mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-02 07:26:13 +00:00
Merge pull request #1307 from ijc25/isoefi-autosize
tools: Calculate EFI ESP FAT FS size based on contents.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
FROM alpine:3.5
|
||||
FROM alpine:edge
|
||||
|
||||
RUN \
|
||||
apk update && apk upgrade && \
|
||||
apk add --no-cache \
|
||||
dosfstools \
|
||||
libarchive-tools \
|
||||
binutils \
|
||||
gummiboot \
|
||||
|
@@ -37,14 +37,15 @@ objcopy \
|
||||
|
||||
# create a ISO with a EFI boot partition
|
||||
mkdir -p iso
|
||||
dd if=/dev/zero of=iso/efi.raw bs=1024 count=78000
|
||||
mkfs.vfat iso/efi.raw
|
||||
|
||||
# Stuff it into a FAT filesystem, making it as small as possible. 511KiB
|
||||
# headroom seems to be enough; (x+31)/32*32 rounds up to multiple of 32.
|
||||
mkfs.vfat -v -C iso/efi.raw \
|
||||
$(( ($(stat -c %s "mobylinux.efi") / 1024 + 511) \
|
||||
/ 32 * 32 ))
|
||||
echo "mtools_skip_check=1" >> /etc/mtools.conf && \
|
||||
mmd -i iso/efi.raw ::/EFI
|
||||
mmd -i iso/efi.raw ::/EFI/BOOT
|
||||
mcopy -i iso/efi.raw mobylinux.efi ::/EFI/BOOT/BOOTX64.EFI
|
||||
|
||||
xorriso -as mkisofs \
|
||||
-R -f -e efi.raw -no-emul-boot -o mobylinux-efi.iso iso
|
||||
|
||||
|
Reference in New Issue
Block a user