From 3ba5beaf17d9535a7567fe22b110f0f27dcd0855 Mon Sep 17 00:00:00 2001 From: PartialVolume <22084881+PartialVolume@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:02:09 +0000 Subject: [PATCH] Fixed the issues (#342 and #385) where a Ventoy USB memory stick that was formatted as GPT with NTFS (Type:Microsoft Basic Data) was unable to have config, PDFs and log files written to it as it was being mounted read only. This was corrected by installing BR2_PACKAGE_NTFS_3G, deinstalling the busybox mount command and installing mount from the util-linux package. I also fixed an issue that occurs when multiple formatted discs exist on the system and the user pulls the ShredOS USB boot device out after booting. In that circumstance, when it's time for ShredOS to backup PDFs, logs and configs it attempts to write them first to a disc that is identified as the ShredOS boot disc, if it fails it then looks for the first disc with a mountable partition and writes the PDFs, log and configs to that disc. Unfortunately if the disc failed to mount it wouldn't then go on and search for other disks, it would assume the mount completed ok. The save of PDFs etc, would then fail. This was also fixed so the mount return status is now checked and if it fails it now continues its search. --- .../fsoverlay/usr/bin/find_shredos_boot_disc.sh | 16 ++++++++++------ board/shredos/fsoverlay/usr/sbin/mount.ntfs | 1 + board/shredos/genimage_i586.cfg | 2 +- board/shredos/kernel-i686-defconfig | 4 ++-- configs/shredos_i686_lite_defconfig | 1 + package/busybox/busybox.config | 12 ++++++------ 6 files changed, 21 insertions(+), 15 deletions(-) create mode 120000 board/shredos/fsoverlay/usr/sbin/mount.ntfs diff --git a/board/shredos/fsoverlay/usr/bin/find_shredos_boot_disc.sh b/board/shredos/fsoverlay/usr/bin/find_shredos_boot_disc.sh index 3aded1ce8a..64d1e14120 100755 --- a/board/shredos/fsoverlay/usr/bin/find_shredos_boot_disc.sh +++ b/board/shredos/fsoverlay/usr/bin/find_shredos_boot_disc.sh @@ -46,14 +46,18 @@ fi # while read drive ; do - if [[ "$first_drive" == "" ]] - then - first_drive=$drive - fi - if [[ "$drive" != "" ]] then mount $drive $drive_dir 2>&1 | tee -a transfer.log + if [ $? == 0 ] + then + # Note the first mountable drive, we will use this for storage of PDFs + # if we can't identify a ShredOS USB stick + if [[ "$first_drive" == "" ]] + then + first_drive=$drive + fi + fi # Check the partion for the file /etc/shredos/shredos_exclude_disc, # If the file is found it indicates that the user considers that @@ -120,7 +124,7 @@ do umount $drive_dir 2>&1 | tee -a transfer.log fi -done <<< $(fdisk -l | grep -i "exfat\|fat16\|fat32" | awk '{print $1}') +done <<< $(fdisk -l | grep -i "exfat\|fat16\|fat32\|Microsoft basic data" | awk '{print $1}') # If no boot disc has been found that contains the version of ShredOS # that is running, then output the first FAT formatted drive we came across. diff --git a/board/shredos/fsoverlay/usr/sbin/mount.ntfs b/board/shredos/fsoverlay/usr/sbin/mount.ntfs new file mode 120000 index 0000000000..b54af2a35b --- /dev/null +++ b/board/shredos/fsoverlay/usr/sbin/mount.ntfs @@ -0,0 +1 @@ +mount.ntfs-3g \ No newline at end of file diff --git a/board/shredos/genimage_i586.cfg b/board/shredos/genimage_i586.cfg index 668c19416a..c3a2d3ef13 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 = 91541248 +size = 92344064 } image shredos.img { diff --git a/board/shredos/kernel-i686-defconfig b/board/shredos/kernel-i686-defconfig index d759f86163..50efb7bd11 100644 --- a/board/shredos/kernel-i686-defconfig +++ b/board/shredos/kernel-i686-defconfig @@ -2,7 +2,7 @@ # Automatically generated file; DO NOT EDIT. # Linux/i386 6.18.0 Kernel Configuration # -CONFIG_CC_VERSION_TEXT="i686-buildroot-linux-gnu-gcc.br_real (Buildroot -g8b7c69305e-dirty) 14.3.0" +CONFIG_CC_VERSION_TEXT="i686-buildroot-linux-gnu-gcc.br_real (Buildroot -g4fe795cab5-dirty) 14.3.0" CONFIG_CC_IS_GCC=y CONFIG_GCC_VERSION=140300 CONFIG_CLANG_VERSION=0 @@ -6720,7 +6720,7 @@ CONFIG_UDF_FS=y # DOS/FAT/EXFAT/NT Filesystems # CONFIG_FAT_FS=y -# CONFIG_MSDOS_FS is not set +CONFIG_MSDOS_FS=y CONFIG_VFAT_FS=y CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" diff --git a/configs/shredos_i686_lite_defconfig b/configs/shredos_i686_lite_defconfig index 2e86930b22..7f58158c14 100644 --- a/configs/shredos_i686_lite_defconfig +++ b/configs/shredos_i686_lite_defconfig @@ -21,6 +21,7 @@ BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y BR2_PACKAGE_DOSFSTOOLS_MKFS_FAT=y BR2_PACKAGE_E2FSPROGS=y +BR2_PACKAGE_NTFS_3G=y BR2_PACKAGE_LINUX_FIRMWARE=y BR2_PACKAGE_LINUX_FIRMWARE_I915=y BR2_PACKAGE_LINUX_FIRMWARE_XE=y diff --git a/package/busybox/busybox.config b/package/busybox/busybox.config index 363214c61e..cd27ef81c3 100644 --- a/package/busybox/busybox.config +++ b/package/busybox/busybox.config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Busybox version: 1.37.0 -# Wed Jan 21 13:43:11 2026 +# Thu Jan 22 00:38:58 2026 # CONFIG_HAVE_DOT_CONFIG=y @@ -671,16 +671,16 @@ CONFIG_MKDOSFS=y CONFIG_MKSWAP=y # CONFIG_FEATURE_MKSWAP_UUID is not set CONFIG_MORE=y -CONFIG_MOUNT=y +# CONFIG_MOUNT is not set # CONFIG_FEATURE_MOUNT_FAKE is not set # CONFIG_FEATURE_MOUNT_VERBOSE is not set # CONFIG_FEATURE_MOUNT_HELPERS is not set # CONFIG_FEATURE_MOUNT_LABEL is not set # CONFIG_FEATURE_MOUNT_NFS is not set -CONFIG_FEATURE_MOUNT_CIFS=y -CONFIG_FEATURE_MOUNT_FLAGS=y -CONFIG_FEATURE_MOUNT_FSTAB=y -CONFIG_FEATURE_MOUNT_OTHERTAB=y +# CONFIG_FEATURE_MOUNT_CIFS is not set +# CONFIG_FEATURE_MOUNT_FLAGS is not set +# CONFIG_FEATURE_MOUNT_FSTAB is not set +# CONFIG_FEATURE_MOUNT_OTHERTAB is not set CONFIG_MOUNTPOINT=y CONFIG_NOLOGIN=y # CONFIG_NOLOGIN_DEPENDENCIES is not set