From c0513c547adf7bb85d91ccea97453d7d91ce0c60 Mon Sep 17 00:00:00 2001 From: James Ruan Date: Thu, 31 Aug 2017 18:22:33 +0800 Subject: export-image: when work in a non-English locale environment the PARTUUID will silently fail, resulting to an unbootable image file. (#96) * use dd and xxd to get disk identifier * add xxd as dependency --- export-image/03-set-partuuid/00-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'export-image') diff --git a/export-image/03-set-partuuid/00-run.sh b/export-image/03-set-partuuid/00-run.sh index dccc55e..4b18405 100755 --- a/export-image/03-set-partuuid/00-run.sh +++ b/export-image/03-set-partuuid/00-run.sh @@ -2,7 +2,7 @@ IMG_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img" -IMGID="$(fdisk -l ${IMG_FILE} | sed -n 's/Disk identifier: 0x\([^ ]*\)/\1/p')" +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" -- cgit v1.2.3