X-Git-Url: https://git.ao2.it/kboot-utils.git/blobdiff_plain/ba32c0d281280ce7c63394b1d71404fdb6d18b18..5e2be1396bf9e22f0692874d3d242bfaf4d2661b:/kboot-mkconfig_lib diff --git a/kboot-mkconfig_lib b/kboot-mkconfig_lib index 155cca0..080edf7 100644 --- a/kboot-mkconfig_lib +++ b/kboot-mkconfig_lib @@ -90,18 +90,20 @@ version_find_latest () } linux_find_root_device() { - RDEV=$(mountpoint -d /) + ROOT_DEVICE=$(mountpoint -d /) for devnode in $(find /dev); do - if [ $(stat --printf="%t:%T" "$devnode") = $RDEV ]; + # Get major and minor in decimal + CURRENT_DEVICE=$(printf "%d:%d" $(stat --printf="0x%t 0x%T" "$devnode")) + if [ $CURRENT_DEVICE = $ROOT_DEVICE ]; then - ROOTDEVICE="$devnode" + ROOT_NODE="$devnode" break fi done - echo "$ROOTDEVICE" + echo "$ROOT_NODE" } linux_entry () @@ -144,7 +146,7 @@ list_kernels () alt_version=`echo $version | sed -e "s,\.old$,,g"` # TODO: remove this too #linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" - linux_root_device_thisversion=linux_find_root_device + linux_root_device_thisversion=`linux_find_root_device` initrd= for i in "initrd.img-${version}" "initrd-${version}.img" \