mount /boot just before kernel build

This commit is contained in:
YellowJacketLinux 2024-10-13 07:02:09 -07:00
parent 5b07c352bd
commit bd6449e60e
3 changed files with 19 additions and 13 deletions

View File

@ -27,9 +27,9 @@ else
# UUID/File System mount-point type options dump fsck # UUID/File System mount-point type options dump fsck
# order # order
UUID=add2119a-1a46-4c72-b212-863ee869ebd1 / ext4 defaults,noatime 1 1 UUID=add2119a-1a46-4c72-b212-863ee869ebd1 / ext4 defaults,noatime 1 1
UUID=fed06a3d-5504-44ae-8b7d-c7357e7bad10 /mnt/newlfs ext4 defaults,noatime 1 2 #UUID=fed06a3d-5504-44ae-8b7d-c7357e7bad10 /mnt/newlfs ext4 defaults,noatime 1 2
UUID=2322f8e6-1d3d-43ee-becf-67417a46e124 /mnt/newlfs/boot ext2 defaults,noauto 1 2 #UUID=2322f8e6-1d3d-43ee-becf-67417a46e124 /mnt/newlfs/boot ext2 defaults,noauto 1 2
UUID=a36492d9-de00-4c51-9649-cd5b5004f790 swap swap defaults 0 0 UUID=a36492d9-de00-4c51-9649-cd5b5004f790 swap swap defaults 0 0
EOF EOF
fi fi

View File

@ -1,5 +1,17 @@
#!/bin/bash #!/bin/bash
# if booted from flash drive and building for system install...
if [ ! -f /USBFlash ]; then
echo "Mounting existing /boot"
[ ! -d /boot ] && mkdir /boot
mount /boot
if [ $? -ne 0 ]; then
echo "failed to mount /boot"
exit 1
fi
fi
source versions.sh source versions.sh
GLSOURCES="/sources" GLSOURCES="/sources"
@ -49,6 +61,9 @@ rm -rf linux-${linux_lts_version}
if [ ! -f /USBFlash ]; then if [ ! -f /USBFlash ]; then
echo "Manually update the /boot/grub/grub.cfg file." echo "Manually update the /boot/grub/grub.cfg file."
echo "In theory, you can shut down, remove the thumb drive, and boot!" echo "In theory, you can shut down, remove the thumb drive, and boot!"
echo
echo "of course if it is a virgin /boot and this is first OS being installed"
echo "on it, you have to run grub-install /dev/whatever first."
exit 0 exit 0
fi fi
@ -67,7 +82,7 @@ EOF
echo "#USB Flash Grub" >> /boot/grub/grub.cfg echo "#USB Flash Grub" >> /boot/grub/grub.cfg
echo "" >> /boot/grub/grub.cfg echo "" >> /boot/grub/grub.cfg
echo "menuentry \"GNU/Linux, Linux ${KVSTRING}\" {" \ echo "menuentry \"USB Flash GNU/Linux, Linux ${KVSTRING}\" {" \
>> /boot/grub/grub.cfg >> /boot/grub/grub.cfg
echo " linux /boot/vmlinuz-${KVSTRING} root=PARTUUID=8d5d11ba-01 ro" \ echo " linux /boot/vmlinuz-${KVSTRING} root=PARTUUID=8d5d11ba-01 ro" \
>> /boot/grub/grub.cfg >> /boot/grub/grub.cfg

View File

@ -17,13 +17,4 @@ if [ ! -f ${LFS}/USBFlash ]; then
cp /home/lfs/lfs-sources.tar ${LFS}/home/lfs/ cp /home/lfs/lfs-sources.tar ${LFS}/home/lfs/
cp -ar /home/lfs/lfs-buildscripts ${LFS}/home/lfs/ cp -ar /home/lfs/lfs-buildscripts ${LFS}/home/lfs/
touch ${LFS}/USBFlash touch ${LFS}/USBFlash
else
echo "Mounting existing /boot"
#uncomment below before final build
# [ ! -d /mnt/newlfs/boot ] && mkdir /mnt/newlfs/boot
# mount /mnt/newlfs/boot
# if [ $? -ne 0 ]; then
# echo "failed to mount /mnt/newlfs/boot"
# exit 1
# fi
fi fi