Summary: | sysutils/grub2 10_kfreebsd fails to identify kernel and zpool.cache proper location | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | bergerkos | ||||||||
Component: | Individual Port(s) | Assignee: | freebsd-ports-bugs (Nobody) <ports-bugs> | ||||||||
Status: | Closed Feedback Timeout | ||||||||||
Severity: | Affects Some People | CC: | miwi | ||||||||
Priority: | --- | ||||||||||
Version: | Latest | ||||||||||
Hardware: | amd64 | ||||||||||
OS: | Any | ||||||||||
Attachments: |
|
Two points: 1) incredibly, this port is unmaintained 2) you provided a patch to the source whereas you should have provided a part to the port (e.g. a patch that creates a patch in files/ directory). Since there is no maintainer, I'll promote this anyway. Oh, sorry. Didn't know all these details. This isn't even a patch to the source. I just extracted the tarball, I think you were probably thinking of ${WRKSRC}/util/grub.d/10_kfreebsd.in. You provided a patch to the installed product rather than the template. Can you submit a new attachment that is a proper patch to the source? in other words, > make clean ; make extract > cd <work>/grub-2.00/util/grub.d/ > cp -a 10_kfreebsd.in 10_kfreebsd.in.orig modify 10_kfreebsd.in > cd /usr/ports/sysutils/grub > make makepatch you should have a good patch in files directory. OK thanks. Now that you've explained what to do I'll see into it. (In reply to John Marino from comment #3) thanks a lot!! The more I learn about FreeBSD build system, the more I love it. Created attachment 153897 [details]
new patch file
Here is the patch to the source
Created attachment 153914 [details]
patch for --search sting to work properly
Here is another patch linked to the one above. Without it the "--search ..." string produced by grub-mkconfig doesn't work properly.
OK, here are some updates upon these patches. 1. The one to correct the detection of zpool.cache is not needed for the current GIT version of GRUB. However, it IS needed for the current version of sysutils/grub2 port and the source it is based upon. 2. Other patches are meant to trim up the looks of the resulting grub.cfg. However, GRUB maintainers upstream claim that the existing script deals with the possibility of different modules being on different partitions/disks. While this makes little sense to me from the practical vewpoint, this capacity should be preserved. Although such customized setups will still need manual configuration... In which case these patches must be removed in order to keep that capacity of grub-mkconfig. CONCLUSION: I will test all this as soon as possible and then submit the resulting patch that will only correct the detection of /boot/zfs/zpool.cache for the existing port version -- if the resulting grub.cfg will be useful for booting the system. |
Created attachment 150413 [details] patch to 10_kfreebsd file. On my system, which is amd64, zfs root, the 10_kfreebsd template found under /usr/local/etc/grub.d causes grub-mkconfig script to erroneously define kernel as /boot/kernel instead of /boot/kernel/kernel, while also looking for zfs/zpool.cache under /boot/kernel, while it usually resides under /boot. Logical, too, because /boot/kernel is subject to being moved with a new kernel installation, which mustn't concern zpool.cache file. Another problem I see is needless repetition of the string "search --no-floppy --fs-uuid --set=root $UUID" every now and then in the created grub.cfg, while it is properly belongs only once, at the top of a menu entry, where "root" is defined. This I was able to correct, see the attached patch. It also deals with \t meant for <tab>, which has been reported elsewhere. The result is a clean and correct grub.cfg file, which can be used.