Adjust fstab script with valid data+ vscode update

This commit is contained in:
Krizsán Péter 2024-11-09 20:08:10 +01:00
parent 79ae9a6451
commit 1512c07ec2
3 changed files with 43 additions and 3 deletions

View File

@ -43,4 +43,4 @@ grep -qF sdl2-image-version ../blfs_root/blfs-xml/packages.ent || echo '<!ENTITY
# Add VSCode
cp -fv xsoft/other/vscode.xml ../blfs_root/blfs-xml/xsoft/other
grep -qF vscode.xml ../blfs_root/blfs-xml/xsoft/other/other.xml || sed -i '/<\/chapter>.*/i <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="vscode.xml"/>' ../blfs_root/blfs-xml/xsoft/other/other.xml
grep -qF vscode-version ../blfs_root/blfs-xml/packages.ent || echo '<!ENTITY vscode-version "1.95.1">' >> ../blfs_root/blfs-xml/packages.ent
grep -qF vscode-version ../blfs_root/blfs-xml/packages.ent || echo '<!ENTITY vscode-version "1.95.2">' >> ../blfs_root/blfs-xml/packages.ent

View File

@ -29,6 +29,37 @@ patchKernelVersion()
fi
}
# Function that createst an fstab based on the incoming folder
createFstab()
{
# Get mount info from lsblk output
LSBLK_INFO=$(lsblk -l -o MOUNTPOINT,PATH,NAME,PKNAME,UUID,FSTYPE,PTTYPE | sed "/^ /d")
printf "# Begin /etc/fstab\n\n"
printf '%-41s %-11s %-4s %-16s %-4s %-10s\n' "# File system (UUID)" "mount-point" "type" "options" "dump" "fsck"
printf '#%100s\n\n' "order"
# Find the root mount point
DIR_ROOT=$(grep "^/ " <<< "$LSBLK_INFO")
if [ -n "$DIR_ROOT" ] ; then
printf '%-41s %-11s %-4s %-16s %-4s %-10s\n' "UUID=$(awk '{print $5}' <<< "$DIR_ROOT")" / "$(awk '{print $6}' <<< "$DIR_ROOT")" defaults 1 1
fi
# Find if there is a separate boot drive
DIR_BOOT=$(grep "^/boot " <<< "$LSBLK_INFO")
if [ -n "$DIR_BOOT" ] ; then
printf '%-41s %-11s %-4s %-16s %-4s %-10s\n' "UUID=$(awk '{print $5}' <<< "$DIR_BOOT")" /boot "$(awk '{print $6}' <<< "$DIR_BOOT")" noauto,defaults 0 0
fi
# Find if there is a swap partition
DIR_SWAP=$(grep "^\[SWAP\] " <<< "$LSBLK_INFO")
if [ -n "$DIR_SWAP" ] ; then
printf '%-41s %-11s %-4s %-16s %-4s %-10s\n' "UUID=$(awk '{print $5}' <<< "$DIR_SWAP")" swap "$(awk '{print $6}' <<< "$DIR_SWAP")" pri=1 0 0
fi
printf "\n# End /etc/fstab\n"
}
# Check if the lfs mount point folder is specified as the first argument
if [ -z "$1" ]
then
@ -164,6 +195,8 @@ cp -iv lfs_configs/configuration "$DIR_SETUP/"
echo Patching setup configuration file...
FILE_CFG="$DIR_SETUP/configuration"
sed -i -E "\@BUILDDIR=\"xxx\"@s@xxx@$1@g" "$FILE_CFG"
#sed -i -E "\@FSTAB=\"xxx\"@s@xxx@/home/$U/fstab@g" "$FILE_CFG"
sed -i -E "/^FSTAB=/s/^/#/g" "$FILE_CFG"
sed -i -E "\@FSTAB=\"xxx\"@s@xxx@/home/$U/fstab@g" "$FILE_CFG"
sed -i -E "\@CONFIG=\"xxx\"@s@xxx@/home/$U/config-$LATEST_KERNEL_VER@g" "$FILE_CFG"
sed -i -E "\@KEYMAP=\"xxx\"@s@xxx@$(localectl | grep Keymap | awk -F' ' '{printf $NF}')@g" "$FILE_CFG"
@ -195,6 +228,13 @@ if [ -n "$NET_SCRIPT" ] ; then
fi
fi
# Patch fstab script
FSTAB_SCRIPT=$(find "$DIR_COMMANDS" -type f -iname "*-fstab")
if [ -n "$FSTAB_SCRIPT" ] ; then
sed -i '/^cat /,/^EOF/{/^cat /!{/^EOF/!d}}' "$FSTAB_SCRIPT"
sed -i "/^cat /a $(createFstab | sed '$!s/$/\\/')/" "$FSTAB_SCRIPT"
fi
# Patch LFS kernel script to keep build folder and add new user
KERNEL_SCRIPT=$(find "$DIR_COMMANDS" -type f -iname "*-kernel")
sed -i "/^rm -rf \$PKGDIR/s/^/#/" "$KERNEL_SCRIPT"

View File

@ -4,9 +4,9 @@
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY vscode-download-http "https://codeload.github.com/microsoft/vscode/tar.gz/refs/tags/1.95.1">
<!ENTITY vscode-download-http "https://codeload.github.com/microsoft/vscode/tar.gz/refs/tags/1.95.2">
<!ENTITY vscode-download-ftp " ">
<!ENTITY vscode-md5sum "4db63724a16f2c4b9dc2fe7b6a38d6c7">
<!ENTITY vscode-md5sum "c2dfe6a14c9aa1536c7c9cd77800355f">
<!ENTITY vscode-size "4.6 MB">
<!ENTITY vscode-buildsize "500 MB">
<!ENTITY vscode-time "2 SBU (using parallelism=4)">