fickit: include local pkg

This commit is contained in:
nemunaire 2019-01-17 07:38:47 +01:00
commit 5d644fa366
17 changed files with 404 additions and 0 deletions

View file

@ -0,0 +1,3 @@
FROM alpine:latest
COPY init.sh /init

View file

@ -0,0 +1 @@
image: boot

24
fickit-pkg/boot/init.sh Executable file
View file

@ -0,0 +1,24 @@
#!/bin/sh
# /proc/cmdline parser (from Gentoo Wiki)
cmdline() {
local value
value=" $(cat /proc/cmdline) "
value="${value##* $1=}"
value="${value%% *}"
[ "$value" != "" ] && echo "$value"
}
mount -t devtmpfs none /dev
mount -t proc none /proc
mount -o ro /dev/sda1 /boot
mount -o loop -t squashfs /boot/imgs/$(cmdline root) /mnt || /bin/sh
umount /dev
umount /proc
mount --move /boot /mnt/boot
# Switch
exec switch_root /mnt /init