33 |
grub_setup=${sbindir}/grub-setup |
grub_setup=${sbindir}/grub-setup |
34 |
grub_mkimage=${sbindir}/grub-mkimage |
grub_mkimage=${sbindir}/grub-mkimage |
35 |
grub_mkdevicemap=${sbindir}/grub-mkdevicemap |
grub_mkdevicemap=${sbindir}/grub-mkdevicemap |
36 |
|
grub_probefs=${sbindir}/grub-probefs |
37 |
rootdir= |
rootdir= |
38 |
grub_prefix=/boot/grub |
grub_prefix=/boot/grub |
39 |
|
modules= |
40 |
|
|
41 |
install_device= |
install_device= |
42 |
no_floppy= |
no_floppy= |
53 |
|
|
54 |
-h, --help print this message and exit |
-h, --help print this message and exit |
55 |
-v, --version print the version information and exit |
-v, --version print the version information and exit |
56 |
|
--modules=MODULES pre-load specified modules MODULES |
57 |
--root-directory=DIR install GRUB images under the directory DIR |
--root-directory=DIR install GRUB images under the directory DIR |
58 |
instead of the root directory |
instead of the root directory |
59 |
--grub-setup=FILE use FILE as grub-setup |
--grub-setup=FILE use FILE as grub-setup |
60 |
--grub-mkimage=FILE use FILE as grub-mkimage |
--grub-mkimage=FILE use FILE as grub-mkimage |
61 |
--grub-mkdevicemap=FILE use FILE as grub-mkdevicemap |
--grub-mkdevicemap=FILE use FILE as grub-mkdevicemap |
62 |
|
--grub-probefs=FILE use FILE as grub-probefs |
63 |
--no-floppy do not probe any floppy drive |
--no-floppy do not probe any floppy drive |
64 |
--recheck probe a device map even if it already exists |
--recheck probe a device map even if it already exists |
65 |
|
|
82 |
-v | --version) |
-v | --version) |
83 |
echo "grub-install (GNU GRUB ${PACKAGE_VERSION})" |
echo "grub-install (GNU GRUB ${PACKAGE_VERSION})" |
84 |
exit 0 ;; |
exit 0 ;; |
85 |
|
--modules=*) |
86 |
|
modules=`echo "$option" | sed 's/--modules=//'` ;; |
87 |
--root-directory=*) |
--root-directory=*) |
88 |
rootdir=`echo "$option" | sed 's/--root-directory=//'` ;; |
rootdir=`echo "$option" | sed 's/--root-directory=//'` ;; |
89 |
--grub-setup=*) |
--grub-setup=*) |
91 |
--grub-mkimage=*) |
--grub-mkimage=*) |
92 |
grub_mkimage=`echo "$option" | sed 's/--grub-mkimage=//'` ;; |
grub_mkimage=`echo "$option" | sed 's/--grub-mkimage=//'` ;; |
93 |
--grub-mkdevicemap=*) |
--grub-mkdevicemap=*) |
94 |
grub_setup=`echo "$option" | sed 's/--grub-mkdevicemap=//'` ;; |
grub_mkdevicemap=`echo "$option" | sed 's/--grub-mkdevicemap=//'` ;; |
95 |
|
--grub-probefs=*) |
96 |
|
grub_probefs=`echo "$option" | sed 's/--grub-probefs=//'` ;; |
97 |
--no-floppy) |
--no-floppy) |
98 |
no_floppy="--no-floppy" ;; |
no_floppy="--no-floppy" ;; |
99 |
--recheck) |
--recheck) |
206 |
cp -f $file ${grubdir} || exit 1 |
cp -f $file ${grubdir} || exit 1 |
207 |
done |
done |
208 |
|
|
209 |
# Create the core image. |
# Create the core image. First, auto-detect the filesystme module. |
210 |
modules="_chain pc" |
fs_module=`$grub_probefs --device-map=${device_map} ${grubdir}` |
211 |
# XXX This must be dynamic. I'm still thinking how to implement this. |
if test "x$fs_module" = x -a "x$modules" = x; then |
212 |
modules="$modules fat" |
echo "Auto-detection of a filesystem module failed." 1>&2 |
213 |
|
echo "Please specify the module with the option `--modules' explicitly." 1>&2 |
214 |
|
exit 1 |
215 |
|
fi |
216 |
|
|
217 |
|
# Typically, _chain and pc are required. |
218 |
|
modules="$modules $fs_module _chain pc" |
219 |
|
|
220 |
$grub_mkimage --output=${grubdir}/core.img $modules || exit 1 |
$grub_mkimage --output=${grubdir}/core.img $modules || exit 1 |
221 |
|
|
222 |
# Now perform the installation. |
# Now perform the installation. |