[202012] Run tune2fs during initramfs instead of image install ()

If it is run during image install, it's not guaranteed that the
installation environment will have tune2fs available. Therefore, run it
during initramfs instead.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
This commit is contained in:
Saikrishna Arcot 2022-04-12 19:59:24 -07:00 committed by GitHub
parent 6e17ef311a
commit 29b6f62902
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 2 additions and 24 deletions
files
Aboot
initramfs-tools
installer

View File

@ -355,9 +355,6 @@ extract_image() {
local rootdev="$(echo $mountstr | cut -f1 -d' ')"
rootfs_type="$(echo $mountstr | cut -d' ' -f3)"
## Don't reserve any blocks just for root
tune2fs -m 0 -r 0 $rootdev
info "Extracting $dockerfs from swi"
## Unpacking dockerfs delayed
## 1. when disk is vfat as it does not support symbolic link

View File

@ -21,6 +21,7 @@ copy_exec /usr/sbin/mke2fs /usr/local/sbin/
copy_exec /sbin/sfdisk
copy_exec /sbin/fdisk
copy_exec /sbin/resize2fs
copy_exec /sbin/tune2fs
copy_exec /sbin/findfs
fstypes="ext4 ext3"

View File

@ -129,6 +129,7 @@ case "${ROOT}" in
*)
## Mount the raw partition again
mount ${ROOT} ${rootmnt}/host
tune2fs -m 0 -r 0 ${ROOT}
;;
esac

View File

@ -117,11 +117,6 @@ elif [ "$install_env" = "sonic" ]; then
rm -rf $f
fi
done
demo_dev=$(findmnt -n -o SOURCE --target /host)
# Don't reserve any blocks just for root
tune2fs -m 0 -r 0 $demo_dev
fi
# Create target directory or clean it up if exists

View File

@ -117,11 +117,6 @@ elif [ "$install_env" = "sonic" ]; then
rm -rf $f
fi
done
demo_dev=$(findmnt -n -o SOURCE --target /host)
# Don't reserve any blocks just for root
tune2fs -m 0 -r 0 $demo_dev
fi
# Create target directory or clean it up if exists

View File

@ -434,9 +434,6 @@ if [ "$install_env" = "onie" ]; then
# Make filesystem
mkfs.ext4 -L $demo_volume_label $demo_dev
# Don't reserve any blocks just for root
tune2fs -m 0 -r 0 $demo_dev
# Mount demo filesystem
demo_mnt=$(${onie_bin} mktemp -d) || {
echo "Error: Unable to create file system mount point"
@ -469,20 +466,12 @@ elif [ "$install_env" = "sonic" ]; then
rm -rf $f
fi
done
demo_dev=$(findmnt -n -o SOURCE --target /host)
# Don't reserve any blocks just for root
tune2fs -m 0 -r 0 $demo_dev
else
demo_mnt="build_raw_image_mnt"
demo_dev=$cur_wd/"%%OUTPUT_RAW_IMAGE%%"
mkfs.ext4 -L $demo_volume_label $demo_dev
# Don't reserve any blocks just for root
tune2fs -m 0 -r 0 $demo_dev
echo "Mounting $demo_dev on $demo_mnt..."
mkdir $demo_mnt
mount -t auto -o loop $demo_dev $demo_mnt