]>
Commit | Line | Data |
---|---|---|
df5e82b3 | 1 | #!/bin/bash |
9a7e4d85 PM |
2 | ############################################################################### |
3 | # # | |
4 | # IPFire.org - A linux based firewall # | |
6ca4e2f2 | 5 | # Copyright (C) 2007-2025 IPFire Team <info@ipfire.org> # |
9a7e4d85 PM |
6 | # # |
7 | # This program is free software: you can redistribute it and/or modify # | |
8 | # it under the terms of the GNU General Public License as published by # | |
9 | # the Free Software Foundation, either version 3 of the License, or # | |
10 | # (at your option) any later version. # | |
11 | # # | |
12 | # This program is distributed in the hope that it will be useful, # | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | |
15 | # GNU General Public License for more details. # | |
16 | # # | |
17 | # You should have received a copy of the GNU General Public License # | |
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. # | |
19 | # # | |
20 | ############################################################################### | |
df5e82b3 | 21 | |
e8ee3199 AF |
22 | NAME="IPFire" # Software name |
23 | SNAME="ipfire" # Short name | |
d12e3fcd | 24 | # If you update the version don't forget to update backupiso and add it to core update |
e36e826a | 25 | VERSION="2.29" # Version number |
3a555543 | 26 | CORE="196" # Core Level (Filename) |
e8ee3199 AF |
27 | SLOGAN="www.ipfire.org" # Software slogan |
28 | CONFIG_ROOT=/var/ipfire # Configuration rootdir | |
36e2e992 MT |
29 | |
30 | # Information from Git | |
31 | GIT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" # Git Branch | |
32 | GIT_TAG="$(git tag | tail -1)" # Git Tag | |
33 | GIT_LASTCOMMIT="$(git rev-parse --verify HEAD)" # Last commit | |
628e8c3a | 34 | |
1be21e5d | 35 | TOOLCHAINVER="20250430" |
03ad5f93 | 36 | |
9db251ee MT |
37 | KVER_SUFFIX="-${SNAME}" |
38 | ||
39 | # Kernel Version | |
40 | KVER="$(grep --max-count=1 VER lfs/linux | awk '{ print $3 }')" | |
41 | KVER="${KVER/-rc/.0-rc}${KVER_SUFFIX}" | |
42 | ||
69a6ec55 MT |
43 | ############################################################################### |
44 | # | |
45 | # Beautifying variables & presentation & input output interface | |
46 | # | |
47 | ############################################################################### | |
48 | ||
5be3501e MT |
49 | # All supported architectures |
50 | ARCHES=( | |
51 | aarch64 | |
52 | riscv64 | |
53 | x86_64 | |
54 | ) | |
55 | ||
0de9b403 | 56 | HOST_ARCH="${HOSTTYPE}" |
faccfa70 | 57 | HOST_KERNEL="$(uname -r)" |
dfb583fe | 58 | LC_ALL=POSIX |
9948d3d9 MT |
59 | PS1='\u:\w$ ' |
60 | ||
faccfa70 MT |
61 | HAS_TIME_NAMESPACE="true" |
62 | ||
63 | # Disable time namespaces for older kernels | |
64 | case "${HOST_KERNEL}" in | |
65 | 4.*|5.[12345].*) | |
66 | HAS_TIME_NAMESPACE="false" | |
67 | ;; | |
68 | esac | |
69 | ||
0de9b403 MT |
70 | # Are we reading from/writing to a terminal? |
71 | is_terminal() { | |
72 | [ -t 0 ] && [ -t 1 ] && [ -t 2 ] | |
73 | } | |
8eeaf1ab | 74 | |
0de9b403 MT |
75 | # Define color for messages |
76 | if is_terminal; then | |
77 | BOLD="$(tput bold)" | |
78 | RED="$(tput setaf 1)" | |
79 | GREEN="$(tput setaf 2)" | |
80 | YELLOW="$(tput setaf 3)" | |
81 | CYAN="$(tput setaf 6)" | |
82 | NORMAL="$(tput sgr0)" | |
83 | fi | |
8eeaf1ab | 84 | |
401a1edc MT |
85 | # Sets or adjusts pretty formatting variables |
86 | resize_terminal() { | |
401a1edc | 87 | # Find current screen size |
0de9b403 | 88 | COLUMNS="$(tput cols)" |
401a1edc MT |
89 | |
90 | # When using remote connections, such as a serial port, stty size returns 0 | |
0de9b403 | 91 | if ! is_terminal || [ "${COLUMNS}" = "0" ]; then |
401a1edc MT |
92 | COLUMNS=80 |
93 | fi | |
69a6ec55 | 94 | |
56312598 MT |
95 | # Wipe any previous content before updating the counters |
96 | if [ -n "${TIME_COL}" ]; then | |
97 | tput hpa "${TIME_COL}" | |
98 | tput el | |
99 | fi | |
100 | ||
0de9b403 | 101 | # The status column is always 8 characters wide |
401a1edc | 102 | STATUS_WIDTH=8 |
401a1edc | 103 | |
0de9b403 MT |
104 | # The time column is always 12 characters wide |
105 | TIME_WIDTH=12 | |
106 | ||
107 | # Where do the columns start? | |
108 | (( STATUS_COL = COLUMNS - STATUS_WIDTH )) | |
109 | (( TIME_COL = STATUS_COL - TIME_WIDTH )) | |
401a1edc | 110 | } |
69a6ec55 | 111 | |
401a1edc MT |
112 | # Initially setup terminal |
113 | resize_terminal | |
f9783277 | 114 | |
401a1edc MT |
115 | # Call resize_terminal when terminal is being resized |
116 | trap "resize_terminal" WINCH | |
69a6ec55 | 117 | |
74371ed5 MT |
118 | # Writes a line to the log file |
119 | log() { | |
120 | local line="$@" | |
121 | ||
122 | # Fetch the current timestamp | |
123 | local t="$(date -u "+%b %e %T")" | |
124 | ||
125 | # Append the line to file | |
126 | if [ -w "${LOGFILE}" ]; then | |
127 | echo "${t}: ${line}" >> "${LOGFILE}" | |
128 | fi | |
129 | ||
130 | return 0 | |
131 | } | |
132 | ||
510dd732 MT |
133 | find_base() { |
134 | local path | |
135 | ||
136 | # Figure out the absolute script path using readlink | |
137 | path="$(readlink -f "${0}" 2>&1)" | |
138 | ||
139 | # If that failed, try realpath | |
140 | if [ -z "${path}" ]; then | |
141 | path="$(realpath "${0}" 2>&1)" | |
142 | fi | |
143 | ||
144 | # If that failed, I am out of ideas | |
145 | if [ -z "${path}" ]; then | |
146 | echo "${0}: Could not determine BASEDIR" >&2 | |
147 | return 1 | |
148 | fi | |
149 | ||
150 | # Return the dirname | |
151 | dirname "${path}" | |
152 | } | |
153 | ||
69a6ec55 MT |
154 | system_processors() { |
155 | getconf _NPROCESSORS_ONLN 2>/dev/null || echo "1" | |
156 | } | |
157 | ||
158 | system_memory() { | |
159 | local key val unit | |
160 | ||
161 | while read -r key val unit; do | |
162 | case "${key}" in | |
163 | MemTotal:*) | |
164 | # Convert to MB | |
165 | echo "$(( ${val} / 1024 ))" | |
166 | break | |
167 | ;; | |
168 | esac | |
169 | done < /proc/meminfo | |
170 | } | |
171 | ||
f9783277 MT |
172 | format_runtime() { |
173 | local seconds=${1} | |
174 | ||
175 | if [ ${seconds} -ge 3600 ]; then | |
176 | printf "%d:%02d:%02d\n" \ | |
177 | "$(( seconds / 3600 ))" \ | |
178 | "$(( seconds % 3600 / 60 ))" \ | |
179 | "$(( seconds % 3600 % 60 ))" | |
180 | elif [ ${seconds} -ge 60 ]; then | |
181 | printf "%d:%02d\n" \ | |
182 | "$(( seconds / 60 ))" \ | |
183 | "$(( seconds % 60 ))" | |
69a6ec55 | 184 | else |
f9783277 | 185 | printf "%d\n" "${seconds}" |
69a6ec55 | 186 | fi |
f9783277 | 187 | } |
69a6ec55 | 188 | |
f9783277 | 189 | print_line() { |
0de9b403 MT |
190 | # Print the string all the way to the status column |
191 | printf "%-${STATUS_COL}s" "$*" | |
f9783277 MT |
192 | } |
193 | ||
194 | print_headline() { | |
0de9b403 | 195 | printf "${BOLD}%s${NORMAL}\n" "$*" |
f9783277 MT |
196 | } |
197 | ||
198 | print_package() { | |
199 | local name="${1}" | |
200 | shift | |
69a6ec55 | 201 | |
f9783277 MT |
202 | local version="$(grep -E "^VER |^VER=|^VER " $BASEDIR/lfs/${name} | awk '{ print $3 }')" |
203 | local options="$@" | |
204 | ||
205 | local string="${name}" | |
206 | if [ -n "${version}" ] && [ "${version}" != "ipfire" ]; then | |
207 | string="${string} (${version})" | |
208 | fi | |
209 | ||
0de9b403 MT |
210 | # Add the options |
211 | if [ -n "${options}" ]; then | |
9a07118b | 212 | string="${string} ${options[@]}" |
0de9b403 MT |
213 | fi |
214 | ||
215 | # Print the string | |
216 | print_line "${string}" | |
f9783277 MT |
217 | } |
218 | ||
219 | print_runtime() { | |
220 | local runtime=$(format_runtime $@) | |
221 | ||
0de9b403 MT |
222 | # Move back the cursor to rewrite the runtime |
223 | if is_terminal; then | |
224 | tput hpa "${TIME_COL}" | |
69a6ec55 | 225 | fi |
0de9b403 MT |
226 | |
227 | printf "[ ${BOLD}%$(( TIME_WIDTH - 4 ))s${NORMAL} ]" "${runtime}" | |
f9783277 MT |
228 | } |
229 | ||
230 | print_status() { | |
231 | local status="${1}" | |
0de9b403 | 232 | local color |
f9783277 | 233 | |
0de9b403 MT |
234 | case "${status}" in |
235 | DONE) | |
236 | color="${BOLD}${GREEN}" | |
237 | ;; | |
238 | FAIL) | |
239 | color="${BOLD}${RED}" | |
240 | ;; | |
241 | SKIP) | |
242 | color="${BOLD}${CYAN}" | |
243 | ;; | |
244 | WARN) | |
245 | color="${BOLD}${YELLOW}" | |
246 | ;; | |
247 | *) | |
248 | color="${BOLD}" | |
249 | ;; | |
250 | esac | |
f9783277 | 251 | |
0de9b403 MT |
252 | # Move to the start of the column |
253 | if is_terminal; then | |
254 | tput hpa "${STATUS_COL}" | |
69a6ec55 | 255 | fi |
f9783277 | 256 | |
0de9b403 | 257 | printf "[ ${color}%$(( STATUS_WIDTH - 4 ))s${NORMAL} ]\n" "${status}" |
69a6ec55 MT |
258 | } |
259 | ||
f9783277 | 260 | print_build_summary() { |
787d9428 | 261 | local runtime="${1}" |
f9783277 | 262 | |
787d9428 MT |
263 | print_line "*** Build Finished" |
264 | print_runtime "${runtime}" | |
f9783277 | 265 | print_status DONE |
69a6ec55 MT |
266 | } |
267 | ||
9d9c7cef MT |
268 | # Launches a timer process as a co-process |
269 | launch_timer() { | |
270 | # Do nothing if the timer is already running | |
271 | if [ -n "${TIMER_PID}" ]; then | |
272 | return 0 | |
273 | fi | |
274 | ||
0de9b403 MT |
275 | # Don't launch the timer when we are not on a terminal |
276 | if ! is_terminal; then | |
277 | return 0 | |
278 | fi | |
279 | ||
9d9c7cef MT |
280 | # Launch the co-process |
281 | coproc TIMER { "${0}" "__timer" "$$"; } | |
282 | ||
283 | # Register the signal handlers | |
284 | trap "__timer_event" SIGUSR1 | |
285 | trap "terminate_timer" EXIT | |
286 | } | |
287 | ||
288 | # Terminates a previously launched timer | |
289 | terminate_timer() { | |
290 | if [ -n "${TIMER_PID}" ]; then | |
291 | kill -TERM "${TIMER_PID}" | |
292 | fi | |
293 | } | |
294 | ||
295 | # The timer main loop | |
296 | __timer() { | |
297 | local pid="${1}" | |
298 | ||
299 | # Send SIGUSR1 to the main process once a second | |
b55434ff | 300 | # If the parent process has gone away, we will terminate. |
9d9c7cef | 301 | while sleep 1; do |
b55434ff MT |
302 | if ! kill -USR1 "${pid}" &>/dev/null; then |
303 | break | |
304 | fi | |
9d9c7cef MT |
305 | done |
306 | ||
307 | return 0 | |
308 | } | |
309 | ||
310 | # Called when the timer triggers | |
6e6cb046 | 311 | # This function does nothing, but is needed interrupt the wait call |
9d9c7cef | 312 | __timer_event() { |
b55434ff | 313 | return 0 |
9d9c7cef MT |
314 | } |
315 | ||
69a6ec55 | 316 | exiterror() { |
f9783277 | 317 | # Dump logfile |
66028310 | 318 | if [ -n "${LOGFILE}" ] && [ -e "${LOGFILE}" ]; then |
69a6ec55 MT |
319 | echo # empty line |
320 | ||
321 | local line | |
322 | while read -r line; do | |
323 | echo " ${line}" | |
324 | done <<< "$(tail -n30 ${LOGFILE})" | |
325 | fi | |
326 | ||
f9783277 MT |
327 | echo # empty line |
328 | ||
329 | local line | |
330 | for line in "ERROR: $@" " Check ${LOGFILE} for errors if applicable"; do | |
a8e10869 | 331 | print_line "${line}" |
f9783277 MT |
332 | print_status FAIL |
333 | done | |
334 | ||
69a6ec55 MT |
335 | exit 1 |
336 | } | |
337 | ||
aecbe123 | 338 | prepareenv() { |
dae1ac41 MT |
339 | local network="false" |
340 | ||
aecbe123 | 341 | # Are we running the right shell? |
54328605 | 342 | if [ -z "${BASH}" ]; then |
aecbe123 MT |
343 | exiterror "BASH environment variable is not set. You're probably running the wrong shell." |
344 | fi | |
345 | ||
346 | if [ -z "${BASH_VERSION}" ]; then | |
347 | exiterror "Not running BASH shell." | |
348 | fi | |
349 | ||
350 | # Trap on emergency exit | |
db9ba592 | 351 | trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGQUIT |
aecbe123 | 352 | |
aecbe123 | 353 | # Checking if running as root user |
b0c45169 MT |
354 | if [ "${UID}" -ne 0 ]; then |
355 | exiterror "root privileges required for building" | |
aecbe123 MT |
356 | fi |
357 | ||
25817601 | 358 | local required_space |
f8b5e93d | 359 | |
25817601 MT |
360 | # Parse arguments |
361 | while [ $# -gt 0 ]; do | |
362 | case "${1}" in | |
363 | --required-space=*) | |
364 | required_space="${1#--required-space=}" | |
365 | ;; | |
366 | ||
dae1ac41 MT |
367 | --network) |
368 | network="true" | |
369 | ;; | |
370 | ||
25817601 MT |
371 | *) |
372 | exiterror "Unknown argument: ${1}" | |
373 | ;; | |
374 | esac | |
375 | shift | |
376 | done | |
377 | ||
378 | # Do we need to check the required space? | |
379 | if [ -n "${required_space}" ]; then | |
380 | local free_space free_blocks block_size | |
a50bd44c | 381 | local consumed_space path |
f8b5e93d | 382 | |
25817601 MT |
383 | # Fetch free blocks |
384 | read -r free_blocks block_size <<< "$(stat --file-system --format="%a %S" "${BASEDIR}")" | |
f8b5e93d | 385 | |
25817601 MT |
386 | # Calculate free space |
387 | (( free_space = free_blocks * block_size / 1024 / 1024 )) | |
388 | ||
a50bd44c | 389 | # If we don't have the total space free, we need to check how much we have consumed already... |
25817601 | 390 | if [ "${free_space}" -lt "${required_space}" ]; then |
a50bd44c MT |
391 | # Add any consumed space |
392 | while read -r consumed_space path; do | |
393 | (( free_space += consumed_space / 1024 / 1024 )) | |
656e3b79 | 394 | done <<< "$(du --summarize --bytes "${BUILD_DIR}" "${IMAGES_DIR}" "${LOG_DIR}" 2>/dev/null)" |
a50bd44c MT |
395 | fi |
396 | ||
397 | # Check that we have the required space | |
398 | if [ "${free_space}" -lt "${required_space}" ]; then | |
399 | exiterror "Not enough temporary space available, need at least ${required_space}MiB, but only have ${free_space}MiB" | |
25817601 | 400 | fi |
aecbe123 MT |
401 | fi |
402 | ||
403 | # Set umask | |
404 | umask 022 | |
405 | ||
aecbe123 | 406 | # Make some extra directories |
814360a3 | 407 | mkdir -p "${CCACHE_DIR}" |
68fea175 | 408 | mkdir -p "${IMAGES_DIR}" |
2c33bdf0 | 409 | mkdir -p "${PACKAGES_DIR}" |
86565d7f MT |
410 | mkdir -p "${BUILD_DIR}/${TOOLS_DIR}" |
411 | mkdir -p "${BUILD_DIR}/cache" | |
daa17f2e | 412 | mkdir -p "${BUILD_DIR}/dev" |
86565d7f | 413 | mkdir -p "${BUILD_DIR}/etc" |
b2e0324e | 414 | mkdir -p "${BUILD_DIR}/proc" |
a3bd0672 | 415 | mkdir -p "${BUILD_DIR}/root" |
daa17f2e | 416 | mkdir -p "${BUILD_DIR}/sys" |
86565d7f MT |
417 | mkdir -p "${BUILD_DIR}/tmp" |
418 | mkdir -p "${BUILD_DIR}/usr/src" | |
419 | mkdir -p "${BUILD_DIR}/usr/src/cache" | |
420 | mkdir -p "${BUILD_DIR}/usr/src/ccache" | |
421 | mkdir -p "${BUILD_DIR}/usr/src/config" | |
422 | mkdir -p "${BUILD_DIR}/usr/src/doc" | |
423 | mkdir -p "${BUILD_DIR}/usr/src/html" | |
68fea175 | 424 | mkdir -p "${BUILD_DIR}/usr/src/images" |
86565d7f MT |
425 | mkdir -p "${BUILD_DIR}/usr/src/langs" |
426 | mkdir -p "${BUILD_DIR}/usr/src/lfs" | |
427 | mkdir -p "${BUILD_DIR}/usr/src/log" | |
428 | mkdir -p "${BUILD_DIR}/usr/src/src" | |
aecbe123 | 429 | |
d4e9fc7f MT |
430 | # Make BUILD_DIR a mountpoint |
431 | mount -o bind "${BUILD_DIR}" "${BUILD_DIR}" | |
432 | ||
e940d23c MT |
433 | # Create a new, minimal /dev |
434 | mount build_dev "${BUILD_DIR}/dev" \ | |
2b0ecf4d | 435 | -t devtmpfs -o "nosuid,noexec,mode=0755,size=4m,nr_inodes=64k" |
e940d23c MT |
436 | |
437 | # Mount a new /dev/pts | |
438 | mount build_dev_pts "${BUILD_DIR}/dev/pts" \ | |
439 | -t devpts -o "nosuid,noexec,newinstance,ptmxmode=0666,mode=620" | |
440 | ||
441 | # Mount a new /dev/shm | |
442 | mount build_dev_shm "${BUILD_DIR}/dev/shm" \ | |
443 | -t tmpfs -o "nosuid,nodev,strictatime,mode=1777,size=1024m" | |
aecbe123 | 444 | |
3a5d7b88 MT |
445 | # Mount a new /tmp |
446 | mount build_tmp "${BUILD_DIR}/tmp" \ | |
447 | -t tmpfs -o "nosuid,nodev,strictatime,size=4G,nr_inodes=1M,mode=1777" | |
448 | ||
5e8730eb MT |
449 | # Create an empty /proc directory and make it a mountpoint |
450 | mkdir -p "${BUILD_DIR}/proc" | |
451 | mount --bind "${BUILD_DIR}/proc" "${BUILD_DIR}/proc" | |
452 | ||
aecbe123 | 453 | # Make all sources and proc available under lfs build |
27b8db24 MT |
454 | mount --bind /sys "${BUILD_DIR}/sys" |
455 | mount --bind -o ro "${BASEDIR}/cache" "${BUILD_DIR}/usr/src/cache" | |
456 | mount --bind -o ro "${BASEDIR}/config" "${BUILD_DIR}/usr/src/config" | |
457 | mount --bind -o ro "${BASEDIR}/doc" "${BUILD_DIR}/usr/src/doc" | |
458 | mount --bind -o ro "${BASEDIR}/html" "${BUILD_DIR}/usr/src/html" | |
459 | mount --bind -o ro "${BASEDIR}/langs" "${BUILD_DIR}/usr/src/langs" | |
460 | mount --bind -o ro "${BASEDIR}/lfs" "${BUILD_DIR}/usr/src/lfs" | |
27b8db24 | 461 | mount --bind -o ro "${BASEDIR}/src" "${BUILD_DIR}/usr/src/src" |
aecbe123 | 462 | |
372f8088 MT |
463 | # Mount the log directory |
464 | mount --bind "${LOG_DIR}" "${BUILD_DIR}/usr/src/log" | |
465 | ||
814360a3 MT |
466 | # Mount the ccache |
467 | mount --bind "${CCACHE_DIR}" "${BUILD_DIR}/usr/src/ccache" | |
468 | ||
68fea175 MT |
469 | # Mount the images directory |
470 | mount --bind "${IMAGES_DIR}" "${BUILD_DIR}/usr/src/images" | |
471 | ||
dae1ac41 MT |
472 | # Bind-mount files requires for networking if requested |
473 | if [ "${network}" = "true" ]; then | |
474 | local file | |
475 | ||
476 | for file in /etc/resolv.conf /etc/hosts; do | |
477 | # Skip if the source files does not exist | |
478 | if [ ! -e "${file}" ]; then | |
479 | continue | |
480 | fi | |
481 | ||
482 | # Create the destination if it does not exist | |
483 | if [ ! -e "${BUILD_DIR}/${file}" ]; then | |
484 | touch "${BUILD_DIR}/${file}" | |
485 | fi | |
486 | ||
487 | # Mount the file read-only | |
488 | mount --bind -o ro "${file}" "${BUILD_DIR}/${file}" | |
489 | done | |
490 | fi | |
491 | ||
814360a3 | 492 | # Configure the ccache |
36065e42 | 493 | export CCACHE_TEMPDIR="/tmp" |
aecbe123 MT |
494 | export CCACHE_COMPILERCHECK="string:toolchain-${TOOLCHAINVER} ${BUILD_ARCH}" |
495 | ||
92a2ed67 MT |
496 | # Install the QEMU helper |
497 | qemu_install_helper | |
498 | ||
aecbe123 | 499 | # Remove pre-install list of installed files in case user erase some files before rebuild |
86565d7f | 500 | rm -f "${BUILD_DIR}/usr/src/lsalr" |
aecbe123 MT |
501 | |
502 | # Prepare string for /etc/system-release. | |
f48643e5 MT |
503 | local system_release="${NAME} ${VERSION} (${BUILD_ARCH})" |
504 | ||
505 | case "${GIT_BRANCH}" in | |
506 | core*|beta?|rc?) | |
507 | system_release="${system_release} - ${GIT_BRANCH}" | |
508 | ;; | |
509 | *) | |
9ff65bfa | 510 | system_release="${system_release} - core${CORE} Development Build: ${GIT_BRANCH}/${GIT_LASTCOMMIT:0:8}" |
f48643e5 | 511 | ;; |
aecbe123 | 512 | esac |
4e54a8e2 | 513 | |
f48643e5 MT |
514 | # Append -dirty tag for local changes |
515 | if [ "$(git status -s | wc -l)" != "0" ]; then | |
516 | system_release="${system_release}-dirty" | |
517 | fi | |
518 | ||
519 | # Export variable | |
520 | SYSTEM_RELEASE="${system_release}" | |
521 | ||
040160c7 MT |
522 | # Decide on PAKFIRE_TREE |
523 | case "${GIT_BRANCH}" in | |
524 | core*) | |
525 | PAKFIRE_TREE="stable" | |
526 | ;; | |
527 | master) | |
528 | PAKFIRE_TREE="testing" | |
529 | ;; | |
530 | *) | |
531 | PAKFIRE_TREE="unstable" | |
532 | ;; | |
533 | esac | |
534 | ||
4e54a8e2 | 535 | # Setup ccache cache size |
9fc24981 | 536 | execute --chroot ccache --max-size="${CCACHE_CACHE_SIZE}" |
69a6ec55 MT |
537 | } |
538 | ||
539 | entershell() { | |
4fd413a1 | 540 | echo "Entering to a shell inside the build environment, go out with exit" |
d630cfec | 541 | |
ab8464f4 | 542 | local PS1="ipfire build chroot (${BUILD_ARCH}) \u:\w\$ " |
69a6ec55 | 543 | |
d630cfec | 544 | # Run an interactive shell |
07f6a51a | 545 | execute --chroot --interactive --network bash -i |
69a6ec55 MT |
546 | } |
547 | ||
548 | lfsmakecommoncheck() { | |
549 | # Script present? | |
550 | if [ ! -f $BASEDIR/lfs/$1 ]; then | |
551 | exiterror "No such file or directory: $BASEDIR/$1" | |
552 | fi | |
553 | ||
f9783277 MT |
554 | # Print package name and version |
555 | print_package $@ | |
69a6ec55 MT |
556 | |
557 | # Check if this package is supported by our architecture. | |
558 | # If no SUP_ARCH is found, we assume the package can be built for all. | |
559 | if grep "^SUP_ARCH" ${BASEDIR}/lfs/${1} >/dev/null; then | |
560 | # Check if package supports ${BUILD_ARCH} or all architectures. | |
561 | if ! grep -E "^SUP_ARCH.*${BUILD_ARCH}|^SUP_ARCH.*all" ${BASEDIR}/lfs/${1} >/dev/null; then | |
405ee2b4 | 562 | print_runtime 0 |
f9783277 | 563 | print_status SKIP |
69a6ec55 MT |
564 | return 1 |
565 | fi | |
566 | fi | |
567 | ||
69a6ec55 MT |
568 | echo -ne "`date -u '+%b %e %T'`: Building $* " >> $LOGFILE |
569 | ||
69a6ec55 MT |
570 | return 0 # pass all! |
571 | } | |
572 | ||
9fc24981 | 573 | execute() { |
9fc24981 | 574 | local chroot="false" |
ba844d1d | 575 | local command=() |
9fc24981 MT |
576 | local interactive="false" |
577 | local timer | |
91942800 | 578 | local network="false" |
1c74bc46 | 579 | |
449f2879 MT |
580 | # Collect environment variables |
581 | local -A environ=( | |
582 | [PATH]="${TOOLS_DIR}/ccache/bin:${TOOLS_DIR}/sbin:${TOOLS_DIR}/bin:${PATH}" | |
583 | [HOME]="${HOME}" | |
584 | [PS1]="${PS1}" | |
585 | [TERM]="vt100" | |
586 | ||
587 | # Distro Information | |
588 | [NAME]="${NAME}" | |
589 | [SNAME]="${SNAME}" | |
590 | [VERSION]="${VERSION}" | |
591 | [CORE]="${CORE}" | |
592 | [SLOGAN]="${SLOGAN}" | |
593 | [SYSTEM_RELEASE]="${SYSTEM_RELEASE}" | |
594 | [PAKFIRE_TREE]="${PAKFIRE_TREE}" | |
595 | [CONFIG_ROOT]="${CONFIG_ROOT}" | |
596 | ||
597 | # Kernel Version | |
598 | [KVER]="${KVER}" | |
9db251ee | 599 | [KVER_SUFFIX]="${KVER_SUFFIX}" |
449f2879 MT |
600 | |
601 | # Compiler flags | |
27d0a2c4 MT |
602 | [CFLAGS]="${CFLAGS[@]}" |
603 | [CXXFLAGS]="${CFLAGS[@]}" | |
604 | [RUSTFLAGS]="${RUSTFLAGS[@]}" | |
449f2879 MT |
605 | |
606 | # ccache | |
607 | [CCACHE_DIR]="${CCACHE_DIR}" | |
608 | [CCACHE_TEMPDIR]="${CCACHE_TEMPDIR}" | |
609 | [CCACHE_COMPILERCHECK]="${CCACHE_COMPILERCHECK}" | |
610 | ||
611 | # System Properties | |
612 | [SYSTEM_PROCESSORS]="${SYSTEM_PROCESSORS}" | |
613 | [SYSTEM_MEMORY]="${SYSTEM_MEMORY}" | |
614 | ||
615 | # Parallelism | |
616 | [DEFAULT_PARALLELISM]="${DEFAULT_PARALLELISM}" | |
617 | ||
618 | # Compression Options | |
b1cf1d9c MT |
619 | [XZ_OPT]="${XZ_OPT[*]}" |
620 | [ZSTD_OPT]="${ZSTD_OPT[*]}" | |
449f2879 MT |
621 | |
622 | # Build Architecture | |
623 | [BUILD_ARCH]="${BUILD_ARCH}" | |
624 | [BUILD_PLATFORM]="${BUILD_PLATFORM}" | |
625 | ||
626 | # Targets | |
627 | [CROSSTARGET]="${CROSSTARGET}" | |
628 | [BUILDTARGET]="${BUILDTARGET}" | |
629 | ||
630 | # Paths | |
631 | [LFS_BASEDIR]="${BASEDIR}" | |
c08841bb | 632 | [BUILD_DIR]="${BUILD_DIR}" |
449f2879 | 633 | [IMAGES_DIR]="${IMAGES_DIR}" |
c08841bb | 634 | [LOG_DIR]="${LOG_DIR}" |
20e49206 | 635 | [PACKAGES_DIR]="${PACKAGES_DIR}" |
449f2879 MT |
636 | [TOOLS_DIR]="${TOOLS_DIR}" |
637 | ) | |
638 | ||
ba844d1d MT |
639 | local unshare=() |
640 | ||
449f2879 | 641 | # Configure a new namespace |
ba844d1d MT |
642 | if [ -n "${IN_NAMESPACE}" ]; then |
643 | unshare+=( | |
644 | # Create a new cgroup namespace | |
645 | "--cgroup" | |
449f2879 | 646 | |
ba844d1d MT |
647 | # Create a new mount namespace |
648 | "--mount" | |
2b4d457c | 649 | "--propagation=slave" |
449f2879 | 650 | |
ba844d1d MT |
651 | # Create a new PID namespace and fork |
652 | "--pid" | |
653 | "--fork" | |
449f2879 | 654 | |
ba844d1d MT |
655 | # Create a new UTS namespace |
656 | "--uts" | |
449f2879 | 657 | |
0a110703 MT |
658 | # Mount /proc so that the build environment does not see |
659 | # any foreign processes. | |
660 | "--mount-proc=${BUILD_DIR}/proc" | |
661 | ||
ba844d1d MT |
662 | # If unshare is asked to terminate, terminate all child processes |
663 | "--kill-child" | |
664 | ) | |
faccfa70 MT |
665 | |
666 | # Optionally set up a new time namespace | |
667 | if [ "${HAS_TIME_NAMESPACE}" = "true" ]; then | |
668 | unshare+=( "--time" ) | |
669 | fi | |
ba844d1d | 670 | fi |
0ce11c68 | 671 | |
9fc24981 MT |
672 | while [ $# -gt 0 ]; do |
673 | case "${1}" in | |
674 | --chroot) | |
675 | chroot="true" | |
69a6ec55 | 676 | |
449f2879 MT |
677 | # Update some variables |
678 | environ+=( | |
679 | [PATH]="${TOOLS_DIR}/ccache/bin:/bin:/usr/bin:/sbin:/usr/sbin:${TOOLS_DIR}/sbin:${TOOLS_DIR}/bin" | |
680 | [HOME]="/root" | |
681 | ||
682 | # Paths | |
683 | [LFS_BASEDIR]="/usr/src" | |
c08841bb | 684 | [BUILD_DIR]="/" |
449f2879 | 685 | [IMAGES_DIR]="/usr/src/images" |
c08841bb | 686 | [LOG_DIR]="/usr/src/log" |
20e49206 | 687 | [PACKAGES_DIR]="/usr/src/images/packages" |
449f2879 MT |
688 | |
689 | # Compiler Cache | |
690 | [CCACHE_DIR]="/usr/src/ccache" | |
691 | ||
692 | # Go Cache | |
693 | [GOCACHE]="/usr/src/ccache/go" | |
694 | ) | |
695 | ||
696 | # Fake environment | |
697 | if [ -e "${BUILD_DIR}${TOOLS_DIR}/lib/libpakfire_preload.so" ]; then | |
698 | environ+=( | |
699 | [LD_PRELOAD]="${TOOLS_DIR}/lib/libpakfire_preload.so" | |
700 | ||
701 | # Fake kernel version, because some of the packages do not | |
702 | # compile with kernel 3.0 and later | |
9db251ee | 703 | [UTS_RELEASE]="${KVER}" |
449f2879 MT |
704 | |
705 | # Fake machine | |
706 | [UTS_MACHINE]="${BUILD_ARCH}" | |
707 | ) | |
708 | fi | |
9fc24981 | 709 | ;; |
69a6ec55 | 710 | |
9fc24981 MT |
711 | --interactive) |
712 | interactive="true" | |
449f2879 MT |
713 | |
714 | # Use the actual value of $TERM | |
715 | environ+=( | |
716 | [TERM]="${TERM}" | |
717 | ) | |
9fc24981 | 718 | ;; |
fcbe8019 | 719 | |
91942800 MT |
720 | --network) |
721 | network="true" | |
07f6a51a MT |
722 | |
723 | # Export the proxy configuration | |
724 | environ+=( | |
725 | [https_proxy]="${https_proxy}" | |
726 | [http_proxy]="${http_proxy}" | |
727 | ) | |
91942800 MT |
728 | ;; |
729 | ||
9fc24981 MT |
730 | --timer=*) |
731 | timer="${1#--timer=}" | |
732 | ;; | |
fcbe8019 | 733 | |
9fc24981 MT |
734 | -*) |
735 | echo "Unknown argument: ${1}" >&2 | |
736 | return 2 | |
737 | ;; | |
28fa6877 | 738 | |
9fc24981 MT |
739 | # Parse any custom environment variables |
740 | *=*) | |
449f2879 | 741 | environ["${1%=*}"]="${1#*=}" |
9fc24981 | 742 | ;; |
28fa6877 | 743 | |
9fc24981 MT |
744 | # The rest is the command |
745 | *) | |
746 | command+=( "$@" ) | |
747 | break | |
748 | ;; | |
749 | esac | |
750 | shift | |
751 | done | |
752 | ||
9fc24981 MT |
753 | # Prepend any custom changes to PATH |
754 | if [ -n "${CUSTOM_PATH}" ]; then | |
449f2879 | 755 | environ[PATH]="${CUSTOM_PATH}:${environ[PATH]}" |
9fc24981 MT |
756 | fi |
757 | ||
449f2879 MT |
758 | # Setup QEMU |
759 | if qemu_is_required; then | |
760 | environ+=( | |
761 | [QEMU_TARGET_HELPER]="${QEMU_TARGET_HELPER}" | |
28fa6877 | 762 | |
449f2879 MT |
763 | # Enable QEMU strace |
764 | #[QEMU_STRACE]="1" | |
765 | ) | |
9fc24981 | 766 | |
449f2879 MT |
767 | case "${BUILD_ARCH}" in |
768 | arm*) | |
769 | environ+=( | |
770 | [QEMU_CPU]="${QEMU_CPU:-cortex-a9}" | |
771 | ) | |
772 | ;; | |
9fc24981 | 773 | |
449f2879 MT |
774 | riscv64) |
775 | environ+=( | |
776 | [QEMU_CPU]="${QEMU_CPU:-sifive-u54}" | |
9fc24981 | 777 | |
449f2879 MT |
778 | # Bug fix for QEMU locking up |
779 | [G_SLICE]="always-malloc" | |
780 | ) | |
781 | ;; | |
782 | esac | |
783 | fi | |
9fc24981 | 784 | |
91942800 MT |
785 | # Network |
786 | if [ "${network}" = "false" ]; then | |
787 | unshare+=( "--net" ) | |
788 | fi | |
789 | ||
449f2879 MT |
790 | local execute=() |
791 | local env | |
9fc24981 | 792 | |
449f2879 | 793 | # Create new namespaces |
ba844d1d MT |
794 | if [ "${#unshare[@]}" -gt 0 ]; then |
795 | execute+=( | |
796 | "unshare" "${unshare[@]}" | |
797 | ) | |
798 | fi | |
28fa6877 | 799 | |
f5160566 MT |
800 | # Call a setup script in the new namespaces to perform |
801 | # further set up, but before we change root. | |
802 | execute+=( "${BASEDIR}/tools/execute.sh" ) | |
803 | ||
449f2879 MT |
804 | # Run in chroot? |
805 | if [ "${chroot}" = "true" ]; then | |
806 | execute+=( "chroot" "${BUILD_DIR}" ) | |
807 | fi | |
3a272cfe | 808 | |
1090b297 MT |
809 | # Set PATH so that we can find the env binary |
810 | local PATH="${environ[PATH]}:${PATH}" | |
811 | ||
449f2879 MT |
812 | # Reset the environment |
813 | execute+=( | |
814 | "env" | |
fcbe8019 | 815 | |
449f2879 MT |
816 | # Clear the previous environment |
817 | "--ignore-environment" | |
fcbe8019 | 818 | |
eba9f280 MT |
819 | # Change to the home directory |
820 | --chdir="${environ[HOME]}" | |
28fa6877 MT |
821 | ) |
822 | ||
449f2879 MT |
823 | # Export the environment |
824 | for env in ${!environ[@]}; do | |
825 | execute+=( "${env}=${environ[${env}]}" ) | |
826 | done | |
9fc24981 | 827 | |
449f2879 MT |
828 | # Append the command |
829 | execute+=( "${command[@]}" ) | |
fcbe8019 | 830 | |
59e07d4b MT |
831 | local pid |
832 | ||
2e90be3e MT |
833 | # Return code |
834 | local r=0 | |
835 | ||
836 | # Store the start time | |
837 | local t="${SECONDS}" | |
838 | ||
9fc24981 MT |
839 | # Run the command in the background and pipe all output to the logfile |
840 | case "${interactive}" in | |
841 | true) | |
449f2879 | 842 | "${execute[@]}" || return $? |
b55434ff | 843 | ;; |
b55434ff | 844 | |
9fc24981 MT |
845 | false) |
846 | # Launch the timer if needed | |
847 | if [ -n "${timer}" ]; then | |
848 | launch_timer | |
849 | fi | |
b55434ff | 850 | |
9fc24981 MT |
851 | # Dispatch the command to the background |
852 | { | |
449f2879 | 853 | "${execute[@]}" >> "${LOGFILE}" 2>&1 </dev/null |
9fc24981 | 854 | } & |
b55434ff | 855 | |
59e07d4b MT |
856 | # Store the PID |
857 | pid="$!" | |
858 | ||
9fc24981 MT |
859 | # Wait for the process to complete |
860 | while :; do | |
59e07d4b | 861 | wait "${pid}" |
9fc24981 MT |
862 | |
863 | # Store the return code | |
864 | r="$?" | |
865 | ||
a44e11e8 MT |
866 | case "${r}" in |
867 | # Code means that we have received SIGUSR1 from the timer | |
868 | 138) | |
869 | # Call the timer callback | |
870 | if [ -n "${timer}" ]; then | |
871 | "${timer}" | |
872 | fi | |
873 | ||
874 | # Go back and wait | |
875 | continue | |
876 | ;; | |
5e45d49e MT |
877 | |
878 | # Ignore SIGWINCH | |
879 | 156) | |
880 | continue | |
881 | ;; | |
a44e11e8 | 882 | esac |
9fc24981 MT |
883 | |
884 | break | |
885 | done | |
886 | ||
887 | # Call the timer callback at least once | |
888 | if [ -n "${timer}" ]; then | |
889 | "${timer}" | |
0754f99f | 890 | fi |
0754f99f | 891 | esac |
2e90be3e MT |
892 | |
893 | return "${r}" | |
69a6ec55 MT |
894 | } |
895 | ||
9fc24981 MT |
896 | # Calls the makefile of a package |
897 | make_pkg() { | |
898 | local args=() | |
899 | local pkg | |
900 | ||
eba9f280 MT |
901 | local basedir="${BASEDIR}" |
902 | ||
9fc24981 MT |
903 | while [ $# -gt 0 ]; do |
904 | local arg="${1}" | |
905 | shift | |
906 | ||
907 | case "${arg}" in | |
908 | --*) | |
eba9f280 MT |
909 | case "${arg}" in |
910 | --chroot) | |
911 | basedir="/usr/src" | |
912 | ;; | |
913 | esac | |
914 | ||
9fc24981 MT |
915 | args+=( "${arg}" ) |
916 | ;; | |
917 | ||
918 | *) | |
919 | pkg="${arg}" | |
920 | break | |
921 | ;; | |
922 | esac | |
923 | done | |
924 | ||
925 | # Execute the make command in the environment | |
eba9f280 | 926 | execute "${args[@]}" make --directory="${basedir}/lfs" --file="${pkg}" "$@" |
9fc24981 MT |
927 | } |
928 | ||
929 | lfsmake1() { | |
930 | local pkg="${1}" | |
931 | shift | |
932 | ||
933 | # Run the common check | |
934 | lfsmakecommoncheck "${pkg}" "$@" | |
935 | [ $? == 1 ] && return 0 | |
936 | ||
dd813c6b | 937 | # Download source outside of the toolchain |
07358a9f | 938 | if ! make_pkg --network "${pkg}" download "$@"; then |
dd813c6b MT |
939 | exiterror "Downloading ${pkg}" |
940 | fi | |
941 | ||
df7d6c99 | 942 | if ! make_pkg --timer="update_runtime" "${pkg}" TOOLCHAIN=1 ROOT="${BUILD_DIR}" b2 install "$@"; then |
9fc24981 MT |
943 | print_status FAIL |
944 | ||
945 | exiterror "Building ${pkg}" | |
946 | fi | |
947 | ||
948 | print_status DONE | |
949 | } | |
950 | ||
fcbe8019 MT |
951 | lfsmake2() { |
952 | local pkg="${1}" | |
a061f9a5 | 953 | shift |
69a6ec55 | 954 | |
2bf48a73 | 955 | # Run the common check |
a061f9a5 | 956 | lfsmakecommoncheck "${pkg}" "$@" |
2bf48a73 MT |
957 | [ $? == 1 ] && return 0 |
958 | ||
84dc5631 | 959 | # Download source outside of the toolchain |
07358a9f | 960 | if ! make_pkg --network "${pkg}" download "$@"; then |
84dc5631 MT |
961 | exiterror "Downloading ${pkg}" |
962 | fi | |
963 | ||
fcbe8019 | 964 | # Run install on the package |
50f8a139 | 965 | if ! make_pkg --chroot --timer="update_runtime" "${pkg}" b2 install "$@"; then |
9fc24981 MT |
966 | print_status FAIL |
967 | ||
fcbe8019 | 968 | exiterror "Building ${pkg}" |
f9783277 | 969 | fi |
9fc24981 MT |
970 | |
971 | print_status DONE | |
fcbe8019 | 972 | } |
69a6ec55 | 973 | |
fcbe8019 MT |
974 | ipfiredist() { |
975 | local pkg="${1}" | |
a061f9a5 | 976 | shift |
fcbe8019 | 977 | |
2bf48a73 | 978 | # Run the common check |
a061f9a5 | 979 | lfsmakecommoncheck "${pkg}" "$@" |
2bf48a73 MT |
980 | [ $? == 1 ] && return 0 |
981 | ||
fcbe8019 | 982 | # Run dist on the package |
9fc24981 MT |
983 | if ! make_pkg --chroot --timer="update_runtime" "${pkg}" dist "$@"; then |
984 | print_status FAIL | |
f9783277 | 985 | |
9fc24981 | 986 | exiterror "Packaging ${pkg}" |
69a6ec55 | 987 | fi |
f9783277 | 988 | |
9fc24981 MT |
989 | print_status DONE |
990 | } | |
f9783277 | 991 | |
9fc24981 MT |
992 | update_runtime() { |
993 | print_runtime "$(( SECONDS - t ))" | |
69a6ec55 MT |
994 | } |
995 | ||
69a6ec55 MT |
996 | qemu_is_required() { |
997 | local build_arch="${1}" | |
998 | ||
999 | if [ -z "${build_arch}" ]; then | |
1000 | build_arch="${BUILD_ARCH}" | |
1001 | fi | |
1002 | ||
1003 | case "${HOST_ARCH},${build_arch}" in | |
161eb15d | 1004 | x86_64,arm*|x86_64,aarch64|x86_64,riscv64|i?86,arm*|i?86,aarch64|i?86,x86_64) |
69a6ec55 MT |
1005 | return 0 |
1006 | ;; | |
1007 | *) | |
1008 | return 1 | |
1009 | ;; | |
1010 | esac | |
1011 | } | |
1012 | ||
1013 | qemu_install_helper() { | |
1014 | # Do nothing, if qemu is not required | |
1015 | if ! qemu_is_required; then | |
1016 | return 0 | |
1017 | fi | |
1018 | ||
1019 | if [ ! -e /proc/sys/fs/binfmt_misc/status ]; then | |
1020 | exiterror "binfmt_misc not mounted. QEMU_TARGET_HELPER not useable." | |
1021 | fi | |
1022 | ||
1023 | if [ ! $(cat /proc/sys/fs/binfmt_misc/status) = 'enabled' ]; then | |
1024 | exiterror "binfmt_misc not enabled. QEMU_TARGET_HELPER not useable." | |
1025 | fi | |
1026 | ||
27d0a2c4 MT |
1027 | # Search for the helper binary |
1028 | local qemu_build_helper="$(qemu_find_build_helper_name "${BUILD_ARCH}")" | |
69a6ec55 MT |
1029 | |
1030 | # Try to find a suitable binary that we can install | |
1031 | # to the build environment. | |
1032 | local file | |
27d0a2c4 | 1033 | for file in "${qemu_build_helper}" "${qemu_build_helper}-static"; do |
69a6ec55 MT |
1034 | # file must exist and be executable. |
1035 | [ -x "${file}" ] || continue | |
1036 | ||
1037 | # Must be static. | |
1038 | file_is_static "${file}" || continue | |
1039 | ||
4fd413a1 | 1040 | local dirname="${BUILD_DIR}$(dirname "${file}")" |
69a6ec55 MT |
1041 | mkdir -p "${dirname}" |
1042 | ||
5db99637 | 1043 | # Create the mountpoint |
75493bbc | 1044 | touch "${BUILD_DIR}${file}" |
5db99637 | 1045 | |
27d0a2c4 | 1046 | # Mount the helper |
75493bbc MT |
1047 | if ! mount --bind -o ro "${file}" "${BUILD_DIR}${file}"; then |
1048 | exiterror "Could not mount ${file}" | |
27d0a2c4 MT |
1049 | fi |
1050 | ||
1051 | # Set | |
1052 | QEMU_TARGET_HELPER="${file}" | |
1053 | ||
69a6ec55 MT |
1054 | return 0 |
1055 | done | |
1056 | ||
27d0a2c4 | 1057 | exiterror "Could not find a statically-linked QEMU emulator: ${qemu_build_helper}" |
69a6ec55 MT |
1058 | } |
1059 | ||
1060 | qemu_find_build_helper_name() { | |
1061 | local build_arch="${1}" | |
1062 | ||
1063 | local magic | |
1064 | case "${build_arch}" in | |
0db0f7fa AF |
1065 | aarch64) |
1066 | magic="7f454c460201010000000000000000000200b700" | |
1067 | ;; | |
4576ca4c MT |
1068 | arm*) |
1069 | magic="7f454c4601010100000000000000000002002800" | |
1070 | ;; | |
161eb15d MT |
1071 | riscv64) |
1072 | magic="7f454c460201010000000000000000000200f300" | |
1073 | ;; | |
69a6ec55 MT |
1074 | x86_64) |
1075 | magic="7f454c4602010100000000000000000002003e00" | |
1076 | ;; | |
1077 | esac | |
1078 | ||
1079 | [ -z "${magic}" ] && return 1 | |
1080 | ||
1081 | local file | |
1082 | for file in /proc/sys/fs/binfmt_misc/*; do | |
1083 | # skip write only register entry | |
1084 | [ $(basename "${file}") = "register" ] && continue | |
1085 | # Search for the file with the correct magic value. | |
1086 | grep -qE "^magic ${magic}$" "${file}" || continue | |
1087 | ||
1088 | local interpreter="$(grep "^interpreter" "${file}" | awk '{ print $2 }')" | |
1089 | ||
1090 | [ -n "${interpreter}" ] || continue | |
1091 | [ "${interpreter:0:1}" = "/" ] || continue | |
1092 | [ -x "${interpreter}" ] || continue | |
1093 | ||
1094 | echo "${interpreter}" | |
1095 | return 0 | |
1096 | done | |
1097 | ||
1098 | return 1 | |
1099 | } | |
1100 | ||
1101 | file_is_static() { | |
1102 | local file="${1}" | |
1103 | ||
1985774f | 1104 | file -L "${file}" 2>/dev/null | grep -q -e "statically linked" -e "static-pie linked" |
69a6ec55 MT |
1105 | } |
1106 | ||
1107 | update_language_list() { | |
1108 | local path="${1}" | |
1109 | ||
1110 | local lang | |
1111 | for lang in ${path}/*.po; do | |
1112 | lang="$(basename "${lang}")" | |
1113 | echo "${lang%*.po}" | |
1114 | done | sort -u > "${path}/LINGUAS" | |
1115 | } | |
1116 | ||
1fb7f56e MT |
1117 | contributors() { |
1118 | local commits name | |
1119 | ||
1120 | git shortlog --summary --numbered | while read -r commits name; do | |
1121 | echo "${name}" | |
1122 | done | grep -vE -e "^(alpha197|morlix|root|ummeegge)$" -e "via Development$" -e "@" -e "#$" | |
1123 | } | |
1124 | ||
1125 | update_contributors() { | |
1126 | echo -n "Updating list of contributors" | |
1127 | ||
1128 | local contributors="$(contributors | paste -sd , - | sed -e "s/,/&\\\\n/g")" | |
1129 | ||
1130 | # Edit contributors into credits.cgi | |
e2338aa7 MT |
1131 | local tmp="$(mktemp)" |
1132 | ||
1133 | awk "/<!-- CONTRIBUTORS -->/{ p=1; print; printf \"${contributors}\n\"}/<!-- END -->/{ p=0 } !p" \ | |
1134 | < "${BASEDIR}/html/cgi-bin/credits.cgi" > "${tmp}" | |
1135 | ||
1136 | # Copy back modified content | |
1137 | cat "${tmp}" > "${BASEDIR}/html/cgi-bin/credits.cgi" | |
1138 | unlink "${tmp}" | |
1fb7f56e MT |
1139 | |
1140 | print_status DONE | |
1141 | return 0 | |
1142 | } | |
1143 | ||
e2e0d087 MT |
1144 | # Download sources |
1145 | download_sources() { | |
1146 | local file | |
1147 | local pkg | |
1148 | ||
cf4b9118 | 1149 | local failed_packages=() |
e2e0d087 MT |
1150 | |
1151 | # Walk through all files in LFS | |
1152 | for file in "${BASEDIR}/lfs/"*; do | |
1153 | pkg="${file##*/}" | |
1154 | ||
1155 | # Skip some packages | |
1156 | case "${pkg}" in | |
1157 | Config) | |
1158 | continue | |
1159 | ;; | |
1160 | esac | |
1161 | ||
1162 | # Run the common check | |
1163 | lfsmakecommoncheck "${pkg}" | |
1164 | [ $? == 1 ] && continue | |
1165 | ||
1166 | # Download and check the package | |
07358a9f | 1167 | if ! make_pkg --network "${pkg}" download b2; then |
cf4b9118 | 1168 | failed_packages+=( "${pkg}" ) |
560b9ecc | 1169 | print_status FAIL |
560b9ecc | 1170 | continue |
e2e0d087 | 1171 | fi |
560b9ecc MT |
1172 | |
1173 | print_status DONE | |
e2e0d087 MT |
1174 | done |
1175 | ||
cf4b9118 MT |
1176 | # Fail if we could not download/verify all packages |
1177 | if [ "${#failed_packages[@]}" -gt 0 ]; then | |
1178 | exiterror "Failed to download or verify some packages: ${failed_packages[@]}" | |
1179 | fi | |
e2e0d087 MT |
1180 | } |
1181 | ||
baf15b60 MT |
1182 | # Download the toolchain |
1183 | download_toolchain() { | |
1184 | local toolchain="${1}" | |
1185 | ||
1186 | # Do nothing if the toolchain has already been downloaded | |
1187 | if [ -e "${TOOLCHAIN_DIR}/${toolchain}" ]; then | |
1188 | return 0 | |
1189 | fi | |
1190 | ||
1191 | # Ensure the directory exists | |
1192 | mkdir -p "${TOOLCHAIN_DIR}" | |
1193 | ||
1194 | # Create a temporary directory | |
1195 | local tmp="$(mktemp -d)" | |
1196 | ||
1197 | # Make the name for the checksum file | |
1198 | local checksums="${toolchain/.tar.zst/.b2}" | |
1199 | ||
1200 | # Download the toolchain and checksum files | |
1201 | if ! wget --quiet --directory-prefix="${tmp}" \ | |
1202 | "${TOOLCHAIN_URL}/${toolchain}" \ | |
1203 | "${TOOLCHAIN_URL}/${checksums}"; then | |
1204 | # Cleanup | |
1205 | rm -rf "${tmp}" | |
1206 | ||
1207 | return 1 | |
1208 | fi | |
1209 | ||
1210 | # Check integrity | |
54d59f56 | 1211 | if ! cd "${tmp}" && b2sum --quiet --check "${checksums}"; then |
baf15b60 MT |
1212 | # Cleanup |
1213 | rm -rf "${tmp}" | |
1214 | ||
1215 | return 1 | |
1216 | fi | |
1217 | ||
1218 | # Everything is good, move the files to their destination | |
1219 | if ! mv \ | |
1220 | "${tmp}/${toolchain}" \ | |
1221 | "${tmp}/${checksums}" \ | |
1222 | "${TOOLCHAIN_DIR}"; then | |
1223 | # Cleanup | |
1224 | rm -rf "${tmp}" | |
1225 | ||
1226 | return 1 | |
1227 | fi | |
1228 | ||
1229 | # Cleanup | |
1230 | rm -rf "${tmp}" | |
1231 | ||
1232 | return 0 | |
1233 | } | |
1234 | ||
cf4652d6 MT |
1235 | # Extracts the toolchain |
1236 | extract_toolchain() { | |
1237 | local toolchain="${1}" | |
1238 | ||
1239 | local build_dir="${BUILD_DIR#${BASEDIR}/}" | |
1240 | local log_dir="${LOG_DIR#${BASEDIR}/}" | |
1241 | ||
1242 | local args=( | |
1243 | # Extract | |
1244 | "ax" | |
1245 | ||
1246 | # The file to extract | |
baf15b60 | 1247 | "-f" "${TOOLCHAIN_DIR}/${toolchain}" |
cf4652d6 MT |
1248 | |
1249 | # The destination | |
1250 | "-C" "${BASEDIR}" | |
1251 | ||
1252 | # Transform any older toolchains | |
1253 | "--transform" "s@^build/@${build_dir}/@" | |
1254 | "--transform" "s@^log/@${log_dir}/@" | |
1255 | ) | |
1256 | ||
1257 | # Extract the toolchain | |
1258 | tar "${args[@]}" || return $? | |
1259 | } | |
1260 | ||
3db20d6f MT |
1261 | # Compresses the toolchain |
1262 | compress_toolchain() { | |
1263 | local toolchain="${1}" | |
1264 | ||
1265 | log "Creating toolchain image for ${BUILD_ARCH}" | |
1266 | ||
1267 | # Create a temporary directory | |
1268 | local tmp="$(mktemp -d)" | |
1269 | ||
1270 | # Make the name for the checksum file | |
1271 | local checksums="${toolchain/.tar.zst/.b2}" | |
1272 | ||
1273 | local build_dir="${BUILD_DIR#${BASEDIR}/}" | |
1274 | local log_dir="${LOG_DIR#${BASEDIR}/}" | |
1275 | ||
1276 | local args=( | |
1277 | "--create" | |
1278 | ||
1279 | # Filter through zstd with custom options | |
b1cf1d9c | 1280 | "-I" "zstd ${ZSTD_OPT[*]}" |
3db20d6f MT |
1281 | |
1282 | # Write to the temporary directory | |
1283 | "-f" "${tmp}/${toolchain}" | |
1284 | ||
1285 | # Start in the base directory | |
1286 | "-C" "${BASEDIR}" | |
1287 | ||
1288 | # Exclude the build logs | |
1289 | "--exclude" "${log_dir}/_build.*.log" | |
1290 | ||
1291 | # Include /bin/sh | |
1292 | "${build_dir}/bin/sh" | |
1293 | ||
1294 | # Include the /tools_${BUILD_ARCH} directory | |
1295 | "${build_dir}/${TOOLS_DIR}" | |
1296 | ||
1297 | # Include the log directory | |
1298 | "${log_dir}" | |
1299 | ) | |
1300 | ||
1301 | # Create the archive | |
1302 | if ! tar "${args[@]}"; then | |
1303 | # Cleanup | |
1304 | rm -rf "${tmp}" | |
1305 | ||
1306 | return 1 | |
1307 | fi | |
1308 | ||
63faf359 MT |
1309 | # Change to the temporary directory |
1310 | pushd "${tmp}" &>/dev/null | |
1311 | ||
3db20d6f | 1312 | # Create the checksums |
63faf359 MT |
1313 | if ! b2sum "${toolchain}" > "${tmp}/${checksums}"; then |
1314 | popd &>/dev/null | |
1315 | ||
3db20d6f MT |
1316 | # Cleanup |
1317 | rm -rf "${tmp}" | |
1318 | ||
1319 | return 1 | |
1320 | fi | |
1321 | ||
63faf359 MT |
1322 | popd &>/dev/null |
1323 | ||
3db20d6f MT |
1324 | # Everything is good, move the files to their destination |
1325 | if ! mv \ | |
1326 | "${tmp}/${toolchain}" \ | |
1327 | "${tmp}/${checksums}" \ | |
1328 | "${TOOLCHAIN_DIR}"; then | |
1329 | # Cleanup | |
1330 | rm -rf "${tmp}" | |
1331 | ||
1332 | return 1 | |
1333 | fi | |
1334 | ||
1335 | return 0 | |
1336 | } | |
1337 | ||
1338 | build_toolchain() { | |
69a6ec55 MT |
1339 | local gcc=$(type -p gcc) |
1340 | if [ -z "${gcc}" ]; then | |
1341 | exiterror "Could not find GCC. You will need a working build enviroment in order to build the toolchain." | |
1342 | fi | |
1343 | ||
6bd3a131 MT |
1344 | # Check ${TOOLS_DIR} symlink |
1345 | if [ -h "${TOOLS_DIR}" ]; then | |
1346 | rm -f "${TOOLS_DIR}" | |
1347 | fi | |
1348 | ||
1349 | if [ ! -e "${TOOLS_DIR}" ]; then | |
829f2b46 | 1350 | ln -s "${BUILD_DIR}${TOOLS_DIR}" "${TOOLS_DIR}" |
6bd3a131 MT |
1351 | fi |
1352 | ||
1353 | if [ ! -h "${TOOLS_DIR}" ]; then | |
1354 | exiterror "Could not create ${TOOLS_DIR} symbolic link" | |
1355 | fi | |
1356 | ||
79ea5921 | 1357 | local LOGFILE="${LOG_DIR}/_build.toolchain.log" |
69a6ec55 MT |
1358 | |
1359 | lfsmake1 stage1 | |
69a6ec55 MT |
1360 | lfsmake1 binutils PASS=1 |
1361 | lfsmake1 gcc PASS=1 | |
9db251ee | 1362 | lfsmake1 linux HEADERS=1 |
69a6ec55 | 1363 | lfsmake1 glibc |
178c7a6a | 1364 | lfsmake1 libxcrypt |
69a6ec55 | 1365 | lfsmake1 gcc PASS=L |
c4a21542 | 1366 | lfsmake1 zlib-ng |
7d14c775 MT |
1367 | lfsmake1 binutils PASS=2 |
1368 | lfsmake1 gcc PASS=2 | |
0250d332 | 1369 | lfsmake1 zstd |
74ee1c7a | 1370 | lfsmake1 ccache |
69a6ec55 MT |
1371 | lfsmake1 tcl |
1372 | lfsmake1 expect | |
1373 | lfsmake1 dejagnu | |
1374 | lfsmake1 pkg-config | |
1375 | lfsmake1 ncurses | |
1376 | lfsmake1 bash | |
1377 | lfsmake1 bzip2 | |
1378 | lfsmake1 automake | |
1379 | lfsmake1 coreutils | |
1380 | lfsmake1 diffutils | |
1381 | lfsmake1 findutils | |
1382 | lfsmake1 gawk | |
1383 | lfsmake1 gettext | |
1384 | lfsmake1 grep | |
1385 | lfsmake1 gzip | |
1386 | lfsmake1 m4 | |
1387 | lfsmake1 make | |
1388 | lfsmake1 patch | |
1389 | lfsmake1 perl | |
46bbc13b | 1390 | lfsmake1 python3 |
69a6ec55 MT |
1391 | lfsmake1 sed |
1392 | lfsmake1 tar | |
1393 | lfsmake1 texinfo | |
1394 | lfsmake1 xz | |
85439ac7 | 1395 | lfsmake1 bison |
11b5e5cb | 1396 | lfsmake1 flex |
69a6ec55 | 1397 | lfsmake1 fake-environ |
0ce11c68 | 1398 | CUSTOM_PATH="${PATH}" lfsmake1 strip |
69a6ec55 | 1399 | lfsmake1 cleanup-toolchain |
df5e82b3 MT |
1400 | } |
1401 | ||
513814ab MT |
1402 | build_system() { |
1403 | local LOGFILE="${LOG_DIR}/_build.${SNAME}.log" | |
49714ec4 | 1404 | |
69a6ec55 | 1405 | lfsmake2 stage2 |
9db251ee | 1406 | lfsmake2 linux HEADERS=1 |
69a6ec55 MT |
1407 | lfsmake2 man-pages |
1408 | lfsmake2 glibc | |
1409 | lfsmake2 tzdata | |
1410 | lfsmake2 cleanup-toolchain | |
c4a21542 | 1411 | lfsmake2 zlib-ng |
b2af45b2 | 1412 | [ "${BUILD_ARCH}" = "riscv64" ] && lfsmake2 gcc PASS=A |
8fa66ce7 | 1413 | lfsmake2 zstd |
cf6c8e67 | 1414 | lfsmake2 autoconf |
79ed9095 | 1415 | lfsmake2 autoconf-archive |
cf6c8e67 | 1416 | lfsmake2 automake |
37f48533 | 1417 | lfsmake2 help2man |
cf6c8e67 | 1418 | lfsmake2 libtool |
69a6ec55 MT |
1419 | lfsmake2 binutils |
1420 | lfsmake2 gmp | |
69a6ec55 MT |
1421 | lfsmake2 mpfr |
1422 | lfsmake2 libmpc | |
7cb00d0a | 1423 | lfsmake2 pkg-config |
cf6c8e67 | 1424 | lfsmake2 libxcrypt |
69a6ec55 MT |
1425 | lfsmake2 file |
1426 | lfsmake2 gcc | |
e38fb3f6 MT |
1427 | lfsmake2 attr |
1428 | lfsmake2 acl | |
69a6ec55 | 1429 | lfsmake2 sed |
69a6ec55 MT |
1430 | lfsmake2 berkeley |
1431 | lfsmake2 coreutils | |
1432 | lfsmake2 iana-etc | |
1433 | lfsmake2 m4 | |
1434 | lfsmake2 bison | |
69a6ec55 | 1435 | lfsmake2 ncurses |
69a6ec55 MT |
1436 | lfsmake2 perl |
1437 | lfsmake2 readline | |
69a6ec55 | 1438 | lfsmake2 bzip2 |
3ece7859 | 1439 | lfsmake2 xz |
f407f05a | 1440 | lfsmake2 lzip |
69a6ec55 | 1441 | lfsmake2 pcre |
b0c37190 | 1442 | lfsmake2 pcre2 |
d701756a | 1443 | lfsmake2 gettext |
69a6ec55 MT |
1444 | lfsmake2 bash |
1445 | lfsmake2 diffutils | |
69a6ec55 MT |
1446 | lfsmake2 ed |
1447 | lfsmake2 findutils | |
1448 | lfsmake2 flex | |
1449 | lfsmake2 gawk | |
d2315d00 | 1450 | lfsmake2 go |
69a6ec55 MT |
1451 | lfsmake2 grep |
1452 | lfsmake2 groff | |
1453 | lfsmake2 gperf | |
1454 | lfsmake2 gzip | |
1455 | lfsmake2 hostname | |
ac36f9f2 | 1456 | lfsmake2 whois |
69a6ec55 MT |
1457 | lfsmake2 kbd |
1458 | lfsmake2 less | |
50992c73 | 1459 | lfsmake2 procps |
69a6ec55 | 1460 | lfsmake2 make |
908a25c6 | 1461 | lfsmake2 libpipeline |
69a6ec55 | 1462 | lfsmake2 man |
69a6ec55 MT |
1463 | lfsmake2 net-tools |
1464 | lfsmake2 patch | |
1465 | lfsmake2 psmisc | |
1466 | lfsmake2 shadow | |
1467 | lfsmake2 sysklogd | |
1468 | lfsmake2 sysvinit | |
1469 | lfsmake2 tar | |
1470 | lfsmake2 texinfo | |
1471 | lfsmake2 util-linux | |
69a6ec55 | 1472 | lfsmake2 vim |
69b3d63b | 1473 | lfsmake2 e2fsprogs |
c9fb8808 | 1474 | lfsmake2 jq |
ce2cea17 MT |
1475 | lfsmake2 configroot |
1476 | lfsmake2 initscripts | |
1477 | lfsmake2 backup | |
1478 | lfsmake2 rust | |
1479 | lfsmake2 openssl | |
1480 | lfsmake2 popt | |
1481 | lfsmake2 libedit | |
bd1a3ad8 AB |
1482 | lfsmake2 expat |
1483 | lfsmake2 libffi | |
1484 | lfsmake2 gdbm | |
1485 | lfsmake2 sqlite | |
1486 | lfsmake2 python3 | |
1487 | lfsmake2 python3-setuptools | |
1488 | lfsmake2 ninja | |
1489 | lfsmake2 meson | |
ce2cea17 MT |
1490 | lfsmake2 pam |
1491 | lfsmake2 libcap | |
1492 | lfsmake2 libcap-ng | |
1493 | lfsmake2 libpcap | |
1494 | lfsmake2 ppp | |
1495 | lfsmake2 pptp | |
1496 | lfsmake2 unzip | |
1497 | lfsmake2 which | |
1498 | lfsmake2 bc | |
1499 | lfsmake2 cpio | |
1500 | lfsmake2 libaio | |
1501 | lfsmake2 freetype | |
1502 | lfsmake2 libmnl | |
1503 | lfsmake2 libnfnetlink | |
1504 | lfsmake2 libnetfilter_queue | |
1505 | lfsmake2 libnetfilter_conntrack | |
1506 | lfsmake2 libnetfilter_cthelper | |
1507 | lfsmake2 libnetfilter_cttimeout | |
1508 | lfsmake2 iptables | |
1509 | lfsmake2 iproute2 | |
1510 | lfsmake2 screen | |
1511 | lfsmake2 elfutils | |
ce2cea17 MT |
1512 | lfsmake2 libconfig |
1513 | lfsmake2 curl | |
1514 | lfsmake2 libarchive | |
1515 | lfsmake2 cmake | |
1516 | lfsmake2 json-c | |
1517 | lfsmake2 tcl | |
ce2cea17 MT |
1518 | lfsmake2 python3-MarkupSafe |
1519 | lfsmake2 python3-Jinja2 | |
ce2cea17 MT |
1520 | lfsmake2 kmod |
1521 | lfsmake2 udev | |
1522 | lfsmake2 libusb | |
1523 | lfsmake2 mdadm | |
1524 | lfsmake2 dracut | |
1525 | lfsmake2 lvm2 | |
1526 | lfsmake2 multipath-tools | |
1527 | lfsmake2 glib | |
1528 | lfsmake2 libgudev | |
1529 | lfsmake2 libgpg-error | |
1530 | lfsmake2 libgcrypt | |
1531 | lfsmake2 libassuan | |
1532 | lfsmake2 nettle | |
1533 | lfsmake2 libsodium | |
1534 | lfsmake2 libevent2 | |
1535 | lfsmake2 apr | |
1536 | lfsmake2 aprutil | |
1537 | lfsmake2 unbound | |
1538 | lfsmake2 gnutls | |
1539 | lfsmake2 libuv | |
9d58c441 | 1540 | lfsmake2 liburcu |
ce2cea17 MT |
1541 | lfsmake2 bind |
1542 | lfsmake2 dhcp | |
1543 | lfsmake2 dhcpcd | |
1544 | lfsmake2 boost | |
1545 | lfsmake2 linux-atm | |
1546 | lfsmake2 libqmi | |
1547 | lfsmake2 c-ares | |
1548 | lfsmake2 rust-dissimilar | |
1549 | lfsmake2 rust-cfg-if | |
1550 | lfsmake2 rust-libc | |
1551 | lfsmake2 rust-getrandom | |
1552 | lfsmake2 rust-typenum | |
1553 | lfsmake2 rust-version-check | |
1554 | lfsmake2 rust-generic-array | |
1555 | lfsmake2 rust-crypto-common | |
1556 | lfsmake2 rust-cipher | |
1557 | lfsmake2 rust-hex | |
1558 | lfsmake2 rust-unicode-xid | |
2491a837 | 1559 | lfsmake2 rust-unicode-ident |
ce2cea17 MT |
1560 | lfsmake2 rust-proc-macro2 |
1561 | lfsmake2 rust-quote | |
2491a837 | 1562 | lfsmake2 rust-syn-1.0.109 |
ce2cea17 MT |
1563 | lfsmake2 rust-syn |
1564 | lfsmake2 rust-home | |
1565 | lfsmake2 rust-lazy-static | |
1566 | lfsmake2 rust-memchr | |
1567 | lfsmake2 rust-aho-corasick | |
1568 | lfsmake2 rust-regex-syntax | |
1569 | lfsmake2 rust-regex | |
1570 | lfsmake2 rust-ucd-trie | |
1571 | lfsmake2 rust-pest | |
1572 | lfsmake2 rust-semver-parser | |
1573 | lfsmake2 rust-semver | |
1574 | lfsmake2 rust-same-file | |
1575 | lfsmake2 rust-walkdir | |
1576 | lfsmake2 rust-dirs | |
1577 | lfsmake2 rust-toolchain_find | |
2491a837 | 1578 | lfsmake2 rust-serde_derive |
ce2cea17 MT |
1579 | lfsmake2 rust-serde |
1580 | lfsmake2 rust-itoa | |
1581 | lfsmake2 rust-ryu | |
1582 | lfsmake2 rust-serde_json | |
1583 | lfsmake2 rust-synstructure | |
1584 | lfsmake2 rust-block-buffer | |
1585 | lfsmake2 rust-digest | |
1586 | lfsmake2 rust-ppv-lite86 | |
1587 | lfsmake2 rust-rand_core | |
1588 | lfsmake2 rust-rand_core-0.4.2 | |
1589 | lfsmake2 rust-rand_core-0.3.1 | |
1590 | lfsmake2 rust-rand_chacha | |
1591 | lfsmake2 rust-rand_hc | |
1592 | lfsmake2 rust-rand | |
1593 | lfsmake2 rust-rdrand | |
1594 | lfsmake2 rust-rand-0.4 | |
1595 | lfsmake2 rust-log | |
1596 | lfsmake2 rust-num_cpus | |
1597 | lfsmake2 rust-crossbeam-utils | |
1598 | lfsmake2 rust-autocfg | |
1599 | lfsmake2 rust-memoffset | |
1600 | lfsmake2 rust-scopeguard | |
1601 | lfsmake2 rust-crossbeam-epoch | |
1602 | lfsmake2 rust-crossbeam-deque | |
1603 | lfsmake2 rust-either | |
1604 | lfsmake2 rust-crossbeam-channel | |
1605 | lfsmake2 rust-rayon-core | |
1606 | lfsmake2 rust-rayon | |
1607 | lfsmake2 rust-remove_dir_all | |
1608 | lfsmake2 rust-tempdir | |
1609 | lfsmake2 rust-glob | |
1610 | lfsmake2 rust-once_cell | |
1611 | lfsmake2 rust-termcolor | |
2491a837 AB |
1612 | lfsmake2 rust-serde_spanned |
1613 | lfsmake2 rust-toml_datetime | |
1614 | lfsmake2 rust-equivalent | |
1615 | lfsmake2 rust-allocator-api2 | |
1616 | lfsmake2 rust-foldhash | |
1617 | lfsmake2 rust-hashbrown | |
1618 | lfsmake2 rust-indexmap | |
1619 | lfsmake2 rust-winnow | |
1620 | lfsmake2 rust-toml_edit | |
ce2cea17 | 1621 | lfsmake2 rust-toml |
2491a837 | 1622 | lfsmake2 rust-target-triple |
ce2cea17 MT |
1623 | lfsmake2 rust-trybuild |
1624 | lfsmake2 rust-unindent | |
1625 | lfsmake2 rust-proc-macro-hack | |
1626 | lfsmake2 rust-indoc-impl | |
2491a837 | 1627 | lfsmake2 rust-indoc-impl-0.3.6 |
ce2cea17 MT |
1628 | lfsmake2 rust-indoc |
1629 | lfsmake2 rust-indoc-0.3.6 | |
1630 | lfsmake2 rust-instant | |
1631 | lfsmake2 rust-lock_api | |
1632 | lfsmake2 rust-smallvec | |
1633 | lfsmake2 rust-parking_lot_core | |
1634 | lfsmake2 rust-parking_lot | |
1635 | lfsmake2 rust-paste-impl | |
1636 | lfsmake2 rust-paste | |
1637 | lfsmake2 rust-paste-0.1.18 | |
1638 | lfsmake2 rust-ctor | |
1639 | lfsmake2 rust-ghost | |
1640 | lfsmake2 rust-inventory-impl | |
1641 | lfsmake2 rust-inventory | |
1642 | lfsmake2 rust-pyo3-build-config | |
1643 | lfsmake2 rust-pyo3-macros-backend | |
1644 | lfsmake2 rust-pyo3-macros | |
1645 | lfsmake2 rust-pyo3 | |
1646 | lfsmake2 rust-num-traits | |
1647 | lfsmake2 rust-num-integer | |
1648 | lfsmake2 rust-num_threads | |
1649 | lfsmake2 rust-time | |
1650 | lfsmake2 rust-iana-time-zone | |
1651 | lfsmake2 rust-chrono | |
1652 | lfsmake2 rust-asn1_derive | |
1653 | lfsmake2 rust-asn1 | |
1654 | lfsmake2 rust-proc-macro-error-attr | |
1655 | lfsmake2 rust-proc-macro-error | |
1656 | lfsmake2 rust-Inflector | |
1657 | lfsmake2 rust-ouroboros_macro | |
1658 | lfsmake2 rust-aliasable | |
1659 | lfsmake2 rust-stable_deref_trait | |
1660 | lfsmake2 rust-ouroboros | |
1661 | lfsmake2 rust-base64 | |
1662 | lfsmake2 rust-pem | |
1663 | lfsmake2 gdb | |
1664 | lfsmake2 grub | |
1665 | lfsmake2 mandoc | |
1666 | lfsmake2 efivar | |
1667 | lfsmake2 efibootmgr | |
1668 | lfsmake2 libtasn1 | |
1669 | lfsmake2 p11-kit | |
1670 | lfsmake2 ca-certificates | |
1671 | lfsmake2 fireinfo | |
1672 | lfsmake2 libnet | |
1673 | lfsmake2 libnl-3 | |
137ce0bd | 1674 | lfsmake2 libidn2 |
ce2cea17 | 1675 | lfsmake2 nasm |
ce2cea17 | 1676 | lfsmake2 libexif |
c5d2db20 | 1677 | lfsmake2 libjpeg |
ce2cea17 | 1678 | lfsmake2 libpng |
ce2cea17 MT |
1679 | lfsmake2 gd |
1680 | lfsmake2 slang | |
1681 | lfsmake2 newt | |
1682 | lfsmake2 libsmooth | |
1683 | lfsmake2 pciutils | |
1684 | lfsmake2 usbutils | |
1685 | lfsmake2 libxml2 | |
1686 | lfsmake2 libxslt | |
1687 | lfsmake2 perl-BerkeleyDB | |
1688 | lfsmake2 cyrus-sasl | |
1689 | lfsmake2 openldap | |
1690 | lfsmake2 apache2 | |
1691 | lfsmake2 web-user-interface | |
1692 | lfsmake2 flag-icons | |
1693 | lfsmake2 jquery | |
1694 | lfsmake2 bootstrap | |
1695 | lfsmake2 arping | |
1696 | lfsmake2 beep | |
1697 | lfsmake2 libssh | |
1698 | lfsmake2 libinih | |
f8020292 | 1699 | lfsmake2 xorriso |
ce2cea17 MT |
1700 | lfsmake2 dosfstools |
1701 | lfsmake2 exfatprogs | |
1702 | lfsmake2 reiserfsprogs | |
ce2cea17 MT |
1703 | lfsmake2 xfsprogs |
1704 | lfsmake2 sysfsutils | |
1705 | lfsmake2 fuse | |
1706 | lfsmake2 ntfs-3g | |
1707 | lfsmake2 ethtool | |
1708 | lfsmake2 fcron | |
6c228fab | 1709 | lfsmake2 wireguard-tools |
ce2cea17 MT |
1710 | lfsmake2 perl-ExtUtils-PkgConfig |
1711 | lfsmake2 perl-GD | |
1712 | lfsmake2 perl-GD-Graph | |
1713 | lfsmake2 perl-GD-TextUtil | |
1714 | lfsmake2 perl-Device-SerialPort | |
1715 | lfsmake2 perl-Device-Modem | |
ce2cea17 MT |
1716 | lfsmake2 perl-Parse-Yapp |
1717 | lfsmake2 perl-Data-UUID | |
1718 | lfsmake2 perl-Try-Tiny | |
1719 | lfsmake2 perl-HTTP-Message | |
1720 | lfsmake2 perl-HTTP-Date | |
1721 | lfsmake2 gnupg | |
1722 | lfsmake2 hdparm | |
1723 | lfsmake2 whatmask | |
1724 | lfsmake2 libtirpc | |
1725 | lfsmake2 conntrack-tools | |
1726 | lfsmake2 iputils | |
1727 | lfsmake2 l7-protocols | |
1728 | lfsmake2 hwdata | |
1729 | lfsmake2 logrotate | |
1730 | lfsmake2 logwatch | |
1731 | lfsmake2 misc-progs | |
1732 | lfsmake2 nano | |
1733 | lfsmake2 perl-URI | |
1734 | lfsmake2 perl-CGI | |
1735 | lfsmake2 perl-Switch | |
1736 | lfsmake2 perl-HTML-Tagset | |
1737 | lfsmake2 perl-HTML-Parser | |
1738 | lfsmake2 perl-HTML-Template | |
ce2cea17 MT |
1739 | lfsmake2 perl-libwww |
1740 | lfsmake2 perl-LWP-Protocol-https | |
1741 | lfsmake2 perl-Net-HTTP | |
1742 | lfsmake2 perl-Net-DNS | |
1743 | lfsmake2 perl-Net-IPv4Addr | |
1744 | lfsmake2 perl-Net_SSLeay | |
1745 | lfsmake2 perl-IO-Stringy | |
1746 | lfsmake2 perl-IO-Socket-SSL | |
1747 | lfsmake2 perl-Unix-Syslog | |
1748 | lfsmake2 perl-Mail-Tools | |
1749 | lfsmake2 perl-MIME-Tools | |
1750 | lfsmake2 perl-Net-Server | |
1751 | lfsmake2 perl-Canary-Stability | |
1752 | lfsmake2 perl-Convert-TNEF | |
1753 | lfsmake2 perl-Convert-UUlib | |
ce2cea17 MT |
1754 | lfsmake2 perl-Archive-Zip |
1755 | lfsmake2 perl-Text-Tabs+Wrap | |
1756 | lfsmake2 perl-XML-Parser | |
1757 | lfsmake2 perl-Crypt-PasswdMD5 | |
1758 | lfsmake2 perl-Net-Telnet | |
ce2cea17 MT |
1759 | lfsmake2 perl-Capture-Tiny |
1760 | lfsmake2 perl-Config-AutoConf | |
d705f5e5 | 1761 | lfsmake2 perl-File-LibMagic |
ce2cea17 MT |
1762 | lfsmake2 perl-Object-Tiny |
1763 | lfsmake2 perl-Archive-Peek-Libarchive | |
1764 | lfsmake2 python3-inotify | |
1765 | lfsmake2 python3-docutils | |
1766 | lfsmake2 python3-daemon | |
1767 | lfsmake2 ntp | |
1768 | lfsmake2 openssh | |
1769 | lfsmake2 fontconfig | |
1770 | lfsmake2 dejavu-fonts-ttf | |
1771 | lfsmake2 ubuntu-font-family | |
1772 | lfsmake2 freefont | |
1773 | lfsmake2 pixman | |
1774 | lfsmake2 cairo | |
1775 | lfsmake2 harfbuzz | |
1776 | lfsmake2 fribidi | |
1777 | lfsmake2 pango | |
1778 | lfsmake2 rrdtool | |
1779 | lfsmake2 setup | |
1780 | lfsmake2 jansson | |
1781 | lfsmake2 yaml | |
1782 | lfsmake2 libhtp | |
1783 | lfsmake2 colm | |
1784 | lfsmake2 ragel | |
1785 | lfsmake2 vectorscan | |
1786 | lfsmake2 suricata | |
1787 | lfsmake2 ids-ruleset-sources | |
1788 | lfsmake2 ipblocklist-sources | |
1789 | lfsmake2 squid | |
1790 | lfsmake2 squidguard | |
1791 | lfsmake2 calamaris | |
1792 | lfsmake2 tcpdump | |
1793 | lfsmake2 traceroute | |
ce2cea17 MT |
1794 | lfsmake2 wireless |
1795 | lfsmake2 pakfire | |
1796 | lfsmake2 lz4 | |
1797 | lfsmake2 lzo | |
1798 | lfsmake2 openvpn | |
1799 | lfsmake2 mpage | |
1800 | lfsmake2 dbus | |
1801 | lfsmake2 intltool | |
1802 | lfsmake2 libdaemon | |
1803 | lfsmake2 avahi | |
f1a1b377 | 1804 | lfsmake2 libtalloc |
ce2cea17 MT |
1805 | lfsmake2 cifs-utils |
1806 | lfsmake2 krb5 | |
1807 | lfsmake2 rpcsvc-proto | |
39239d2b | 1808 | lfsmake2 lmdb |
ce2cea17 | 1809 | lfsmake2 samba |
dba19944 | 1810 | lfsmake2 iniparser |
ce2cea17 MT |
1811 | lfsmake2 netatalk |
1812 | lfsmake2 sudo | |
1813 | lfsmake2 mc | |
1814 | lfsmake2 wget | |
1815 | lfsmake2 bridge-utils | |
1816 | lfsmake2 smartmontools | |
1817 | lfsmake2 htop | |
1818 | lfsmake2 chkconfig | |
1819 | lfsmake2 postfix | |
1820 | lfsmake2 fetchmail | |
1821 | lfsmake2 clamav | |
1822 | lfsmake2 perl-NetAddr-IP | |
1823 | lfsmake2 dma | |
1824 | lfsmake2 alsa | |
ce2cea17 MT |
1825 | lfsmake2 guardian |
1826 | lfsmake2 libid3tag | |
1827 | lfsmake2 libmad | |
1828 | lfsmake2 libogg | |
1829 | lfsmake2 libvorbis | |
1830 | lfsmake2 flac | |
1831 | lfsmake2 lame | |
1832 | lfsmake2 soxr | |
1833 | lfsmake2 libshout | |
ce2cea17 | 1834 | lfsmake2 gnump3d |
a08b674d | 1835 | lfsmake2 libxxhash |
ce2cea17 MT |
1836 | lfsmake2 rsync |
1837 | lfsmake2 rpcbind | |
1838 | lfsmake2 keyutils | |
1839 | lfsmake2 nfs | |
1840 | lfsmake2 ncat | |
1841 | lfsmake2 nmap | |
1842 | lfsmake2 etherwake | |
1843 | lfsmake2 bwm-ng | |
1844 | lfsmake2 sysstat | |
1845 | lfsmake2 strongswan | |
1846 | lfsmake2 rng-tools | |
1847 | lfsmake2 lsof | |
ce2cea17 MT |
1848 | lfsmake2 lm_sensors |
1849 | lfsmake2 libstatgrab | |
1850 | lfsmake2 liboping | |
4145cffd AB |
1851 | lfsmake2 netsnmpd |
1852 | lfsmake2 nut | |
ce2cea17 MT |
1853 | lfsmake2 collectd |
1854 | lfsmake2 git | |
1855 | lfsmake2 linux-firmware | |
1856 | lfsmake2 dvb-firmwares | |
1857 | lfsmake2 zd1211-firmware | |
1858 | lfsmake2 rpi-firmware | |
1859 | lfsmake2 intel-microcode | |
1860 | lfsmake2 pcengines-apu-firmware | |
1861 | lfsmake2 elinks | |
1862 | lfsmake2 igmpproxy | |
1863 | lfsmake2 opus | |
1864 | lfsmake2 python3-toml | |
1865 | lfsmake2 python3-pyproject2setuppy | |
1866 | lfsmake2 python3-pyparsing | |
1867 | lfsmake2 spice-protocol | |
1868 | lfsmake2 spice | |
1869 | lfsmake2 sdl2 | |
1870 | lfsmake2 libusbredir | |
1871 | lfsmake2 libseccomp | |
1872 | lfsmake2 libslirp | |
82c9e495 | 1873 | lfsmake2 dtc |
44b8e06f | 1874 | lfsmake2 python3-tomli |
ce2cea17 | 1875 | lfsmake2 qemu |
ce2cea17 MT |
1876 | lfsmake2 nagios_nrpe |
1877 | lfsmake2 nagios-plugins | |
1878 | lfsmake2 observium-agent | |
1879 | lfsmake2 ebtables | |
1880 | lfsmake2 faad2 | |
1881 | lfsmake2 alac | |
1882 | lfsmake2 ffmpeg | |
1883 | lfsmake2 vdr | |
1884 | lfsmake2 vdr_streamdev | |
1885 | lfsmake2 vdr_epgsearch | |
1886 | lfsmake2 vdr_dvbapi | |
1887 | lfsmake2 vdr_eepg | |
1888 | lfsmake2 w_scan | |
1889 | lfsmake2 fmt | |
1890 | lfsmake2 mpd | |
1891 | lfsmake2 libmpdclient | |
1892 | lfsmake2 mpc | |
1893 | lfsmake2 perl-Net-CIDR-Lite | |
1894 | lfsmake2 perl-Net-SMTP-SSL | |
ce2cea17 MT |
1895 | lfsmake2 perl-Authen-SASL |
1896 | lfsmake2 perl-MIME-Lite | |
1897 | lfsmake2 perl-Email-Date-Format | |
1898 | lfsmake2 vnstat | |
1899 | lfsmake2 iw | |
1900 | lfsmake2 wpa_supplicant | |
1901 | lfsmake2 hostapd | |
1902 | lfsmake2 syslinux | |
1903 | lfsmake2 tftpd | |
1904 | lfsmake2 cpufrequtils | |
ce2cea17 MT |
1905 | lfsmake2 apcupsd |
1906 | lfsmake2 fireperf | |
1907 | lfsmake2 iperf | |
1908 | lfsmake2 iperf3 | |
1909 | lfsmake2 7zip | |
1910 | lfsmake2 lynis | |
1911 | lfsmake2 sshfs | |
1912 | lfsmake2 utfcpp | |
1913 | lfsmake2 taglib | |
1914 | lfsmake2 perl-gettext | |
1915 | lfsmake2 perl-Sort-Naturally | |
1916 | lfsmake2 vdradmin | |
1917 | lfsmake2 perl-DBI | |
1918 | lfsmake2 perl-DBD-SQLite | |
1919 | lfsmake2 perl-File-ReadBackwards | |
1920 | lfsmake2 openvmtools | |
1921 | lfsmake2 joe | |
1922 | lfsmake2 monit | |
ce2cea17 MT |
1923 | lfsmake2 watchdog |
1924 | lfsmake2 usb_modeswitch | |
1925 | lfsmake2 usb_modeswitch_data | |
1926 | lfsmake2 zerofree | |
1927 | lfsmake2 minicom | |
1928 | lfsmake2 ddrescue | |
1929 | lfsmake2 parted | |
1930 | lfsmake2 swig | |
2186f19f | 1931 | lfsmake2 python3-pyelftools |
ce2cea17 MT |
1932 | lfsmake2 u-boot |
1933 | lfsmake2 wireless-regdb | |
1934 | lfsmake2 ddns | |
1935 | lfsmake2 python3-pycparser | |
1936 | lfsmake2 python3-charset-normalizer | |
1937 | lfsmake2 python3-certifi | |
1938 | lfsmake2 python3-idna | |
1939 | lfsmake2 python3-requests | |
ce2cea17 MT |
1940 | lfsmake2 python3-pep517 |
1941 | lfsmake2 python3-build | |
1942 | lfsmake2 python3-install | |
1943 | lfsmake2 python3-urllib3 | |
1944 | lfsmake2 python3-flit | |
1945 | lfsmake2 python3-packaging | |
1946 | lfsmake2 python3-typing-extensions | |
1947 | lfsmake2 python3-semantic-version | |
1948 | lfsmake2 python3-setuptools-scm | |
1949 | lfsmake2 python3-setuptools-rust | |
1950 | lfsmake2 python3-six | |
1951 | lfsmake2 python3-dateutil | |
1952 | lfsmake2 python3-jmespath | |
1953 | lfsmake2 python3-colorama | |
1954 | lfsmake2 python3-yaml | |
1955 | lfsmake2 python3-s3transfer | |
1956 | lfsmake2 python3-rsa | |
1957 | lfsmake2 python3-pyasn1 | |
1958 | lfsmake2 python3-botocore | |
1959 | lfsmake2 python3-cffi | |
1960 | lfsmake2 python3-cryptography | |
1961 | lfsmake2 python3-circuitbreaker | |
1962 | lfsmake2 python3-pytz | |
1963 | lfsmake2 python3-click | |
1964 | lfsmake2 python3-arrow | |
1965 | lfsmake2 python3-terminaltables | |
1966 | lfsmake2 python3-pkgconfig | |
1967 | lfsmake2 python3-msgpack | |
1968 | lfsmake2 python3-editables | |
1969 | lfsmake2 python3-pathspec | |
1970 | lfsmake2 python3-pluggy | |
1971 | lfsmake2 python3-calver | |
1972 | lfsmake2 python3-trove-classifiers | |
1973 | lfsmake2 python3-hatchling | |
1974 | lfsmake2 python3-hatch-vcs | |
1975 | lfsmake2 python3-hatch-fancy-pypi-readme | |
1976 | lfsmake2 python3-attrs | |
1977 | lfsmake2 python3-sniffio | |
1978 | lfsmake2 python3-sortedcontainers | |
1979 | lfsmake2 python3-outcome | |
1980 | lfsmake2 python3-async_generator | |
1981 | lfsmake2 python3-flit_scm | |
1982 | lfsmake2 python3-exceptiongroup | |
1983 | lfsmake2 python3-trio | |
1984 | lfsmake2 python3-pyfuse3 | |
1985 | lfsmake2 aws-cli | |
1986 | lfsmake2 oci-python-sdk | |
1987 | lfsmake2 oci-cli | |
1988 | lfsmake2 transmission | |
1989 | lfsmake2 mtr | |
1990 | lfsmake2 minidlna | |
1991 | lfsmake2 acpid | |
1992 | lfsmake2 fping | |
1993 | lfsmake2 telnet | |
1994 | lfsmake2 xinetd | |
1995 | lfsmake2 stress | |
1996 | lfsmake2 sarg | |
1997 | lfsmake2 nginx | |
1998 | lfsmake2 sysbench | |
1999 | lfsmake2 strace | |
2000 | lfsmake2 ltrace | |
2001 | lfsmake2 ipfire-netboot | |
ce2cea17 MT |
2002 | lfsmake2 keepalived |
2003 | lfsmake2 ipvsadm | |
2004 | lfsmake2 perl-Carp-Clan | |
2005 | lfsmake2 perl-Date-Calc | |
2006 | lfsmake2 perl-Date-Manip | |
2007 | lfsmake2 perl-File-Tail | |
2008 | lfsmake2 perl-TimeDate | |
2009 | lfsmake2 swatch | |
2010 | lfsmake2 tor | |
2011 | lfsmake2 wavemon | |
2012 | lfsmake2 iptraf-ng | |
2013 | lfsmake2 iotop | |
2014 | lfsmake2 stunnel | |
2015 | lfsmake2 bacula | |
2016 | lfsmake2 perl-Font-TTF | |
2017 | lfsmake2 perl-IO-String | |
2018 | lfsmake2 perl-PDF-API2 | |
2019 | lfsmake2 proxy-accounting | |
2020 | lfsmake2 tmux | |
2021 | lfsmake2 perl-Text-CSV_XS | |
2022 | lfsmake2 lua | |
2023 | lfsmake2 haproxy | |
2024 | lfsmake2 ipset | |
2025 | lfsmake2 dnsdist | |
2026 | lfsmake2 bird | |
2027 | lfsmake2 libyang | |
2028 | lfsmake2 abseil-cpp | |
2029 | lfsmake2 protobuf | |
2030 | lfsmake2 protobuf-c | |
2031 | lfsmake2 frr | |
2032 | lfsmake2 dmidecode | |
2033 | lfsmake2 mcelog | |
2034 | lfsmake2 libpciaccess | |
041adb61 | 2035 | lfsmake2 ovmf |
ce2cea17 | 2036 | lfsmake2 libvirt |
ce2cea17 MT |
2037 | lfsmake2 freeradius |
2038 | lfsmake2 perl-common-sense | |
2039 | lfsmake2 perl-inotify2 | |
2040 | lfsmake2 perl-Net-IP | |
2041 | lfsmake2 wio | |
2042 | lfsmake2 iftop | |
2043 | lfsmake2 mdns-repeater | |
2044 | lfsmake2 i2c-tools | |
2045 | lfsmake2 nss-myhostname | |
2046 | lfsmake2 dehydrated | |
2047 | lfsmake2 libplist | |
2048 | lfsmake2 nqptp | |
2049 | lfsmake2 shairport-sync | |
2050 | lfsmake2 borgbackup | |
ce2cea17 MT |
2051 | lfsmake2 knot |
2052 | lfsmake2 spectre-meltdown-checker | |
2053 | lfsmake2 zabbix_agentd | |
2054 | lfsmake2 flashrom | |
2055 | lfsmake2 firmware-update | |
2056 | lfsmake2 ruby | |
2057 | lfsmake2 asciidoctor | |
2058 | lfsmake2 speexdsp | |
2059 | lfsmake2 tshark | |
2060 | lfsmake2 speedtest-cli | |
2061 | lfsmake2 amazon-ssm-agent | |
2062 | lfsmake2 libloc | |
2063 | lfsmake2 ncdu | |
2064 | lfsmake2 lshw | |
2065 | lfsmake2 socat | |
2066 | lfsmake2 libcdada | |
2067 | lfsmake2 pmacct | |
2068 | lfsmake2 squid-asnbl | |
2069 | lfsmake2 qemu-ga | |
2070 | lfsmake2 gptfdisk | |
2071 | lfsmake2 oath-toolkit | |
2072 | lfsmake2 qrencode | |
2073 | lfsmake2 perl-File-Remove | |
2074 | lfsmake2 perl-Module-Build | |
2075 | lfsmake2 perl-Module-ScanDeps | |
2076 | lfsmake2 perl-YAML-Tiny | |
2077 | lfsmake2 perl-Module-Install | |
2078 | lfsmake2 perl-Imager | |
2079 | lfsmake2 perl-Imager-QRCode | |
2080 | lfsmake2 perl-MIME-Base32 | |
2081 | lfsmake2 perl-URI-Encode | |
2082 | lfsmake2 rsnapshot | |
2083 | lfsmake2 mympd | |
2084 | lfsmake2 wsdd | |
2085 | lfsmake2 btrfs-progs | |
2086 | lfsmake2 inotify-tools | |
2087 | lfsmake2 grub-btrfs | |
6d970496 | 2088 | lfsmake2 fort-validator |
ce2cea17 | 2089 | |
048d2be9 MT |
2090 | lfsmake2 linux |
2091 | lfsmake2 rtl8812au | |
2092 | lfsmake2 linux-initrd | |
49714ec4 | 2093 | |
ce2cea17 | 2094 | lfsmake2 memtest |
513814ab MT |
2095 | |
2096 | # Build the installer | |
ce2cea17 | 2097 | lfsmake2 installer |
513814ab | 2098 | |
e9fcb8c3 MT |
2099 | # Build images |
2100 | lfsmake2 cdrom | |
2101 | lfsmake2 flash-images | |
36fb6a66 | 2102 | lfsmake2 core-updates |
df5e82b3 MT |
2103 | } |
2104 | ||
20e49206 MT |
2105 | build_packages() { |
2106 | local LOGFILE="${LOG_DIR}/_build.packages.log" | |
49714ec4 | 2107 | |
20e49206 | 2108 | # Build packages |
0de9b403 | 2109 | print_headline "Building Packages" |
e67a57fe | 2110 | |
20e49206 MT |
2111 | local path |
2112 | local -A pkgs=() | |
2113 | local pkg | |
e67a57fe | 2114 | |
20e49206 MT |
2115 | # Collect all packages |
2116 | for path in \ | |
2117 | "${BASEDIR}/config/rootfiles/packages/"* \ | |
2118 | "${BASEDIR}/config/rootfiles/packages/${BUILD_ARCH}"/*; do | |
b368b190 MT |
2119 | # Skip directories |
2120 | if [ -d "${path}" ]; then | |
2121 | continue | |
2122 | fi | |
2123 | ||
20e49206 MT |
2124 | pkgs["${path##*/}"]="${path}" |
2125 | done | |
5596077b | 2126 | |
20e49206 MT |
2127 | # Package them all |
2128 | for pkg in ${!pkgs[@]}; do | |
2129 | ipfiredist "${pkg}" | |
fe7fe395 | 2130 | done |
df5e82b3 MT |
2131 | } |
2132 | ||
6dcd1931 MT |
2133 | # This function will re-execute a command in a new namespace |
2134 | exec_in_namespace() { | |
2135 | # Nothing to do if we are already in a new namespace | |
2136 | if [ -n "${IN_NAMESPACE}" ]; then | |
2137 | return 0 | |
2138 | fi | |
2139 | ||
2b81545b MT |
2140 | # Forward any configuration |
2141 | local args=( | |
2142 | "--target=${BUILD_ARCH}" | |
2143 | ) | |
2144 | ||
6dcd1931 MT |
2145 | IN_NAMESPACE=1 \ |
2146 | exec unshare \ | |
2147 | --mount \ | |
2b4d457c | 2148 | --propagation=private \ |
2b81545b | 2149 | "${0}" "${args[@]}" "$@" |
6dcd1931 MT |
2150 | } |
2151 | ||
5be3501e MT |
2152 | check_for_missing_rootfiles() { |
2153 | print_headline "Checking for missing rootfiles..." | |
deb95014 MT |
2154 | |
2155 | local file | |
2156 | for file in ${LOG_DIR}/*_missing_rootfile; do | |
60b5c6c2 MT |
2157 | [ -e "${file}" ] || continue |
2158 | ||
deb95014 MT |
2159 | file="${file##*/}" |
2160 | file="${file/_missing_rootfile/}"; | |
2161 | ||
2162 | print_line "${file} is missing a rootfile" | |
2163 | print_status FAIL | |
2164 | done | |
2165 | ||
2166 | return 0 | |
2167 | } | |
2168 | ||
5be3501e MT |
2169 | check_rootfiles_for_arch() { |
2170 | local arch="${1}" | |
2171 | ||
2172 | local args=( | |
2173 | # Search path | |
2174 | "${BASEDIR}/config/rootfiles" | |
2175 | ||
2176 | # Exclude old core updates | |
2177 | "--exclude-dir" "oldcore" | |
2178 | ||
2179 | # Ignore the update scripts | |
2180 | "--exclude" "update.sh" | |
2181 | ) | |
2182 | ||
2183 | # A list of files that are not scanned | |
2184 | # because they probably cause some false positives. | |
2185 | local excluded_files=( | |
a23189d2 AF |
2186 | abseil-cpp |
2187 | cmake | |
2188 | gdb | |
2189 | liburcu | |
041adb61 | 2190 | ovmf |
5be3501e | 2191 | qemu |
a23189d2 AF |
2192 | rust-memchr |
2193 | rust-libc | |
2194 | rust-ppv-lite86 | |
2195 | xfsprogs | |
5be3501e MT |
2196 | ) |
2197 | ||
2198 | # Exclude any architecture-specific directories | |
2199 | local a | |
2200 | for a in ${ARCHES[@]}; do | |
2201 | args+=( "--exclude-dir" "${a}" ) | |
2202 | done | |
2203 | ||
2204 | # Exclude all excluded files | |
2205 | local x | |
2206 | for x in ${excluded_files[@]}; do | |
2207 | args+=( "--exclude" "${x}" ) | |
2208 | done | |
2209 | ||
a23189d2 | 2210 | # Search for all files that contain the architecture |
32ec5667 | 2211 | local files=( |
a23189d2 | 2212 | $(grep --files-with-matches -r "^.*${arch}" "${args[@]}") |
32ec5667 | 2213 | ) |
5be3501e | 2214 | |
32ec5667 MT |
2215 | local file |
2216 | for file in ${files[@]}; do | |
2217 | print_line "${file} contains ${arch}" | |
2218 | print_status FAIL | |
2219 | done | |
2220 | ||
2221 | return "${#files[@]}" | |
5be3501e MT |
2222 | } |
2223 | ||
2224 | check_rootfiles_for_pattern() { | |
2225 | local pattern="${1}" | |
2226 | local message="${2}" | |
2227 | ||
2228 | local args=( | |
2229 | # Search path | |
2230 | "${BASEDIR}/config/rootfiles" | |
2231 | ||
2232 | # Exclude old core updates | |
2233 | "--exclude-dir" "oldcore" | |
2234 | ||
2235 | # Ignore the update scripts | |
2236 | "--exclude" "update.sh" | |
2237 | ) | |
2238 | ||
2239 | if grep -r "${pattern}" "${args[@]}"; then | |
2240 | if [ -n "${message}" ]; then | |
2241 | print_line "${message}" | |
2242 | print_status FAIL | |
2243 | else | |
2244 | print_file "Files matching '${pattern}' have been found in the rootfiles" | |
2245 | print_status FAIL | |
2246 | fi | |
2247 | return 1 | |
2248 | fi | |
2249 | ||
2250 | return 0 | |
2251 | } | |
2252 | ||
2253 | check_rootfiles() { | |
2254 | local failed=0 | |
2255 | ||
2256 | print_headline "Checking for rootfile consistency..." | |
2257 | ||
aab8f48a MT |
2258 | # Check for changes |
2259 | if ! check_rootfiles_for_pattern "^[\+\-]" \ | |
2260 | "Rootfiles have changed in them"; then | |
2261 | failed=1 | |
2262 | fi | |
2263 | ||
5be3501e MT |
2264 | # Check for /etc/init.d |
2265 | if ! check_rootfiles_for_pattern "^etc/init\.d/" \ | |
2266 | "/etc/init.d/* has been found. Please replace by /etc/rc.d/init.d"; then | |
2267 | failed=1 | |
2268 | fi | |
2269 | ||
2270 | # Check for /var/run | |
2271 | if ! check_rootfiles_for_pattern "^var/run/.*" \ | |
2272 | "You cannot ship files in /var/run as it is a ramdisk"; then | |
2273 | failed=1 | |
2274 | fi | |
2275 | ||
2276 | # Check architectures | |
2277 | local arch | |
2278 | for arch in ${ARCHES[@]}; do | |
2279 | check_rootfiles_for_arch "${arch}" || failed=$? | |
2280 | done | |
2281 | ||
2282 | # Return the error | |
2283 | return ${failed} | |
2284 | } | |
2285 | ||
40571258 MT |
2286 | check_changed_rootfiles() { |
2287 | local files=( | |
2288 | $(grep --files-with-matches -r "^+" "${LOG_DIR}" --exclude="_*" | sort) | |
2289 | ) | |
2290 | ||
2291 | # If we have no matches, there is nothing to do | |
2292 | [ "${#files[@]}" -eq 0 ] && return 0 | |
2293 | ||
2294 | print_line "Packages have created new files" | |
2295 | print_status WARN | |
2296 | ||
2297 | local file | |
2298 | for file in ${files[@]}; do | |
2299 | print_line " ${file##*/}" | |
2300 | print_status WARN | |
2301 | done | |
2302 | ||
2303 | return 0 | |
2304 | } | |
2305 | ||
510dd732 MT |
2306 | # Set BASEDIR |
2307 | readonly BASEDIR="$(find_base)" | |
8eeaf1ab | 2308 | |
8eeaf1ab MT |
2309 | # Get some information about the host system |
2310 | SYSTEM_PROCESSORS="$(system_processors)" | |
2311 | SYSTEM_MEMORY="$(system_memory)" | |
2312 | ||
2313 | # Default settings | |
27d0a2c4 | 2314 | BUILD_ARCH="${HOST_ARCH}" |
8eeaf1ab | 2315 | CCACHE_CACHE_SIZE="4G" |
8eeaf1ab MT |
2316 | |
2317 | # Load configuration file | |
2318 | if [ -f .config ]; then | |
2319 | source .config | |
2320 | fi | |
2321 | ||
8eeaf1ab | 2322 | # Parse any command line options (not commands) |
bcb9dc13 MT |
2323 | while [ $# -gt 0 ]; do |
2324 | case "${1}" in | |
2325 | --target=*) | |
8eeaf1ab | 2326 | BUILD_ARCH="${1#--target=}" |
bcb9dc13 | 2327 | ;; |
8eeaf1ab | 2328 | |
bcb9dc13 MT |
2329 | -*) |
2330 | exiterror "Unknown configuration option: ${1}" | |
2331 | ;; | |
8eeaf1ab MT |
2332 | |
2333 | # Found a command, so exit options parsing | |
bcb9dc13 | 2334 | *) |
bcb9dc13 MT |
2335 | break |
2336 | ;; | |
2337 | esac | |
2338 | shift | |
2339 | done | |
2340 | ||
27d0a2c4 MT |
2341 | # Check the architecture |
2342 | case "${BUILD_ARCH}" in | |
2343 | aarch64|x86_64|riscv64) | |
2344 | ;; | |
2345 | ||
2346 | *) | |
2347 | exiterror "Unsupported architecture: ${BUILD_ARCH}" | |
2348 | ;; | |
2349 | esac | |
2350 | ||
2351 | # Set build platform | |
2352 | case "${BUILD_ARCH}" in | |
2353 | aarch64) | |
2354 | BUILD_PLATFORM="arm" | |
2355 | ;; | |
2356 | ||
2357 | riscv64) | |
2358 | BUILD_PLATFORM="riscv" | |
2359 | ;; | |
2360 | ||
2361 | x86_64) | |
2362 | BUILD_PLATFORM="x86" | |
2363 | ;; | |
2364 | esac | |
2365 | ||
2366 | # Configure the C compiler | |
2367 | CFLAGS=( | |
2368 | # Optimize the code | |
2369 | "-O2" | |
2370 | ||
2371 | # Do not compile in any debugging information | |
2372 | "-g0" | |
2373 | ||
2374 | # Do not write temporary files | |
2375 | "-pipe" | |
2376 | ||
2377 | # Enable all warnings | |
2378 | "-Wall" | |
2379 | ||
2380 | # Enable exceptions | |
2381 | "-fexceptions" | |
2382 | ||
2383 | # Compile place-independent code | |
2384 | "-fPIC" | |
2385 | ||
2386 | # Fortify Source | |
2387 | "-Wp,-U_FORTIFY_SOURCE" | |
2388 | "-Wp,-D_FORTIFY_SOURCE=3" | |
2389 | ||
2390 | # Enable additional checks for C++ in glibc | |
2391 | "-Wp,-D_GLIBCXX_ASSERTIONS" | |
2392 | ||
2393 | # Enable stack smashing protection | |
2394 | "-fstack-protector-strong" | |
2395 | ||
2396 | # Enable stack clash protection | |
2397 | "-fstack-clash-protection" | |
2398 | ) | |
2399 | ||
2400 | # Architecture-dependent compiler flags | |
2401 | case "${BUILD_ARCH}" in | |
2402 | aarch64) | |
2403 | CFLAGS+=( | |
2404 | "-mbranch-protection=standard" | |
2405 | ) | |
2406 | ;; | |
2407 | ||
2408 | x86_64) | |
2409 | CFLAGS+=( | |
2410 | "-m64" "-mtune=generic" "-fcf-protection=full" | |
2411 | ) | |
2412 | ;; | |
2413 | esac | |
2414 | ||
2415 | # Configure the Rust compiler | |
2416 | RUSTFLAGS=( | |
2417 | "-Copt-level=3" | |
2418 | "-Clink-arg=-Wl,-z,relro,-z,now" | |
2419 | "-Ccodegen-units=1" | |
2420 | "--cap-lints=warn" | |
2421 | ) | |
2422 | ||
2423 | # Configure the compiler tuple | |
2424 | CROSSTARGET="${BUILD_ARCH}-cross-linux-gnu" | |
2425 | BUILDTARGET="${BUILD_ARCH}-pc-linux-gnu" | |
2426 | ||
2427 | # Use this as default PARALLELISM | |
2428 | DEFAULT_PARALLELISM="${SYSTEM_PROCESSORS}" | |
2429 | ||
2430 | # Limit lauched ninja build jobs to computed parallel value | |
2431 | NINJAJOBS="${DEFAULT_PARALLELISM}" | |
2432 | ||
2433 | # Configure XZ | |
2434 | XZ_OPT=( | |
2435 | "-T0" "-8" | |
2436 | ) | |
2437 | ||
2438 | # Configure Zstandard | |
2439 | ZSTD_OPT=( | |
64192acb | 2440 | "-T0" "-19" "--long" |
27d0a2c4 | 2441 | ) |
8eeaf1ab MT |
2442 | |
2443 | # Set directories | |
38b4f088 | 2444 | readonly CACHE_DIR="${BASEDIR}/cache" |
baf15b60 | 2445 | readonly TOOLCHAIN_DIR="${CACHE_DIR}/toolchains" |
8eeaf1ab | 2446 | readonly CCACHE_DIR="${BASEDIR}/ccache/${BUILD_ARCH}/${TOOLCHAINVER}" |
38b4f088 | 2447 | readonly BUILD_DIR="${BASEDIR}/build_${BUILD_ARCH}" |
68fea175 | 2448 | readonly IMAGES_DIR="${BASEDIR}/images_${BUILD_ARCH}" |
38b4f088 | 2449 | readonly LOG_DIR="${BASEDIR}/log_${BUILD_ARCH}" |
20e49206 | 2450 | readonly PACKAGES_DIR="${IMAGES_DIR}/packages" |
38b4f088 | 2451 | readonly TOOLS_DIR="/tools_${BUILD_ARCH}" |
49714ec4 | 2452 | |
baf15b60 | 2453 | # Set URLs |
97732901 | 2454 | readonly SOURCE_URL="https://source.ipfire.org/ipfire-2.x" |
baf15b60 MT |
2455 | readonly TOOLCHAIN_URL="https://source.ipfire.org/toolchains" |
2456 | ||
49714ec4 MT |
2457 | # Set the LOGFILE |
2458 | LOGFILE="${LOG_DIR}/_build.preparation.log" | |
2459 | ||
e2e0d087 MT |
2460 | # Ensure that some basic directories exist |
2461 | mkdir -p "${CACHE_DIR}" "${LOG_DIR}" | |
8eeaf1ab | 2462 | |
baf15b60 MT |
2463 | # Toolchain Archive |
2464 | readonly TOOLCHAIN="${SNAME}-${VERSION}-toolchain-${TOOLCHAINVER}-${BUILD_ARCH}.tar.zst" | |
cf4652d6 | 2465 | |
df5e82b3 | 2466 | # See what we're supposed to do |
2f8ae1c2 | 2467 | case "$1" in |
df5e82b3 | 2468 | build) |
3080500d | 2469 | START_TIME="${SECONDS}" |
f9783277 | 2470 | |
6dcd1931 MT |
2471 | # Launch in a new namespace |
2472 | exec_in_namespace "$@" | |
2473 | ||
cf4652d6 | 2474 | # Prepare the environment |
a54da991 | 2475 | prepareenv --required-space=8192 |
cf4652d6 MT |
2476 | |
2477 | # Check if the toolchain is available | |
2478 | if [ ! -e "${BUILD_DIR}${TOOLS_DIR}/.toolchain-successful" ]; then | |
2479 | # If we have the toolchain available, we extract it into the build environment | |
baf15b60 | 2480 | if [ -r "${TOOLCHAIN_DIR}/${TOOLCHAIN}" ]; then |
0de9b403 | 2481 | print_headline "Packaged toolchain compilation" |
cf4652d6 MT |
2482 | |
2483 | # Extract the toolchain | |
2484 | if ! extract_toolchain "${TOOLCHAIN}"; then | |
2485 | exiterror "Failed extracting the toolchain" | |
df5e82b3 | 2486 | fi |
cf4652d6 MT |
2487 | |
2488 | # Otherwise perform a full toolchain compilation | |
2489 | else | |
0de9b403 | 2490 | print_headline "Full toolchain compilation" |
3db20d6f | 2491 | build_toolchain |
df5e82b3 | 2492 | fi |
df5e82b3 | 2493 | fi |
5cfe86e6 | 2494 | |
0de9b403 | 2495 | print_headline "Building ${NAME}" |
513814ab | 2496 | build_system |
15679d9f | 2497 | |
20e49206 MT |
2498 | # Build all packages |
2499 | build_packages | |
2f8ae1c2 | 2500 | |
5be3501e MT |
2501 | # Check for missing rootfiles |
2502 | check_for_missing_rootfiles | |
deb95014 | 2503 | |
5be3501e MT |
2504 | # Check for rootfile consistency |
2505 | if ! check_rootfiles; then | |
2506 | exiterror "Rootfiles are inconsistent" | |
2507 | fi | |
a23731d1 | 2508 | |
40571258 MT |
2509 | check_changed_rootfiles |
2510 | ||
3080500d | 2511 | print_build_summary $(( SECONDS - START_TIME )) |
df5e82b3 | 2512 | ;; |
90e50883 MT |
2513 | tail) |
2514 | tail -F \ | |
abbcbd1a | 2515 | "${LOG_DIR}/_build.preparation.log" \ |
90e50883 MT |
2516 | "${LOG_DIR}/_build.toolchain.log" \ |
2517 | "${LOG_DIR}/_build.${SNAME}.log" \ | |
2518 | "${LOG_DIR}/_build.packages.log" 2>/dev/null | |
2519 | ;; | |
df5e82b3 | 2520 | shell) |
6dcd1931 MT |
2521 | # Launch in a new namespace |
2522 | exec_in_namespace "$@" | |
2523 | ||
df5e82b3 MT |
2524 | # enter a shell inside LFS chroot |
2525 | # may be used to changed kernel settings | |
dae1ac41 | 2526 | prepareenv --network |
df5e82b3 MT |
2527 | entershell |
2528 | ;; | |
40571258 | 2529 | check) |
a23189d2 AF |
2530 | # Check for rootfile consistency |
2531 | if ! check_rootfiles; then | |
2532 | exiterror "Rootfiles are inconsistent" | |
2533 | fi | |
2534 | ||
40571258 MT |
2535 | check_changed_rootfiles |
2536 | ;; | |
df5e82b3 | 2537 | clean) |
f9783277 MT |
2538 | print_line "Cleaning build directory..." |
2539 | ||
711a047b MT |
2540 | # Cleanup build files |
2541 | rm -rf \ | |
2542 | "${BUILD_DIR}" \ | |
ecacbaac | 2543 | "${IMAGES_DIR}" \ |
711a047b MT |
2544 | "${LOG_DIR}" |
2545 | ||
2546 | # Remove the /tools symlink | |
6c4cc7ea MT |
2547 | if [ -h "${TOOLS_DIR}" ]; then |
2548 | rm -f "${TOOLS_DIR}" | |
df5e82b3 | 2549 | fi |
711a047b | 2550 | |
f9783277 | 2551 | print_status DONE |
df5e82b3 | 2552 | ;; |
c3db995c | 2553 | downloadsrc) |
e2e0d087 MT |
2554 | # Tell the user what we are about to do |
2555 | print_headline "Pre-loading all source files" | |
2556 | ||
2557 | # Download all sources | |
cf4b9118 | 2558 | download_sources |
df5e82b3 | 2559 | ;; |
df5e82b3 | 2560 | toolchain) |
6dcd1931 MT |
2561 | # Launch in a new namespace |
2562 | exec_in_namespace "$@" | |
2563 | ||
3db20d6f | 2564 | # Prepare the environment |
df5e82b3 | 2565 | prepareenv |
3db20d6f | 2566 | |
0de9b403 | 2567 | print_headline "Toolchain compilation (${BUILD_ARCH})" |
3db20d6f MT |
2568 | |
2569 | # Build the toolchain | |
2570 | build_toolchain | |
2571 | ||
2572 | # Ensure the toolchain directory exists | |
2573 | mkdir -p "${TOOLCHAIN_DIR}" | |
2574 | ||
2575 | # Compress the toolchain | |
2576 | if ! compress_toolchain "${TOOLCHAIN}"; then | |
2577 | exiterror "Could not compress toolchain" | |
2578 | fi | |
df5e82b3 | 2579 | ;; |
3db20d6f | 2580 | |
df5e82b3 | 2581 | gettoolchain) |
baf15b60 | 2582 | download_toolchain "${TOOLCHAIN}" |
df5e82b3 | 2583 | ;; |
15679d9f | 2584 | uploadsrc) |
97732901 MT |
2585 | # Check if IPFIRE_USER is set |
2586 | if [ -z "${IPFIRE_USER}" ]; then | |
2587 | exiterror "You have to setup IPFIRE_USER first. See .config for details." | |
661d9388 | 2588 | fi |
ae23a606 | 2589 | |
97732901 | 2590 | # Sync with upstream |
dbd455ef MT |
2591 | rsync \ |
2592 | --recursive \ | |
2593 | --update \ | |
2594 | --ignore-existing \ | |
2595 | --progress \ | |
2596 | --human-readable \ | |
2597 | --exclude="toolchains/" \ | |
97732901 MT |
2598 | "${CACHE_DIR}/" \ |
2599 | "${IPFIRE_USER}@people.ipfire.org:/pub/sources/source-2.x" | |
661d9388 | 2600 | |
15679d9f | 2601 | exit 0 |
0eab8e84 | 2602 | ;; |
bf7c473f | 2603 | lang) |
69a6ec55 MT |
2604 | echo -ne "Checking the translations for missing or obsolete strings..." |
2605 | chmod 755 $BASEDIR/tools/{check_strings.pl,sort_strings.pl,check_langs.sh} | |
2606 | $BASEDIR/tools/sort_strings.pl en | |
2607 | $BASEDIR/tools/sort_strings.pl de | |
2608 | $BASEDIR/tools/sort_strings.pl fr | |
2609 | $BASEDIR/tools/sort_strings.pl es | |
2610 | $BASEDIR/tools/sort_strings.pl pl | |
2611 | $BASEDIR/tools/sort_strings.pl ru | |
2612 | $BASEDIR/tools/sort_strings.pl nl | |
2613 | $BASEDIR/tools/sort_strings.pl tr | |
2614 | $BASEDIR/tools/sort_strings.pl it | |
2615 | $BASEDIR/tools/check_strings.pl en > $BASEDIR/doc/language_issues.en | |
2616 | $BASEDIR/tools/check_strings.pl de > $BASEDIR/doc/language_issues.de | |
2617 | $BASEDIR/tools/check_strings.pl fr > $BASEDIR/doc/language_issues.fr | |
2618 | $BASEDIR/tools/check_strings.pl es > $BASEDIR/doc/language_issues.es | |
72c8478e | 2619 | $BASEDIR/tools/check_strings.pl pl > $BASEDIR/doc/language_issues.pl |
69a6ec55 MT |
2620 | $BASEDIR/tools/check_strings.pl ru > $BASEDIR/doc/language_issues.ru |
2621 | $BASEDIR/tools/check_strings.pl nl > $BASEDIR/doc/language_issues.nl | |
2622 | $BASEDIR/tools/check_strings.pl tr > $BASEDIR/doc/language_issues.tr | |
2623 | $BASEDIR/tools/check_strings.pl it > $BASEDIR/doc/language_issues.it | |
2624 | $BASEDIR/tools/check_langs.sh > $BASEDIR/doc/language_missings | |
f9783277 | 2625 | print_status DONE |
69a6ec55 MT |
2626 | |
2627 | echo -ne "Updating language lists..." | |
2628 | update_language_list ${BASEDIR}/src/installer/po | |
2629 | update_language_list ${BASEDIR}/src/setup/po | |
f9783277 | 2630 | print_status DONE |
bf7c473f | 2631 | ;; |
1fb7f56e MT |
2632 | update-contributors) |
2633 | update_contributors | |
2634 | ;; | |
ba137dd8 MT |
2635 | find-dependencies) |
2636 | shift | |
3e071939 | 2637 | exec "${BASEDIR}/tools/find-dependencies" "${BUILD_DIR}" "$@" |
ba137dd8 | 2638 | ;; |
4edcd4b2 LAH |
2639 | check-manualpages) |
2640 | echo "Checking the manual pages for broken links..." | |
2f8ae1c2 | 2641 | |
4edcd4b2 LAH |
2642 | chmod 755 $BASEDIR/tools/check_manualpages.pl |
2643 | if $BASEDIR/tools/check_manualpages.pl; then | |
2644 | print_status DONE | |
2645 | else | |
2646 | print_status FAIL | |
2647 | fi | |
2648 | ;; | |
9d9c7cef MT |
2649 | __timer) |
2650 | __timer "${2}" || exit $? | |
2651 | ;; | |
6b8cff41 | 2652 | *) |
90e50883 | 2653 | echo "Usage: $0 [OPTIONS] {build|check-manualpages|clean|downloadsrc|find-dependencies|gettoolchain|lang|shell|tail|toolchain|update-contributors|uploadsrc}" |
6b8cff41 MT |
2654 | cat doc/make.sh-usage |
2655 | ;; | |
3ea75603 | 2656 | esac |