From 3c2ef1c035b3037125878a092318eeefa5e0c7c5 Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Wed, 25 Jul 2018 15:40:56 +0300 Subject: [PATCH] rework isoboot support beyond x86 Every .iso was assumed to be bootable since the very beginning[*], and isoboot images were deemed to be x86 isolinux ones; this didn't change with basic ppc/armh support as I never ran into hardware that would _boot_ those ISOs, not only run the code, and it was only e2k isodata project that finally forced this refactoring. It's still not perfect: pack and syslinux features still end up somewhat interwoven, and too much places care for architecture the image is being built for (instead of archdep features tossing their appropriate bits and pieces in). Should help: - any-arch regarding isodata images; - {x86,aarch64}/efi by decoupling isoboot and isolinux; - ppc{,64} as introducing yaboot support will be easier now; - mipsel{,64} too, hopefully. * I knew of school addon images baked with mkimage-profiles-desktop but postponed and then neglected the whole problem for years... --- conf.d/test.mk | 2 +- features.in/build-distro/lib/90-build-distro.mk | 8 ++++++-- features.in/pack/config.mk | 11 +++-------- features.in/syslinux/config.mk | 4 +++- features.in/syslinux/lib/90-syslinux.mk | 1 + lib/boot.mk | 10 +++++++--- lib/distro.mk | 10 ++++++---- 7 files changed, 27 insertions(+), 19 deletions(-) create mode 100644 features.in/syslinux/lib/90-syslinux.mk diff --git a/conf.d/test.mk b/conf.d/test.mk index 4252e018..51da2f01 100644 --- a/conf.d/test.mk +++ b/conf.d/test.mk @@ -3,7 +3,7 @@ ifneq (,$(DEBUG)) ifeq (distro,$(IMAGE_CLASS)) -distro/syslinux-auto: distro/.init use/hdt use/syslinux/timeout/1; @: +distro/syslinux-auto: distro/.boot use/hdt use/syslinux/timeout/1; @: distro/syslinux-noescape: distro/syslinux-auto use/syslinux/noescape.cfg; @: distro/live-systemd: distro/.base use/live/base +systemd; @: diff --git a/features.in/build-distro/lib/90-build-distro.mk b/features.in/build-distro/lib/90-build-distro.mk index 2d5fef17..fc62b357 100644 --- a/features.in/build-distro/lib/90-build-distro.mk +++ b/features.in/build-distro/lib/90-build-distro.mk @@ -11,12 +11,16 @@ BOOT_BIBL := $(META_BIBLIO) BOOT_ABST := $(META_ABSTRACT) DATE_F := $(shell date +%F) -### we might want a e2k data iso too +ifeq (isodata,$(IMAGE_PACKTYPE)) +BOOT_TYPE := +else ifeq (,$(filter-out e2k%,$(ARCH))) BOOT_TYPE := e2kboot -else +endif +ifeq (,$(filter-out i586 x86_64,$(ARCH))) BOOT_TYPE := isolinux endif +endif all: | $(GLOBAL_DEBUG) prep copy-subdirs copy-tree run-scripts pack-image \ postprocess $(GLOBAL_CLEAN_WORKDIR) diff --git a/features.in/pack/config.mk b/features.in/pack/config.mk index e86698d0..88eaf823 100644 --- a/features.in/pack/config.mk +++ b/features.in/pack/config.mk @@ -6,14 +6,9 @@ DISTRO_EXTS := .iso use/pack: @$(call add_feature) -# conventional ISO9660 image hybridization -# for direct bootable usbflash imaging -use/pack/iso: use/pack boot/isolinux $(ISOHYBRID:%=use/isohybrid) -ifeq (distro,$(IMAGE_CLASS)) - @$(call set,IMAGE_PACKTYPE,boot) -else - @$(call set,IMAGE_PACKTYPE,isodata) -endif +# fallback type is isodata, might get set elsewhere to produce bootable iso +use/pack/iso: use/pack + @$(call try,IMAGE_PACKTYPE,isodata) # virtual environments VE_ARCHIVES := tar cpio ubifs diff --git a/features.in/syslinux/config.mk b/features.in/syslinux/config.mk index 59175dec..909a3689 100644 --- a/features.in/syslinux/config.mk +++ b/features.in/syslinux/config.mk @@ -1,10 +1,12 @@ # default is plain text prompt -use/syslinux: sub/stage1 +# NB: might be usbflash-ready hybrid iso +use/syslinux: sub/stage1 $(ISOHYBRID:%=use/isohybrid) @$(call add_feature) @$(call add,STAGE1_PACKAGES,syslinux) @$(call try,META_SYSTEM_ID,SYSLINUX) @$(call try,BOOTVGA,normal) @$(call set,RELNAME,ALT ($(IMAGE_NAME))) + @$(call set,IMAGE_PACKTYPE,boot) # UI is overwritten use/syslinux/ui/%: use/syslinux diff --git a/features.in/syslinux/lib/90-syslinux.mk b/features.in/syslinux/lib/90-syslinux.mk new file mode 100644 index 00000000..2b9f9a6c --- /dev/null +++ b/features.in/syslinux/lib/90-syslinux.mk @@ -0,0 +1 @@ +BOOT_TYPE := isolinux diff --git a/lib/boot.mk b/lib/boot.mk index a05c8ae3..9ce4f59b 100644 --- a/lib/boot.mk +++ b/lib/boot.mk @@ -3,13 +3,17 @@ $(error this makefile is designed to be included in toplevel one) endif ifeq (distro,$(IMAGE_CLASS)) + +# install x86 media bootloader ifeq (,$(filter-out i586 x86_64,$(ARCH))) -# install media bootloader -boot/isolinux: use/syslinux +boot/iso: use/syslinux @$(call set,BOOTLOADER,isolinux) endif + +# firmware is the bootloader ifeq (,$(filter-out e2k%,$(ARCH))) -boot/isolinux: +boot/iso: @$(call set,BOOTLOADER,e2k-boot) endif + endif diff --git a/lib/distro.mk b/lib/distro.mk index d6a5084c..ef8ae19f 100644 --- a/lib/distro.mk +++ b/lib/distro.mk @@ -12,13 +12,15 @@ distro/.init: profile/bare @$(call try,META_APP_ID,$(IMAGE_NAME)) @$(call set,META_PUBLISHER,ALT Linux Team) -# NB: the last flavour in KFLAVOURS gets to be the default one; -# the kernel packages regexp evaluation has to take place at build stage -distro/.base: distro/.init use/kernel - @$(call set,META_SYSTEM_ID,LINUX) +distro/.boot: distro/.init boot/iso @$(call set,META_VOL_ID,ALT $(IMAGE_NAME)/$(ARCH)) @$(call set,META_VOL_SET,ALT) +# NB: the last flavour in KFLAVOURS gets to be the default one; +# the kernel packages regexp evaluation has to take place at build stage +distro/.base: distro/.boot use/kernel + @$(call set,META_SYSTEM_ID,LINUX) + # this one should not be fundamental as it appears (think armh) distro/.installer: distro/.base use/bootloader/grub +installer; @: