From aaccdfc4ba06d04f4577148e5fdc776d79b7c855 Mon Sep 17 00:00:00 2001 From: okuji Date: Sat, 29 Dec 2001 18:53:30 +0000 Subject: [PATCH] Add NetBSD support into grub-install. --- ChangeLog | 5 +++++ THANKS | 1 + TODO | 9 ++++----- util/grub-install.in | 14 ++++++++++++++ 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f2626166d..f2340820c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-12-30 Yoshinori K. Okuji + + From John Goerzen : + * util/grub-install.in (convert): Added NetBSD support. + 2001-12-30 Yoshinori K. Okuji * util/grub-install.in: Set GRUB_PREFIX and BOOTDIR to "/grub" diff --git a/THANKS b/THANKS index 92af6e42a..19c777833 100644 --- a/THANKS +++ b/THANKS @@ -45,6 +45,7 @@ Jason Thomas Jeremy Katz Jochen Hoenicke Johannes Kroeger +John Goerzen John Tobey Josip Rodin Julien Bordet diff --git a/TODO b/TODO index a30494773..d31312b10 100644 --- a/TODO +++ b/TODO @@ -53,10 +53,9 @@ Things that must _not_ be done before 1.0: Things that may be done anytime: -* Port the script ``grub-install'' to FreeBSD, NetBSD and OpenBSD. At - least you will have to modify the function `convert' so that it can - translate a native device name into the corresponding GRUB drive - representation. ! +* Port the script ``grub-install'' to OpenBSD. At least you will have to + modify the function `convert' so that it can translate a native device + name into the corresponding GRUB drive representation. ! * Add a command to run a GRUB script file. !! @@ -84,7 +83,7 @@ Things that may be done anytime: * Add more remote console support (parallel and net). -* Add RAID support. +* Add (real) RAID support. ? Add a partition naming syntax that means ``the first partition of this type''. We need this for clean Hurd install floppies. diff --git a/util/grub-install.in b/util/grub-install.in index 500cfc33e..fcf0658ad 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -96,6 +96,12 @@ convert () { | sed "s%.*/r\{0,1\}[saw]d[0-9]\(s[0-9]*[a-h]\)%\1%" \ | sed "s%.*/r\{0,1\}da[0-9]\(s[0-9]*[a-h]\)%\1%"` ;; + netbsd*) + tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([sw]d[0-9]*\).*$%r\1d%' \ + | sed 's%r\{0,1\}\(fd[0-9]*\).*$%r\1a%'` + tmp_part=`echo "$1" \ + | sed "s%.*/r\{0,1\}[sw]d[0-9]\([abe-p]\)%\1%"` + ;; *) echo "grub-install does not support your OS yet." 1>&2 exit 1 ;; @@ -145,6 +151,14 @@ convert () { | sed "s%)%,$tmp_bsd_partition)%"` fi echo "$tmp_drive" ;; + netbsd*) + if echo $tmp_part | grep "^[abe-p]$" >/dev/null; then + tmp_bsd_partition=`echo "$tmp_part" \ + | sed "s%\([a-p]\)$%\1%"` + tmp_drive=`echo "$tmp_drive" \ + | sed "s%)%,$tmp_bsd_partition)%"` + fi + echo "$tmp_drive" ;; esac else # If no partition is specified, just print the drive name.