2009-10-14 Robert Millan <rmh.grub@aybabtu.com>

Refer to kernel of FreeBSD "kFreeBSD" to avoid confusion between
        the Operating System (FreeBSD) and its kernel (kernel of FreeBSD).

        * loader/i386/bsd.c (grub_freebsd_boot): Read kernel environment
        from "kFreeBSD" namespace (rather than "FreeBSD").  Update all
        users.

        (GRUB_MOD_INIT (bsd)): Rename "freebsd" command to "kfreebsd",
        "openbsd" to "kopenbsd", "netbsd" to "knetbsd", "freebsd_loadenv"
        to "kfreebsd_loadenv", "freebsd_module" to "kfreebsd_module",
        and "freebsd_module_elf" to "kfreebsd_module_elf".  Update all
        users.
This commit is contained in:
robertmh 2009-10-14 16:49:22 +00:00
parent bf7f7a18f4
commit 9155bc1796
3 changed files with 32 additions and 17 deletions

View file

@ -1,3 +1,18 @@
2009-10-14 Robert Millan <rmh.grub@aybabtu.com>
Refer to kernel of FreeBSD "kFreeBSD" to avoid confusion between
the Operating System (FreeBSD) and its kernel (kernel of FreeBSD).
* loader/i386/bsd.c (grub_freebsd_boot): Read kernel environment
from "kFreeBSD" namespace (rather than "FreeBSD"). Update all
users.
(GRUB_MOD_INIT (bsd)): Rename "freebsd" command to "kfreebsd",
"openbsd" to "kopenbsd", "netbsd" to "knetbsd", "freebsd_loadenv"
to "kfreebsd_loadenv", "freebsd_module" to "kfreebsd_module",
and "freebsd_module_elf" to "kfreebsd_module_elf". Update all
users.
2009-10-12 Robert Millan <rmh.grub@aybabtu.com> 2009-10-12 Robert Millan <rmh.grub@aybabtu.com>
* term/tparm.c: Switch to GPLv3. * term/tparm.c: Switch to GPLv3.

View file

@ -444,9 +444,9 @@ grub_freebsd_boot (void)
auto int iterate_env (struct grub_env_var *var); auto int iterate_env (struct grub_env_var *var);
int iterate_env (struct grub_env_var *var) int iterate_env (struct grub_env_var *var)
{ {
if ((!grub_memcmp (var->name, "FreeBSD.", 8)) && (var->name[8])) if ((!grub_memcmp (var->name, "kFreeBSD.", sizeof("kFreeBSD.") - 1)) && (var->name[sizeof("kFreeBSD.") - 1]))
{ {
grub_strcpy (p, &var->name[8]); grub_strcpy (p, &var->name[sizeof("kFreeBSD.") - 1]);
p += grub_strlen (p); p += grub_strlen (p);
*(p++) = '='; *(p++) = '=';
grub_strcpy (p, var->value); grub_strcpy (p, var->value);
@ -1112,12 +1112,12 @@ grub_cmd_freebsd_loadenv (grub_command_t cmd __attribute__ ((unused)),
if (*curr) if (*curr)
{ {
char name[grub_strlen (curr) + 8 + 1]; char name[grub_strlen (curr) + sizeof("kFreeBSD.")];
if (*p == '"') if (*p == '"')
p++; p++;
grub_sprintf (name, "FreeBSD.%s", curr); grub_sprintf (name, "kFreeBSD.%s", curr);
if (grub_env_set (name, p)) if (grub_env_set (name, p))
goto fail; goto fail;
} }
@ -1252,26 +1252,26 @@ static grub_command_t cmd_freebsd_module_elf;
GRUB_MOD_INIT (bsd) GRUB_MOD_INIT (bsd)
{ {
cmd_freebsd = grub_register_extcmd ("freebsd", grub_cmd_freebsd, cmd_freebsd = grub_register_extcmd ("kfreebsd", grub_cmd_freebsd,
GRUB_COMMAND_FLAG_BOTH, GRUB_COMMAND_FLAG_BOTH,
"freebsd FILE", "Load kernel of FreeBSD.", "kfreebsd FILE", "Load kernel of FreeBSD.",
freebsd_opts); freebsd_opts);
cmd_openbsd = grub_register_extcmd ("openbsd", grub_cmd_openbsd, cmd_openbsd = grub_register_extcmd ("kopenbsd", grub_cmd_openbsd,
GRUB_COMMAND_FLAG_BOTH, GRUB_COMMAND_FLAG_BOTH,
"openbsd FILE", "Load kernel of OpenBSD.", "kopenbsd FILE", "Load kernel of OpenBSD.",
openbsd_opts); openbsd_opts);
cmd_netbsd = grub_register_extcmd ("netbsd", grub_cmd_netbsd, cmd_netbsd = grub_register_extcmd ("knetbsd", grub_cmd_netbsd,
GRUB_COMMAND_FLAG_BOTH, GRUB_COMMAND_FLAG_BOTH,
"netbsd FILE", "Load kernel of NetBSD.", "knetbsd FILE", "Load kernel of NetBSD.",
netbsd_opts); netbsd_opts);
cmd_freebsd_loadenv = cmd_freebsd_loadenv =
grub_register_command ("freebsd_loadenv", grub_cmd_freebsd_loadenv, grub_register_command ("kfreebsd_loadenv", grub_cmd_freebsd_loadenv,
0, "load FreeBSD env"); 0, "load FreeBSD env");
cmd_freebsd_module = cmd_freebsd_module =
grub_register_command ("freebsd_module", grub_cmd_freebsd_module, grub_register_command ("kfreebsd_module", grub_cmd_freebsd_module,
0, "load FreeBSD kernel module"); 0, "load FreeBSD kernel module");
cmd_freebsd_module_elf = cmd_freebsd_module_elf =
grub_register_command ("freebsd_module_elf", grub_cmd_freebsd_module_elf, grub_register_command ("kfreebsd_module_elf", grub_cmd_freebsd_module_elf,
0, "load FreeBSD kernel module (ELF)"); 0, "load FreeBSD kernel module (ELF)");
my_mod = mod; my_mod = mod;

View file

@ -60,17 +60,17 @@ menuentry "${OS}" {
EOF EOF
prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
cat << EOF cat << EOF
freebsd ${kfreebsd_rel_dirname}/${kfreebsd_basename} kfreebsd ${kfreebsd_rel_dirname}/${kfreebsd_basename}
EOF EOF
if [ x"$devices" != "x" ] ; then if [ x"$devices" != "x" ] ; then
cat << EOF cat << EOF
freebsd_loadenv ${devices_rel_dirname}/${devices_basename} kfreebsd_loadenv ${devices_rel_dirname}/${devices_basename}
EOF EOF
fi fi
cat << EOF cat << EOF
set FreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${GRUB_DEVICE} set kFreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${GRUB_DEVICE}
set FreeBSD.vfs.root.mountfrom.options=rw set kFreeBSD.vfs.root.mountfrom.options=rw
} }
EOF EOF
fi fi