FS#25701 - [grub2-common] grub-mkconfig doesn't work without using an initrd
Attached to Project:
Arch Linux
Opened by Paride Legovini (torn) - Sunday, 21 August 2011, 18:03 GMT
Last edited by Ronald van Haren (pressh) - Sunday, 15 January 2012, 10:51 GMT
Opened by Paride Legovini (torn) - Sunday, 21 August 2011, 18:03 GMT
Last edited by Ronald van Haren (pressh) - Sunday, 15 January 2012, 10:51 GMT
|
Details
When no initrd is used the root partition is mounted from
the fictitious device /dev/root:
% mount /dev/root on / type ext4 (rw,relatime,commit=0) but this breaks grub-mkconfig (grub-probe in particular, and maybe other things): # grub-mkconfig /sbin/grub-probe: error: cannot stat `/dev/root'. See also https://bugs.archlinux.org/task/25659 for a discussion about the issue I had with the udev maintainers. |
This task depends upon
Closed by Ronald van Haren (pressh)
Sunday, 15 January 2012, 10:51 GMT
Reason for closing: Implemented
Additional comments about closing: added a comment in the install file that it may fail on systems running a custom kernel
Sunday, 15 January 2012, 10:51 GMT
Reason for closing: Implemented
Additional comments about closing: added a comment in the install file that it may fail on systems running a custom kernel
Maybe the tip from 25659 could be added
/*
Comment by Gerardo Exequiel Pozzi (djgera) - Tuesday, 23 August 2011, 20:07 GMT-4
Or trivially but not dynamic: "ln -s /dev/your-partition /lib/udev/devices/root". Just keep in mind this if you change your root-partition on migration ;)
*/
https://wiki.archlinux.org/index.php/Kernel_Compilation_without_ABS
https://wiki.archlinux.org/index.php/Kernel_Compilation_without_ABS_for_New_Users#16.29_Configure_Bootloader
https://wiki.archlinux.org/index.php/GRUB2
Loading a the initrd is unwanted by many custom-kernel users, it is unnecessary. So including the initrd is a ugly workaround. Also it should (?) be necessary to remove one or more hooks from the mkinitcpip.conf (filesystem, sata or pata). With the initrd (and the regular hooks) it get always a message that the "modprobe.dep" couldn't be loaded, it think this is caused by one of this hooks. But editing the mkinitcpio.conf will, of course, break the kernels offered by Archlinux itself!
Here are the current mount points:
% mount
/dev/root on / type ext4 (rw,noatime,user_xattr,barrier=1,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=1024896k,nr_inodes=256224,mode=755)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
/sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
/run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=262144k)
%
Also /dev/root actually does not exist:
% file /dev/root
/dev/root: ERROR: cannot open `/dev/root' (No such file or directory)
%
'Trying to automatically create a config. This may fail on some systems running a custom kernel. Please refer to the wiki on how to create a config manually'
Or do we know what exactly makes it fail so we can condition on that?
So no, it is not the same as running grub-install, which actually has effect on your systems behavior. IMO that should not be done (I'm not sure what would happen if you would run this in a chroot or something....)
Either way, we can set a conditional on when to or not to run grub-mkconfig (if we know that is), or simply try to run it and have a message stating that is may fail on some custom kernels. We could even copy a generic example file and try to overwrite it with grub-mkconfig so if it fails there is still something there that the user can build upon. Though I don't think I prefer this last one.
Btw this is the grub2 bug I'd like to close before pushing the updated packages, the rest is already in trunk (mostly).