commit a2e3d3f
chld
·
2026-09-21 20:07:51 +0000 UTC
parent dc47000
fix symlink issues
3 files changed,
+42,
-35
+11,
-17
1@@ -3,23 +3,6 @@
2
3 #set -x
4
5-# now actually bootstrapping apk stage
6-# from https://wiki.alpinelinux.org/wiki/Bootstrapping_Alpine_Linux
7-
8-wget \
9- https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.6/x86_64/apk.static \
10- -O $m/bin/apk # static apk ez
11-
12-chmod 755 $m/bin/apk # executable apk
13-$m/bin/apk --arch $(arch) -X https://dl-cdn.alpinelinux.org/alpine/latest-stable/main/ -U --allow-untrusted --root $m/ --initdb add alpine-keys
14-
15-# add apk repositories
16-mkdir -p $m/etc/
17-mkdir -p $m/etc/apk
18-printf "https://dl-cdn.alpinelinux.org/alpine/latest-stable/main\nhttps://dl-cdn.alpinelinux.org/alpine/latest-stable/community" > $m/etc/apk/repositories
19-ls $m/lib/apk
20-ls $m/lib/apk/db
21-
22 # sync repositories
23 _inc '
24 apk --arch $(arch) --root / --allow-untrusted update
25@@ -49,3 +32,14 @@ _inc '
26 apk add libbz2 libcrypto3
27 apk del libbz2 libcrypto3
28 '
29+
30+# now busybox is out of the way, make init symlinks
31+
32+for i in bin sbin
33+do
34+ ln -sf $m/bin/sit $m/$i/init
35+done
36+for i in poweroff halt
37+do
38+ ln -sf $m/bin/reboot $m/bin/$i
39+done
+17,
-9
1@@ -22,15 +22,6 @@ do
2 done
3 rm -rf ./srudge/
4
5-for i in bin sbin
6-do
7- ln -sf $m/bin/sit $m/$i/init
8-done
9-for i in poweroff halt
10-do
11- ln -sf $m/bin/reboot $m/bin/$i
12-done
13-
14 # mwakatizing the rootfs
15 rm -f $m/etc/*tab # situation doesnt use tables, it is not sysv-ish
16 rm -f $m/etc/issue
17@@ -52,6 +43,23 @@ mkdir -p $m/usr
18 mkdir $m/usr/src
19 cp ./rootfs/no-perl.patch $m/usr/src/no-perl.patch
20
21+# enter apk to fix symlink errors
22+wget \
23+ https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.6/x86_64/apk.static \
24+ -O $m/bin/apk # static apk ez
25+
26+chmod 755 $m/bin/apk # executable apk
27+$m/bin/apk --arch $(arch) -X https://dl-cdn.alpinelinux.org/alpine/latest-stable/main/ -U --allow-untrusted --root $m/ --initdb add alpine-keys
28+
29+# add apk repositories
30+mkdir -p $m/etc/
31+mkdir -p $m/etc/apk
32+printf "https://dl-cdn.alpinelinux.org/alpine/latest-stable/main\nhttps://dl-cdn.alpinelinux.org/alpine/latest-stable/community\n" > $m/etc/apk/repositories
33+ls $m/lib/apk
34+ls $m/lib/apk/db
35+
36+$m/bin/apk --root $m --allow-untrusted add busybox
37+
38 # remove all except: kiss, musl, curl
39 # kiss will be removed after bootstrapping apk
40
+14,
-9
1@@ -20,12 +20,17 @@ wget \
2 chmod 755 $m/bin/toybox # ensure toybox is a executable
3
4 # linking!!
5-for i in ls mv cp rm mkdir ln unlink rmdir; do _swt toybox $i ; done
6-for i in tee touch cat find; do _swt toybox $i ; done
7-for i in chmod chown; do _swt toybox $i ; done
8-for i in reboot poweroff halt; do _swt toybox $i ; done
9-for i in dmesg sysctl top lsmod; do _swt toybox $i ; done
10-for i in login tty; do _swt toybox $i ; done
11-for i in free du df; do _swt toybox $i ; done
12-for i in kill killall killall5 pkill; do _swt toybox $i ; done
13-for i in time date; do _swt toybox $i ; done
14+for i in sh env
15+do
16+ ln -sf busybox $m/bin/$i
17+ ln -sf busybox $m/usr/bin/$i
18+done
19+for i in ls mv cp rm mkdir ln unlink \
20+ rmdir tee touch cat find chmod \
21+ chown dmesg \
22+ sysctl top lsmod login tty free \
23+ du df kill killall killall5 pkill time date
24+do
25+ ln -sf toybox $m/bin/$i
26+ ln -sf toybox $m/usr/bin/$i
27+done