Le 23/05/2020 à 22:56, Pierre Labastie via blfs-dev a écrit :
On Fri, 2020-05-15 at 21:34 +0200, Alain Dumont via blfs-dev wrote:
Hi all,

With grub I usually use PARTUUID rather than UUID to specify the
location of my file system :
linux/boot/vmlinuz root=PARTUUID="7d896f5 ....."
It works very well. But recently I needed to use initrd (*) and I
used
the script mkinitramfs described in the blfs-book chapter 5.
But then my system refused to start. The reason is that the init.in
script does not support the case of PARTUUID.
It is very easy to include this functionality in the script by
simply
adding a single line in the function do_mount_root() :

do_mount_root()
{
     mkdir /.root
     [ -n "$rootflags" ] && rootflags="$rootflags,"
     rootflags="$rootflags$ro"

     case "$root" in
           /dev/*    ) device=$root ;;
           UUID=*    ) eval $root; device="/dev/disk/by-uuid/$UUID" ;;
           PARTUUID=*) eval $root;
device="/dev/disk/by-partuuid/$PARTUUID" ;;   <=== add this line
           LABEL=*   ) eval $root; device="/dev/disk/by-label/$LABEL"
;;
           ""        ) echo "No root device specified." ; problem ;;
     esac

et voila!

a simple suggestion which could be included definitively in the
script
hoping that it would be useful for others.

Alain

(*) Here, initrd is required by lvm to check thin-pools at boot time
(I
use optional thin-provisonning-tools).

       More info about that in an other post if needed.



Done at r23196, together with a fix and another improvement. Thanks

Pierre


Thank you for considering my remark regarding the init.in script.
However, upon re-reading this script I notice that the do_try_resume()
function requires the same modification

PARTUUID = *) eval $resume; resume="/dev/disk/by-partuuid/$PARTUUID" ;;

Moreover and for the sake of homogeneity with do_mount_root(), the do_try_resume() function should also accept the option
/dev/*) resume=$root ;;

However, the kernel does not allow the specification of the swap partition by its UUID.
This option would be removed in the do_try_resume().

Documentation/admin-guide/kernel-parameters.txt
        resume=         [SWSUSP]
                        Specify the partition device for software suspend
                        Format:
{/dev/<dev> | PARTUUID=<uuid> | <int>:<int> | <hex>}

I did the test on my own machine and I can confirm this, UUID is useless in do_try_resume() As for the <int>:<int> and <hex> options, they are not processed by the script. I'll see it maybe another time.

Best regards.

Alain
--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to