mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-04-11 11:15:54 +00:00
Move to the development track of `containerd` not the legacy 0.2 branch. The commands have changed a bit. This does increase the image size as we are bundling the Docker copy and our copy, and the new one is larger as it is growing features. Hopefully Docker will shrink eventually. Also we may replace `ctr` with a library. Fix #1029 Signed-off-by: Justin Cormack <justin.cormack@docker.com>
53 lines
2.4 KiB
Docker
53 lines
2.4 KiB
Docker
# Create a EFI Bootable ISO
|
|
# Tag: cb55eabd696f41c5e4983a7440a865685087f683
|
|
FROM mobylinux/alpine-efi@sha256:3693e786f48858c1b104e64727ac487e3c851046755b241f8a4556afac97edd6
|
|
|
|
WORKDIR /tmp/efi
|
|
|
|
COPY initrd.img ./
|
|
COPY kernel/x86_64/vmlinuz64 ./
|
|
|
|
# Create a EFI boot file with kernel and initrd. From:
|
|
# https://github.com/haraldh/mkrescue-uefi/blob/master/mkrescue-uefi.sh
|
|
RUN cp /usr/lib/gummiboot/linuxx64.efi.stub . && \
|
|
echo "earlyprintk=ttyS0,115200 console=ttyS0,115200 mobyplatform=windows vsyscall=emulate rootdelay=300 noautodetect" > cmdline.txt && \
|
|
objcopy \
|
|
--add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \
|
|
--add-section .cmdline=./cmdline.txt --change-section-vma .cmdline=0x30000 \
|
|
--add-section .linux=./vmlinuz64 --change-section-vma .linux=0x40000 \
|
|
--add-section .initrd=initrd.img --change-section-vma .initrd=0x3000000 \
|
|
./linuxx64.efi.stub \
|
|
mobylinux.efi
|
|
|
|
# create a ISO with a EFI boot partition
|
|
RUN mkdir -p iso && \
|
|
dd if=/dev/zero of=iso/efi.raw bs=1024 count=78000 && \
|
|
mkfs.vfat iso/efi.raw
|
|
|
|
RUN 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
|
|
|
|
# How to build a VHDX. Commented out because we are currently not using it
|
|
# Don't delete: It took too long to figure out how to do this...
|
|
# # create a disk image (150MB)
|
|
# # This is a little odd, as we run this as part of the default command.
|
|
# # Can't run this during the build step as it requires privilege.
|
|
# # The Magic numbers in losetup are startsector (2048) times 512 and
|
|
# # (endsector - startsector) * 512
|
|
# CMD cd /tmp/efi && \
|
|
# dd if=/dev/zero of=disk.raw bs=1024 count=51200 && \
|
|
# sgdisk -N 1 -t 1:ef00 disk.raw && \
|
|
# losetup -o 1048576 --sizelimit 51362816 /dev/loop/1 disk.raw && \
|
|
# mkfs.vfat /dev/loop/1 && \
|
|
# echo "drive c: file=\"/dev/loop/1\" mtools_skip_check=1" > /etc/mtools.conf && \
|
|
# mmd c:/EFI && \
|
|
# mmd c:/EFI/BOOT && \
|
|
# mcopy mobylinux.efi c:/EFI/BOOT/BOOTX64.EFI && \
|
|
# losetup -d /dev/loop/1 && \
|
|
# qemu-img convert -O vhdx disk.raw mobylinux-boot.vhdx && \
|
|
# cp /tmp/efi/mobylinux.efi /tmp/efi/mobylinuxefi.iso /tmp/efi/mobylinux-boot.vhdx /mnt/
|