# Add the compiler location and version and specs to the ccache hash
CCACHE_COMPILERCHECK += $(shell gcc -dumpspecs 2>/dev/null | md5sum | cut -d ' ' -f1)
+# We support EFI on x86_64 and aarch64
+ifeq "$(BUILD_ARCH)" "x86_64"
+ EFI = 1
+ EFI_ARCH = x64
+ GRUB_ARCH = $(BUILD_ARCH)
+endif
+
+ifeq "$(BUILD_ARCH)" "aarch64"
+ EFI = 1
+ EFI_ARCH = aa64
+ GRUB_ARCH = arm64
+endif
+
+# Basic modules
+GRUB_EFI_MODULES = \
+ configfile \
+ gzio \
+ linux \
+ loadenv \
+ normal \
+ regexp
+
+# Stuff for accessing file systems
+GRUB_EFI_MODULES += \
+ ext2 \
+ fat \
+ iso9660 \
+ part_gpt \
+ part_msdos \
+ udf
+
+# Graphics & IO
+GRUB_EFI_MODULES += \
+ all_video \
+ bitmap_scale \
+ font \
+ gfxmenu \
+ gfxterm \
+ jpeg \
+ png \
+ tga
+
+# Commands
+GRUB_EFI_MODULES += \
+ boot \
+ cat \
+ chain \
+ echo \
+ halt \
+ help \
+ ls \
+ minicmd \
+ probe \
+ reboot \
+ search \
+ search_fs_file \
+ search_fs_uuid \
+ search_label \
+ test \
+ true
+
+# Platform dependent modules
+ifeq "$(BUILD_ARCH)" "x86_64"
+ GRUB_EFI_MODULES += \
+ loadbios \
+ ahci \
+ at_keyboard \
+ usb_keyboard
+endif
+
###############################################################################
# Common Macro Definitions
###############################################################################
sed -e 's/BUILDTARGET/$(BUILDTARGET)/g' -e 's/KVER/$(KVER)/g' -e 's/MACHINE/$(BUILD_ARCH)/g' -i /install/packages/package/ROOTFILES
sed -e 's/xxxKVERxxx/$(KVER)/g' -i /install/packages/package/install.sh
chmod 755 /install/packages/package/{{,un}install,update}.sh
- cd / && tar cf /install/packages/package/files.tmp --files-from=/install/packages/package/ROOTFILES --exclude='#*' \
- -p --numeric-owner
+ cd / && tar cfp /install/packages/package/files.tmp --numeric-owner --exclude='#*' --files-from=/install/packages/package/ROOTFILES
# Double tar to remove double files
- tar xf /install/packages/package/files.tmp -C /install/packages/package/tmp/ \
- -p --numeric-owner
+ tar xfp /install/packages/package/files.tmp --numeric-owner -C /install/packages/package/tmp/
rm -f /install/packages/package/files.tmp
cd /install/packages/package/tmp/ && tar cf - -p --numeric-owner * | xz $(XZ_OPT) > /install/packages/package/files.tar.xz
rm -r /install/packages/package/tmp