mirror of
https://github.com/elseif/MikroTikPatch.git
synced 2025-01-23 05:25:00 +03: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
17
.github/workflows/mikrotik_patch.yml
vendored
17
.github/workflows/mikrotik_patch.yml
vendored
@ -41,6 +41,10 @@ jobs:
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '>=1.17.0'
|
||||
|
||||
- name: Cache Squashfs
|
||||
id: cache-squashfs
|
||||
uses: actions/cache@v4
|
||||
@ -53,13 +57,14 @@ jobs:
|
||||
- name: Create Squashfs for option and python3
|
||||
if: steps.cache-squashfs.outputs.cache-hit != 'true'
|
||||
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 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)
|
||||
for cmd in $COMMANDS; do
|
||||
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…
Reference in New Issue
Block a user