Summary: | Grub does not update netboot files | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Thomas Schweikle <tps> |
Component: | [OLD] Core system | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Thomas Schweikle
2005-08-19 13:18:47 UTC
Workaround: before emergeing grub: rm -rf /lib/grub/* rm -rf /usr/lib/grub/* rm -rf /boot/grub/*stage* nbgrub pxegrub then emerge grub: emerge grub copy missing files: cp /usr/lib/grub/* /boot/grub chmod 0644 /boot/grub/* Install grub to your hd: /sbin/grub --batch \ --device-map=/boot/grub/device.map \ < /boot/grub/grub.conf BTW: shouldn't files in "/usr/lib/grub" be installed with permission bits set to "0644"? AFAIK there is no neccessity to make them executable! the files are copied in the pkg_postinst stage: >>> /boot/grub/splash.xpm.gz * Linking from new grub.conf name to menu.lst * Copying files from /lib/grub and /usr/lib/grub to /boot >>> Regenerating /etc/ld.so.cache... Yes, it tells us, but there isn't anything copied, if these files already exist. Any program can print anything. It must not mean it is doing it! This doesn't work as expected: einfo "Copying files from /lib/grub and /usr/lib/grub to /boot" for x in /lib/grub/*/* /usr/lib/grub/*/* ; do [[ -f ${x} ]] && cp -p ${x} /boot/grub done For testing I changed, assuming execution by "sh": #! /bin/sh for x in /lib/grub/*/* /usr/lib/grub/*/* ; do [[ -f ${x} ]] && ls -la ${x} done Now here is what is exausted: yew grub # ~/test -rw-r--r-- 1 root root 8052 Aug 19 21:55 /lib/grub/i386-pc/e2fs_stage1_5 -rw-r--r-- 1 root root 7812 Aug 19 21:55 /lib/grub/i386-pc/fat_stage1_5 -rw-r--r-- 1 root root 7092 Aug 19 21:55 /lib/grub/i386-pc/ffs_stage1_5 -rw-r--r-- 1 root root 7124 Aug 19 21:55 /lib/grub/i386-pc/iso9660_stage1_5 -rw-r--r-- 1 root root 8576 Aug 19 21:55 /lib/grub/i386-pc/jfs_stage1_5 -rw-r--r-- 1 root root 7284 Aug 19 21:55 /lib/grub/i386-pc/minix_stage1_5 -rw-r--r-- 1 root root 9556 Aug 19 21:55 /lib/grub/i386-pc/reiserfs_stage1_5 -rw-r--r-- 1 root root 512 Aug 19 21:55 /lib/grub/i386-pc/stage1 -rw-r--r-- 1 root root 105576 Aug 19 21:55 /lib/grub/i386-pc/stage2 -rw-r--r-- 1 root root 105576 Aug 19 21:55 /lib/grub/i386-pc/stage2_eltorito -rw-r--r-- 1 root root 7368 Aug 19 21:55 /lib/grub/i386-pc/ufs2_stage1_5 -rw-r--r-- 1 root root 6708 Aug 19 21:55 /lib/grub/i386-pc/vstafs_stage1_5 -rw-r--r-- 1 root root 9404 Aug 19 21:55 /lib/grub/i386-pc/xfs_stage1_5 And here is what is in "/lib/grub": yew grub # ls -lA /lib/grub/i386-pc/ total 312 -rw-r--r-- 1 root root 8052 Aug 19 21:55 e2fs_stage1_5 -rw-r--r-- 1 root root 7812 Aug 19 21:55 fat_stage1_5 -rw-r--r-- 1 root root 7092 Aug 19 21:55 ffs_stage1_5 -rw-r--r-- 1 root root 7124 Aug 19 21:55 iso9660_stage1_5 -rw-r--r-- 1 root root 8576 Aug 19 21:55 jfs_stage1_5 -rw-r--r-- 1 root root 7284 Aug 19 21:55 minix_stage1_5 -rw-r--r-- 1 root root 9556 Aug 19 21:55 reiserfs_stage1_5 -rw-r--r-- 1 root root 512 Aug 19 21:55 stage1 -rw-r--r-- 1 root root 105576 Aug 19 21:55 stage2 -rw-r--r-- 1 root root 105576 Aug 19 21:55 stage2_eltorito -rw-r--r-- 1 root root 7368 Aug 19 21:55 ufs2_stage1_5 -rw-r--r-- 1 root root 6708 Aug 19 21:55 vstafs_stage1_5 -rw-r--r-- 1 root root 9404 Aug 19 21:55 xfs_stage1_5 And here what "/usr/lib/grub" holds: yew grub # ls -lA /usr/lib/grub total 600 -rwxr-xr-x 1 root root 197444 Aug 19 21:55 nbgrub -rwxr-xr-x 1 root root 198468 Aug 19 21:55 pxegrub -rwxr-xr-x 1 root root 198020 Aug 19 21:55 stage2.netboot Your error: you are assuming *one* subdirectory. This assumtion isn't true for "/usr/lib/grub". A better way copying the files would be: for d in /lib/grub /usr/lib/grub; do find d -type f -exec cp -p {} /boot/grub \; done or if find permits it (it should since we are on an GNU system ;-) ): find /lib/grub /usr/lib/grub -type f -exec cp -p {} /boot/grub \; not really the bug is that the netboot files are installed into /usr/lib/grub instead of /usr/lib/grub/<an arch dir>/ fixed in cvs The copy routine is a bad idea IMHO. I had a bad morning today: compiling grub for three architectures I noticed this routine copying the files for "alpha", then for "i386", overwriting what was just copied, then copying for "ppc" again overwriting what was just copied. Afterwards I wondered why grub installed perfectly, but a reboot failed! It just had to fail, since a PII can't interpret ppc code. With this "little" problem I would prefer to copy grub *including* the <arch>-directory or, alternatively only copy the files related to the given <arch>. Modifying the copy procedure to be: cp -R /lib/grub/* /boot/grub cp -R /usr/lib/grub/* /boot/grub or (I'd prefer): cp -R /lib/grub/$( uname -m )/* i dont think anyone has attempted cross-grub builds before sanest thing would prob to modify the grub build to install into /lib/grub/$(tc-arch)/ and then we'd copy files from there |