export-image: generate bmap file if bmaptool is available
This commit is contained in:
parent
f621f9e279
commit
2e5d13e1b9
@ -22,7 +22,7 @@ To install the required dependencies for `pi-gen` you should run:
|
||||
```bash
|
||||
apt-get install coreutils quilt parted qemu-user-static debootstrap zerofree zip \
|
||||
dosfstools libarchive-tools libcap2-bin grep rsync xz-utils file git curl bc \
|
||||
gpg pigz xxd arch-test
|
||||
gpg pigz xxd arch-test bmap-tools
|
||||
```
|
||||
|
||||
The file `depends` contains a list of tools needed. The format of this
|
||||
|
@ -3,6 +3,7 @@
|
||||
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
|
||||
INFO_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.info"
|
||||
SBOM_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.sbom"
|
||||
BMAP_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.bmap"
|
||||
|
||||
on_chroot << EOF
|
||||
update-initramfs -k all -c
|
||||
@ -100,6 +101,12 @@ zerofree "${ROOT_DEV}"
|
||||
|
||||
unmount_image "${IMG_FILE}"
|
||||
|
||||
if hash bmaptool 2>/dev/null; then
|
||||
bmaptool create \
|
||||
-o "${BMAP_FILE}" \
|
||||
"${IMG_FILE}"
|
||||
fi
|
||||
|
||||
mkdir -p "${DEPLOY_DIR}"
|
||||
|
||||
rm -f "${DEPLOY_DIR}/${ARCHIVE_FILENAME}${IMG_SUFFIX}.*"
|
||||
@ -128,4 +135,7 @@ esac
|
||||
if [ -f "${SBOM_FILE}" ]; then
|
||||
xz -c "${SBOM_FILE}" > "$DEPLOY_DIR/image_$(basename "${SBOM_FILE}").xz"
|
||||
fi
|
||||
if [ -f "${BMAP_FILE}" ]; then
|
||||
xz -c "${BMAP_FILE}" > "$DEPLOY_DIR/image_$(basename "${BMAP_FILE}").xz"
|
||||
fi
|
||||
cp "$INFO_FILE" "$DEPLOY_DIR/"
|
||||
|
Loading…
x
Reference in New Issue
Block a user