Gentoo Archives: gentoo-user

From: "Sven Köhler" <skoehler@×××.de>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: grub weirdness
Date: Wed, 07 May 2008 10:14:18
Message-Id: fvrvd1$ecf$1@ger.gmane.org
In Reply to: Re: [gentoo-user] Re: grub weirdness by Wolf Canis
1 > To avoid automounting and autoinstalling with /boot,
2 > just export the DONT_MOUNT_BOOT variable.
3
4 Which /boot partition? I don't have any ...
5
6 >> If there's a setup-command in your grub.conf, it is indeed executed.
7 >> So if that command is outdated (something you won't notice, since that
8 >> command is not used by grub in any situation i know), the ebuild will
9 >> execute that setup-command and write to some device's boot sector. How
10 >> evil, again!
11 >>
12 >> Regards,
13 >> Sven
14 >>
15 >> P.S.: here's the code from grub-0.97-r5.ebuild:
16 >>
17 >> if [[ -e ${dir}/grub.conf ]] ; then
18 >> egrep \
19 >> -v
20 >> '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)'
21 >> \
22 >> "${dir}"/grub.conf | \
23 >> /sbin/grub --batch \
24 >> --device-map="${dir}"/device.map \
25 >> > /dev/null
26 >> fi
27 > And following the code of the functions which does the job:
28 > found in ebuild: /usr/portage/sys-boot/grub/grub-0.97-r5.ebuild
29 >
30 > setup_boot_dir() {
31 > local boot_dir=$1
32 > local dir=${boot_dir}
33 >
34 > [[ ! -e ${dir} ]] && die "${dir} does not exist!"
35 > [[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot"
36 > dir="${dir}/grub"
37 > if [[ ! -e ${dir} ]] ; then
38 > mkdir "${dir}" || die "${dir} does not exist!"
39 > fi
40 >
41 > # change menu.lst to grub.conf
42 > if [[ ! -e ${dir}/grub.conf ]] && [[ -e ${dir}/menu.lst ]] ; then
43 > mv -f "${dir}"/menu.lst "${dir}"/grub.conf
44 > ewarn
45 > ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
46 > ewarn
47 > fi
48 >
49 > if [[ -e ${dir}/stage2 ]] ; then
50 > mv "${dir}"/stage2{,.old}
51 > ewarn "*** IMPORTANT NOTE: you must run grub and install"
52 > ewarn "the new version's stage1 to your MBR. Until you do,"
53 > ewarn "stage1 and stage2 will still be the old version, but"
54 > ewarn "later stages will be the new version, which could"
55 > ewarn "cause problems such as an unbootable system."
56 > ebeep
57 > fi
58 >
59 > einfo "Copying files from /lib/grub and /usr/lib/grub to ${dir}"
60 > for x in "${ROOT}"/lib*/grub/*/* "${ROOT}"/usr/lib*/grub/*/* ; do
61 > [[ -f ${x} ]] && cp -p "${x}" "${dir}"/
62 > done
63 >
64 > if [[ -e ${dir}/grub.conf ]] ; then
65 > egrep \
66 > -v
67 > '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)'
68 > \
69 > "${dir}"/grub.conf | \
70 > /sbin/grub --batch \
71 > --device-map="${dir}"/device.map \
72 > > /dev/null
73 > fi
74 >
75 > # the grub default commands silently piss themselves if
76 > # the default file does not exist ahead of time
77 > if [[ ! -e ${dir}/default ]] ; then
78 > grub-set-default --root-directory="${boot_dir}" default
79 > fi
80 > }
81 >
82 >
83 > How you can see isn't the message piped to /dev/null, only
84 > the command "/sbin/grub -batch -device-map...".
85
86 Why should i worry about the message being piped to /dev/null?
87
88 I worry about a message saying "you have to do it by hand" although some
89 harmful "magic" is going on behind the scenes (the egrep+grub command)
90 although we are not informed about it (command is piped to /dev/null,
91 not message about it, etc.).

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[gentoo-user] Re: grub weirdness "»Q«" <boxcars@×××.net>