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
Michael Tremer
9948d3d9ac
make.sh: Move PS1 to the header
...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:17 +00:00
Michael Tremer
5c865ab9d8
make.sh: Remove TARGET_ARCH compatibility
...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:17 +00:00
Michael Tremer
a0aefbd53f
make.sh: Remove option to make /usr/src a ramdisk
...
I am not sure this is helping in any way these days that we have SSDs
everywhere...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:17 +00:00
Michael Tremer
bcf9d74b59
make.sh: Remove docker stuff
...
This is basically unused for years. I even forgot we had this.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:17 +00:00
Michael Tremer
49714ec428
make.sh: Tidy up LOGFILE
...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:17 +00:00
Michael Tremer
510dd732ea
make.sh: Refactor determining BASEDIR
...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:17 +00:00
Michael Tremer
8eeaf1ab7e
make.sh: Group variables and initialization together
...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:17 +00:00
Michael Tremer
814360a348
make.sh: Set the CCACHE_DIR with the ccache to use
...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:17 +00:00
Michael Tremer
b0c45169f2
make.sh: Refactor the root user check
...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:17 +00:00
Michael Tremer
86565d7f7a
make.sh: Tidy up the environment creation function
...
NFC
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:17 +00:00
Michael Tremer
f8b5e93d94
make.sh: Refactor the space check
...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:17 +00:00
Michael Tremer
37081a7a1d
make.sh: No longer export LFS as it is not being used
...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:16 +00:00
Michael Tremer
4fd413a1a8
make.sh: Replace LFS with BUILD_DIR
...
This is probably a more specific name for this.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:16 +00:00
Michael Tremer
3a5d7b880b
make.sh: Always mount a separate /tmp
...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:16 +00:00
Michael Tremer
d4e9fc7fc5
make.sh: Make BUILD_DIR a mountpoint
...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:16 +00:00
Michael Tremer
e940d23cf8
make.sh: Create a new, minimal /dev in the build environment
...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:16 +00:00
Michael Tremer
4c92e5d852
make.sh: Don't bind-mount the host's /proc
...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:16 +00:00
Michael Tremer
6a644a5d30
make.sh: Create the second mount namespace as slave
...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:16 +00:00
Michael Tremer
738704d76c
make.sh: Don't create a new IPC namespace
...
If we do this, we no longer can interrupt the build process on the
console.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:16 +00:00
Michael Tremer
98ce3c7688
make.sh: Create lots more namespaces when we enter the chroot
...
This allows us to protect the host system a little bit more from the
host system by decoupling all namespaces.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:16 +00:00
Michael Tremer
99ce7cd2ce
make.sh: Ensure that we enter the chroot only in our own NS
...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:16 +00:00
Michael Tremer
d630cfec5b
make.sh: Remove the fragile cleanup code
...
Since we now mount everything in a new namespace, there is no need to
clean up ourselves. This will be done when the last process leaves the
namespace.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org >
2024-07-22 15:21:16 +00:00