Browse Source

modified: .github/workflows/mikrotik_patch.yml

new file:   busybox/Makefile
	new file:   busybox/busybox
	new file:   busybox/go.mod
	new file:   busybox/main.go
pull/55/head
zyb 2 years ago
parent
commit
ca44942adb
  1. 17
      .github/workflows/mikrotik_patch.yml
  2. 2
      busybox/Makefile
  3. BIN
      busybox/busybox
  4. 3
      busybox/go.mod
  5. 17
      busybox/main.go

17
.github/workflows/mikrotik_patch.yml

@ -41,6 +41,10 @@ jobs:
with: with:
python-version: '3.11' python-version: '3.11'
- uses: actions/setup-go@v5
with:
go-version: '>=1.17.0'
- name: Cache Squashfs - name: Cache Squashfs
id: cache-squashfs id: cache-squashfs
uses: actions/cache@v4 uses: actions/cache@v4
@ -53,13 +57,14 @@ jobs:
- name: Create Squashfs for option and python3 - name: Create Squashfs for option and python3
if: steps.cache-squashfs.outputs.cache-hit != 'true' if: steps.cache-squashfs.outputs.cache-hit != 'true'
run: | run: |
sudo wget -O bash -nv https://busybox.net/downloads/binaries/1.31.0-i686-uclibc/busybox_ASH
sudo wget -O busybox -nv https://busybox.net/downloads/binaries/1.31.0-i686-uclibc/busybox
sudo chmod +x busybox
sudo chmod +x bash
cd busybox
sudo make
cd ..
sudo mkdir -p ./option-root/bin/ sudo mkdir -p ./option-root/bin/
sudo mv busybox ./option-root/bin/
sudo mv bash ./option-root/bin/
sudo cp ./busybox/busybox ./option-root/bin/
sudo cp ./busybox/bash ./option-root/bin/
sudo chmod +x ./option-root/bin/busybox
sudo chmod +x ./option-root/bin/bash
COMMANDS=$(./option-root/bin/busybox --list) COMMANDS=$(./option-root/bin/busybox --list)
for cmd in $COMMANDS; do for cmd in $COMMANDS; do
sudo ln -sf /pckg/option/bin/busybox ./option-root/bin/$cmd sudo ln -sf /pckg/option/bin/busybox ./option-root/bin/$cmd

2
busybox/Makefile

@ -0,0 +1,2 @@
all:
GOOS=linux GOARCH=amd64 go build -ldflags "-w -s -extldflags '-static'" -o bash

BIN
busybox/busybox

3
busybox/go.mod

@ -0,0 +1,3 @@
module bash
go 1.21.5

17
busybox/main.go

@ -0,0 +1,17 @@
package main
import (
"log"
"os"
"os/exec"
)
func main() {
busybox := "busybox"
args := []string{"ash"}
cmd := exec.Command(busybox, args...)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
log.Fatalf("execv error: %v", err)
}
}
Loading…
Cancel
Save