Commit Graph

22021 Commits

Author SHA1 Message Date
Michael Tremer
28fa687731 make.sh: Split environment and make variables
This got very messed up in the past and I think we would benefit greatly
from splitting this again for a less cluttered environment in the build
chroot and reusability of the make commands for the different stages.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:20 +00:00
Michael Tremer
878f864c1a make.sh: Call the correct target for checksum check
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:20 +00:00
Michael Tremer
5db99637ae make.sh: Bind-mount the QEMU helper instead of copying the binary
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:20 +00:00
Michael Tremer
92a2ed67be make.sh: Install the QEMU helper only once
This needs to be done only once when we initialize the environment.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:20 +00:00
Michael Tremer
3a272cfe40 make.sh: Pass variables before the commands
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:20 +00:00
Michael Tremer
7a6c3fb0d0 make.sh: Correctly pass the command return code in run_command
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:20 +00:00
Michael Tremer
a4578c6928 flash-images: No need to sleep for automount any more
I am not sure whether automount is being used at all any more, but since
we are now running in our own namespace, it certainly has no business
here.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
68fea175f5 make.sh: Create and mount and images directory
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
90e508839f make.sh: Add a tail command to stream any logs
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
a061f9a535 make.sh: Pass on individual build arguments
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
6b4cb7d793 make.sh: Don't generate any documentation in the source directory
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
6a7053fd82 make.sh: Kill all child processes if unshare terminates
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
6e6cb04630 make.sh: Update the runtime after the interrupt
This is a lot better because this puts the code where it is being
executed and allows us to run run_command in a subshell, too.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
513814ab98 make.sh: Build the entire distribution in one go
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
ce2cea174f make.sh: Fix indentation
No functional changes.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
8af25b83a3 make.sh: Move a comment to where it should be
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
37d4fcc9b3 make.sh: Launch the timer only when we need it
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
b55434ff46 make.sh: Have the background timer update the process runtime
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
9d9c7cef74 make.sh: Create a timer co-process
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
dfb583fee3 make.sh: Don't export loads of variables in the main script
We clear and reset the environment when we launch any build commands and
therefore don't need to do this here.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
e7601c7a93 make.sh: Don't mess with Bash's command hashing
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
e2e0d0879e make.sh: Refactor downloading sources
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
0059a357de make.sh: run_command: Fix basedir in and outside the chroot
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
7ee70f04ea make.sh: Disconnect standard input from make commands
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
84dc563161 make.sh: Move download and check to lfsmake2 and out of the common check
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
0754f99f95 make.sh: Add --quiet to run_command
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
15527043ea make.sh: Allow run_command to execute multiple actions at a time
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
2bf48a732d make.sh: Move lfscommoncheck out of run_command
We would quite likely create an infinite loop here later and so should
rather treat run_command as a low-level function.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
bb740c14c9 make.sh: Remove some dead code
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
2e90be3e29 make.sh: Show total runtime of commands after they are finished
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
fcbe801961 make.sh: Add helper function to run a make command
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
f43f28738a make.sh: Fix checking if we have a fake environment
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
03c51a4e67 Config: Drop toolchain URL
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:19 +00:00
Michael Tremer
9773290176 make.sh: Refactor uploading sources
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:18 +00:00
Michael Tremer
2581760148 make.sh: Make the disk space check optional
There is little value in running this when entering a shell...

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:18 +00:00
Michael Tremer
372f80882a make.sh: Mount the log directory for the correct architecture
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:18 +00:00
Michael Tremer
3db20d6fba make.sh: Refactor compression the toolchain
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:18 +00:00
Michael Tremer
74371ed5b6 make.sh: Create a custom log function
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:18 +00:00
Michael Tremer
711a047b66 make.sh: Use path variables for cleanup
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:18 +00:00
Michael Tremer
baf15b60f7 make.sh: Refactor downloading the toolchain
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:18 +00:00
Michael Tremer
3277e38460 .gitignore: Ignore architecture directories
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:18 +00:00
Michael Tremer
2b81545bc5 make.sh: Forward the architecture to the namespace
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:18 +00:00
Michael Tremer
cf4652d603 make.sh: Refactor the toolchain extraction
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:18 +00:00
Michael Tremer
38b4f088a2 make.sh: Build in a separate directory for each architecture
This allows running multiple builds in the same working directory.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:18 +00:00
Michael Tremer
79ea5921bc make.sh: Use LOG_DIR for logs
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:18 +00:00
Michael Tremer
b39d6d9a89 make.sh: Check free space in the base directory
This makes more sense if we want to support building multiple
architectures and if we consider cache and ccache, too.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:18 +00:00
Michael Tremer
27b8db2421 make.sh: Create all bind-mounts as read-only where possible
This way, the build environment can no longer modify any source any
more. This was not a huge integrity problem before as Git would have
shown differences, but it might cause damage to the build system which
need to manually be recovered.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:18 +00:00
Michael Tremer
daa17f2e24 make.sh: Create /dev and /sys in the build environment
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:17 +00:00
Michael Tremer
1801c2419d perl-Device-SerialPort: Use /dev/null as test port
The build failed with the new minimal /dev it is looking for some TTY
devices which are no longer present. This patch fixes the build.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:17 +00:00
Michael Tremer
b2e0324ebc make.sh: Create /proc in the chroot environment before mounting it
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-22 15:21:17 +00:00