aboutsummaryrefslogtreecommitdiff
path: root/sysutils/grub/files
diff options
context:
space:
mode:
authorKirill Ponomarev <krion@FreeBSD.org>2004-01-31 09:29:07 +0000
committerKirill Ponomarev <krion@FreeBSD.org>2004-01-31 09:29:07 +0000
commit121975e1760500a35e00f4a0015592cb74452f86 (patch)
treef57e00ae3f80a089582a2567eff76601bf4015ef /sysutils/grub/files
parentc80dfde1d78049a1011c61e6793b52cda404611e (diff)
Notes
Diffstat (limited to 'sysutils/grub/files')
-rw-r--r--sysutils/grub/files/patch-lib_device.c48
-rw-r--r--sysutils/grub/files/patch-netboot_main.c18
2 files changed, 59 insertions, 7 deletions
diff --git a/sysutils/grub/files/patch-lib_device.c b/sysutils/grub/files/patch-lib_device.c
index eb3b072c26c3..ac44ee3ea91f 100644
--- a/sysutils/grub/files/patch-lib_device.c
+++ b/sysutils/grub/files/patch-lib_device.c
@@ -1,5 +1,5 @@
---- lib/device.c.orig Sat Jan 24 01:52:56 2004
-+++ lib/device.c Sun Jan 25 00:07:02 2004
+--- lib/device.c.orig Sat Jan 17 18:57:57 2004
++++ lib/device.c Sat Jan 31 06:32:24 2004
@@ -78,6 +78,12 @@
# include <sys/ioctl.h> /* ioctl */
# include <sys/disklabel.h>
@@ -13,7 +13,26 @@
#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ */
#ifdef HAVE_OPENDISK
-@@ -123,6 +129,7 @@
+@@ -94,8 +100,16 @@
+ {
+ int fd;
+
+- fd = open (map[drive], O_RDONLY);
+- assert (fd >= 0);
++#if defined(__FreeBSD__)
++ if(geom->flags == -1)
++ {
++#endif
++ fd = open (map[drive], O_RDONLY);
++ assert (fd >= 0);
++#if defined(__FreeBSD__)
++ } else
++ fd = geom->flags;
++#endif
+
+ #if defined(__linux__)
+ /* Linux */
+@@ -123,6 +137,7 @@
/* FreeBSD, NetBSD or OpenBSD */
{
struct disklabel hdg;
@@ -21,10 +40,11 @@
if (ioctl (fd, DIOCGDINFO, &hdg))
goto fail;
-@@ -131,6 +138,38 @@
+@@ -131,7 +146,40 @@
geom->sectors = hdg.d_nsectors;
geom->total_sectors = hdg.d_secperunit;
+- close (fd);
+#else
+ u_int u, secsize;
+ off_t mediasize;
@@ -57,10 +77,24 @@
+ geom->sectors = hdg.d_nsectors;
+ geom->total_sectors = hdg.d_secperunit;
+#endif
- close (fd);
++ if(geom->flags == -1)
++ close (fd);
return;
}
-@@ -233,7 +272,7 @@
+
+@@ -203,7 +251,11 @@
+ sprintf (name, "/dev/fd%d", unit);
+ #elif defined(__FreeBSD__)
+ /* FreeBSD */
++#if __FreeBSD__ >= 4
++ sprintf (name, "/dev/fd%d", unit);
++#else
+ sprintf (name, "/dev/rfd%d", unit);
++#endif
+ #elif defined(__NetBSD__)
+ /* NetBSD */
+ /* opendisk() doesn't work for floppies. */
+@@ -233,7 +285,7 @@
#elif defined(__FreeBSD__)
/* FreeBSD */
# if __FreeBSD__ >= 4
@@ -69,7 +103,7 @@
# else /* __FreeBSD__ <= 3 */
sprintf (name, "/dev/rwd%d", unit);
# endif /* __FreeBSD__ <= 3 */
-@@ -274,7 +313,11 @@
+@@ -274,7 +326,11 @@
sprintf (name, "/dev/sd%d", unit);
#elif defined(__FreeBSD__)
/* FreeBSD */
diff --git a/sysutils/grub/files/patch-netboot_main.c b/sysutils/grub/files/patch-netboot_main.c
new file mode 100644
index 000000000000..1feadafd2caf
--- /dev/null
+++ b/sysutils/grub/files/patch-netboot_main.c
@@ -0,0 +1,18 @@
+--- netboot/main.c.orig Sat Jan 18 21:13:02 2003
++++ netboot/main.c Sat Jan 18 21:13:27 2003
+@@ -82,6 +82,7 @@
+ RFC2132_MSG_TYPE, 1, DHCPDISCOVER,
+ RFC2132_MAX_SIZE,2, /* request as much as we can */
+ ETH_MAX_MTU / 256, ETH_MAX_MTU % 256,
++ RFC2132_VENDOR_CLASS_ID,4,'G','R','U','B',
+ RFC2132_PARAM_LIST, 4, RFC1533_NETMASK, RFC1533_GATEWAY,
+ RFC1533_HOSTNAME, RFC1533_EXTENSIONPATH
+ };
+@@ -93,6 +94,7 @@
+ RFC2132_REQ_ADDR, 4, 0, 0, 0, 0,
+ RFC2132_MAX_SIZE, 2, /* request as much as we can */
+ ETH_MAX_MTU / 256, ETH_MAX_MTU % 256,
++ RFC2132_VENDOR_CLASS_ID,4,'G','R','U','B',
+ /* request parameters */
+ RFC2132_PARAM_LIST,
+ /* 4 standard + 2 vendortags */