diff options
author | Sven Gothel <[email protected]> | 2021-07-22 05:16:51 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-07-22 05:16:51 +0200 |
commit | ead70c56506b0f1bb178d780f311735cb2b3a353 (patch) | |
tree | cc7cc5380ad7283a943eb967b0cdc7496f042f40 /scripts/qcow2_handling | |
parent | 5eb3622f38c563ec325695936779caa3cf848c55 (diff) |
Refine boot process of build target and allow config of /boot fstype and mount-options
- Add env-vars BOOT_FSTYPE and BOOT_FSOPTIONS, supporting customizing the boot filesystem type and options
- FAT_CODEPAGE (if using BOOT_FSTYPE vfat, default) is hardcoded '437'
- Add 'lsof', allowing to check open listening ports (besides netstat)
- On Raspi: Use plymouth splash screen for all configurations, theme 'pix'
- Add systemd resize2fs_once.service to have it start very early
to resize the rootfs partition for RW rootfs
- No kernel argument 'rootwait' for initramfs/grub root=file boot
loop_rootfs (initram):
- kill spawn-off pipe copy process (LOOP_ROOTFS_LOG_PIDS)
- Use BOOT_FSTYPE, BOOT_FSOPTIONS (incl mounting /boot)..
- Use dedicated fsck.BOOT_FSTYPE if possible (and quiet)
- Log fsck and mount attempts, failure and success
-
Stage2 01-sys-tweaks fixes:
- Only disable systemd-remount-fs for ROOTFS_RO
- Only generate /boot/loop_rootfs.id for ROOTFS_RO
- Kernel Modules: Add codepage 437 and 850, drm and vc4 (raspi only)
- Use TARGET_ARCH in all situations
- On RW rootfs, grub-install with ext2 module
-
Diffstat (limited to 'scripts/qcow2_handling')
-rw-r--r-- | scripts/qcow2_handling | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/scripts/qcow2_handling b/scripts/qcow2_handling index d757e65..770d074 100644 --- a/scripts/qcow2_handling +++ b/scripts/qcow2_handling @@ -3,6 +3,12 @@ sdir=`dirname $(readlink -f "${BASH_SOURCE[0]}")` rootdir=`dirname $sdir` +# codepage is hardcoded in 'loop_rootfs' and scripts, as well as required by pi-gen build +if [ -z ${FAT_CODEPAGE+x} ]; then + readonly FAT_CODEPAGE="437" + export FAT_CODEPAGE +fi + # QCOW2 Routines export CURRENT_IMAGE @@ -104,7 +110,7 @@ mount_qimage() { fi mount -v -t ext4 $MAP_ROOT_DEV "$2" mkdir -p "$2/boot" - mount -v -t vfat $MAP_BOOT_DEV "$2/boot" + mount -v -t ${BOOT_FSTYPE} $MAP_BOOT_DEV "$2/boot" CURRENT_MOUNTPOINT="$2" } export -f mount_qimage @@ -132,7 +138,7 @@ mount_rawimage() { fi mount -v -t ext4 $MAP_ROOT_DEV "$2" mkdir -p "$2/boot" - mount -v -t vfat $MAP_BOOT_DEV "$2/boot" + mount -v -t ${BOOT_FSTYPE} $MAP_BOOT_DEV "$2/boot" CURRENT_MOUNTPOINT="$2" } export -f mount_rawimage @@ -198,7 +204,25 @@ EOF sync kpartx -a /dev/${NBD_DEV} - mkfs.fat -n BOOT -F 32 -v $MAP_BOOT_DEV + case ${BOOT_FSTYPE} in + xfs) + mkfs.xfs -L BOOT $MAP_BOOT_DEV + ;; + ext4) + mkfs.ext4 -L BOOT -O "^huge_file,^metadata_csum,^64bit" $MAP_BOOT_DEV + ;; + ext2) + mkfs.ext2 -L BOOT -O "^has_journal,^huge_file,^metadata_csum,^64bit" $MAP_BOOT_DEV + ;; + vfat) + mkfs.fat -n BOOT -F 32 --codepage=${FAT_CODEPAGE} -v $MAP_BOOT_DEV + ;; + *) + echo "BOOT_FSTYPE not one of[xfs,ext4,ext2,vfat] but '${BOOT_FSTYPE}'. Exit." + exit 1; + ;; + esac + if [ "${ROOTFS_RO}" = "1" ] ; then # Set reserved-blocks-percentage for root to zero, no journaling mkfs.ext4 -L ROOTFS -m 0 -O "^has_journal,^huge_file,^metadata_csum,^64bit" $MAP_ROOT_DEV @@ -222,7 +246,7 @@ EOF mount -v -t ext4 $MAP_ROOT_DEV "${ROOTFS_DIR}" mkdir -p "${ROOTFS_DIR}/boot" - mount -v -t vfat $MAP_BOOT_DEV "${ROOTFS_DIR}/boot" + mount -v -t ${BOOT_FSTYPE} $MAP_BOOT_DEV "${ROOTFS_DIR}/boot" CURRENT_IMAGE=${WORK_DIR}/image-${STAGE}.qcow2 CURRENT_MOUNTPOINT=${ROOTFS_DIR} popd > /dev/null |