Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include uboot bits in installer image #4293

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions images/installer.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ onboot:
image: INSTALLER_TAG
binds.add:
- mkimage-raw-efi:/mkimage:ro # so that it has access to make-raw
- uboot:/uboot:ro # additional necessary parts for boot, appear inside image as /boot and /u-boot, so need to have in separate path
- /rootfs.img:/bits/rootfs.img:ro # this is the rootfs it will install
- /persist.img:/bits/persist.img:ro # this is the persist image
- /config.img:/bits/config.img:ro # this is the config image
Expand All @@ -29,6 +30,9 @@ volumes:
- name: mkimage-raw-efi
image: MKRAW_TAG
readonly: true
- name: uboot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it ARM specific? Shouldn't we add it conditionally somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, it is available for all platforms, even riscv64. Different content. It works on all of them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange... Why do we need u-boot for x86, for example... But ok, let it be...

image: UBOOT_TAG
readonly: true
files:
- path: /etc/eve-release
source: eve_version
Expand Down
2 changes: 1 addition & 1 deletion pkg/installer/install
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ ln -s /bits/* ${ARTIFACTS_DIR} 2>/dev/null
# symlink to the root filesystem
[ -e ${ROOTFS_IMG} ] || { echo "ERROR: no rootfs.img found"; exit 1; }
[ -e ${EFI_DIR} ] || ln -s /root/EFI ${EFI_DIR}
[ -e ${BOOT_DIR} ] || ln -s /root/boot ${BOOT_DIR}
[ -e ${BOOT_DIR} ] || ln -s /uboot/boot ${BOOT_DIR}

# finally lets see if we were given any overrides
for i in rootfs config persist; do
Expand Down
12 changes: 5 additions & 7 deletions pkg/mkimage-raw-efi/make-raw
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,6 @@ dir2vfat() {
echo $IMG
}

mkefifs() {
rm -rf /efifs/*
cp -Lr "$EFI_DIR" /efifs/EFI
}

do_system_vfat_part() {
eval "local SEC_START=\$$1"
local SEC_END="$(grow_part "$SEC_START" "$2")"
Expand Down Expand Up @@ -304,7 +299,11 @@ do_system_vfat_part() {
do_efi() {
eval "local SEC_START=\$$1"
local customparts=$2
mkefifs

# Create EFI partition and include the bootloaders
rm -rf /efifs/*
cp -Lr "$EFI_DIR" /efifs/EFI

# the grub.cfg.in is embedded in the script to avoid any external filesystem dependency for this make-raw script
sed -e 's#@PATH_TO_GRUB@#'"$(cd /efifs; echo EFI/BOOT/BOOT*EFI)"'#' > /efifs/EFI/BOOT/grub.cfg <<'EOF'
# this finds the next available bootable partition in GPT, with the highest priority
Expand Down Expand Up @@ -349,7 +348,6 @@ efi_installer_extension() {
fi
# Copy bootloaders to boot folder for installer
mkdir -p /efifs/boot
cp -r "$BOOT_DIR"/* /efifs/boot/ 2>/dev/null
touch /efifs/boot/.boot_repository
od -An -x -N 16 /dev/random | tr -d ' ' > /efifs/boot/.uuid
cp /UsbInvocationScript.txt /efifs
Expand Down
2 changes: 2 additions & 0 deletions tools/parse-pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ WWAN_TAG=${WWAN_TAG}
WLAN_TAG=${WLAN_TAG}
GUACD_TAG=${GUACD_TAG}
GRUB_TAG=${GRUB_TAG}
UBOOT_TAG=${UBOOT_TAG}
GPTTOOLS_TAG=${GPTTOOLS_TAG}
NEWLOGD_TAG=${NEWLOGD_TAG}
NVIDIA_TAG=${NVIDIA_TAG}
Expand Down Expand Up @@ -173,6 +174,7 @@ XENTOOLS_TAG=$(linuxkit_tag pkg/xen-tools)
XEN_TAG=$(linuxkit_tag pkg/xen)
ACRN_TAG=$(linuxkit_tag pkg/acrn)
GRUB_TAG=$(linuxkit_tag pkg/grub)
UBOOT_TAG=$(linuxkit_tag pkg/u-boot)
DNSMASQ_TAG=$(linuxkit_tag pkg/dnsmasq)
DOM0ZTOOLS_TAG=$(linuxkit_tag pkg/dom0-ztools)
RNGD_TAG=$(linuxkit_tag pkg/rngd)
Expand Down
Loading