]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Merge branch 'master' into kernel-4.9
authorArne Fitzenreiter <arne_f@ipfire.org>
Sun, 9 Jul 2017 10:47:16 +0000 (12:47 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sun, 9 Jul 2017 10:47:16 +0000 (12:47 +0200)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
1  2 
config/qos/makeqosscripts.pl
lfs/linux
lfs/postfix
lfs/udev
make.sh

index b86e375d87c38c3e1786f72d0262d169d13df467,19809615a9312f48ade3c472dd95a4bb5fa49a27..aadd959ec068fd0cd548323b0691d8e141013eeb
@@@ -252,8 -252,8 +252,8 @@@ foreach $subclassentry (sort @subclasse
  }
  print <<END
  
 -      ### add l7-filter to POSTROUTING chain to see all traffic
 -      iptables -t mangle -A POSTROUTING -m layer7 --l7proto unset
 +      ### add l7-filter to PREROUTING chain to see all traffic
 +      iptables -t mangle -A PREROUTING -m layer7 --l7proto unset
  
        ### ADD QOS-OUT CHAIN TO THE MANGLE TABLE IN IPTABLES
        iptables -t mangle -N QOS-OUT
@@@ -411,7 -411,7 +411,7 @@@ print <<EN
                insmod ipt_IMQ
                sleep 2
        fi
-       modprobe imq numdevs=1
+       modprobe imq numdevs=1 numqueues=\$(grep -c "^processor" /proc/cpuinfo || echo 1)
        ip link set $qossettings{'IMQ_DEV'} up
  
        ### ADD HTB QDISC FOR $qossettings{'IMQ_DEV'}
@@@ -715,7 -715,7 +715,7 @@@ print <<EN
        iptables -t mangle --flush  QOS-TOS >/dev/null 2>&1
        iptables -t mangle --delete-chain QOS-TOS >/dev/null 2>&1
        # remove l7-filter
 -      iptables -t mangle --delete POSTROUTING -m layer7 --l7proto unset
 +      iptables -t mangle --delete PREROUTING -m layer7 --l7proto unset
  
        rmmod sch_htb >/dev/null 2>&1
  
diff --combined lfs/linux
index a0968a1ad54ed1702cf7771da3e3ad909ee32882,b3ccb7af9a74dfbcda67d4f9f01be13b6853ba49..e309cd52dc20394f414655656f65e461f5f70a18
+++ b/lfs/linux
  
  include Config
  
 -VER         = 3.14.79
 +VER         = 4.9.35
  RPI_PATCHES = 3.14.79-grsec-ipfire1
  A7M_PATCHES = 3.14.79-grsec-ipfire1
 -GRS_PATCHES = grsecurity-3.1ipfire-3.14.79-v1.patch.xz
 +GRS_PATCHES = grsecurity-3.1-4.9.35-ipfire1.patch.xz
  
  
  THISAPP    = linux-$(VER)
@@@ -40,15 -40,21 +40,21 @@@ CXXFLAGS   
  PAK_VER    = 73
  DEPS     = ""
  
- KERNEL_ARCH = $(MACHINE)
- ifeq "$(MACHINE)" "i586"
+ ifeq "$(BUILD_ARCH)" "i586"
        KERNEL_ARCH = i386
+ else
+       KERNEL_ARCH = $(BUILD_ARCH)
+ endif
+ ifeq "$(BUILD_ARCH)" "aarch64"
+       HEADERS_ARCH = arm64
+ else
+       HEADERS_ARCH = $(BUILD_PLATFORM)
  endif
  
  VERSUFIX=ipfire$(KCFG)
  
- ifeq "$(TOOLS)" "1"
+ ifeq "$(TOOLCHAIN)" "1"
        TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX)-tools
        HEADERS_PREFIX = /tools
  else
        HEADERS_PREFIX = /usr
  endif
  
- ifeq "$(MACHINE_TYPE)" "arm"
-       HEADERS_ARCH=arm
- else
-       HEADERS_ARCH=x86
- endif
  ifeq "$(KCFG)" ""
  LASTKERNEL=1
  endif
@@@ -69,6 -69,9 +69,9 @@@ ifeq "$(KCFG)" "-kirkwood
  LASTKERNEL=1
  endif
  
+ # The buildsystem does not correctly detect if our compiler supports plugins
+ export DISABLE_PAX_PLUGINS=y
  ###############################################################################
  # Top-level Rules
  ###############################################################################
@@@ -83,10 -86,10 +86,10 @@@ rpi-patches-$(RPI_PATCHES).patch.xz                = 
  arm7-multi-patches-$(A7M_PATCHES).patch.xz    = $(URL_IPFIRE)/arm7-multi-patches-$(A7M_PATCHES).patch.xz
  $(GRS_PATCHES)                                        = $(URL_IPFIRE)/$(GRS_PATCHES)
  
 -$(DL_FILE)_MD5                                        = ec5b09d8ad2ebf92e6f51a727a338559
 +$(DL_FILE)_MD5                                        = 9b72bca09f8192ff645b354a4f7960ea
  rpi-patches-$(RPI_PATCHES).patch.xz_MD5               = a02a7fd54c642c1e3578a00ed22f54f8
  arm7-multi-patches-$(A7M_PATCHES).patch.xz_MD5        = 6c3b11e51caa278dbeacd1e23c2b171b
 -$(GRS_PATCHES)_MD5                            = 7fe448b53558082395f68c5db94af1a7
 +$(GRS_PATCHES)_MD5                            = 3fb5171db23cf10198b874b6c60842cc
  
  install : $(TARGET)
  
@@@ -122,46 -125,98 +125,46 @@@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(
        ln -svf linux-$(VER) $(DIR_SRC)/linux
  
        # Linux Intermediate Queueing Device
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.22-imq.patch
 +      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9-imq.diff
  
        # Layer7-patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14-layer7-filter.patch
 +      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.13-layer7.patch
 +
  
  ifneq "$(KCFG)" "-headers"
        # Grsecurity-patches
        cd $(DIR_APP) && xz -c -d $(DIR_DL)/$(GRS_PATCHES) | patch -Np1
        cd $(DIR_APP) && rm localversion-grsec
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.7-disable-compat_vdso.patch
  endif
  
        # DVB Patches
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.22-dvbsky.patch
        cd $(DIR_APP) && patch -Np2 < $(DIR_SRC)/src/patches/v4l-dvb_fix_tua6034_pll.patch
  
        # Wlan Patches
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/compat-drivers-3.8.3-ath_ignore_eeprom_regdomain.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.22-iwlwifi-noibss_only_on_radar_chan.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.37-rt2800usb_add_dlink_dwa137_usbid.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.55-rt2800usb-change_queue_warn_to_debug.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.25_rt2x00_fix_bss_bcn_num.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.25-rt5592_no_special_txop_init.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.39-add_libertas_uap.patch
 +      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/backports-4.2.6-1_ath10k_remove_logspam.patch
 +      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8-ath_ignore_eeprom_regd.patch
 +      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8-iwlwifi-noibss_only_on_radar_chan.patch
 +      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8-rt2x00usb_suppress_queue_warnings.patch
 +#     cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.39-add_libertas_uap.patch
  
        # mISDN Patches
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/mISDN_hfc-s_add_id.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/mISDN-hfcusb-reportl1down.patch
  
        # Add LED trigger
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.22-ledtrig_netdev.patch
 +      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.16-ledtrig_netdev.patch
 +
 +      # Fix igb and e1000e crash
 +      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.17-igb-e1000e_fix_lock_at_update_stats.patch
  
        # cs5535audio spams syslog if no ac97 was present (geos router)
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.30_cs5535audio_fix_logspam_on_geos.patch
 +      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8_cs5535audio_fix_logspam_on_geos.patch
  
        # Add PC Engines APU led support
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14-apu_leds.patch
 -
 -      # Add APU2 SoC ID to k10temp
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.65-k10temp_add_16H_M30H_id.patch
 +      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8-apu_leds.patch
  
        # Fix uevent PHYSDEVDRIVER
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2.33_ipg-fix-driver-name.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.27_mcs7830-fix-driver-name.patch
 -
 -      # r8169 L23 patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.32-r8169_disable_L23.patch
 -
 -      # update the queued trim blacklist from kernel 4.2rc1
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.43_new_qtrim_blacklist.patch
 -
 -      # remove eMMC EXT_CSD revision check to use newer eMMC modules
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.79_mmc_remove_EXT_CSD_revision_check.patch
 -
 -      # Hyper-V patches
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0001-Drivers-net-hyperv-Get-rid-of-the-rndis_filter_packe.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0002-Drivers-net-hyperv-Cleanup-the-receive-path.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0003-Drivers-net-hyperv-Cleanup-the-netvsc-receive-callba.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0004-hyperv-Add-latest-NetVSP-versions-to-auto-negotiatio.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0005-Drivers-net-hyperv-Enable-scatter-gather-I-O.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0006-Drivers-net-hyperv-Cleanup-the-send-path.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0007-Drivers-net-hyperv-Enable-offloads-on-the-host.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0008-Drivers-net-hyperv-Enable-receive-side-IP-checksum-o.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0009-Drivers-net-hyperv-Enable-send-side-checksum-offload.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0010-Drivers-net-hyperv-Enable-large-send-offload.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0011-hyperv-Change-the-receive-buffer-size-for-legacy-hos.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0012-Drivers-net-hyperv-Allocate-memory-for-all-possible-.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0013-Drivers-net-hyperv-Negotiate-suitable-ndis-version-f.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0014-Drivers-net-hyperv-Address-UDP-checksum-issues.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0015-hyperv-Properly-handle-checksum-offload.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0016-hyperv-Add-support-for-virtual-Receive-Side-Scaling-.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0017-hyperv-Remove-recv_pkt_list-and-lock.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0018-hyperv-Simplify-the-send_completion-variables.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0019-hyperv-Enable-sendbuf-mechanism-on-the-send-path.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0020-Add-support-for-netvsc-build-without-CONFIG_SYSFS-fl.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0021-hyperv-Add-hash-value-into-RNDIS-Per-packet-info.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0022-hyperv-fix-apparent-cut-n-paste-error-in-send-path-t.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0023-hyperv-Fix-error-return-code-in-netvsc_init_buf.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0024-hyperv-Fix-a-bug-in-netvsc_send.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0025-Drivers-hv-vmbus-Support-per-channel-driver-state.patch
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-hyperv_Mark_the_Hyoer-V_TSC_as_unstable.patch
 -
 -ifneq "$(KCFG)" "-headers"
 -      # fix AES-NI 192 and 256 bits / grsec is needed for this patch version
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0100-crypto-aesni-Add-support-for-192-256-bit-keys-to-AES.patch
 -endif
 -
 -      # fix CVE-2016-5195 (Dirty COW)
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0110-mm-remove-gup_flags-FOLL_WRITE-games-from-__get_user.patch
 -
 -      # fix empty symbol crc's
 -      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-genksyms_fix_typeof_handling.patch
 +      cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-2.6.32.27_mcs7830-fix-driver-name.patch
  
  ifeq "$(KCFG)" "-kirkwood"
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.10-mv_cesa_disable_failing_hmac_sha1.patch
@@@ -183,8 -238,11 +186,11 @@@ endi
  ifeq "$(KCFG)" "-rpi"
        # Apply Raspberry Pi kernel patches.
        cd $(DIR_APP) && xzcat $(DIR_DL)/rpi-patches-$(RPI_PATCHES).patch.xz | patch -Np1
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-3.14.79-rpi-suspend-not-inline.patch
  endif
  
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-3.14.79-amba-fix.patch
  ifeq "$(KCFG)" "-headers"
        # Install the header files
        cd $(DIR_APP) && make ARCH=$(HEADERS_ARCH) INSTALL_HDR_PATH=dest headers_install
@@@ -198,7 -256,7 +204,7 @@@ els
                drivers/video/logo/logo_linux_clut224.ppm
  
        # 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 clean
        cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ -$(VERSUFIX)/' Makefile
@@@ -229,7 -287,7 +235,7 @@@ endi
        cd $(DIR_APP) && make $(MAKETUNING) modules_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) && for f in $$(find arch/arm/boot/dts/ -name *.dtb); do \
                                mkdir -p /boot/dtb-$(VER)-$(VERSUFIX) ; \
diff --combined lfs/postfix
index 4864fb9f6eb1de58c0a1684211c215d8bb91f14e,3758b9cbeecadec97c4d9b03f063a652edf25e83..9f5ad380946e13ea99c165bf8f2870ec709bedcb
@@@ -102,7 -102,6 +102,7 @@@ $(subst %,%_MD5,$(objects)) 
  $(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/$(THISAPP)-build_with_kernel4x.patch
        cd $(DIR_APP) && make -f Makefile.init makefiles \
                DEBUG="" OPT="$(CFLAGS) -fno-strict-aliasing" CCARGS="$(CCARGS)" AUXLIBS="$(AUXLIBS)"
        cd $(DIR_APP) && make $(MAKETUNING)
        install -v -m 644 $(DIR_SRC)/config/backup/includes/postfix \
                         /var/ipfire/backup/addons/includes/postfix
        mv /usr/sbin/sendmail /usr/sbin/sendmail.postfix
+       #install initscripts
+       $(call INSTALL_INITSCRIPT,postfix)
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
diff --combined lfs/udev
index f6686954d157728dd37d14bc018c9501704189d1,2d5c56078cdc146cf0e5abd9cfb47b8308c70074..1e6323620b88002b32aca0b7893a3695b173a82d
+++ b/lfs/udev
@@@ -76,10 -76,7 +76,8 @@@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(
        cd $(DIR_APP) && tar axf $(DIR_DL)/udev-lfs-$(VER)-1.tar.bz2
  
        cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/udev-208_remove_systemd_log.patch
 +      cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/udev-208-fix_uint8_t.patch
  
-       cd $(DIR_APP)/udev-lfs-$(VER)-1 && sed -i "s/HANDLE_AT 1/HANDLE_AT 0/g" cfg.h
        rm -rf /lib/udev/devices
        install -dv /lib/firmware
  
diff --combined make.sh
index 7351b5ad9523b1547bf6c97b3af383df2c7e24d3,663f23fbb9dc27f5c5bdbe71d26216dfe74577ce..89c3e56cafaba1c0df9b6fc3f6501ce10e755507
+++ b/make.sh
@@@ -25,8 -25,8 +25,8 @@@
  NAME="IPFire"                                                 # Software name
  SNAME="ipfire"                                                        # Short name
  VERSION="2.19"                                                        # Version number
- CORE="109"                                                    # Core Level (Filename)
- PAKFIRE_CORE="109"                                            # Core Level (PAKFIRE)
+ CORE="112"                                                    # Core Level (Filename)
+ PAKFIRE_CORE="112"                                            # Core Level (PAKFIRE)
  GIT_BRANCH=`git rev-parse --abbrev-ref HEAD`                  # Git Branch
  SLOGAN="www.ipfire.org"                                               # Software slogan
  CONFIG_ROOT=/var/ipfire                                               # Configuration rootdir
@@@ -36,11 -36,11 +36,11 @@@ BUILD_IMAGES=1                                                     # Flash and Xen Do
  KVER=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'`
  GIT_TAG=$(git tag | tail -1)                                  # Git Tag
  GIT_LASTCOMMIT=$(git log | head -n1 | cut -d" " -f2 |head -c8)        # Last commit
- TOOLCHAINVER=12
+ TOOLCHAINVER=20170705
  
  # New architecture variables
- BUILD_ARCH="$(uname -m)"
- BUILDMACHINE="${BUILD_ARCH}"
+ HOST_ARCH="$(uname -m)"
  
  # Debian specific settings
  if [ ! -e /etc/debian_version ]; then
@@@ -69,10 -69,13 +69,13 @@@ if [ -f .config ]; the
        . .config
  fi
  
- if [ -n "${TARGET_ARCH}" ]; then
-       configure_target "${TARGET_ARCH}"
+ if [ -n "${BUILD_ARCH}" ]; then
+       configure_build "${BUILD_ARCH}"
+ elif [ -n "${TARGET_ARCH}" ]; then
+       configure_build "${TARGET_ARCH}"
+       unset TARGET_ARCH
  else
-       configure_target "default"
+       configure_build "default"
  fi
  
  if [ -z $EDITOR ]; then
@@@ -221,13 -224,13 +224,13 @@@ prepareenv() 
      # Run LFS static binary creation scripts one by one
      export CCACHE_DIR=$BASEDIR/ccache
      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
      rm -f $BASEDIR/build/usr/src/lsalr 2>/dev/null
  
      # 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
        GIT_STATUS=""
      else
  
  buildtoolchain() {
      local error=false
-     case "${TARGET_ARCH}:${BUILD_ARCH}" in
+     case "${BUILD_ARCH}:${HOST_ARCH}" in
          # x86_64
          x86_64:x86_64)
               # This is working.
              ;;
  
          # ARM
+         arvm7hl:armv7hl|armv7hl:armv7l)
+             # These are working.
+             ;;
          armv5tel:armv5tel|armv5tel:armv5tejl|armv5tel:armv6l|armv5tel:armv7l|armv5tel:aarch64)
              # These are working.
              ;;
      esac
  
      ${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)
      if [ -z "${gcc}" ]; then
      LOGFILE="$BASEDIR/log/_build.toolchain.log"
      export LOGFILE
  
-     local ORG_PATH=$PATH
-     export PATH="/tools/ccache/bin:/tools/bin:$PATH"
+     lfsmake1 stage1
      lfsmake1 ccache                   PASS=1
      lfsmake1 binutils                 PASS=1
      lfsmake1 gcc                      PASS=1
-     lfsmake1 linux                    TOOLS=1 KCFG="-headers"
+     lfsmake1 linux                    KCFG="-headers"
      lfsmake1 glibc
-     lfsmake1 cleanup-toolchain                PASS=1
      lfsmake1 gcc                      PASS=L
      lfsmake1 binutils                 PASS=2
      lfsmake1 gcc                      PASS=2
      lfsmake1 texinfo
      lfsmake1 xz
      lfsmake1 fake-environ
-     lfsmake1 cleanup-toolchain                PASS=2
-     export PATH=$ORG_PATH
+     lfsmake1 cleanup-toolchain
  }
  
  buildbase() {
      lfsmake2 man-pages
      lfsmake2 glibc
      lfsmake2 tzdata
-     lfsmake2 cleanup-toolchain                PASS=3
+     lfsmake2 cleanup-toolchain
      lfsmake2 zlib
      lfsmake2 binutils
      lfsmake2 gmp
      lfsmake2 file
      lfsmake2 gcc
      lfsmake2 sed
-     lfsmake2 berkeley
      lfsmake2 autoconf
      lfsmake2 automake
+     lfsmake2 berkeley
      lfsmake2 coreutils
      lfsmake2 iana-etc
      lfsmake2 m4
  buildipfire() {
    LOGFILE="$BASEDIR/log/_build.ipfire.log"
    export LOGFILE
-   ipfiremake configroot
-   ipfiremake backup
-   ipfiremake pkg-config
-   ipfiremake libusb
-   ipfiremake libusb-compat
-   ipfiremake libpcap
-   ipfiremake ppp
-   ipfiremake pptp
-   ipfiremake unzip
-   ipfiremake which
-   ipfiremake linux-firmware
-   ipfiremake ath10k-firmware
-   ipfiremake dvb-firmwares
-   ipfiremake mt7601u-firmware
-   ipfiremake zd1211-firmware
-   ipfiremake rpi-firmware
-   ipfiremake bc
-   ipfiremake u-boot
-   ipfiremake cpio
-   ipfiremake mdadm
-   ipfiremake dracut
-   ipfiremake lvm2
-   ipfiremake multipath-tools
-   ipfiremake freetype
-   ipfiremake grub
-   ipfiremake libmnl
-   ipfiremake libnfnetlink
-   ipfiremake libnetfilter_queue
-   ipfiremake libnetfilter_conntrack
-   ipfiremake libnetfilter_cthelper
-   ipfiremake libnetfilter_cttimeout
-   ipfiremake iptables
-   case "${TARGET_ARCH}" in
+   lfsmake2 configroot
+   lfsmake2 initscripts
+   lfsmake2 backup
+   lfsmake2 pkg-config
+   lfsmake2 libusb
+   lfsmake2 libusb-compat
+   lfsmake2 libpcap
+   lfsmake2 ppp
+   lfsmake2 pptp
+   lfsmake2 unzip
+   lfsmake2 which
+   lfsmake2 linux-firmware
+   lfsmake2 ath10k-firmware
+   lfsmake2 dvb-firmwares
+   lfsmake2 mt7601u-firmware
+   lfsmake2 zd1211-firmware
+   lfsmake2 rpi-firmware
+   lfsmake2 bc
+   lfsmake2 u-boot
+   lfsmake2 cpio
+   lfsmake2 mdadm
+   lfsmake2 dracut
+   lfsmake2 lvm2
+   lfsmake2 multipath-tools
+   lfsmake2 freetype
+   lfsmake2 grub
+   lfsmake2 libmnl
+   lfsmake2 libnfnetlink
+   lfsmake2 libnetfilter_queue
+   lfsmake2 libnetfilter_conntrack
+   lfsmake2 libnetfilter_cthelper
+   lfsmake2 libnetfilter_cttimeout
+   lfsmake2 iptables
+   case "${BUILD_ARCH}" in
        x86_64)
-               ipfiremake linux                        KCFG=""
- #             ipfiremake backports                    KCFG=""
- #             ipfiremake e1000e                       KCFG=""
- #             ipfiremake igb                          KCFG=""
- #             ipfiremake ixgbe                        KCFG=""
-               ipfiremake xtables-addons               KCFG=""
-               ipfiremake linux-initrd                 KCFG=""
+               lfsmake2 linux                  KCFG=""
 -              lfsmake2 backports                      KCFG=""
 -              lfsmake2 e1000e                 KCFG=""
 -              lfsmake2 igb                            KCFG=""
 -              lfsmake2 ixgbe                  KCFG=""
++#             lfsmake2 backports                      KCFG=""
++#             lfsmake2 e1000e                 KCFG=""
++#             lfsmake2 igb                            KCFG=""
++#             lfsmake2 ixgbe                  KCFG=""
+               lfsmake2 xtables-addons         KCFG=""
+               lfsmake2 linux-initrd                   KCFG=""
                ;;
        i586)
                # x86-pae (Native and new XEN) kernel build
-               ipfiremake linux                        KCFG="-pae"
- #             ipfiremake backports                    KCFG="-pae"
- #             ipfiremake e1000e                       KCFG="-pae"
- #             ipfiremake igb                          KCFG="-pae"
- #             ipfiremake ixgbe                        KCFG="-pae"
-               ipfiremake xtables-addons               KCFG="-pae"
-               ipfiremake linux-initrd                 KCFG="-pae"
+               lfsmake2 linux                  KCFG="-pae"
 -              lfsmake2 backports                      KCFG="-pae"
 -              lfsmake2 e1000e                 KCFG="-pae"
 -              lfsmake2 igb                            KCFG="-pae"
 -              lfsmake2 ixgbe                  KCFG="-pae"
++#             lfsmake2 backports                      KCFG="-pae"
++#             lfsmake2 e1000e                 KCFG="-pae"
++#             lfsmake2 igb                            KCFG="-pae"
++#             lfsmake2 ixgbe                  KCFG="-pae"
+               lfsmake2 xtables-addons         KCFG="-pae"
+               lfsmake2 linux-initrd                   KCFG="-pae"
  
                # x86 kernel build
-               ipfiremake linux                        KCFG=""
- #             ipfiremake backports                    KCFG=""
- #             ipfiremake e1000e                       KCFG=""
- #             ipfiremake igb                          KCFG=""
- #             ipfiremake ixgbe                        KCFG=""
-               ipfiremake xtables-addons               KCFG=""
-               ipfiremake linux-initrd                 KCFG=""
+               lfsmake2 linux                  KCFG=""
 -              lfsmake2 backports                      KCFG=""
 -              lfsmake2 e1000e                 KCFG=""
 -              lfsmake2 igb                            KCFG=""
 -              lfsmake2 ixgbe                  KCFG=""
++#             lfsmake2 backports                      KCFG=""
++#             lfsmake2 e1000e                 KCFG=""
++#             lfsmake2 igb                            KCFG=""
++#             lfsmake2 ixgbe                  KCFG=""
+               lfsmake2 xtables-addons         KCFG=""
+               lfsmake2 linux-initrd                   KCFG=""
                ;;
  
        armv5tel)
                # arm-rpi (Raspberry Pi) kernel build
-               ipfiremake linux                        KCFG="-rpi"
-               ipfiremake backports                    KCFG="-rpi"
-               ipfiremake xtables-addons               KCFG="-rpi"
-               ipfiremake linux-initrd                 KCFG="-rpi"
+               lfsmake2 linux                  KCFG="-rpi"
+               lfsmake2 backports                      KCFG="-rpi"
+               lfsmake2 xtables-addons         KCFG="-rpi"
+               lfsmake2 linux-initrd                   KCFG="-rpi"
  
                # arm multi platform (Panda, Wandboard ...) kernel build
-               ipfiremake linux                        KCFG="-multi"
-               ipfiremake backports                    KCFG="-multi"
-               ipfiremake e1000e                       KCFG="-multi"
-               ipfiremake igb                          KCFG="-multi"
-               ipfiremake ixgbe                        KCFG="-multi"
-               ipfiremake xtables-addons               KCFG="-multi"
-               ipfiremake linux-initrd                 KCFG="-multi"
+               lfsmake2 linux                  KCFG="-multi"
+               lfsmake2 backports                      KCFG="-multi"
+               lfsmake2 e1000e                 KCFG="-multi"
+               lfsmake2 igb                            KCFG="-multi"
+               lfsmake2 ixgbe                  KCFG="-multi"
+               lfsmake2 xtables-addons         KCFG="-multi"
+               lfsmake2 linux-initrd                   KCFG="-multi"
  
                # arm-kirkwood (Dreamplug, ICY-Box ...) kernel build
-               ipfiremake linux                        KCFG="-kirkwood"
-               ipfiremake backports                    KCFG="-kirkwood"
-               ipfiremake e1000e                       KCFG="-kirkwood"
-               ipfiremake igb                          KCFG="-kirkwood"
-               ipfiremake ixgbe                        KCFG="-kirkwood"
-               ipfiremake xtables-addons               KCFG="-kirkwood"
-               ipfiremake linux-initrd                 KCFG="-kirkwood"
+               lfsmake2 linux                  KCFG="-kirkwood"
+               lfsmake2 backports                      KCFG="-kirkwood"
+               lfsmake2 e1000e                 KCFG="-kirkwood"
+               lfsmake2 igb                            KCFG="-kirkwood"
+               lfsmake2 ixgbe                  KCFG="-kirkwood"
+               lfsmake2 xtables-addons         KCFG="-kirkwood"
+               lfsmake2 linux-initrd                   KCFG="-kirkwood"
                ;;
    esac
-   ipfiremake xtables-addons                   USPACE="1"
-   ipfiremake openssl
-   [ "${TARGET_ARCH}" = "i586" ] && ipfiremake openssl KCFG='-sse2'
-   ipfiremake libgpg-error
-   ipfiremake libgcrypt
-   ipfiremake libassuan
-   ipfiremake bind
-   ipfiremake dhcp
-   ipfiremake dhcpcd
-   ipfiremake boost
-   ipfiremake linux-atm
-   ipfiremake expat
-   ipfiremake gdbm
-   ipfiremake pam
-   ipfiremake curl
-   ipfiremake tcl
-   ipfiremake sqlite
-   ipfiremake libffi
-   ipfiremake python
-   ipfiremake python3
-   ipfiremake ca-certificates
-   ipfiremake fireinfo
-   ipfiremake libnet
-   ipfiremake libnl
-   ipfiremake libnl-3
-   ipfiremake libidn
-   ipfiremake nasm
-   ipfiremake libjpeg
-   ipfiremake libjpeg-compat
-   ipfiremake libexif
-   ipfiremake libpng
-   ipfiremake libtiff
-   ipfiremake libart
-   ipfiremake gd
-   ipfiremake popt
-   ipfiremake pcre
-   ipfiremake slang
-   ipfiremake newt
-   ipfiremake libsmooth
-   ipfiremake attr
-   ipfiremake acl
-   ipfiremake libcap
-   ipfiremake pciutils
-   ipfiremake usbutils
-   ipfiremake libxml2
-   ipfiremake libxslt
-   ipfiremake BerkeleyDB
-   ipfiremake mysql
-   ipfiremake cyrus-sasl
-   ipfiremake openldap
-   ipfiremake apache2
-   ipfiremake php
-   ipfiremake web-user-interface
-   ipfiremake flag-icons
-   ipfiremake jquery
-   ipfiremake arping
-   ipfiremake beep
-   ipfiremake dvdrtools
-   ipfiremake nettle
-   ipfiremake libevent
-   ipfiremake libevent2
-   ipfiremake unbound
-   ipfiremake dosfstools
-   ipfiremake reiserfsprogs
-   ipfiremake xfsprogs
-   ipfiremake sysfsutils
-   ipfiremake fuse
-   ipfiremake ntfs-3g
-   ipfiremake ethtool
-   ipfiremake ez-ipupdate
-   ipfiremake fcron
-   ipfiremake perl-GD
-   ipfiremake GD-Graph
-   ipfiremake GD-TextUtil
-   ipfiremake perl-Device-SerialPort
-   ipfiremake perl-Device-Modem
-   ipfiremake perl-Apache-Htpasswd
-   ipfiremake gnupg
-   ipfiremake hdparm
-   ipfiremake sdparm
-   ipfiremake mtools
-   ipfiremake initscripts
-   ipfiremake whatmask
-   ipfiremake conntrack-tools
-   ipfiremake libupnp
-   ipfiremake ipaddr
-   ipfiremake iputils
-   ipfiremake l7-protocols
-   ipfiremake mISDNuser
-   ipfiremake capi4k-utils
-   ipfiremake hwdata
-   ipfiremake logrotate
-   ipfiremake logwatch
-   ipfiremake misc-progs
-   ipfiremake nano
-   ipfiremake URI
-   ipfiremake HTML-Tagset
-   ipfiremake HTML-Parser
-   ipfiremake HTML-Template
-   ipfiremake Compress-Zlib
-   ipfiremake Digest
-   ipfiremake Digest-SHA1
-   ipfiremake Digest-HMAC
-   ipfiremake libwww-perl
-   ipfiremake Net-DNS
-   ipfiremake Net-IPv4Addr
-   ipfiremake Net_SSLeay
-   ipfiremake IO-Stringy
-   ipfiremake IO-Socket-SSL
-   ipfiremake Unix-Syslog
-   ipfiremake Mail-Tools
-   ipfiremake MIME-Tools
-   ipfiremake Net-Server
-   ipfiremake Convert-TNEF
-   ipfiremake Convert-UUlib
-   ipfiremake Archive-Tar
-   ipfiremake Archive-Zip
-   ipfiremake Text-Tabs+Wrap
-   ipfiremake Locale-Country
-   ipfiremake XML-Parser
-   ipfiremake Crypt-PasswdMD5
-   ipfiremake Net-Telnet
-   ipfiremake python-setuptools
-   ipfiremake python-clientform
-   ipfiremake python-mechanize
-   ipfiremake python-feedparser
-   ipfiremake python-rssdler
-   ipfiremake python-inotify
-   ipfiremake python-docutils
-   ipfiremake python-daemon
-   ipfiremake python-ipaddress
-   ipfiremake glib
-   ipfiremake GeoIP
-   ipfiremake fwhits
-   ipfiremake noip_updater
-   ipfiremake ntp
-   ipfiremake openssh
-   ipfiremake fontconfig
-   ipfiremake dejavu-fonts-ttf
-   ipfiremake freefont
-   ipfiremake pixman
-   ipfiremake cairo
-   ipfiremake pango
-   ipfiremake rrdtool
-   ipfiremake setserial
-   ipfiremake setup
-   ipfiremake libdnet
-   ipfiremake daq
-   ipfiremake snort
-   ipfiremake oinkmaster
-   ipfiremake squid
-   ipfiremake squidguard
-   ipfiremake calamaris
-   ipfiremake tcpdump
-   ipfiremake traceroute
-   ipfiremake vlan
-   ipfiremake wireless
-   ipfiremake pakfire
-   ipfiremake spandsp
-   ipfiremake lzo
-   ipfiremake openvpn
-   ipfiremake pammysql
-   ipfiremake mpage
-   ipfiremake dbus
-   ipfiremake cups
-   ipfiremake ghostscript
-   ipfiremake foomatic
-   ipfiremake hplip
-   ipfiremake cifs-utils
-   ipfiremake krb5
-   ipfiremake samba
-   ipfiremake sudo
-   ipfiremake mc
-   ipfiremake wget
-   ipfiremake bridge-utils
-   ipfiremake screen
-   ipfiremake smartmontools
-   ipfiremake htop
-   ipfiremake chkconfig
-   ipfiremake postfix
-   ipfiremake fetchmail
-   ipfiremake cyrus-imapd
-   ipfiremake openmailadmin
-   ipfiremake clamav
-   ipfiremake spamassassin
-   ipfiremake amavisd
-   ipfiremake dma
-   ipfiremake alsa
-   ipfiremake mpfire
-   ipfiremake guardian
-   ipfiremake libid3tag
-   ipfiremake libmad
-   ipfiremake libogg
-   ipfiremake libvorbis
-   ipfiremake libdvbpsi
-   ipfiremake flac
-   ipfiremake lame
-   ipfiremake sox
-   ipfiremake libshout
-   ipfiremake xvid
-   ipfiremake libmpeg2
-   ipfiremake libarchive
-   ipfiremake cmake
-   ipfiremake gnump3d
-   ipfiremake rsync
-   ipfiremake tcpwrapper
-   ipfiremake libtirpc
-   ipfiremake rpcbind
-   ipfiremake nfs
-   ipfiremake gnu-netcat
-   ipfiremake ncat
-   ipfiremake nmap
-   ipfiremake ncftp
-   ipfiremake etherwake
-   ipfiremake bwm-ng
-   ipfiremake sysstat
-   ipfiremake vsftpd
-   ipfiremake strongswan
-   ipfiremake rng-tools
-   ipfiremake lsof
-   ipfiremake br2684ctl
-   ipfiremake pcmciautils
-   ipfiremake lm_sensors
-   ipfiremake liboping
-   ipfiremake collectd
-   ipfiremake elinks
-   ipfiremake igmpproxy
-   ipfiremake fbset
-   ipfiremake opus
-   ipfiremake python-six
-   ipfiremake python-pyparsing
-   ipfiremake spice-protocol
-   ipfiremake spice
-   ipfiremake sdl
-   ipfiremake libusbredir
-   ipfiremake qemu
-   ipfiremake sane
-   ipfiremake netpbm
-   ipfiremake phpSANE
-   ipfiremake tunctl
-   ipfiremake netsnmpd
-   ipfiremake nagios
-   ipfiremake nagios_nrpe
-   ipfiremake icinga
-   ipfiremake ebtables
-   ipfiremake directfb
-   ipfiremake dfb++
-   ipfiremake faad2
-   ipfiremake ffmpeg
-   ipfiremake vdr
-   ipfiremake vdr_streamdev
-   ipfiremake vdr_vnsiserver5
-   ipfiremake vdr_epgsearch
-   ipfiremake vdr_dvbapi
-   ipfiremake vdr_eepg
-   ipfiremake w_scan
-   ipfiremake icecast
-   ipfiremake icegenerator
-   ipfiremake mpd
-   ipfiremake libmpdclient
-   ipfiremake mpc
-   ipfiremake perl-Net-SMTP-SSL
-   ipfiremake perl-MIME-Base64
-   ipfiremake perl-Authen-SASL
-   ipfiremake perl-MIME-Lite
-   ipfiremake perl-Email-Date-Format
-   ipfiremake git
-   ipfiremake squidclamav
-   ipfiremake vnstat
-   ipfiremake iw
-   ipfiremake wpa_supplicant
-   ipfiremake hostapd
-   ipfiremake pycurl
-   ipfiremake urlgrabber
-   ipfiremake syslinux
-   ipfiremake tftpd
-   ipfiremake cpufrequtils
-   ipfiremake bluetooth
-   ipfiremake gutenprint
-   ipfiremake apcupsd
-   ipfiremake iperf
-   ipfiremake iperf3
-   ipfiremake 7zip
-   ipfiremake lynis
-   ipfiremake streamripper
-   ipfiremake sshfs
-   ipfiremake taglib
-   #ipfiremake mediatomb
-   ipfiremake sslh
-   ipfiremake perl-gettext
-   ipfiremake perl-Sort-Naturally
-   ipfiremake vdradmin
-   ipfiremake miau
-   ipfiremake perl-DBI
-   ipfiremake perl-DBD-mysql
-   ipfiremake perl-DBD-SQLite
-   ipfiremake perl-File-ReadBackwards
-   ipfiremake cacti
-   ipfiremake openvmtools
-   ipfiremake nagiosql
-   ipfiremake iftop
-   ipfiremake motion
-   ipfiremake joe
-   ipfiremake monit
-   ipfiremake nut
-   ipfiremake watchdog
-   ipfiremake libpri
-   ipfiremake libsrtp
-   ipfiremake asterisk
-   ipfiremake lcr
-   ipfiremake usb_modeswitch
-   ipfiremake usb_modeswitch_data
-   ipfiremake zerofree
-   ipfiremake pound
-   ipfiremake minicom
-   ipfiremake ddrescue
-   ipfiremake imspector
-   ipfiremake miniupnpd
-   ipfiremake client175
-   ipfiremake powertop
-   ipfiremake parted
-   ipfiremake swig
-   ipfiremake python-m2crypto
-   ipfiremake wireless-regdb
-   ipfiremake crda
-   ipfiremake libsolv
-   ipfiremake python-distutils-extra
-   ipfiremake python-lzma
-   ipfiremake python-progressbar
-   ipfiremake python-xattr
-   ipfiremake intltool
-   ipfiremake ddns
-   ipfiremake transmission
-   ipfiremake dpfhack
-   ipfiremake lcd4linux
-   ipfiremake mtr
-   ipfiremake tcpick
-   ipfiremake minidlna
-   ipfiremake acpid
-   ipfiremake fping
-   ipfiremake telnet
-   ipfiremake xinetd
-   ipfiremake gpgme
-   ipfiremake pygpgme
-   ipfiremake pakfire3
-   ipfiremake stress
-   ipfiremake libstatgrab
-   ipfiremake sarg
-   ipfiremake check_mk_agent
-   ipfiremake libdaemon
-   ipfiremake avahi
-   ipfiremake nginx
-   ipfiremake sendEmail
-   ipfiremake sysbench
-   ipfiremake strace
-   ipfiremake ipfire-netboot
-   ipfiremake lcdproc
-   ipfiremake bitstream
-   ipfiremake multicat
-   ipfiremake keepalived
-   ipfiremake ipvsadm
-   ipfiremake perl-Carp-Clan
-   ipfiremake perl-Date-Calc
-   ipfiremake perl-Date-Manip
-   ipfiremake perl-File-Tail
-   ipfiremake perl-TimeDate
-   ipfiremake swatch
-   ipfiremake tor
-   ipfiremake arm
-   ipfiremake wavemon
-   ipfiremake iptraf-ng
-   ipfiremake iotop
-   ipfiremake stunnel
-   ipfiremake sslscan
-   ipfiremake owncloud
-   ipfiremake bacula
-   ipfiremake batctl
-   ipfiremake perl-PDF-API2
-   ipfiremake squid-accounting
-   ipfiremake pigz
-   ipfiremake tmux
-   ipfiremake perl-Text-CSV_XS
-   ipfiremake swconfig
-   ipfiremake haproxy
-   ipfiremake ipset
-   ipfiremake lua
-   ipfiremake dnsdist
-   ipfiremake bird
-   ipfiremake dmidecode
-   ipfiremake mcelog
-   ipfiremake rtpproxy
-   ipfiremake util-macros
-   ipfiremake libpciaccess
-   ipfiremake libyajl
-   ipfiremake libvirt
-   ipfiremake freeradius
-   ipfiremake perl-common-sense
-   ipfiremake perl-inotify2
-   ipfiremake perl-Net-IP
+   lfsmake2 xtables-addons                     USPACE="1"
+   lfsmake2 openssl
+   [ "${BUILD_ARCH}" = "i586" ] && lfsmake2 openssl KCFG='-sse2'
+   lfsmake2 libgpg-error
+   lfsmake2 libgcrypt
+   lfsmake2 libassuan
+   lfsmake2 nettle
+   lfsmake2 libevent
+   lfsmake2 libevent2
+   lfsmake2 libevent2-compat
+   lfsmake2 expat
+   lfsmake2 unbound
+   lfsmake2 gnutls
+   lfsmake2 bind
+   lfsmake2 dhcp
+   lfsmake2 dhcpcd
+   lfsmake2 boost
+   lfsmake2 linux-atm
+   lfsmake2 gdbm
+   lfsmake2 pam
+   lfsmake2 curl
+   lfsmake2 tcl
+   lfsmake2 sqlite
+   lfsmake2 libffi
+   lfsmake2 python
+   lfsmake2 python3
+   lfsmake2 ca-certificates
+   lfsmake2 fireinfo
+   lfsmake2 libnet
+   lfsmake2 libnl
+   lfsmake2 libnl-3
+   lfsmake2 libidn
+   lfsmake2 nasm
+   lfsmake2 libjpeg
+   lfsmake2 libjpeg-compat
+   lfsmake2 libexif
+   lfsmake2 libpng
+   lfsmake2 libtiff
+   lfsmake2 libart
+   lfsmake2 gd
+   lfsmake2 popt
+   lfsmake2 slang
+   lfsmake2 newt
+   lfsmake2 libsmooth
+   lfsmake2 attr
+   lfsmake2 acl
+   lfsmake2 libcap
+   lfsmake2 pciutils
+   lfsmake2 usbutils
+   lfsmake2 libxml2
+   lfsmake2 libxslt
+   lfsmake2 BerkeleyDB
+   lfsmake2 mysql
+   lfsmake2 cyrus-sasl
+   lfsmake2 openldap
+   lfsmake2 apache2
+   lfsmake2 php
+   lfsmake2 web-user-interface
+   lfsmake2 flag-icons
+   lfsmake2 jquery
+   lfsmake2 arping
+   lfsmake2 beep
+   lfsmake2 dvdrtools
+   lfsmake2 dosfstools
+   lfsmake2 reiserfsprogs
+   lfsmake2 xfsprogs
+   lfsmake2 sysfsutils
+   lfsmake2 fuse
+   lfsmake2 ntfs-3g
+   lfsmake2 ethtool
+   lfsmake2 ez-ipupdate
+   lfsmake2 fcron
+   lfsmake2 perl-GD
+   lfsmake2 GD-Graph
+   lfsmake2 GD-TextUtil
+   lfsmake2 perl-Device-SerialPort
+   lfsmake2 perl-Device-Modem
+   lfsmake2 perl-Apache-Htpasswd
+   lfsmake2 gnupg
+   lfsmake2 hdparm
+   lfsmake2 sdparm
+   lfsmake2 mtools
+   lfsmake2 whatmask
+   lfsmake2 conntrack-tools
+   lfsmake2 libupnp
+   lfsmake2 ipaddr
+   lfsmake2 iputils
+   lfsmake2 l7-protocols
+   lfsmake2 mISDNuser
+   lfsmake2 capi4k-utils
+   lfsmake2 hwdata
+   lfsmake2 logrotate
+   lfsmake2 logwatch
+   lfsmake2 misc-progs
+   lfsmake2 nano
+   lfsmake2 URI
+   lfsmake2 HTML-Tagset
+   lfsmake2 HTML-Parser
+   lfsmake2 HTML-Template
+   lfsmake2 Compress-Zlib
+   lfsmake2 Digest
+   lfsmake2 Digest-SHA1
+   lfsmake2 Digest-HMAC
+   lfsmake2 libwww-perl
+   lfsmake2 Net-DNS
+   lfsmake2 Net-IPv4Addr
+   lfsmake2 Net_SSLeay
+   lfsmake2 IO-Stringy
+   lfsmake2 IO-Socket-SSL
+   lfsmake2 Unix-Syslog
+   lfsmake2 Mail-Tools
+   lfsmake2 MIME-Tools
+   lfsmake2 Net-Server
+   lfsmake2 Convert-TNEF
+   lfsmake2 Convert-UUlib
+   lfsmake2 Archive-Tar
+   lfsmake2 Archive-Zip
+   lfsmake2 Text-Tabs+Wrap
+   lfsmake2 Locale-Country
+   lfsmake2 XML-Parser
+   lfsmake2 Crypt-PasswdMD5
+   lfsmake2 Net-Telnet
+   lfsmake2 python-setuptools
+   lfsmake2 python-clientform
+   lfsmake2 python-mechanize
+   lfsmake2 python-feedparser
+   lfsmake2 python-rssdler
+   lfsmake2 python-inotify
+   lfsmake2 python-docutils
+   lfsmake2 python-daemon
+   lfsmake2 python-ipaddress
+   lfsmake2 glib
+   lfsmake2 GeoIP
+   lfsmake2 noip_updater
+   lfsmake2 ntp
+   lfsmake2 openssh
+   lfsmake2 fontconfig
+   lfsmake2 dejavu-fonts-ttf
+   lfsmake2 freefont
+   lfsmake2 pixman
+   lfsmake2 cairo
+   lfsmake2 pango
+   lfsmake2 rrdtool
+   lfsmake2 setserial
+   lfsmake2 setup
+   lfsmake2 libdnet
+   lfsmake2 daq
+   lfsmake2 snort
+   lfsmake2 oinkmaster
+   lfsmake2 squid
+   lfsmake2 squidguard
+   lfsmake2 calamaris
+   lfsmake2 tcpdump
+   lfsmake2 traceroute
+   lfsmake2 vlan
+   lfsmake2 wireless
+   lfsmake2 pakfire
+   lfsmake2 spandsp
+   lfsmake2 lzo
+   lfsmake2 openvpn
+   lfsmake2 pammysql
+   lfsmake2 mpage
+   lfsmake2 dbus
+   lfsmake2 intltool
+   lfsmake2 libdaemon
+   lfsmake2 cups
+   lfsmake2 lcms2
+   lfsmake2 ghostscript
+   lfsmake2 qpdf
+   lfsmake2 poppler
+   lfsmake2 cups-filters
+   lfsmake2 epson-inkjet-printer-escpr
+   lfsmake2 foomatic
+   lfsmake2 hplip
+   lfsmake2 cifs-utils
+   lfsmake2 krb5
+   lfsmake2 samba
+   lfsmake2 sudo
+   lfsmake2 mc
+   lfsmake2 wget
+   lfsmake2 bridge-utils
+   lfsmake2 screen
+   lfsmake2 smartmontools
+   lfsmake2 htop
+   lfsmake2 chkconfig
+   lfsmake2 postfix
+   lfsmake2 fetchmail
+   lfsmake2 cyrus-imapd
+   lfsmake2 openmailadmin
+   lfsmake2 clamav
+   lfsmake2 spamassassin
+   lfsmake2 amavisd
+   lfsmake2 dma
+   lfsmake2 alsa
+   lfsmake2 mpfire
+   lfsmake2 guardian
+   lfsmake2 libid3tag
+   lfsmake2 libmad
+   lfsmake2 libogg
+   lfsmake2 libvorbis
+   lfsmake2 libdvbpsi
+   lfsmake2 flac
+   lfsmake2 lame
+   lfsmake2 sox
+   lfsmake2 libshout
+   lfsmake2 xvid
+   lfsmake2 libmpeg2
+   lfsmake2 libarchive
+   lfsmake2 cmake
+   lfsmake2 gnump3d
+   lfsmake2 rsync
+   lfsmake2 tcpwrapper
+   lfsmake2 libtirpc
+   lfsmake2 rpcbind
+   lfsmake2 nfs
+   lfsmake2 gnu-netcat
+   lfsmake2 ncat
+   lfsmake2 nmap
+   lfsmake2 etherwake
+   lfsmake2 bwm-ng
+   lfsmake2 sysstat
+   lfsmake2 vsftpd
+   lfsmake2 strongswan
+   lfsmake2 rng-tools
+   lfsmake2 lsof
+   lfsmake2 br2684ctl
+   lfsmake2 pcmciautils
+   lfsmake2 lm_sensors
+   lfsmake2 liboping
+   lfsmake2 collectd
+   lfsmake2 elinks
+   lfsmake2 igmpproxy
+   lfsmake2 fbset
+   lfsmake2 opus
+   lfsmake2 python-six
+   lfsmake2 python-pyparsing
+   lfsmake2 spice-protocol
+   lfsmake2 spice
+   lfsmake2 sdl
+   lfsmake2 libusbredir
+   lfsmake2 qemu
+   lfsmake2 sane
+   lfsmake2 netpbm
+   lfsmake2 phpSANE
+   lfsmake2 tunctl
+   lfsmake2 netsnmpd
+   lfsmake2 nagios
+   lfsmake2 nagios_nrpe
+   lfsmake2 icinga
+   lfsmake2 ebtables
+   lfsmake2 directfb
+   lfsmake2 faad2
+   lfsmake2 ffmpeg
+   lfsmake2 vdr
+   lfsmake2 vdr_streamdev
+   lfsmake2 vdr_epgsearch
+   lfsmake2 vdr_dvbapi
+   lfsmake2 vdr_eepg
+   lfsmake2 w_scan
+   lfsmake2 icecast
+   lfsmake2 icegenerator
+   lfsmake2 mpd
+   lfsmake2 libmpdclient
+   lfsmake2 mpc
+   lfsmake2 perl-Net-SMTP-SSL
+   lfsmake2 perl-MIME-Base64
+   lfsmake2 perl-Authen-SASL
+   lfsmake2 perl-MIME-Lite
+   lfsmake2 perl-Email-Date-Format
+   lfsmake2 git
+   lfsmake2 squidclamav
+   lfsmake2 vnstat
+   lfsmake2 iw
+   lfsmake2 wpa_supplicant
+   lfsmake2 hostapd
+   lfsmake2 pycurl
+   lfsmake2 urlgrabber
+   lfsmake2 syslinux
+   lfsmake2 tftpd
+   lfsmake2 cpufrequtils
+   lfsmake2 bluetooth
+   lfsmake2 gutenprint
+   lfsmake2 apcupsd
+   lfsmake2 iperf
+   lfsmake2 iperf3
+   lfsmake2 7zip
+   lfsmake2 lynis
+   lfsmake2 streamripper
+   lfsmake2 sshfs
+   lfsmake2 taglib
+   #lfsmake2 mediatomb
+   lfsmake2 sslh
+   lfsmake2 perl-gettext
+   lfsmake2 perl-Sort-Naturally
+   lfsmake2 vdradmin
+   lfsmake2 miau
+   lfsmake2 perl-DBI
+   lfsmake2 perl-DBD-mysql
+   lfsmake2 perl-DBD-SQLite
+   lfsmake2 perl-File-ReadBackwards
+   lfsmake2 cacti
+   lfsmake2 openvmtools
+   lfsmake2 nagiosql
+   lfsmake2 motion
+   lfsmake2 joe
+   lfsmake2 monit
+   lfsmake2 nut
+   lfsmake2 watchdog
+   lfsmake2 libpri
+   lfsmake2 libsrtp
+   lfsmake2 asterisk
+   lfsmake2 lcr
+   lfsmake2 usb_modeswitch
+   lfsmake2 usb_modeswitch_data
+   lfsmake2 zerofree
+   lfsmake2 pound
+   lfsmake2 minicom
+   lfsmake2 ddrescue
+   lfsmake2 miniupnpd
+   lfsmake2 client175
+   lfsmake2 powertop
+   lfsmake2 parted
+   lfsmake2 swig
+   lfsmake2 python-m2crypto
+   lfsmake2 wireless-regdb
+   lfsmake2 crda
+   lfsmake2 libsolv
+   lfsmake2 python-distutils-extra
+   lfsmake2 python-lzma
+   lfsmake2 python-progressbar
+   lfsmake2 python-xattr
+   lfsmake2 ddns
+   lfsmake2 transmission
+   lfsmake2 dpfhack
+   lfsmake2 lcd4linux
+   lfsmake2 mtr
+   lfsmake2 minidlna
+   lfsmake2 acpid
+   lfsmake2 fping
+   lfsmake2 telnet
+   lfsmake2 xinetd
+   lfsmake2 gpgme
+   lfsmake2 pygpgme
+   lfsmake2 pakfire3
+   lfsmake2 stress
+   lfsmake2 libstatgrab
+   lfsmake2 sarg
+   lfsmake2 check_mk_agent
+   lfsmake2 nginx
+   lfsmake2 sendEmail
+   lfsmake2 sysbench
+   lfsmake2 strace
+   lfsmake2 elfutils
+   lfsmake2 ltrace
+   lfsmake2 ipfire-netboot
+   lfsmake2 lcdproc
+   lfsmake2 bitstream
+   lfsmake2 multicat
+   lfsmake2 keepalived
+   lfsmake2 ipvsadm
+   lfsmake2 perl-Carp-Clan
+   lfsmake2 perl-Date-Calc
+   lfsmake2 perl-Date-Manip
+   lfsmake2 perl-File-Tail
+   lfsmake2 perl-TimeDate
+   lfsmake2 swatch
+   lfsmake2 tor
+   lfsmake2 arm
+   lfsmake2 wavemon
+   lfsmake2 iptraf-ng
+   lfsmake2 iotop
+   lfsmake2 stunnel
+   lfsmake2 sslscan
+   lfsmake2 owncloud
+   lfsmake2 bacula
+   lfsmake2 batctl
+   lfsmake2 perl-PDF-API2
+   lfsmake2 squid-accounting
+   lfsmake2 pigz
+   lfsmake2 tmux
+   lfsmake2 perl-Text-CSV_XS
+   lfsmake2 swconfig
+   lfsmake2 haproxy
+   lfsmake2 ipset
+   lfsmake2 lua
+   lfsmake2 dnsdist
+   lfsmake2 bird
+   lfsmake2 dmidecode
+   lfsmake2 mcelog
+   lfsmake2 rtpproxy
+   lfsmake2 util-macros
+   lfsmake2 libpciaccess
+   lfsmake2 libyajl
+   lfsmake2 libvirt
+   lfsmake2 python3-libvirt
+   lfsmake2 freeradius
+   lfsmake2 perl-common-sense
+   lfsmake2 perl-inotify2
+   lfsmake2 perl-Net-IP
  }
  
  buildinstaller() {
    # Run installer scripts one by one
    LOGFILE="$BASEDIR/log/_build.installer.log"
    export LOGFILE
-   ipfiremake memtest
-   ipfiremake installer
-   installmake strip
+   lfsmake2 memtest
+   lfsmake2 installer
+   lfsmake1 strip
  }
  
  buildpackages() {
    git log -n 500 --no-merges --pretty=medium --shortstat $EXT > $BASEDIR/doc/ChangeLog
  
    # Create images for install
-   ipfiremake cdrom
+   lfsmake2 cdrom
  
    # Check if there is a loop device for building in virtual environments
    modprobe loop 2>/dev/null
    if [ $BUILD_IMAGES == 1 ] && ([ -e /dev/loop/0 ] || [ -e /dev/loop0 ] || [ -e "/dev/loop-control" ]); then
-       ipfiremake flash-images
-       ipfiremake flash-images SCON=1
+       lfsmake2 flash-images
+       lfsmake2 flash-images SCON=1
    fi
  
    mv $LFS/install/images/{*.iso,*.tgz,*.img.gz,*.bz2} $BASEDIR >> $LOGFILE 2>&1
  
    ipfirepackages
  
-   ipfiremake xen-image
+   lfsmake2 xen-image
    mv $LFS/install/images/*.bz2 $BASEDIR >> $LOGFILE 2>&1
  
    cd $BASEDIR
  
    # 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
        md5sum $i > $i.md5
  }
  
  ipfirepackages() {
-       ipfiremake core-updates
+       lfsmake2 core-updates
  
        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})
                if [ -e $BASEDIR/lfs/$i ]; then
                        ipfiredist $i
  while [ $# -gt 0 ]; do
        case "${1}" in
                --target=*)
-                       configure_target "${1#--target=}"
+                       configure_build "${1#--target=}"
                        ;;
                -*)
                        exiterror "Unknown configuration option: ${1}"
  case "$1" in 
  build)
        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
-       if [ ! -f log/cleanup-toolchain-2-tools ]; then
+       if [ ! -e "${BASEDIR}/build/tools/.toolchain-successful" ]; then
                if [ ! -n "$PACKAGE" ]; then
-                       beautify build_stage "Full toolchain compilation - Native GCC: `gcc --version | grep GCC | awk {'print $3'}`"
+                       beautify build_stage "Full toolchain compilation"
                        prepareenv
                        buildtoolchain
                else
@@@ -1097,7 -1102,7 +1102,7 @@@ downloadsrc
                        if [ -f "$i" -a "$i" != "Config" ]; then
                                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
                                if [ $? -ne 0 ]; then
                                        beautify message FAIL
        for i in *; do
                if [ -f "$i" -a "$i" != "Config" ]; then
                        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
                        if [ $? -ne 0 ]; then
                                echo -ne "MD5 difference in lfs/$i"
  toolchain)
        clear
        prepareenv
-       beautify build_stage "Toolchain compilation - Native GCC: `gcc --version | grep GCC | awk {'print $3'}`"
+       beautify build_stage "Toolchain compilation"
        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
-       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
-       md5sum cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-$MACHINE.tar.gz \
-               > cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-$MACHINE.md5
+       md5sum cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.gz \
+               > cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.md5
        stdumount
        ;;
  gettoolchain)
        # 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
                URL_TOOLCHAIN=`grep URL_TOOLCHAIN lfs/Config | awk '{ print $3 }'`
                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
                wget -U "IPFireSourceGrabber/2.x" $URL_TOOLCHAIN/$PACKAGE.tar.gz $URL_TOOLCHAIN/$PACKAGE.md5 >& /dev/null
                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
                        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
        ;;
  othersrc)
        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 \
        TERM=$TERM PS1='\u:\w\$ ' \
        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
        mv $LFS/install/images/ipfire-* $BASEDIR >> $LOGFILE 2>&1
        if [ $? -eq "0" ]; then