2017-03-07 15:13:22 +00:00
|
|
|
#!/bin/bash -e
|
2017-07-27 10:11:07 +00:00
|
|
|
|
2019-12-02 16:19:05 +00:00
|
|
|
if [ "${NO_PRERUN_QCOW2}" = "0" ]; then
|
2017-03-07 15:13:22 +00:00
|
|
|
|
2019-12-02 16:19:05 +00:00
|
|
|
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
|
2017-03-07 15:13:22 +00:00
|
|
|
|
2019-12-02 16:19:05 +00:00
|
|
|
IMGID="$(dd if="${IMG_FILE}" skip=440 bs=1 count=4 2>/dev/null | xxd -e | cut -f 2 -d' ')"
|
2017-03-07 15:13:22 +00:00
|
|
|
|
2019-12-02 16:19:05 +00:00
|
|
|
BOOT_PARTUUID="${IMGID}-01"
|
|
|
|
ROOT_PARTUUID="${IMGID}-02"
|
|
|
|
|
|
|
|
sed -i "s/BOOTDEV/PARTUUID=${BOOT_PARTUUID}/" "${ROOTFS_DIR}/etc/fstab"
|
|
|
|
sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" "${ROOTFS_DIR}/etc/fstab"
|
|
|
|
|
|
|
|
sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" "${ROOTFS_DIR}/boot/cmdline.txt"
|
|
|
|
|
|
|
|
fi
|
2017-03-07 15:13:22 +00:00
|
|
|
|