From 431136fdd54c02ae09d0fca5b63123c3205110c3 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Mon, 10 Nov 2014 22:37:11 -0500 Subject: install-lilo: Use PARTUUID for root option --- diff --git a/install-lilo.sh b/install-lilo.sh index 987b7a5..a421a36 100644 --- a/install-lilo.sh +++ b/install-lilo.sh @@ -5,6 +5,13 @@ set -u main() { local boot= + local root= + local rootdev= + local rootpart= + local b4= + local b3= + local b2= + local b1= [ "x$(id -u)" = 'x0' ] || error 'Must be run as the superuser' @@ -16,6 +23,15 @@ main() boot="$(mountpoint -n /boot | cut -d ' ' -f 1)" boot="${boot%%[0-9]}" root="$(mountpoint -n / | cut -d ' ' -f 1)" + rootdev="$(printf '%s\n' "${root}" | \ + sed 's|^\([/a-zA-Z]*\)\([0-9]*\)|\1|')" + rootpart="$(printf '%s\n' "${root}" | \ + sed 's|^\([/a-zA-Z]*\)\([0-9]*\)|\2|')" + read b4 b3 b2 b1 <<-EOF + $(od -An -tx1 -v -j 440 -N 4 "${rootdev}") + EOF + root="$(printf 'PARTUUID=%s-%02d\n' \ + "${b1}${b2}${b3}${b4}" ${rootpart})" elif [ ${#} -eq 2 ]; then boot="${1}" root="${2}" -- cgit v0.9.1