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...
This commit is contained in:
Michael Shigorin 2018-07-25 15:40:56 +03:00
parent db319bb4b3
commit 3c2ef1c035
7 changed files with 27 additions and 19 deletions

View File

@ -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; @:

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
BOOT_TYPE := isolinux

View File

@ -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

View File

@ -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; @: