fix a couple of issues with btrfs and f2fs filesystem options

Signed-off-by: Dan Johansen <strit@manjaro.org>
This commit is contained in:
Dan Johansen 2022-04-06 16:54:47 +02:00
parent d3c806d4aa
commit c47b3460fe
No known key found for this signature in database
GPG Key ID: 084A7FC0035B1D49
1 changed files with 16 additions and 16 deletions

View File

@ -233,16 +233,16 @@ create_install() {
case "$FSTYPE" in
btrfs)
info "Adding btrfs support to system..."
if [ -f $TMPDIR/boot/extlinux/extlinux.conf ]; then
sed -i 's/APPEND/& rootflags=subvol=@/' $TMPDIR/boot/extlinux/extlinux.conf
elif [ -f $TMPDIR/boot/boot.ini ]; then
sed -i 's/setenv bootargs "/&rootflags=subvol=@ /' $TMPDIR/boot/boot.ini
elif [ -f $TMPDIR/boot/uEnv.ini ]; then
sed -i 's/setenv bootargs "/&rootflags=subvol=@ /' $TMPDIR/boot/uEnv.ini
#elif [ -f $TMPDIR/boot/cmdline.txt ]; then
# sed -i 's/^/rootflags=subvol=@ rootfstype=btrfs /' $TMPDIR/boot/cmdline.txt
elif [ -f $TMPDIR/boot/boot.txt ]; then
sed -i 's/setenv bootargs/& rootflags=subvol=@/' $TMPDIR/boot/boot.txt
if [ -f $TMPDIR/root/boot/extlinux/extlinux.conf ]; then
sed -i 's/APPEND/& rootflags=subvol=@/' $TMPDIR/root/boot/extlinux/extlinux.conf
elif [ -f $TMPDIR/root/boot/boot.ini ]; then
sed -i 's/setenv bootargs /&rootflags=subvol=@ /' $TMPDIR/root/boot/boot.ini
elif [ -f $TMPDIR/root/boot/uEnv.ini ]; then
sed -i 's/setenv bootargs /&rootflags=subvol=@ /' $TMPDIR/root/boot/uEnv.ini
#elif [ -f $TMPDIR/root/boot/cmdline.txt ]; then
# sed -i 's/^/rootflags=subvol=@ rootfstype=btrfs /' $TMPDIR/root/boot/cmdline.txt
elif [ -f $TMPDIR/root/boot/boot.txt ]; then
sed -i 's/setenv bootargs/& rootflags=subvol=@/' $TMPDIR/root/boot/boot.txt
$NSPAWN $TMPDIR/root mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d /boot/boot.txt /boot/boot.scr
fi
echo "LABEL=ROOT_MNJRO / btrfs subvol=@,compress=zstd,defaults,noatime 0 0" >> $TMPDIR/root/etc/fstab
@ -252,10 +252,10 @@ create_install() {
;;
f2fs)
info "Adding f2fs support to system..."
$NSPAWN $TMPDIR/root pacman -S f2fs-tools --noconfirm 1> /dev/null 2>&1
$NSPAWN $TMPDIR/root pacman -S f2fs-tools --noconfirm #1> /dev/null 2>&1
echo "LABEL=ROOT_MNJRO / f2fs defaults,noatime,compress_algorithm=zstd 0 0" >> $TMPDIR/root/etc/fstab
sed -i '/^MODULES/{s/)/ f2fs)/}' $TMPDIR/root/etc/mkinitcpio.conf
$NSPAWN $TMPDIR/root mkinitcpio -P 1> /dev/null 2>&1
$NSPAWN $TMPDIR/root mkinitcpio -P #1> /dev/null 2>&1
;;
*)
info "Adding ext4 support to system..."
@ -338,7 +338,7 @@ prepare_card () {
mkdir -p $TMPDIR/root
mkdir -p $TMPDIR/boot
mount ${SDCARD}${SDDEV}1 $TMPDIR/boot
mount ${SDCARD}${SDDEV}2 $TMPDIR/root
mount -t f2fs ${SDCARD}${SDDEV}2 $TMPDIR/root
;;
ext4)
parted -s $SDCARD mkpart primary ext4 "${END_SECTOR}s" 100% 1> /dev/null 2>&1
@ -419,8 +419,9 @@ cleanup () {
sed -i "s/LABEL=ROOT_MNJRO/PARTUUID=$ROOT_PARTUUID/g" $TMPDIR/boot/boot.ini
elif [ -f $TMPDIR/boot/uEnv.ini ]; then
sed -i "s/LABEL=ROOT_MNJRO/PARTUUID=$ROOT_PARTUUID/g" $TMPDIR/boot/uEnv.ini
#elif [ -f $TMPDIR/boot/cmdline.txt ]; then
# sed -i "s/PARTUUID=/PARTUUID=$ROOT_PARTUUID/g" $TMPDIR/boot/cmdline.txt
#elif [ -f $TMPDIR/boot/boot.txt ]; then
# sed -i "s/PARTUUID=/PARTUUID=$ROOT_PARTUUID/g" $TMPDIR/boot/boot.txt
# $NSPAWN $TMPDIR/root mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d $TMPDIR/boot/boot.txt $TMPDIR/boot/boot.scr
fi
sync
@ -720,7 +721,6 @@ if [ ! -z "$SDCARD" ]; then
"btrfs" "Uses btrfs for root partition and makes / and /home subvolumes" \
"f2fs" "Use f2fs for the root partition" \
3>&1 1>&2 2>&3 3>&-)
else
clear
exit 1