mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-09-19 21:20:31 +02:00
Compare commits
4 Commits
a82328904e
...
6c3791ce81
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c3791ce81 | |||
| d17b06f589 | |||
| 2fc37b4b47 | |||
| 4ebede5b99 |
@@ -21,6 +21,7 @@ CONFIG_OPTION_BACKEND_NONE=y
|
||||
# CONFIG_USE_CBFS_FILE_OPTION_BACKEND is not set
|
||||
CONFIG_COMPRESS_RAMSTAGE_LZMA=y
|
||||
# CONFIG_COMPRESS_RAMSTAGE_LZ4 is not set
|
||||
# CONFIG_COMPRESS_RAMSTAGE_ZSTD is not set
|
||||
CONFIG_SEPARATE_ROMSTAGE=y
|
||||
CONFIG_INCLUDE_CONFIG_FILE=y
|
||||
CONFIG_COLLECT_TIMESTAMPS=y
|
||||
@@ -99,6 +100,7 @@ CONFIG_VENDOR_DELL=y
|
||||
# CONFIG_VENDOR_PRODRIVE is not set
|
||||
# CONFIG_VENDOR_PROTECTLI is not set
|
||||
# CONFIG_VENDOR_PURISM is not set
|
||||
# CONFIG_VENDOR_QOTOM is not set
|
||||
# CONFIG_VENDOR_RAPTOR_CS is not set
|
||||
# CONFIG_VENDOR_RAZER is not set
|
||||
# CONFIG_VENDOR_RODA is not set
|
||||
@@ -127,7 +129,7 @@ CONFIG_CBFS_SIZE=0xEEE000
|
||||
CONFIG_CONSOLE_SERIAL=y
|
||||
CONFIG_LINEAR_FRAMEBUFFER_MAX_HEIGHT=2160
|
||||
CONFIG_LINEAR_FRAMEBUFFER_MAX_WIDTH=3840
|
||||
CONFIG_MAX_CPUS=16
|
||||
CONFIG_MAX_CPUS=8
|
||||
# CONFIG_ONBOARD_VGA_IS_PRIMARY is not set
|
||||
CONFIG_POST_DEVICE=y
|
||||
CONFIG_POST_IO=y
|
||||
@@ -149,19 +151,21 @@ CONFIG_INTEL_GMA_VBT_FILE="src/mainboard/$(MAINBOARDDIR)/data.vbt"
|
||||
CONFIG_PRERAM_CBMEM_CONSOLE_SIZE=0xc00
|
||||
CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME="OptiPlex 3040 Micro"
|
||||
# CONFIG_CONSOLE_POST is not set
|
||||
CONFIG_FSP_FD_PATH="3rdparty/fsp/KabylakeFspBinPkg/Fsp.fd"
|
||||
CONFIG_MAX_SOCKET=1
|
||||
CONFIG_CMOS_DEFAULT_FILE="src/mainboard/$(MAINBOARDDIR)/cmos.default"
|
||||
CONFIG_CMOS_LAYOUT_FILE="src/mainboard/$(MAINBOARDDIR)/cmos.layout"
|
||||
CONFIG_MAX_SOCKET=1
|
||||
CONFIG_BOOT_DEVICE_SPI_FLASH_BUS=0
|
||||
CONFIG_USE_PM_ACPI_TIMER=y
|
||||
# CONFIG_BOARD_DELL_LATITUDE_E7240 is not set
|
||||
CONFIG_BOOT_DEVICE_SPI_FLASH_BUS=0
|
||||
# CONFIG_BOARD_DELL_E4300 is not set
|
||||
# CONFIG_BOARD_DELL_E6400 is not set
|
||||
# CONFIG_BOARD_DELL_LATITUDE_E7240 is not set
|
||||
CONFIG_BOARD_DELL_OPTIPLEX_3040=y
|
||||
# CONFIG_BOARD_DELL_OPTIPLEX_780_MT is not set
|
||||
# CONFIG_BOARD_DELL_OPTIPLEX_780_USFF is not set
|
||||
# CONFIG_BOARD_DELL_OPTIPLEX_9020_SFF is not set
|
||||
# CONFIG_BOARD_DELL_OPTIPLEX_9020_MT is not set
|
||||
# CONFIG_BOARD_DELL_OPTIPLEX_3050 is not set
|
||||
# CONFIG_BOARD_DELL_LATITUDE_E5420 is not set
|
||||
# CONFIG_BOARD_DELL_LATITUDE_E5520 is not set
|
||||
# CONFIG_BOARD_DELL_LATITUDE_E6220 is not set
|
||||
@@ -205,7 +209,8 @@ CONFIG_GFX_GMA_PANEL_1_ON_EDP=y
|
||||
CONFIG_DRIVERS_UART_8250IO=y
|
||||
CONFIG_PC_CMOS_BASE_PORT_BANK1=0x72
|
||||
CONFIG_HEAP_SIZE=0x100000
|
||||
CONFIG_EC_GPE_SCI=0x50
|
||||
# CONFIG_BOOTMEDIA_SMM_BWP is not set
|
||||
# CONFIG_DRIVERS_EFI_FW_INFO is not set
|
||||
CONFIG_BOARD_ROMSIZE_KB_16384=y
|
||||
# CONFIG_COREBOOT_ROMSIZE_KB_256 is not set
|
||||
# CONFIG_COREBOOT_ROMSIZE_KB_512 is not set
|
||||
@@ -249,6 +254,7 @@ CONFIG_SMM_RESERVED_SIZE=0x200000
|
||||
CONFIG_SMM_MODULE_STACK_SIZE=0x800
|
||||
CONFIG_ACPI_BERT_SIZE=0x0
|
||||
CONFIG_DRIVERS_I2C_DESIGNWARE_CLOCK_MHZ=120
|
||||
CONFIG_CPU_PT_ROM_MAP_GB=512
|
||||
CONFIG_PRERAM_CBFS_CACHE_SIZE=0x4000
|
||||
CONFIG_DOMAIN_RESOURCE_32BIT_LIMIT=0xe0000000
|
||||
CONFIG_ACPI_CPU_STRING="CP%02X"
|
||||
@@ -266,7 +272,6 @@ CONFIG_SOC_INTEL_I2C_DEV_MAX=6
|
||||
CONFIG_SOC_INTEL_COMMON_LPSS_UART_CLK_M_VAL=0x30
|
||||
CONFIG_SOC_INTEL_COMMON_LPSS_UART_CLK_N_VAL=0xc35
|
||||
CONFIG_FSP_HEADER_PATH="3rdparty/fsp/KabylakeFspBinPkg/Include/"
|
||||
CONFIG_FSP_FD_PATH="3rdparty/fsp/KabylakeFspBinPkg/Fsp.fd"
|
||||
CONFIG_SOC_INTEL_COMMON_DEBUG_CONSENT=0
|
||||
CONFIG_INTEL_GMA_BCLV_OFFSET=0xc8254
|
||||
CONFIG_INTEL_GMA_BCLV_WIDTH=16
|
||||
@@ -284,6 +289,8 @@ CONFIG_SOC_INTEL_GFX_FRAMEBUFFER_OFFSET=0x0
|
||||
CONFIG_PCIE_LTR_MAX_SNOOP_LATENCY=0x1003
|
||||
CONFIG_PCIE_LTR_MAX_NO_SNOOP_LATENCY=0x1003
|
||||
CONFIG_SOC_PHYSICAL_ADDRESS_WIDTH=0
|
||||
CONFIG_RAMSTAGE_CBFS_CACHE_SIZE=0x4000
|
||||
CONFIG_CBFS_CACHE_ALIGN=8
|
||||
CONFIG_SOC_INTEL_COMMON_SKYLAKE_BASE=y
|
||||
CONFIG_SOC_INTEL_KABYLAKE=y
|
||||
CONFIG_SKYLAKE_SOC_PCH_H=y
|
||||
@@ -293,7 +300,7 @@ CONFIG_SKYLAKE_SOC_PCH_H=y
|
||||
CONFIG_FSP_T_LOCATION=0xfffe0000
|
||||
CONFIG_SOC_INTEL_COMMON_BLOCK_P2SB=y
|
||||
CONFIG_FIXED_SMBUS_IO_BASE=0xefa0
|
||||
CONFIG_CBFS_CACHE_ALIGN=8
|
||||
CONFIG_UART_BITBANG_TX_DELAY_MS=5
|
||||
CONFIG_SOC_INTEL_COMMON=y
|
||||
|
||||
#
|
||||
@@ -431,7 +438,6 @@ CONFIG_UDELAY_TSC=y
|
||||
CONFIG_TSC_MONOTONIC_TIMER=y
|
||||
CONFIG_TSC_SYNC_MFENCE=y
|
||||
CONFIG_HAVE_SMI_HANDLER=y
|
||||
CONFIG_CPU_PT_ROM_MAP_GB=512
|
||||
CONFIG_SMM_TSEG=y
|
||||
CONFIG_SMM_PCI_RESOURCE_STORE_NUM_SLOTS=8
|
||||
CONFIG_AP_STACK_SIZE=0x800
|
||||
@@ -500,7 +506,6 @@ CONFIG_ARCH_ALL_STAGES_X86_32=y
|
||||
CONFIG_RESERVED_PHYSICAL_ADDRESS_BITS_SUPPORT=y
|
||||
CONFIG_X86_TOP4G_BOOTMEDIA_MAP=y
|
||||
CONFIG_POSTRAM_CBFS_CACHE_IN_BSS=y
|
||||
CONFIG_RAMSTAGE_CBFS_CACHE_SIZE=0x4000
|
||||
CONFIG_PC80_SYSTEM=y
|
||||
CONFIG_HAVE_CMOS_DEFAULT=y
|
||||
CONFIG_POSTCAR_STAGE=y
|
||||
@@ -564,6 +569,8 @@ CONFIG_INTEL_GMA_ADD_VBT=y
|
||||
# CONFIG_SOFTWARE_I2C is not set
|
||||
CONFIG_I2C_TRANSFER_TIMEOUT_US=500000
|
||||
CONFIG_RESOURCE_ALLOCATION_TOP_DOWN=y
|
||||
CONFIG_DRAM_SUPPORT_DDR4=y
|
||||
CONFIG_DRAM_SUPPORT_DDR3=y
|
||||
# end of Devices
|
||||
|
||||
#
|
||||
@@ -571,8 +578,8 @@ CONFIG_RESOURCE_ALLOCATION_TOP_DOWN=y
|
||||
#
|
||||
CONFIG_CRB_TPM_BASE_ADDRESS=0xfed40000
|
||||
# CONFIG_DRIVERS_EFI_VARIABLE_STORE is not set
|
||||
# CONFIG_DRIVERS_EFI_FW_INFO is not set
|
||||
# CONFIG_ELOG is not set
|
||||
# CONFIG_DRIVERS_HWID_DMI is not set
|
||||
CONFIG_CACHE_MRC_SETTINGS=y
|
||||
CONFIG_MRC_SETTINGS_PROTECT=y
|
||||
# CONFIG_DRIVERS_OPTION_CFR is not set
|
||||
@@ -610,6 +617,7 @@ CONFIG_USE_FSP_NOTIFY_PHASE_READY_TO_BOOT=y
|
||||
CONFIG_USE_FSP_NOTIFY_PHASE_END_OF_FIRMWARE=y
|
||||
# CONFIG_DISPLAY_FSP_TIMESTAMPS is not set
|
||||
# CONFIG_BUILDING_WITH_DEBUG_FSP is not set
|
||||
CONFIG_FSP_VGA_MODE12_BPP=0x0
|
||||
CONFIG_INTEL_GMA_ACPI=y
|
||||
CONFIG_VBT_CBFS_COMPRESSION_LZMA=y
|
||||
# CONFIG_VBT_CBFS_COMPRESSION_LZ4 is not set
|
||||
@@ -670,7 +678,6 @@ CONFIG_PLATFORM_HAS_DRAM_CLEAR=y
|
||||
CONFIG_BOOTMEDIA_LOCK_NONE=y
|
||||
# CONFIG_BOOTMEDIA_LOCK_CONTROLLER is not set
|
||||
# CONFIG_BOOTMEDIA_LOCK_CHIP is not set
|
||||
# CONFIG_BOOTMEDIA_SMM_BWP is not set
|
||||
# end of Security
|
||||
|
||||
CONFIG_ACPI_HAVE_PCAT_8259=y
|
||||
@@ -811,6 +818,9 @@ CONFIG_DECOMPRESS_OFAST=y
|
||||
# Boot Logo Configuration
|
||||
#
|
||||
# CONFIG_BMP_LOGO is not set
|
||||
CONFIG_PLATFORM_POST_RENDER_DELAY_SEC=5
|
||||
CONFIG_PLATFORM_OFF_MODE_CHARGING_INDICATOR_LOGO_PATH="3rdparty/blobs/mainboard/$(MAINBOARDDIR)/off_mode_charging.bmp"
|
||||
# CONFIG_FRAMEBUFFER_SPLASH_TEXT is not set
|
||||
# end of Boot Logo Configuration
|
||||
|
||||
CONFIG_WARNINGS_ARE_ERRORS=y
|
||||
|
||||
@@ -21,6 +21,7 @@ CONFIG_OPTION_BACKEND_NONE=y
|
||||
# CONFIG_USE_CBFS_FILE_OPTION_BACKEND is not set
|
||||
CONFIG_COMPRESS_RAMSTAGE_LZMA=y
|
||||
# CONFIG_COMPRESS_RAMSTAGE_LZ4 is not set
|
||||
# CONFIG_COMPRESS_RAMSTAGE_ZSTD is not set
|
||||
CONFIG_SEPARATE_ROMSTAGE=y
|
||||
CONFIG_INCLUDE_CONFIG_FILE=y
|
||||
CONFIG_COLLECT_TIMESTAMPS=y
|
||||
@@ -99,6 +100,7 @@ CONFIG_VENDOR_DELL=y
|
||||
# CONFIG_VENDOR_PRODRIVE is not set
|
||||
# CONFIG_VENDOR_PROTECTLI is not set
|
||||
# CONFIG_VENDOR_PURISM is not set
|
||||
# CONFIG_VENDOR_QOTOM is not set
|
||||
# CONFIG_VENDOR_RAPTOR_CS is not set
|
||||
# CONFIG_VENDOR_RAZER is not set
|
||||
# CONFIG_VENDOR_RODA is not set
|
||||
@@ -125,7 +127,7 @@ CONFIG_FMDFILE=""
|
||||
CONFIG_MAINBOARD_VENDOR="Dell Inc."
|
||||
CONFIG_CBFS_SIZE=0xEEE000
|
||||
CONFIG_CONSOLE_SERIAL=y
|
||||
CONFIG_MAX_CPUS=16
|
||||
CONFIG_MAX_CPUS=8
|
||||
# CONFIG_ONBOARD_VGA_IS_PRIMARY is not set
|
||||
CONFIG_POST_DEVICE=y
|
||||
CONFIG_POST_IO=y
|
||||
@@ -147,19 +149,21 @@ CONFIG_INTEL_GMA_VBT_FILE="src/mainboard/$(MAINBOARDDIR)/data.vbt"
|
||||
CONFIG_PRERAM_CBMEM_CONSOLE_SIZE=0xc00
|
||||
CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME="OptiPlex 3040 Micro"
|
||||
# CONFIG_CONSOLE_POST is not set
|
||||
CONFIG_FSP_FD_PATH="3rdparty/fsp/KabylakeFspBinPkg/Fsp.fd"
|
||||
CONFIG_MAX_SOCKET=1
|
||||
CONFIG_CMOS_DEFAULT_FILE="src/mainboard/$(MAINBOARDDIR)/cmos.default"
|
||||
CONFIG_CMOS_LAYOUT_FILE="src/mainboard/$(MAINBOARDDIR)/cmos.layout"
|
||||
CONFIG_MAX_SOCKET=1
|
||||
CONFIG_BOOT_DEVICE_SPI_FLASH_BUS=0
|
||||
CONFIG_USE_PM_ACPI_TIMER=y
|
||||
# CONFIG_BOARD_DELL_LATITUDE_E7240 is not set
|
||||
CONFIG_BOOT_DEVICE_SPI_FLASH_BUS=0
|
||||
# CONFIG_BOARD_DELL_E4300 is not set
|
||||
# CONFIG_BOARD_DELL_E6400 is not set
|
||||
# CONFIG_BOARD_DELL_LATITUDE_E7240 is not set
|
||||
CONFIG_BOARD_DELL_OPTIPLEX_3040=y
|
||||
# CONFIG_BOARD_DELL_OPTIPLEX_780_MT is not set
|
||||
# CONFIG_BOARD_DELL_OPTIPLEX_780_USFF is not set
|
||||
# CONFIG_BOARD_DELL_OPTIPLEX_9020_SFF is not set
|
||||
# CONFIG_BOARD_DELL_OPTIPLEX_9020_MT is not set
|
||||
# CONFIG_BOARD_DELL_OPTIPLEX_3050 is not set
|
||||
# CONFIG_BOARD_DELL_LATITUDE_E5420 is not set
|
||||
# CONFIG_BOARD_DELL_LATITUDE_E5520 is not set
|
||||
# CONFIG_BOARD_DELL_LATITUDE_E6220 is not set
|
||||
@@ -203,7 +207,8 @@ CONFIG_GFX_GMA_PANEL_1_ON_EDP=y
|
||||
CONFIG_DRIVERS_UART_8250IO=y
|
||||
CONFIG_PC_CMOS_BASE_PORT_BANK1=0x72
|
||||
CONFIG_HEAP_SIZE=0x100000
|
||||
CONFIG_EC_GPE_SCI=0x50
|
||||
# CONFIG_BOOTMEDIA_SMM_BWP is not set
|
||||
# CONFIG_DRIVERS_EFI_FW_INFO is not set
|
||||
CONFIG_BOARD_ROMSIZE_KB_16384=y
|
||||
# CONFIG_COREBOOT_ROMSIZE_KB_256 is not set
|
||||
# CONFIG_COREBOOT_ROMSIZE_KB_512 is not set
|
||||
@@ -247,6 +252,7 @@ CONFIG_SMM_RESERVED_SIZE=0x200000
|
||||
CONFIG_SMM_MODULE_STACK_SIZE=0x800
|
||||
CONFIG_ACPI_BERT_SIZE=0x0
|
||||
CONFIG_DRIVERS_I2C_DESIGNWARE_CLOCK_MHZ=120
|
||||
CONFIG_CPU_PT_ROM_MAP_GB=512
|
||||
CONFIG_PRERAM_CBFS_CACHE_SIZE=0x4000
|
||||
CONFIG_DOMAIN_RESOURCE_32BIT_LIMIT=0xe0000000
|
||||
CONFIG_ACPI_CPU_STRING="CP%02X"
|
||||
@@ -264,7 +270,6 @@ CONFIG_SOC_INTEL_I2C_DEV_MAX=6
|
||||
CONFIG_SOC_INTEL_COMMON_LPSS_UART_CLK_M_VAL=0x30
|
||||
CONFIG_SOC_INTEL_COMMON_LPSS_UART_CLK_N_VAL=0xc35
|
||||
CONFIG_FSP_HEADER_PATH="3rdparty/fsp/KabylakeFspBinPkg/Include/"
|
||||
CONFIG_FSP_FD_PATH="3rdparty/fsp/KabylakeFspBinPkg/Fsp.fd"
|
||||
CONFIG_SOC_INTEL_COMMON_DEBUG_CONSENT=0
|
||||
CONFIG_INTEL_GMA_BCLV_OFFSET=0xc8254
|
||||
CONFIG_INTEL_GMA_BCLV_WIDTH=16
|
||||
@@ -282,6 +287,8 @@ CONFIG_SOC_INTEL_GFX_FRAMEBUFFER_OFFSET=0x0
|
||||
CONFIG_PCIE_LTR_MAX_SNOOP_LATENCY=0x1003
|
||||
CONFIG_PCIE_LTR_MAX_NO_SNOOP_LATENCY=0x1003
|
||||
CONFIG_SOC_PHYSICAL_ADDRESS_WIDTH=0
|
||||
CONFIG_RAMSTAGE_CBFS_CACHE_SIZE=0x4000
|
||||
CONFIG_CBFS_CACHE_ALIGN=8
|
||||
CONFIG_SOC_INTEL_COMMON_SKYLAKE_BASE=y
|
||||
CONFIG_SOC_INTEL_KABYLAKE=y
|
||||
CONFIG_SKYLAKE_SOC_PCH_H=y
|
||||
@@ -291,7 +298,7 @@ CONFIG_SKYLAKE_SOC_PCH_H=y
|
||||
CONFIG_FSP_T_LOCATION=0xfffe0000
|
||||
CONFIG_SOC_INTEL_COMMON_BLOCK_P2SB=y
|
||||
CONFIG_FIXED_SMBUS_IO_BASE=0xefa0
|
||||
CONFIG_CBFS_CACHE_ALIGN=8
|
||||
CONFIG_UART_BITBANG_TX_DELAY_MS=5
|
||||
CONFIG_SOC_INTEL_COMMON=y
|
||||
|
||||
#
|
||||
@@ -429,7 +436,6 @@ CONFIG_UDELAY_TSC=y
|
||||
CONFIG_TSC_MONOTONIC_TIMER=y
|
||||
CONFIG_TSC_SYNC_MFENCE=y
|
||||
CONFIG_HAVE_SMI_HANDLER=y
|
||||
CONFIG_CPU_PT_ROM_MAP_GB=512
|
||||
CONFIG_SMM_TSEG=y
|
||||
CONFIG_SMM_PCI_RESOURCE_STORE_NUM_SLOTS=8
|
||||
CONFIG_AP_STACK_SIZE=0x800
|
||||
@@ -498,7 +504,6 @@ CONFIG_ARCH_ALL_STAGES_X86_32=y
|
||||
CONFIG_RESERVED_PHYSICAL_ADDRESS_BITS_SUPPORT=y
|
||||
CONFIG_X86_TOP4G_BOOTMEDIA_MAP=y
|
||||
CONFIG_POSTRAM_CBFS_CACHE_IN_BSS=y
|
||||
CONFIG_RAMSTAGE_CBFS_CACHE_SIZE=0x4000
|
||||
CONFIG_PC80_SYSTEM=y
|
||||
CONFIG_HAVE_CMOS_DEFAULT=y
|
||||
CONFIG_POSTCAR_STAGE=y
|
||||
@@ -556,6 +561,8 @@ CONFIG_INTEL_GMA_ADD_VBT=y
|
||||
# CONFIG_SOFTWARE_I2C is not set
|
||||
CONFIG_I2C_TRANSFER_TIMEOUT_US=500000
|
||||
CONFIG_RESOURCE_ALLOCATION_TOP_DOWN=y
|
||||
CONFIG_DRAM_SUPPORT_DDR4=y
|
||||
CONFIG_DRAM_SUPPORT_DDR3=y
|
||||
# end of Devices
|
||||
|
||||
#
|
||||
@@ -563,8 +570,8 @@ CONFIG_RESOURCE_ALLOCATION_TOP_DOWN=y
|
||||
#
|
||||
CONFIG_CRB_TPM_BASE_ADDRESS=0xfed40000
|
||||
# CONFIG_DRIVERS_EFI_VARIABLE_STORE is not set
|
||||
# CONFIG_DRIVERS_EFI_FW_INFO is not set
|
||||
# CONFIG_ELOG is not set
|
||||
# CONFIG_DRIVERS_HWID_DMI is not set
|
||||
CONFIG_CACHE_MRC_SETTINGS=y
|
||||
CONFIG_MRC_SETTINGS_PROTECT=y
|
||||
# CONFIG_DRIVERS_OPTION_CFR is not set
|
||||
@@ -602,6 +609,7 @@ CONFIG_USE_FSP_NOTIFY_PHASE_READY_TO_BOOT=y
|
||||
CONFIG_USE_FSP_NOTIFY_PHASE_END_OF_FIRMWARE=y
|
||||
# CONFIG_DISPLAY_FSP_TIMESTAMPS is not set
|
||||
# CONFIG_BUILDING_WITH_DEBUG_FSP is not set
|
||||
CONFIG_FSP_VGA_MODE12_BPP=0x0
|
||||
CONFIG_INTEL_GMA_ACPI=y
|
||||
CONFIG_VBT_CBFS_COMPRESSION_LZMA=y
|
||||
# CONFIG_VBT_CBFS_COMPRESSION_LZ4 is not set
|
||||
@@ -663,7 +671,6 @@ CONFIG_PLATFORM_HAS_DRAM_CLEAR=y
|
||||
CONFIG_BOOTMEDIA_LOCK_NONE=y
|
||||
# CONFIG_BOOTMEDIA_LOCK_CONTROLLER is not set
|
||||
# CONFIG_BOOTMEDIA_LOCK_CHIP is not set
|
||||
# CONFIG_BOOTMEDIA_SMM_BWP is not set
|
||||
# end of Security
|
||||
|
||||
CONFIG_ACPI_HAVE_PCAT_8259=y
|
||||
@@ -804,6 +811,9 @@ CONFIG_DECOMPRESS_OFAST=y
|
||||
# Boot Logo Configuration
|
||||
#
|
||||
# CONFIG_BMP_LOGO is not set
|
||||
CONFIG_PLATFORM_POST_RENDER_DELAY_SEC=5
|
||||
CONFIG_PLATFORM_OFF_MODE_CHARGING_INDICATOR_LOGO_PATH="3rdparty/blobs/mainboard/$(MAINBOARDDIR)/off_mode_charging.bmp"
|
||||
# CONFIG_FRAMEBUFFER_SPLASH_TEXT is not set
|
||||
# end of Boot Logo Configuration
|
||||
|
||||
CONFIG_WARNINGS_ARE_ERRORS=y
|
||||
|
||||
@@ -175,7 +175,8 @@ modify_mac()
|
||||
x_ "$nvmutil" "$xbtmp/gbe" setmac "$new_mac"
|
||||
fi
|
||||
|
||||
fx_ newmac x_ find "$tmpromdir" -maxdepth 1 -type f -name "*.rom"
|
||||
fx_ newmac x_ find "$tmpromdir" -mindepth 1 -maxdepth 1 \
|
||||
-type f -name "*.rom"
|
||||
|
||||
printf "\nThe following GbE NVM data will be written:\n"
|
||||
x_ "$nvmutil" "$xbtmp/gbe" dump | grep -v "bytes read from file" || :
|
||||
|
||||
@@ -436,7 +436,8 @@ getvfile()
|
||||
else
|
||||
# inject vendor files
|
||||
|
||||
fx_ prep x_ find "$tmpromdir" -maxdepth 1 -type f -name "*.rom"
|
||||
fx_ prep x_ find "$tmpromdir" -mindepth 1 -maxdepth 1 \
|
||||
-type f -name "*.rom"
|
||||
( check_vendor_hashes ) || \
|
||||
err "$archive: Can't verify hashes" "getvfile" "$@"; :
|
||||
fi
|
||||
|
||||
@@ -109,7 +109,8 @@ prep_release_bin()
|
||||
x_ ./mk -b stm32-vserprog
|
||||
x_ ./mk -b pcsx-redux
|
||||
|
||||
fx_ mkrom_tarball x_ find bin -maxdepth 1 -type d -name "serprog_*"
|
||||
fx_ mkrom_tarball x_ find bin -mindepth 1 -maxdepth 1 \
|
||||
-type d -name "serprog_*"
|
||||
|
||||
x_ mv bin ../roms
|
||||
}
|
||||
|
||||
@@ -1,628 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Copyright (c) 2022-2023 Alper Nebi Yasak <alpernebiyasak@gmail.com>
|
||||
# Copyright (c) 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
|
||||
# Copyright (c) 2023-2025 Leah Rowe <leah@libreboot.org>
|
||||
|
||||
# flag e.g. ./mk -b <-- mkflag would be "b"
|
||||
flag=""
|
||||
|
||||
# macros, overridden depending on the flag
|
||||
if_do_make=""
|
||||
if_dry_build=":"
|
||||
if_not_do_make=":"
|
||||
if_not_dry_build=""
|
||||
|
||||
eval "`newvar autoconfargs autogenargs badhash badtghash bootstrapargs \
|
||||
build_depend buildtype cleanargs cmakedir cmd defconfig dest_dir elfdir \
|
||||
forcepull gccdir gccfull gccver gnatdir gnatfull gnatver listfile \
|
||||
makeargs mdir mkhelper mkhelpercfg mode postmake premake project release \
|
||||
rev srcdir target target_dir targets tree xarch xgcctree xlang`"
|
||||
|
||||
trees()
|
||||
{
|
||||
flags="f:F:b:m:u:c:x:s:l:n:d:"
|
||||
|
||||
while getopts $flags option
|
||||
do
|
||||
[ -n "$flag" ] && \
|
||||
err "only one flag is permitted" "trees" "$@"
|
||||
|
||||
flag="$1"
|
||||
|
||||
# the "mode" variable is affixed to a make command, example:
|
||||
# ./mk -m coreboot does: make menuconfig -C src/coreboot/tree
|
||||
|
||||
case "$flag" in
|
||||
-d)
|
||||
# -d is similar to -b, except that
|
||||
# a large number of operations will be
|
||||
# skipped. these are "if_not_dry_build build" scenarios
|
||||
# where only a subset of build tasks are done,
|
||||
# and $if_not_dry_build is prefixed to skipped commands
|
||||
|
||||
if_dry_build=""
|
||||
if_not_dry_build=":"
|
||||
;;
|
||||
-b) : ;;
|
||||
-u) mode="oldconfig" ;;
|
||||
-m) mode="menuconfig" ;;
|
||||
-c) mode="distclean" ;;
|
||||
-x) mode="crossgcc-clean" ;;
|
||||
-f|-F) # download source code for a project
|
||||
# macros. colon means false.
|
||||
if_do_make=":"
|
||||
if_dry_build=""
|
||||
if_not_do_make=""
|
||||
if_not_dry_build=":"
|
||||
[ "$flag" = "-F" ] && \
|
||||
forcepull="y"; : # never skip git fetch/pull
|
||||
;;
|
||||
-s) mode="savedefconfig" ;;
|
||||
-l) mode="olddefconfig" ;;
|
||||
-n) mode="nconfig" ;;
|
||||
*) err "invalid option '-$option'" "trees" "$@" ;;
|
||||
esac
|
||||
|
||||
if [ -z "${OPTARG+x}" ]; then
|
||||
shift 1
|
||||
break
|
||||
fi
|
||||
|
||||
project="${OPTARG#src/}"
|
||||
project="${project#config/git/}"
|
||||
|
||||
shift 2
|
||||
done
|
||||
|
||||
if [ -z "$flag" ]; then
|
||||
err "missing flag ($flags)" "trees" "$@"
|
||||
elif [ -z "$project" ]; then
|
||||
fx_ "x_ ./mk $flag" x_ ls -1 config/git
|
||||
return 1
|
||||
elif [ ! -f "config/git/$project/pkg.cfg" ]; then
|
||||
err "config/git/$project/pkg.cfg missing" "trees" "$@"
|
||||
fi
|
||||
|
||||
elfdir="elf/$project"
|
||||
datadir="config/data/$project"
|
||||
configdir="config/$project"
|
||||
srcdir="src/$project"
|
||||
dest_dir="$elfdir"
|
||||
|
||||
listfile="$datadir/build.list"
|
||||
[ ! -f "$listfile" ] && \
|
||||
listfile="" # build.list is optional on all projects
|
||||
|
||||
mkhelpercfg="$datadir/mkhelper.cfg"
|
||||
if e "$mkhelpercfg" f missing; then
|
||||
mkhelpercfg="$xbtmp/mkhelper.cfg"
|
||||
x_ touch "$mkhelpercfg"
|
||||
fi
|
||||
|
||||
targets="$*"
|
||||
cmd="build_targets $targets"
|
||||
if singletree "$project"; then
|
||||
cmd="build_project"
|
||||
fi
|
||||
|
||||
remkdir "${tmpgit%/*}"
|
||||
}
|
||||
|
||||
build_project()
|
||||
{
|
||||
configure_project "$configdir" || \
|
||||
return 0
|
||||
|
||||
[ ! -f "$listfile" ] || \
|
||||
$if_not_dry_build elfcheck || \
|
||||
return 0
|
||||
|
||||
[ "$mode" = "distclean" ] && \
|
||||
mode="clean"
|
||||
|
||||
run_make_command || \
|
||||
return 0
|
||||
|
||||
[ -z "$mode" ] && \
|
||||
$if_not_dry_build \
|
||||
copy_elf; :
|
||||
}
|
||||
|
||||
build_targets()
|
||||
{
|
||||
if [ ! -d "$configdir" ]; then
|
||||
err "directory '$configdir' doesn't exist" "build_targets" "$@"
|
||||
elif [ $# -lt 1 ]; then
|
||||
targets="$(ls -1 "$configdir")" || \
|
||||
err "'$configdir': can't list targets" "build_targets" "$@"
|
||||
fi
|
||||
|
||||
for x in $targets
|
||||
do
|
||||
unset CROSS_COMPILE
|
||||
export PATH="$xbmkpath"
|
||||
|
||||
if [ "$x" = "list" ]; then
|
||||
x_ ls -1 "config/$project"
|
||||
listfile=""
|
||||
break
|
||||
fi
|
||||
|
||||
printf "'make %s', '%s', '%s'\n" "$mode" "$project" "$x"
|
||||
|
||||
target="$x"
|
||||
|
||||
x_ handle_defconfig
|
||||
|
||||
[ -z "$mode" ] && \
|
||||
x_ $postmake; :
|
||||
done; :
|
||||
}
|
||||
|
||||
handle_defconfig()
|
||||
{
|
||||
target_dir="$configdir/$target"
|
||||
|
||||
[ ! -f "CHANGELOG" ] && \
|
||||
fetch_project "$project"
|
||||
|
||||
configure_project "$target_dir" || \
|
||||
return 0
|
||||
|
||||
[ -z "$tree" ] && \
|
||||
err "$configdir: 'tree' not set" "handle_defconfig" "$@"
|
||||
|
||||
srcdir="src/$project/$tree"
|
||||
|
||||
[ "$mode" = "${mode%clean}" ] && [ ! -d "$srcdir" ] && \
|
||||
return 0
|
||||
|
||||
for y in "$target_dir/config"/*
|
||||
do
|
||||
[ "$flag" != "-d" ] && [ ! -f "$y" ] && \
|
||||
continue
|
||||
[ "$flag" != "-d" ] && \
|
||||
defconfig="$y"
|
||||
|
||||
if [ -z "$mode" ]; then
|
||||
check_defconfig || continue; :
|
||||
fi
|
||||
|
||||
[ -z "$mode" ] && \
|
||||
for _xarch in $xarch; do
|
||||
$if_dry_build \
|
||||
break
|
||||
[ -n "$_xarch" ] && \
|
||||
check_cross_compiler "$_xarch"; :
|
||||
done; :
|
||||
|
||||
handle_makefile
|
||||
|
||||
[ -z "$mode" ] && \
|
||||
$if_not_dry_build \
|
||||
copy_elf; :
|
||||
done; :
|
||||
}
|
||||
|
||||
configure_project()
|
||||
{
|
||||
_tcfg="$1/target.cfg"
|
||||
|
||||
eval "`newvar autoconfargs badhash badtghash bootstrapargs \
|
||||
build_depend buildtype cleanargs makeargs mkhelper postmake \
|
||||
premake release xarch xgcctree xlang`"
|
||||
|
||||
[ ! -f "$_tcfg" ] && \
|
||||
buildtype="auto"
|
||||
|
||||
# globally initialise all variables for a source tree / target:
|
||||
if e "$datadir/mkhelper.cfg" f; then
|
||||
. "$datadir/mkhelper.cfg" || \
|
||||
err "Can't read '$datadir/mkhelper.cfg'" \
|
||||
"configure_project" "$@"
|
||||
fi
|
||||
|
||||
# override target/tree specific variables from per-target config:
|
||||
while e "$_tcfg" f || [ "$cmd" != "build_project" ]
|
||||
do
|
||||
printf "Loading %s config: %s\n" "$project" "$_tcfg"
|
||||
eval "`newvar rev tree`"
|
||||
|
||||
. "$_tcfg" || \
|
||||
err "Can't read '$_tcfg'" "configure_project" "$@"
|
||||
|
||||
[ "$flag" = "-d" ] && \
|
||||
build_depend="" # dry run
|
||||
|
||||
[ "$cmd" = "build_project" ] && \
|
||||
break # single-tree, so targeting is unnecessary
|
||||
$if_do_make \
|
||||
break
|
||||
[ "${_tcfg%/*/target.cfg}" = "${_tcfg%"/$tree/target.cfg"}" ] \
|
||||
&& break # target and tree matching was successful
|
||||
|
||||
_tcfg="${_tcfg%/*/target.cfg}/$tree/target.cfg" # try next
|
||||
done
|
||||
|
||||
[ "$XBMK_RELEASE" = "y" ] && [ "$release" = "n" ] && \
|
||||
return 1
|
||||
[ -n "$buildtype" ] && [ "${mode%config}" != "$mode" ] && \
|
||||
return 1
|
||||
|
||||
[ -z "$mode" ] && \
|
||||
$if_not_dry_build \
|
||||
build_dependencies
|
||||
|
||||
mdir="$xbmkpwd/config/submodule/$project"
|
||||
[ -n "$tree" ] && \
|
||||
mdir="$mdir/$tree"
|
||||
|
||||
if [ ! -f "CHANGELOG" ]; then
|
||||
delete_old_project_files
|
||||
$if_not_do_make \
|
||||
fetch_${cmd#build_}
|
||||
fi
|
||||
$if_not_do_make \
|
||||
return 1
|
||||
|
||||
x_ ./mk -f "$project" "$target"
|
||||
}
|
||||
|
||||
# projects can specify which other projects
|
||||
# to build first, as declared dependencies:
|
||||
|
||||
build_dependencies()
|
||||
{
|
||||
for bd in $build_depend
|
||||
do
|
||||
bd_project="${bd%%/*}"
|
||||
bd_tree="${bd##*/}"
|
||||
|
||||
[ -z "$bd_project" ] && \
|
||||
$if_not_dry_build \
|
||||
err "$project/$tree: !bd '$bd'" \
|
||||
"build_dependencies" "$@"
|
||||
[ "${bd##*/}" = "$bd" ] && \
|
||||
bd_tree=""
|
||||
[ -n "$bd_project" ] && \
|
||||
$if_not_dry_build \
|
||||
x_ ./mk -b $bd_project $bd_tree; :
|
||||
done; :
|
||||
}
|
||||
|
||||
# delete_old_project_files along with project_up_to_date,
|
||||
# concatenates the sha512sum hashes of all files related to
|
||||
# a project, tree or target, then gets the sha512sum of that
|
||||
# concatenation. this is checked against any existing
|
||||
# calculation previously cached; if the result differs, or
|
||||
# nothing was previously stored, we know to delete resources
|
||||
# such as builds, project sources and so on, for auto-rebuild:
|
||||
|
||||
delete_old_project_files()
|
||||
{
|
||||
# delete an entire source tree along with its builds:
|
||||
project_up_to_date hash "$tree" badhash "$datadir" \
|
||||
"$configdir/$tree" "$mdir" || \
|
||||
x_ rm -Rf "src/$project/$tree" "elf/$project/$tree"
|
||||
|
||||
x_ cp "$xbtmp/new.hash" "$XBMK_CACHE/hash/$project$tree"
|
||||
|
||||
if singletree "$project" || [ -z "$target" ] || [ "$target" = "$tree" ]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# delete only the builds of a given target, but not src.
|
||||
# this is useful when only the target config changes, for
|
||||
# example x200_8mb coreboot configs change, but not coreboot:
|
||||
|
||||
project_up_to_date tghash "$target" badtghash "$configdir/$target" || \
|
||||
x_ rm -Rf "elf/$project/$tree/$target"
|
||||
|
||||
x_ cp "$xbtmp/new.hash" "$XBMK_CACHE/tghash/$project$target"
|
||||
}
|
||||
|
||||
project_up_to_date()
|
||||
{
|
||||
eval "`newvar hash old_hash`"
|
||||
|
||||
hashdir="$1"
|
||||
hashname="$2"
|
||||
badhashvar="$3"
|
||||
|
||||
shift 3
|
||||
|
||||
x_ mkdir -p "$XBMK_CACHE/$hashdir"
|
||||
|
||||
if [ -f "$XBMK_CACHE/$hashdir/$project$hashname" ]; then
|
||||
read -r old_hash < "$XBMK_CACHE/$hashdir/$project$hashname" \
|
||||
|| err \
|
||||
"$hashdir: err '$XBMK_CACHE/$hashdir/$project$hashname'" \
|
||||
"project_up_to_date" "$hashdir" "$hashname" "$badhashvar" \
|
||||
"$@"
|
||||
fi
|
||||
|
||||
build_sbase
|
||||
fx_ "x_ util/sbase/sha512sum" find "$@" -type f -not -path \
|
||||
"*/.git*/*" | awk '{print $1}' > "$xbtmp/tmp.hash" || \
|
||||
err "!h $project $hashdir" \
|
||||
"project_up_to_date" "$hashdir" "$hashname" "$badhashvar" "$@"
|
||||
|
||||
hash="$(x_ "$sha512sum" "$xbtmp/tmp.hash" | awk '{print $1}' || \
|
||||
err)" || err "$hashname: Can't read sha512 of '$xbtmp/tmp.hash'" \
|
||||
"project_up_to_date" "$hashdir" "$hashname" "$badhashvar" "$@"
|
||||
|
||||
if [ "$hash" != "$old_hash" ] || \
|
||||
[ ! -f "$XBMK_CACHE/$hashdir/$project$hashname" ]; then
|
||||
eval "$badhashvar=\"y\""
|
||||
fi
|
||||
|
||||
printf "%s\n" "$hash" > "$xbtmp/new.hash" || \
|
||||
err "!mkhash $xbtmp/new.hash ($hashdir $hashname $badhashvar)" \
|
||||
"project_up_to_date" "$hashdir" "$hashname" "$badhashvar" "$@"
|
||||
|
||||
eval "[ \"\$$badhashvar\" = \"y\" ] && return 1"; :
|
||||
}
|
||||
|
||||
check_cross_compiler()
|
||||
{
|
||||
cbdir="src/coreboot/$tree"
|
||||
|
||||
[ "$project" != "coreboot" ] && \
|
||||
cbdir="src/coreboot/default"
|
||||
[ -n "$xgcctree" ] && \
|
||||
cbdir="src/coreboot/$xgcctree"
|
||||
|
||||
xfix="${1%-*}"
|
||||
[ "$xfix" = "x86_64" ] && \
|
||||
xfix="x64"
|
||||
|
||||
xgccfile="elf/coreboot/$tree/xgcc_${xfix}_was_compiled"
|
||||
xgccargs="crossgcc-$xfix UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS"
|
||||
|
||||
x_ ./mk -f coreboot "${cbdir#src/coreboot/}"
|
||||
x_ mkdir -p "elf/coreboot/$tree" # TODO: is this needed?
|
||||
|
||||
# tell build systems what cross-compiler to use
|
||||
export PATH="$xbmkpwd/$cbdir/util/crossgcc/xgcc/bin:$PATH"
|
||||
export CROSS_COMPILE="${xarch% *}-" # used by e.g. u-boot
|
||||
|
||||
# coreboot-specific (we disable gnat on some trees)
|
||||
[ -n "$xlang" ] && \
|
||||
export BUILD_LANGUAGES="$xlang"
|
||||
|
||||
[ -f "$xgccfile" ] && \
|
||||
return 0 # build exists already, so skip building
|
||||
|
||||
check_gnu_path gcc gnat || x_ check_gnu_path gnat gcc
|
||||
make -C "$cbdir" $xgccargs || x_ make -C "$cbdir" $xgccargs
|
||||
|
||||
x_ touch "$xgccfile" # prevent unnecessary re-build operations
|
||||
remkdir "$xbtmp/gnupath" # reset hostcc
|
||||
}
|
||||
|
||||
# fix mismatching gcc/gnat versions on debian trixie/sid. as of december 2024,
|
||||
# trixie/sid had gnat-13 as gnat and gcc-14 as gcc, but has gnat-14 in apt. in
|
||||
# some cases, gcc 13+14 and gnat-13 are present; or gnat-14 and gcc-14, but
|
||||
# gnat in PATH never resolves to gnat-14, because gnat-14 was "experimental"
|
||||
|
||||
check_gnu_path()
|
||||
{
|
||||
command -v "$1" 1>/dev/null || \
|
||||
err "Host '$1' unavailable" "check_gnu_path" "$@"
|
||||
|
||||
eval "`newvar gccdir gccfull gccver gnatdir gnatfull gnatver`"
|
||||
|
||||
if host_gcc_gnat_match "$@"; then
|
||||
return 0
|
||||
elif ! match_gcc_gnat_versions "$@"; then
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# check if gcc/gnat versions already match:
|
||||
|
||||
host_gcc_gnat_match()
|
||||
{
|
||||
gnu_setver "$1" "$1" || \
|
||||
err "Command '$1' unavailable." "check_gnu_path" "$@"
|
||||
gnu_setver "$2" "$2" || :
|
||||
|
||||
eval "[ -z \"\$$1ver\" ] && err \"Cannot detect host '$1' version\""
|
||||
|
||||
[ "$gnatfull" != "$gccfull" ] && \
|
||||
return 1; : # mismatched gcc/gnat versions
|
||||
}
|
||||
|
||||
# find all gcc/gnat versions, matching them up in PATH:
|
||||
|
||||
match_gcc_gnat_versions()
|
||||
{
|
||||
eval "$1dir=\"$(dirname "$(command -v "$1")")\""
|
||||
eval "_gnudir=\"\$$1dir\""
|
||||
eval "_gnuver=\"\$$1ver\""
|
||||
|
||||
for _bin in "$_gnudir/$2-"*; do
|
||||
if [ "${_bin#"$_gnudir/$2-"}" = "$_gnuver" ] && [ -x "$_bin" ]
|
||||
then
|
||||
_gnuver="${_bin#"$_gnudir/$2-"}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
gnu_setver "$2" "$_gnudir/$2-$_gnuver" || \
|
||||
return 1
|
||||
[ "$gnatfull" != "$gccfull" ] && \
|
||||
return 1
|
||||
|
||||
( link_gcc_gnat_versions "$@" "$_gnudir" "$_gnuver" ) || \
|
||||
err "Can't link '$2-$_gnuver' '$_gnudir'" "check_gnu_path" "$@"; :
|
||||
}
|
||||
|
||||
# create symlinks in PATH, so that the GCC/GNAT versions match:
|
||||
|
||||
link_gcc_gnat_versions()
|
||||
{
|
||||
_gnudir="$3"
|
||||
_gnuver="$4"
|
||||
|
||||
remkdir "$xbtmp/gnupath"
|
||||
|
||||
x_ cd "$xbtmp/gnupath"
|
||||
|
||||
for _gnubin in "$_gnudir/$2"*"-$_gnuver"
|
||||
do
|
||||
_gnuutil="${_gnubin##*/}"
|
||||
[ -e "$_gnubin" ] && \
|
||||
x_ ln -s "$_gnubin" "${_gnuutil%"-$_gnuver"}"; :
|
||||
done
|
||||
}
|
||||
|
||||
# get the gcc/gnat version
|
||||
# fail: return 1 if util not found
|
||||
gnu_setver()
|
||||
{
|
||||
eval "$2 --version 1>/dev/null 2>/dev/null || return 1"
|
||||
|
||||
eval "$1ver=\"`"$2" --version 2>/dev/null | head -n1`\""
|
||||
eval "$1ver=\"\${$1ver##* }\""
|
||||
eval "$1full=\"\$$1ver\""
|
||||
eval "$1ver=\"\${$1ver%%.*}\""; :
|
||||
}
|
||||
|
||||
check_defconfig()
|
||||
{
|
||||
[ ! -f "$defconfig" ] && \
|
||||
$if_not_dry_build \
|
||||
err "$project/$target: no config" check_defconfig "$@"
|
||||
|
||||
dest_dir="$elfdir/$tree/$target/${defconfig#"$target_dir/config/"}"
|
||||
|
||||
# skip build if a previous one exists:
|
||||
|
||||
$if_dry_build \
|
||||
return 0
|
||||
elfcheck || \
|
||||
return 1; :
|
||||
}
|
||||
|
||||
elfcheck()
|
||||
{
|
||||
# TODO: *STILL* very hacky check. do it properly (based on build.list)
|
||||
|
||||
( fx_ "eval exit 1 && err" find "$dest_dir" -type f ) || return 1; :
|
||||
}
|
||||
|
||||
handle_makefile()
|
||||
{
|
||||
if $if_not_dry_build check_makefile "$srcdir"; then
|
||||
$if_not_dry_build \
|
||||
x_ make -C "$srcdir" $cleanargs clean
|
||||
fi
|
||||
|
||||
[ -f "$defconfig" ] && \
|
||||
x_ cp "$defconfig" "$srcdir/.config"
|
||||
|
||||
run_make_command || \
|
||||
err "no makefile!" "handle_makefile" "$@"
|
||||
|
||||
_copy=".config"
|
||||
|
||||
[ "$mode" = "savedefconfig" ] && \
|
||||
_copy="defconfig"
|
||||
|
||||
[ "${mode%config}" != "$mode" ] && \
|
||||
$if_not_dry_build \
|
||||
x_ cp "$srcdir/$_copy" "$defconfig"; :
|
||||
|
||||
[ -e "$srcdir/.git" ] && [ "$project" = "u-boot" ] && \
|
||||
[ "$mode" = "distclean" ] && \
|
||||
$if_not_dry_build \
|
||||
x_ git -C "$srcdir" $cleanargs clean -fdx; :
|
||||
}
|
||||
|
||||
run_make_command()
|
||||
{
|
||||
[ -z "$mode" ] && \
|
||||
x_ $premake
|
||||
|
||||
$if_not_dry_build check_cmake "$srcdir" && \
|
||||
[ -z "$mode" ] && \
|
||||
$if_not_dry_build \
|
||||
check_autoconf "$srcdir"
|
||||
|
||||
$if_not_dry_build check_makefile "$srcdir" || \
|
||||
return 1
|
||||
|
||||
$if_not_dry_build \
|
||||
x_ make -C "$srcdir" $mode -j$XBMK_THREADS $makeargs
|
||||
|
||||
[ -z "$mode" ] && \
|
||||
x_ $mkhelper
|
||||
|
||||
check_makefile "$srcdir" || \
|
||||
return 0
|
||||
|
||||
[ "$mode" = "clean" ] || \
|
||||
return 0
|
||||
$if_dry_build \
|
||||
return 0
|
||||
|
||||
make -C "$srcdir" $cleanargs distclean || \
|
||||
x_ make -C "$srcdir" $cleanargs clean; :
|
||||
}
|
||||
|
||||
check_cmake()
|
||||
{
|
||||
$if_dry_build \
|
||||
return 0
|
||||
[ ! -n "$cmakedir" ] && \
|
||||
return 0
|
||||
|
||||
check_makefile "$1" || \
|
||||
cmake -B "$1" "$1/$cmakedir" || \
|
||||
x_ check_makefile "$1"
|
||||
|
||||
x_ check_makefile "$1"; :
|
||||
}
|
||||
|
||||
check_autoconf()
|
||||
{
|
||||
(
|
||||
x_ cd "$1"
|
||||
|
||||
[ -f "bootstrap" ] && \
|
||||
x_ ./bootstrap $bootstrapargs
|
||||
[ -f "autogen.sh" ] && \
|
||||
x_ ./autogen.sh $autogenargs
|
||||
[ -f "configure" ] && \
|
||||
x_ ./configure $autoconfargs; :
|
||||
|
||||
) || err "can't bootstrap project: $1" "check_autoconf" "$@"; :
|
||||
}
|
||||
|
||||
check_makefile()
|
||||
{
|
||||
[ ! -f "$1/Makefile" ] && [ ! -f "$1/makefile" ] && \
|
||||
[ ! -f "$1/GNUmakefile" ] && \
|
||||
return 1; :
|
||||
}
|
||||
|
||||
copy_elf()
|
||||
{
|
||||
[ -f "$listfile" ] && \
|
||||
x_ mkdir -p "$dest_dir"
|
||||
|
||||
if [ -f "$listfile" ]; then
|
||||
while read -r f; do
|
||||
[ -f "$srcdir/$f" ] && \
|
||||
x_ cp "$srcdir/$f" "$dest_dir"; :
|
||||
|
||||
done < "$listfile" || err \
|
||||
"cannot read '$listfile'" "copy_elf" "$@"; :
|
||||
fi
|
||||
|
||||
( x_ make clean -C "$srcdir" $cleanargs ) || \
|
||||
err "can't make-clean '$srcdir'" "copy_elf" "$@"; :
|
||||
}
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
# Copyright (c) 2020-2026 Leah Rowe <leah@libreboot.org>
|
||||
# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
|
||||
# Copyright (c) 2022-2023 Alper Nebi Yasak <alpernebiyasak@gmail.com>
|
||||
# Copyright (c) 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
|
||||
|
||||
set -u -e
|
||||
|
||||
@@ -32,7 +34,6 @@ cd "${commandv%/*}" || exit 1
|
||||
. "include/fw/inject.sh"
|
||||
. "include/fw/rom.sh"
|
||||
|
||||
. "include/mk/tree.sh"
|
||||
. "include/mk/release.sh"
|
||||
|
||||
_f="${1-}"
|
||||
@@ -41,9 +42,629 @@ shift 1 2>/dev/null || :
|
||||
eval "$(printf "version release download inject\n" | awk '{ for (i=1; i<=NF; \
|
||||
i++) $i = "[ \""$i"\" = \"$_f\" ] && x_ "$i" \"$@\" && exit 0;"; print }')"
|
||||
|
||||
trees "$_f" "$@" || exit 0
|
||||
x_ touch "$mkhelpercfg"
|
||||
. "$mkhelpercfg"
|
||||
$cmd
|
||||
# flag e.g. ./mk -b <-- mkflag would be "b"
|
||||
flag=""
|
||||
|
||||
# macros, overridden depending on the flag
|
||||
if_do_make=""
|
||||
if_dry_build=":"
|
||||
if_not_do_make=":"
|
||||
if_not_dry_build=""
|
||||
|
||||
eval "`newvar autoconfargs autogenargs badhash badtghash bootstrapargs \
|
||||
build_depend buildtype cleanargs cmakedir cmd defconfig dest_dir elfdir \
|
||||
forcepull gccdir gccfull gccver gnatdir gnatfull gnatver listfile \
|
||||
makeargs mdir mkhelper mkhelpercfg mode postmake premake project release \
|
||||
rev srcdir target target_dir tree xarch xgcctree xlang`"
|
||||
|
||||
main()
|
||||
{
|
||||
flags="f:F:b:m:u:c:x:s:l:n:d:"
|
||||
|
||||
while getopts $flags option
|
||||
do
|
||||
[ -n "$flag" ] && \
|
||||
err "only one flag is permitted" "trees" "$@"
|
||||
|
||||
flag="$1"
|
||||
|
||||
# the "mode" variable is affixed to a make command, example:
|
||||
# ./mk -m coreboot does: make menuconfig -C src/coreboot/tree
|
||||
|
||||
case "$flag" in
|
||||
-d)
|
||||
# -d is similar to -b, except that
|
||||
# a large number of operations will be
|
||||
# skipped. these are "if_not_dry_build build" scenarios
|
||||
# where only a subset of build tasks are done,
|
||||
# and $if_not_dry_build is prefixed to skipped commands
|
||||
|
||||
if_dry_build=""
|
||||
if_not_dry_build=":"
|
||||
;;
|
||||
-b) : ;;
|
||||
-u) mode="oldconfig" ;;
|
||||
-m) mode="menuconfig" ;;
|
||||
-c) mode="distclean" ;;
|
||||
-x) mode="crossgcc-clean" ;;
|
||||
-f|-F) # download source code for a project
|
||||
# macros. colon means false.
|
||||
if_do_make=":"
|
||||
if_dry_build=""
|
||||
if_not_do_make=""
|
||||
if_not_dry_build=":"
|
||||
[ "$flag" = "-F" ] && \
|
||||
forcepull="y"; : # never skip git fetch/pull
|
||||
;;
|
||||
-s) mode="savedefconfig" ;;
|
||||
-l) mode="olddefconfig" ;;
|
||||
-n) mode="nconfig" ;;
|
||||
*) err "invalid option '-$option'" "trees" "$@" ;;
|
||||
esac
|
||||
|
||||
if [ -z "${OPTARG+x}" ]; then
|
||||
shift 1
|
||||
break
|
||||
fi
|
||||
|
||||
project="${OPTARG#src/}"
|
||||
project="${project#config/git/}"
|
||||
|
||||
shift 2
|
||||
done
|
||||
|
||||
if [ -z "$flag" ]; then
|
||||
err "missing flag ($flags)" "trees" "$@"
|
||||
elif [ -z "$project" ]; then
|
||||
fx_ "x_ ./mk $flag" x_ ls -1 config/git
|
||||
return 0
|
||||
elif [ ! -f "config/git/$project/pkg.cfg" ]; then
|
||||
err "config/git/$project/pkg.cfg missing" "trees" "$@"
|
||||
fi
|
||||
|
||||
elfdir="elf/$project"
|
||||
datadir="config/data/$project"
|
||||
configdir="config/$project"
|
||||
srcdir="src/$project"
|
||||
dest_dir="$elfdir"
|
||||
|
||||
listfile="$datadir/build.list"
|
||||
[ ! -f "$listfile" ] && \
|
||||
listfile="" # build.list is optional on all projects
|
||||
|
||||
mkhelpercfg="$datadir/mkhelper.cfg"
|
||||
if e "$mkhelpercfg" f missing; then
|
||||
mkhelpercfg="$xbtmp/mkhelper.cfg"
|
||||
x_ touch "$mkhelpercfg"
|
||||
fi
|
||||
|
||||
cmd="build_project"
|
||||
singletree "$project" || \
|
||||
cmd="build_targets"
|
||||
|
||||
remkdir "${tmpgit%/*}"
|
||||
x_ touch "$mkhelpercfg"
|
||||
|
||||
. "$mkhelpercfg"
|
||||
$cmd "$@"
|
||||
}
|
||||
|
||||
build_project()
|
||||
{
|
||||
configure_project "$configdir" || \
|
||||
return 0
|
||||
|
||||
[ ! -f "$listfile" ] || \
|
||||
$if_not_dry_build elfcheck || \
|
||||
return 0
|
||||
|
||||
[ "$mode" = "distclean" ] && \
|
||||
mode="clean"
|
||||
|
||||
run_make_command || \
|
||||
return 0
|
||||
|
||||
[ -z "$mode" ] && \
|
||||
$if_not_dry_build \
|
||||
copy_elf; :
|
||||
}
|
||||
|
||||
build_targets()
|
||||
{
|
||||
[ ! -d "$configdir" ] && \
|
||||
err "directory '$configdir' doesn't exist" "build_targets" "$@"
|
||||
[ $# -lt 1 ] && \
|
||||
fx_ build_targets find "$configdir" \
|
||||
-mindepth 1 -maxdepth 1 -type d
|
||||
[ $# -gt 0 ] && for x in "$@"
|
||||
do
|
||||
unset CROSS_COMPILE
|
||||
export PATH="$xbmkpath"
|
||||
|
||||
if [ "$x" = "list" ]; then
|
||||
x_ ls -1 "config/$project"
|
||||
listfile=""
|
||||
break
|
||||
fi
|
||||
|
||||
printf "'make %s', '%s', '%s'\n" "$mode" "$project" "$x"
|
||||
|
||||
target="${x##*/}"
|
||||
|
||||
x_ handle_defconfig
|
||||
|
||||
[ -z "$mode" ] && \
|
||||
x_ $postmake; :
|
||||
done; :
|
||||
}
|
||||
|
||||
handle_defconfig()
|
||||
{
|
||||
target_dir="$configdir/$target"
|
||||
|
||||
[ ! -f "CHANGELOG" ] && \
|
||||
fetch_project "$project"
|
||||
|
||||
configure_project "$target_dir" || \
|
||||
return 0
|
||||
|
||||
[ -z "$tree" ] && \
|
||||
err "$configdir: 'tree' not set" "handle_defconfig" "$@"
|
||||
|
||||
srcdir="src/$project/$tree"
|
||||
|
||||
[ "$mode" = "${mode%clean}" ] && [ ! -d "$srcdir" ] && \
|
||||
return 0
|
||||
|
||||
for y in "$target_dir/config"/*
|
||||
do
|
||||
[ "$flag" != "-d" ] && [ ! -f "$y" ] && \
|
||||
continue
|
||||
[ "$flag" != "-d" ] && \
|
||||
defconfig="$y"
|
||||
|
||||
if [ -z "$mode" ]; then
|
||||
check_defconfig || continue; :
|
||||
fi
|
||||
|
||||
[ -z "$mode" ] && \
|
||||
for _xarch in $xarch; do
|
||||
$if_dry_build \
|
||||
break
|
||||
[ -n "$_xarch" ] && \
|
||||
check_cross_compiler "$_xarch"; :
|
||||
done; :
|
||||
|
||||
handle_makefile
|
||||
|
||||
[ -z "$mode" ] && \
|
||||
$if_not_dry_build \
|
||||
copy_elf; :
|
||||
done; :
|
||||
}
|
||||
|
||||
configure_project()
|
||||
{
|
||||
_tcfg="$1/target.cfg"
|
||||
|
||||
eval "`newvar autoconfargs badhash badtghash bootstrapargs \
|
||||
build_depend buildtype cleanargs makeargs mkhelper postmake \
|
||||
premake release xarch xgcctree xlang`"
|
||||
|
||||
[ ! -f "$_tcfg" ] && \
|
||||
buildtype="auto"
|
||||
|
||||
# globally initialise all variables for a source tree / target:
|
||||
if e "$datadir/mkhelper.cfg" f; then
|
||||
. "$datadir/mkhelper.cfg" || \
|
||||
err "Can't read '$datadir/mkhelper.cfg'" \
|
||||
"configure_project" "$@"
|
||||
fi
|
||||
|
||||
# override target/tree specific variables from per-target config:
|
||||
while e "$_tcfg" f || [ "$cmd" != "build_project" ]
|
||||
do
|
||||
printf "Loading %s config: %s\n" "$project" "$_tcfg"
|
||||
eval "`newvar rev tree`"
|
||||
|
||||
. "$_tcfg" || \
|
||||
err "Can't read '$_tcfg'" "configure_project" "$@"
|
||||
|
||||
[ "$flag" = "-d" ] && \
|
||||
build_depend="" # dry run
|
||||
|
||||
[ "$cmd" = "build_project" ] && \
|
||||
break # single-tree, so targeting is unnecessary
|
||||
$if_do_make \
|
||||
break
|
||||
[ "${_tcfg%/*/target.cfg}" = "${_tcfg%"/$tree/target.cfg"}" ] \
|
||||
&& break # target and tree matching was successful
|
||||
|
||||
_tcfg="${_tcfg%/*/target.cfg}/$tree/target.cfg" # try next
|
||||
done
|
||||
|
||||
[ "$XBMK_RELEASE" = "y" ] && [ "$release" = "n" ] && \
|
||||
return 1
|
||||
[ -n "$buildtype" ] && [ "${mode%config}" != "$mode" ] && \
|
||||
return 1
|
||||
|
||||
[ -z "$mode" ] && \
|
||||
$if_not_dry_build \
|
||||
build_dependencies
|
||||
|
||||
mdir="$xbmkpwd/config/submodule/$project"
|
||||
[ -n "$tree" ] && \
|
||||
mdir="$mdir/$tree"
|
||||
|
||||
if [ ! -f "CHANGELOG" ]; then
|
||||
delete_old_project_files
|
||||
$if_not_do_make \
|
||||
fetch_${cmd#build_}
|
||||
fi
|
||||
$if_not_do_make \
|
||||
return 1
|
||||
|
||||
x_ ./mk -f "$project" "$target"
|
||||
}
|
||||
|
||||
# projects can specify which other projects
|
||||
# to build first, as declared dependencies:
|
||||
|
||||
build_dependencies()
|
||||
{
|
||||
for bd in $build_depend
|
||||
do
|
||||
bd_project="${bd%%/*}"
|
||||
bd_tree="${bd##*/}"
|
||||
|
||||
[ -z "$bd_project" ] && \
|
||||
$if_not_dry_build \
|
||||
err "$project/$tree: !bd '$bd'" \
|
||||
"build_dependencies" "$@"
|
||||
[ "${bd##*/}" = "$bd" ] && \
|
||||
bd_tree=""
|
||||
[ -n "$bd_project" ] && \
|
||||
$if_not_dry_build \
|
||||
x_ ./mk -b $bd_project $bd_tree; :
|
||||
done; :
|
||||
}
|
||||
|
||||
# delete_old_project_files along with project_up_to_date,
|
||||
# concatenates the sha512sum hashes of all files related to
|
||||
# a project, tree or target, then gets the sha512sum of that
|
||||
# concatenation. this is checked against any existing
|
||||
# calculation previously cached; if the result differs, or
|
||||
# nothing was previously stored, we know to delete resources
|
||||
# such as builds, project sources and so on, for auto-rebuild:
|
||||
|
||||
delete_old_project_files()
|
||||
{
|
||||
# delete an entire source tree along with its builds:
|
||||
project_up_to_date hash "$tree" badhash "$datadir" \
|
||||
"$configdir/$tree" "$mdir" || \
|
||||
x_ rm -Rf "src/$project/$tree" "elf/$project/$tree"
|
||||
|
||||
x_ cp "$xbtmp/new.hash" "$XBMK_CACHE/hash/$project$tree"
|
||||
|
||||
if singletree "$project" || [ -z "$target" ] || [ "$target" = "$tree" ]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# delete only the builds of a given target, but not src.
|
||||
# this is useful when only the target config changes, for
|
||||
# example x200_8mb coreboot configs change, but not coreboot:
|
||||
|
||||
project_up_to_date tghash "$target" badtghash "$configdir/$target" || \
|
||||
x_ rm -Rf "elf/$project/$tree/$target"
|
||||
|
||||
x_ cp "$xbtmp/new.hash" "$XBMK_CACHE/tghash/$project$target"
|
||||
}
|
||||
|
||||
project_up_to_date()
|
||||
{
|
||||
eval "`newvar hash old_hash`"
|
||||
|
||||
hashdir="$1"
|
||||
hashname="$2"
|
||||
badhashvar="$3"
|
||||
|
||||
shift 3
|
||||
|
||||
x_ mkdir -p "$XBMK_CACHE/$hashdir"
|
||||
|
||||
if [ -f "$XBMK_CACHE/$hashdir/$project$hashname" ]; then
|
||||
read -r old_hash < "$XBMK_CACHE/$hashdir/$project$hashname" \
|
||||
|| err \
|
||||
"$hashdir: err '$XBMK_CACHE/$hashdir/$project$hashname'" \
|
||||
"project_up_to_date" "$hashdir" "$hashname" "$badhashvar" \
|
||||
"$@"
|
||||
fi
|
||||
|
||||
build_sbase
|
||||
fx_ "x_ util/sbase/sha512sum" find "$@" -type f -not -path \
|
||||
"*/.git*/*" | awk '{print $1}' > "$xbtmp/tmp.hash" || \
|
||||
err "!h $project $hashdir" \
|
||||
"project_up_to_date" "$hashdir" "$hashname" "$badhashvar" "$@"
|
||||
|
||||
hash="$(x_ "$sha512sum" "$xbtmp/tmp.hash" | awk '{print $1}' || \
|
||||
err)" || err "$hashname: Can't read sha512 of '$xbtmp/tmp.hash'" \
|
||||
"project_up_to_date" "$hashdir" "$hashname" "$badhashvar" "$@"
|
||||
|
||||
if [ "$hash" != "$old_hash" ] || \
|
||||
[ ! -f "$XBMK_CACHE/$hashdir/$project$hashname" ]; then
|
||||
eval "$badhashvar=\"y\""
|
||||
fi
|
||||
|
||||
printf "%s\n" "$hash" > "$xbtmp/new.hash" || \
|
||||
err "!mkhash $xbtmp/new.hash ($hashdir $hashname $badhashvar)" \
|
||||
"project_up_to_date" "$hashdir" "$hashname" "$badhashvar" "$@"
|
||||
|
||||
eval "[ \"\$$badhashvar\" = \"y\" ] && return 1"; :
|
||||
}
|
||||
|
||||
check_cross_compiler()
|
||||
{
|
||||
cbdir="src/coreboot/$tree"
|
||||
|
||||
[ "$project" != "coreboot" ] && \
|
||||
cbdir="src/coreboot/default"
|
||||
[ -n "$xgcctree" ] && \
|
||||
cbdir="src/coreboot/$xgcctree"
|
||||
|
||||
xfix="${1%-*}"
|
||||
[ "$xfix" = "x86_64" ] && \
|
||||
xfix="x64"
|
||||
|
||||
xgccfile="elf/coreboot/$tree/xgcc_${xfix}_was_compiled"
|
||||
xgccargs="crossgcc-$xfix UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS"
|
||||
|
||||
x_ ./mk -f coreboot "${cbdir#src/coreboot/}"
|
||||
x_ mkdir -p "elf/coreboot/$tree" # TODO: is this needed?
|
||||
|
||||
# tell build systems what cross-compiler to use
|
||||
export PATH="$xbmkpwd/$cbdir/util/crossgcc/xgcc/bin:$PATH"
|
||||
export CROSS_COMPILE="${xarch% *}-" # used by e.g. u-boot
|
||||
|
||||
# coreboot-specific (we disable gnat on some trees)
|
||||
[ -n "$xlang" ] && \
|
||||
export BUILD_LANGUAGES="$xlang"
|
||||
|
||||
[ -f "$xgccfile" ] && \
|
||||
return 0 # build exists already, so skip building
|
||||
|
||||
check_gnu_path gcc gnat || x_ check_gnu_path gnat gcc
|
||||
make -C "$cbdir" $xgccargs || x_ make -C "$cbdir" $xgccargs
|
||||
|
||||
x_ touch "$xgccfile" # prevent unnecessary re-build operations
|
||||
remkdir "$xbtmp/gnupath" # reset hostcc
|
||||
}
|
||||
|
||||
# fix mismatching gcc/gnat versions on debian trixie/sid. as of december 2024,
|
||||
# trixie/sid had gnat-13 as gnat and gcc-14 as gcc, but has gnat-14 in apt. in
|
||||
# some cases, gcc 13+14 and gnat-13 are present; or gnat-14 and gcc-14, but
|
||||
# gnat in PATH never resolves to gnat-14, because gnat-14 was "experimental"
|
||||
|
||||
check_gnu_path()
|
||||
{
|
||||
command -v "$1" 1>/dev/null || \
|
||||
err "Host '$1' unavailable" "check_gnu_path" "$@"
|
||||
|
||||
eval "`newvar gccdir gccfull gccver gnatdir gnatfull gnatver`"
|
||||
|
||||
if host_gcc_gnat_match "$@"; then
|
||||
return 0
|
||||
elif ! match_gcc_gnat_versions "$@"; then
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# check if gcc/gnat versions already match:
|
||||
|
||||
host_gcc_gnat_match()
|
||||
{
|
||||
gnu_setver "$1" "$1" || \
|
||||
err "Command '$1' unavailable." "check_gnu_path" "$@"
|
||||
gnu_setver "$2" "$2" || :
|
||||
|
||||
eval "[ -z \"\$$1ver\" ] && err \"Cannot detect host '$1' version\""
|
||||
|
||||
[ "$gnatfull" != "$gccfull" ] && \
|
||||
return 1; : # mismatched gcc/gnat versions
|
||||
}
|
||||
|
||||
# find all gcc/gnat versions, matching them up in PATH:
|
||||
|
||||
match_gcc_gnat_versions()
|
||||
{
|
||||
eval "$1dir=\"$(dirname "$(command -v "$1")")\""
|
||||
eval "_gnudir=\"\$$1dir\""
|
||||
eval "_gnuver=\"\$$1ver\""
|
||||
|
||||
for _bin in "$_gnudir/$2-"*; do
|
||||
if [ "${_bin#"$_gnudir/$2-"}" = "$_gnuver" ] && [ -x "$_bin" ]
|
||||
then
|
||||
_gnuver="${_bin#"$_gnudir/$2-"}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
gnu_setver "$2" "$_gnudir/$2-$_gnuver" || \
|
||||
return 1
|
||||
[ "$gnatfull" != "$gccfull" ] && \
|
||||
return 1
|
||||
|
||||
( link_gcc_gnat_versions "$@" "$_gnudir" "$_gnuver" ) || \
|
||||
err "Can't link '$2-$_gnuver' '$_gnudir'" "check_gnu_path" "$@"; :
|
||||
}
|
||||
|
||||
# create symlinks in PATH, so that the GCC/GNAT versions match:
|
||||
|
||||
link_gcc_gnat_versions()
|
||||
{
|
||||
_gnudir="$3"
|
||||
_gnuver="$4"
|
||||
|
||||
remkdir "$xbtmp/gnupath"
|
||||
|
||||
x_ cd "$xbtmp/gnupath"
|
||||
|
||||
for _gnubin in "$_gnudir/$2"*"-$_gnuver"
|
||||
do
|
||||
_gnuutil="${_gnubin##*/}"
|
||||
[ -e "$_gnubin" ] && \
|
||||
x_ ln -s "$_gnubin" "${_gnuutil%"-$_gnuver"}"; :
|
||||
done
|
||||
}
|
||||
|
||||
# get the gcc/gnat version
|
||||
# fail: return 1 if util not found
|
||||
gnu_setver()
|
||||
{
|
||||
eval "$2 --version 1>/dev/null 2>/dev/null || return 1"
|
||||
|
||||
eval "$1ver=\"`"$2" --version 2>/dev/null | head -n1`\""
|
||||
eval "$1ver=\"\${$1ver##* }\""
|
||||
eval "$1full=\"\$$1ver\""
|
||||
eval "$1ver=\"\${$1ver%%.*}\""; :
|
||||
}
|
||||
|
||||
check_defconfig()
|
||||
{
|
||||
[ ! -f "$defconfig" ] && \
|
||||
$if_not_dry_build \
|
||||
err "$project/$target: no config" check_defconfig "$@"
|
||||
|
||||
dest_dir="$elfdir/$tree/$target/${defconfig#"$target_dir/config/"}"
|
||||
|
||||
# skip build if a previous one exists:
|
||||
|
||||
$if_dry_build \
|
||||
return 0
|
||||
elfcheck || \
|
||||
return 1; :
|
||||
}
|
||||
|
||||
elfcheck()
|
||||
{
|
||||
# TODO: *STILL* very hacky check. do it properly (based on build.list)
|
||||
|
||||
( fx_ "eval exit 1 && err" find "$dest_dir" -type f ) || return 1; :
|
||||
}
|
||||
|
||||
handle_makefile()
|
||||
{
|
||||
if $if_not_dry_build check_makefile "$srcdir"; then
|
||||
$if_not_dry_build \
|
||||
x_ make -C "$srcdir" $cleanargs clean
|
||||
fi
|
||||
|
||||
[ -f "$defconfig" ] && \
|
||||
x_ cp "$defconfig" "$srcdir/.config"
|
||||
|
||||
run_make_command || \
|
||||
err "no makefile!" "handle_makefile" "$@"
|
||||
|
||||
_copy=".config"
|
||||
|
||||
[ "$mode" = "savedefconfig" ] && \
|
||||
_copy="defconfig"
|
||||
|
||||
[ "${mode%config}" != "$mode" ] && \
|
||||
$if_not_dry_build \
|
||||
x_ cp "$srcdir/$_copy" "$defconfig"; :
|
||||
|
||||
[ -e "$srcdir/.git" ] && [ "$project" = "u-boot" ] && \
|
||||
[ "$mode" = "distclean" ] && \
|
||||
$if_not_dry_build \
|
||||
x_ git -C "$srcdir" $cleanargs clean -fdx; :
|
||||
}
|
||||
|
||||
run_make_command()
|
||||
{
|
||||
[ -z "$mode" ] && \
|
||||
x_ $premake
|
||||
|
||||
$if_not_dry_build check_cmake "$srcdir" && \
|
||||
[ -z "$mode" ] && \
|
||||
$if_not_dry_build \
|
||||
check_autoconf "$srcdir"
|
||||
|
||||
$if_not_dry_build check_makefile "$srcdir" || \
|
||||
return 1
|
||||
|
||||
$if_not_dry_build \
|
||||
x_ make -C "$srcdir" $mode -j$XBMK_THREADS $makeargs
|
||||
|
||||
[ -z "$mode" ] && \
|
||||
x_ $mkhelper
|
||||
|
||||
check_makefile "$srcdir" || \
|
||||
return 0
|
||||
|
||||
[ "$mode" = "clean" ] || \
|
||||
return 0
|
||||
$if_dry_build \
|
||||
return 0
|
||||
|
||||
make -C "$srcdir" $cleanargs distclean || \
|
||||
x_ make -C "$srcdir" $cleanargs clean; :
|
||||
}
|
||||
|
||||
check_cmake()
|
||||
{
|
||||
$if_dry_build \
|
||||
return 0
|
||||
[ ! -n "$cmakedir" ] && \
|
||||
return 0
|
||||
|
||||
check_makefile "$1" || \
|
||||
cmake -B "$1" "$1/$cmakedir" || \
|
||||
x_ check_makefile "$1"
|
||||
|
||||
x_ check_makefile "$1"; :
|
||||
}
|
||||
|
||||
check_autoconf()
|
||||
{
|
||||
(
|
||||
x_ cd "$1"
|
||||
|
||||
[ -f "bootstrap" ] && \
|
||||
x_ ./bootstrap $bootstrapargs
|
||||
[ -f "autogen.sh" ] && \
|
||||
x_ ./autogen.sh $autogenargs
|
||||
[ -f "configure" ] && \
|
||||
x_ ./configure $autoconfargs; :
|
||||
|
||||
) || err "can't bootstrap project: $1" "check_autoconf" "$@"; :
|
||||
}
|
||||
|
||||
check_makefile()
|
||||
{
|
||||
[ ! -f "$1/Makefile" ] && [ ! -f "$1/makefile" ] && \
|
||||
[ ! -f "$1/GNUmakefile" ] && \
|
||||
return 1; :
|
||||
}
|
||||
|
||||
copy_elf()
|
||||
{
|
||||
[ -f "$listfile" ] && \
|
||||
x_ mkdir -p "$dest_dir"
|
||||
|
||||
if [ -f "$listfile" ]; then
|
||||
while read -r f; do
|
||||
[ -f "$srcdir/$f" ] && \
|
||||
x_ cp "$srcdir/$f" "$dest_dir"; :
|
||||
|
||||
done < "$listfile" || err \
|
||||
"cannot read '$listfile'" "copy_elf" "$@"; :
|
||||
fi
|
||||
|
||||
( x_ make clean -C "$srcdir" $cleanargs ) || \
|
||||
err "can't make-clean '$srcdir'" "copy_elf" "$@"; :
|
||||
}
|
||||
|
||||
x_ main "$_f" "$@"
|
||||
|
||||
) || exit 1; :
|
||||
|
||||
Reference in New Issue
Block a user