pxe-network-installer: add support for arm64

* Add grubaa64.efi

* use dpkg-architecture to check the host arch and
  replace the hardcoded names for arm64:
  - amd64 -> arm64
  - x64 -> aa64
  - ttyS0 -> ttyAMA0

* set biosplusefi=0 since legacy bios is not supported
  by ARM64.

* The dependency on syslinux-common is only for amd64
  since it's not supported by arm64.

Test Plan:
PASS: build-pkgs on x86-64 host
PASS: build-image on x86-64 host
PASS: build-pkgs on arm64 host
PASS: build-image on arm64 host
PASS: Deploy AIO-SX on x86-64 target
PASS: Deploy AIO-SX on arm64 target
PASS: Deploy AIO-DX on arm64 targets
PASS: Deploy std(2+2+2) on arm64 targets

Story: 2010739
Task: 48019

Change-Id: Ibd7feea4e1b0af88c00d46ddfbeaf8cdb1d34898
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
This commit is contained in:
Jackie Huang 2023-07-31 21:17:04 +08:00
parent 880df77a25
commit 2544bd0aca
3 changed files with 24 additions and 2 deletions

View File

@ -6,8 +6,9 @@ Homepage: https://www.starlingx.io
Standards-Version: 4.5.1
Build-Depends: debhelper-compat (= 13),
build-info-dev,
grub2,
syslinux-common
grub2-common,
grub2 [amd64],
syslinux-common [amd64]
Package: pxe-network-installer
Architecture: all

View File

@ -4,6 +4,8 @@
export ROOT=$(CURDIR)/debian/tmp
export platform_release="$(shell grep SW_VERSION /usr/include/build_info.h | cut -d ' ' -f 3)"
export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null)
%:
dh $@
@ -19,6 +21,9 @@ override_dh_install:
install -v -d -m 755 $(ROOT)/usr/share/licenses/pxe-network-installer-1.0.0
# Add grub links
ifeq ($(DEB_HOST_ARCH),arm64)
sed -i -e "s/ttyS0/ttyAMA0/" -e "s/\(efi-watchdog enable 0\) .*/\1 600/" grub.cfg.stx
endif
install -v -m 644 default $(ROOT)/var/pxeboot/pxelinux.cfg.files/default
install -v -m 644 default.static $(ROOT)/var/pxeboot/pxelinux.cfg.files/default.static
install -v -m 644 pxe-grub.cfg $(ROOT)/var/pxeboot/pxelinux.cfg.files/grub.cfg
@ -26,14 +31,23 @@ override_dh_install:
install -v -m 644 grub.cfg.stx $(ROOT)/var/pxeboot/pxelinux.cfg.files/grub.cfg.stx
# Add controller-0 pxeboot install grub menus and setup utility
ifeq ($(DEB_HOST_ARCH),arm64)
sed -i -e "s/amd64/arm64/" -e "s/ttyS0/ttyAMA0/" -e "s/biosplusefi=1/biosplusefi=0/" pxeboot.cfg.debian efi-pxeboot.cfg.debian
endif
install -p -D -m 644 pxeboot.cfg.debian $(ROOT)/var/pxeboot/pxelinux.cfg.files/pxeboot.cfg.debian
install -p -D -m 644 efi-pxeboot.cfg.debian $(ROOT)/var/pxeboot/pxelinux.cfg.files/efi-pxeboot.cfg.debian
install -p -D -m 755 pxeboot_setup.sh $(ROOT)/usr/sbin/pxeboot_setup.sh
install -p -D -m 755 pxeboot-update.sh ${ROOT}/etc/pxeboot-update-${platform_release}.sh
install -p -D -m 644 pxeboot-feed.service $(ROOT)/lib/systemd/system/pxeboot-feed.service
ifeq ($(DEB_HOST_ARCH),arm64)
sed -i -e "s/amd64/arm64/" -e "s/x64/aa64/" pxeboot_feed.sh
endif
install -p -D -m 755 pxeboot_feed.sh $(ROOT)/etc/init.d/pxeboot_feed
# Legacy BIOS System Node Install grub menus
ifeq ($(DEB_HOST_ARCH),arm64)
sed -i -e "s/amd64/arm64/" -e "s/biosplusefi=1/biosplusefi=0/" debian-pxe-*-install
endif
install -p -D -m 700 debian-pxe-controller-install $(ROOT)/var/pxeboot/pxelinux.cfg.files/pxe-controller-install-${platform_release}
install -p -D -m 700 debian-pxe-smallsystem-install $(ROOT)/var/pxeboot/pxelinux.cfg.files/pxe-smallsystem-install-${platform_release}
install -p -D -m 700 debian-pxe-storage-install $(ROOT)/var/pxeboot/pxelinux.cfg.files/pxe-storage-install-${platform_release}
@ -42,6 +56,9 @@ override_dh_install:
install -p -D -m 700 debian-pxe-smallsystem_lowlatency-install $(ROOT)/var/pxeboot/pxelinux.cfg.files/pxe-smallsystem_lowlatency-install-${platform_release}
# UEFI System Node Install grub menus
ifeq ($(DEB_HOST_ARCH),arm64)
sed -i -e "s/amd64/arm64/" -e "s/biosplusefi=1/biosplusefi=0/" efi-debian-pxe-*-install
endif
install -p -D -m 700 efi-debian-pxe-controller-install $(ROOT)/var/pxeboot/pxelinux.cfg.files/efi-pxe-controller-install-${platform_release}
install -p -D -m 700 efi-debian-pxe-smallsystem-install $(ROOT)/var/pxeboot/pxelinux.cfg.files/efi-pxe-smallsystem-install-${platform_release}
install -p -D -m 700 efi-debian-pxe-storage-install $(ROOT)/var/pxeboot/pxelinux.cfg.files/efi-pxe-storage-install-${platform_release}
@ -51,7 +68,11 @@ override_dh_install:
# Package pxeboot utilities in /var/pxeboot
install -d -m 755 $(ROOT)/var/pxeboot
ifeq ($(DEB_HOST_ARCH),arm64)
install -p -D -m 700 pxeboot/grubaa64.efi $(ROOT)/var/pxeboot
else
install -p -D -m 700 pxeboot/grubx64.efi $(ROOT)/var/pxeboot
endif
install -p -D -m 700 pxeboot/menu.c32 $(ROOT)/var/pxeboot
install -p -D -m 700 pxeboot/ldlinux.c32 $(ROOT)/var/pxeboot
install -p -D -m 700 pxeboot/libcom32.c32 $(ROOT)/var/pxeboot