Bug 25216 - mkboot in debianutils uses qpkg to search all packages
|
Bug#:
25216
|
Product: Gentoo Linux
|
Version: 1.4_rc4
|
Platform: All
|
|
OS/Version: Linux
|
Status: RESOLVED
|
Severity: minor
|
Priority: P2
|
|
Resolution: FIXED
|
Assigned To: azarah@gentoo.org
|
Reported By: farcepest@gmail.com
|
|
Component: Core system
|
|
|
URL:
|
|
Summary: mkboot in debianutils uses qpkg to search all packages
|
|
Keywords:
|
|
Status Whiteboard:
|
|
Opened: 2003-07-24 17:27 0000
|
In /usr/sbin/mkboot grubcheck(), grub is tested for by the line:
[ "$(qpkg -nc sys-apps/grub)" = "sys-apps/grub *" ]
This is a big time-waster, because it crawls the entire portage tree. If your
portage tree is mounted via NFS, this is painful...
A better solution is:
[ "$(qpkg -I -nc sys-apps/grub)" = "sys-apps/grub" ]
An updated version of debianutils-1.16.7-gentoo.patch will be attached.
Reproducible: Always
Steps to Reproduce:
1. Use mkboot, usually via kernel's make install
2.
3.
Actual Results:
It finds grub (slowly)
Expected Results:
Find grub (quickly)
Created an attachment (id=14976) [details]
Make mkboot not read the whole portage tree
This is a modified version of debianutils-1.16.7-gentoo.patch in the current
portage tree which makes the grubcheck() function of mkboot much faster.
I bumped up against this but in a worse form - It's not just slow, it doesn't
work.
The line
[ "$(qpkg -I -nc sys-apps/grub)" = "sys-apps/grub" ]
Fails to detect my grub because I also have grub-static installed, which causes
qpkg to return
sys-apps/grub *
sys-apps/grub-static
which fails the test.
Quick correction - I typoed
[ "$(qpkg -nc sys-apps/grub)" = "sys-apps/grub *" ]
Is the line that doesn't work
[ "$(qpkg -I -nc sys-apps/grub)" = "sys-apps/grub" ]
does work.
if [ -x /usr/bin/qpkg ] ; then
[ "$(qpkg -I -nc sys-apps/grub)" = "sys-apps/grub" ]
else
return 1
fi
This never returns zero!
At least it should be:
if [ -x /usr/bin/qpkg ] ; then
[ "$(qpkg -I -nc sys-apps/grub)" = "sys-apps/grub" ] && return 0
else
return 1
fi
But it cannot fail just because gentoolkit is not installed, and there's the
grub-static problem... Summing up, why don't we simply have
if [ -f /boot/grub/grub.conf ] ; then
return 0
else
return 1
fi
As /boot might not be mounted ...
Anyhow, use portageq and not quickpkg.