Skip to content

Commit

Permalink
refactor: refactor generate DISKID
Browse files Browse the repository at this point in the history
As discussed in #71 changed behavior to
mentioned code by pelwel.

See #71 (comment)
for details.

Signed-off-by: Stephan Wendel <me@stephanwe.de>
  • Loading branch information
KwadFan committed Mar 28, 2023
1 parent fb80cdd commit 0c57f92
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions usr/lib/raspberrypi-sys-mods/firstboot
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
x
i
Expand Down

0 comments on commit 0c57f92

Please sign in to comment.