406
437
trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGQUIT
408
439
# Checking if running as root user
409
if [ $(id -u) -ne 0 ]; then
410
exiterror "root privileges required for building"
440
if [ "${UID}" -ne 0 ]; then
441
exiterror "root privileges required for building"
413
# Checking for necessary temporary space
414
print_line "Checking for necessary space on disk $BASE_DEV"
415
BASE_DEV=`df -P -k $BASEDIR | tail -n 1 | awk '{ print $1 }'`
416
BASE_ASPACE=`df -P -k $BASEDIR | tail -n 1 | awk '{ print $4 }'`
417
if (( 2048000 > $BASE_ASPACE )); then
418
BASE_USPACE=`du -skx $BASEDIR | awk '{print $1}'`
419
if (( 2048000 - $BASE_USPACE > $BASE_ASPACE )); then
421
exiterror "Not enough temporary space available, need at least 2GB on $BASE_DEV"
447
while [ $# -gt 0 ]; do
450
required_space="${1#--required-space=}"
454
exiterror "Unknown argument: ${1}"
460
# Do we need to check the required space?
461
if [ -n "${required_space}" ]; then
462
local free_space free_blocks block_size
465
read -r free_blocks block_size <<< "$(stat --file-system --format="%a %S" "${BASEDIR}")"
467
# Calculate free space
468
(( free_space = free_blocks * block_size / 1024 / 1024 ))
470
# Check if we have at least 4GB of space
471
if [ "${free_space}" -lt "${required_space}" ]; then
472
exiterror "Not enough temporary space available, need at least ${required_space}MiB"
436
export LFS LC_ALL CFLAGS CXXFLAGS DEFAULT_PARALLELISM RUSTFLAGS NINJAJOBS
437
unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
439
479
# Make some extra directories
440
mkdir -p "${BASEDIR}/build${TOOLS_DIR}" 2>/dev/null
441
mkdir -p $BASEDIR/build/{etc,usr/src} 2>/dev/null
442
mkdir -p $BASEDIR/build/{dev/{shm,pts},proc,sys}
443
mkdir -p $BASEDIR/{cache,ccache/${BUILD_ARCH}/${TOOLCHAINVER}} 2>/dev/null
445
if [ "${ENABLE_RAMDISK}" = "on" ]; then
446
mkdir -p $BASEDIR/build/usr/src
447
mount -t tmpfs tmpfs -o size=8G,nr_inodes=1M,mode=1777 $BASEDIR/build/usr/src
449
mkdir -p ${BASEDIR}/build/tmp
450
mount -t tmpfs tmpfs -o size=4G,nr_inodes=1M,mode=1777 ${BASEDIR}/build/tmp
453
mkdir -p $BASEDIR/build/usr/src/{cache,config,doc,html,langs,lfs,log,src,ccache}
455
mknod -m 600 $BASEDIR/build/dev/console c 5 1 2>/dev/null
456
mknod -m 666 $BASEDIR/build/dev/null c 1 3 2>/dev/null
480
mkdir -p "${CCACHE_DIR}"
481
mkdir -p "${IMAGES_DIR}"
482
mkdir -p "${BUILD_DIR}/${TOOLS_DIR}"
483
mkdir -p "${BUILD_DIR}/cache"
484
mkdir -p "${BUILD_DIR}/dev"
485
mkdir -p "${BUILD_DIR}/etc"
486
mkdir -p "${BUILD_DIR}/proc"
487
mkdir -p "${BUILD_DIR}/sys"
488
mkdir -p "${BUILD_DIR}/tmp"
489
mkdir -p "${BUILD_DIR}/usr/src"
490
mkdir -p "${BUILD_DIR}/usr/src/cache"
491
mkdir -p "${BUILD_DIR}/usr/src/ccache"
492
mkdir -p "${BUILD_DIR}/usr/src/config"
493
mkdir -p "${BUILD_DIR}/usr/src/doc"
494
mkdir -p "${BUILD_DIR}/usr/src/html"
495
mkdir -p "${BUILD_DIR}/usr/src/images"
496
mkdir -p "${BUILD_DIR}/usr/src/langs"
497
mkdir -p "${BUILD_DIR}/usr/src/lfs"
498
mkdir -p "${BUILD_DIR}/usr/src/log"
499
mkdir -p "${BUILD_DIR}/usr/src/src"
501
# Make BUILD_DIR a mountpoint
502
mount -o bind "${BUILD_DIR}" "${BUILD_DIR}"
504
# Create a new, minimal /dev
505
mount build_dev "${BUILD_DIR}/dev" \
506
-t tmpfs -o "nosuid,noexec,mode=0755,size=4m,nr_inodes=64k"
508
# Create device nodes
509
mknod -m 600 "${BUILD_DIR}/dev/console" c 5 1
510
mknod -m 666 "${BUILD_DIR}/dev/null" c 1 3
511
mknod -m 666 "${BUILD_DIR}/dev/zero" c 1 5
512
mknod -m 666 "${BUILD_DIR}/dev/full" c 1 7
513
mknod -m 444 "${BUILD_DIR}/dev/random" c 1 8
514
mknod -m 444 "${BUILD_DIR}/dev/urandom" c 1 9
515
mknod -m 444 "${BUILD_DIR}/dev/kmsg" c 1 11
516
mknod -m 666 "${BUILD_DIR}/dev/tty" c 5 0
517
mknod -m 666 "${BUILD_DIR}/dev/rtc0" c 252 0
519
# Create loop devices
520
mknod -m 666 "${BUILD_DIR}/dev/loop-control" c 10 237
521
mknod -m 666 "${BUILD_DIR}/dev/loop0" c 7 0
522
mknod -m 666 "${BUILD_DIR}/dev/loop1" c 7 1
523
mknod -m 666 "${BUILD_DIR}/dev/loop2" c 7 2
524
mknod -m 666 "${BUILD_DIR}/dev/loop3" c 7 3
525
mknod -m 666 "${BUILD_DIR}/dev/loop4" c 7 4
526
mknod -m 666 "${BUILD_DIR}/dev/loop5" c 7 5
527
mknod -m 666 "${BUILD_DIR}/dev/loop6" c 7 6
528
mknod -m 666 "${BUILD_DIR}/dev/loop7" c 7 7
531
mkdir -p "${BUILD_DIR}/dev/pts"
532
mkdir -p "${BUILD_DIR}/dev/shm"
535
ln -s "pts/ptmx" "${BUILD_DIR}/dev/ptmx"
536
ln -s "../proc/self/fd" "${BUILD_DIR}/dev/fd"
537
ln -s "../proc/self/fd/0" "${BUILD_DIR}/dev/stdin"
538
ln -s "../proc/self/fd/1" "${BUILD_DIR}/dev/stdout"
539
ln -s "../proc/self/fd/2" "${BUILD_DIR}/dev/stderr"
540
ln -s "../proc/kcore" "${BUILD_DIR}/dev/core"
542
# Mount a new /dev/pts
543
mount build_dev_pts "${BUILD_DIR}/dev/pts" \
544
-t devpts -o "nosuid,noexec,newinstance,ptmxmode=0666,mode=620"
546
# Mount a new /dev/shm
547
mount build_dev_shm "${BUILD_DIR}/dev/shm" \
548
-t tmpfs -o "nosuid,nodev,strictatime,mode=1777,size=1024m"
551
mount build_tmp "${BUILD_DIR}/tmp" \
552
-t tmpfs -o "nosuid,nodev,strictatime,size=4G,nr_inodes=1M,mode=1777"
458
554
# Make all sources and proc available under lfs build
459
mount --bind /dev $BASEDIR/build/dev
460
mount --bind /dev/pts $BASEDIR/build/dev/pts
461
mount --bind /dev/shm $BASEDIR/build/dev/shm
462
mount --bind /proc $BASEDIR/build/proc
463
mount --bind /sys $BASEDIR/build/sys
464
mount --bind $BASEDIR/cache $BASEDIR/build/usr/src/cache
465
mount --bind $BASEDIR/ccache/${BUILD_ARCH}/${TOOLCHAINVER} $BASEDIR/build/usr/src/ccache
466
mount --bind $BASEDIR/config $BASEDIR/build/usr/src/config
467
mount --bind $BASEDIR/doc $BASEDIR/build/usr/src/doc
468
mount --bind $BASEDIR/html $BASEDIR/build/usr/src/html
469
mount --bind $BASEDIR/langs $BASEDIR/build/usr/src/langs
470
mount --bind $BASEDIR/lfs $BASEDIR/build/usr/src/lfs
471
mount --bind $BASEDIR/log $BASEDIR/build/usr/src/log
472
mount --bind $BASEDIR/src $BASEDIR/build/usr/src/src
474
# Run LFS static binary creation scripts one by one
475
export CCACHE_DIR=$BASEDIR/ccache
555
mount --bind /sys "${BUILD_DIR}/sys"
556
mount --bind -o ro "${BASEDIR}/cache" "${BUILD_DIR}/usr/src/cache"
557
mount --bind -o ro "${BASEDIR}/config" "${BUILD_DIR}/usr/src/config"
558
mount --bind -o ro "${BASEDIR}/doc" "${BUILD_DIR}/usr/src/doc"
559
mount --bind -o ro "${BASEDIR}/html" "${BUILD_DIR}/usr/src/html"
560
mount --bind -o ro "${BASEDIR}/langs" "${BUILD_DIR}/usr/src/langs"
561
mount --bind -o ro "${BASEDIR}/lfs" "${BUILD_DIR}/usr/src/lfs"
562
mount --bind -o ro "${BASEDIR}/src" "${BUILD_DIR}/usr/src/src"
564
# Mount the log directory
565
mount --bind "${LOG_DIR}" "${BUILD_DIR}/usr/src/log"
568
mount --bind "${CCACHE_DIR}" "${BUILD_DIR}/usr/src/ccache"
570
# Mount the images directory
571
mount --bind "${IMAGES_DIR}" "${BUILD_DIR}/usr/src/images"
573
# Configure the ccache
476
574
export CCACHE_TEMPDIR="/tmp"
477
575
export CCACHE_COMPILERCHECK="string:toolchain-${TOOLCHAINVER} ${BUILD_ARCH}"
577
# Install the QEMU helper
479
580
# Remove pre-install list of installed files in case user erase some files before rebuild
480
rm -f $BASEDIR/build/usr/src/lsalr 2>/dev/null
581
rm -f "${BUILD_DIR}/usr/src/lsalr"
482
583
# Prepare string for /etc/system-release.
483
584
local system_release="${NAME} ${VERSION} (${BUILD_ARCH})"
603
for i in $SKIP_PACKAGE_LIST
605
if [ "$i" == "$1" ]; then
611
649
echo -ne "`date -u '+%b %e %T'`: Building $* " >> $LOGFILE
613
cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR BUILD_ARCH="${BUILD_ARCH}" \
614
MESSAGE="$1\t " download >> $LOGFILE 2>&1
615
if [ $? -ne 0 ]; then
616
exiterror "Download error in $1"
619
cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR BUILD_ARCH="${BUILD_ARCH}" \
620
MESSAGE="$1\t b2sum" b2 >> $LOGFILE 2>&1
621
if [ $? -ne 0 ]; then
622
exiterror "BLAKE2 checksum error in $1, check file in cache or signature"
625
651
return 0 # pass all!
655
# Check if we are running in our namespace
656
if [ -z "${IN_NAMESPACE}" ]; then
657
exiterror "Not running in namespace"
663
local interactive="false"
666
# Collect environment variables
668
[PATH]="${TOOLS_DIR}/ccache/bin:${TOOLS_DIR}/sbin:${TOOLS_DIR}/bin:${PATH}"
676
[VERSION]="${VERSION}"
679
[SYSTEM_RELEASE]="${SYSTEM_RELEASE}"
680
[PAKFIRE_TREE]="${PAKFIRE_TREE}"
681
[CONFIG_ROOT]="${CONFIG_ROOT}"
687
[CFLAGS]="${CFLAGS} ${HARDENING_CFLAGS}"
688
[CXXFLAGS]="${CXXFLAGS} ${HARDENING_CFLAGS}"
689
[RUSTFLAGS]="${RUSTFLAGS}"
692
[CCACHE_DIR]="${CCACHE_DIR}"
693
[CCACHE_TEMPDIR]="${CCACHE_TEMPDIR}"
694
[CCACHE_COMPILERCHECK]="${CCACHE_COMPILERCHECK}"
697
[SYSTEM_PROCESSORS]="${SYSTEM_PROCESSORS}"
698
[SYSTEM_MEMORY]="${SYSTEM_MEMORY}"
701
[DEFAULT_PARALLELISM]="${DEFAULT_PARALLELISM}"
703
# Compression Options
707
[BUILD_ARCH]="${BUILD_ARCH}"
708
[BUILD_PLATFORM]="${BUILD_PLATFORM}"
711
[CROSSTARGET]="${CROSSTARGET}"
712
[BUILDTARGET]="${BUILDTARGET}"
715
[LFS_BASEDIR]="${BASEDIR}"
716
[IMAGES_DIR]="${IMAGES_DIR}"
717
[TOOLS_DIR]="${TOOLS_DIR}"
720
# Configure a new namespace
722
# Create a new cgroup namespace
725
# Create a new mount namespace
727
"--propagation=slave"
729
# Create a new PID namespace and fork
733
# Create a new time namespace
736
# Create a new UTS namespace
739
# Mount /proc so that the build environment does not see
740
# any foreign processes.
741
"--mount-proc=${BUILD_DIR}/proc"
743
# If unshare is asked to terminate, terminate all child processes
747
while [ $# -gt 0 ]; do
752
# Update some variables
754
[PATH]="${TOOLS_DIR}/ccache/bin:/bin:/usr/bin:/sbin:/usr/sbin:${TOOLS_DIR}/sbin:${TOOLS_DIR}/bin"
758
[LFS_BASEDIR]="/usr/src"
759
[IMAGES_DIR]="/usr/src/images"
762
[CCACHE_DIR]="/usr/src/ccache"
765
[GOCACHE]="/usr/src/ccache/go"
769
if [ -e "${BUILD_DIR}${TOOLS_DIR}/lib/libpakfire_preload.so" ]; then
771
[LD_PRELOAD]="${TOOLS_DIR}/lib/libpakfire_preload.so"
773
# Fake kernel version, because some of the packages do not
774
# compile with kernel 3.0 and later
775
[UTS_RELEASE]="${KVER}-${SNAME}"
778
[UTS_MACHINE]="${BUILD_ARCH}"
786
# Use the actual value of $TERM
793
timer="${1#--timer=}"
797
echo "Unknown argument: ${1}" >&2
801
# Parse any custom environment variables
803
environ["${1%=*}"]="${1#*=}"
806
# The rest is the command
815
# Prepend any custom changes to PATH
816
if [ -n "${CUSTOM_PATH}" ]; then
817
environ[PATH]="${CUSTOM_PATH}:${environ[PATH]}"
821
if qemu_is_required; then
823
[QEMU_TARGET_HELPER]="${QEMU_TARGET_HELPER}"
829
case "${BUILD_ARCH}" in
832
[QEMU_CPU]="${QEMU_CPU:-cortex-a9}"
838
[QEMU_CPU]="${QEMU_CPU:-sifive-u54}"
840
# Bug fix for QEMU locking up
841
[G_SLICE]="always-malloc"
850
# Create new namespaces
852
"unshare" "${unshare[@]}"
856
if [ "${chroot}" = "true" ]; then
857
execute+=( "chroot" "${BUILD_DIR}" )
860
# Reset the environment
864
# Clear the previous environment
865
"--ignore-environment"
867
# Change the working directory
868
--chdir="${environ[LFS_BASEDIR]}/lfs"
871
# Export the environment
872
for env in ${!environ[@]}; do
873
execute+=( "${env}=${environ[${env}]}" )
877
execute+=( "${command[@]}" )
882
# Store the start time
885
# Run the command in the background and pipe all output to the logfile
886
case "${interactive}" in
888
"${execute[@]}" || return $?
892
# Launch the timer if needed
893
if [ -n "${timer}" ]; then
897
# Dispatch the command to the background
899
"${execute[@]}" >> "${LOGFILE}" 2>&1 </dev/null
902
# Wait for the process to complete
906
# Store the return code
909
# If the return code is >= 128, wait has been interrupted by the timer
910
if [ "${r}" -ge 128 ]; then
911
# Call the timer callback
912
if [ -n "${timer}" ]; then
923
# Call the timer callback at least once
924
if [ -n "${timer}" ]; then
932
# Calls the makefile of a package
937
while [ $# -gt 0 ]; do
953
# Execute the make command in the environment
954
execute "${args[@]}" make --file="${pkg}" "$@"
629
lfsmakecommoncheck $*
961
# Run the common check
962
lfsmakecommoncheck "${pkg}" "$@"
630
963
[ $? == 1 ] && return 0
632
# Set PATH to use the toolchain tools first and then whatever the host has set
633
local PATH="${TOOLS_DIR}/ccache/bin:${TOOLS_DIR}/sbin:${TOOLS_DIR}/bin:${PATH}"
635
if [ -n "${CUSTOM_PATH}" ]; then
636
PATH="${CUSTOM_PATH}:${PATH}"
965
# Download source outside of the toolchain
966
if ! make_pkg "${pkg}" download "$@"; then
967
exiterror "Downloading ${pkg}"
639
cd $BASEDIR/lfs && env -i \
641
CCACHE_DIR="${CCACHE_DIR}"/${BUILD_ARCH}/${TOOLCHAINVER} \
642
CCACHE_TEMPDIR="${CCACHE_TEMPDIR}" \
643
CCACHE_COMPILERCHECK="${CCACHE_COMPILERCHECK}" \
645
CXXFLAGS="${CXXFLAGS}" \
646
DEFAULT_PARALLELISM="${DEFAULT_PARALLELISM}" \
647
SYSTEM_PROCESSORS="${SYSTEM_PROCESSORS}" \
648
SYSTEM_MEMORY="${SYSTEM_MEMORY}" \
651
TOOLS_DIR="${TOOLS_DIR}" \
652
CROSSTARGET="${CROSSTARGET}" \
653
BUILDTARGET="${BUILDTARGET}" \
654
BUILD_ARCH="${BUILD_ARCH}" \
655
BUILD_PLATFORM="${BUILD_PLATFORM}" \
656
LFS_BASEDIR="${BASEDIR}" \
659
install >> $LOGFILE 2>&1 &
661
if ! wait_until_finished $!; then
970
if ! make_pkg "${pkg}" TOOLCHAIN=1 ROOT="${BUILD_DIR}"; then
662
971
print_status FAIL
663
exiterror "Building $*"
973
exiterror "Building ${pkg}"
666
976
print_status DONE
670
lfsmakecommoncheck $*
983
# Run the common check
984
lfsmakecommoncheck "${pkg}" "$@"
671
985
[ $? == 1 ] && return 0
676
bash -x -c "cd /usr/src/lfs && \
678
LFS_BASEDIR=/usr/src install" \
681
if ! wait_until_finished $!; then
987
# Download source outside of the toolchain
988
if ! make_pkg "${pkg}" download "$@"; then
989
exiterror "Downloading ${pkg}"
992
# Run install on the package
993
if ! make_pkg --chroot --timer="update_runtime" "${pkg}" install "$@"; then
682
994
print_status FAIL
683
exiterror "Building $*"
996
exiterror "Building ${pkg}"
686
999
print_status DONE
690
lfsmakecommoncheck $*
1006
# Run the common check
1007
lfsmakecommoncheck "${pkg}" "$@"
691
1008
[ $? == 1 ] && return 0
696
bash -x -c "cd /usr/src/lfs && make -f $* LFS_BASEDIR=/usr/src dist" \
699
if ! wait_until_finished $!; then
1010
# Run dist on the package
1011
if ! make_pkg --chroot --timer="update_runtime" "${pkg}" dist "$@"; then
700
1012
print_status FAIL
701
exiterror "Packaging $*"
1014
exiterror "Packaging ${pkg}"
704
1017
print_status DONE
707
wait_until_finished() {
710
local start_time="${SECONDS}"
713
if ${INTERACTIVE}; then
714
# Wait a little just in case the process
715
# has finished very quickly.
719
while kill -0 ${pid} 2>/dev/null; do
720
print_runtime $(( SECONDS - start_time ))
727
# Returns the exit code of the child process
731
if ! ${INTERACTIVE}; then
732
print_runtime $(( SECONDS - start_time ))
739
[ -e "${BASEDIR}/build${TOOLS_DIR}/lib/libpakfire_preload.so" ] || return
741
local env="LD_PRELOAD=${TOOLS_DIR}/lib/libpakfire_preload.so"
743
# Fake kernel version, because some of the packages do not compile
744
# with kernel 3.0 and later.
745
env="${env} UTS_RELEASE=${KVER}-ipfire"
747
# Fake machine version.
748
env="${env} UTS_MACHINE=${BUILD_ARCH}"
754
local env="QEMU_TARGET_HELPER=${QEMU_TARGET_HELPER}"
756
# Don't add anything if qemu is not used.
757
if ! qemu_is_required; then
761
# Set default qemu options
762
case "${BUILD_ARCH}" in
764
QEMU_CPU="${QEMU_CPU:-cortex-a9}"
766
env="${env} QEMU_CPU=${QEMU_CPU}"
769
QEMU_CPU="${QEMU_CPU:-sifive-u54}"
770
G_SLICE="always-malloc"
771
env="${env} QEMU_CPU=${QEMU_CPU} G_SLICE=${G_SLICE}"
776
#env="${env} QEMU_STRACE=1"
1021
print_runtime "$(( SECONDS - t ))"
781
1024
qemu_is_required() {
927
CCACHE_CACHE_SIZE="4G"
928
ENABLE_RAMDISK="auto"
930
# Load configuration file
931
if [ -f .config ]; then
935
# TARGET_ARCH is BUILD_ARCH now
936
if [ -n "${TARGET_ARCH}" ]; then
937
BUILD_ARCH="${TARGET_ARCH}"
941
# Get some information about the host system
942
SYSTEM_PROCESSORS="$(system_processors)"
943
SYSTEM_MEMORY="$(system_memory)"
945
if [ -n "${BUILD_ARCH}" ]; then
946
configure_build "${BUILD_ARCH}"
948
configure_build "default"
951
# Automatically enable/disable ramdisk usage
952
if [ "${ENABLE_RAMDISK}" = "auto" ]; then
953
# Enable only when the host system has 4GB of RAM or more
954
if [ ${SYSTEM_MEMORY} -ge 3900 ]; then
1173
download_sources() {
1179
# Walk through all files in LFS
1180
for file in "${BASEDIR}/lfs/"*; do
1183
# Skip some packages
1190
# Run the common check
1191
lfsmakecommoncheck "${pkg}"
1192
[ $? == 1 ] && continue
1194
# Download and check the package
1195
if ! run_command "${pkg}" download b2; then
1203
# Download the toolchain
1204
download_toolchain() {
1205
local toolchain="${1}"
1207
# Do nothing if the toolchain has already been downloaded
1208
if [ -e "${TOOLCHAIN_DIR}/${toolchain}" ]; then
1212
# Ensure the directory exists
1213
mkdir -p "${TOOLCHAIN_DIR}"
1215
# Create a temporary directory
1216
local tmp="$(mktemp -d)"
1218
# Make the name for the checksum file
1219
local checksums="${toolchain/.tar.zst/.b2}"
1221
# Download the toolchain and checksum files
1222
if ! wget --quiet --directory-prefix="${tmp}" \
1223
"${TOOLCHAIN_URL}/${toolchain}" \
1224
"${TOOLCHAIN_URL}/${checksums}"; then
1232
if ! b2sum --quiet --check "${tmp}/${checksums}"; then
1239
# Everything is good, move the files to their destination
1241
"${tmp}/${toolchain}" \
1242
"${tmp}/${checksums}" \
1243
"${TOOLCHAIN_DIR}"; then
1256
# Extracts the toolchain
1257
extract_toolchain() {
1258
local toolchain="${1}"
1260
local build_dir="${BUILD_DIR#${BASEDIR}/}"
1261
local log_dir="${LOG_DIR#${BASEDIR}/}"
1267
# The file to extract
1268
"-f" "${TOOLCHAIN_DIR}/${toolchain}"
1273
# Transform any older toolchains
1274
"--transform" "s@^build/@${build_dir}/@"
1275
"--transform" "s@^log/@${log_dir}/@"
1278
# Extract the toolchain
1279
tar "${args[@]}" || return $?
1282
# Compresses the toolchain
1283
compress_toolchain() {
1284
local toolchain="${1}"
1286
log "Creating toolchain image for ${BUILD_ARCH}"
1288
# Create a temporary directory
1289
local tmp="$(mktemp -d)"
1291
# Make the name for the checksum file
1292
local checksums="${toolchain/.tar.zst/.b2}"
1294
local build_dir="${BUILD_DIR#${BASEDIR}/}"
1295
local log_dir="${LOG_DIR#${BASEDIR}/}"
1300
# Filter through zstd with custom options
1301
"-I" "zstd ${ZSTD_OPT}"
1303
# Write to the temporary directory
1304
"-f" "${tmp}/${toolchain}"
1306
# Start in the base directory
1309
# Exclude the build logs
1310
"--exclude" "${log_dir}/_build.*.log"
1313
"${build_dir}/bin/sh"
1315
# Include the /tools_${BUILD_ARCH} directory
1316
"${build_dir}/${TOOLS_DIR}"
1318
# Include the log directory
1322
# Create the archive
1323
if ! tar "${args[@]}"; then
1330
# Create the checksums
1331
if ! b2sum "${tmp}/${toolchain}" > "${tmp}/${checksums}"; then
1338
# Everything is good, move the files to their destination
1340
"${tmp}/${toolchain}" \
1341
"${tmp}/${checksums}" \
1342
"${TOOLCHAIN_DIR}"; then
960
1353
local gcc=$(type -p gcc)
961
1354
if [ -z "${gcc}" ]; then
962
1355
exiterror "Could not find GCC. You will need a working build enviroment in order to build the toolchain."
1094
1486
lfsmake2 e2fsprogs
1099
LOGFILE="$BASEDIR/log/_build.ipfire.log"
1102
lfsmake2 initscripts
1117
lfsmake2 u-boot MKIMAGE=1
1123
lfsmake2 multipath-tools
1126
lfsmake2 libnfnetlink
1127
lfsmake2 libnetfilter_queue
1128
lfsmake2 libnetfilter_conntrack
1129
lfsmake2 libnetfilter_cthelper
1130
lfsmake2 libnetfilter_cttimeout
1146
lfsmake2 python3-setuptools
1151
lfsmake2 libgpg-error
1170
lfsmake2 rust-dissimilar
1171
lfsmake2 rust-cfg-if
1173
lfsmake2 rust-getrandom
1174
lfsmake2 rust-typenum
1175
lfsmake2 rust-version-check
1176
lfsmake2 rust-generic-array
1177
lfsmake2 rust-crypto-common
1178
lfsmake2 rust-cipher
1180
lfsmake2 rust-unicode-xid
1181
lfsmake2 rust-proc-macro2
1185
lfsmake2 rust-lazy-static
1186
lfsmake2 rust-memchr
1187
lfsmake2 rust-aho-corasick
1188
lfsmake2 rust-regex-syntax
1190
lfsmake2 rust-ucd-trie
1192
lfsmake2 rust-semver-parser
1193
lfsmake2 rust-semver
1194
lfsmake2 rust-same-file
1195
lfsmake2 rust-walkdir
1197
lfsmake2 rust-toolchain_find
1201
lfsmake2 rust-serde_json
1202
lfsmake2 rust-synstructure
1203
lfsmake2 rust-block-buffer
1204
lfsmake2 rust-digest
1205
lfsmake2 rust-ppv-lite86
1206
lfsmake2 rust-rand_core
1207
lfsmake2 rust-rand_core-0.4.2
1208
lfsmake2 rust-rand_core-0.3.1
1209
lfsmake2 rust-rand_chacha
1210
lfsmake2 rust-rand_hc
1212
lfsmake2 rust-rdrand
1213
lfsmake2 rust-rand-0.4
1215
lfsmake2 rust-num_cpus
1216
lfsmake2 rust-crossbeam-utils
1217
lfsmake2 rust-autocfg
1218
lfsmake2 rust-memoffset
1219
lfsmake2 rust-scopeguard
1220
lfsmake2 rust-crossbeam-epoch
1221
lfsmake2 rust-crossbeam-deque
1222
lfsmake2 rust-either
1223
lfsmake2 rust-crossbeam-channel
1224
lfsmake2 rust-rayon-core
1226
lfsmake2 rust-remove_dir_all
1227
lfsmake2 rust-tempdir
1229
lfsmake2 rust-once_cell
1230
lfsmake2 rust-termcolor
1232
lfsmake2 rust-serde_derive
1233
lfsmake2 rust-trybuild
1234
lfsmake2 rust-unindent
1235
lfsmake2 rust-proc-macro-hack
1236
lfsmake2 rust-indoc-impl
1238
lfsmake2 rust-indoc-0.3.6
1239
lfsmake2 rust-instant
1240
lfsmake2 rust-lock_api
1241
lfsmake2 rust-smallvec
1242
lfsmake2 rust-parking_lot_core
1243
lfsmake2 rust-parking_lot
1244
lfsmake2 rust-paste-impl
1246
lfsmake2 rust-paste-0.1.18
1249
lfsmake2 rust-inventory-impl
1250
lfsmake2 rust-inventory
1251
lfsmake2 rust-pyo3-build-config
1252
lfsmake2 rust-pyo3-macros-backend
1253
lfsmake2 rust-pyo3-macros
1255
lfsmake2 rust-num-traits
1256
lfsmake2 rust-num-integer
1257
lfsmake2 rust-num_threads
1259
lfsmake2 rust-iana-time-zone
1260
lfsmake2 rust-chrono
1261
lfsmake2 rust-asn1_derive
1263
lfsmake2 rust-proc-macro-error-attr
1264
lfsmake2 rust-proc-macro-error
1265
lfsmake2 rust-Inflector
1266
lfsmake2 rust-ouroboros_macro
1267
lfsmake2 rust-aliasable
1268
lfsmake2 rust-stable_deref_trait
1269
lfsmake2 rust-ouroboros
1270
lfsmake2 rust-base64
1279
lfsmake2 ca-certificates
1300
lfsmake2 perl-BerkeleyDB
1304
lfsmake2 web-user-interface
1315
lfsmake2 reiserfsprogs
1323
lfsmake2 perl-ExtUtils-PkgConfig
1325
lfsmake2 perl-GD-Graph
1326
lfsmake2 perl-GD-TextUtil
1327
lfsmake2 perl-Device-SerialPort
1328
lfsmake2 perl-Device-Modem
1329
lfsmake2 perl-Apache-Htpasswd
1330
lfsmake2 perl-Parse-Yapp
1331
lfsmake2 perl-Data-UUID
1332
lfsmake2 perl-Try-Tiny
1333
lfsmake2 perl-HTTP-Message
1334
lfsmake2 perl-HTTP-Date
1339
lfsmake2 conntrack-tools
1341
lfsmake2 l7-protocols
1349
lfsmake2 perl-Switch
1350
lfsmake2 perl-HTML-Tagset
1351
lfsmake2 perl-HTML-Parser
1352
lfsmake2 perl-HTML-Template
1353
lfsmake2 perl-Compress-Zlib
1354
lfsmake2 perl-Digest
1355
lfsmake2 perl-Digest-SHA1
1356
lfsmake2 perl-Digest-HMAC
1357
lfsmake2 perl-libwww
1358
lfsmake2 perl-LWP-Protocol-https
1359
lfsmake2 perl-Net-HTTP
1360
lfsmake2 perl-Net-DNS
1361
lfsmake2 perl-Net-IPv4Addr
1362
lfsmake2 perl-Net_SSLeay
1363
lfsmake2 perl-IO-Stringy
1364
lfsmake2 perl-IO-Socket-SSL
1365
lfsmake2 perl-Unix-Syslog
1366
lfsmake2 perl-Mail-Tools
1367
lfsmake2 perl-MIME-Tools
1368
lfsmake2 perl-Net-Server
1369
lfsmake2 perl-Canary-Stability
1370
lfsmake2 perl-Convert-TNEF
1371
lfsmake2 perl-Convert-UUlib
1372
lfsmake2 perl-Archive-Tar
1373
lfsmake2 perl-Archive-Zip
1374
lfsmake2 perl-Text-Tabs+Wrap
1375
lfsmake2 perl-XML-Parser
1376
lfsmake2 perl-Crypt-PasswdMD5
1377
lfsmake2 perl-Net-Telnet
1379
lfsmake2 python3-inotify
1380
lfsmake2 python3-docutils
1381
lfsmake2 python3-daemon
1385
lfsmake2 dejavu-fonts-ttf
1386
lfsmake2 ubuntu-font-family
1402
lfsmake2 ids-ruleset-sources
1403
lfsmake2 ipblocklist-sources
1422
lfsmake2 ghostscript
1425
lfsmake2 poppler-data
1426
lfsmake2 cups-filters
1427
lfsmake2 epson-inkjet-printer-escpr
1433
lfsmake2 rpcsvc-proto
1439
lfsmake2 bridge-utils
1440
lfsmake2 smartmontools
1446
lfsmake2 perl-NetAddr-IP
1476
lfsmake2 libstatgrab
1480
lfsmake2 linux-firmware
1481
lfsmake2 dvb-firmwares
1482
lfsmake2 zd1211-firmware
1483
lfsmake2 rpi-firmware
1484
lfsmake2 intel-microcode
1485
lfsmake2 pcengines-apu-firmware
1489
lfsmake2 python3-toml
1490
lfsmake2 python3-pyproject2setuppy
1491
lfsmake2 python3-pyparsing
1492
lfsmake2 spice-protocol
1495
lfsmake2 libusbredir
1500
lfsmake2 nagios_nrpe
1501
lfsmake2 nagios-plugins
1503
lfsmake2 observium-agent
1509
lfsmake2 vdr_streamdev
1510
lfsmake2 vdr_epgsearch
1516
lfsmake2 libmpdclient
1518
lfsmake2 perl-Net-CIDR-Lite
1519
lfsmake2 perl-Net-SMTP-SSL
1520
lfsmake2 perl-MIME-Base64
1521
lfsmake2 perl-Authen-SASL
1522
lfsmake2 perl-MIME-Lite
1523
lfsmake2 perl-Email-Date-Format
1526
lfsmake2 wpa_supplicant
1530
lfsmake2 cpufrequtils
1541
lfsmake2 perl-gettext
1542
lfsmake2 perl-Sort-Naturally
1545
lfsmake2 perl-DBD-SQLite
1546
lfsmake2 perl-File-ReadBackwards
1547
lfsmake2 openvmtools
1552
lfsmake2 usb_modeswitch
1553
lfsmake2 usb_modeswitch_data
1561
lfsmake2 wireless-regdb
1563
lfsmake2 python3-pycparser
1564
lfsmake2 python3-charset-normalizer
1565
lfsmake2 python3-certifi
1566
lfsmake2 python3-idna
1567
lfsmake2 python3-requests
1568
lfsmake2 python3-tomli
1569
lfsmake2 python3-pep517
1570
lfsmake2 python3-build
1571
lfsmake2 python3-install
1572
lfsmake2 python3-urllib3
1573
lfsmake2 python3-flit
1574
lfsmake2 python3-packaging
1575
lfsmake2 python3-typing-extensions
1576
lfsmake2 python3-semantic-version
1577
lfsmake2 python3-setuptools-scm
1578
lfsmake2 python3-setuptools-rust
1579
lfsmake2 python3-six
1580
lfsmake2 python3-dateutil
1581
lfsmake2 python3-jmespath
1582
lfsmake2 python3-colorama
1583
lfsmake2 python3-yaml
1584
lfsmake2 python3-s3transfer
1585
lfsmake2 python3-rsa
1586
lfsmake2 python3-pyasn1
1587
lfsmake2 python3-botocore
1588
lfsmake2 python3-cffi
1589
lfsmake2 python3-cryptography
1590
lfsmake2 python3-circuitbreaker
1591
lfsmake2 python3-pytz
1592
lfsmake2 python3-click
1593
lfsmake2 python3-arrow
1594
lfsmake2 python3-terminaltables
1595
lfsmake2 python3-pkgconfig
1596
lfsmake2 python3-msgpack
1597
lfsmake2 python3-attrs
1598
lfsmake2 python3-sniffio
1599
lfsmake2 python3-sortedcontainers
1600
lfsmake2 python3-outcome
1601
lfsmake2 python3-async_generator
1602
lfsmake2 python3-flit_scm
1603
lfsmake2 python3-exceptiongroup
1604
lfsmake2 python3-trio
1605
lfsmake2 python3-pyfuse3
1607
lfsmake2 oci-python-sdk
1609
lfsmake2 transmission
1622
lfsmake2 ipfire-netboot
1626
lfsmake2 perl-Carp-Clan
1627
lfsmake2 perl-Date-Calc
1628
lfsmake2 perl-Date-Manip
1629
lfsmake2 perl-File-Tail
1630
lfsmake2 perl-TimeDate
1638
lfsmake2 perl-Font-TTF
1639
lfsmake2 perl-IO-String
1640
lfsmake2 perl-PDF-API2
1641
lfsmake2 proxy-accounting
1643
lfsmake2 perl-Text-CSV_XS
1653
lfsmake2 libpciaccess
1658
lfsmake2 perl-common-sense
1659
lfsmake2 perl-inotify2
1660
lfsmake2 perl-Net-IP
1663
lfsmake2 mdns-repeater
1665
lfsmake2 nss-myhostname
1669
lfsmake2 shairport-sync
1673
lfsmake2 spectre-meltdown-checker
1674
lfsmake2 zabbix_agentd
1676
lfsmake2 firmware-update
1678
lfsmake2 speedtest-cli
1679
lfsmake2 amazon-ssm-agent
1686
lfsmake2 squid-asnbl
1689
lfsmake2 oath-toolkit
1691
lfsmake2 perl-File-Remove
1692
lfsmake2 perl-Module-Build
1693
lfsmake2 perl-Module-ScanDeps
1694
lfsmake2 perl-YAML-Tiny
1695
lfsmake2 perl-Module-Install
1696
lfsmake2 perl-Imager
1697
lfsmake2 perl-Imager-QRCode
1698
lfsmake2 perl-MIME-Base32
1699
lfsmake2 perl-URI-Encode
1702
# Kernelbuild ... current we have no platform that need
1703
# multi kernel builds so KCFG is empty
1704
lfsmake2 linux KCFG=""
1705
lfsmake2 rtl8189es KCFG=""
1706
lfsmake2 rtl8189fs KCFG=""
1707
lfsmake2 rtl8812au KCFG=""
1708
lfsmake2 rtl8822bu KCFG=""
1709
lfsmake2 rtl8821cu KCFG=""
1710
lfsmake2 linux-initrd KCFG=""
1714
# Run installer scripts one by one
1715
LOGFILE="$BASEDIR/log/_build.installer.log"
1719
# use toolchain bash for chroot to strip
1720
CUSTOM_PATH="${TOOLS_DIR}/bin" lfsmake2 strip
1489
lfsmake2 initscripts
1508
lfsmake2 libnfnetlink
1509
lfsmake2 libnetfilter_queue
1510
lfsmake2 libnetfilter_conntrack
1511
lfsmake2 libnetfilter_cthelper
1512
lfsmake2 libnetfilter_cttimeout
1528
lfsmake2 python3-setuptools
1529
lfsmake2 python3-MarkupSafe
1530
lfsmake2 python3-Jinja2
1539
lfsmake2 multipath-tools
1542
lfsmake2 libgpg-error
1560
lfsmake2 rust-dissimilar
1561
lfsmake2 rust-cfg-if
1563
lfsmake2 rust-getrandom
1564
lfsmake2 rust-typenum
1565
lfsmake2 rust-version-check
1566
lfsmake2 rust-generic-array
1567
lfsmake2 rust-crypto-common
1568
lfsmake2 rust-cipher
1570
lfsmake2 rust-unicode-xid
1571
lfsmake2 rust-proc-macro2
1575
lfsmake2 rust-lazy-static
1576
lfsmake2 rust-memchr
1577
lfsmake2 rust-aho-corasick
1578
lfsmake2 rust-regex-syntax
1580
lfsmake2 rust-ucd-trie
1582
lfsmake2 rust-semver-parser
1583
lfsmake2 rust-semver
1584
lfsmake2 rust-same-file
1585
lfsmake2 rust-walkdir
1587
lfsmake2 rust-toolchain_find
1591
lfsmake2 rust-serde_json
1592
lfsmake2 rust-synstructure
1593
lfsmake2 rust-block-buffer
1594
lfsmake2 rust-digest
1595
lfsmake2 rust-ppv-lite86
1596
lfsmake2 rust-rand_core
1597
lfsmake2 rust-rand_core-0.4.2
1598
lfsmake2 rust-rand_core-0.3.1
1599
lfsmake2 rust-rand_chacha
1600
lfsmake2 rust-rand_hc
1602
lfsmake2 rust-rdrand
1603
lfsmake2 rust-rand-0.4
1605
lfsmake2 rust-num_cpus
1606
lfsmake2 rust-crossbeam-utils
1607
lfsmake2 rust-autocfg
1608
lfsmake2 rust-memoffset
1609
lfsmake2 rust-scopeguard
1610
lfsmake2 rust-crossbeam-epoch
1611
lfsmake2 rust-crossbeam-deque
1612
lfsmake2 rust-either
1613
lfsmake2 rust-crossbeam-channel
1614
lfsmake2 rust-rayon-core
1616
lfsmake2 rust-remove_dir_all
1617
lfsmake2 rust-tempdir
1619
lfsmake2 rust-once_cell
1620
lfsmake2 rust-termcolor
1622
lfsmake2 rust-serde_derive
1623
lfsmake2 rust-trybuild
1624
lfsmake2 rust-unindent
1625
lfsmake2 rust-proc-macro-hack
1626
lfsmake2 rust-indoc-impl
1628
lfsmake2 rust-indoc-0.3.6
1629
lfsmake2 rust-instant
1630
lfsmake2 rust-lock_api
1631
lfsmake2 rust-smallvec
1632
lfsmake2 rust-parking_lot_core
1633
lfsmake2 rust-parking_lot
1634
lfsmake2 rust-paste-impl
1636
lfsmake2 rust-paste-0.1.18
1639
lfsmake2 rust-inventory-impl
1640
lfsmake2 rust-inventory
1641
lfsmake2 rust-pyo3-build-config
1642
lfsmake2 rust-pyo3-macros-backend
1643
lfsmake2 rust-pyo3-macros
1645
lfsmake2 rust-num-traits
1646
lfsmake2 rust-num-integer
1647
lfsmake2 rust-num_threads
1649
lfsmake2 rust-iana-time-zone
1650
lfsmake2 rust-chrono
1651
lfsmake2 rust-asn1_derive
1653
lfsmake2 rust-proc-macro-error-attr
1654
lfsmake2 rust-proc-macro-error
1655
lfsmake2 rust-Inflector
1656
lfsmake2 rust-ouroboros_macro
1657
lfsmake2 rust-aliasable
1658
lfsmake2 rust-stable_deref_trait
1659
lfsmake2 rust-ouroboros
1660
lfsmake2 rust-base64
1669
lfsmake2 ca-certificates
1688
lfsmake2 perl-BerkeleyDB
1692
lfsmake2 web-user-interface
1703
lfsmake2 reiserfsprogs
1711
lfsmake2 perl-ExtUtils-PkgConfig
1713
lfsmake2 perl-GD-Graph
1714
lfsmake2 perl-GD-TextUtil
1715
lfsmake2 perl-Device-SerialPort
1716
lfsmake2 perl-Device-Modem
1717
lfsmake2 perl-Apache-Htpasswd
1718
lfsmake2 perl-Parse-Yapp
1719
lfsmake2 perl-Data-UUID
1720
lfsmake2 perl-Try-Tiny
1721
lfsmake2 perl-HTTP-Message
1722
lfsmake2 perl-HTTP-Date
1727
lfsmake2 conntrack-tools
1729
lfsmake2 l7-protocols
1737
lfsmake2 perl-Switch
1738
lfsmake2 perl-HTML-Tagset
1739
lfsmake2 perl-HTML-Parser
1740
lfsmake2 perl-HTML-Template
1741
lfsmake2 perl-Compress-Zlib
1742
lfsmake2 perl-Digest
1743
lfsmake2 perl-Digest-SHA1
1744
lfsmake2 perl-Digest-HMAC
1745
lfsmake2 perl-libwww
1746
lfsmake2 perl-LWP-Protocol-https
1747
lfsmake2 perl-Net-HTTP
1748
lfsmake2 perl-Net-DNS
1749
lfsmake2 perl-Net-IPv4Addr
1750
lfsmake2 perl-Net_SSLeay
1751
lfsmake2 perl-IO-Stringy
1752
lfsmake2 perl-IO-Socket-SSL
1753
lfsmake2 perl-Unix-Syslog
1754
lfsmake2 perl-Mail-Tools
1755
lfsmake2 perl-MIME-Tools
1756
lfsmake2 perl-Net-Server
1757
lfsmake2 perl-Canary-Stability
1758
lfsmake2 perl-Convert-TNEF
1759
lfsmake2 perl-Convert-UUlib
1760
lfsmake2 perl-Archive-Tar
1761
lfsmake2 perl-Archive-Zip
1762
lfsmake2 perl-Text-Tabs+Wrap
1763
lfsmake2 perl-XML-Parser
1764
lfsmake2 perl-Crypt-PasswdMD5
1765
lfsmake2 perl-Net-Telnet
1767
lfsmake2 perl-Capture-Tiny
1768
lfsmake2 perl-Config-AutoConf
1769
lfsmake2 perl-Object-Tiny
1770
lfsmake2 perl-Archive-Peek-Libarchive
1771
lfsmake2 python3-inotify
1772
lfsmake2 python3-docutils
1773
lfsmake2 python3-daemon
1777
lfsmake2 dejavu-fonts-ttf
1778
lfsmake2 ubuntu-font-family
1794
lfsmake2 ids-ruleset-sources
1795
lfsmake2 ipblocklist-sources
1814
lfsmake2 ghostscript
1817
lfsmake2 poppler-data
1818
lfsmake2 cups-filters
1819
lfsmake2 epson-inkjet-printer-escpr
1825
lfsmake2 rpcsvc-proto
1831
lfsmake2 bridge-utils
1832
lfsmake2 smartmontools
1838
lfsmake2 perl-NetAddr-IP
1868
lfsmake2 libstatgrab
1872
lfsmake2 linux-firmware
1873
lfsmake2 dvb-firmwares
1874
lfsmake2 zd1211-firmware
1875
lfsmake2 rpi-firmware
1876
lfsmake2 intel-microcode
1877
lfsmake2 pcengines-apu-firmware
1881
lfsmake2 python3-toml
1882
lfsmake2 python3-pyproject2setuppy
1883
lfsmake2 python3-pyparsing
1884
lfsmake2 spice-protocol
1887
lfsmake2 libusbredir
1892
lfsmake2 nagios_nrpe
1893
lfsmake2 nagios-plugins
1894
lfsmake2 observium-agent
1900
lfsmake2 vdr_streamdev
1901
lfsmake2 vdr_epgsearch
1907
lfsmake2 libmpdclient
1909
lfsmake2 perl-Net-CIDR-Lite
1910
lfsmake2 perl-Net-SMTP-SSL
1911
lfsmake2 perl-MIME-Base64
1912
lfsmake2 perl-Authen-SASL
1913
lfsmake2 perl-MIME-Lite
1914
lfsmake2 perl-Email-Date-Format
1917
lfsmake2 wpa_supplicant
1921
lfsmake2 cpufrequtils
1932
lfsmake2 perl-gettext
1933
lfsmake2 perl-Sort-Naturally
1936
lfsmake2 perl-DBD-SQLite
1937
lfsmake2 perl-File-ReadBackwards
1938
lfsmake2 openvmtools
1943
lfsmake2 usb_modeswitch
1944
lfsmake2 usb_modeswitch_data
1952
lfsmake2 wireless-regdb
1954
lfsmake2 python3-pycparser
1955
lfsmake2 python3-charset-normalizer
1956
lfsmake2 python3-certifi
1957
lfsmake2 python3-idna
1958
lfsmake2 python3-requests
1959
lfsmake2 python3-tomli
1960
lfsmake2 python3-pep517
1961
lfsmake2 python3-build
1962
lfsmake2 python3-install
1963
lfsmake2 python3-urllib3
1964
lfsmake2 python3-flit
1965
lfsmake2 python3-packaging
1966
lfsmake2 python3-typing-extensions
1967
lfsmake2 python3-semantic-version
1968
lfsmake2 python3-setuptools-scm
1969
lfsmake2 python3-setuptools-rust
1970
lfsmake2 python3-six
1971
lfsmake2 python3-dateutil
1972
lfsmake2 python3-jmespath
1973
lfsmake2 python3-colorama
1974
lfsmake2 python3-yaml
1975
lfsmake2 python3-s3transfer
1976
lfsmake2 python3-rsa
1977
lfsmake2 python3-pyasn1
1978
lfsmake2 python3-botocore
1979
lfsmake2 python3-cffi
1980
lfsmake2 python3-cryptography
1981
lfsmake2 python3-circuitbreaker
1982
lfsmake2 python3-pytz
1983
lfsmake2 python3-click
1984
lfsmake2 python3-arrow
1985
lfsmake2 python3-terminaltables
1986
lfsmake2 python3-pkgconfig
1987
lfsmake2 python3-msgpack
1988
lfsmake2 python3-editables
1989
lfsmake2 python3-pathspec
1990
lfsmake2 python3-pluggy
1991
lfsmake2 python3-calver
1992
lfsmake2 python3-trove-classifiers
1993
lfsmake2 python3-hatchling
1994
lfsmake2 python3-hatch-vcs
1995
lfsmake2 python3-hatch-fancy-pypi-readme
1996
lfsmake2 python3-attrs
1997
lfsmake2 python3-sniffio
1998
lfsmake2 python3-sortedcontainers
1999
lfsmake2 python3-outcome
2000
lfsmake2 python3-async_generator
2001
lfsmake2 python3-flit_scm
2002
lfsmake2 python3-exceptiongroup
2003
lfsmake2 python3-trio
2004
lfsmake2 python3-pyfuse3
2006
lfsmake2 oci-python-sdk
2008
lfsmake2 transmission
2021
lfsmake2 ipfire-netboot
2025
lfsmake2 perl-Carp-Clan
2026
lfsmake2 perl-Date-Calc
2027
lfsmake2 perl-Date-Manip
2028
lfsmake2 perl-File-Tail
2029
lfsmake2 perl-TimeDate
2037
lfsmake2 perl-Font-TTF
2038
lfsmake2 perl-IO-String
2039
lfsmake2 perl-PDF-API2
2040
lfsmake2 proxy-accounting
2042
lfsmake2 perl-Text-CSV_XS
2055
lfsmake2 libpciaccess
2060
lfsmake2 perl-common-sense
2061
lfsmake2 perl-inotify2
2062
lfsmake2 perl-Net-IP
2065
lfsmake2 mdns-repeater
2067
lfsmake2 nss-myhostname
2071
lfsmake2 shairport-sync
2075
lfsmake2 spectre-meltdown-checker
2076
lfsmake2 zabbix_agentd
2078
lfsmake2 firmware-update
2080
lfsmake2 asciidoctor
2083
lfsmake2 speedtest-cli
2084
lfsmake2 amazon-ssm-agent
2091
lfsmake2 squid-asnbl
2094
lfsmake2 oath-toolkit
2096
lfsmake2 perl-File-Remove
2097
lfsmake2 perl-Module-Build
2098
lfsmake2 perl-Module-ScanDeps
2099
lfsmake2 perl-YAML-Tiny
2100
lfsmake2 perl-Module-Install
2101
lfsmake2 perl-Imager
2102
lfsmake2 perl-Imager-QRCode
2103
lfsmake2 perl-MIME-Base32
2104
lfsmake2 perl-URI-Encode
2108
lfsmake2 btrfs-progs
2109
lfsmake2 inotify-tools
2112
# Kernelbuild ... current we have no platform that need
2113
# multi kernel builds so KCFG is empty
2114
lfsmake2 linux KCFG=""
2115
lfsmake2 rtl8812au KCFG=""
2116
lfsmake2 linux-initrd KCFG=""
2120
# Build the installer
2123
# use toolchain bash for chroot to strip
2124
CUSTOM_PATH="${TOOLS_DIR}/bin" lfsmake2 strip
2128
lfsmake2 flash-images
1723
2131
buildpackages() {
1724
LOGFILE="$BASEDIR/log/_build.packages.log"
1726
echo "... see detailed log in _build.*.log files" >> $LOGFILE
1729
# Generating list of packages used
1730
print_line "Generating packages list from logs"
1731
rm -f $BASEDIR/doc/packages-list
1732
for i in `ls -1tr $BASEDIR/log/[^_]*`; do
1733
if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
1734
echo "* `basename $i`" >>$BASEDIR/doc/packages-list
1737
echo "== List of softwares used to build $NAME Version: $VERSION ==" > $BASEDIR/doc/packages-list.txt
1738
grep -v 'configroot$\|img$\|initrd$\|initscripts$\|installer$\|install$\|setup$\|pakfire$\|stage2$\|smp$\|tools$\|tools1$\|tools2$\|.tgz$\|-config$\|_missing_rootfile$\|install1$\|install2$\|pass1$\|pass2$\|pass3$' \
1739
$BASEDIR/doc/packages-list | sort >> $BASEDIR/doc/packages-list.txt
1740
rm -f $BASEDIR/doc/packages-list
1741
# packages-list.txt is ready to be displayed for wiki page
1746
[ -z $GIT_TAG ] || LAST_TAG=$GIT_TAG
1747
[ -z $LAST_TAG ] || EXT="$LAST_TAG..HEAD"
1748
git log -n 500 --no-merges --pretty=medium --shortstat $EXT > $BASEDIR/doc/ChangeLog
1750
# Create images for install
1753
# Check if there is a loop device for building in virtual environments
1754
modprobe loop 2>/dev/null
1755
if [ $BUILD_IMAGES == 1 ] && ([ -e /dev/loop/0 ] || [ -e /dev/loop0 ] || [ -e "/dev/loop-control" ]); then
1756
lfsmake2 flash-images
1759
mv $LFS/install/images/{*.iso,*.img.xz,*.bz2} $BASEDIR >> $LOGFILE 2>&1
2132
local LOGFILE="${LOG_DIR}/_build.packages.log"
1790
2162
test -d $BASEDIR/packages || mkdir $BASEDIR/packages
1791
mv -f $LFS/install/packages/* $BASEDIR/packages >> $LOGFILE 2>&1
2163
mv -f ${BUILD_DIR}/install/packages/* $BASEDIR/packages >> $LOGFILE 2>&1
1792
2164
rm -rf $BASEDIR/build/install/packages/*
2167
# This function will re-execute a command in a new namespace
2168
exec_in_namespace() {
2169
# Nothing to do if we are already in a new namespace
2170
if [ -n "${IN_NAMESPACE}" ]; then
2174
# Forward any configuration
2176
"--target=${BUILD_ARCH}"
2182
--propagation=private \
2183
"${0}" "${args[@]}" "$@"
2187
readonly BASEDIR="$(find_base)"
2189
# Get some information about the host system
2190
SYSTEM_PROCESSORS="$(system_processors)"
2191
SYSTEM_MEMORY="$(system_memory)"
2194
BUILD_ARCH="default"
2195
CCACHE_CACHE_SIZE="4G"
2197
# Load configuration file
2198
if [ -f .config ]; then
2202
# Parse any command line options (not commands)
1795
2203
while [ $# -gt 0 ]; do
1798
configure_build "${1#--target=}"
2206
BUILD_ARCH="${1#--target=}"
1801
2210
exiterror "Unknown configuration option: ${1}"
2213
# Found a command, so exit options parsing
1804
# Found a command, so exit options parsing.
2221
# Configure the build
2222
configure_build "${BUILD_ARCH}"
2225
readonly CACHE_DIR="${BASEDIR}/cache"
2226
readonly TOOLCHAIN_DIR="${CACHE_DIR}/toolchains"
2227
readonly CCACHE_DIR="${BASEDIR}/ccache/${BUILD_ARCH}/${TOOLCHAINVER}"
2228
readonly BUILD_DIR="${BASEDIR}/build_${BUILD_ARCH}"
2229
readonly IMAGES_DIR="${BASEDIR}/images_${BUILD_ARCH}"
2230
readonly LOG_DIR="${BASEDIR}/log_${BUILD_ARCH}"
2231
readonly TOOLS_DIR="/tools_${BUILD_ARCH}"
2234
readonly SOURCE_URL="https://source.ipfire.org/ipfire-2.x"
2235
readonly TOOLCHAIN_URL="https://source.ipfire.org/toolchains"
2238
LOGFILE="${LOG_DIR}/_build.preparation.log"
2240
# Ensure that some basic directories exist
2241
mkdir -p "${CACHE_DIR}" "${LOG_DIR}"
2244
readonly TOOLCHAIN="${SNAME}-${VERSION}-toolchain-${TOOLCHAINVER}-${BUILD_ARCH}.tar.zst"
1811
2246
# See what we're supposed to do
1814
2249
START_TIME="${SECONDS}"
1816
PACKAGE="$BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.zst"
1817
#only restore on a clean disk
1818
if [ ! -e "${BASEDIR}/build${TOOLS_DIR}/.toolchain-successful" ]; then
1819
if [ ! -n "$PACKAGE" ]; then
2251
# Launch in a new namespace
2252
exec_in_namespace "$@"
2254
# Prepare the environment
2255
prepareenv --required-space=2048
2257
# Check if the toolchain is available
2258
if [ ! -e "${BUILD_DIR}${TOOLS_DIR}/.toolchain-successful" ]; then
2259
# If we have the toolchain available, we extract it into the build environment
2260
if [ -r "${TOOLCHAIN_DIR}/${TOOLCHAIN}" ]; then
2261
print_build_stage "Packaged toolchain compilation"
2263
# Extract the toolchain
2264
if ! extract_toolchain "${TOOLCHAIN}"; then
2265
exiterror "Failed extracting the toolchain"
2268
# Otherwise perform a full toolchain compilation
1820
2270
print_build_stage "Full toolchain compilation"
1824
PACKAGENAME=${PACKAGE%.tar.zst}
1825
print_build_stage "Packaged toolchain compilation"
1826
if [ `b2sum $PACKAGE | awk '{print $1}'` == `cat $PACKAGENAME.b2 | awk '{print $1}'` ]; then
1827
zstd -d < "${PACKAGE}" | tar x
1830
exiterror "$PACKAGENAME BLAKE2 checksum did not match, check downloaded package"
1837
print_build_stage "Building LFS"
1840
print_build_stage "Building IPFire"
1843
print_build_stage "Building installer"
1846
print_build_stage "Building packages"
2275
print_build_stage "Building ${NAME}"
2278
print_build_stage "Building Packages"
1849
2281
print_build_stage "Checking Logfiles for new Files"
1865
2306
print_line "Cleaning build directory..."
1867
for i in `mount | grep $BASEDIR | sed 's/^.*loop=\(.*\))/\1/'`; do
1868
$LOSETUP -d $i 2>/dev/null
1870
#for i in `mount | grep $BASEDIR | cut -d " " -f 1`; do
1874
for i in `seq 0 7`; do
1875
if ( losetup /dev/loop${i} 2>/dev/null | grep -q "/install/images" ); then
1876
umount /dev/loop${i} 2>/dev/null;
1877
losetup -d /dev/loop${i} 2>/dev/null;
1880
rm -rf $BASEDIR/build
1881
rm -rf $BASEDIR/cdrom
1882
rm -rf $BASEDIR/packages
2308
# Cleanup build files
2311
"${BASEDIR}/cdrom" \
2312
"${BASEDIR}/packages" \
2315
# Remove the /tools symlink
1884
2316
if [ -h "${TOOLS_DIR}" ]; then
1885
2317
rm -f "${TOOLS_DIR}"
1887
rm -f $BASEDIR/ipfire-*
1888
2320
print_status DONE
1891
# Build the docker image if it does not exist, yet
1892
if ! docker images -a | grep -q ^ipfire-builder; then
1893
if docker build -t ipfire-builder ${BASEDIR}/tools/docker; then
1901
# Run the container and enter a shell
1902
docker run -it --privileged -v "${BASEDIR}:/build" -w "/build" ipfire-builder bash -l
1905
if [ ! -d $BASEDIR/cache ]; then
1906
mkdir $BASEDIR/cache
1908
mkdir -p $BASEDIR/log
1909
echo -e "${BOLD}Preload all source files${NORMAL}" | tee -a $LOGFILE
1912
for c in `seq $MAX_RETRIES`; do
1913
if (( FINISHED==1 )); then
1919
if [ -f "$i" -a "$i" != "Config" ]; then
1920
lfsmakecommoncheck ${i} || continue
2323
# Tell the user what we are about to do
2324
print_headline "Pre-loading all source files"
1922
make -s -f $i LFS_BASEDIR=$BASEDIR BUILD_ARCH="${BUILD_ARCH}" \
1923
MESSAGE="$i\t ($c/$MAX_RETRIES)" download >> $LOGFILE 2>&1
1924
if [ $? -ne 0 ]; then
1928
if [ $c -eq 1 ]; then
1935
echo -e "${BOLD}***Verifying BLAKE2 checksum${NORMAL}"
1938
if [ -f "$i" -a "$i" != "Config" ]; then
1939
lfsmakecommoncheck ${i} > /dev/null || continue
1940
make -s -f $i LFS_BASEDIR=$BASEDIR BUILD_ARCH="${BUILD_ARCH}" \
1941
MESSAGE="$i\t " b2 >> $LOGFILE 2>&1
1942
if [ $? -ne 0 ]; then
1943
echo -ne "BLAKE2 checksum difference in lfs/$i"
1949
if [ $ERROR -eq 0 ]; then
1950
echo -ne "${BOLD}all files BLAKE2 checksum match${NORMAL}"
1953
echo -ne "${BOLD}not all files were correctly download${NORMAL}"
2326
# Download all sources
2327
if ! download_sources; then
2328
exiterror "Failed to download sources"
1956
cd - >/dev/null 2>&1
2332
# Launch in a new namespace
2333
exec_in_namespace "$@"
2335
# Prepare the environment
1960
2338
print_build_stage "Toolchain compilation (${BUILD_ARCH})"
1962
echo "`date -u '+%b %e %T'`: Create toolchain image for ${BUILD_ARCH}" | tee -a $LOGFILE
1963
test -d $BASEDIR/cache/toolchains || mkdir -p $BASEDIR/cache/toolchains
1964
cd $BASEDIR && tar -cf- --exclude='log/_build.*.log' build/${TOOLS_DIR} build/bin/sh log \
1965
| zstd ${ZSTD_OPT} > cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.zst
1966
b2sum cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.zst \
1967
> cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.b2
2340
# Build the toolchain
2343
# Ensure the toolchain directory exists
2344
mkdir -p "${TOOLCHAIN_DIR}"
2346
# Compress the toolchain
2347
if ! compress_toolchain "${TOOLCHAIN}"; then
2348
exiterror "Could not compress toolchain"
1971
# arbitrary name to be updated in case of new toolchain package upload
1972
PACKAGE=$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}
1973
if [ ! -f $BASEDIR/cache/toolchains/$PACKAGE.tar.zst ]; then
1974
URL_TOOLCHAIN=`grep URL_TOOLCHAIN lfs/Config | awk '{ print $3 }'`
1975
test -d $BASEDIR/cache/toolchains || mkdir -p $BASEDIR/cache/toolchains
1976
echo "`date -u '+%b %e %T'`: Load toolchain image for ${BUILD_ARCH}" | tee -a $LOGFILE
1977
cd $BASEDIR/cache/toolchains
1978
wget -U "IPFireSourceGrabber/2.x" $URL_TOOLCHAIN/$PACKAGE.tar.zst $URL_TOOLCHAIN/$PACKAGE.b2 >& /dev/null
1979
if [ $? -ne 0 ]; then
1980
echo "`date -u '+%b %e %T'`: error downloading $PACKAGE toolchain for ${BUILD_ARCH} machine" | tee -a $LOGFILE
1982
if [ "`b2sum $PACKAGE.tar.zst | awk '{print $1}'`" = "`cat $PACKAGE.b2 | awk '{print $1}'`" ]; then
1983
echo "`date -u '+%b %e %T'`: toolchain BLAKE2 checksum ok" | tee -a $LOGFILE
1985
exiterror "$PACKAGE BLAKE2 checksum did not match, check downloaded package"
1989
echo "Toolchain is already downloaded. Exiting..."
2353
download_toolchain "${TOOLCHAIN}"
1993
if [ -z $IPFIRE_USER ]; then
1994
echo -n "You have to setup IPFIRE_USER first. See .config for details."
2356
# Check if IPFIRE_USER is set
2357
if [ -z "${IPFIRE_USER}" ]; then
2358
exiterror "You have to setup IPFIRE_USER first. See .config for details."
1999
URL_SOURCE="$(awk '/^URL_SOURCE/ { print $3 }' lfs/Config)"
2361
# Sync with upstream