server/fickit-pkg/boot/init.sh

33 lines
584 B
Bash
Raw Normal View History

2019-01-17 06:38:47 +00:00
#!/bin/sh
# /proc/cmdline parser (from Gentoo Wiki)
cmdline() {
local value
value=" $(cat /proc/cmdline) "
value="${value##* $1=}"
value="${value%% *}"
[ "$value" != "" ] && echo "$value"
}
2022-06-02 09:40:43 +00:00
modprobe xhci_pci
modprobe ahci
modprobe intel_lpss_pci
modprobe i2c_i801
modprobe megaraid_sas
modprobe tg3
modprobe bnxt_en
2019-01-17 06:38:47 +00:00
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