sexybit grub # emerge grub >>> emerge sys-apps/grub-0.90-r7 to / >>> md5 ;-) grub-0.90.tar.gz Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more information. /dev/hdb3 on / type ext3 (rw) [...] sexybit root # emerge --debug grub Calculating dependencies ...done! >>> emerge sys-apps/grub-0.90-r7 to / [...........] >>> md5 ;-) grub-0.90.tar.gz + dyn_setup + pkg_setup + '[' / '!=' / ']' ++ grep /boot /etc/fstab ++ grep -v '^[ \t]*#' + '[' -z '' ']' + local myboot ++ cat /etc/fstab ++ grep -v '^#' ++ grep /boot ++ sed -e 's/^[^[:space:]]*[[:space:]]*\([^[:space:]]*\).*$/\1/' + myboot= ++ cat /proc/mounts ++ cut -f2 '-d ' ++ grep Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more information. + '[' ']' + mount /dev/hdb3 on / type ext3 (rw) [........] This output is due to the pkg_setup() stuff in sys-apps/grub-0.90-r7 i.e. : [ `cat /proc/mounts | cut -f2 -d" " | grep $myboot` ] && return 0 mount $myboot I've not a /boot partition so $myboot is empty and the ^^^^ fails. *If $myboot is empty* we could safely assume that /boot is NOT a separate partition, avoid that 'errorr' stuff and provide a check. Something like: if [ -z $myboot ]; then einfo "Assuming you don't have a separate /boot partition. using /boot dir" [ -d /boot ] || mkdir /boot fi Maurizio aka j2ee
this is already taken into consideration ... the problem is with this code ... notice the 'usage: grep' display ... basically whatever got passed to grep, grep did not like :) please post your /etc/fstab pkg_setup() { [ "$ROOT" != "/" ] && return 0 #If the user doesn't have a /boot or /mnt/boot filesystem, skip. [ -z "`grep /boot /etc/fstab | grep -v "^[ \t]*#"`" ] || return 0 ... }
well, the problem here is not with my fstab. exactly, if you don't have a /boot line in /etc/fstab, and you're not supposed to have one if your /boot isn't a separate partition, myboot=`cat /etc/fstab | grep -v ^# | grep /boot | \ sed -e 's/^[^[:space:]]*[[:space:]]*\([^[:space:]]*\).*$/\1/'` the ^^^^ stuff will result in an empty $myboot and 'grep' in the following line will fail if $myboot is empty. [ `cat /proc/mounts | cut -f2 -d" " | grep $myboot` ] Here's again, the verbose output of emerge grub. ++ grep /boot ++ sed -e 's/^[^[:space:]]*[[:space:]]*\([^[:space:]]*\).*$/\1/' + myboot= ++ cat /proc/mounts ++ cut -f2 '-d ' ++ grep Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more information.
im going to go ahead and say it might be your /etc/fstab :P i say this because i have machines that dont have 'boot' anywhere in their /etc/fstab and emergeing grub is not a problem on them so will you please post it ?
You're right. What happened to me ( when you don't have a separate /boot part. ) will not prevent grub to be installed. However, we should avoid those msg to be displayed. Instead of tweaking the grub ebuild, the solution might be woodchip's request in bug 7903. I'll try to work on that eclass. (bug 7903) Woodchip: please tell me if you've already started to work on that eclass. Here's my poor fstab :) /dev/hdb1 /mnt/new ext3 defaults 0 2 /dev/hdb3 / ext3 defaults 0 1 /dev/hdb2 none swap sw 0 2 /dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0 proc /proc proc defaults 0 0 I'm marking this bug as dependent on 7903.
ok so the pkg_setup() has this error ... basically its is this: #If the user doesn't have a /boot or /mnt/boot filesystem, skip. [ -z "`grep /boot /etc/fstab | grep -v "^[ \t]*#"`" ] || return 0 i'm pretty sure that should be '&& return 0' and not '|| return 0'
mount-boot eclass should be in use now.