[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[2488] 2009-08-10 Robert Millan <address@hidden>
From: |
Robert Millan |
Subject: |
[2488] 2009-08-10 Robert Millan <address@hidden> |
Date: |
Mon, 10 Aug 2009 15:42:39 +0000 |
Revision: 2488
http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2488
Author: robertmh
Date: 2009-08-10 15:42:39 +0000 (Mon, 10 Aug 2009)
Log Message:
-----------
2009-08-10 Robert Millan <address@hidden>
* include/grub/i386/bsd.h (KERNEL_TYPE_NONE, KERNEL_TYPE_FREEBSD)
(KERNEL_TYPE_OPENBSD, KERNEL_TYPE_NETBSD): Convert to ...
(bsd_kernel_types): ... this enum.
* loader/i386/bsd.c (grub_cmd_freebsd_loadenv, grub_cmd_freebsd_module)
(grub_cmd_freebsd_module_elf): Abort with "You need to load the
kernel first." when `kernel_type' is set to KERNEL_TYPE_NONE.
(grub_bsd_load_aout, grub_bsd_load, grub_cmd_freebsd_loadenv)
(grub_cmd_freebsd_module, grub_cmd_freebsd_module_elf)
(GRUB_MOD_INIT (bsd)): Fix capitalization in a few error
messages.
Modified Paths:
--------------
trunk/grub2/ChangeLog
trunk/grub2/include/grub/i386/bsd.h
trunk/grub2/loader/i386/bsd.c
Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog 2009-08-08 19:24:58 UTC (rev 2487)
+++ trunk/grub2/ChangeLog 2009-08-10 15:42:39 UTC (rev 2488)
@@ -1,3 +1,18 @@
+2009-08-10 Robert Millan <address@hidden>
+
+ * include/grub/i386/bsd.h (KERNEL_TYPE_NONE, KERNEL_TYPE_FREEBSD)
+ (KERNEL_TYPE_OPENBSD, KERNEL_TYPE_NETBSD): Convert to ...
+ (bsd_kernel_types): ... this enum.
+
+ * loader/i386/bsd.c (grub_cmd_freebsd_loadenv, grub_cmd_freebsd_module)
+ (grub_cmd_freebsd_module_elf): Abort with "You need to load the
+ kernel first." when `kernel_type' is set to KERNEL_TYPE_NONE.
+
+ (grub_bsd_load_aout, grub_bsd_load, grub_cmd_freebsd_loadenv)
+ (grub_cmd_freebsd_module, grub_cmd_freebsd_module_elf)
+ (GRUB_MOD_INIT (bsd)): Fix capitalization in a few error
+ messages.
+
2009-08-08 Robert Millan <address@hidden>
* util/grub-dumpdevtree: Moved from here ...
Modified: trunk/grub2/include/grub/i386/bsd.h
===================================================================
--- trunk/grub2/include/grub/i386/bsd.h 2009-08-08 19:24:58 UTC (rev 2487)
+++ trunk/grub2/include/grub/i386/bsd.h 2009-08-10 15:42:39 UTC (rev 2488)
@@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
- * Copyright (C) 2008 Free Software Foundation, Inc.
+ * Copyright (C) 2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,10 +21,13 @@
#include <grub/types.h>
-#define KERNEL_TYPE_NONE 0
-#define KERNEL_TYPE_FREEBSD 1
-#define KERNEL_TYPE_OPENBSD 2
-#define KERNEL_TYPE_NETBSD 3
+enum bsd_kernel_types
+ {
+ KERNEL_TYPE_NONE,
+ KERNEL_TYPE_FREEBSD,
+ KERNEL_TYPE_OPENBSD,
+ KERNEL_TYPE_NETBSD,
+ };
#define GRUB_BSD_TEMP_BUFFER 0x68000
Modified: trunk/grub2/loader/i386/bsd.c
===================================================================
--- trunk/grub2/loader/i386/bsd.c 2009-08-08 19:24:58 UTC (rev 2487)
+++ trunk/grub2/loader/i386/bsd.c 2009-08-10 15:42:39 UTC (rev 2488)
@@ -47,7 +47,7 @@
#define MOD_BUF_ALLOC_UNIT 4096
-static int kernel_type;
+static int kernel_type = KERNEL_TYPE_NONE;
static grub_dl_t my_mod;
static grub_addr_t entry, entry_hi, kern_start, kern_end;
static grub_uint32_t bootflags;
@@ -614,10 +614,10 @@
return grub_errno;
if (grub_file_read (file, &ah, sizeof (ah)) != sizeof (ah))
- return grub_error (GRUB_ERR_READ_ERROR, "cannot read the a.out header");
+ return grub_error (GRUB_ERR_READ_ERROR, "Cannot read the a.out header");
if (grub_aout_get_type (&ah) != AOUT_TYPE_AOUT32)
- return grub_error (GRUB_ERR_BAD_OS, "invalid a.out header");
+ return grub_error (GRUB_ERR_BAD_OS, "Invalid a.out header");
entry = ah.aout32.a_entry & 0xFFFFFF;
@@ -635,7 +635,7 @@
}
if (load_addr < 0x100000)
- return grub_error (GRUB_ERR_BAD_OS, "load address below 1M");
+ return grub_error (GRUB_ERR_BAD_OS, "Load address below 1M");
kern_start = load_addr;
kern_end = load_addr + ah.aout32.a_text + ah.aout32.a_data;
@@ -738,7 +738,7 @@
return grub_elf64_load (elf, grub_bsd_elf64_hook, 0, 0);
}
else
- return grub_error (GRUB_ERR_BAD_OS, "invalid elf");
+ return grub_error (GRUB_ERR_BAD_OS, "Invalid elf");
}
static grub_err_t
@@ -753,7 +753,7 @@
if (argc == 0)
{
- grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified");
+ grub_error (GRUB_ERR_BAD_ARGUMENT, "No kernel specified");
goto fail;
}
@@ -914,13 +914,17 @@
char *buf = 0, *curr, *next;
int len;
+ if (kernel_type == KERNEL_TYPE_NONE)
+ return grub_error (GRUB_ERR_BAD_ARGUMENT,
+ "You need to load the kernel first.");
+
if (kernel_type != KERNEL_TYPE_FREEBSD)
return grub_error (GRUB_ERR_BAD_ARGUMENT,
- "only freebsd support environment");
+ "Only FreeBSD support environment");
if (argc == 0)
{
- grub_error (GRUB_ERR_BAD_ARGUMENT, "no filename");
+ grub_error (GRUB_ERR_BAD_ARGUMENT, "No filename");
goto fail;
}
@@ -1004,13 +1008,17 @@
char **modargv;
char *type;
+ if (kernel_type == KERNEL_TYPE_NONE)
+ return grub_error (GRUB_ERR_BAD_ARGUMENT,
+ "You need to load the kernel first.");
+
if (kernel_type != KERNEL_TYPE_FREEBSD)
return grub_error (GRUB_ERR_BAD_ARGUMENT,
- "only freebsd support module");
+ "Only FreeBSD support module");
if (!is_elf_kernel)
return grub_error (GRUB_ERR_BAD_ARGUMENT,
- "only elf kernel support module");
+ "Only ELF kernel support module");
/* List the current modules if no parameter. */
if (!argc)
@@ -1066,13 +1074,17 @@
grub_file_t file = 0;
grub_err_t err;
+ if (kernel_type == KERNEL_TYPE_NONE)
+ return grub_error (GRUB_ERR_BAD_ARGUMENT,
+ "You need to load the kernel first.");
+
if (kernel_type != KERNEL_TYPE_FREEBSD)
return grub_error (GRUB_ERR_BAD_ARGUMENT,
- "only freebsd support module");
+ "Only FreeBSD support module");
if (! is_elf_kernel)
return grub_error (GRUB_ERR_BAD_ARGUMENT,
- "only elf kernel support module");
+ "Only ELF kernel support module");
/* List the current modules if no parameter. */
if (! argc)
@@ -1108,22 +1120,22 @@
{
cmd_freebsd =
grub_register_command ("freebsd", grub_cmd_freebsd,
- 0, "load freebsd kernel");
+ 0, "load kernel of FreeBSD");
cmd_openbsd =
grub_register_command ("openbsd", grub_cmd_openbsd,
- 0, "load openbsd kernel");
+ 0, "load kernel of OpenBSD");
cmd_netbsd =
grub_register_command ("netbsd", grub_cmd_netbsd,
- 0, "load netbsd kernel");
+ 0, "load kernel of NetBSD");
cmd_freebsd_loadenv =
grub_register_command ("freebsd_loadenv", grub_cmd_freebsd_loadenv,
- 0, "load freebsd env");
+ 0, "load FreeBSD env");
cmd_freebsd_module =
grub_register_command ("freebsd_module", grub_cmd_freebsd_module,
- 0, "load freebsd module");
+ 0, "load FreeBSD kernel module");
cmd_freebsd_module_elf =
grub_register_command ("freebsd_module_elf", grub_cmd_freebsd_module_elf,
- 0, "load freebsd ELF module");
+ 0, "load FreeBSD kernel module (ELF)");
my_mod = mod;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [2488] 2009-08-10 Robert Millan <address@hidden>,
Robert Millan <=