diff options
| author | Serge Schneider <serge@raspberrypi.com> | 2022-03-18 17:03:26 +0000 |
|---|---|---|
| committer | Serge Schneider <serge@raspberrypi.com> | 2022-03-21 08:37:25 +0000 |
| commit | b0316ae8706e3abe0d4bd2bdf1cda976a6e2e6a7 (patch) | |
| tree | 31c596c8795a2151200955cb9dd5000491abbba7 /export-image/04-set-partuuid | |
| parent | 95ac3cfb3b223dad058c1aee1d8b6e3f5e5b5935 (diff) | |
Enable userconf-pi on first boot
Diffstat (limited to 'export-image/04-set-partuuid')
| -rwxr-xr-x | export-image/04-set-partuuid/00-run.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/export-image/04-set-partuuid/00-run.sh b/export-image/04-set-partuuid/00-run.sh new file mode 100755 index 0000000..16e1b15 --- /dev/null +++ b/export-image/04-set-partuuid/00-run.sh @@ -0,0 +1,18 @@ +#!/bin/bash -e + +if [ "${NO_PRERUN_QCOW2}" = "0" ]; then + + IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img" + + IMGID="$(dd if="${IMG_FILE}" skip=440 bs=1 count=4 2>/dev/null | xxd -e | cut -f 2 -d' ')" + + 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 + |
