Add UEFI support for Ubuntu live image

Change-Id: I6f5e8f86c246407d407c0ec74b8cb790a97fa7ec
This commit is contained in:
Alexander Noskov 2020-08-11 19:57:22 +00:00
parent 0de6f688d5
commit 5e55597fbc
3 changed files with 33 additions and 13 deletions

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ARG FROM=ubuntu:latest
ARG FROM=ubuntu:focal
FROM ${FROM}
@ -26,6 +26,7 @@ LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc
RUN apt-get update && apt-get install -y \
curl\
debootstrap \
dosfstools \
grub-efi-amd64-bin \
grub-pc-bin \
mtools \

View File

@ -44,14 +44,29 @@ function _grub_install (){
touch "${HOME}/LIVE_BOOT/image/UBUNTU_FOCAL_CUSTOM"
grub-mkstandalone \
--format=i386-pc \
--output="${HOME}/LIVE_BOOT/scratch/core.img" \
--install-modules="linux normal iso9660 biosdisk memdisk search tar ls all_video" \
--modules="linux normal iso9660 biosdisk search" \
--format=x86_64-efi \
--output="${HOME}/LIVE_BOOT/scratch/bootx64.efi" \
--locales="" \
--fonts="" \
boot/grub/grub.cfg="${HOME}/LIVE_BOOT/scratch/grub.cfg"
(
cd "${HOME}/LIVE_BOOT/scratch" && \
dd if=/dev/zero of=efiboot.img bs=1M count=10 && \
mkfs.vfat efiboot.img && \
LC_CTYPE=C mmd -i efiboot.img efi efi/boot && \
LC_CTYPE=C mcopy -i efiboot.img ./bootx64.efi ::efi/boot/
)
grub-mkstandalone \
--format=i386-pc \
--output="${HOME}/LIVE_BOOT/scratch/core.img" \
--install-modules="linux16 linux normal iso9660 biosdisk memdisk search tar ls" \
--modules="linux16 linux normal iso9660 biosdisk search" \
--locales="" \
--fonts="" \
boot/grub/grub.cfg="${HOME}/LIVE_BOOT/scratch/grub.cfg"
cat \
/usr/lib/grub/i386-pc/cdboot.img "${HOME}/LIVE_BOOT/scratch/core.img" \
> "${HOME}/LIVE_BOOT/scratch/bios.img"
@ -63,18 +78,22 @@ function _make_iso(){
-iso-level 3 \
-full-iso9660-filenames \
-volid "config-2" \
-eltorito-boot boot/grub/bios.img \
-no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
--eltorito-catalog boot/grub/boot.cat \
--grub2-boot-info \
--grub2-mbr /usr/lib/grub/i386-pc/boot_hybrid.img \
-eltorito-boot \
boot/grub/bios.img \
-no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
--eltorito-catalog boot/grub/boot.cat \
-eltorito-alt-boot \
-e EFI/efiboot.img \
-no-emul-boot \
-append_partition 2 0xef "${HOME}/LIVE_BOOT/scratch/efiboot.img" \
-output "/config/ubuntu-focal.iso" \
-graft-points \
"${HOME}/LIVE_BOOT/image" \
/boot/grub/bios.img="${HOME}/LIVE_BOOT/scratch/bios.img"
/boot/grub/bios.img="${HOME}/LIVE_BOOT/scratch/bios.img" \
/EFI/efiboot.img="${HOME}/LIVE_BOOT/scratch/efiboot.img"
}
function _make_metadata(){

View File

@ -1,4 +1,4 @@
FROM ubuntu:20.04 as chart-collator
FROM ubuntu:focal as chart-collator
SHELL ["bash", "-exc"]
ENV DEBIAN_FRONTEND noninteractive