From 636299cc5089c1bd6bc3fcd8d4c515eb23c1554e Mon Sep 17 00:00:00 2001 From: okuji Date: Sun, 15 Oct 2000 18:24:58 +0000 Subject: [PATCH] add a new option --recheck into grub-install, relieve the check of a device file in grub-install. --- ChangeLog | 11 +++++++++++ NEWS | 3 +++ util/grub-install.in | 13 +++++++++++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3c5e08e96..9ae7df642 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2000-10-16 OKUJI Yoshinori + + * util/grub-install.in (convert): Check only if the file exists, + instead of checking if the file is a block device as well. + Because, in a sane operating system, it should be a char device + but not a block device (unlike Linux), and it may be a symbolic + link (this can happen if you use Linux's devfs without devfsd). + (recheck): New variable. Set to "no" by default, and set to + "yes", if you specify the new option ``--recheck''. If $recheck + is "yes", remove the device map file, if present. + 2000-10-16 OKUJI Yoshinori From Roderich Schupp: diff --git a/NEWS b/NEWS index 35d8160ed..69ab0de7b 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,9 @@ New in 1.0 - XXXX-XX-XX: * The command "setkey" resets key mappings, when no argument is specified. * Linux devfs support is added. +* The utility ``grub-install'' accepts a new option, `--recheck'. If + this option is specified, probe a device map, even if it already + exists. You should use this option whenever you add/remove a disk. New in 0.5.96 - 2000-10-04: * New commands, "reboot" and "halt". diff --git a/util/grub-install.in b/util/grub-install.in index 8d12c9c04..5bc7bb5eb 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -36,6 +36,7 @@ grub_prefix=/boot/grub install_device= force_lba= +recheck=no debug=no # Usage: usage @@ -50,8 +51,9 @@ Install GRUB on your drive. --root-directory=DIR install GRUB images under the directory DIR instead of the root directory. --grub-shell=FILE use FILE as the grub shell. - --force-lba Force GRUB to use LBA mode even for a buggy + --force-lba force GRUB to use LBA mode even for a buggy BIOS. + --recheck probe a device map even if it already exists. INSTALL_DEVICE can be a GRUB device name or a system device filename. @@ -64,7 +66,7 @@ EOF # This part is OS-specific. convert () { # First, check if the device file exists. - if test -b "$1"; then + if test -e "$1"; then : else echo "$1: Not found or not a block device." 1>&2 @@ -139,6 +141,8 @@ for option in "$@"; do grub_shell=`echo "$option" | sed 's/--grub-shell=//'` ;; --force-lba) force_lba="--force-lba" ;; + --recheck) + recheck=yes ;; # This is an undocumented feature... --debug) debug=yes ;; @@ -197,6 +201,11 @@ fi test -d "$bootdir" || mkdir "$bootdir" || exit 1 test -d "$grubdir" || mkdir "$grubdir" || exit 1 +# If --recheck is specified, remove the device map, if present. +if test $recheck = yes; then + rm -f $device_map +fi + # Create the device map file if it is not present. if test -f "$device_map"; then :