2017-03-07 10:13:22 -05:00
|
|
|
#!/bin/bash -e
|
2017-07-27 06:11:07 -04:00
|
|
|
|
2017-03-07 10:13:22 -05:00
|
|
|
IMG_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img"
|
|
|
|
|
2018-03-02 15:08:24 -05:00
|
|
|
IMGID="$(dd if="${IMG_FILE}" skip=440 bs=1 count=4 2>/dev/null | xxd -e | cut -f 2 -d' ')"
|
2017-03-07 10:13:22 -05:00
|
|
|
|
|
|
|
BOOT_PARTUUID="${IMGID}-01"
|
|
|
|
ROOT_PARTUUID="${IMGID}-02"
|
|
|
|
|
2018-03-02 15:08:24 -05:00
|
|
|
sed -i "s/BOOTDEV/PARTUUID=${BOOT_PARTUUID}/" "${ROOTFS_DIR}/etc/fstab"
|
|
|
|
sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" "${ROOTFS_DIR}/etc/fstab"
|
2017-03-07 10:13:22 -05:00
|
|
|
|
2018-03-02 15:08:24 -05:00
|
|
|
sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" "${ROOTFS_DIR}/boot/cmdline.txt"
|