mirror of
https://github.com/PartialVolume/shredos.x86_64.git
synced 2026-02-20 05:32:11 +00:00
fix(configs): revert partition size and post processing for EFI
The EFI partition for hybrid ISOs does not reliably show on all Windows systems, so we cannot use our "hack" of writing the configurations/PDFs to it. Reverted instead to a sane-sized EFI partition which is used just for booting. Added a note to the README that some tools such as Rufus support an ISO-mode to add a writeable partition at burning-time. Signed-off-by: desertwitch <24509509+desertwitch@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
Do not modify the grub.cfg file in this folder trying to customize ShredOS
|
||||
behavior. The ISO file does not support such customizations, and you should use
|
||||
the IMG release instead (where you can modify the actual GRUB configuration)
|
||||
|
||||
Get it from: https://github.com/PartialVolume/shredos.x86_64
|
||||
@@ -3,7 +3,7 @@
|
||||
# This program looks for any exfat, fat32 or fat16 filesystem, it then
|
||||
# examines the filesystem, looking for a kernel file or .img or .iso
|
||||
# file that has the same version number as the booted ShredOS. Once
|
||||
# the boot USB has been found this script outputs the drive name in
|
||||
# the boot USB has been found this script outputs the drive name in
|
||||
# the following form, example being /dev/sdc etc.
|
||||
#
|
||||
# If there is no FAT drive found the script fails silently
|
||||
@@ -46,23 +46,11 @@ fi
|
||||
#
|
||||
while read drive ;
|
||||
do
|
||||
isEFI=$(fdisk -l | grep -i "$drive" | grep -i "EFI")
|
||||
|
||||
# EFI partitions should not quality for "first drive" to avoid false
|
||||
# positives; we only use it if confirmed as ours. The hybrid ISO image has
|
||||
# an EFI partition that can be written to, and we need to ensure that other
|
||||
# devices' EFI partitions remain untouched, disallowing EFI "first drive"s.
|
||||
#
|
||||
# Note that our USB image's FAT partition is not marked specifically as EFI
|
||||
# (0xEF) but regular FAT (0xC/0x0C), so it still qualifies as "first drive".
|
||||
if [[ "$first_drive" == "" ]] && [[ -z "$isEFI" ]]
|
||||
if [[ "$first_drive" == "" ]]
|
||||
then
|
||||
first_drive=$drive
|
||||
fi
|
||||
|
||||
# We can use the EFI partition if it passes the below checks and is
|
||||
# confirmed to be ours (of the hybrid ISO images, when flashed on USB).
|
||||
|
||||
if [[ "$drive" != "" ]]
|
||||
then
|
||||
mount $drive $drive_dir 2>&1 | tee -a transfer.log
|
||||
@@ -132,7 +120,7 @@ do
|
||||
|
||||
umount $drive_dir 2>&1 | tee -a transfer.log
|
||||
fi
|
||||
done <<< $(fdisk -l | grep -i "exfat\|fat16\|fat32\|EFI" | awk '{print $1}')
|
||||
done <<< $(fdisk -l | grep -i "exfat\|fat16\|fat32" | 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.
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
#
|
||||
# BR2_ROOTFS_POST_BUILD_SCRIPT for hybrid ISO configurations
|
||||
#
|
||||
# Our hybrid ISO has an accessible EFI partition, which we can (ab)use to store
|
||||
# our information also, so we move the usual data onto it before creating the
|
||||
# images. This should not cause any issues for CD/DVD-ROM burned ISO images, as
|
||||
# the EFI partition will be in RAM, but allow any USB burned ISO images to have
|
||||
# that writeable data location to put configuration files, logs and PDFs onto.
|
||||
#
|
||||
# Keep in mind that the EFI partition size (in configuration) must be below
|
||||
# the maximum of 65535 blocks of 512 bytes (= ~32 MB) or the ISO may not
|
||||
# be bootable on legacy systems, xorriso would warn about this during the
|
||||
# ISO building stage (but not consider it a failure - just so you know...)
|
||||
#
|
||||
|
||||
mkdir -p "${BINARIES_DIR}/efi-part/boot/" || exit 1
|
||||
|
||||
cp "board/shredos/autorun.inf" "${BINARIES_DIR}/efi-part/autorun.inf" || exit 1
|
||||
cp "board/shredos/README.txt" "${BINARIES_DIR}/efi-part/README.txt" || exit 1
|
||||
cp "board/shredos/README-ISO.txt" "${BINARIES_DIR}/efi-part/EFI/BOOT/README.txt" || exit 1
|
||||
cp "board/shredos/shredos.ico" "${BINARIES_DIR}/efi-part/shredos.ico" || exit 1
|
||||
cp "board/shredos/fsoverlay/etc/shredos/version.txt" "${BINARIES_DIR}/efi-part/boot/version.txt" || exit 1
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user