mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 03:33:25 +02:00
make.sh: Cleanup of polluted environment
The build environment is using a number of variables which occasionally conflicted with some other build systems. This patch cleans that up by renaming some variables and later unexporting them in the lfs files. Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
11
lfs/Config
11
lfs/Config
@@ -30,6 +30,9 @@
|
|||||||
# #
|
# #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
# Cleanup environment from any variables
|
||||||
|
unexport BUILD_ARCH BUILD_PLATFORM BUILDTARGET CROSSTARGET TOOLCHAIN
|
||||||
|
|
||||||
# URLs that are common sources of downloads. If you're having trouble with
|
# URLs that are common sources of downloads. If you're having trouble with
|
||||||
# a site you should change its URL to that of a suitable mirror site.
|
# a site you should change its URL to that of a suitable mirror site.
|
||||||
#
|
#
|
||||||
@@ -117,13 +120,13 @@ define POSTBUILD
|
|||||||
if [ -s "$(TARGET)_diff" ]; then \
|
if [ -s "$(TARGET)_diff" ]; then \
|
||||||
LFS_SCRIPT=$(firstword $(MAKEFILE_LIST))$(KCFG); \
|
LFS_SCRIPT=$(firstword $(MAKEFILE_LIST))$(KCFG); \
|
||||||
echo $(LFS_SCRIPT); \
|
echo $(LFS_SCRIPT); \
|
||||||
ROOTFILE=$$(find $(DIR_SRC)/config/rootfiles/{common,packages}/{$(MACHINE),} -maxdepth 1 -type f -name $$LFS_SCRIPT 2>/dev/null | head -1); \
|
ROOTFILE=$$(find $(DIR_SRC)/config/rootfiles/{common,packages}/{$(BUILD_ARCH),} -maxdepth 1 -type f -name $$LFS_SCRIPT 2>/dev/null | head -1); \
|
||||||
if [ "$$ROOTFILE" = "" ]; then \
|
if [ "$$ROOTFILE" = "" ]; then \
|
||||||
touch $(TARGET)_missing_rootfile; \
|
touch $(TARGET)_missing_rootfile; \
|
||||||
ROOTFILE=$(TARGET)_missing_rootfile ; \
|
ROOTFILE=$(TARGET)_missing_rootfile ; \
|
||||||
echo "error $$LFS_SCRIPT not found in config/rootfiles"; \
|
echo "error $$LFS_SCRIPT not found in config/rootfiles"; \
|
||||||
fi; \
|
fi; \
|
||||||
sed -e "s/BUILDTARGET/$(BUILDTARGET)/g" -e "s/KVER/$(KVER)/g" -e "s/MACHINE/$(MACHINE)/g" $$ROOTFILE > $(TARGET)_rootfile; \
|
sed -e "s/BUILDTARGET/$(BUILDTARGET)/g" -e "s/KVER/$(KVER)/g" -e "s/MACHINE/$(BUILD_ARCH)/g" $$ROOTFILE > $(TARGET)_rootfile; \
|
||||||
for line in `cat $(TARGET)_diff`; do \
|
for line in `cat $(TARGET)_diff`; do \
|
||||||
if grep -qG "^#$$line$$" $(TARGET)_rootfile; then echo "#$$line" >> $(TARGET); \
|
if grep -qG "^#$$line$$" $(TARGET)_rootfile; then echo "#$$line" >> $(TARGET); \
|
||||||
elif grep -qG "^$$line$$" $(TARGET)_rootfile ; then echo "$$line" >> $(TARGET); \
|
elif grep -qG "^$$line$$" $(TARGET)_rootfile ; then echo "$$line" >> $(TARGET); \
|
||||||
@@ -178,13 +181,13 @@ define PAK
|
|||||||
cp -f /usr/src/src/paks/default/{,un}install.sh /usr/src/src/paks/default/update.sh \
|
cp -f /usr/src/src/paks/default/{,un}install.sh /usr/src/src/paks/default/update.sh \
|
||||||
/install/packages/package; \
|
/install/packages/package; \
|
||||||
fi
|
fi
|
||||||
for i in $(DIR_SRC)/config/rootfiles/packages/{$(MACHINE),}/$(PROG); do \
|
for i in $(DIR_SRC)/config/rootfiles/packages/{$(BUILD_ARCH),}/$(PROG); do \
|
||||||
if [ -e "$${i}" ]; then \
|
if [ -e "$${i}" ]; then \
|
||||||
cp -v $${i} /install/packages/package/ROOTFILES; \
|
cp -v $${i} /install/packages/package/ROOTFILES; \
|
||||||
break; \
|
break; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
sed -e 's/BUILDTARGET/$(BUILDTARGET)/g' -e 's/KVER/$(KVER)/g' -e 's/MACHINE/$(MACHINE)/g' -i /install/packages/package/ROOTFILES
|
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
|
sed -e 's/xxxKVERxxx/$(KVER)/g' -i /install/packages/package/install.sh
|
||||||
chmod 755 /install/packages/package/{{,un}install,update}.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='#*' \
|
cd / && tar cf /install/packages/package/files.tmp --files-from=/install/packages/package/ROOTFILES --exclude='#*' \
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ DL_FROM = $(URL_IPFIRE)
|
|||||||
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
||||||
TARGET = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)-$(VERSUFIX)
|
TARGET = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)-$(VERSUFIX)
|
||||||
|
|
||||||
#ifeq "$(MACHINE_TYPE)" "arm"
|
#ifeq "$(BUILD_PLATFORM)" "arm"
|
||||||
CFLAGS += -fno-PIC
|
CFLAGS += -fno-PIC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
|||||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1-ipfire-build.patch
|
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1-ipfire-build.patch
|
||||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-4.2.6-1-grsecurity.patch
|
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-4.2.6-1-grsecurity.patch
|
||||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-4.2.6-1-add_usbnet_modules.patch
|
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-4.2.6-1-add_usbnet_modules.patch
|
||||||
ifeq "$(MACHINE)" "x86_64"
|
ifeq "$(BUILD_ARCH)" "x86_64"
|
||||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1_no_dma_sgtable_on_x86_64.patch
|
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1_no_dma_sgtable_on_x86_64.patch
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ endif
|
|||||||
cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_DEFAULT_PS=y/# CPTCFG_CFG80211_DEFAULT_PS is not set/g" .config
|
cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_DEFAULT_PS=y/# CPTCFG_CFG80211_DEFAULT_PS is not set/g" .config
|
||||||
cd $(DIR_APP) && sed -i -e "s/CPTCFG_NFC=m/# CPTCFG_NFC is not set/g" .config
|
cd $(DIR_APP) && sed -i -e "s/CPTCFG_NFC=m/# CPTCFG_NFC is not set/g" .config
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "x86_64"
|
ifeq "$(BUILD_ARCH)" "x86_64"
|
||||||
cd $(DIR_APP) && sed -i -e "s/CPTCFG_LIBERTAS_UAP=m/# CPTCFG_LIBERTAS_UAP is not set/g" .config
|
cd $(DIR_APP) && sed -i -e "s/CPTCFG_LIBERTAS_UAP=m/# CPTCFG_LIBERTAS_UAP is not set/g" .config
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
12
lfs/binutils
12
lfs/binutils
@@ -72,7 +72,7 @@ else
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "armv5tel"
|
ifeq "$(BUILD_ARCH)" "armv5tel"
|
||||||
EXTRA_CONFIG += \
|
EXTRA_CONFIG += \
|
||||||
--with-abi=aapcs-linux \
|
--with-abi=aapcs-linux \
|
||||||
--with-float=soft
|
--with-float=soft
|
||||||
@@ -124,15 +124,15 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
|||||||
# Prevent installing libiberty to lib64.
|
# Prevent installing libiberty to lib64.
|
||||||
cd $(DIR_APP) && sed -i 's%\(^MULTIOSDIR = \).*%\1 ../lib%' libiberty/Makefile.in
|
cd $(DIR_APP) && sed -i 's%\(^MULTIOSDIR = \).*%\1 ../lib%' libiberty/Makefile.in
|
||||||
|
|
||||||
cd $(DIR_SRC)/binutils-build && $(EXTRA_ENV) MACHINE= $(DIR_APP)/configure $(EXTRA_CONFIG)
|
cd $(DIR_SRC)/binutils-build && $(EXTRA_ENV) $(DIR_APP)/configure $(EXTRA_CONFIG)
|
||||||
cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING) MACHINE=
|
cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING)
|
||||||
cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install MACHINE=
|
cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install
|
||||||
ifeq "$(ROOT)" ""
|
ifeq "$(ROOT)" ""
|
||||||
cp -v $(DIR_APP)/include/libiberty.h /usr/include
|
cp -v $(DIR_APP)/include/libiberty.h /usr/include
|
||||||
else
|
else
|
||||||
ifeq "$(PASS)" "2"
|
ifeq "$(PASS)" "2"
|
||||||
cd $(DIR_SRC)/binutils-build && make -C ld clean MACHINE=
|
cd $(DIR_SRC)/binutils-build && make -C ld clean
|
||||||
cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib MACHINE=
|
cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib
|
||||||
cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
|
cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
14
lfs/cdrom
14
lfs/cdrom
@@ -29,7 +29,7 @@ VER = ipfire
|
|||||||
THISAPP = cdrom
|
THISAPP = cdrom
|
||||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||||
|
|
||||||
ifeq "$(MACHINE_TYPE)" "arm"
|
ifeq "$(BUILD_PLATFORM)" "arm"
|
||||||
TAR_OPTIONS =
|
TAR_OPTIONS =
|
||||||
else
|
else
|
||||||
TAR_OPTIONS = --lzma
|
TAR_OPTIONS = --lzma
|
||||||
@@ -64,7 +64,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
|||||||
echo > /etc/mtab
|
echo > /etc/mtab
|
||||||
|
|
||||||
# Create filelist for packaging.
|
# Create filelist for packaging.
|
||||||
BUILDTARGET="$(BUILDTARGET)" MACHINE="$(MACHINE)" KVER="$(KVER)" \
|
BUILDTARGET="$(BUILDTARGET)" BUILD_ARCH="$(BUILD_ARCH)" KVER="$(KVER)" \
|
||||||
$(DIR_SRC)/src/scripts/archive.files \
|
$(DIR_SRC)/src/scripts/archive.files \
|
||||||
$(DIR_SRC)/config/rootfiles/common \
|
$(DIR_SRC)/config/rootfiles/common \
|
||||||
> /tmp/ROOTFILES
|
> /tmp/ROOTFILES
|
||||||
@@ -89,7 +89,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
|||||||
# Make the ISO
|
# Make the ISO
|
||||||
mkdir -p /install/cdrom/boot/isolinux
|
mkdir -p /install/cdrom/boot/isolinux
|
||||||
dd if=/dev/zero bs=1k count=2 > /install/cdrom/boot/isolinux/boot.catalog
|
dd if=/dev/zero bs=1k count=2 > /install/cdrom/boot/isolinux/boot.catalog
|
||||||
ifneq "$(MACHINE_TYPE)" "arm"
|
ifneq "$(BUILD_PLATFORM)" "arm"
|
||||||
cp /boot/vmlinuz-$(KVER)-ipfire /install/cdrom/boot/isolinux/vmlinuz
|
cp /boot/vmlinuz-$(KVER)-ipfire /install/cdrom/boot/isolinux/vmlinuz
|
||||||
dracut --force -a "installer" --strip --xz /install/cdrom/boot/isolinux/instroot $(KVER)-ipfire
|
dracut --force -a "installer" --strip --xz /install/cdrom/boot/isolinux/instroot $(KVER)-ipfire
|
||||||
cp $(DIR_SRC)/config/syslinux/boot.png /install/cdrom/boot/isolinux/boot.png
|
cp $(DIR_SRC)/config/syslinux/boot.png /install/cdrom/boot/isolinux/boot.png
|
||||||
@@ -106,12 +106,12 @@ endif
|
|||||||
xargs md5sum > md5sum.txt
|
xargs md5sum > md5sum.txt
|
||||||
|
|
||||||
mkdir -p /install/images
|
mkdir -p /install/images
|
||||||
ifeq "$(MACHINE_TYPE)" "arm"
|
ifeq "$(BUILD_PLATFORM)" "arm"
|
||||||
cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
|
cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
|
||||||
. > /install/images/$(SNAME)-$(VERSION).$(MACHINE)-full-core$(CORE).iso
|
. > /install/images/$(SNAME)-$(VERSION).$(BUILD_ARCH)-full-core$(CORE).iso
|
||||||
else
|
else
|
||||||
cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
|
cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
|
||||||
-b boot/isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table \
|
-b boot/isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table \
|
||||||
-c boot/isolinux/boot.catalog . > /install/images/$(SNAME)-$(VERSION).$(MACHINE)-full-core$(CORE).iso
|
-c boot/isolinux/boot.catalog . > /install/images/$(SNAME)-$(VERSION).$(BUILD_ARCH)-full-core$(CORE).iso
|
||||||
isohybrid /install/images/$(SNAME)-$(VERSION).$(MACHINE)-full-core$(CORE).iso
|
isohybrid /install/images/$(SNAME)-$(VERSION).$(BUILD_ARCH)-full-core$(CORE).iso
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ PAK_VER = 34
|
|||||||
|
|
||||||
DEPS = ""
|
DEPS = ""
|
||||||
|
|
||||||
ifeq "$(MACHINE_TYPE)" "arm"
|
ifeq "$(BUILD_PLATFORM)" "arm"
|
||||||
CONFIGURE_FLAGS = --disable-fanotify
|
CONFIGURE_FLAGS = --disable-fanotify
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ core/%:
|
|||||||
$(DIR_SRC)/src/scripts/archive.files \
|
$(DIR_SRC)/src/scripts/archive.files \
|
||||||
$(DIR_SRC)/config/rootfiles/$@/filelists \
|
$(DIR_SRC)/config/rootfiles/$@/filelists \
|
||||||
$(DIR_SRC)/config/rootfiles/$@/files \
|
$(DIR_SRC)/config/rootfiles/$@/files \
|
||||||
$(DIR_SRC)/config/rootfiles/$@/files.$(MACHINE) \
|
$(DIR_SRC)/config/rootfiles/$@/files.$(BUILD_ARCH) \
|
||||||
> /tmp/ROOTFILES.tmp
|
> /tmp/ROOTFILES.tmp
|
||||||
|
|
||||||
#remove excluded files from ROOTFILES
|
#remove excluded files from ROOTFILES
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ PART_BOOT = /dev/mapper/$(patsubst /dev/%,%,$(DEVICE))p1
|
|||||||
PART_ROOT = /dev/mapper/$(patsubst /dev/%,%,$(DEVICE))p3
|
PART_ROOT = /dev/mapper/$(patsubst /dev/%,%,$(DEVICE))p3
|
||||||
|
|
||||||
ifeq "$(SCON)" "1"
|
ifeq "$(SCON)" "1"
|
||||||
IMAGE_FILE = /install/images/$(SNAME)-$(VERSION).1gb-ext4-scon.$(MACHINE)-full-core$(CORE).img.gz
|
IMAGE_FILE = /install/images/$(SNAME)-$(VERSION).1gb-ext4-scon.$(BUILD_ARCH)-full-core$(CORE).img.gz
|
||||||
else
|
else
|
||||||
IMAGE_FILE = /install/images/$(SNAME)-$(VERSION).1gb-ext4.$(MACHINE)-full-core$(CORE).img.gz
|
IMAGE_FILE = /install/images/$(SNAME)-$(VERSION).1gb-ext4.$(BUILD_ARCH)-full-core$(CORE).img.gz
|
||||||
endif
|
endif
|
||||||
|
|
||||||
FSTAB_FMT = UUID=%s %-8s %-4s %-10s %d %d\n
|
FSTAB_FMT = UUID=%s %-8s %-4s %-10s %d %d\n
|
||||||
@@ -60,7 +60,7 @@ MNThdd := /install/harddisk
|
|||||||
IMG := /install/images/image.img
|
IMG := /install/images/image.img
|
||||||
|
|
||||||
# All sizes in blocks
|
# All sizes in blocks
|
||||||
ifeq "$(MACHINE_TYPE)" "arm"
|
ifeq "$(BUILD_PLATFORM)" "arm"
|
||||||
BOOTLOADER =
|
BOOTLOADER =
|
||||||
S_OFFSET = 8192
|
S_OFFSET = 8192
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ endif
|
|||||||
mount $(PART_BOOT) $(MNThdd)/boot
|
mount $(PART_BOOT) $(MNThdd)/boot
|
||||||
|
|
||||||
# Install Pandaboard MLO and uboot first
|
# Install Pandaboard MLO and uboot first
|
||||||
ifeq "$(MACHINE_TYPE)" "arm"
|
ifeq "$(BUILD_PLATFORM)" "arm"
|
||||||
cp -v /boot/MLO $(MNThdd)/boot/
|
cp -v /boot/MLO $(MNThdd)/boot/
|
||||||
cp -v /boot/u-boot.img $(MNThdd)/boot/
|
cp -v /boot/u-boot.img $(MNThdd)/boot/
|
||||||
cp -v /boot/zImage-ipfire-multi $(MNThdd)/boot/
|
cp -v /boot/zImage-ipfire-multi $(MNThdd)/boot/
|
||||||
@@ -135,7 +135,7 @@ ifeq "$(MACHINE_TYPE)" "arm"
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Install IPFire
|
# Install IPFire
|
||||||
ifneq "$(MACHINE_TYPE)" "arm"
|
ifneq "$(BUILD_PLATFORM)" "arm"
|
||||||
tar -x --lzma -C $(MNThdd)/ -f /install/cdrom/distro.img
|
tar -x --lzma -C $(MNThdd)/ -f /install/cdrom/distro.img
|
||||||
else
|
else
|
||||||
tar -x -C $(MNThdd)/ -f /install/cdrom/distro.img
|
tar -x -C $(MNThdd)/ -f /install/cdrom/distro.img
|
||||||
@@ -154,7 +154,7 @@ ifeq "$(SCON)" "1"
|
|||||||
sed -i -e "s|6:2345:respawn:|#6:2345:respawn:|g" $(MNThdd)/etc/inittab
|
sed -i -e "s|6:2345:respawn:|#6:2345:respawn:|g" $(MNThdd)/etc/inittab
|
||||||
sed -i -e "s|#7:2345:respawn:|7:2345:respawn:|g" $(MNThdd)/etc/inittab
|
sed -i -e "s|#7:2345:respawn:|7:2345:respawn:|g" $(MNThdd)/etc/inittab
|
||||||
|
|
||||||
ifeq "$(MACHINE_TYPE)" "arm"
|
ifeq "$(BUILD_PLATFORM)" "arm"
|
||||||
sed -i -e "s| console=tty1 | console=ttyAMA0,115200n8 |g" $(MNThdd)/boot/cmdline.txt
|
sed -i -e "s| console=tty1 | console=ttyAMA0,115200n8 |g" $(MNThdd)/boot/cmdline.txt
|
||||||
sed -i -e "s| console=tty1 | console=ttyO2,115200n8 |g" $(MNThdd)/boot/uEnv.txt
|
sed -i -e "s| console=tty1 | console=ttyO2,115200n8 |g" $(MNThdd)/boot/uEnv.txt
|
||||||
endif
|
endif
|
||||||
@@ -228,7 +228,7 @@ endif
|
|||||||
# not copied to a block device)
|
# not copied to a block device)
|
||||||
dd if=/dev/zero bs=1M count=$(PADDING) >> $(IMG)
|
dd if=/dev/zero bs=1M count=$(PADDING) >> $(IMG)
|
||||||
|
|
||||||
ifeq "$(MACHINE_TYPE)" "arm"
|
ifeq "$(BUILD_PLATFORM)" "arm"
|
||||||
# Install u-boot for LeMaker Banana Pi into image 8KB
|
# Install u-boot for LeMaker Banana Pi into image 8KB
|
||||||
dd if=/usr/share/u-boot/banana_pi/u-boot-sunxi-with-spl.bin of=$(IMG) bs=1K seek=8 conv=notrunc
|
dd if=/usr/share/u-boot/banana_pi/u-boot-sunxi-with-spl.bin of=$(IMG) bs=1K seek=8 conv=notrunc
|
||||||
endif
|
endif
|
||||||
|
|||||||
8
lfs/gcc
8
lfs/gcc
@@ -133,24 +133,24 @@ endif
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "armv7hl"
|
ifeq "$(BUILD_ARCH)" "armv7hl"
|
||||||
EXTRA_CONFIG += \
|
EXTRA_CONFIG += \
|
||||||
--with-float=hard
|
--with-float=hard
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "armv5tel"
|
ifeq "$(BUILD_ARCH)" "armv5tel"
|
||||||
EXTRA_CONFIG += \
|
EXTRA_CONFIG += \
|
||||||
--with-float=soft \
|
--with-float=soft \
|
||||||
--disable-sjlj-exceptions
|
--disable-sjlj-exceptions
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "i586"
|
ifeq "$(BUILD_ARCH)" "i586"
|
||||||
EXTRA_CONFIG += \
|
EXTRA_CONFIG += \
|
||||||
--with-arch=i586 \
|
--with-arch=i586 \
|
||||||
--with-tune=generic
|
--with-tune=generic
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "x86_64"
|
ifeq "$(BUILD_ARCH)" "x86_64"
|
||||||
EXTRA_CONFIG += \
|
EXTRA_CONFIG += \
|
||||||
--disable-multilib
|
--disable-multilib
|
||||||
endif
|
endif
|
||||||
|
|||||||
33
lfs/glibc
33
lfs/glibc
@@ -53,16 +53,16 @@ endif
|
|||||||
# Enable some extra optimization for the glibc code
|
# Enable some extra optimization for the glibc code
|
||||||
CFLAGS = -O3 -DNDEBUG -fasynchronous-unwind-tables -fPIC -DPIC
|
CFLAGS = -O3 -DNDEBUG -fasynchronous-unwind-tables -fPIC -DPIC
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "armv7hl"
|
ifeq "$(BUILD_ARCH)" "armv7hl"
|
||||||
CFLAGS += -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard
|
CFLAGS += -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "i586"
|
ifeq "$(BUILD_ARCH)" "i586"
|
||||||
CFLAGS += -march=i586 -mtune=generic -mno-tls-direct-seg-refs
|
CFLAGS += -march=i586 -mtune=generic -mno-tls-direct-seg-refs
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Disable hardware FP for armv5tel
|
# Disable hardware FP for armv5tel
|
||||||
ifeq "$(MACHINE)" "armv5tel"
|
ifeq "$(BUILD_ARCH)" "armv5tel"
|
||||||
EXTRA_CONFIG += \
|
EXTRA_CONFIG += \
|
||||||
--without-fp
|
--without-fp
|
||||||
endif
|
endif
|
||||||
@@ -117,19 +117,21 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
|||||||
@rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
|
@rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
|
||||||
@mkdir $(DIR_SRC)/glibc-build
|
@mkdir $(DIR_SRC)/glibc-build
|
||||||
|
|
||||||
ifeq "$(ROOT)" ""
|
ifneq "$(TOOLCHAIN)" "1"
|
||||||
ifeq "$(MACHINE_TYPE)" "arm"
|
ifeq "$(BUILD_ARCH)" "x86_64"
|
||||||
cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.3 -o|' \
|
|
||||||
scripts/test-installation.pl
|
|
||||||
else
|
|
||||||
ifeq "$(MACHINE)" "x86_64"
|
|
||||||
cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib64 -Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 -o|' \
|
cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib64 -Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 -o|' \
|
||||||
scripts/test-installation.pl
|
scripts/test-installation.pl
|
||||||
else
|
endif
|
||||||
|
|
||||||
|
ifeq "$(BUILD_ARCH)" "i586"
|
||||||
cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \
|
cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \
|
||||||
scripts/test-installation.pl
|
scripts/test-installation.pl
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
ifeq "$(BUILD_ARCH)" "armv5tel"
|
||||||
|
cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.3 -o|' \
|
||||||
|
scripts/test-installation.pl
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
cd $(DIR_SRC)/glibc-build && \
|
cd $(DIR_SRC)/glibc-build && \
|
||||||
@@ -141,15 +143,16 @@ endif
|
|||||||
|
|
||||||
cd $(DIR_SRC)/glibc-build && make install
|
cd $(DIR_SRC)/glibc-build && make install
|
||||||
|
|
||||||
ifeq "$(ROOT)" ""
|
ifeq "$(TOOLCHAIN)" "1"
|
||||||
|
ln -svf lib /tools/lib64
|
||||||
|
else
|
||||||
# Creating the locales
|
# Creating the locales
|
||||||
mkdir -p /usr/lib/locale
|
mkdir -p /usr/lib/locale
|
||||||
cd $(DIR_SRC)/glibc-build && make localedata/install-locales
|
cd $(DIR_SRC)/glibc-build && make localedata/install-locales
|
||||||
|
|
||||||
# Timezone data will be shipped by tzdata.
|
# Timezone data will be shipped by tzdata.
|
||||||
rm -rfv /usr/share/zoneinfo
|
rm -rfv /usr/share/zoneinfo
|
||||||
else
|
|
||||||
ln -svf lib /tools/lib64
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build
|
@rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build
|
||||||
@$(POSTBUILD)
|
@$(POSTBUILD)
|
||||||
|
|||||||
6
lfs/gmp
6
lfs/gmp
@@ -32,9 +32,9 @@ DL_FROM = $(URL_IPFIRE)
|
|||||||
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
||||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "i586"
|
ifeq "$(BUILD_ARCH)" "i586"
|
||||||
CONFIGURE_ARGS = ABI=32
|
CONFIGURE_ARGS = ABI=32
|
||||||
BUILDTARGET_PENTIUM4 = $(patsubst $(MACHINE)-%,pentium4-%,$(BUILDTARGET))
|
BUILDTARGET_PENTIUM4 = $(patsubst $(BUILD_ARCH)-%,pentium4-%,$(BUILDTARGET))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CONFIGURE_OPTIONS = \
|
CONFIGURE_OPTIONS = \
|
||||||
@@ -89,7 +89,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
|||||||
cd $(DIR_APP) && make $(MAKETUNING)
|
cd $(DIR_APP) && make $(MAKETUNING)
|
||||||
cd $(DIR_APP) && make install
|
cd $(DIR_APP) && make install
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "i586"
|
ifeq "$(BUILD_ARCH)" "i586"
|
||||||
# Build SSE/SSE2 optimised version for x86
|
# Build SSE/SSE2 optimised version for x86
|
||||||
cd $(DIR_APP) && make clean
|
cd $(DIR_APP) && make clean
|
||||||
cd $(DIR_APP) && \
|
cd $(DIR_APP) && \
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ DL_FROM = $(URL_IPFIRE)
|
|||||||
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
||||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "i586"
|
ifeq "$(BUILD_ARCH)" "i586"
|
||||||
CONFIGURE_ARGS = ABI=32
|
CONFIGURE_ARGS = ABI=32
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ $(TARGET) :
|
|||||||
done
|
done
|
||||||
|
|
||||||
# ARM does not need acpid, intel no swconfig
|
# ARM does not need acpid, intel no swconfig
|
||||||
ifeq "$(MACHINE_TYPE)" "arm"
|
ifeq "$(BUILD_PLATFORM)" "arm"
|
||||||
rm -vf /etc/rc.d/init.d/acpid
|
rm -vf /etc/rc.d/init.d/acpid
|
||||||
ln -sf ../init.d/swconfig /etc/rc.d/rcsysinit.d/S73swconfig
|
ln -sf ../init.d/swconfig /etc/rc.d/rcsysinit.d/S73swconfig
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ DIR_APP = $(DIR_SRC)/$(THISAPP)
|
|||||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||||
|
|
||||||
SLOGAN = An Open Source Firewall Solution
|
SLOGAN = An Open Source Firewall Solution
|
||||||
DOWNLOAD_URL = http://downloads.ipfire.org/releases/ipfire-2.x/$(VERSION)-core$(CORE)/$(SNAME)-$(VERSION).$(MACHINE)-full-core$(CORE).iso
|
DOWNLOAD_URL = http://downloads.ipfire.org/releases/ipfire-2.x/$(VERSION)-core$(CORE)/$(SNAME)-$(VERSION).$(BUILD_ARCH)-full-core$(CORE).iso
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Top-level Rules
|
# Top-level Rules
|
||||||
|
|||||||
34
lfs/linux
34
lfs/linux
@@ -40,10 +40,16 @@ CXXFLAGS =
|
|||||||
PAK_VER = 73
|
PAK_VER = 73
|
||||||
DEPS = ""
|
DEPS = ""
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "i586"
|
ifeq "$(BUILD_ARCH)" "i586"
|
||||||
KERNEL_ARCH = i386
|
KERNEL_ARCH = i386
|
||||||
else
|
else
|
||||||
KERNEL_ARCH = $(MACHINE)
|
KERNEL_ARCH = $(BUILD_ARCH)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq "$(BUILD_ARCH)" "aarch64"
|
||||||
|
HEADERS_ARCH = arm64
|
||||||
|
else
|
||||||
|
HEADERS_ARCH = $(BUILD_PLATFORM)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
VERSUFIX=ipfire$(KCFG)
|
VERSUFIX=ipfire$(KCFG)
|
||||||
@@ -56,26 +62,6 @@ else
|
|||||||
HEADERS_PREFIX = /usr
|
HEADERS_PREFIX = /usr
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "armv7hl"
|
|
||||||
HEADERS_ARCH=arm
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "armv5tel"
|
|
||||||
HEADERS_ARCH=arm
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "aarch64"
|
|
||||||
HEADERS_ARCH=arm64
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "x86_64"
|
|
||||||
HEADERS_ARCH=x86
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "i586"
|
|
||||||
HEADERS_ARCH=x86
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq "$(KCFG)" ""
|
ifeq "$(KCFG)" ""
|
||||||
LASTKERNEL=1
|
LASTKERNEL=1
|
||||||
endif
|
endif
|
||||||
@@ -264,7 +250,7 @@ else
|
|||||||
drivers/video/logo/logo_linux_clut224.ppm
|
drivers/video/logo/logo_linux_clut224.ppm
|
||||||
|
|
||||||
# Cleanup kernel source
|
# Cleanup kernel source
|
||||||
cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE)-$(VERSUFIX) $(DIR_APP)/.config
|
cp $(DIR_SRC)/config/kernel/kernel.config.$(BUILD_ARCH)-$(VERSUFIX) $(DIR_APP)/.config
|
||||||
cd $(DIR_APP) && make oldconfig
|
cd $(DIR_APP) && make oldconfig
|
||||||
cd $(DIR_APP) && make clean
|
cd $(DIR_APP) && make clean
|
||||||
cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ -$(VERSUFIX)/' Makefile
|
cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ -$(VERSUFIX)/' Makefile
|
||||||
@@ -295,7 +281,7 @@ endif
|
|||||||
cd $(DIR_APP) && make $(MAKETUNING) modules_install
|
cd $(DIR_APP) && make $(MAKETUNING) modules_install
|
||||||
cd $(DIR_APP) && make $(MAKETUNING) firmware_install
|
cd $(DIR_APP) && make $(MAKETUNING) firmware_install
|
||||||
|
|
||||||
ifeq "$(MACHINE_TYPE)" "arm"
|
ifeq "$(BUILD_PLATFORM)" "arm"
|
||||||
cd $(DIR_APP) && make $(MAKETUNING) dtbs
|
cd $(DIR_APP) && make $(MAKETUNING) dtbs
|
||||||
cd $(DIR_APP) && for f in $$(find arch/arm/boot/dts/ -name *.dtb); do \
|
cd $(DIR_APP) && for f in $$(find arch/arm/boot/dts/ -name *.dtb); do \
|
||||||
mkdir -p /boot/dtb-$(VER)-$(VERSUFIX) ; \
|
mkdir -p /boot/dtb-$(VER)-$(VERSUFIX) ; \
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
|||||||
# gcc-4.9.3 produce a corrupted version of memtest
|
# gcc-4.9.3 produce a corrupted version of memtest
|
||||||
# we use the precomp version at the moment
|
# we use the precomp version at the moment
|
||||||
|
|
||||||
#ifeq "$(MACHINE)" "i586"
|
#ifeq "$(BUILD_ARCH)" "i586"
|
||||||
# # Enable SMP as default
|
# # Enable SMP as default
|
||||||
# cd $(DIR_APP) && sed -i -e "s|CONSERVATIVE_SMP 1|CONSERVATIVE_SMP 0|g" config.h
|
# cd $(DIR_APP) && sed -i -e "s|CONSERVATIVE_SMP 1|CONSERVATIVE_SMP 0|g" config.h
|
||||||
# cd $(DIR_APP) && sed -i -e "s|scp |echo |g" Makefile
|
# cd $(DIR_APP) && sed -i -e "s|scp |echo |g" Makefile
|
||||||
|
|||||||
@@ -63,11 +63,11 @@ CONFIGURE_OPTIONS = \
|
|||||||
no-srp \
|
no-srp \
|
||||||
-DSSL_FORBID_ENULL
|
-DSSL_FORBID_ENULL
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "x86_64"
|
ifeq "$(BUILD_ARCH)" "x86_64"
|
||||||
CONFIGURE_OPTIONS += linux-x86_64
|
CONFIGURE_OPTIONS += linux-x86_64
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "i586"
|
ifeq "$(BUILD_ARCH)" "i586"
|
||||||
CONFIGURE_OPTIONS += linux-elf
|
CONFIGURE_OPTIONS += linux-elf
|
||||||
|
|
||||||
ifneq "$(KCFG)" "-sse2"
|
ifneq "$(KCFG)" "-sse2"
|
||||||
@@ -75,7 +75,7 @@ ifneq "$(KCFG)" "-sse2"
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "armv5tel"
|
ifeq "$(BUILD_ARCH)" "armv5tel"
|
||||||
CONFIGURE_OPTIONS += linux-generic32
|
CONFIGURE_OPTIONS += linux-generic32
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
|||||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openssl-1.0.2g-disable-sslv2v3.patch
|
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openssl-1.0.2g-disable-sslv2v3.patch
|
||||||
|
|
||||||
# i586 specific patches
|
# i586 specific patches
|
||||||
ifeq "$(MACHINE)" "i586"
|
ifeq "$(BUILD_ARCH)" "i586"
|
||||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openssl-1.0.2a_auto_enable_padlock.patch
|
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openssl-1.0.2a_auto_enable_padlock.patch
|
||||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openssl-1.0.2a_disable_ssse3_for_amd.patch
|
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openssl-1.0.2a_disable_ssse3_for_amd.patch
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -30,10 +30,10 @@ THISAPP = pakfire
|
|||||||
DIR_APP = /opt/$(THISAPP)
|
DIR_APP = /opt/$(THISAPP)
|
||||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "i586"
|
ifeq "$(BUILD_ARCH)" "i586"
|
||||||
PAKFIRE_VERSION = $(VERSION)
|
PAKFIRE_VERSION = $(VERSION)
|
||||||
else
|
else
|
||||||
PAKFIRE_VERSION = $(VERSION)-$(MACHINE)
|
PAKFIRE_VERSION = $(VERSION)-$(BUILD_ARCH)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|||||||
2
lfs/php
2
lfs/php
@@ -32,7 +32,7 @@ DL_FROM = $(URL_IPFIRE)
|
|||||||
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
||||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||||
|
|
||||||
ifeq "$(MACHINE_TYPE)" "arm"
|
ifeq "$(BUILD_PLATFORM)" "arm"
|
||||||
CFLAGS := $(patsubst -march=%,,$(CFLAGS))
|
CFLAGS := $(patsubst -march=%,,$(CFLAGS))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -48,5 +48,5 @@ install : $(DIR_INFO)/_build.othersrc-list.log
|
|||||||
|
|
||||||
# make the sources CDROM iso
|
# make the sources CDROM iso
|
||||||
cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
|
cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
|
||||||
. > /install/images/$(SNAME)-sources-cd-$(VERSION).$(MACHINE).iso
|
. > /install/images/$(SNAME)-sources-cd-$(VERSION).$(BUILD_ARCH).iso
|
||||||
rm -rf /install/cdrom/*
|
rm -rf /install/cdrom/*
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ $(TARGET) :
|
|||||||
# Symlink /var/run -> /run.
|
# Symlink /var/run -> /run.
|
||||||
ln -svf ../run /var/run
|
ln -svf ../run /var/run
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "x86_64"
|
ifeq "$(BUILD_ARCH)" "x86_64"
|
||||||
ln -svf lib /lib64
|
ln -svf lib /lib64
|
||||||
ln -svf lib /usr/lib64
|
ln -svf lib /usr/lib64
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ DL_FROM = $(URL_IPFIRE)
|
|||||||
DIR_APP = $(DIR_SRC)/strongswan-$(VER)
|
DIR_APP = $(DIR_SRC)/strongswan-$(VER)
|
||||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "i586"
|
ifeq "$(BUILD_ARCH)" "i586"
|
||||||
CONFIGURE_OPTIONS = \
|
CONFIGURE_OPTIONS = \
|
||||||
--enable-padlock
|
--enable-padlock
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
|||||||
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
|
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
|
||||||
cd $(DIR_APP) && make -f unix/Makefile clean
|
cd $(DIR_APP) && make -f unix/Makefile clean
|
||||||
cd $(DIR_APP)/unix && ./configure
|
cd $(DIR_APP)/unix && ./configure
|
||||||
ifeq "$(MACHINE)" "i586"
|
ifeq "$(BUILD_ARCH)" "i586"
|
||||||
cd $(DIR_APP) && make -f unix/Makefile LOCAL_UNZIP=-D_FILE_OFFSET_BITS=64 generic
|
cd $(DIR_APP) && make -f unix/Makefile LOCAL_UNZIP=-D_FILE_OFFSET_BITS=64 generic
|
||||||
else
|
else
|
||||||
# ARM/x86_64 cannot use the x86 32 bit assembly code.
|
# ARM/x86_64 cannot use the x86 32 bit assembly code.
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
|||||||
@$(PREBUILD)
|
@$(PREBUILD)
|
||||||
@rm -rf $(DIR_APP)* && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
|
@rm -rf $(DIR_APP)* && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
|
||||||
|
|
||||||
ifeq "$(MACHINE)" "i586"
|
ifeq "$(BUILD_ARCH)" "i586"
|
||||||
# Build an SSE enabled version.
|
# Build an SSE enabled version.
|
||||||
$(call BUILD,-sse)
|
$(call BUILD,-sse)
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ md5 :
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# Installation Details
|
# Installation Details
|
||||||
###############################################################################
|
###############################################################################
|
||||||
IMGinst := /install/images/$(SNAME)-$(VERSION).xen.$(MACHINE)-downloader-core$(CORE).tar.bz2
|
IMGinst := /install/images/$(SNAME)-$(VERSION).xen.$(BUILD_ARCH)-downloader-core$(CORE).tar.bz2
|
||||||
|
|
||||||
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||||
rm -rf /install/images/$(SNAME) $(IMGinst) && mkdir -p /install/images/$(SNAME)
|
rm -rf /install/images/$(SNAME) $(IMGinst) && mkdir -p /install/images/$(SNAME)
|
||||||
|
|||||||
52
make.sh
52
make.sh
@@ -39,8 +39,7 @@ GIT_LASTCOMMIT=$(git log | head -n1 | cut -d" " -f2 |head -c8) # Last commit
|
|||||||
TOOLCHAINVER=12
|
TOOLCHAINVER=12
|
||||||
|
|
||||||
# New architecture variables
|
# New architecture variables
|
||||||
BUILD_ARCH="$(uname -m)"
|
HOST_ARCH="$(uname -m)"
|
||||||
BUILDMACHINE="${BUILD_ARCH}"
|
|
||||||
|
|
||||||
# Debian specific settings
|
# Debian specific settings
|
||||||
if [ ! -e /etc/debian_version ]; then
|
if [ ! -e /etc/debian_version ]; then
|
||||||
@@ -69,10 +68,13 @@ if [ -f .config ]; then
|
|||||||
. .config
|
. .config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${TARGET_ARCH}" ]; then
|
if [ -n "${BUILD_ARCH}" ]; then
|
||||||
configure_target "${TARGET_ARCH}"
|
configure_build "${BUILD_ARCH}"
|
||||||
|
elif [ -n "${TARGET_ARCH}" ]; then
|
||||||
|
configure_build "${TARGET_ARCH}"
|
||||||
|
unset TARGET_ARCH
|
||||||
else
|
else
|
||||||
configure_target "default"
|
configure_build "default"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $EDITOR ]; then
|
if [ -z $EDITOR ]; then
|
||||||
@@ -221,13 +223,13 @@ prepareenv() {
|
|||||||
# Run LFS static binary creation scripts one by one
|
# Run LFS static binary creation scripts one by one
|
||||||
export CCACHE_DIR=$BASEDIR/ccache
|
export CCACHE_DIR=$BASEDIR/ccache
|
||||||
export CCACHE_COMPRESS=1
|
export CCACHE_COMPRESS=1
|
||||||
export CCACHE_COMPILERCHECK="string:toolchain-${TOOLCHAINVER} ${TARGET_ARCH}"
|
export CCACHE_COMPILERCHECK="string:toolchain-${TOOLCHAINVER} ${BUILD_ARCH}"
|
||||||
|
|
||||||
# Remove pre-install list of installed files in case user erase some files before rebuild
|
# Remove pre-install list of installed files in case user erase some files before rebuild
|
||||||
rm -f $BASEDIR/build/usr/src/lsalr 2>/dev/null
|
rm -f $BASEDIR/build/usr/src/lsalr 2>/dev/null
|
||||||
|
|
||||||
# Prepare string for /etc/system-release.
|
# Prepare string for /etc/system-release.
|
||||||
SYSTEM_RELEASE="${NAME} ${VERSION} (${MACHINE})"
|
SYSTEM_RELEASE="${NAME} ${VERSION} (${BUILD_ARCH})"
|
||||||
if [ "$(git status -s | wc -l)" == "0" ]; then
|
if [ "$(git status -s | wc -l)" == "0" ]; then
|
||||||
GIT_STATUS=""
|
GIT_STATUS=""
|
||||||
else
|
else
|
||||||
@@ -245,7 +247,7 @@ prepareenv() {
|
|||||||
|
|
||||||
buildtoolchain() {
|
buildtoolchain() {
|
||||||
local error=false
|
local error=false
|
||||||
case "${TARGET_ARCH}:${BUILD_ARCH}" in
|
case "${BUILD_ARCH}:${HOST_ARCH}" in
|
||||||
# x86_64
|
# x86_64
|
||||||
x86_64:x86_64)
|
x86_64:x86_64)
|
||||||
# This is working.
|
# This is working.
|
||||||
@@ -273,7 +275,7 @@ buildtoolchain() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
${error} && \
|
${error} && \
|
||||||
exiterror "Cannot build ${MACHINE} toolchain on $(uname -m). Please use the download if any."
|
exiterror "Cannot build ${BUILD_ARCH} toolchain on $(uname -m). Please use the download if any."
|
||||||
|
|
||||||
local gcc=$(type -p gcc)
|
local gcc=$(type -p gcc)
|
||||||
if [ -z "${gcc}" ]; then
|
if [ -z "${gcc}" ]; then
|
||||||
@@ -426,7 +428,7 @@ buildipfire() {
|
|||||||
ipfiremake libnetfilter_cttimeout
|
ipfiremake libnetfilter_cttimeout
|
||||||
ipfiremake iptables
|
ipfiremake iptables
|
||||||
|
|
||||||
case "${TARGET_ARCH}" in
|
case "${BUILD_ARCH}" in
|
||||||
x86_64)
|
x86_64)
|
||||||
ipfiremake linux KCFG=""
|
ipfiremake linux KCFG=""
|
||||||
ipfiremake backports KCFG=""
|
ipfiremake backports KCFG=""
|
||||||
@@ -484,7 +486,7 @@ buildipfire() {
|
|||||||
esac
|
esac
|
||||||
ipfiremake xtables-addons USPACE="1"
|
ipfiremake xtables-addons USPACE="1"
|
||||||
ipfiremake openssl
|
ipfiremake openssl
|
||||||
[ "${TARGET_ARCH}" = "i586" ] && ipfiremake openssl KCFG='-sse2'
|
[ "${BUILD_ARCH}" = "i586" ] && ipfiremake openssl KCFG='-sse2'
|
||||||
ipfiremake libgpg-error
|
ipfiremake libgpg-error
|
||||||
ipfiremake libgcrypt
|
ipfiremake libgcrypt
|
||||||
ipfiremake libassuan
|
ipfiremake libassuan
|
||||||
@@ -947,7 +949,7 @@ buildpackages() {
|
|||||||
cd $BASEDIR
|
cd $BASEDIR
|
||||||
|
|
||||||
# remove not useable iso on armv5tel (needed to build flash images)
|
# remove not useable iso on armv5tel (needed to build flash images)
|
||||||
[ "${TARGET_ARCH}" = "armv5tel" ] && rm -rf *.iso
|
[ "${BUILD_ARCH}" = "armv5tel" ] && rm -rf *.iso
|
||||||
|
|
||||||
for i in `ls *.bz2 *.img.gz *.iso`; do
|
for i in `ls *.bz2 *.img.gz *.iso`; do
|
||||||
md5sum $i > $i.md5
|
md5sum $i > $i.md5
|
||||||
@@ -978,7 +980,7 @@ ipfirepackages() {
|
|||||||
ipfiremake core-updates
|
ipfiremake core-updates
|
||||||
|
|
||||||
local i
|
local i
|
||||||
for i in $(find $BASEDIR/config/rootfiles/packages{/${MACHINE},} -maxdepth 1 -type f); do
|
for i in $(find $BASEDIR/config/rootfiles/packages{/${BUILD_ARCH},} -maxdepth 1 -type f); do
|
||||||
i=$(basename ${i})
|
i=$(basename ${i})
|
||||||
if [ -e $BASEDIR/lfs/$i ]; then
|
if [ -e $BASEDIR/lfs/$i ]; then
|
||||||
ipfiredist $i
|
ipfiredist $i
|
||||||
@@ -1012,7 +1014,7 @@ done
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
build)
|
build)
|
||||||
clear
|
clear
|
||||||
PACKAGE=`ls -v -r $BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-$MACHINE.tar.gz 2> /dev/null | head -n 1`
|
PACKAGE=`ls -v -r $BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.gz 2> /dev/null | head -n 1`
|
||||||
#only restore on a clean disk
|
#only restore on a clean disk
|
||||||
if [ ! -f log/cleanup-toolchain-2-tools ]; then
|
if [ ! -f log/cleanup-toolchain-2-tools ]; then
|
||||||
if [ ! -n "$PACKAGE" ]; then
|
if [ ! -n "$PACKAGE" ]; then
|
||||||
@@ -1106,7 +1108,7 @@ downloadsrc)
|
|||||||
if [ -f "$i" -a "$i" != "Config" ]; then
|
if [ -f "$i" -a "$i" != "Config" ]; then
|
||||||
lfsmakecommoncheck ${i} || continue
|
lfsmakecommoncheck ${i} || continue
|
||||||
|
|
||||||
make -s -f $i LFS_BASEDIR=$BASEDIR MACHINE=$MACHINE \
|
make -s -f $i LFS_BASEDIR=$BASEDIR BUILD_ARCH="${BUILD_ARCH}" \
|
||||||
MESSAGE="$i\t ($c/$MAX_RETRIES)" download >> $LOGFILE 2>&1
|
MESSAGE="$i\t ($c/$MAX_RETRIES)" download >> $LOGFILE 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
beautify message FAIL
|
beautify message FAIL
|
||||||
@@ -1124,7 +1126,7 @@ downloadsrc)
|
|||||||
for i in *; do
|
for i in *; do
|
||||||
if [ -f "$i" -a "$i" != "Config" ]; then
|
if [ -f "$i" -a "$i" != "Config" ]; then
|
||||||
lfsmakecommoncheck ${i} > /dev/null || continue
|
lfsmakecommoncheck ${i} > /dev/null || continue
|
||||||
make -s -f $i LFS_BASEDIR=$BASEDIR MACHINE=$MACHINE \
|
make -s -f $i LFS_BASEDIR=$BASEDIR BUILD_ARCH="${BUILD_ARCH}" \
|
||||||
MESSAGE="$i\t " md5 >> $LOGFILE 2>&1
|
MESSAGE="$i\t " md5 >> $LOGFILE 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo -ne "MD5 difference in lfs/$i"
|
echo -ne "MD5 difference in lfs/$i"
|
||||||
@@ -1147,25 +1149,25 @@ toolchain)
|
|||||||
prepareenv
|
prepareenv
|
||||||
beautify build_stage "Toolchain compilation - Native GCC: `gcc --version | grep GCC | awk {'print $3'}`"
|
beautify build_stage "Toolchain compilation - Native GCC: `gcc --version | grep GCC | awk {'print $3'}`"
|
||||||
buildtoolchain
|
buildtoolchain
|
||||||
echo "`date -u '+%b %e %T'`: Create toolchain tar.gz for $MACHINE" | tee -a $LOGFILE
|
echo "`date -u '+%b %e %T'`: Create toolchain tar.gz for ${BUILD_ARCH}" | tee -a $LOGFILE
|
||||||
test -d $BASEDIR/cache/toolchains || mkdir -p $BASEDIR/cache/toolchains
|
test -d $BASEDIR/cache/toolchains || mkdir -p $BASEDIR/cache/toolchains
|
||||||
cd $BASEDIR && tar -zc --exclude='log/_build.*.log' -f cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-$MACHINE.tar.gz \
|
cd $BASEDIR && tar -zc --exclude='log/_build.*.log' -f cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.gz \
|
||||||
build/tools build/bin/sh log >> $LOGFILE
|
build/tools build/bin/sh log >> $LOGFILE
|
||||||
md5sum cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-$MACHINE.tar.gz \
|
md5sum cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.gz \
|
||||||
> cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-$MACHINE.md5
|
> cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.md5
|
||||||
stdumount
|
stdumount
|
||||||
;;
|
;;
|
||||||
gettoolchain)
|
gettoolchain)
|
||||||
# arbitrary name to be updated in case of new toolchain package upload
|
# arbitrary name to be updated in case of new toolchain package upload
|
||||||
PACKAGE=$SNAME-$VERSION-toolchain-$TOOLCHAINVER-$MACHINE
|
PACKAGE=$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}
|
||||||
if [ ! -f $BASEDIR/cache/toolchains/$PACKAGE.tar.gz ]; then
|
if [ ! -f $BASEDIR/cache/toolchains/$PACKAGE.tar.gz ]; then
|
||||||
URL_TOOLCHAIN=`grep URL_TOOLCHAIN lfs/Config | awk '{ print $3 }'`
|
URL_TOOLCHAIN=`grep URL_TOOLCHAIN lfs/Config | awk '{ print $3 }'`
|
||||||
test -d $BASEDIR/cache/toolchains || mkdir -p $BASEDIR/cache/toolchains
|
test -d $BASEDIR/cache/toolchains || mkdir -p $BASEDIR/cache/toolchains
|
||||||
echo "`date -u '+%b %e %T'`: Load toolchain tar.gz for $MACHINE" | tee -a $LOGFILE
|
echo "`date -u '+%b %e %T'`: Load toolchain tar.gz for ${BUILD_ARCH}" | tee -a $LOGFILE
|
||||||
cd $BASEDIR/cache/toolchains
|
cd $BASEDIR/cache/toolchains
|
||||||
wget -U "IPFireSourceGrabber/2.x" $URL_TOOLCHAIN/$PACKAGE.tar.gz $URL_TOOLCHAIN/$PACKAGE.md5 >& /dev/null
|
wget -U "IPFireSourceGrabber/2.x" $URL_TOOLCHAIN/$PACKAGE.tar.gz $URL_TOOLCHAIN/$PACKAGE.md5 >& /dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "`date -u '+%b %e %T'`: error downloading $PACKAGE toolchain for $MACHINE machine" | tee -a $LOGFILE
|
echo "`date -u '+%b %e %T'`: error downloading $PACKAGE toolchain for ${BUILD_ARCH} machine" | tee -a $LOGFILE
|
||||||
else
|
else
|
||||||
if [ "`md5sum $PACKAGE.tar.gz | awk '{print $1}'`" = "`cat $PACKAGE.md5 | awk '{print $1}'`" ]; then
|
if [ "`md5sum $PACKAGE.tar.gz | awk '{print $1}'`" = "`cat $PACKAGE.md5 | awk '{print $1}'`" ]; then
|
||||||
echo "`date -u '+%b %e %T'`: toolchain md5 ok" | tee -a $LOGFILE
|
echo "`date -u '+%b %e %T'`: toolchain md5 ok" | tee -a $LOGFILE
|
||||||
@@ -1179,11 +1181,11 @@ gettoolchain)
|
|||||||
;;
|
;;
|
||||||
othersrc)
|
othersrc)
|
||||||
prepareenv
|
prepareenv
|
||||||
echo -ne "`date -u '+%b %e %T'`: Build sources iso for $MACHINE" | tee -a $LOGFILE
|
echo -ne "`date -u '+%b %e %T'`: Build sources iso for ${BUILD_ARCH}" | tee -a $LOGFILE
|
||||||
chroot $LFS /tools/bin/env -i HOME=/root \
|
chroot $LFS /tools/bin/env -i HOME=/root \
|
||||||
TERM=$TERM PS1='\u:\w\$ ' \
|
TERM=$TERM PS1='\u:\w\$ ' \
|
||||||
PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \
|
PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \
|
||||||
VERSION=$VERSION NAME="$NAME" SNAME="$SNAME" MACHINE=$MACHINE \
|
VERSION=$VERSION NAME="$NAME" SNAME="$SNAME" BUILD_ARCH="${BUILD_ARCH}" \
|
||||||
/bin/bash -x -c "cd /usr/src/lfs && make -f sources-iso LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
|
/bin/bash -x -c "cd /usr/src/lfs && make -f sources-iso LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
|
||||||
mv $LFS/install/images/ipfire-* $BASEDIR >> $LOGFILE 2>&1
|
mv $LFS/install/images/ipfire-* $BASEDIR >> $LOGFILE 2>&1
|
||||||
if [ $? -eq "0" ]; then
|
if [ $? -eq "0" ]; then
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ for dir in $@; do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for exclude in ${dir}/${MACHINE}/*; do
|
for exclude in ${dir}/${BUILD_ARCH}/*; do
|
||||||
[ -f "${exclude}" ] || continue
|
[ -f "${exclude}" ] || continue
|
||||||
EXCLUDE="$EXCLUDE $exclude"
|
EXCLUDE="$EXCLUDE $exclude"
|
||||||
done
|
done
|
||||||
@@ -52,4 +52,4 @@ for dir in $@; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
cat ${FILELIST} 2>/dev/null | grep -v ^# | sort | uniq | \
|
cat ${FILELIST} 2>/dev/null | grep -v ^# | sort | uniq | \
|
||||||
sed -e "s/KVER/${KVER}/g" -e "s/MACHINE/${MACHINE}/g" -e "s/BUILDTARGET/${BUILDTARGET}/g"
|
sed -e "s/KVER/${KVER}/g" -e "s/MACHINE/${BUILD_ARCH}/g" -e "s/BUILDTARGET/${BUILDTARGET}/g"
|
||||||
|
|||||||
@@ -60,65 +60,66 @@ WARN="\\033[1;35m"
|
|||||||
FAIL="\\033[1;31m"
|
FAIL="\\033[1;31m"
|
||||||
NORMAL="\\033[0;39m"
|
NORMAL="\\033[0;39m"
|
||||||
|
|
||||||
configure_target() {
|
configure_build() {
|
||||||
local target_arch="${1}"
|
local build_arch="${1}"
|
||||||
|
|
||||||
if [ "${target_arch}" = "default" ]; then
|
if [ "${build_arch}" = "default" ]; then
|
||||||
target_arch="$(configure_target_guess)"
|
build_arch="$(configure_build_guess)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "${target_arch}" in
|
case "${build_arch}" in
|
||||||
x86_64)
|
x86_64)
|
||||||
BUILDTARGET="${target_arch}-unknown-linux-gnu"
|
BUILDTARGET="${build_arch}-unknown-linux-gnu"
|
||||||
CROSSTARGET="${target_arch}-cross-linux-gnu"
|
CROSSTARGET="${build_arch}-cross-linux-gnu"
|
||||||
|
BUILD_PLATFORM="x86"
|
||||||
CFLAGS_ARCH="-m64 -mtune=generic"
|
CFLAGS_ARCH="-m64 -mtune=generic"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
i586)
|
i586)
|
||||||
BUILDTARGET="${target_arch}-pc-linux-gnu"
|
BUILDTARGET="${build_arch}-pc-linux-gnu"
|
||||||
CROSSTARGET="${target_arch}-cross-linux-gnu"
|
CROSSTARGET="${build_arch}-cross-linux-gnu"
|
||||||
|
BUILD_PLATFORM="x86"
|
||||||
CFLAGS_ARCH="-march=i586 -mtune=generic -fomit-frame-pointer"
|
CFLAGS_ARCH="-march=i586 -mtune=generic -fomit-frame-pointer"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
aarch64)
|
aarch64)
|
||||||
BUILDTARGET="${target_arch}-unknown-linux-gnu"
|
BUILDTARGET="${build_arch}-unknown-linux-gnu"
|
||||||
CROSSTARGET="${target_arch}-cross-linux-gnu"
|
CROSSTARGET="${build_arch}-cross-linux-gnu"
|
||||||
|
BUILD_PLATFORM="arm"
|
||||||
CFLAGS_ARCH=""
|
CFLAGS_ARCH=""
|
||||||
;;
|
;;
|
||||||
|
|
||||||
armv7hl)
|
armv7hl)
|
||||||
BUILDTARGET="${target_arch}-unknown-linux-gnueabi"
|
BUILDTARGET="${build_arch}-unknown-linux-gnueabi"
|
||||||
CROSSTARGET="${target_arch}-cross-linux-gnueabi"
|
CROSSTARGET="${build_arch}-cross-linux-gnueabi"
|
||||||
|
BUILD_PLATFORM="arm"
|
||||||
CFLAGS_ARCH="-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
|
CFLAGS_ARCH="-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
armv5tel)
|
armv5tel)
|
||||||
BUILDTARGET="${target_arch}-unknown-linux-gnueabi"
|
BUILDTARGET="${build_arch}-unknown-linux-gnueabi"
|
||||||
CROSSTARGET="${target_arch}-cross-linux-gnueabi"
|
CROSSTARGET="${build_arch}-cross-linux-gnueabi"
|
||||||
|
BUILD_PLATFORM="arm"
|
||||||
CFLAGS_ARCH="-march=armv5te -mfloat-abi=soft -fomit-frame-pointer"
|
CFLAGS_ARCH="-march=armv5te -mfloat-abi=soft -fomit-frame-pointer"
|
||||||
MACHINE_TYPE="arm"
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
exiterror "Cannot build for architure ${target_arch}"
|
exiterror "Cannot build for architure ${build_arch}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if the QEMU helper is available if needed.
|
# Check if the QEMU helper is available if needed.
|
||||||
if qemu_is_required "${target_arch}"; then
|
if qemu_is_required "${build_arch}"; then
|
||||||
local qemu_target_helper="$(qemu_find_target_helper_name "${target_arch}")"
|
local qemu_build_helper="$(qemu_find_build_helper_name "${build_arch}")"
|
||||||
|
|
||||||
if [ -n "${qemu_target_helper}" ]; then
|
if [ -n "${qemu_build_helper}" ]; then
|
||||||
QEMU_TARGET_HELPER="${qemu_target_helper}"
|
QEMU_TARGET_HELPER="${qemu_build_helper}"
|
||||||
else
|
else
|
||||||
exiterror "Could not find a binfmt_misc helper entry for ${target_arch}"
|
exiterror "Could not find a binfmt_misc helper entry for ${build_arch}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TARGET_ARCH="${target_arch}"
|
BUILD_ARCH="${build_arch}"
|
||||||
|
|
||||||
# Old variable names
|
|
||||||
MACHINE="${TARGET_ARCH}"
|
|
||||||
|
|
||||||
# Enables hardening
|
# Enables hardening
|
||||||
HARDENING_CFLAGS="-Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4"
|
HARDENING_CFLAGS="-Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4"
|
||||||
@@ -127,8 +128,8 @@ configure_target() {
|
|||||||
CXXFLAGS="${CFLAGS}"
|
CXXFLAGS="${CFLAGS}"
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_target_guess() {
|
configure_build_guess() {
|
||||||
case "${BUILD_ARCH}" in
|
case "${HOST_ARCH}" in
|
||||||
x86_64|i686|i586)
|
x86_64|i686|i586)
|
||||||
echo "i586"
|
echo "i586"
|
||||||
;;
|
;;
|
||||||
@@ -146,7 +147,7 @@ configure_target_guess() {
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
exiterror "Cannot guess target architecture"
|
exiterror "Cannot guess build architecture"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -359,7 +360,7 @@ fake_environ() {
|
|||||||
env="${env} UTS_RELEASE=${KVER}"
|
env="${env} UTS_RELEASE=${KVER}"
|
||||||
|
|
||||||
# Fake machine version.
|
# Fake machine version.
|
||||||
env="${env} UTS_MACHINE=${TARGET_ARCH}"
|
env="${env} UTS_MACHINE=${BUILD_ARCH}"
|
||||||
|
|
||||||
echo "${env}"
|
echo "${env}"
|
||||||
}
|
}
|
||||||
@@ -373,7 +374,7 @@ qemu_environ() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Set default qemu options
|
# Set default qemu options
|
||||||
case "${TARGET_ARCH}" in
|
case "${BUILD_ARCH}" in
|
||||||
arm*)
|
arm*)
|
||||||
QEMU_CPU="${QEMU_CPU:-cortex-a9}"
|
QEMU_CPU="${QEMU_CPU:-cortex-a9}"
|
||||||
|
|
||||||
@@ -388,13 +389,13 @@ qemu_environ() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
qemu_is_required() {
|
qemu_is_required() {
|
||||||
local target_arch="${1}"
|
local build_arch="${1}"
|
||||||
|
|
||||||
if [ -z "${target_arch}" ]; then
|
if [ -z "${build_arch}" ]; then
|
||||||
target_arch="${TARGET_ARCH}"
|
build_arch="${BUILD_ARCH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "${BUILD_ARCH},${target_arch}" in
|
case "${HOST_ARCH},${build_arch}" in
|
||||||
x86_64,arm*|i?86,arm*|i?86,x86_64)
|
x86_64,arm*|i?86,arm*|i?86,x86_64)
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
@@ -448,11 +449,11 @@ qemu_install_helper() {
|
|||||||
exiterror "Could not find a statically-linked QEMU emulator: ${QEMU_TARGET_HELPER}"
|
exiterror "Could not find a statically-linked QEMU emulator: ${QEMU_TARGET_HELPER}"
|
||||||
}
|
}
|
||||||
|
|
||||||
qemu_find_target_helper_name() {
|
qemu_find_build_helper_name() {
|
||||||
local target_arch="${1}"
|
local build_arch="${1}"
|
||||||
|
|
||||||
local magic
|
local magic
|
||||||
case "${target_arch}" in
|
case "${build_arch}" in
|
||||||
arm*)
|
arm*)
|
||||||
magic="7f454c4601010100000000000000000002002800"
|
magic="7f454c4601010100000000000000000002002800"
|
||||||
;;
|
;;
|
||||||
@@ -510,8 +511,7 @@ entershell() {
|
|||||||
KVER=$KVER \
|
KVER=$KVER \
|
||||||
BUILDTARGET="$BUILDTARGET" \
|
BUILDTARGET="$BUILDTARGET" \
|
||||||
CROSSTARGET="${CROSSTARGET}" \
|
CROSSTARGET="${CROSSTARGET}" \
|
||||||
MACHINE="$MACHINE" \
|
BUILD_ARCH="${BUILD_ARCH}" \
|
||||||
MACHINE_TYPE="$MACHINE_TYPE" \
|
|
||||||
$(fake_environ) \
|
$(fake_environ) \
|
||||||
$(qemu_environ) \
|
$(qemu_environ) \
|
||||||
/tools/bin/bash -i
|
/tools/bin/bash -i
|
||||||
@@ -548,8 +548,8 @@ lfsmakecommoncheck()
|
|||||||
# Check if this package is supported by our architecture.
|
# Check if this package is supported by our architecture.
|
||||||
# If no SUP_ARCH is found, we assume the package can be built for all.
|
# If no SUP_ARCH is found, we assume the package can be built for all.
|
||||||
if grep "^SUP_ARCH" ${BASEDIR}/lfs/${1} >/dev/null; then
|
if grep "^SUP_ARCH" ${BASEDIR}/lfs/${1} >/dev/null; then
|
||||||
# Check if package supports ${MACHINE} or all architectures.
|
# Check if package supports ${BUILD_ARCH} or all architectures.
|
||||||
if ! grep -E "^SUP_ARCH.*${MACHINE}|^SUP_ARCH.*all" ${BASEDIR}/lfs/${1} >/dev/null; then
|
if ! grep -E "^SUP_ARCH.*${BUILD_ARCH}|^SUP_ARCH.*all" ${BASEDIR}/lfs/${1} >/dev/null; then
|
||||||
beautify result SKIP
|
beautify result SKIP
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -567,15 +567,13 @@ lfsmakecommoncheck()
|
|||||||
|
|
||||||
echo -ne "`date -u '+%b %e %T'`: Building $* " >> $LOGFILE
|
echo -ne "`date -u '+%b %e %T'`: Building $* " >> $LOGFILE
|
||||||
|
|
||||||
cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MACHINE=$MACHINE \
|
cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR BUILD_ARCH="${BUILD_ARCH}" \
|
||||||
MACHINE_TYPE="$MACHINE_TYPE" \
|
|
||||||
MESSAGE="$1\t " download >> $LOGFILE 2>&1
|
MESSAGE="$1\t " download >> $LOGFILE 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exiterror "Download error in $1"
|
exiterror "Download error in $1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MACHINE=$MACHINE \
|
cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR BUILD_ARCH="${BUILD_ARCH}" \
|
||||||
MACHINE_TYPE="$MACHINE_TYPE" \
|
|
||||||
MESSAGE="$1\t md5sum" md5 >> $LOGFILE 2>&1
|
MESSAGE="$1\t md5sum" md5 >> $LOGFILE 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
exiterror "md5sum error in $1, check file in cache or signature"
|
exiterror "md5sum error in $1, check file in cache or signature"
|
||||||
@@ -590,17 +588,22 @@ lfsmake1() {
|
|||||||
|
|
||||||
local PKG_TIME_START=`date +%s`
|
local PKG_TIME_START=`date +%s`
|
||||||
|
|
||||||
cd $BASEDIR/lfs && \
|
cd $BASEDIR/lfs && env -i \
|
||||||
PATH="/tools/ccache/bin:/tools/bin:$PATH" \
|
PATH="/tools/ccache/bin:/tools/bin:$PATH" \
|
||||||
make -f $* TOOLCHAIN=1 BUILDTARGET=$BUILDTARGET \
|
make -f $* \
|
||||||
CROSSTARGET="${CROSSTARGET}" \
|
TOOLCHAIN=1 \
|
||||||
MACHINE=$MACHINE \
|
CROSSTARGET="${CROSSTARGET}" \
|
||||||
MACHINE_TYPE=$MACHINE_TYPE \
|
BUILDTARGET="${BUILDTARGET}" \
|
||||||
LFS_BASEDIR=$BASEDIR \
|
BUILD_ARCH="${BUILD_ARCH}" \
|
||||||
ROOT=$LFS \
|
BUILD_PLATFORM="${BUILD_PLATFORM}" \
|
||||||
KVER=$KVER \
|
CFLAGS="${CFLAGS}" \
|
||||||
MAKETUNING=$MAKETUNING \
|
CXXFLAGS="${CXXFLAGS}" \
|
||||||
install >> $LOGFILE 2>&1
|
LFS_BASEDIR="${BASEDIR}" \
|
||||||
|
ROOT="${LFS}" \
|
||||||
|
KVER="${KVER}" \
|
||||||
|
MAKETUNING="${MAKETUNING}" \
|
||||||
|
install >> $LOGFILE 2>&1
|
||||||
|
|
||||||
local COMPILE_SUCCESS=$?
|
local COMPILE_SUCCESS=$?
|
||||||
local PKG_TIME_END=`date +%s`
|
local PKG_TIME_END=`date +%s`
|
||||||
|
|
||||||
@@ -637,8 +640,7 @@ lfsmake2() {
|
|||||||
KVER=$KVER MAKETUNING=$MAKETUNING \
|
KVER=$KVER MAKETUNING=$MAKETUNING \
|
||||||
BUILDTARGET="$BUILDTARGET" \
|
BUILDTARGET="$BUILDTARGET" \
|
||||||
CROSSTARGET="${CROSSTARGET}" \
|
CROSSTARGET="${CROSSTARGET}" \
|
||||||
MACHINE="$MACHINE" \
|
BUILD_ARCH="${BUILD_ARCH}" \
|
||||||
MACHINE_TYPE="$MACHINE_TYPE" \
|
|
||||||
$(qemu_environ) \
|
$(qemu_environ) \
|
||||||
$(fake_environ) \
|
$(fake_environ) \
|
||||||
/tools/bin/bash -x -c "cd /usr/src/lfs && \
|
/tools/bin/bash -x -c "cd /usr/src/lfs && \
|
||||||
@@ -680,8 +682,7 @@ ipfiremake() {
|
|||||||
KVER=$KVER MAKETUNING=$MAKETUNING \
|
KVER=$KVER MAKETUNING=$MAKETUNING \
|
||||||
BUILDTARGET="$BUILDTARGET" \
|
BUILDTARGET="$BUILDTARGET" \
|
||||||
CROSSTARGET="${CROSSTARGET}" \
|
CROSSTARGET="${CROSSTARGET}" \
|
||||||
MACHINE="$MACHINE" \
|
BUILD_ARCH="${BUILD_ARCH}" \
|
||||||
MACHINE_TYPE="$MACHINE_TYPE" \
|
|
||||||
$(qemu_environ) \
|
$(qemu_environ) \
|
||||||
$(fake_environ) \
|
$(fake_environ) \
|
||||||
/bin/bash -x -c "cd /usr/src/lfs && \
|
/bin/bash -x -c "cd /usr/src/lfs && \
|
||||||
@@ -721,8 +722,7 @@ ipfiredist() {
|
|||||||
KVER=$KVER \
|
KVER=$KVER \
|
||||||
BUILDTARGET="$BUILDTARGET" \
|
BUILDTARGET="$BUILDTARGET" \
|
||||||
CROSSTARGET="${CROSSTARGET}" \
|
CROSSTARGET="${CROSSTARGET}" \
|
||||||
MACHINE="$MACHINE" \
|
BUILD_ARCH="${BUILD_ARCH}" \
|
||||||
MACHINE_TYPE="$MACHINE_TYPE" \
|
|
||||||
$(qemu_environ) \
|
$(qemu_environ) \
|
||||||
$(fake_environ) \
|
$(fake_environ) \
|
||||||
/bin/bash -x -c "cd /usr/src/lfs && \
|
/bin/bash -x -c "cd /usr/src/lfs && \
|
||||||
@@ -761,8 +761,7 @@ installmake() {
|
|||||||
KVER=$KVER \
|
KVER=$KVER \
|
||||||
BUILDTARGET="$BUILDTARGET" \
|
BUILDTARGET="$BUILDTARGET" \
|
||||||
CROSSTARGET="${CROSSTARGET}" \
|
CROSSTARGET="${CROSSTARGET}" \
|
||||||
MACHINE="$MACHINE" \
|
BUILD_ARCH="${BUILD_ARCH}" \
|
||||||
MACHINE_TYPE="$MACHINE_TYPE" \
|
|
||||||
LD_LIBRARY_PATH=/tools/lib \
|
LD_LIBRARY_PATH=/tools/lib \
|
||||||
/tools/bin/bash -x -c "cd /usr/src/lfs && \
|
/tools/bin/bash -x -c "cd /usr/src/lfs && \
|
||||||
/tools/bin/make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
|
/tools/bin/make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
|
||||||
|
|||||||
Reference in New Issue
Block a user