commit 553f722
chld
·
2025-12-20 20:29:03 +0000 UTC
parent 0e59ab5
get rid of all hardcoding
5 files changed,
+29,
-24
+12,
-11
1@@ -6,7 +6,8 @@
2 # remove all except: kiss, musl, curl
3 # kiss will be removed after bootstrapping apk
4
5-sh ./util/kiss-mount /mnt
6+sh ./util/kiss-mount $m
7+
8 _inc '
9 rm -f /var/db/kiss/installed/kiss/depends
10 kiss r b3sum
11@@ -17,28 +18,28 @@ _inc '
12 kiss r baselayout
13 '
14
15-ls /mnt/var/db/kiss/installed # wooh
16+ls $m/var/db/kiss/installed # wooh
17
18 # now, lets remove all traces of KISS from /mnt
19-rm -rf /mnt/var/db/kiss/
20-rm -rf /mnt/bin/kiss-* /mnt/bin/kiss
21+rm -rf $m/var/db/kiss/
22+rm -rf $m/bin/kiss-* $m/bin/kiss
23
24 # now actually bootstrapping apk stage
25 # from https://wiki.alpinelinux.org/wiki/Bootstrapping_Alpine_Linux
26
27 wget \
28 https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.6/x86_64/apk.static \
29- -O /mnt/bin/apk # static apk ez
30+ -O $m/bin/apk # static apk ez
31
32 chmod 755 /mnt/bin/apk # executable apk
33-/mnt/bin/apk --arch $(arch) -X https://dl-cdn.alpinelinux.org/alpine/latest-stable/main/ -U --allow-untrusted --root /mnt/ --initdb add alpine-keys
34+$m/bin/apk --arch $(arch) -X https://dl-cdn.alpinelinux.org/alpine/latest-stable/main/ -U --allow-untrusted --root $m --initdb add alpine-keys
35
36 # add apk repositories
37-mkdir -p /mnt/etc/
38-mkdir -p /mnt/etc/apk
39-cp ./rootfs/repositories /mnt/etc/apk/repositories
40-ls /mnt/lib/apk
41-ls /mnt/lib/apk/db
42+mkdir -p $m/etc/
43+mkdir -p $m/etc/apk
44+cp ./rootfs/repositories $m/etc/apk/repositories
45+ls $m/lib/apk
46+ls $m/lib/apk/db
47
48 # check for internet
49 #_inc '
R setup-mwakat =>
setup-distro
+3,
-1
1@@ -1,8 +1,10 @@
2 #!/bin/sh -e
3
4+. /util/lib.sh
5+
6 set -x
7 # unmount /mnt
8-sh ./util/kiss-mount /mnt .
9+sh ./util/kiss-mount $m .
10
11 sh ./setup-rootfs
12 sh ./setup-userland
+7,
-7
1@@ -1,22 +1,22 @@
2 #!/bin/sh -eu
3 . ./util/lib.sh # source functions
4
5-echo "WARNING: $0 assumes you have rootfs mounted @ /mnt!"
6+echo "WARNING: $0 assumes you have rootfs mounted @ ${m}!"
7 set -x
8
9-rm -rf /mnt/*
10+rm -rf $m/*
11 wget \
12 https://codeberg.org/kiss-community/repo/releases/download/24.12.18/kiss-chroot-24.12.18.tar.xz \
13 -O kiss.tar.xz
14
15-tar -xvf kiss.tar.xz -C /mnt
16+tar -xvf kiss.tar.xz -C $m
17
18 # mwakatize the rootfs
19-rm -f /mnt/etc/fstab
20+rm -f $m/etc/fstab
21 # swap out KISS os-release for mwakat
22-rm -f /mnt/etc/os-release
23-cp ./rootfs/os-release /mnt/etc/os-release
24+rm -f $m/etc/os-release
25+cp ./rootfs/os-release $m/etc/os-release
26
27-rm -f /mnt/etc/mdev.conf # change later?
28+rm -f $m/etc/mdev.conf # change later?
29
30 #sh util/kiss-mount /mnt
+4,
-4
1@@ -9,8 +9,8 @@ set -x
2 # lets setup situation init
3 wget \
4 https://codeberg.org/derivelinux/situation/raw/branch/main/situation \
5- -O /mnt/bin/situation
6+ -O $m/bin/situation
7
8-chmod 755 /mnt/bin/situation # make situation a executable or kernel panic
9-ln -sf /mnt/bin/situation /mnt/bin/init # make sure kern knows situation is init
10-ln -sf /mnt/bin/situation /mnt/sbin/init
11+chmod 755 $m/bin/situation # make situation a executable or kernel panic
12+ln -sf $m/bin/situation $m/bin/init # make sure kern knows situation is init
13+ln -sf $m/bin/situation $m/sbin/init
+3,
-1
1@@ -1,5 +1,7 @@
2 #!/bin/sh
3
4+m=${m:-/mnt}
5+
6 _inc() {
7- chroot /mnt /bin/sh -e -c "$*"
8+ chroot $m /bin/sh -e -c "$*"
9 }