mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
make.sh: Bind-mount all loop devices
There seems to be a different way how to create loop devices. On my Debian system, the first loop device is a block device with major=7 and minor=0, the second device is major=7 and minor=1, and so on. On a system running Grml, the second loop device has major=7 and minor=32, and all following ones are increasing their minor by 32 as well instead of one. Since I don't have an easy way to detect this, we will simply bind-mount all available loop devices in to the build environment. Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
21
make.sh
21
make.sh
@@ -447,14 +447,19 @@ prepareenv() {
|
||||
|
||||
# Create loop devices
|
||||
mknod -m 666 "${BUILD_DIR}/dev/loop-control" c 10 237
|
||||
mknod -m 666 "${BUILD_DIR}/dev/loop0" b 7 0
|
||||
mknod -m 666 "${BUILD_DIR}/dev/loop1" b 7 1
|
||||
mknod -m 666 "${BUILD_DIR}/dev/loop2" b 7 2
|
||||
mknod -m 666 "${BUILD_DIR}/dev/loop3" b 7 3
|
||||
mknod -m 666 "${BUILD_DIR}/dev/loop4" b 7 4
|
||||
mknod -m 666 "${BUILD_DIR}/dev/loop5" b 7 5
|
||||
mknod -m 666 "${BUILD_DIR}/dev/loop6" b 7 6
|
||||
mknod -m 666 "${BUILD_DIR}/dev/loop7" b 7 7
|
||||
|
||||
local loop
|
||||
|
||||
# Copy all loop devices from the host
|
||||
for loop in /dev/loop*; do
|
||||
if [ -b "${loop}" ]; then
|
||||
# Create the mountpoint
|
||||
: > "${BUILD_DIR}${loop}"
|
||||
|
||||
# Bind-mount the device
|
||||
mount --bind "${loop}" "${BUILD_DIR}${loop}"
|
||||
fi
|
||||
done
|
||||
|
||||
# Create directories
|
||||
mkdir -p "${BUILD_DIR}/dev/pts"
|
||||
|
||||
Reference in New Issue
Block a user