~vcs-imports/ipfire/ipfire-2.x

« back to all changes in this revision

Viewing changes to make.sh

  • Committer: Michael Tremer
  • Date: 2024-07-22 15:21:16 UTC
  • Revision ID: git-v1:4fd413a1a87d37afd575b9b712f5513d483ecfb9
make.sh: Replace LFS with BUILD_DIR

This is probably a more specific name for this.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
DIR_CHK=$BASEDIR/cache/check
115
115
mkdir $BASEDIR/log/ 2>/dev/null
116
116
 
 
117
# Set BUILD_DIR
 
118
readonly BUILD_DIR="${BASEDIR}/build"
 
119
 
117
120
system_processors() {
118
121
        getconf _NPROCESSORS_ONLN 2>/dev/null || echo "1"
119
122
}
399
402
        # Set umask
400
403
        umask 022
401
404
 
402
 
        # Set LFS Directory
403
 
        LFS=$BASEDIR/build
404
 
 
405
 
        BUILD_DIR="${BASEDIR}/build"
406
 
 
407
405
        # Setup environment
408
406
        set +h
409
407
        LC_ALL=POSIX
410
 
        export LFS LC_ALL CFLAGS CXXFLAGS DEFAULT_PARALLELISM RUSTFLAGS NINJAJOBS
 
408
        export LFS="${BUILD_DIR}" LC_ALL CFLAGS CXXFLAGS DEFAULT_PARALLELISM RUSTFLAGS NINJAJOBS
411
409
        unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
412
410
 
413
411
        # Make some extra directories
569
567
 
570
568
                # Mount /proc so that the build environment does not see
571
569
                # any foreign processes.
572
 
                "--mount-proc=${LFS}/proc"
 
570
                "--mount-proc=${BUILD_DIR}/proc"
573
571
        )
574
572
 
575
573
        PATH="${PATH}" \
576
574
        unshare \
577
575
                "${unshare[@]}" \
578
 
        chroot "${LFS}" \
 
576
        chroot "${BUILD_DIR}" \
579
577
        env -i \
580
578
                HOME="/root" \
581
579
                TERM="${TERM}" \
612
610
}
613
611
 
614
612
entershell() {
615
 
        echo "Entering to a shell inside LFS chroot, go out with exit"
 
613
        echo "Entering to a shell inside the build environment, go out with exit"
616
614
 
617
615
        local PS1="ipfire build chroot (${BUILD_ARCH}) \u:\w\$ "
618
616
 
696
694
                        BUILD_ARCH="${BUILD_ARCH}" \
697
695
                        BUILD_PLATFORM="${BUILD_PLATFORM}" \
698
696
                        LFS_BASEDIR="${BASEDIR}" \
699
 
                        ROOT="${LFS}" \
 
697
                        ROOT="${BUILD_DIR}" \
700
698
                        KVER="${KVER}" \
701
699
                        install >> $LOGFILE 2>&1 &
702
700
 
857
855
        fi
858
856
 
859
857
        # Check if the helper is already installed.
860
 
        if [ -x "${LFS}${QEMU_TARGET_HELPER}" ]; then
 
858
        if [ -x "${BUILD_DIR}${QEMU_TARGET_HELPER}" ]; then
861
859
                return 0
862
860
        fi
863
861
 
871
869
                # Must be static.
872
870
                file_is_static "${file}" || continue
873
871
 
874
 
                local dirname="${LFS}$(dirname "${file}")"
 
872
                local dirname="${BUILD_DIR}$(dirname "${file}")"
875
873
                mkdir -p "${dirname}"
876
874
 
877
 
                install -m 755 "${file}" "${LFS}${QEMU_TARGET_HELPER}"
 
875
                install -m 755 "${file}" "${BUILD_DIR}${QEMU_TARGET_HELPER}"
878
876
                return 0
879
877
        done
880
878
 
1814
1812
  # Check if there is a loop device for building in virtual environments
1815
1813
  lfsmake2 flash-images
1816
1814
 
1817
 
  mv $LFS/install/images/{*.iso,*.img.xz,*.bz2} $BASEDIR >> $LOGFILE 2>&1
 
1815
  mv ${BUILD_DIR}/install/images/{*.iso,*.img.xz,*.bz2} $BASEDIR >> $LOGFILE 2>&1
1818
1816
 
1819
1817
  ipfirepackages
1820
1818
 
1845
1843
                fi
1846
1844
        done
1847
1845
  test -d $BASEDIR/packages || mkdir $BASEDIR/packages
1848
 
  mv -f $LFS/install/packages/* $BASEDIR/packages >> $LOGFILE 2>&1
 
1846
  mv -f ${BUILD_DIR}/install/packages/* $BASEDIR/packages >> $LOGFILE 2>&1
1849
1847
  rm -rf  $BASEDIR/build/install/packages/*
1850
1848
}
1851
1849