mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-23 19:46:31 +01:00
refactor+docs(payload.img, payload.img discovery): split offline distfiles at improve: import_payload so main image is minimal and payload.img is primary carrier, detect payload.img automaticly using magic number
This commit is contained in:
parent
e20afe69bb
commit
beb9fb12f9
5 changed files with 234 additions and 26 deletions
|
|
@ -7,5 +7,31 @@ set -ex
|
|||
|
||||
if [ "${PAYLOAD_REQUIRED}" = True ]; then
|
||||
mkdir -p /external/distfiles
|
||||
payload-import /external/distfiles
|
||||
found_payload=0
|
||||
|
||||
# Probe all block devices reported by the running kernel instead of
|
||||
# assuming fixed names like /dev/sdb or /dev/hdb.
|
||||
while read -r major minor blocks name; do
|
||||
case "${name}" in
|
||||
""|name|ram*|loop*|fd*|sr*|md*)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
dev_path="/dev/${name}"
|
||||
if [ ! -b "${dev_path}" ]; then
|
||||
mknod -m 600 "${dev_path}" b "${major}" "${minor}" || :
|
||||
fi
|
||||
|
||||
if payload-import --probe "${dev_path}"; then
|
||||
payload-import --device "${dev_path}" /external/distfiles
|
||||
found_payload=1
|
||||
break
|
||||
fi
|
||||
done < /proc/partitions
|
||||
|
||||
if [ "${found_payload}" != 1 ]; then
|
||||
echo "payload-import failed: no payload image found on detected block devices." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue