From 73200ac89212a3bd694bf38c892f0159dd02b0cd Mon Sep 17 00:00:00 2001 From: PartialVolume <22084881+PartialVolume@users.noreply.github.com> Date: Sat, 17 Jan 2026 00:59:46 +0000 Subject: [PATCH] Modified make_img_file.sh so that the vfat partition size is dynamically calculated based on the bzImage size plus an arbitary 20MB added to accommodate the extra files including PDF reports and logs. --- board/shredos/genimage_i586.cfg | 2 +- board/shredos/make_img_file.sh | 25 +++++++++++++++++++++++++ configs/shredos_i686_lite_defconfig | 1 + 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/board/shredos/genimage_i586.cfg b/board/shredos/genimage_i586.cfg index 9827beb8cd..5b96b324cd 100644 --- a/board/shredos/genimage_i586.cfg +++ b/board/shredos/genimage_i586.cfg @@ -12,7 +12,7 @@ image boot.vfat { file autorun.inf { image = 'autorun.inf' } } - size = 380000000 +size = 74137344 } image shredos.img { diff --git a/board/shredos/make_img_file.sh b/board/shredos/make_img_file.sh index 7f435d66c8..2554a3e341 100755 --- a/board/shredos/make_img_file.sh +++ b/board/shredos/make_img_file.sh @@ -23,6 +23,31 @@ cp "board/shredos/shredos.ico" "${BINARIES_DIR}/shredos.ico" # version.txt is used to help identify the (boot) USB disk cp "board/shredos/fsoverlay/etc/shredos/version.txt" "${BINARIES_DIR}/version.txt" || exit 1 +# Determine size of FAT partition based on size of bzImage plus an arbitary 20MB to hold PDF's etc. +BZIMAGE="${BINARIES_DIR}/bzImage" +CFG="board/shredos/${MKIMAGE_CFG}" +OFFSET=20000000 + +# Get bzImage size in bytes +if [[ ! -f "$BZIMAGE" ]]; then + echo "Error: $BZIMAGE not found" + exit 1 +fi + +SIZE=$(stat -c %s "$BZIMAGE") +NEW_SIZE=$((SIZE + OFFSET)) + +# Update size line in genimage.cfg +if [[ ! -f "$CFG" ]]; then + echo "Error: $CFG not found" + exit 1 +fi + +sed -i -E "0,/^[[:space:]]*size[[:space:]]*=/{s/^[[:space:]]*size[[:space:]]*=.*/size = ${NEW_SIZE}/}" "$CFG" + +echo "Updated size to $NEW_SIZE bytes in $CFG" + +# Create the .img rm -rf "${BUILD_DIR}/genimage.tmp" || exit 1 genimage --rootpath="${TARGET_DIR}" \ --inputpath="${BINARIES_DIR}" \ diff --git a/configs/shredos_i686_lite_defconfig b/configs/shredos_i686_lite_defconfig index 1c538d41f6..efe96795e8 100644 --- a/configs/shredos_i686_lite_defconfig +++ b/configs/shredos_i686_lite_defconfig @@ -6,6 +6,7 @@ BR2_TARGET_GENERIC_HOSTNAME="shredos" BR2_TARGET_GENERIC_ISSUE="Welcome to ShredOS https://github.com/PartialVolume/shredos.i686" BR2_INIT_SYSV=y BR2_ROOTFS_MERGED_USR=y +BR2_SYSTEM_BIN_SH_BASH=y BR2_SYSTEM_DEFAULT_PATH="/bin:/sbin:/usr/bin:/usr/sbin" # BR2_ENABLE_LOCALE_PURGE is not set BR2_ROOTFS_OVERLAY="board/shredos/fsoverlay"