Working UEFI config

pull/13622/head
klaases 2022-02-16 19:21:37 +00:00
parent 0135dbf438
commit 296920b757
10 changed files with 13 additions and 169 deletions

View File

@ -292,7 +292,7 @@ minikube_iso: deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/usr/b
$(MAKE) BR2_EXTERNAL=../../deploy/iso/minikube-iso minikube_defconfig -C $(BUILD_DIR)/buildroot $(BUILDROOT_OPTIONS)
$(MAKE) -C $(BUILD_DIR)/buildroot $(BUILDROOT_OPTIONS) host-python
$(MAKE) -C $(BUILD_DIR)/buildroot $(BUILDROOT_OPTIONS)
mv $(BUILD_DIR)/buildroot/output/images/rootfs.iso9660 $(BUILD_DIR)/minikube.iso
mv $(BUILD_DIR)/buildroot/output/images/boot.iso $(BUILD_DIR)/minikube.iso
# Change buildroot configuration for the minikube ISO
.PHONY: iso-menuconfig
@ -322,7 +322,7 @@ iso_in_docker:
$(ISO_BUILD_IMAGE) /bin/bash
test-iso:
go test -v $(INTEGRATION_TESTS_TO_RUN) --tags=iso --minikube-start-args="--iso-url=file://$(shell pwd)/out/buildroot/output/images/rootfs.iso9660"
go test -v $(INTEGRATION_TESTS_TO_RUN) --tags=iso --minikube-start-args="--iso-url=file://$(shell pwd)/out/buildroot/output/images/boot.iso"
.PHONY: test-pkg
test-pkg/%: ## Trigger packaging test

View File

@ -2,3 +2,5 @@ insmod iso9660
insmod udf
search --no-floppy --label EFIBOOTISO --set root
# used to find the cd

View File

@ -2,6 +2,6 @@ set default="0"
set timeout="5"
menuentry "Buildroot" {
linux /boot/vmlinuz console=tty0 rw
initrd /boot/initrd.img
linux /boot/vmlinuz console=tty0 rw # kernel
initrd /boot/initrd.img # rootfs
}

View File

@ -1,23 +0,0 @@
image disk.img {
hdimage {
}
partition boot {
in-partition-table = "no"
image = "boot.img"
offset = 0
size = 512
holes = {"(440; 512)"}
}
partition grub {
in-partition-table = "no"
image = "grub.img"
offset = 512
}
partition root {
partition-type = 0x83
image = "rootfs.ext2"
}
}

View File

@ -1,32 +0,0 @@
image efi-part.vfat {
vfat {
file EFI {
image = "efi-part/EFI"
}
file bzImage {
image = "bzImage"
}
}
size = 65408K # 16MB - 32KB
}
image disk.img {
hdimage {
partition-table-type = "gpt"
}
partition boot {
image = "efi-part.vfat"
partition-type-uuid = c12a7328-f81f-11d2-ba4b-00a0c93ec93b
offset = 32K
bootable = true
}
partition root {
partition-type-uuid = 44479540-f297-41b2-9af7-d131d5f0458a
partition-uuid = UUID_TMP
image = "rootfs.ext2"
}
}

View File

@ -1,6 +0,0 @@
set default="0"
set timeout="5"
menuentry "Buildroot" {
linux /boot/bzImage root=/dev/sda1 rootwait console=tty1
}

View File

@ -1,6 +0,0 @@
set default="0"
set timeout="5"
menuentry "Buildroot" {
linux /bzImage root=PARTUUID=UUID_TMP rootwait console=tty1
}

View File

@ -1,46 +0,0 @@
#!/bin/sh
# Copyright 2022 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
echo "1*** post-build.sh"
pwd
ls -lah
BOARD_DIR=$(dirname "$0")
echo "${BOARD_DIR}"
# Detect boot strategy, EFI or BIOS
if [ -d "$BINARIES_DIR/efi-part/" ]; then
echo "1a*** boot strategy: EFI"
pwd
echo "BINARIES_DIR: $BINARIES_DIR"
cp -f "$BOARD_DIR/grub-efi.cfg" "$BINARIES_DIR/efi-part/EFI/BOOT/grub.cfg"
echo "1b*** copy done?"
pwd
ls -lah $BINARIES_DIR/efi-part/EFI/BOOT/
else
echo "1a*** boot strategy: BIOS"
cp -f "$BOARD_DIR/grub-bios.cfg" "$TARGET_DIR/boot/grub/grub.cfg"
# Copy grub 1st stage to binaries, required for genimage
cp -f "$TARGET_DIR/lib/grub/i386-pc/boot.img" "$BINARIES_DIR"
fi
echo "1z*** done"

View File

@ -1,43 +0,0 @@
#!/bin/sh
# Copyright 2022 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
echo "2*** post-image.sh"
pwd
ls -lah
echo "BINARIES_DIR $BINARIES_DIR"
UUID=$(dumpe2fs "$BINARIES_DIR/rootfs.ext2" 2>/dev/null | sed -n 's/^Filesystem UUID: *\(.*\)/\1/p')
echo "$UUID"
sed -i "s/UUID_TMP/$UUID/g" "$BINARIES_DIR/efi-part/EFI/BOOT/grub.cfg"
echo "2***b is grub in here?"
ls -lah $BINARIES_DIR/efi-part/EFI/BOOT/
cat $BINARIES_DIR/efi-part/EFI/BOOT/grub.cfg
sed "s/UUID_TMP/$UUID/g" board/pc/genimage-efi.cfg > "$BINARIES_DIR/genimage-efi.cfg"
echo "2***c genimage-efi.cfg"
ls -lah $BINARIES_DIR
cat $BINARIES_DIR/genimage-efi.cfg
support/scripts/genimage.sh -c "$BINARIES_DIR/genimage-efi.cfg"
echo "2***z done"

View File

@ -23,12 +23,10 @@ BR2_TARGET_GRUB2_BUILTIN_MODULES="boot linux ext2 fat squash4 part_msdos part_gp
# Filesystem / image
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_CPIO_GZIP=y
BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/pc/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/pc/post-image.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/pc/genimage.cfg"
# BR2_TARGET_ROOTFS_EXT2=y
# BR2_TARGET_ROOTFS_EXT2_4=y
# BR2_TARGET_ROOTFS_EXT2_SIZE="2G"
BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/iso/x86_64/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/iso/x86_64/post-image.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/iso/x86_64/genimage.cfg"
# BR2_TARGET_ROOTFS_TAR is not set
# Linux headers same as kernel, a 4.19 series
@ -109,9 +107,9 @@ BR2_PACKAGE_UTIL_LINUX_LOSETUP=y
BR2_PACKAGE_UTIL_LINUX_NOLOGIN=y
BR2_PACKAGE_UTIL_LINUX_NSENTER=y
BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS=y
BR2_TARGET_ROOTFS_ISO9660=y
BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/isolinux.cfg"
BR2_TARGET_SYSLINUX=y
# BR2_TARGET_ROOTFS_ISO9660=y
# BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/isolinux.cfg"
# BR2_TARGET_SYSLINUX=y
BR2_PACKAGE_HOST_E2TOOLS=y
BR2_PACKAGE_HOST_PYTHON=y
BR2_PACKAGE_LIBFUSE=y