Merge remote-tracking branch 'origin/efi' into next

This commit is contained in:
Michael Tremer
2018-08-16 12:49:13 +01:00
61 changed files with 4579 additions and 757 deletions

View File

@@ -79,6 +79,19 @@ DIR_TMP = /tmp
# 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
###############################################################################
# Common Macro Definitions
###############################################################################

109
lfs/cdrkit Normal file
View File

@@ -0,0 +1,109 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
###############################################################################
# Definitions
###############################################################################
include Config
VER = 1.1.11
THISAPP = cdrkit-$(VER)
DL_FILE = $(THISAPP).tar.gz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
###############################################################################
# Top-level Rules
###############################################################################
objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_MD5 = efe08e2f3ca478486037b053acd512e9
install : $(TARGET)
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
###############################################################################
# Downloading, checking, md5sum
###############################################################################
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
@$(CHECK)
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
$(subst %,%_MD5,$(objects)) :
@$(MD5)
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.8-werror.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.9-buffer_overflow.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.9-no_mp3.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.9-efi-boot.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.10-build-fix.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.11-cmakewarn.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.11-devname.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.11-dvdman.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.11-format.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.11-handler.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.11-manpagefix.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.11-memset.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.11-paranoiacdda.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.11-ppc64le_elfheader.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.11-readsegfault.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.11-rootstat.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.11-usalinst.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.11-utf8.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cdrkit/cdrkit-1.1.11-werror_gcc5.patch
cd $(DIR_APP) && sed -i CMakeLists.txt -e "s/icedax//g"
cd $(DIR_APP) && mkdir -pv build
cd $(DIR_APP)/build && cmake .. \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DBUILD_SHARED_LIBS:BOOL=ON
cd $(DIR_APP)/build && make $(MAKETUNING)
cd $(DIR_APP)/build && make install
ln -svf genisoimage /usr/bin/mkisofs
ln -svf genisoimage /usr/bin/mkhybrid
ln -svf icedax /usr/bin/cdda2wav
ln -svf wodim /usr/bin/cdrecord
ln -svf wodim /usr/bin/dvdrecord
@rm -rf $(DIR_APP)
@$(POSTBUILD)

169
lfs/cdrom
View File

@@ -29,6 +29,103 @@ VER = ipfire
THISAPP = cdrom
TARGET = $(DIR_INFO)/$(THISAPP)
ifeq "$(BUILD_PLATFORM)" "arm"
TAR_OPTIONS =
else
TAR_OPTIONS = --lzma
endif
HAS_MEMTEST = 0
HAS_IPXE = 0
HAS_ISOLINUX = 0
HAS_KERNEL = 1
ifeq "$(BUILD_PLATFORM)" "x86"
HAS_MEMTEST = 1
HAS_IPXE = 1
HAS_ISOLINUX = 1
endif
ifeq "$(BUILD_ARCH)" "armv5tel"
HAS_KERNEL = 0
endif
ISO_ARGS = -J -r -v \
-A "$(NAME) $(VERSION) $(BUILD_ARCH)" \
-V "$(NAME) $(VERSION) $(BUILD_ARCH)"
ISOHYBRID_ARGS =
ifeq "$(HAS_ISOLINUX)" "1"
ISO_ARGS += \
-no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
-b boot/isolinux/isolinux.bin \
-c boot/isolinux/boot.catalog
endif
ifeq "$(EFI)" "1"
ISO_ARGS += \
-eltorito-alt-boot \
-e boot/isolinux/efiboot.img \
-no-emul-boot
ISOHYBRID_ARGS += --uefi
endif
GRUB_EFI_MODULES = \
all_video \
at_keyboard \
boot \
bitmap_scale \
cat \
chain \
configfile \
disk \
echo \
efi_gop \
efi_uga \
ext2 \
extcmd \
fat \
file \
font \
fxterm_menu \
gfxterm \
gfxmenu \
gfxterm_background \
gzio \
halt \
help \
iso9660 \
jpeg \
loadbios \
loadenv \
loopback \
linux \
ls \
memdisk \
minicmd \
nativedisk \
normal \
ntfs \
part_gpt \
part_msdos \
png \
probe \
reboot \
regexp \
search \
search_fs_file \
search_fs_uuid \
search_label \
tar \
test \
tga \
true \
usb_keyboard
###############################################################################
# Top-level Rules
###############################################################################
@@ -79,15 +176,16 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
cp $(DIR_SRC)/doc/COPYING /install/cdrom/
cp $(DIR_SRC)/doc/{ChangeLog,packages-list.txt} /install/cdrom/doc
# Make the ISO
mkdir -p /install/cdrom/boot/isolinux
dd if=/dev/zero bs=1k count=2 > /install/cdrom/boot/isolinux/boot.catalog
ifneq "$(BUILD_PLATFORM)" "arm"
ifeq "$(HAS_KERNEL)" "1"
cp /boot/vmlinuz-$(KVER)-ipfire /install/cdrom/boot/isolinux/vmlinuz
dracut --force --early-microcode -a "installer" --strip --xz /install/cdrom/boot/isolinux/instroot $(KVER)-ipfire
endif
ifeq "$(HAS_ISOLINUX)" "1"
dd if=/dev/zero bs=1k count=2 > /install/cdrom/boot/isolinux/boot.catalog
cp $(DIR_SRC)/config/syslinux/boot.png /install/cdrom/boot/isolinux/boot.png
cp /usr/lib/memtest86+/memtest.bin /install/cdrom/boot/isolinux/memtest
cp /usr/share/ipfire-netboot/ipxe.lkrn /install/cdrom/boot/isolinux/netboot
cp /usr/share/syslinux/isolinux.bin /install/cdrom/boot/isolinux/isolinux.bin
cp /usr/share/hwdata/pci.ids /install/cdrom/boot/isolinux/pci.ids
cp -vf /usr/share/syslinux/*.c32 /install/cdrom/boot/isolinux/
@@ -95,16 +193,61 @@ ifneq "$(BUILD_PLATFORM)" "arm"
$(DIR_SRC)/config/syslinux/syslinux.cfg \
> /install/cdrom/boot/isolinux/isolinux.cfg
endif
ifeq "$(HAS_MEMTEST)" "1"
# Install memtest
cp /usr/lib/memtest86+/memtest.bin /install/cdrom/boot/isolinux/memtest
endif
ifeq "$(HAS_IPXE)" "1"
cp /usr/share/ipfire-netboot/ipxe.lkrn /install/cdrom/boot/isolinux/netboot
endif
ifeq "$(EFI)" "1"
# Generate embedded GRUB configuration
sed -e "s/NAME/$(NAME)/g" -e "s/VERSION/$(VERSION)/g" -e "s/ARCH/$(BUILD_ARCH)/g" \
$(DIR_SRC)/config/cdrom/grub-efi.cfg > /tmp/grub-efi.cfg
# Build a GRUB EFI image
mkdir -pv /install/cdrom/EFI/BOOT
grub-mkimage \
--format=$(GRUB_ARCH)-efi \
--output=/install/cdrom/EFI/BOOT/boot$(EFI_ARCH).efi \
--config=/tmp/grub-efi.cfg \
--compression=xz \
--prefix=/EFI/BOOT \
$$(for mod in $(GRUB_EFI_MODULES); do [ -f "/usr/lib/grub/$(GRUB_ARCH)-efi/$${mod}.mod" ] && echo "$${mod}"; done)
# Install GRUB configuration
mkdir -pv /install/cdrom/EFI/BOOT
sed -e "s/NAME/$(NAME)/g" -e "s/VERSION/$(VERSION)/g" -e "s/ARCH/$(BUILD_ARCH)/g" \
< $(DIR_SRC)/config/cdrom/grub.cfg > /install/cdrom/EFI/BOOT/grub.cfg
# Create the EFI Eltorito image
dd if=/dev/zero of=/install/cdrom/boot/isolinux/efiboot.img bs=1k count=1440
mkdosfs -F 12 -n "IPFIRE_EFI" /install/cdrom/boot/isolinux/efiboot.img
# Mount the EFI image
mkdir -pv /install/efiboot.img
mount -o loop /install/cdrom/boot/isolinux/efiboot.img /install/efiboot.img
# Copy the bootloader into the image
mkdir -pv /install/efiboot.img/EFI/BOOT
cp -a /install/cdrom/EFI/BOOT/boot$(EFI_ARCH).efi \
/install/efiboot.img/EFI/BOOT/boot$(EFI_ARCH).efi
# Cleanup
umount /install/efiboot.img
rm -rf /install/efiboot.img /tmp/grub-efi.cfg
endif
cd /install/cdrom && find -type f ! -name md5sum.txt | grep -v "./boot" | \
xargs md5sum > md5sum.txt
mkdir -p /install/images
ifeq "$(BUILD_PLATFORM)" "arm"
cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
. > /install/images/$(SNAME)-$(VERSION).$(BUILD_ARCH)-full-core$(CORE).iso
else
cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
-b boot/isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table \
-c boot/isolinux/boot.catalog . > /install/images/$(SNAME)-$(VERSION).$(BUILD_ARCH)-full-core$(CORE).iso
isohybrid /install/images/$(SNAME)-$(VERSION).$(BUILD_ARCH)-full-core$(CORE).iso
cd /install/cdrom && mkisofs $(ISO_ARGS) \
-o /install/images/$(SNAME)-$(VERSION).$(BUILD_ARCH)-full-core$(CORE).iso .
ifeq "$(HAS_ISOLINUX)" "1"
isohybrid $(ISOHYBRID_ARGS) /install/images/$(SNAME)-$(VERSION).$(BUILD_ARCH)-full-core$(CORE).iso
endif

80
lfs/efibootmgr Normal file
View File

@@ -0,0 +1,80 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2018 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
###############################################################################
# Definitions
###############################################################################
include Config
VER = 16
THISAPP = efibootmgr-$(VER)
DL_FILE = $(THISAPP).tar.bz2
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
SUP_ARCH = aarch64 x86_64
###############################################################################
# Top-level Rules
###############################################################################
objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_MD5 = ab7cf46774fda951a0e8a40beb65a90e
install : $(TARGET)
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
###############################################################################
# Downloading, checking, md5sum
###############################################################################
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
@$(CHECK)
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
$(subst %,%_MD5,$(objects)) :
@$(MD5)
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && make CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
EFIDIR=$(SNAME) $(MAKETUNING)
cd $(DIR_APP) && make install EFIDIR=$(SNAME)
@rm -rf $(DIR_APP)
@$(POSTBUILD)

View File

@@ -1,7 +1,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
# Copyright (C) 2007-2018 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@@ -24,13 +24,14 @@
include Config
VER = 0.2.1
VER = 35
THISAPP = dvdrtools-$(VER)
DL_FILE = $(THISAPP).tar.gz
THISAPP = efivar-$(VER)
DL_FILE = $(THISAPP).tar.bz2
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
SUP_ARCH = aarch64 x86_64
###############################################################################
# Top-level Rules
@@ -40,7 +41,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_MD5 = e82d359137e716e8c0b04d5c73bd3e79
$(DL_FILE)_MD5 = 53da18ea0cf7bba1fd9edf3098037edf
install : $(TARGET)
@@ -69,11 +70,10 @@ $(subst %,%_MD5,$(objects)) :
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
$(UPDATE_AUTOMAKE)
cd $(DIR_APP) && ./configure --prefix=/usr --mandir=/usr/share/man \
--disable-static
cd $(DIR_APP) && make $(MAKETUNING)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && make CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKETUNING)
cd $(DIR_APP) && make install
@rm -rf $(DIR_APP)
@$(POSTBUILD)

View File

@@ -31,6 +31,9 @@ TARGET = $(DIR_INFO)/$(THISAPP)
DEVICE = $(shell losetup -f)
PART_BOOT = /dev/mapper/$(patsubst /dev/%,%,$(DEVICE))p1
ifeq "$(EFI)" "1"
PART_EFI = /dev/mapper/$(patsubst /dev/%,%,$(DEVICE))p2
endif
PART_ROOT = /dev/mapper/$(patsubst /dev/%,%,$(DEVICE))p3
IMAGE_FILE = /install/images/$(SNAME)-$(VERSION).2gb-ext4.$(BUILD_ARCH)-full-core$(CORE).img.xz
@@ -62,11 +65,14 @@ ifeq "$(BUILD_PLATFORM)" "arm"
# FAT32
PART_TYPE = c
ifeq "$(BUILD_ARCH)" "aarch64"
BOOTLOADER = grub
endif
else
BOOTLOADER = grub
S_OFFSET = 8192
# Logical
# Linux
PART_TYPE = L
endif
@@ -75,8 +81,24 @@ endif
S_BOOT := $(shell echo $$(( 262144 - $(S_OFFSET) )))
S_ROOT := 2477600
ifeq "$(EFI)" "1"
S_EFI = 65536 # 32 MB
else
S_EFI = 0
endif
PADDING = 100 # MB
ifeq "$(EFI)" "1"
SFDISK = $(SFDISK_BOOT)$(SFDISK_EFI)$(SFDISK_ROOT)
else
SFDISK = $(SFDISK_BOOT),0,0\n$(SFDISK_ROOT)
endif
SFDISK_BOOT = $(S_OFFSET),$(S_BOOT),$(PART_TYPE),*\n
SFDISK_EFI = $(shell echo $$(( $(S_OFFSET) + $(S_BOOT) ))),$(S_EFI),U\n
SFDISK_ROOT = $(shell echo $$(( $(S_OFFSET) + $(S_BOOT) + $(S_EFI) ))),$(S_ROOT),L\n
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
# Stop if $(MNThdd) is still mounted
mountpoint $(MNThdd) && exit 1 || exit 0
@@ -84,13 +106,11 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
rm -rf $(IMG) $(MNThdd) && mkdir -p $(MNThdd)
# Allocate image on disk
dd if=/dev/zero of=$(IMG) bs=512 count=$$(( $(S_OFFSET) + $(S_BOOT) + $(S_ROOT) ))
dd if=/dev/zero of=$(IMG) bs=512 count=$$(( $(S_OFFSET) + $(S_BOOT) + $(S_EFI) + $(S_ROOT) ))
losetup $(DEVICE) $(IMG)
# Write Partition table
echo -e "$(S_OFFSET),$(S_BOOT),$(PART_TYPE),*\n,0,0\n$$(( $(S_BOOT) + $(S_OFFSET) )),$(S_ROOT),L\n" \
| sfdisk -uS $(DEVICE)
-echo -e "d\n2\nw\n\q\n" | fdisk $(DEVICE)
echo -e "$(SFDISK)" | sfdisk -uS $(DEVICE)
kpartx -v -a $(DEVICE)
@@ -99,6 +119,9 @@ ifeq "$(PART_TYPE)" "c"
mkfs.vfat $(PART_BOOT)
else
mkfs.ext2 -F $(PART_BOOT)
endif
ifeq "$(EFI)" "1"
mkfs.vfat $(PART_EFI)
endif
mkfs.ext4 -O ^has_journal,extent -F $(PART_ROOT)
@@ -113,6 +136,11 @@ endif
mkdir -pv $(MNThdd)/boot
mount $(PART_BOOT) $(MNThdd)/boot
ifeq "$(EFI)" "1"
mkdir -pv $(MNThdd)/boot/efi
mount $(PART_EFI) $(MNThdd)/boot/efi
endif
# Install Pandaboard MLO and uboot first
ifeq "$(BUILD_ARCH)" "armv5tel"
cp -v /boot/MLO $(MNThdd)/boot/
@@ -139,6 +167,10 @@ endif
# Create /etc/fstab
printf "$(FSTAB_FMT)" "$$(blkid -o value -s UUID $(PART_BOOT))" "/boot" \
"auto" "defaults" 1 2 > $(MNThdd)/etc/fstab
ifeq "$(EFI)" "1"
printf "$(FSTAB_FMT)" "$$(blkid -o value -s UUID $(PART_EFI))" "/boot/efi" \
"auto" "defaults" 1 2 >> $(MNThdd)/etc/fstab
endif
printf "$(FSTAB_FMT)" "$$(blkid -o value -s UUID $(PART_ROOT))" "/" \
"auto" "defaults" 1 1 >> $(MNThdd)/etc/fstab
@@ -166,9 +198,17 @@ ifeq "$(BOOTLOADER)" "grub"
sed -i $(MNThdd)/boot/grub/grub.cfg \
-e "s/root=[A-Za-z0-9\/=-]*/root=UUID=$$(blkid -o value -s UUID $(PART_ROOT))/g"
ifeq "$(BUILD_PLATFORM)" "x86"
# Install GRUB
grub-install --force --recheck --no-floppy --target=i386-pc \
--root-directory=$(MNThdd) $(DEVICE)
endif
ifeq "$(EFI)" "1"
# Install GRUB for EFI
grub-install --target=$(GRUB_ARCH)-efi --removable --no-nvram \
--boot-directory=$(MNThdd)/boot --efi-directory=$(MNThdd)/boot/efi
endif
# restore orginal defaults
mv -f $(MNThdd)/etc/default/grub.backup $(MNThdd)/etc/default/grub
@@ -185,6 +225,9 @@ endif
umount $(MNThdd)/proc
umount $(MNThdd)/sys
umount $(MNThdd)/dev
ifeq "$(EFI)" "1"
umount $(MNThdd)/boot/efi
endif
umount $(MNThdd)/boot
umount $(MNThdd)

View File

@@ -31,10 +31,30 @@ DL_FILE = $(THISAPP).tar.xz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
SUP_ARCH = x86_64 i586
SUP_ARCH = aarch64 x86_64 i586
CFLAGS =
CXXFLAGS =
# Build for which platforms?
ifeq "$(BUILD_ARCH)" "i586"
BUILD_PC = 1
endif
ifeq "$(BUILD_ARCH)" "x86_64"
BUILD_PC = 1
endif
BUILD_EFI = $(EFI)
DIR_APP_PC = $(DIR_APP)-pc
DIR_APP_EFI = $(DIR_APP)-efi
# Don't use our CFLAGS for boot code
export HOST_CFLAGS = $(CFLAGS)
export HOST_LDFLAGS = $(LDFLAGS)
CONFIGURE_ARGS = \
--prefix=/usr \
--sysconfdir=/etc \
--disable-werror
###############################################################################
# Top-level Rules
@@ -76,27 +96,38 @@ $(subst %,%_MD5,$(objects)) :
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
@rm -rf $(DIR_APP) $(DIR_APP_EFI) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub-2.02_disable_vga_fallback.patch
cd $(DIR_APP) && \
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--with-platform=pc \
--with-grubdir=grub \
--program-transform-name=s,grub,grub, \
--disable-grub-mount \
--disable-werror
cd $(DIR_APP) && make $(MAKETUNING)
cd $(DIR_APP) && make install
# Install unifont
cp -v $(DIR_DL)/unifont-7.0.03.pcf.gz $(DIR_APP)/unifont.pcf.gz
ifeq "$(BUILD_EFI)" "1"
cp -r $(DIR_APP) $(DIR_APP_EFI)
cd $(DIR_APP_EFI) && ./configure $(CONFIGURE_ARGS) \
--with-platform=efi CFLAGS= LDFLAGS=
cd $(DIR_APP_EFI) && make $(MAKETUNING)
cd $(DIR_APP_EFI) && make install
endif
ifeq "$(BUILD_PC)" "1"
cp -r $(DIR_APP) $(DIR_APP_PC)
cd $(DIR_APP_PC) && ./configure $(CONFIGURE_ARGS) \
--with-platform=pc CFLAGS= LDFLAGS=
cd $(DIR_APP_PC) && make $(MAKETUNING)
cd $(DIR_APP_PC) && make install
# Install empty configuration file
-mkdir -pv /boot/grub
touch /boot/grub/grub.cfg
ln -svf ../boot/grub/grub.cfg /etc/grub2.cfg
endif
# Install background image
-mkdir -pv /boot/grub
install -m 644 $(DIR_SRC)/config/grub2/splash.png /boot/grub/splash.png
# Install default configuration
-mkdir -pv /etc/default
install -m 644 $(DIR_SRC)/config/grub2/default /etc/default/grub
@@ -104,12 +135,5 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
paxctl -Cmpes /usr/sbin/grub-bios-setup /usr/sbin/grub-probe
paxctl -Cmpexs /usr/bin/grub-script-check
# We don't need to install unifont just to generate a grub2 compatible
# font archive for the graphical boot menu. The following command only
# converts Latin-1, Latin Extended A+B, Arrows, Box and Block characters.
/usr/bin/grub-mkfont --output /boot/grub/unifont.pf2 \
--range=0x0000-0x0241,0x2190-0x21FF,0x2500-0x259f \
$(DIR_DL)/unifont-7.0.03.pcf.gz
@rm -rf $(DIR_APP)
@rm -rf $(DIR_APP) $(DIR_APP_PC) $(DIR_APP_EFI)
@$(POSTBUILD)

View File

@@ -79,10 +79,17 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
cd $(DIR_APP) && tar axf $(DIR_DL)/ipxe-$(PXE_VER).tar.gz
cd $(DIR_APP) && rm -rfv ipxe && ln -s ipxe-$(PXE_VER) ipxe
cd $(DIR_APP) && make bin/ipxe.lkrn
ifeq "$(BUILD_ARCH)" "x86_64"
cd $(DIR_APP) && make bin-x86_64-efi/ipxe.efi
endif
# Installation
-mkdir -pv /usr/share/ipfire-netboot
cd $(DIR_APP) && install -m 644 bin/ipxe.lkrn /usr/share/ipfire-netboot
ifeq "$(BUILD_ARCH)" "x86_64"
cd $(DIR_APP) && install -m 644 bin-x86_64-efi/ipxe.efi \
/usr/share/ipfire-netboot
endif
@rm -rf $(DIR_APP)
@$(POSTBUILD)

View File

@@ -24,7 +24,7 @@
include Config
VER = 3.1
VER = 3.2
THISAPP = parted-$(VER)
DL_FILE = $(THISAPP).tar.xz
@@ -33,7 +33,7 @@ DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = parted
PAK_VER = 2
PAK_VER = 3
DEPS = ""
@@ -45,7 +45,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_MD5 = 5d89d64d94bcfefa9ce8f59f4b81bdcb
$(DL_FILE)_MD5 = 0247b6a7b314f8edeb618159fa95f9cb
install : $(TARGET)
@@ -78,6 +78,7 @@ $(subst %,%_MD5,$(objects)) :
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/parted-3.2-device-mapper.patch
cd $(DIR_APP) && ./configure --prefix=/usr --disable-device-mapper
cd $(DIR_APP) && make $(MAKETUNING)
cd $(DIR_APP) && make install

View File

@@ -24,7 +24,7 @@
include Config
VER = 4.06
VER = 6.04-pre1
THISAPP = syslinux-$(VER)
DL_FILE = $(THISAPP).tar.xz
@@ -33,6 +33,9 @@ DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
SUP_ARCH = x86_64 i586
# Clear compiler flags (mainly hardening)
CFLAGS =
###############################################################################
# Top-level Rules
###############################################################################
@@ -41,7 +44,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_MD5 = 77d33140860621cd850c3a7ab0ebb7d6
$(DL_FILE)_MD5 = f9c956fde0de29be297402ecbc8ff4d0
install : $(TARGET)
@@ -71,6 +74,18 @@ $(subst %,%_MD5,$(objects)) :
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && make install
# Build
cd $(DIR_APP) && make bios $(MAKETUNING)
ifeq "$(BUILD_ARCH)" "x86_64"
cd $(DIR_APP) && make efi64 $(MAKETUNING)
endif
# Install
cd $(DIR_APP) && make bios install
ifeq "$(BUILD_ARCH)" "x86_64"
cd $(DIR_APP) && make efi64 install
endif
@rm -rf $(DIR_APP)
@$(POSTBUILD)