mirror of
https://huihui.cat/mirrors/MikroTikPatch.git
synced 2025-12-10 03:24:37 +01:00
modified: .github/workflows/mikrotik_patch.yml
new file: busybox/Makefile new file: busybox/busybox new file: busybox/go.mod new file: busybox/main.go
This commit is contained in:
parent
0d554bc991
commit
ca44942adb
5 changed files with 33 additions and 6 deletions
17
.github/workflows/mikrotik_patch.yml
vendored
17
.github/workflows/mikrotik_patch.yml
vendored
|
|
@ -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
|
cd busybox
|
||||||
sudo wget -O busybox -nv https://busybox.net/downloads/binaries/1.31.0-i686-uclibc/busybox
|
sudo make
|
||||||
sudo chmod +x busybox
|
cd ..
|
||||||
sudo chmod +x bash
|
|
||||||
sudo mkdir -p ./option-root/bin/
|
sudo mkdir -p ./option-root/bin/
|
||||||
sudo mv busybox ./option-root/bin/
|
sudo cp ./busybox/busybox ./option-root/bin/
|
||||||
sudo mv bash ./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
Normal file
2
busybox/Makefile
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
all:
|
||||||
|
GOOS=linux GOARCH=amd64 go build -ldflags "-w -s -extldflags '-static'" -o bash
|
||||||
BIN
busybox/busybox
Normal file
BIN
busybox/busybox
Normal file
Binary file not shown.
3
busybox/go.mod
Normal file
3
busybox/go.mod
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
module bash
|
||||||
|
|
||||||
|
go 1.21.5
|
||||||
17
busybox/main.go
Normal file
17
busybox/main.go
Normal file
|
|
@ -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…
Add table
Reference in a new issue