From 0c57f92968db0916fc0055184c2d9028612c0a36 Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Tue, 28 Mar 2023 17:29:25 +0200 Subject: [PATCH] refactor: refactor generate DISKID As discussed in #71 changed behavior to mentioned code by pelwel. See https://github.com/RPi-Distro/raspberrypi-sys-mods/pull/71#issuecomment-1484941247 for details. Signed-off-by: Stephan Wendel --- usr/lib/raspberrypi-sys-mods/firstboot | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/usr/lib/raspberrypi-sys-mods/firstboot b/usr/lib/raspberrypi-sys-mods/firstboot index 339131c..ae37d3a 100755 --- a/usr/lib/raspberrypi-sys-mods/firstboot +++ b/usr/lib/raspberrypi-sys-mods/firstboot @@ -63,11 +63,7 @@ get_variables () { fix_partuuid() { mount -o remount,rw "$ROOT_PART_DEV" mount -o remount,rw "$BOOT_PART_DEV" - MAJOR="$(uname -r | cut -f1 -d.)" - if [[ "$MAJOR" -eq "6" ]] && [[ -c /dev/hwrng ]]; then - dd if=/dev/hwrng of=/dev/urandom count=1 bs=256 status=none - fi - DISKID="$(tr -dc 'a-f0-9' < /dev/urandom | dd bs=1 count=8 2>/dev/null)" + DISKID="$(dd if=/dev/hwrng bs=4 count=1 | od -An -tx4 | cut -c2-9)" fdisk "$ROOT_DEV" > /dev/null <