try using gpt part table

This commit is contained in:
Ward from fusion-voyager-3 2024-08-11 19:15:02 +03:00
parent 7e2676f939
commit d31e137dc7
3 changed files with 18 additions and 23 deletions

View File

@ -1 +1 @@
17 18

View File

@ -64,43 +64,38 @@ mkdir -p ./data/refind/EFI
cp -vf "$ROOTFS_PATH/boot"/vmlinuz-"$ISO_KERNEL" "./data/refind/EFI/vmlinuz" cp -vf "$ROOTFS_PATH/boot"/vmlinuz-"$ISO_KERNEL" "./data/refind/EFI/vmlinuz"
cp -vf "$ROOTFS_PATH/boot"/initrd.img-"$ISO_KERNEL" "./data/refind/EFI/initrd" cp -vf "$ROOTFS_PATH/boot"/initrd.img-"$ISO_KERNEL" "./data/refind/EFI/initrd"
REFIND_SIZE=$(($(du -s -B1048576 ./data/refind | cut -f1) + 10)) EFI_BOOT_IMAGE_SIZE=$(($(du -s -B1048576 ./data/refind | cut -f1) + 10))
LIVE_SIZE=$(($(du -s -B1048576 $LIVE_BOOT_LIVE_PATH | cut -f1) + 10)) EFI_BOOT_IMAGE="$LIVE_BOOT_PATH/efiboot.img"
ISO_SIZE=$(($REFIND_SIZE + $LIVE_SIZE))
DD_BOOT_IMAGE="./efiboot.img"
DD_LIVE_IMAGE="./live.img"
# Create Refind Image # Create Refind Boot Image
dd if=/dev/zero of="$DD_BOOT_IMAGE" bs=1M count=$REFIND_SIZE dd if=/dev/zero of="$EFI_BOOT_IMAGE" bs=1M count=$EFI_BOOT_IMAGE_SIZE
mkfs.vfat -F 32 "$DD_BOOT_IMAGE" mkfs.vfat -F 32 "$EFI_BOOT_IMAGE"
for directory in $(find ./data/refind/EFI/ -type d | cut -d'/' -f4-) for directory in $(find ./data/refind/EFI/ -type d | cut -d'/' -f4-)
do do
echo "creating directory $directory in $DD_BOOT_IMAGE" echo "creating directory $directory in $EFI_BOOT_IMAGE"
mmd -i "$DD_BOOT_IMAGE" ::"$(echo $directory | tr '[:lower:]' '[:upper:]' | sed 's:/*$::')" mmd -i "$EFI_BOOT_IMAGE" ::"$(echo $directory | tr '[:lower:]' '[:upper:]' | sed 's:/*$::')"
done done
for file in $(find ./data/refind/EFI/ -type f) for file in $(find ./data/refind/EFI/ -type f)
do do
echo "copying file $file to $DD_BOOT_IMAGE" echo "copying file $file to $EFI_BOOT_IMAGE"
mcopy -i "$DD_BOOT_IMAGE" $file ::"$(echo $file | cut -d'/' -f4- | tr '[:lower:]' '[:upper:]')" mcopy -i "$EFI_BOOT_IMAGE" $file ::"$(echo $file | cut -d'/' -f4- | tr '[:lower:]' '[:upper:]')"
done done
# Create System Image # Create ISO Image
xorriso \ xorriso \
-as mkisofs \ -as mkisofs \
-iso-level 3 \ -iso-level 3 \
-V "PikaOS 4" \ -V "PikaOS 4" \
-isohybrid-gpt-basdat \ -partition_offset 16 \
-o $DD_LIVE_IMAGE \ -appended_part_as_gpt \
-no-pad \
-append_partition 2 0xef "$EFI_BOOT_IMAGE" \
-e --interval:appended_partition_2:all:: \
-o "./output/$ISO_IMAGE".iso \
"$LIVE_BOOT_DATA_PATH" "$LIVE_BOOT_DATA_PATH"
# Join the 2 images into one
mkdir -p ./output
echo "joining images"
cat $DD_LIVE_IMAGE $DD_BOOT_IMAGE > "./output/$ISO_IMAGE".iso
# Generate an integrity sum # Generate an integrity sum
touch "./output/$ISO_IMAGE".md5 touch "./output/$ISO_IMAGE".md5
md5sum "./output/$ISO_IMAGE".iso > "./output/$ISO_IMAGE".md5 md5sum "./output/$ISO_IMAGE".iso > "./output/$ISO_IMAGE".md5

View File

@ -10,6 +10,6 @@ export ISO_KERNEL="6.10.0-pikaos"
export ISO_ARCH="#ARCH#" export ISO_ARCH="#ARCH#"
export ISO_RELEASE="4.0" export ISO_RELEASE="4.0"
export ISO_DESKTOP="GNOME" export ISO_DESKTOP="GNOME"
export ISO_PATCH="5" export ISO_PATCH="6"
export ISO_IMAGE="$ISO_DISTNAME-$ISO_DESKTOP-$ISO_RELEASE-$ISO_ARCH-$(date '+%y.%m.%d')-$ISO_PATCH" export ISO_IMAGE="$ISO_DISTNAME-$ISO_DESKTOP-$ISO_RELEASE-$ISO_ARCH-$(date '+%y.%m.%d')-$ISO_PATCH"
export LIVE_BOOT_VOLUME_NAME="$ISO_DISTNAME-$ISO_DESKTOP-$ISO_RELEASE-$ISO_ARCH-$ISO_PATCH" export LIVE_BOOT_VOLUME_NAME="$ISO_DISTNAME-$ISO_DESKTOP-$ISO_RELEASE-$ISO_ARCH-$ISO_PATCH"