On Tue, 2020-05-26 at 14:24 +0200, Alain Dumont via blfs-dev wrote:
>
> 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"
> ;;
This has to be tested, I suspect that if the kernel is able to find the
partition by himself (which is the case if using PARTUUID), it bypasses
the initrd, since it has the memory image anyway.
>
> Moreover and for the sake of homogeneity with do_mount_root(), the
> do_try_resume() function should also accept the option
> /dev/*) resume=$root ;;
nope, this would be resume=$resume, which is a nop.
>
> 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()
What the kernel does not accept on its command line is left for
initramfs... Last time I checked, it was working with UUID... Maybe
they have changed something in the kernel now, but there is no reason
that it stops working: we do convert UUID to a true /dev/something, and
run the command for resuming from that device.
If we use resume=/dev/<not a logical volume> or resume=PARTUUID=, then
the kernel is able to load the memory image without help, and it
resumes from there (bypasses the initrd, I think, so the do_try_resume
function does not need any change). If using /dev/<logical volume> or
UUID=, or LABEL=, it is a job for the initramfs.
Pierre
--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page