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:
parent
da43edcf3e
commit
12ebe3ffa0
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user