1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
#!/usr/bin/make -f
# in order to keep output non-intermixed together, disable parallel building
# of different targets in this d/rules but allow running parallel submakes
.NOTPARALLEL:
MAKEVARS = PYTHON="python3 -B"
VGABIOSES = ati bochs-display cirrus stdvga virtio vmware qxl isavga ramfb
VGABIOS_TARGETS = $(addprefix build/vgabios-, $(addsuffix .bin, $(VGABIOSES)))
BIOS_TARGETS = build/bios.bin build/bios-256k.bin build/bios-microvm.bin ${VGABIOS_TARGETS}
BUILD_TARGETS = $(BIOS_TARGETS)
build build-indep: $(BUILD_TARGETS)
# common rule to build any bios.
# $1: build target: bios or vgabios, builds $(OUT)/$1
# $2: config options to put into .config without CONFIG_ prefix
# $@: where to put output; build dir will be $(basename $@)
define build-bios
@echo "\\n=== Building ${@F} ===\\n"
set -e; \
if [ ! -e $(basename $@)/.config.old ]; then \
rm -rf $(basename $@); mkdir -p $(basename $@); \
for x in $2; do echo CONFIG_$$x; done > $(basename $@)/.config; \
$(MAKE) ${MAKEVARS} KCONFIG_CONFIG=${CURDIR}/$(basename $@)/.config OUT=$(basename $@)/ oldnoconfig; \
fi
+$(MAKE) ${MAKEVARS} $$(cat build/env) KCONFIG_CONFIG=${CURDIR}/$(basename $@)/.config OUT=$(basename $@)/ $(basename $@)/$1.bin
rm -f $@
ln $(basename $@)/$1.bin $@
endef
${BIOS_TARGETS}: build/env
build/env:
mkdir -p build
# regenerate shipped .hex files (iasl-compiled .dsl)
rm -f src/fw/*.hex
# `make iasl' unnecessarily generates .config
${MAKE} ${MAKEVARS} OUT=build/ KCONFIG_CONFIG=${CURDIR}/build/.fakeconfig iasl
echo "EXTRAVERSION=-debian-$$(dpkg-parsechangelog -SVersion)" > $@
# A stripped-down version of bios, to fit in 128Kb, for qemu <= 1.7
bios-config = QEMU=y ROM_SIZE=128 PVSCSI=n ATA_DMA=n BOOTSPLASH=n XEN=n USB_OHCI=n USB_XHCI=n USB_UAS=n SDCARD=n TCGBIOS=n MPT_SCSI=n ESP_SCSI=n MEGASAS=n NVME=n USE_SMM=n VGAHOOKS=n HOST_BIOS_GEOMETRY=n ACPI_PARSE=n \
LSI_SCSI=n DEBUG_IO=n
bios-256k-config = QEMU=y ROM_SIZE=256
bios-microvm-config = QEMU=y ROM_SIZE=128 XEN=n BOOTSPLASH=n ATA=n AHCI=n SDCARD=n PVSCSI=n ESP_SCSI=n LSI_SCSI=n MEGASAS=n MPT_SCSI=n FLOPPY=n FLASH_FLOPPY=n NVME=n PS2PORT=n USB=n LPT=n RTC_TIMER=n USE_SMM=n PMTIMER=n TCGBIOS=n HARDWARE_IRQ=n ACPI_PARSE=y
# % does not match empty string hence "bio" not "bios"
build/bio%.bin:
@$(if ${bio$*-config},,$(error no config for bio$* is set))
$(call build-bios,bios,${bio$*-config})
vgabios-ati-config = VGA_ATI=y VGA_PCI=y
vgabios-cirrus-config = VGA_CIRRUS=y VGA_PCI=y
vgabios-stdvga-config = VGA_BOCHS=y VGA_PCI=y
vgabios-virtio-config = VGA_BOCHS=y VGA_PCI=y OVERRIDE_PCI_ID=y VGA_VID=0x1af4 VGA_DID=0x1050
vgabios-vmware-config = VGA_BOCHS=y VGA_PCI=y OVERRIDE_PCI_ID=y VGA_VID=0x15ad VGA_DID=0x0405
vgabios-qxl-config = VGA_BOCHS=y VGA_PCI=y OVERRIDE_PCI_ID=y VGA_VID=0x1b36 VGA_DID=0x0100
vgabios-isavga-config = VGA_BOCHS=y VGA_PCI=n
vgabios-ramfb-config = VGA_RAMFB=y VGA_PCI=n
vgabios-bochs-display-config = DISPLAY_BOCHS=y VGA_PCI=y
build/vgabios-%.bin:
@$(if ${vgabios-$*-config},,$(error no config for vgabios-$* is set))
$(call build-bios,vgabios,BUILD_VGABIOS=y ${vgabios-$*-config})
clean:
dh_clean build/ src/fw/*.hex
install install-indep: build-indep
dh_testdir
dh_testroot
dh_prep
dh_install build/*.bin build/src/fw/*dsdt.aml usr/share/seabios/
# compatibility symlink for qemu, #1024382
dh_link usr/share/seabios/vgabios-isavga.bin usr/share/seabios/vgabios.bin
binary binary-indep: install-indep
dh_testdir
dh_testroot
dh_installdocs
dh_installman
dh_installchangelogs
dh_strip_nondeterminism
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
build-arch install-arch binary-arch:
# nothing
.PHONY: build build-indep build-arch clean binary binary-indep binary-arch install install-indep install-arch
|