Skip to content

Commit b30f075

Browse files
authored
Merge pull request #98 from OS2borgerPC/fix-build-pipeline-out-of-space
Fix out of space error
2 parents 8e36ddf + b8d2043 commit b30f075

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

.github/workflows/build_iso.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
env:
1717
UBUNTU_ISO_URL: https://releases.ubuntu.com/22.04/ubuntu-22.04.5-desktop-amd64.iso
1818
UBUNTU_ISO_FILENAME: ubuntu-22.04.5-desktop-amd64.iso
19+
DELETE_DOWNLOADED_ISO: true # Used by build_os2borgerpc_image.sh
1920

2021
steps:
2122
- name: Checkout repository

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

image/build_os2borgerpc_image.sh

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,25 @@ then
4747
exit 1
4848
fi
4949

50+
mbr="boot_hybrid.img"
51+
52+
efi="ubuntu22-desktop-amd64.efi"
53+
54+
# Extract the MBR template (used for "Make image" below)
55+
56+
dd if="$ISO_PATH" bs=1 count=446 of=$mbr
57+
58+
# Extract EFI partition image (used for "Make image" below)
59+
60+
skip=$(/sbin/fdisk --list "$ISO_PATH" | grep --fixed-strings '.iso2 ' | awk '{print $2}')
61+
62+
size=$(/sbin/fdisk --list "$ISO_PATH" | grep --fixed-strings '.iso2 ' | awk '{print $4}')
63+
64+
dd if="$ISO_PATH" bs=512 skip="$skip" count="$size" of=$efi
65+
66+
67+
68+
5069
BUILD_FILES_COPY_DESTINATION="squashfs-root/mnt"
5170
TMP_MOUNT_POINT="squashfs-root/tmp"
5271

@@ -75,6 +94,11 @@ fi
7594

7695
build/extract_iso.sh "$ISO_PATH" iso
7796

97+
if [ "$DELETE_DOWNLOADED_ISO" = "true" ] # Useful for CI, that otherwise might run out of space
98+
then
99+
sudo rm -f $ISO_PATH
100+
fi
101+
78102
# Unsquash and customize
79103
sudo unsquashfs -force iso/casper/filesystem.squashfs > /dev/null
80104

@@ -131,22 +155,6 @@ cd ..
131155
# Cleanup and unmount our tmp from squashfs-root
132156
unmount_cleanup
133157

134-
mbr="boot_hybrid.img"
135-
136-
efi="ubuntu22-desktop-amd64.efi"
137-
138-
# Extract the MBR template
139-
140-
dd if="$ISO_PATH" bs=1 count=446 of=$mbr
141-
142-
# Extract EFI partition image
143-
144-
skip=$(/sbin/fdisk --list "$ISO_PATH" | grep --fixed-strings '.iso2 ' | awk '{print $2}')
145-
146-
size=$(/sbin/fdisk --list "$ISO_PATH" | grep --fixed-strings '.iso2 ' | awk '{print $4}')
147-
148-
dd if="$ISO_PATH" bs=512 skip="$skip" count="$size" of=$efi
149-
150158
# Make image
151159

152160
xorriso -as mkisofs -r -V "$IMAGE_NAME" -o "$IMAGE_NAME".iso -J -joliet-long -l -iso-level 3 -partition_offset 16 --grub2-mbr $mbr --mbr-force-bootable -append_partition 2 0xEF $efi -appended_part_as_gpt -c boot.catalog -b boot/grub/i386-pc/eltorito.img -no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info -eltorito-alt-boot -e '--interval:appended_partition_2:all::' -no-emul-boot iso

0 commit comments

Comments
 (0)