From 9155bc1796e65baff75c36732e7daf34d7aab2c5 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 14 Oct 2009 16:49:22 +0000 Subject: [PATCH] 2009-10-14 Robert Millan 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. --- ChangeLog | 15 +++++++++++++++ loader/i386/bsd.c | 26 +++++++++++++------------- util/grub.d/10_freebsd.in | 8 ++++---- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc2a350cf..911aa8c5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2009-10-14 Robert Millan + + 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 * term/tparm.c: Switch to GPLv3. diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index afe1825a5..fc292444f 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -444,9 +444,9 @@ grub_freebsd_boot (void) auto 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_strcpy (p, var->value); @@ -1112,12 +1112,12 @@ grub_cmd_freebsd_loadenv (grub_command_t cmd __attribute__ ((unused)), if (*curr) { - char name[grub_strlen (curr) + 8 + 1]; + char name[grub_strlen (curr) + sizeof("kFreeBSD.")]; if (*p == '"') p++; - grub_sprintf (name, "FreeBSD.%s", curr); + grub_sprintf (name, "kFreeBSD.%s", curr); if (grub_env_set (name, p)) goto fail; } @@ -1252,26 +1252,26 @@ static grub_command_t cmd_freebsd_module_elf; 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, - "freebsd FILE", "Load kernel of FreeBSD.", + "kfreebsd FILE", "Load kernel of FreeBSD.", freebsd_opts); - cmd_openbsd = grub_register_extcmd ("openbsd", grub_cmd_openbsd, + cmd_openbsd = grub_register_extcmd ("kopenbsd", grub_cmd_openbsd, GRUB_COMMAND_FLAG_BOTH, - "openbsd FILE", "Load kernel of OpenBSD.", + "kopenbsd FILE", "Load kernel of OpenBSD.", openbsd_opts); - cmd_netbsd = grub_register_extcmd ("netbsd", grub_cmd_netbsd, + cmd_netbsd = grub_register_extcmd ("knetbsd", grub_cmd_netbsd, GRUB_COMMAND_FLAG_BOTH, - "netbsd FILE", "Load kernel of NetBSD.", + "knetbsd FILE", "Load kernel of NetBSD.", netbsd_opts); 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"); 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"); 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)"); my_mod = mod; diff --git a/util/grub.d/10_freebsd.in b/util/grub.d/10_freebsd.in index 1e3a0de1f..02694d3e7 100644 --- a/util/grub.d/10_freebsd.in +++ b/util/grub.d/10_freebsd.in @@ -60,17 +60,17 @@ menuentry "${OS}" { EOF prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" cat << EOF - freebsd ${kfreebsd_rel_dirname}/${kfreebsd_basename} + kfreebsd ${kfreebsd_rel_dirname}/${kfreebsd_basename} EOF if [ x"$devices" != "x" ] ; then cat << EOF - freebsd_loadenv ${devices_rel_dirname}/${devices_basename} + kfreebsd_loadenv ${devices_rel_dirname}/${devices_basename} EOF fi cat << EOF - set FreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${GRUB_DEVICE} - set FreeBSD.vfs.root.mountfrom.options=rw + set kFreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${GRUB_DEVICE} + set kFreeBSD.vfs.root.mountfrom.options=rw } EOF fi