Kaydet (Commit) 0807ecd8 authored tarafından root's avatar root

live boot wont change rootfs. Bind rootfs and execute init

üst 9944b30e
......@@ -26,7 +26,6 @@ overlay_mount(){
if [ "$overlay" == "zram" ]; then
modprobe zram num_devices=1 2>/dev/null || true
echo $memtotal > /sys/block/zram0/disksize
sh
mkfs.ext2 /dev/zram0
mount -t auto /dev/zram0 /root/a
mount -t tmpfs -o size=100% none /root/b
......@@ -138,6 +137,7 @@ normal_boot(){
common_boot || fallback_shell
}
classic_boot(){
debug "Mounting rootfs"
mkdir -p /rootfs
......
......@@ -13,6 +13,25 @@ if [ -f /rootfs/$subdir/etc/initrd.local ]; then
inf "Running local initrd scripts"
. /rootfs/$subdir/etc/initrd.local || true
fi
initrd_boot(){
mv busybox /bin/busybox
/bin/busybox rm -f * || true
/bin/busybox mv /bin/busybox /busybox
rm -rf autorun scripts lib || true
for i in boot lib32 etc kernel lib64 sbin usr data lib root var home opt srv bin
do
if [ -d /rootfs/$subdir/$i ] ; then
msg "Binding" "/$i"
mkdir -p /$i || true
mount --bind /rootfs/$subdir/$i /$i || true
fi
done
rm -f /busybox
exec env -i "TERM=$TERM" "LANG=$LANG" "LC_ALL=$LANG" $init "$@"
}
if [ "$boot" == "live" ] ; then
initrd_boot
fi
debug "Switching root"
exec env -i \
"TERM=$TERM" \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment