Improved comments.
This commit is contained in:
parent
a65281ac48
commit
0bb0ff98fc
@ -69,19 +69,26 @@ mkdir /mnt/proc
|
|||||||
mkdir /mnt/tmp
|
mkdir /mnt/tmp
|
||||||
|
|
||||||
# Move all crytical file systems in the new mountpoint.
|
# Move all crytical file systems in the new mountpoint.
|
||||||
|
echo "Remounting /dev, /sys, /tmp and /proc in /mnt..."
|
||||||
mount --move /dev /mnt/dev
|
mount --move /dev /mnt/dev
|
||||||
mount --move /sys /mnt/sys
|
mount --move /sys /mnt/sys
|
||||||
mount --move /tmp /mnt/tmp
|
mount --move /tmp /mnt/tmp
|
||||||
mount --move /proc /mnt/proc
|
mount --move /proc /mnt/proc
|
||||||
|
echo "...done."
|
||||||
|
|
||||||
# Copy all root folders in the new mountpoint.
|
# Copy all root folders in the new mountpoint.
|
||||||
|
echo "Moving the rest of the root file system to /mnt..."
|
||||||
cp -a bin etc lib lib64 root sbin src usr /mnt
|
cp -a bin etc lib lib64 root sbin src usr /mnt
|
||||||
|
echo "...done."
|
||||||
|
|
||||||
# The new mountpoint becomes file system root. All original root folders are
|
# The new mountpoint becomes file system root. All original root folders are
|
||||||
# deleted automatically as part of the command execution. The '/sbin/init'
|
# deleted automatically as part of the command execution. The '/sbin/init'
|
||||||
# process is invoked and it becomes the new PID 1 parent process.
|
# process is invoked and it becomes the new PID 1 parent process.
|
||||||
exec switch_root /mnt/ /sbin/init
|
exec switch_root /mnt/ /sbin/init
|
||||||
|
|
||||||
|
echo "You can never see this... unless there is a serious bug..."
|
||||||
|
sleep 99999
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
chmod +x switch.sh
|
chmod +x switch.sh
|
||||||
@ -93,7 +100,7 @@ chmod +x switch.sh
|
|||||||
cat > bootscript.sh << EOF
|
cat > bootscript.sh << EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "Welcome to \"Minimal Linbux Live\" (/sbin/init)"
|
echo "Welcome to \"Minimal Linux Live\" (/sbin/init)"
|
||||||
|
|
||||||
for DEVICE in /sys/class/net/* ; do
|
for DEVICE in /sys/class/net/* ; do
|
||||||
echo "Found network device \${DEVICE##*/}"
|
echo "Found network device \${DEVICE##*/}"
|
||||||
@ -173,7 +180,7 @@ cd ..
|
|||||||
cat > init << EOF
|
cat > init << EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "Welcome to \"Minimal Linbux Live\" (/init)"
|
echo "Welcome to \"Minimal Linux Live\" (/init)"
|
||||||
|
|
||||||
# Let's mount all core file systems.
|
# Let's mount all core file systems.
|
||||||
/etc/prepare.sh
|
/etc/prepare.sh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user