Bug#363698: GNU/kFreeBSD fixes

Robert Millan rmh at aybabtu.com
Thu Apr 20 13:07:08 UTC 2006


Package: grub
Version: 0.97-7.1+kbsd
Severity: normal
Tags: patch

Hi,

Here are a few GNU/kFreeBSD fixes.  The Debian-specific ones are in debian.diff,
the ones in kfreebsd.diff have been sent to upstream already (not committed
ATTOW).

-- System Information:
Debian Release: testing/unstable
Architecture: kfreebsd-i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: GNU/kFreeBSD 5.4-1-486
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)

Versions of packages grub depends on:
ii  debconf                       1.4.72     Debian configuration management sy
ii  libc0.1                       2.3.6-7    GNU C Library: Shared libraries
ii  libncurses5                   5.5-1+kbsd Shared libraries for terminal hand

grub recommends no packages.

-- debconf information excluded
-------------- next part --------------
diff -ur grub-0.97.old/debian/README.Debian grub-0.97/debian/README.Debian
--- grub-0.97.old/debian/README.Debian	2006-04-20 12:28:18.000000000 +0200
+++ grub-0.97/debian/README.Debian	2006-04-20 12:30:36.000000000 +0200
@@ -28,11 +28,11 @@
 
 after installing the package:
 
-1) grub-install /dev/hda
+1) grub-install "(hd0)"
    or if /boot is a separate partition
-   grub-install --root-directory=/boot /dev/hda
+   grub-install --root-directory=/boot "(hd0)"
 
-   using in place of /dev/hda the device that you boot from
+   using in place of "(hd0)" the device that you boot from
 
 2) update-grub which will create a menu.lst for you if one does not exist
    or manually create one, and skip to step 4
diff -ur grub-0.97.old/debian/update-grub grub-0.97/debian/update-grub
--- grub-0.97.old/debian/update-grub	2006-04-20 12:28:18.000000000 +0200
+++ grub-0.97/debian/update-grub	2006-04-20 14:03:43.000000000 +0200
@@ -26,6 +26,8 @@
 # Abort on errors
 set -e
 
+host_os=`uname -s | tr '[A-Z]' '[a-z]'`
+
 abort() {
 	message=$@
 
@@ -173,8 +175,8 @@
 		tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'`
 		tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;;
     freebsd|*/kfreebsd)
-		tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%r\1%' \
-			    | sed 's%r\{0,1\}\(da[0-9]*\).*$%r\1%'`
+		tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%\1%' \
+			    | sed 's%r\{0,1\}\(da[0-9]*\).*$%\1%'`
 		tmp_part=`echo "$1" \
 	    		| 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%"`
@@ -292,7 +294,7 @@
 kopt="root=$root_device ro"
 
 # Title
-title="Debian GNU/Linux"
+title="Debian GNU/`uname -s | sed -e s,GNU/,,g`"
 
 # should update-grub remember the default entry
 updatedefaultentry="false"
@@ -586,7 +588,10 @@
 	initrd=$8
 	savedefault=$9
 
-	echo -n "title		$title, kernel $kernel_version" >> $buffer
+	echo -n "title		$title" >> $buffer
+	if [ -n "$kernel_version" ]; then
+		echo -n ", kernel $kernel_version" >> $buffer
+	fi
 	if [ -n "$recovery_desc" ]; then
 		echo -n " $recovery_desc" >> $buffer
 	fi
@@ -598,7 +603,10 @@
 	fi
 
 	echo "root		$grub_root_device" >> $buffer
-	echo -n "kernel		$kernel $kernel_options"  >> $buffer
+	echo -n "kernel		$kernel"  >> $buffer
+	if [ -n "$kernel_options" ]; then
+		echo -n " $kernel_options"  >> $buffer
+	fi
 	if [ -n "$recovery_desc" ]; then
 		echo -n " $recovery_suffix"  >> $buffer
 	fi
@@ -851,6 +859,17 @@
 		notChangeDefault="yes"
 fi
 
+case "$host_os" in
+  freebsd|*/kfreebsd)
+    if test -e /boot/loader.gz ; then
+      kernel=/boot/loader.gz
+    else
+      kernel=/boot/loader
+    fi
+    write_kernel_entry "" "" "" "$grub_root_device" "$kernel" "" "" "" "true"
+  ;;
+esac
+
 ## heres where we start writing out the kernel entries
 counter=0
 for kern in $sortedKernels ; do
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kfreebsd.diff
Type: text/x-c
Size: 2558 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20060420/9f79ef2d/kfreebsd.bin


More information about the Pkg-grub-devel mailing list