Adds call to mknod if loop dev does not exist after call to losetup -f
(#483)
This commit is contained in:
@@ -102,3 +102,11 @@ update_issue() {
|
||||
echo -e "Raspberry Pi reference ${IMG_DATE}\nGenerated using ${PI_GEN}, ${PI_GEN_REPO}, ${GIT_HASH}, ${1}" > "${ROOTFS_DIR}/etc/rpi-issue"
|
||||
}
|
||||
export -f update_issue
|
||||
|
||||
ensure_next_loopdev() {
|
||||
local loopdev
|
||||
loopdev="$(losetup -f)"
|
||||
loopmaj="$(echo "$loopdev" | sed -E 's/.*[^0-9]*?([0-9]+)$/\1/')"
|
||||
[[ -b "$loopdev" ]] || mknod "$loopdev" b 7 "$loopmaj"
|
||||
}
|
||||
export -f ensure_next_loopdev
|
||||
|
Reference in New Issue
Block a user