summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorjmmv <jmmv>2005-08-21 15:08:46 +0000
committerjmmv <jmmv>2005-08-21 15:08:46 +0000
commit56e1794c95ebe921fc7d657a944946d4e07f8569 (patch)
treed23a83be2c3289d548dc40788ddac4f7e915f0f8 /sysutils
parenta403bca39c93a186eb86ef118c9036a7cde913aa (diff)
downloadpkgsrc-56e1794c95ebe921fc7d657a944946d4e07f8569.tar.gz
Apply patches to recognize boot options passed to NetBSD kernels.
Bump PKGREVISION to 1. From Piotr Meyer in PR pkg/30834. As GRUB 0.x is in maintenance-only status now, I assume there is no chance to get them incorporated mainstream. We'll keep them here though, as they seem useful (could have really helped me in some situations when needing to boot single user).
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/grub/Makefile3
-rw-r--r--sysutils/grub/distinfo5
-rw-r--r--sysutils/grub/patches/patch-ac142
-rw-r--r--sysutils/grub/patches/patch-ad71
-rw-r--r--sysutils/grub/patches/patch-ae13
5 files changed, 232 insertions, 2 deletions
diff --git a/sysutils/grub/Makefile b/sysutils/grub/Makefile
index e0022022121..48d581dc16b 100644
--- a/sysutils/grub/Makefile
+++ b/sysutils/grub/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.33 2005/05/22 20:08:32 jlam Exp $
+# $NetBSD: Makefile,v 1.34 2005/08/21 15:08:46 jmmv Exp $
#
DISTNAME= grub-0.97
+PKGREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= ftp://alpha.gnu.org/gnu/grub/
diff --git a/sysutils/grub/distinfo b/sysutils/grub/distinfo
index d785ba3480c..55c34dd69ae 100644
--- a/sysutils/grub/distinfo
+++ b/sysutils/grub/distinfo
@@ -1,9 +1,12 @@
-$NetBSD: distinfo,v 1.14 2005/05/09 17:35:16 xtraeme Exp $
+$NetBSD: distinfo,v 1.15 2005/08/21 15:08:46 jmmv Exp $
SHA1 (grub-0.97.tar.gz) = 2580626c4579bd99336d3af4482c346c95dac4fb
RMD160 (grub-0.97.tar.gz) = 7fb5674edf0c950bd38e94f85ff1e2909aa741f0
Size (grub-0.97.tar.gz) = 971783 bytes
SHA1 (patch-aa) = f2b6a1c0ec11c1c01f39bf6241291fc0c3879e34
SHA1 (patch-ab) = 274f05f518de51b708102ec853641e237fd40990
+SHA1 (patch-ac) = c2c657af9b4ed15991d642a1359cb65d61662df6
+SHA1 (patch-ad) = b4977c8dad4535b6e878e51a155a2ac0cfaa893d
+SHA1 (patch-ae) = 96d8283e90ceb3e887ba0ada05619858c52bc144
SHA1 (patch-ai) = 61d81c9b4f1bbec6e9bd1f922f1a88cd7a02a8ba
SHA1 (patch-aj) = bfbac23a7c250ed615dcfb4a988708c970b617d8
diff --git a/sysutils/grub/patches/patch-ac b/sysutils/grub/patches/patch-ac
new file mode 100644
index 00000000000..77e2ce78b20
--- /dev/null
+++ b/sysutils/grub/patches/patch-ac
@@ -0,0 +1,142 @@
+$NetBSD: patch-ac,v 1.3 2005/08/21 15:08:46 jmmv Exp $
+
+--- stage2/boot.c 2004-03-30 13:44:08.000000000 +0200
++++ stage2/boot.c 2005-07-25 21:55:29.000000000 +0200
+@@ -22,6 +22,7 @@
+ #include "shared.h"
+
+ #include "freebsd.h"
++#include "netbsd_reboot.h"
+ #include "imgact_aout.h"
+ #include "i386-elf.h"
+
+@@ -872,6 +873,91 @@
+ * variables.
+ */
+
++int
++netbsd_value(char arg)
++{
++ switch (arg) {
++ case 'a':
++ return(NB_RB_ASKNAME);
++ break;
++ case 'b':
++ return(NB_RB_HALT);
++ break;
++ case 'c':
++ return(NB_RB_USERCONF);
++ break;
++ case 'd':
++ return(NB_RB_KDB);
++ break;
++ case 'm':
++ return(NB_RB_MINIROOT);
++ break;
++ case 'q':
++ return(NB_AB_QUIET);
++ break;
++ case 's':
++ return(NB_RB_SINGLE);
++ break;
++ case 'v':
++ return(NB_AB_VERBOSE);
++ break;
++ case 'x':
++ return(NB_AB_DEBUG);
++ break;
++ case 'z':
++ return(NB_AB_SILENT);
++ break;
++ default:
++ break;
++ }
++ return(0);
++}
++
++int
++freebsd_value(char arg)
++{
++ switch (arg) {
++ case 'C':
++ return(RB_CDROM);
++ break;
++ case 'a':
++ return(RB_ASKNAME);
++ break;
++ case 'b':
++ return(RB_HALT);
++ break;
++ case 'c':
++ return(RB_CONFIG);
++ break;
++ case 'd':
++ return(RB_KDB);
++ break;
++ case 'D':
++ return(RB_MULTIPLE);
++ break;
++ case 'g':
++ return(RB_GDB);
++ break;
++ case 'h':
++ return(RB_SERIAL);
++ break;
++ case 'm':
++ return(RB_MUTE);
++ break;
++ case 'r':
++ return(RB_DFLTROOT);
++ break;
++ case 's':
++ return(RB_SINGLE);
++ break;
++ case 'v':
++ return(RB_VERBOSE);
++ break;
++ default:
++ break;
++ }
++ return(0);
++}
+
+ void
+ bsd_boot (kernel_t type, int bootdev, char *arg)
+@@ -894,31 +980,12 @@
+ {
+ while (*str && *str != ' ')
+ {
+- if (*str == 'C')
+- clval |= RB_CDROM;
+- if (*str == 'a')
+- clval |= RB_ASKNAME;
+- if (*str == 'b')
+- clval |= RB_HALT;
+- if (*str == 'c')
+- clval |= RB_CONFIG;
+- if (*str == 'd')
+- clval |= RB_KDB;
+- if (*str == 'D')
+- clval |= RB_MULTIPLE;
+- if (*str == 'g')
+- clval |= RB_GDB;
+- if (*str == 'h')
+- clval |= RB_SERIAL;
+- if (*str == 'm')
+- clval |= RB_MUTE;
+- if (*str == 'r')
+- clval |= RB_DFLTROOT;
+- if (*str == 's')
+- clval |= RB_SINGLE;
+- if (*str == 'v')
+- clval |= RB_VERBOSE;
+- str++;
++ if (type == KERNEL_TYPE_NETBSD) {
++ clval |= netbsd_value(*str);
++ } else {
++ clval |= freebsd_value(*str);
++ }
++ str++;
+ }
+ continue;
+ }
diff --git a/sysutils/grub/patches/patch-ad b/sysutils/grub/patches/patch-ad
new file mode 100644
index 00000000000..10e50b29ae9
--- /dev/null
+++ b/sysutils/grub/patches/patch-ad
@@ -0,0 +1,71 @@
+$NetBSD: patch-ad,v 1.3 2005/08/21 15:08:46 jmmv Exp $
+
+--- stage2/netbsd_reboot.h 1970-01-01 01:00:00.000000000 +0100
++++ stage2/netbsd_reboot.h 2005-07-25 21:49:37.000000000 +0200
+@@ -0,0 +1,66 @@
++/* $NetBSD: patch-ad,v 1.3 2005/08/21 15:08:46 jmmv Exp $ */
++
++/*
++ * Copyright (c) 1982, 1986, 1988, 1993, 1994
++ * The Regents of the University of California. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++ * @(#)reboot.h 8.3 (Berkeley) 12/13/94
++ */
++
++/*
++ * WARNING! This file is stripped and modified!
++ */
++
++/*
++ * Arguments to reboot system call. These are passed to the boot program,
++ * and then on to init.
++ */
++#define NB_RB_AUTOBOOT 0 /* flags for system auto-booting itself */
++
++#define NB_RB_ASKNAME 0x001 /* ask for file name to reboot from */
++#define NB_RB_SINGLE 0x002 /* reboot to single user only */
++#define NB_RB_NOSYNC 0x004 /* dont sync before reboot */
++#define NB_RB_HALT 0x008 /* don't reboot, just halt */
++#define NB_RB_INITNAME 0x010 /* name given for /etc/init (unused) */
++#define __NB_RB_UNUSED1 0x020 /* was RB_DFLTROOT, obsolete */
++#define NB_RB_KDB 0x040 /* give control to kernel debugger */
++#define NB_RB_RDONLY 0x080 /* mount root fs read-only */
++#define NB_RB_DUMP 0x100 /* dump kernel memory before reboot */
++#define NB_RB_MINIROOT 0x200 /* mini-root present in memory at boot time */
++#define NB_RB_STRING 0x400 /* use provided bootstr */
++#define NB_RB_POWERDOWN (RB_HALT|0x800) /* turn power off (or at least halt) */
++#define NB_RB_USERCONF 0x1000 /* change configured devices */
++
++/*
++ * Extra autoboot flags (passed by boot prog to kernel). See also
++ * macros bootverbose, bootquiet in <sys/systm.h>.
++ */
++#define NB_AB_NORMAL 0x00000 /* boot normally (default) */
++#define NB_AB_QUIET 0x10000 /* boot quietly */
++#define NB_AB_VERBOSE 0x20000 /* boot verbosely */
++#define NB_AB_SILENT 0x40000 /* boot silently */
++#define NB_AB_DEBUG 0x80000 /* boot with debug messages */
diff --git a/sysutils/grub/patches/patch-ae b/sysutils/grub/patches/patch-ae
new file mode 100644
index 00000000000..cc81f13a5cc
--- /dev/null
+++ b/sysutils/grub/patches/patch-ae
@@ -0,0 +1,13 @@
+$NetBSD: patch-ae,v 1.3 2005/08/21 15:08:46 jmmv Exp $
+
+--- stage2/shared.h 2004-06-19 18:40:09.000000000 +0200
++++ stage2/shared.h 2005-07-25 21:33:19.000000000 +0200
+@@ -975,6 +975,8 @@
+ #ifndef STAGE1_5
+ void bsd_boot (kernel_t type, int bootdev, char *arg)
+ __attribute__ ((noreturn));
++int freebsd_value(char arg);
++int netbsd_value(char arg);
+
+ /* Define flags for load_image here. */
+ /* Don't pass a Linux's mem option automatically. */