Run tune2fs during initramfs instead of image install (#10536)

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 16:24:13 -07:00 committed by GitHub
parent da43edcf3e
commit 12ebe3ffa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 2 additions and 24 deletions

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

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

View File

@ -139,11 +139,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

@ -139,11 +139,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

@ -477,9 +477,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"
@ -512,20 +509,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