From 2b9af11d18512e5f747d2596894837d8150241a1 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Fri, 9 Mar 2012 09:09:16 -0800 Subject: [PATCH 01/65] remove check for serial.mod in 00_header --- ...erial.mod-test-from-00_header-748964.patch | 29 +++++++++++++++++++ grub2.spec | 1 + 2 files changed, 30 insertions(+) create mode 100644 grub2-1.99-remove-serial.mod-test-from-00_header-748964.patch diff --git a/grub2-1.99-remove-serial.mod-test-from-00_header-748964.patch b/grub2-1.99-remove-serial.mod-test-from-00_header-748964.patch new file mode 100644 index 0000000..918d559 --- /dev/null +++ b/grub2-1.99-remove-serial.mod-test-from-00_header-748964.patch @@ -0,0 +1,29 @@ +From fa200c2b59c0b8346466b503cd6ac80e331c9277 Mon Sep 17 00:00:00 2001 +From: Fedora Ninjas +Date: Thu, 8 Mar 2012 13:43:39 -0800 +Subject: [GRUB2] remove serial.mod test from 00_header (#748964) + +This test doesn't belong here, upstream has removed it, and it +was blocking serial installs from working. +--- + util/grub.d/00_header.in | 4 ---- + 1 files changed, 0 insertions(+), 4 deletions(-) + +diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in +index 5c4d9db..a1a75aa 100644 +--- a/util/grub.d/00_header.in ++++ b/util/grub.d/00_header.in +@@ -113,10 +113,6 @@ for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do + done + + if [ "x$serial" = x1 ]; then +- if ! test -e "${GRUB_PREFIX}/serial.mod" ; then +- echo "Serial terminal not available on this platform." >&2 ; exit 1 +- fi +- + if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then + grub_warn "Requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used." + GRUB_SERIAL_COMMAND=serial +-- +1.7.7.6 + diff --git a/grub2.spec b/grub2.spec index edd8918..1f6b01c 100644 --- a/grub2.spec +++ b/grub2.spec @@ -40,6 +40,7 @@ Patch6: grub2-gfxpayload-efi.patch Patch7: grub-1.99-fix_grub-probe_call.patch Patch8: grub-1.99-handle-newer-autotools.patch Patch9: grub-1.99-gcc-4.7.0.patch +Patch10: grub2-1.99-remove-serial.mod-test-from-00_header-748964.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) From c882abd2667b2b9ff9ad92fa72cc960644950529 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 12 Mar 2012 15:36:27 -0400 Subject: [PATCH 02/65] Fix some bits I missed in the auto* patch. (Patch from khopp) --- grub-1.99-handle-newer-autotools.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-1.99-handle-newer-autotools.patch b/grub-1.99-handle-newer-autotools.patch index 2a178d5..f96ea39 100644 --- a/grub-1.99-handle-newer-autotools.patch +++ b/grub-1.99-handle-newer-autotools.patch @@ -417,7 +417,7 @@ index edb1eda..8bc1180 100644 +exec_prefix="@exec_prefix@" +libdir="@libdir@" +datarootdir="@datarootdir@" -+. "${libdir}/grub/grub-mkconfig_lib" ++. "${datarootdir}/grub/grub-mkconfig_lib" export TEXTDOMAIN=@PACKAGE@ export TEXTDOMAINDIR=@localedir@ @@ -438,7 +438,7 @@ index f37e365..9104667 100644 +exec_prefix="@exec_prefix@" +libdir="@libdir@" +datarootdir="@datarootdir@" -+. "${libdir}/grub/grub-mkconfig_lib" ++. "${datarootdir}/grub/grub-mkconfig_lib" export TEXTDOMAIN=@PACKAGE@ -export TEXTDOMAINDIR=@localedir@ @@ -463,7 +463,7 @@ index 9eb7b3e..7336000 100644 +libdir="@libdir@" -. ${libdir}/grub/grub-mkconfig_lib -+. "${libdir}/grub/grub-mkconfig_lib" ++. "${datarootdir}/grub/grub-mkconfig_lib" if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then exit 0 From 0e53625c75e1433b6aadc39b34c8ee8bd66bd5e5 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 12 Mar 2012 15:41:49 -0400 Subject: [PATCH 03/65] Handle some missed bits for newer autotools support (patch from khopp) - Handle PReP installation on PPC. --- grub-1.99-prep_install_v2.patch | 575 ++++++++++++++++++++++++++++++++ grub2.spec | 7 +- 2 files changed, 581 insertions(+), 1 deletion(-) create mode 100644 grub-1.99-prep_install_v2.patch diff --git a/grub-1.99-prep_install_v2.patch b/grub-1.99-prep_install_v2.patch new file mode 100644 index 0000000..4ca57cb --- /dev/null +++ b/grub-1.99-prep_install_v2.patch @@ -0,0 +1,575 @@ +From: Paulo Flabiano Smorigo +Date: Fri, 24 Feb 2012 17:26:02 -0400 +Subject: [PATCH] Pull in required v2 changes for PPC +--- + +diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c +index 2fbe809..9e80757 100644 +--- a/grub-core/kern/ieee1275/cmain.c ++++ b/grub-core/kern/ieee1275/cmain.c +@@ -60,6 +60,10 @@ grub_ieee1275_find_options (void) + int is_olpc = 0; + int is_qemu = 0; + ++#ifdef __sparc__ ++ grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_PARTITION_0); ++#endif ++ + grub_ieee1275_finddevice ("/", &root); + grub_ieee1275_finddevice ("/options", &options); + grub_ieee1275_finddevice ("/openprom", &openprom); +diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c +index 682a8b5..13a160f 100644 +--- a/grub-core/kern/ieee1275/init.c ++++ b/grub-core/kern/ieee1275/init.c +@@ -69,36 +69,45 @@ grub_translate_ieee1275_path (char *filepath) + } + + void +-grub_machine_set_prefix (void) ++grub_machine_get_bootlocation (char **device, char **path) + { + char bootpath[64]; /* XXX check length */ + char *filename; +- char *prefix; +- +- if (grub_prefix[0]) +- { +- grub_env_set ("prefix", grub_prefix); +- /* Prefix is hardcoded in the core image. */ +- return; +- } +- ++ char *type; ++ + if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", &bootpath, + sizeof (bootpath), 0)) + { + /* Should never happen. */ + grub_printf ("/chosen/bootpath property missing!\n"); +- grub_env_set ("prefix", ""); + return; + } + + /* Transform an OF device path to a GRUB path. */ + +- prefix = grub_ieee1275_encode_devname (bootpath); ++ type = grub_ieee1275_get_device_type (bootpath); ++ if (type && grub_strcmp (type, "network") == 0) ++ { ++ char *dev, *canon; ++ char *ptr; ++ dev = grub_ieee1275_get_aliasdevname (bootpath); ++ canon = grub_ieee1275_canonicalise_devname (dev); ++ ptr = canon + grub_strlen (canon) - 1; ++ while (ptr > canon && (*ptr == ',' || *ptr == ':')) ++ ptr--; ++ ptr++; ++ *ptr = 0; ++ ++ grub_free (dev); ++ grub_free (canon); ++ } ++ else ++ *device = grub_ieee1275_encode_devname (bootpath); ++ grub_free (type); + + filename = grub_ieee1275_get_filename (bootpath); + if (filename) + { +- char *newprefix; + char *lastslash = grub_strrchr (filename, '\\'); + + /* Truncate at last directory. */ +@@ -107,19 +116,9 @@ grub_machine_set_prefix (void) + *lastslash = '\0'; + grub_translate_ieee1275_path (filename); + +- newprefix = grub_xasprintf ("%s%s", prefix, filename); +- if (newprefix) +- { +- grub_free (prefix); +- prefix = newprefix; +- } ++ *path = filename; + } + } +- +- grub_env_set ("prefix", prefix); +- +- grub_free (filename); +- grub_free (prefix); + } + + /* Claim some available memory in the first /memory node. */ +@@ -192,22 +191,12 @@ static void grub_claim_heap (void) + grub_machine_mmap_iterate (heap_init); + } + +-static grub_uint64_t ieee1275_get_time_ms (void); +- +-void +-grub_machine_init (void) ++static void ++grub_parse_cmdline (void) + { +- char args[256]; + grub_ssize_t actual; ++ char args[256]; + +- grub_ieee1275_init (); +- +- grub_console_init_early (); +- grub_claim_heap (); +- grub_console_init_lately (); +- grub_ofdisk_init (); +- +- /* Process commandline. */ + if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootargs", &args, + sizeof args, &actual) == 0 + && actual > 1) +@@ -240,6 +229,21 @@ grub_machine_init (void) + } + } + } ++} ++ ++static grub_uint64_t ieee1275_get_time_ms (void); ++ ++void ++grub_machine_init (void) ++{ ++ grub_ieee1275_init (); ++ ++ grub_console_init_early (); ++ grub_claim_heap (); ++ grub_console_init_lately (); ++ grub_ofdisk_init (); ++ ++ grub_parse_cmdline (); + + grub_install_get_time_ms (ieee1275_get_time_ms); + } +diff --git a/grub-core/kern/ieee1275/openfw.c b/grub-core/kern/ieee1275/openfw.c +index f5dc8ef..6aa57ea 100644 +--- a/grub-core/kern/ieee1275/openfw.c ++++ b/grub-core/kern/ieee1275/openfw.c +@@ -27,6 +27,8 @@ enum grub_ieee1275_parse_type + { + GRUB_PARSE_FILENAME, + GRUB_PARSE_PARTITION, ++ GRUB_PARSE_DEVICE, ++ GRUB_PARSE_DEVICE_TYPE + }; + + /* Walk children of 'devpath', calling hook for each. */ +@@ -317,14 +319,9 @@ grub_ieee1275_parse_args (const char *path, enum grub_ieee1275_parse_type ptype) + { + char type[64]; /* XXX check size. */ + char *device = grub_ieee1275_get_devname (path); +- char *args = grub_ieee1275_get_devargs (path); + char *ret = 0; + grub_ieee1275_phandle_t dev; + +- if (!args) +- /* Shouldn't happen. */ +- return 0; +- + /* We need to know what type of device it is in order to parse the full + file path properly. */ + if (grub_ieee1275_finddevice (device, &dev)) +@@ -339,49 +336,93 @@ grub_ieee1275_parse_args (const char *path, enum grub_ieee1275_parse_type ptype) + goto fail; + } + +- if (!grub_strcmp ("block", type)) ++ switch (ptype) + { +- /* The syntax of the device arguments is defined in the CHRP and PReP +- IEEE1275 bindings: "[partition][,[filename]]". */ +- char *comma = grub_strchr (args, ','); ++ case GRUB_PARSE_DEVICE: ++ ret = grub_strdup (device); ++ break; ++ case GRUB_PARSE_DEVICE_TYPE: ++ ret = grub_strdup (type); ++ break; ++ case GRUB_PARSE_FILENAME: ++ { ++ char *comma; ++ char *args; ++ ++ if (grub_strcmp ("block", type) != 0) ++ goto unknown; ++ ++ args = grub_ieee1275_get_devargs (path); ++ if (!args) ++ /* Shouldn't happen. */ ++ return 0; + +- if (ptype == GRUB_PARSE_FILENAME) +- { +- if (comma) +- { +- char *filepath = comma + 1; +- +- /* Make sure filepath has leading backslash. */ +- if (filepath[0] != '\\') +- ret = grub_xasprintf ("\\%s", filepath); +- else +- ret = grub_strdup (filepath); ++ /* The syntax of the device arguments is defined in the CHRP and PReP ++ IEEE1275 bindings: "[partition][,[filename]]". */ ++ comma = grub_strchr (args, ','); ++ ++ if (comma) ++ { ++ char *filepath = comma + 1; ++ ++ /* Make sure filepath has leading backslash. */ ++ if (filepath[0] != '\\') ++ ret = grub_xasprintf ("\\%s", filepath); ++ else ++ ret = grub_strdup (filepath); + } ++ grub_free (args); + } +- else if (ptype == GRUB_PARSE_PARTITION) +- { +- if (!comma) +- ret = grub_strdup (args); +- else +- ret = grub_strndup (args, (grub_size_t)(comma - args)); +- } +- } +- else +- { +- /* XXX Handle net devices by configuring & registering a grub_net_dev +- here, then return its name? +- Example path: "net:,,,,,". */ ++ break; ++ case GRUB_PARSE_PARTITION: ++ { ++ char *comma; ++ char *args; ++ ++ if (grub_strcmp ("block", type) != 0) ++ goto unknown; ++ ++ args = grub_ieee1275_get_devargs (path); ++ if (!args) ++ /* Shouldn't happen. */ ++ return 0; ++ ++ comma = grub_strchr (args, ','); ++ if (!comma) ++ ret = grub_strdup (args); ++ else ++ ret = grub_strndup (args, (grub_size_t)(comma - args)); ++ /* Consistently provide numbered partitions to GRUB. ++ OpenBOOT traditionally uses alphabetical partition ++ specifiers. */ ++ if (ret[0] >= 'a' && ret[0] <= 'z') ++ ret[0] = '1' + (ret[0] - 'a'); ++ grub_free (args); ++ } ++ break; ++ default: ++ unknown: + grub_printf ("Unsupported type %s for device %s\n", type, device); + } + + fail: + grub_free (device); +- grub_free (args); + return ret; + } + + char * ++grub_ieee1275_get_device_type (const char *path) ++{ ++ return grub_ieee1275_parse_args (path, GRUB_PARSE_DEVICE_TYPE); ++} ++ ++char * ++grub_ieee1275_get_aliasdevname (const char *path) ++{ ++ return grub_ieee1275_parse_args (path, GRUB_PARSE_DEVICE); ++} ++ ++char * + grub_ieee1275_get_filename (const char *path) + { + return grub_ieee1275_parse_args (path, GRUB_PARSE_FILENAME); +@@ -403,10 +444,10 @@ grub_ieee1275_encode_devname (const char *path) + /* GRUB partition 1 is OF partition 0. */ + partno++; + +- encoding = grub_xasprintf ("(%s,%d)", device, partno); ++ encoding = grub_xasprintf ("%s,%d", device, partno); + } + else +- encoding = grub_xasprintf ("(%s)", device); ++ encoding = grub_xasprintf ("%s", device); + + grub_free (partition); + grub_free (device); +diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c +index da71232..6820f4c 100644 +--- a/grub-core/kern/main.c ++++ b/grub-core/kern/main.c +@@ -129,27 +129,74 @@ grub_env_write_root (struct grub_env_var *var __attribute__ ((unused)), + return grub_strdup (val); + } + +-/* Set the root device according to the dl prefix. */ + static void +-grub_set_root_dev (void) ++grub_set_prefix_and_root (void) + { +- const char *prefix; ++ char *device = NULL; ++ char *path = NULL; ++ char *fwdevice = NULL; ++ char *fwpath = NULL; + + grub_register_variable_hook ("root", 0, grub_env_write_root); + +- prefix = grub_env_get ("prefix"); +- +- if (prefix) ++ { ++ char *pptr = NULL; ++ if (grub_prefix[0] == '(') ++ { ++ pptr = grub_strrchr (grub_prefix, ')'); ++ if (pptr) ++ { ++ device = grub_strndup (grub_prefix + 1, pptr - grub_prefix - 1); ++ pptr++; ++ } ++ } ++ if (!pptr) ++ pptr = grub_prefix; ++ if (pptr[0]) ++ path = grub_strdup (pptr); ++ } ++ if ((!device || device[0] == ',' || !device[0]) || !path) ++ grub_machine_get_bootlocation (&fwdevice, &fwpath); ++ ++ if (!device && fwdevice) ++ device = fwdevice; ++ else if (fwdevice && (device[0] == ',' || !device[0])) + { +- char *dev; ++ /* We have a partition, but still need to fill in the drive. */ ++ char *comma, *new_device; ++ ++ comma = grub_strchr (fwdevice, ','); ++ if (comma) ++ { ++ char *drive = grub_strndup (fwdevice, comma - fwdevice); ++ new_device = grub_xasprintf ("%s%s", drive, device); ++ grub_free (drive); ++ } ++ else ++ new_device = grub_xasprintf ("%s%s", fwdevice, device); + +- dev = grub_file_get_device_name (prefix); +- if (dev) ++ grub_free (fwdevice); ++ grub_free (device); ++ device = new_device; ++ } ++ if (fwpath && !path) ++ path = fwpath; ++ if (device) ++ { ++ char *prefix; ++ ++ prefix = grub_xasprintf ("(%s)%s", device, path ? : ""); ++ if (prefix) + { +- grub_env_set ("root", dev); +- grub_free (dev); ++ grub_env_set ("prefix", prefix); ++ grub_free (prefix); + } ++ grub_env_set ("root", device); + } ++ ++ grub_free (device); ++ grub_free (path); ++ grub_print_error (); + } + + /* Load the normal mode module and execute the normal mode if possible. */ +@@ -159,7 +206,7 @@ grub_load_normal_mode (void) + /* Load the module. */ + grub_dl_load ("normal"); + +- /* Something went wrong. Print errors here to let user know why we're entering rescue mode. */ ++ /* Print errors if any. */ + grub_print_error (); + grub_errno = 0; + +@@ -187,8 +234,7 @@ grub_main (void) + + /* It is better to set the root device as soon as possible, + for convenience. */ +- grub_machine_set_prefix (); +- grub_set_root_dev (); ++ grub_set_prefix_and_root (); + grub_env_export ("root"); + grub_env_export ("prefix"); + +diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h +index 4c56cc2..fc977f5 100644 +--- a/include/grub/ieee1275/ieee1275.h ++++ b/include/grub/ieee1275/ieee1275.h +@@ -195,7 +195,8 @@ char *EXPORT_FUNC(grub_ieee1275_get_filename) (const char *path); + int EXPORT_FUNC(grub_ieee1275_devices_iterate) (int (*hook) + (struct grub_ieee1275_devalias * + alias)); +- ++char *EXPORT_FUNC(grub_ieee1275_get_aliasdevname) (const char *path); + char *EXPORT_FUNC(grub_ieee1275_canonicalise_devname) (const char *path); ++char *EXPORT_FUNC(grub_ieee1275_get_device_type) (const char *path); + + #endif /* ! GRUB_IEEE1275_HEADER */ +diff --git a/include/grub/kernel.h b/include/grub/kernel.h +index 2ecc73d..09839de 100644 +--- a/include/grub/kernel.h ++++ b/include/grub/kernel.h +@@ -84,7 +84,8 @@ void grub_machine_init (void); + void EXPORT_FUNC(grub_machine_fini) (void); + + /* The machine-specific prefix initialization. */ +-void grub_machine_set_prefix (void); ++void ++grub_machine_get_bootlocation (char **device, char **path); + + /* Register all the exported symbols. This is automatically generated. */ + void grub_register_exported_symbols (void); +diff --git a/util/grub-install.in b/util/grub-install.in +index ff8bea8..cbf1e1e 100644 +--- a/util/grub-install.in ++++ b/util/grub-install.in +@@ -271,7 +271,8 @@ if test "x$install_device" = x && ([ "${target_cpu}-${platform}" = "i386-pc" ] \ + fi + + if ! ([ "${target_cpu}-${platform}" = "i386-pc" ] \ +- || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ]); then ++ || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ] \ ++ || [ "${target_cpu}-${platform}" = "powerpc-ieee1275" ]); then + install_device= + fi + +@@ -522,11 +523,11 @@ if [ "x${devabstraction_module}" = "x" ] ; then + # Strip partition number + grub_partition="`echo "${grub_drive}" | sed -e 's/^[^,]*[,)]//; s/)$//'`" + grub_drive="`echo "${grub_drive}" | sed -e s/,[a-z0-9,]*//g`" +- if [ "$disk_module" = ata ] || [ "x${grub_drive}" != "x${install_drive}" ] || ([ "x$platform" != xefi ] && [ "x$platform" != xpc ] && [ x"${target_cpu}-${platform}" != x"sparc64-ieee1275" ]) ; then ++ if [ "$disk_module" = ata ] || [ "x${grub_drive}" != "x${install_drive}" ] || ([ "x$platform" != xefi ] && [ "x$platform" != xpc ] && [ x"${platform}" != x"ieee1275" ]); then + # generic method (used on coreboot and ata mod) + uuid="`"$grub_probe" --device-map="${device_map}" --target=fs_uuid --device "${grub_device}"`" + if [ "x${uuid}" = "x" ] ; then +- if [ "x$platform" != xefi ] && [ "x$platform" != xpc ] && [ x"${target_cpu}-${platform}" != x"sparc64-ieee1275" ]; then ++ if [ "x$platform" != xefi ] && [ "x$platform" != xpc ] && [ x"${platform}" != x"ieee1275" ]; then + echo "UUID needed with $platform, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 + elif [ "$disk_module" = ata ]; then + echo "UUID needed with ata mod, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 +@@ -540,11 +541,12 @@ if [ "x${devabstraction_module}" = "x" ] ; then + echo 'set prefix=($root)'"${relative_grubdir}" >> "${grubdir}/load.cfg" + config_opt="-c ${grubdir}/load.cfg " + modules="$modules search_fs_uuid" +- elif [ "x$platform" = xefi ] || [ "x$platform" = xpc ]; then ++ else + # we need to hardcode the partition number in the core image's prefix. + if [ x"$grub_partition" = x ]; then + prefix_drive="()" + else ++ # Comma is already there + prefix_drive="(,$grub_partition)" + fi + fi +@@ -612,6 +614,30 @@ elif [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${pla + + # Point boot-device at the new grub install + boot_device="$ofpath:$partno,"`"$grub_mkrelpath" "${grubdir}/core.${imgext}" | sed 's,/,\\\\,g'` ++ ++ # If a install device is defined, copy the core.elf to PReP partition. ++ if [ "${target_cpu}-${platform}" = "powerpc-ieee1275" ] \ ++ && [ -n "${install_device}" ]; then ++ if [ "$("${grub_probe}" -m "${device_map}" -d "${install_device}" -t msdos_parttype)" != "41" ]; then ++ echo "The chosen partition is not a PReP partition." ++ exit 1 ++ fi ++ ++ # Check if device is with an ELF within or is blank ++ if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" = ELF ] || cmp -s -n $(blockdev --getsize64 ${install_device}) /dev/zero ${install_device} ; then ++ # Change boot device to the harddisk root ++ boot_device="$ofpath" ++ dd if="${grubdir}/core.${imgext}" of="${install_device}" status=noxfer || { ++ echo "Failed to copy Grub to the PReP partition." ++ exit 1 ++ } ++ else ++ echo "The PReP partition is not empty. If you are sure you want to use it, run dd to clear it:" ++ echo " dd if=/dev/zero of=${install_device}" ++ exit 1 ++ fi ++ fi ++ + "$nvsetenv" boot-device "$boot_device" || { + echo "$nvsetenv failed." + echo "You will have to set boot-device manually. At the Open Firmware prompt, type:" +diff --git a/util/grub-probe.c b/util/grub-probe.c +index 0d5dac9..3512a79 100644 +--- a/util/grub-probe.c ++++ b/util/grub-probe.c +@@ -54,6 +54,7 @@ enum { + PRINT_DEVICE, + PRINT_PARTMAP, + PRINT_ABSTRACTION, ++ PRINT_MSDOS_PARTTYPE + }; + + int print = PRINT_FS; +@@ -221,6 +222,17 @@ probe (const char *path, char *device_name) + free (list); + list = tmp; + } ++ printf ("\n"); ++ goto end; ++ } ++ ++ if (print == PRINT_MSDOS_PARTTYPE) ++ { ++ if (dev->disk->partition ++ && strcmp(dev->disk->partition->partmap->name, "msdos") == 0) ++ printf ("%02x", dev->disk->partition->msdostype); ++ ++ printf ("\n"); + goto end; + } + +@@ -289,7 +301,7 @@ Probe device information for a given path (or device, if the -d option is given) + \n\ + -d, --device given argument is a system device, not a path\n\ + -m, --device-map=FILE use FILE as the device map [default=%s]\n\ +- -t, --target=(fs|fs_uuid|fs_label|drive|device|partmap|abstraction)\n\ ++ -t, --target=(fs|fs_uuid|fs_label|drive|device|partmap|abstraction|msdos_parttype)\n\ + print filesystem module, GRUB drive, system device, partition map module or abstraction module [default=fs]\n\ + -h, --help display this message and exit\n\ + -V, --version print version information and exit\n\ +@@ -348,6 +360,8 @@ main (int argc, char *argv[]) + print = PRINT_PARTMAP; + else if (!strcmp (optarg, "abstraction")) + print = PRINT_ABSTRACTION; ++ else if (!strcmp (optarg, "msdos_parttype")) ++ print = PRINT_MSDOS_PARTTYPE; + else + usage (1); + break; diff --git a/grub2.spec b/grub2.spec index 1f6b01c..6b8bc3f 100644 --- a/grub2.spec +++ b/grub2.spec @@ -18,7 +18,7 @@ Name: grub2 Epoch: 1 Version: 1.99 -Release: 17%{?dist} +Release: 18%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -41,6 +41,7 @@ Patch7: grub-1.99-fix_grub-probe_call.patch Patch8: grub-1.99-handle-newer-autotools.patch Patch9: grub-1.99-gcc-4.7.0.patch Patch10: grub2-1.99-remove-serial.mod-test-from-00_header-748964.patch +Patch11: grub-1.99-prep_install_v2.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -380,6 +381,10 @@ fi %endif %changelog +* Mon Mar 12 2012 Peter Jones - 1.99-18 +- Handle some missed bits for newer autotools support (patch from khopp) +- Handle PReP installation on PPC. + * Wed Mar 07 2012 Peter Jones - 1.99-17 - Update for newer autotools and gcc 4.7.0 Related: rhbz#782144 From f2a005fe3530dd5317e2c250a090eac5629e3d3a Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 14 Mar 2012 16:33:25 -0400 Subject: [PATCH 04/65] Rebase from 1.99 to 2.00~beta2 --- grub-1.99-fix_grub-probe_call.patch | 16 - grub-1.99-grub_test_assert_printf.patch | 16 +- grub-1.99-handle-newer-autotools.patch | 501 --------------- grub-1.99-prep_install_v2.patch | 575 ------------------ grub2-1.99-handle-more-dmraid.patch | 285 --------- ...erial.mod-test-from-00_header-748964.patch | 29 - grub2-gfxpayload-efi.patch | 63 -- grub2.spec | 95 ++- 8 files changed, 55 insertions(+), 1525 deletions(-) delete mode 100644 grub-1.99-fix_grub-probe_call.patch delete mode 100644 grub-1.99-handle-newer-autotools.patch delete mode 100644 grub-1.99-prep_install_v2.patch delete mode 100644 grub2-1.99-handle-more-dmraid.patch delete mode 100644 grub2-1.99-remove-serial.mod-test-from-00_header-748964.patch delete mode 100644 grub2-gfxpayload-efi.patch diff --git a/grub-1.99-fix_grub-probe_call.patch b/grub-1.99-fix_grub-probe_call.patch deleted file mode 100644 index 0adf117..0000000 --- a/grub-1.99-fix_grub-probe_call.patch +++ /dev/null @@ -1,16 +0,0 @@ -From: Adam Williamson -Subject: call ${grub_probe} instead of grub-probe in OSXUUID line of 30_os-prober.in -Date: 2011-12-08 17:55:47 +0000 - -=== modified file 'util/grub.d/30_os-prober.in' ---- a/util/grub.d/30_os-prober.in 2011-12-08 09:39:52.311466000 -0800 -+++ b/util/grub.d/30_os-prober.in 2011-12-08 09:41:22.984908889 -0800 -@@ -168,7 +168,7 @@ - done - ;; - macosx) -- OSXUUID="`grub-probe --target=fs_uuid --device ${DEVICE} 2> /dev/null`" -+ OSXUUID="`${grub_probe} --target=fs_uuid --device ${DEVICE} 2> /dev/null`" - osx_entry xnu_kernel 32 - osx_entry xnu_kernel64 64 - ;; diff --git a/grub-1.99-grub_test_assert_printf.patch b/grub-1.99-grub_test_assert_printf.patch index 55f514f..f6fa68d 100644 --- a/grub-1.99-grub_test_assert_printf.patch +++ b/grub-1.99-grub_test_assert_printf.patch @@ -141,27 +141,27 @@ index 06d78b7..8453d5b 100644 { grub_test_t test; diff --git a/include/grub/test.h b/include/grub/test.h -index 336d3b6..77a7598 100644 +index 5d1ba75..d876f57 100644 --- a/include/grub/test.h +++ b/include/grub/test.h -@@ -53,10 +53,14 @@ void grub_test_nonzero (int cond, const char *file, +@@ -54,10 +54,14 @@ void grub_test_nonzero (int cond, const char *file, __attribute__ ((format (printf, 5, 6))); /* Macro to fill in location details and an optional error message. */ +void grub_test_assert_helper (int cond, const char *file, -+ const char *func, grub_uint32_t line, -+ const char *condstr, const char *fmt, ...) ++ const char *func, grub_uint32_t line, ++ const char *condstr, const char *fmt, ...) + __attribute__ ((format (printf, 6, 7))); + #define grub_test_assert(cond, ...) \ - grub_test_nonzero(cond, GRUB_FILE, __FUNCTION__, __LINE__, \ - ## __VA_ARGS__, \ - "assert failed: %s", #cond) -+ grub_test_assert_helper(cond, GRUB_FILE, __FUNCTION__, __LINE__, \ -+ #cond, ## __VA_ARGS__); ++ grub_test_assert_helper(cond, GRUB_FILE, __FUNCTION__, __LINE__, \ ++ #cond, ## __VA_ARGS__); - /* Macro to define a unit test. */ - #define GRUB_UNIT_TEST(name, funp) \ + void grub_unit_test_init (void); + void grub_unit_test_fini (void); -- 1.7.3.1 diff --git a/grub-1.99-handle-newer-autotools.patch b/grub-1.99-handle-newer-autotools.patch deleted file mode 100644 index f96ea39..0000000 --- a/grub-1.99-handle-newer-autotools.patch +++ /dev/null @@ -1,501 +0,0 @@ -From: Vladimir Serbinenko -Subject: Handle newer autotools. Add some missing quotes while on it. -Date: 2012-01-24 12:17:36 +0000 - -* Makefile.am (pkglib_DATA): Remove update-grub_lib. -(pkglib_DATA): Move grub-mkconfig_lib from here ... -(pkgdata_DATA): ... here. -* Makefile.util.def (update-grub_lib): Removed. -* conf/Makefile.common (pkglib_DATA): Removed. -(pkglib_SCRIPTS): Likewise. -(pkgdata_DATA): New variable. -* tests/util/grub-shell-tester.in: Replace pkglib with pkgdata where -needed. -Add missing quotes. -Remove unused variable while on it. -* tests/util/grub-shell.in: Likewise. -* util/grub-install.in: Likewise. -* util/grub-mkconfig.in: Likewise. -* util/grub-mknetdir.in: Likewise. -* util/grub-mkrescue.in: Likewise. -* util/grub-mkstandalone.in: Likewise. -* util/grub.d/00_header.in: Likewise. -* util/grub.d/10_hurd.in: Likewise. -* util/grub.d/10_illumos.in: Likewise. -* util/grub.d/10_kfreebsd.in: Likewise. -* util/grub.d/10_linux.in: Likewise. -* util/grub.d/10_netbsd.in: Likewise. -* util/grub.d/10_windows.in: Likewise. -* util/grub.d/20_linux_xen.in: Likewise. -* util/grub.d/30_os-prober.in: Likewise. -* util/update-grub_lib.in: Removed. ---- - Makefile.am | 3 +-- - Makefile.util.def | 6 ------ - conf/Makefile.common | 3 +-- - tests/util/grub-shell-tester.in | 23 +++++++++++------------ - tests/util/grub-shell.in | 23 +++++++++++------------ - util/grub-install.in | 2 ++ - util/grub-mkconfig.in | 27 ++++++++++++++------------- - util/grub-mknetdir.in | 29 ++++++++++++++--------------- - util/grub-mkrescue.in | 9 +++++---- - util/grub.d/00_header.in | 9 +++++---- - util/grub.d/10_linux.in | 10 +++++----- - util/grub.d/20_linux_xen.in | 12 ++++++------ - util/grub.d/30_os-prober.in | 9 +++++---- - util/update-grub_lib.in | 23 ----------------------- - 14 files changed, 80 insertions(+), 108 deletions(-) - delete mode 100644 util/update-grub_lib.in - -diff --git a/Makefile.am b/Makefile.am -index 9301c91..fd3848d 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -101,8 +101,7 @@ CLEANFILES += widthspec.h - # Install config.h into platformdir - platform_HEADERS = config.h - --pkglib_DATA += grub-mkconfig_lib --pkglib_DATA += update-grub_lib -+pkgdata_DATA += grub-mkconfig_lib - - - if COND_i386_coreboot -diff --git a/Makefile.util.def b/Makefile.util.def -index 058572f..6451999 100644 ---- a/Makefile.util.def -+++ b/Makefile.util.def -@@ -435,12 +435,6 @@ script = { - }; - - script = { -- name = update-grub_lib; -- common = util/update-grub_lib.in; -- installdir = noinst; --}; -- --script = { - name = grub-kbdcomp; - common = util/grub-kbdcomp.in; - }; -diff --git a/conf/Makefile.common b/conf/Makefile.common -index 5aa13cd..2040a2e 100644 ---- a/conf/Makefile.common -+++ b/conf/Makefile.common -@@ -137,7 +137,7 @@ KERNEL_HEADER_FILES = - - man_MANS = - noinst_DATA = --pkglib_DATA = -+pkgdata_DATA = - bin_SCRIPTS = - sbin_SCRIPTS = - bin_PROGRAMS = -@@ -147,7 +147,6 @@ check_SCRIPTS = - grubconf_DATA = - check_PROGRAMS = - noinst_SCRIPTS = --pkglib_SCRIPTS = - noinst_PROGRAMS = - grubconf_SCRIPTS = - noinst_LIBRARIES = -diff --git a/tests/util/grub-shell-tester.in b/tests/util/grub-shell-tester.in -index 02e49d3..eaaab41 100644 ---- a/tests/util/grub-shell-tester.in -+++ b/tests/util/grub-shell-tester.in -@@ -19,18 +19,17 @@ - # Initialize some variables. - transform="@program_transform_name@" - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --bindir=@bindir@ --libdir=@libdir@ --builddir=@builddir@ -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+datarootdir="@datarootdir@" -+builddir="@builddir@" - PACKAGE_NAME=@PACKAGE_NAME@ - PACKAGE_TARNAME=@PACKAGE_TARNAME@ - PACKAGE_VERSION=@PACKAGE_VERSION@ - target_cpu=@target_cpu@ - - # Force build directory components --PATH=${builddir}:$PATH -+PATH="${builddir}:$PATH" - export PATH - - # Usage: usage -@@ -85,23 +84,23 @@ done - if [ "x${source}" = x ] ; then - tmpfile=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 - while read REPLY; do -- echo $REPLY >> ${tmpfile} -+ echo $REPLY >> "${tmpfile}" - done -- source=${tmpfile} -+ source="${tmpfile}" - fi - - outfile1=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 --@builddir@/grub-shell --qemu-opts="${qemuopts}" --modules=${modules} ${source} >${outfile1} -+"@builddir@/grub-shell" --qemu-opts="${qemuopts}" --modules=${modules} ${source} >"${outfile1}" - - outfile2=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 --bash ${source} >${outfile2} -+bash "${source}" >"${outfile2}" - --if ! diff -q ${outfile1} ${outfile2} >/dev/null -+if ! diff -q "${outfile1}" "${outfile2}" >/dev/null - then - echo "${source}: GRUB and BASH outputs did not match (see diff -u ${outfile1} ${outfile2})" - status=1 - else -- rm -f ${outfile1} ${outfile2} -+ rm -f "${outfile1}" "${outfile2}" - fi - - exit $status -diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in -index 0213376..461befb 100644 ---- a/tests/util/grub-shell.in -+++ b/tests/util/grub-shell.in -@@ -19,11 +19,10 @@ - # Initialize some variables. - transform="@program_transform_name@" - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --bindir=@bindir@ --libdir=@libdir@ --builddir=@builddir@ -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+datarootdir="@datarootdir@" -+builddir="@builddir@" - PACKAGE_NAME=@PACKAGE_NAME@ - PACKAGE_TARNAME=@PACKAGE_TARNAME@ - PACKAGE_VERSION=@PACKAGE_VERSION@ -@@ -140,9 +139,9 @@ EOF - - isofile=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 - if [ x$boot != xnet ]; then -- sh @builddir@/grub-mkrescue --grub-mkimage=${builddir}/grub-mkimage --output=${isofile} --override-directory=${builddir}/grub-core \ -+ sh "@builddir@/grub-mkrescue" "--grub-mkimage=${builddir}/grub-mkimage" "--output=${isofile}" "--override-directory=${builddir}/grub-core" \ - --rom-directory="${rom_directory}" \ -- /boot/grub/grub.cfg=${cfgfile} /boot/grub/testcase.cfg=${source} \ -+ "/boot/grub/grub.cfg=${cfgfile}" "/boot/grub/testcase.cfg=${source}" \ - ${files} >/dev/null 2>&1 - fi - if [ x$boot = xhd ]; then -@@ -173,12 +172,12 @@ fi - - if [ x$boot = xnet ]; then - netdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 -- sh @builddir@/grub-mknetdir --grub-mkimage=${builddir}/grub-mkimage --override-directory=${builddir}/grub-core --net-directory=$netdir -- cp ${cfgfile} $netdir/boot/grub/grub.cfg -- cp ${source} $netdir/boot/grub/testcase.cfg -- ${qemu} ${qemuopts} -nographic -serial file:/dev/stdout -monitor file:/dev/null -boot n -net user,tftp=$netdir,bootfile=/boot/grub/$target_cpu-$platform/core.0 -net nic | cat | tr -d "\r" -+ sh "@builddir@/grub-mknetdir" "--grub-mkimage=${builddir}/grub-mkimage" "--override-directory=${builddir}/grub-core" "--net-directory=$netdir" -+ cp "${cfgfile}" "$netdir/boot/grub/grub.cfg" -+ cp "${source}" "$netdir/boot/grub/testcase.cfg" -+ "${qemu}" ${qemuopts} -nographic -serial file:/dev/stdout -monitor file:/dev/null -boot n -net "user,tftp=$netdir,bootfile=/boot/grub/$target_cpu-$platform/core.0" -net nic | cat | tr -d "\r" - else -- ${qemu} ${qemuopts} -nographic -serial file:/dev/stdout -monitor file:/dev/null -${device} ${isofile} ${bootdev} | cat | tr -d "\r" -+ "${qemu}" ${qemuopts} -nographic -serial file:/dev/stdout -monitor file:/dev/null -${device} ${isofile} ${bootdev} | cat | tr -d "\r" - fi - rm -f "${isofile}" "${imgfile}" - rm -rf "${rom_directory}" -diff --git a/util/grub-install.in b/util/grub-install.in -index ff8bea8..b18d5cc 100644 ---- a/util/grub-install.in -+++ b/util/grub-install.in -@@ -21,6 +21,7 @@ transform="@program_transform_name@" - - prefix="@prefix@" - exec_prefix="@exec_prefix@" -+datarootdir="@datarootdir@" - sbindir="@sbindir@" - bindir="@bindir@" - libdir="@libdir@" -@@ -32,6 +33,7 @@ target_cpu=@target_cpu@ - platform=@platform@ - host_os=@host_os@ - pkglibdir="${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`" -+datadir="@datadir@" - localedir="@datadir@/locale" - - self="`basename $0`" -diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index afc66f8..45cc400 100644 ---- a/util/grub-mkconfig.in -+++ b/util/grub-mkconfig.in -@@ -18,26 +18,27 @@ set -e - # along with GRUB. If not, see . - - transform="@program_transform_name@" -- --prefix=@prefix@ --exec_prefix=@exec_prefix@ --sbindir=@sbindir@ --bindir=@bindir@ --libdir=@libdir@ --sysconfdir=@sysconfdir@ -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+datarootdir="@datarootdir@" -+ -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+sbindir="@sbindir@" -+bindir="@bindir@" -+sysconfdir="@sysconfdir@" - PACKAGE_NAME=@PACKAGE_NAME@ - PACKAGE_VERSION=@PACKAGE_VERSION@ - host_os=@host_os@ --datarootdir=@datarootdir@ --datadir=@datadir@ --pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"` -+datadir="@datadir@" -+pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`" - grub_cfg="" --grub_mkconfig_dir=${sysconfdir}/grub.d -+grub_mkconfig_dir="${sysconfdir}"/grub.d - - self=`basename $0` - --grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed "${transform}"` --grub_probe=${sbindir}/`echo grub-probe | sed "${transform}"` -+grub_mkdevicemap="${sbindir}/`echo grub-mkdevicemap | sed "${transform}"`" -+grub_probe="${sbindir}/`echo grub-probe | sed "${transform}"`" - grub_script_check="${bindir}/`echo grub-script-check | sed "${transform}"`" - - GRUB_PREFIX=`echo '/@bootdirname@/@grubdirname@' | sed "s,//*,/,g"` -diff --git a/util/grub-mknetdir.in b/util/grub-mknetdir.in -index b353e98..860fb6f 100644 ---- a/util/grub-mknetdir.in -+++ b/util/grub-mknetdir.in -@@ -19,25 +19,24 @@ - # Initialize some variables. - transform="@program_transform_name@" - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --sbindir=@sbindir@ --bindir=@bindir@ --libdir=@libdir@ -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+datarootdir="@datarootdir@" -+bindir="@bindir@" -+libdir="@libdir@" - PACKAGE_NAME=@PACKAGE_NAME@ - PACKAGE_TARNAME=@PACKAGE_TARNAME@ - PACKAGE_VERSION=@PACKAGE_VERSION@ - target_cpu=@target_cpu@ - platform=@platform@ - host_os=@host_os@ --pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}` --localedir=@datadir@/locale -+pkglibdir="${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`" - native_platform=@platform@ - pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst" - - self=`basename $0` - --grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` -+grub_mkimage="${bindir}/`echo grub-mkimage | sed ${transform}`" - rootdir=/srv/tftp - grub_prefix=`echo /boot/grub | sed ${transform}` - modules= -@@ -48,7 +47,7 @@ recheck=no - debug=no - debug_image= - subdir=`echo /boot/grub | sed ${transform}` --pc_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-pc -+pc_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-pc" - - # Usage: usage - # Print the usage. -@@ -170,12 +169,12 @@ process_input_dir () - config_opt= - mkdir -p "$grubdir" || exit 1 - -- for file in ${grubdir}/*.mod ${grubdir}/*.lst ${grubdir}/*.img ${grubdir}/efiemu??.o; do -- if test -f $file && [ "`basename $file`" != menu.lst ]; then -- rm -f $file || exit 1 -+ for file in "${grubdir}"/*.mod "${grubdir}"/*.lst "${grubdir}"/*.img "${grubdir}"/efiemu??.o; do -+ if test -f "$file" && [ "`basename $file`" != menu.lst ]; then -+ rm -f "$file" || exit 1 - fi - done -- for file in ${input_dir}/*.mod; do -+ for file in "${input_dir}"/*.mod; do - if test -f "$file"; then - cp -f "$file" "$grubdir/" - fi -@@ -187,7 +186,7 @@ process_input_dir () - done - - mkdir -p "$grubdir/locale" -- for file in ${input_dir}/po/*.mo; do -+ for file in "${input_dir}"/po/*.mo; do - if test -f "$file"; then - cp -f "$file" "$grubdir/locale/" - fi -@@ -213,7 +212,7 @@ process_input_dir () - source ${subdir}/grub.cfg - EOF - -- $grub_mkimage ${config_opt} -d "${input_dir}" -O ${mkimage_target} --output=${grubdir}/core.$ext --prefix=$prefix $modules $netmodules || exit 1 -+ "$grub_mkimage" ${config_opt} -d "${input_dir}" -O ${mkimage_target} "--output=${grubdir}/core.$ext" "--prefix=$prefix" $modules $netmodules || exit 1 - echo "Netboot directory for ${platform} created. Configure your DHCP server to point to ${subdir}/${platform}/core.$ext" - } - -diff --git a/util/grub-mkrescue.in b/util/grub-mkrescue.in -index f7f7517..383ee7a 100644 ---- a/util/grub-mkrescue.in -+++ b/util/grub-mkrescue.in -@@ -20,10 +20,11 @@ set -e - # Initialize some variables. - transform="@program_transform_name@" - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --bindir=@bindir@ --libdir=@libdir@ -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+datarootdir="@datarootdir@" -+bindir="@bindir@" -+libdir="@libdir@" - PACKAGE_NAME=@PACKAGE_NAME@ - PACKAGE_TARNAME=@PACKAGE_TARNAME@ - PACKAGE_VERSION=@PACKAGE_VERSION@ -diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in -index 9da1511..5c4d9db 100644 ---- a/util/grub.d/00_header.in -+++ b/util/grub.d/00_header.in -@@ -19,9 +19,10 @@ set -e - - transform="@program_transform_name@" - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --libdir=@libdir@ -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+libdir="@libdir@" -+datarootdir="@datarootdir@" - locale_dir=`echo ${GRUB_PREFIX}/locale | sed ${transform}` - grub_lang=`echo $LANG | cut -d . -f 1` - -@@ -112,7 +113,7 @@ for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do - done - - if [ "x$serial" = x1 ]; then -- if ! test -e ${GRUB_PREFIX}/serial.mod ; then -+ if ! test -e "${GRUB_PREFIX}/serial.mod" ; then - echo "Serial terminal not available on this platform." >&2 ; exit 1 - fi - -diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index edb1eda..8bc1180 100644 ---- a/util/grub.d/10_linux.in -+++ b/util/grub.d/10_linux.in -@@ -17,11 +17,11 @@ set -e - # You should have received a copy of the GNU General Public License - # along with GRUB. If not, see . - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --bindir=@bindir@ --libdir=@libdir@ --. ${libdir}/grub/grub-mkconfig_lib -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+libdir="@libdir@" -+datarootdir="@datarootdir@" -+. "${datarootdir}/grub/grub-mkconfig_lib" - - export TEXTDOMAIN=@PACKAGE@ - export TEXTDOMAINDIR=@localedir@ -diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index f37e365..9104667 100644 ---- a/util/grub.d/20_linux_xen.in -+++ b/util/grub.d/20_linux_xen.in -@@ -17,14 +17,14 @@ set -e - # You should have received a copy of the GNU General Public License - # along with GRUB. If not, see . - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --bindir=@bindir@ --libdir=@libdir@ --. ${libdir}/grub/grub-mkconfig_lib -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+libdir="@libdir@" -+datarootdir="@datarootdir@" -+. "${datarootdir}/grub/grub-mkconfig_lib" - - export TEXTDOMAIN=@PACKAGE@ --export TEXTDOMAINDIR=@localedir@ -+export TEXTDOMAINDIR="@localedir@" - - CLASS="--class gnu-linux --class gnu --class os --class xen" - -diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in -index 9eb7b3e..7336000 100644 ---- a/util/grub.d/30_os-prober.in -+++ b/util/grub.d/30_os-prober.in -@@ -17,11 +17,12 @@ set -e - # You should have received a copy of the GNU General Public License - # along with GRUB. If not, see . - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --libdir=@libdir@ -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+datarootdir="@datarootdir@" -+libdir="@libdir@" - --. ${libdir}/grub/grub-mkconfig_lib -+. "${datarootdir}/grub/grub-mkconfig_lib" - - if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then - exit 0 -diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in -deleted file mode 100644 -index 998452e..0000000 ---- a/util/update-grub_lib.in -+++ /dev/null -@@ -1,23 +0,0 @@ --# stub for new grub-mkconfig_lib --# Copyright (C) 2007,2008 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 --# the Free Software Foundation, either version 3 of the License, or --# (at your option) any later version. --# --# GRUB is distributed in the hope that it will be useful, --# but WITHOUT ANY WARRANTY; without even the implied warranty of --# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --# GNU General Public License for more details. --# --# You should have received a copy of the GNU General Public License --# along with GRUB. If not, see . -- --prefix=@prefix@ --exec_prefix=@exec_prefix@ --libdir=@libdir@ -- --. ${libdir}/grub/grub-mkconfig_lib -- --grub_warn "update-grub_lib is deprecated, use grub-mkconfig_lib instead" --- -1.7.7.6 - diff --git a/grub-1.99-prep_install_v2.patch b/grub-1.99-prep_install_v2.patch deleted file mode 100644 index 4ca57cb..0000000 --- a/grub-1.99-prep_install_v2.patch +++ /dev/null @@ -1,575 +0,0 @@ -From: Paulo Flabiano Smorigo -Date: Fri, 24 Feb 2012 17:26:02 -0400 -Subject: [PATCH] Pull in required v2 changes for PPC ---- - -diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c -index 2fbe809..9e80757 100644 ---- a/grub-core/kern/ieee1275/cmain.c -+++ b/grub-core/kern/ieee1275/cmain.c -@@ -60,6 +60,10 @@ grub_ieee1275_find_options (void) - int is_olpc = 0; - int is_qemu = 0; - -+#ifdef __sparc__ -+ grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_PARTITION_0); -+#endif -+ - grub_ieee1275_finddevice ("/", &root); - grub_ieee1275_finddevice ("/options", &options); - grub_ieee1275_finddevice ("/openprom", &openprom); -diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index 682a8b5..13a160f 100644 ---- a/grub-core/kern/ieee1275/init.c -+++ b/grub-core/kern/ieee1275/init.c -@@ -69,36 +69,45 @@ grub_translate_ieee1275_path (char *filepath) - } - - void --grub_machine_set_prefix (void) -+grub_machine_get_bootlocation (char **device, char **path) - { - char bootpath[64]; /* XXX check length */ - char *filename; -- char *prefix; -- -- if (grub_prefix[0]) -- { -- grub_env_set ("prefix", grub_prefix); -- /* Prefix is hardcoded in the core image. */ -- return; -- } -- -+ char *type; -+ - if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", &bootpath, - sizeof (bootpath), 0)) - { - /* Should never happen. */ - grub_printf ("/chosen/bootpath property missing!\n"); -- grub_env_set ("prefix", ""); - return; - } - - /* Transform an OF device path to a GRUB path. */ - -- prefix = grub_ieee1275_encode_devname (bootpath); -+ type = grub_ieee1275_get_device_type (bootpath); -+ if (type && grub_strcmp (type, "network") == 0) -+ { -+ char *dev, *canon; -+ char *ptr; -+ dev = grub_ieee1275_get_aliasdevname (bootpath); -+ canon = grub_ieee1275_canonicalise_devname (dev); -+ ptr = canon + grub_strlen (canon) - 1; -+ while (ptr > canon && (*ptr == ',' || *ptr == ':')) -+ ptr--; -+ ptr++; -+ *ptr = 0; -+ -+ grub_free (dev); -+ grub_free (canon); -+ } -+ else -+ *device = grub_ieee1275_encode_devname (bootpath); -+ grub_free (type); - - filename = grub_ieee1275_get_filename (bootpath); - if (filename) - { -- char *newprefix; - char *lastslash = grub_strrchr (filename, '\\'); - - /* Truncate at last directory. */ -@@ -107,19 +116,9 @@ grub_machine_set_prefix (void) - *lastslash = '\0'; - grub_translate_ieee1275_path (filename); - -- newprefix = grub_xasprintf ("%s%s", prefix, filename); -- if (newprefix) -- { -- grub_free (prefix); -- prefix = newprefix; -- } -+ *path = filename; - } - } -- -- grub_env_set ("prefix", prefix); -- -- grub_free (filename); -- grub_free (prefix); - } - - /* Claim some available memory in the first /memory node. */ -@@ -192,22 +191,12 @@ static void grub_claim_heap (void) - grub_machine_mmap_iterate (heap_init); - } - --static grub_uint64_t ieee1275_get_time_ms (void); -- --void --grub_machine_init (void) -+static void -+grub_parse_cmdline (void) - { -- char args[256]; - grub_ssize_t actual; -+ char args[256]; - -- grub_ieee1275_init (); -- -- grub_console_init_early (); -- grub_claim_heap (); -- grub_console_init_lately (); -- grub_ofdisk_init (); -- -- /* Process commandline. */ - if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootargs", &args, - sizeof args, &actual) == 0 - && actual > 1) -@@ -240,6 +229,21 @@ grub_machine_init (void) - } - } - } -+} -+ -+static grub_uint64_t ieee1275_get_time_ms (void); -+ -+void -+grub_machine_init (void) -+{ -+ grub_ieee1275_init (); -+ -+ grub_console_init_early (); -+ grub_claim_heap (); -+ grub_console_init_lately (); -+ grub_ofdisk_init (); -+ -+ grub_parse_cmdline (); - - grub_install_get_time_ms (ieee1275_get_time_ms); - } -diff --git a/grub-core/kern/ieee1275/openfw.c b/grub-core/kern/ieee1275/openfw.c -index f5dc8ef..6aa57ea 100644 ---- a/grub-core/kern/ieee1275/openfw.c -+++ b/grub-core/kern/ieee1275/openfw.c -@@ -27,6 +27,8 @@ enum grub_ieee1275_parse_type - { - GRUB_PARSE_FILENAME, - GRUB_PARSE_PARTITION, -+ GRUB_PARSE_DEVICE, -+ GRUB_PARSE_DEVICE_TYPE - }; - - /* Walk children of 'devpath', calling hook for each. */ -@@ -317,14 +319,9 @@ grub_ieee1275_parse_args (const char *path, enum grub_ieee1275_parse_type ptype) - { - char type[64]; /* XXX check size. */ - char *device = grub_ieee1275_get_devname (path); -- char *args = grub_ieee1275_get_devargs (path); - char *ret = 0; - grub_ieee1275_phandle_t dev; - -- if (!args) -- /* Shouldn't happen. */ -- return 0; -- - /* We need to know what type of device it is in order to parse the full - file path properly. */ - if (grub_ieee1275_finddevice (device, &dev)) -@@ -339,49 +336,93 @@ grub_ieee1275_parse_args (const char *path, enum grub_ieee1275_parse_type ptype) - goto fail; - } - -- if (!grub_strcmp ("block", type)) -+ switch (ptype) - { -- /* The syntax of the device arguments is defined in the CHRP and PReP -- IEEE1275 bindings: "[partition][,[filename]]". */ -- char *comma = grub_strchr (args, ','); -+ case GRUB_PARSE_DEVICE: -+ ret = grub_strdup (device); -+ break; -+ case GRUB_PARSE_DEVICE_TYPE: -+ ret = grub_strdup (type); -+ break; -+ case GRUB_PARSE_FILENAME: -+ { -+ char *comma; -+ char *args; -+ -+ if (grub_strcmp ("block", type) != 0) -+ goto unknown; -+ -+ args = grub_ieee1275_get_devargs (path); -+ if (!args) -+ /* Shouldn't happen. */ -+ return 0; - -- if (ptype == GRUB_PARSE_FILENAME) -- { -- if (comma) -- { -- char *filepath = comma + 1; -- -- /* Make sure filepath has leading backslash. */ -- if (filepath[0] != '\\') -- ret = grub_xasprintf ("\\%s", filepath); -- else -- ret = grub_strdup (filepath); -+ /* The syntax of the device arguments is defined in the CHRP and PReP -+ IEEE1275 bindings: "[partition][,[filename]]". */ -+ comma = grub_strchr (args, ','); -+ -+ if (comma) -+ { -+ char *filepath = comma + 1; -+ -+ /* Make sure filepath has leading backslash. */ -+ if (filepath[0] != '\\') -+ ret = grub_xasprintf ("\\%s", filepath); -+ else -+ ret = grub_strdup (filepath); - } -+ grub_free (args); - } -- else if (ptype == GRUB_PARSE_PARTITION) -- { -- if (!comma) -- ret = grub_strdup (args); -- else -- ret = grub_strndup (args, (grub_size_t)(comma - args)); -- } -- } -- else -- { -- /* XXX Handle net devices by configuring & registering a grub_net_dev -- here, then return its name? -- Example path: "net:,,,,,". */ -+ break; -+ case GRUB_PARSE_PARTITION: -+ { -+ char *comma; -+ char *args; -+ -+ if (grub_strcmp ("block", type) != 0) -+ goto unknown; -+ -+ args = grub_ieee1275_get_devargs (path); -+ if (!args) -+ /* Shouldn't happen. */ -+ return 0; -+ -+ comma = grub_strchr (args, ','); -+ if (!comma) -+ ret = grub_strdup (args); -+ else -+ ret = grub_strndup (args, (grub_size_t)(comma - args)); -+ /* Consistently provide numbered partitions to GRUB. -+ OpenBOOT traditionally uses alphabetical partition -+ specifiers. */ -+ if (ret[0] >= 'a' && ret[0] <= 'z') -+ ret[0] = '1' + (ret[0] - 'a'); -+ grub_free (args); -+ } -+ break; -+ default: -+ unknown: - grub_printf ("Unsupported type %s for device %s\n", type, device); - } - - fail: - grub_free (device); -- grub_free (args); - return ret; - } - - char * -+grub_ieee1275_get_device_type (const char *path) -+{ -+ return grub_ieee1275_parse_args (path, GRUB_PARSE_DEVICE_TYPE); -+} -+ -+char * -+grub_ieee1275_get_aliasdevname (const char *path) -+{ -+ return grub_ieee1275_parse_args (path, GRUB_PARSE_DEVICE); -+} -+ -+char * - grub_ieee1275_get_filename (const char *path) - { - return grub_ieee1275_parse_args (path, GRUB_PARSE_FILENAME); -@@ -403,10 +444,10 @@ grub_ieee1275_encode_devname (const char *path) - /* GRUB partition 1 is OF partition 0. */ - partno++; - -- encoding = grub_xasprintf ("(%s,%d)", device, partno); -+ encoding = grub_xasprintf ("%s,%d", device, partno); - } - else -- encoding = grub_xasprintf ("(%s)", device); -+ encoding = grub_xasprintf ("%s", device); - - grub_free (partition); - grub_free (device); -diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c -index da71232..6820f4c 100644 ---- a/grub-core/kern/main.c -+++ b/grub-core/kern/main.c -@@ -129,27 +129,74 @@ grub_env_write_root (struct grub_env_var *var __attribute__ ((unused)), - return grub_strdup (val); - } - --/* Set the root device according to the dl prefix. */ - static void --grub_set_root_dev (void) -+grub_set_prefix_and_root (void) - { -- const char *prefix; -+ char *device = NULL; -+ char *path = NULL; -+ char *fwdevice = NULL; -+ char *fwpath = NULL; - - grub_register_variable_hook ("root", 0, grub_env_write_root); - -- prefix = grub_env_get ("prefix"); -- -- if (prefix) -+ { -+ char *pptr = NULL; -+ if (grub_prefix[0] == '(') -+ { -+ pptr = grub_strrchr (grub_prefix, ')'); -+ if (pptr) -+ { -+ device = grub_strndup (grub_prefix + 1, pptr - grub_prefix - 1); -+ pptr++; -+ } -+ } -+ if (!pptr) -+ pptr = grub_prefix; -+ if (pptr[0]) -+ path = grub_strdup (pptr); -+ } -+ if ((!device || device[0] == ',' || !device[0]) || !path) -+ grub_machine_get_bootlocation (&fwdevice, &fwpath); -+ -+ if (!device && fwdevice) -+ device = fwdevice; -+ else if (fwdevice && (device[0] == ',' || !device[0])) - { -- char *dev; -+ /* We have a partition, but still need to fill in the drive. */ -+ char *comma, *new_device; -+ -+ comma = grub_strchr (fwdevice, ','); -+ if (comma) -+ { -+ char *drive = grub_strndup (fwdevice, comma - fwdevice); -+ new_device = grub_xasprintf ("%s%s", drive, device); -+ grub_free (drive); -+ } -+ else -+ new_device = grub_xasprintf ("%s%s", fwdevice, device); - -- dev = grub_file_get_device_name (prefix); -- if (dev) -+ grub_free (fwdevice); -+ grub_free (device); -+ device = new_device; -+ } -+ if (fwpath && !path) -+ path = fwpath; -+ if (device) -+ { -+ char *prefix; -+ -+ prefix = grub_xasprintf ("(%s)%s", device, path ? : ""); -+ if (prefix) - { -- grub_env_set ("root", dev); -- grub_free (dev); -+ grub_env_set ("prefix", prefix); -+ grub_free (prefix); - } -+ grub_env_set ("root", device); - } -+ -+ grub_free (device); -+ grub_free (path); -+ grub_print_error (); - } - - /* Load the normal mode module and execute the normal mode if possible. */ -@@ -159,7 +206,7 @@ grub_load_normal_mode (void) - /* Load the module. */ - grub_dl_load ("normal"); - -- /* Something went wrong. Print errors here to let user know why we're entering rescue mode. */ -+ /* Print errors if any. */ - grub_print_error (); - grub_errno = 0; - -@@ -187,8 +234,7 @@ grub_main (void) - - /* It is better to set the root device as soon as possible, - for convenience. */ -- grub_machine_set_prefix (); -- grub_set_root_dev (); -+ grub_set_prefix_and_root (); - grub_env_export ("root"); - grub_env_export ("prefix"); - -diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index 4c56cc2..fc977f5 100644 ---- a/include/grub/ieee1275/ieee1275.h -+++ b/include/grub/ieee1275/ieee1275.h -@@ -195,7 +195,8 @@ char *EXPORT_FUNC(grub_ieee1275_get_filename) (const char *path); - int EXPORT_FUNC(grub_ieee1275_devices_iterate) (int (*hook) - (struct grub_ieee1275_devalias * - alias)); -- -+char *EXPORT_FUNC(grub_ieee1275_get_aliasdevname) (const char *path); - char *EXPORT_FUNC(grub_ieee1275_canonicalise_devname) (const char *path); -+char *EXPORT_FUNC(grub_ieee1275_get_device_type) (const char *path); - - #endif /* ! GRUB_IEEE1275_HEADER */ -diff --git a/include/grub/kernel.h b/include/grub/kernel.h -index 2ecc73d..09839de 100644 ---- a/include/grub/kernel.h -+++ b/include/grub/kernel.h -@@ -84,7 +84,8 @@ void grub_machine_init (void); - void EXPORT_FUNC(grub_machine_fini) (void); - - /* The machine-specific prefix initialization. */ --void grub_machine_set_prefix (void); -+void -+grub_machine_get_bootlocation (char **device, char **path); - - /* Register all the exported symbols. This is automatically generated. */ - void grub_register_exported_symbols (void); -diff --git a/util/grub-install.in b/util/grub-install.in -index ff8bea8..cbf1e1e 100644 ---- a/util/grub-install.in -+++ b/util/grub-install.in -@@ -271,7 +271,8 @@ if test "x$install_device" = x && ([ "${target_cpu}-${platform}" = "i386-pc" ] \ - fi - - if ! ([ "${target_cpu}-${platform}" = "i386-pc" ] \ -- || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ]); then -+ || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ] \ -+ || [ "${target_cpu}-${platform}" = "powerpc-ieee1275" ]); then - install_device= - fi - -@@ -522,11 +523,11 @@ if [ "x${devabstraction_module}" = "x" ] ; then - # Strip partition number - grub_partition="`echo "${grub_drive}" | sed -e 's/^[^,]*[,)]//; s/)$//'`" - grub_drive="`echo "${grub_drive}" | sed -e s/,[a-z0-9,]*//g`" -- if [ "$disk_module" = ata ] || [ "x${grub_drive}" != "x${install_drive}" ] || ([ "x$platform" != xefi ] && [ "x$platform" != xpc ] && [ x"${target_cpu}-${platform}" != x"sparc64-ieee1275" ]) ; then -+ if [ "$disk_module" = ata ] || [ "x${grub_drive}" != "x${install_drive}" ] || ([ "x$platform" != xefi ] && [ "x$platform" != xpc ] && [ x"${platform}" != x"ieee1275" ]); then - # generic method (used on coreboot and ata mod) - uuid="`"$grub_probe" --device-map="${device_map}" --target=fs_uuid --device "${grub_device}"`" - if [ "x${uuid}" = "x" ] ; then -- if [ "x$platform" != xefi ] && [ "x$platform" != xpc ] && [ x"${target_cpu}-${platform}" != x"sparc64-ieee1275" ]; then -+ if [ "x$platform" != xefi ] && [ "x$platform" != xpc ] && [ x"${platform}" != x"ieee1275" ]; then - echo "UUID needed with $platform, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 - elif [ "$disk_module" = ata ]; then - echo "UUID needed with ata mod, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 -@@ -540,11 +541,12 @@ if [ "x${devabstraction_module}" = "x" ] ; then - echo 'set prefix=($root)'"${relative_grubdir}" >> "${grubdir}/load.cfg" - config_opt="-c ${grubdir}/load.cfg " - modules="$modules search_fs_uuid" -- elif [ "x$platform" = xefi ] || [ "x$platform" = xpc ]; then -+ else - # we need to hardcode the partition number in the core image's prefix. - if [ x"$grub_partition" = x ]; then - prefix_drive="()" - else -+ # Comma is already there - prefix_drive="(,$grub_partition)" - fi - fi -@@ -612,6 +614,30 @@ elif [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${pla - - # Point boot-device at the new grub install - boot_device="$ofpath:$partno,"`"$grub_mkrelpath" "${grubdir}/core.${imgext}" | sed 's,/,\\\\,g'` -+ -+ # If a install device is defined, copy the core.elf to PReP partition. -+ if [ "${target_cpu}-${platform}" = "powerpc-ieee1275" ] \ -+ && [ -n "${install_device}" ]; then -+ if [ "$("${grub_probe}" -m "${device_map}" -d "${install_device}" -t msdos_parttype)" != "41" ]; then -+ echo "The chosen partition is not a PReP partition." -+ exit 1 -+ fi -+ -+ # Check if device is with an ELF within or is blank -+ if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" = ELF ] || cmp -s -n $(blockdev --getsize64 ${install_device}) /dev/zero ${install_device} ; then -+ # Change boot device to the harddisk root -+ boot_device="$ofpath" -+ dd if="${grubdir}/core.${imgext}" of="${install_device}" status=noxfer || { -+ echo "Failed to copy Grub to the PReP partition." -+ exit 1 -+ } -+ else -+ echo "The PReP partition is not empty. If you are sure you want to use it, run dd to clear it:" -+ echo " dd if=/dev/zero of=${install_device}" -+ exit 1 -+ fi -+ fi -+ - "$nvsetenv" boot-device "$boot_device" || { - echo "$nvsetenv failed." - echo "You will have to set boot-device manually. At the Open Firmware prompt, type:" -diff --git a/util/grub-probe.c b/util/grub-probe.c -index 0d5dac9..3512a79 100644 ---- a/util/grub-probe.c -+++ b/util/grub-probe.c -@@ -54,6 +54,7 @@ enum { - PRINT_DEVICE, - PRINT_PARTMAP, - PRINT_ABSTRACTION, -+ PRINT_MSDOS_PARTTYPE - }; - - int print = PRINT_FS; -@@ -221,6 +222,17 @@ probe (const char *path, char *device_name) - free (list); - list = tmp; - } -+ printf ("\n"); -+ goto end; -+ } -+ -+ if (print == PRINT_MSDOS_PARTTYPE) -+ { -+ if (dev->disk->partition -+ && strcmp(dev->disk->partition->partmap->name, "msdos") == 0) -+ printf ("%02x", dev->disk->partition->msdostype); -+ -+ printf ("\n"); - goto end; - } - -@@ -289,7 +301,7 @@ Probe device information for a given path (or device, if the -d option is given) - \n\ - -d, --device given argument is a system device, not a path\n\ - -m, --device-map=FILE use FILE as the device map [default=%s]\n\ -- -t, --target=(fs|fs_uuid|fs_label|drive|device|partmap|abstraction)\n\ -+ -t, --target=(fs|fs_uuid|fs_label|drive|device|partmap|abstraction|msdos_parttype)\n\ - print filesystem module, GRUB drive, system device, partition map module or abstraction module [default=fs]\n\ - -h, --help display this message and exit\n\ - -V, --version print version information and exit\n\ -@@ -348,6 +360,8 @@ main (int argc, char *argv[]) - print = PRINT_PARTMAP; - else if (!strcmp (optarg, "abstraction")) - print = PRINT_ABSTRACTION; -+ else if (!strcmp (optarg, "msdos_parttype")) -+ print = PRINT_MSDOS_PARTTYPE; - else - usage (1); - break; diff --git a/grub2-1.99-handle-more-dmraid.patch b/grub2-1.99-handle-more-dmraid.patch deleted file mode 100644 index bb82492..0000000 --- a/grub2-1.99-handle-more-dmraid.patch +++ /dev/null @@ -1,285 +0,0 @@ -From: Colin Watson -Subject: Improve devmapper support -Date: 2011-05-18 07:35:47 +0000 - -=== modified file 'grub-core/kern/emu/getroot.c' ---- a/grub-core/kern/emu/getroot.c 2011-04-21 09:26:29 +0000 -+++ b/grub-core/kern/emu/getroot.c 2011-05-18 07:35:47 +0000 -@@ -34,6 +34,10 @@ - #include - #include - -+#ifdef HAVE_DEVICE_MAPPER -+# include -+#endif -+ - #ifdef __GNU__ - #include - #include -@@ -634,32 +638,65 @@ - } - - static int --grub_util_is_dmraid (const char *os_dev) -+grub_util_is_lvm (const char *os_dev) - { -- if (! strncmp (os_dev, "/dev/mapper/nvidia_", 19)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/isw_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/hpt37x_", 19)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/hpt45x_", 19)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/via_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/lsi_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/pdc_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/jmicron_", 20)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/asr_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/sil_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/ddf1_", 17)) -- return 1; -- -- return 0; -+ if ((strncmp ("/dev/mapper/", os_dev, 12) != 0)) -+ return 0; -+ -+#ifdef HAVE_DEVICE_MAPPER -+ { -+ struct dm_tree *tree; -+ uint32_t maj, min; -+ struct dm_tree_node *node = NULL; -+ const char *node_uuid; -+ struct stat st; -+ -+ if (stat (os_dev, &st) < 0) -+ return 0; -+ -+ tree = dm_tree_create (); -+ if (! tree) -+ { -+ grub_printf ("Failed to create tree\n"); -+ grub_dprintf ("hostdisk", "dm_tree_create failed\n"); -+ return 0; -+ } -+ -+ maj = major (st.st_rdev); -+ min = minor (st.st_rdev); -+ -+ if (! dm_tree_add_dev (tree, maj, min)) -+ { -+ grub_dprintf ("hostdisk", "dm_tree_add_dev failed\n"); -+ dm_tree_free (tree); -+ return 0; -+ } -+ -+ node = dm_tree_find_node (tree, maj, min); -+ if (! node) -+ { -+ grub_dprintf ("hostdisk", "dm_tree_find_node failed\n"); -+ dm_tree_free (tree); -+ return 0; -+ } -+ node_uuid = dm_tree_node_get_uuid (node); -+ if (! node_uuid) -+ { -+ grub_dprintf ("hostdisk", "%s has no DM uuid\n", os_dev); -+ dm_tree_free (tree); -+ return 0; -+ } -+ if (strncmp (node_uuid, "LVM-", 4) != 0) -+ { -+ dm_tree_free (tree); -+ return 0; -+ } -+ dm_tree_free (tree); -+ return 1; -+ } -+#else -+ return 1; -+#endif /* HAVE_DEVICE_MAPPER */ - } - - int -@@ -671,13 +708,11 @@ - return GRUB_DEV_ABSTRACTION_NONE; - - /* Check for LVM. */ -- if (!strncmp (os_dev, "/dev/mapper/", 12) -- && ! grub_util_is_dmraid (os_dev) -- && strncmp (os_dev, "/dev/mapper/mpath", 17) != 0) -+ if (grub_util_is_lvm (os_dev)) - return GRUB_DEV_ABSTRACTION_LVM; - - /* Check for RAID. */ -- if (!strncmp (os_dev, "/dev/md", 7)) -+ if (!strncmp (os_dev, "/dev/md", 7) && ! grub_util_device_is_mapped (os_dev)) - return GRUB_DEV_ABSTRACTION_RAID; - #endif - - -=== modified file 'grub-core/kern/emu/hostdisk.c' ---- a/grub-core/kern/emu/hostdisk.c 2011-05-09 16:59:35 +0000 -+++ b/grub-core/kern/emu/hostdisk.c 2011-05-18 07:35:47 +0000 -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -331,18 +332,23 @@ - return GRUB_ERR_NONE; - } - -+int -+grub_util_device_is_mapped (const char *dev) -+{ - #ifdef HAVE_DEVICE_MAPPER --static int --device_is_mapped (const char *dev) --{ - struct stat st; - -+ if (!grub_device_mapper_supported ()) -+ return 0; -+ - if (stat (dev, &st) < 0) - return 0; - - return dm_is_dm_major (major (st.st_rdev)); -+#else -+ return 0; -+#endif /* HAVE_DEVICE_MAPPER */ - } --#endif /* HAVE_DEVICE_MAPPER */ - - #if defined (__FreeBSD__) || defined(__FreeBSD_kernel__) - /* FIXME: geom actually gives us the whole container hierarchy. -@@ -418,7 +424,7 @@ - # endif /* !defined(HAVE_DIOCGDINFO) */ - - # ifdef HAVE_DEVICE_MAPPER -- if (grub_device_mapper_supported () && device_is_mapped (dev)) { -+ if (grub_util_device_is_mapped (dev)) { - struct dm_task *task = NULL; - grub_uint64_t start, length; - char *target_type, *params, *space; -@@ -1149,6 +1155,54 @@ - return ret; - } - -+#ifdef HAVE_DEVICE_MAPPER -+static int -+grub_util_get_dm_node_linear_info (const char *dev, -+ int *maj, int *min) -+{ -+ struct dm_task *dmt; -+ void *next = NULL; -+ uint64_t length, start; -+ char *target, *params; -+ char *ptr; -+ int major, minor; -+ -+ dmt = dm_task_create(DM_DEVICE_TABLE); -+ if (!dmt) -+ return 0; -+ -+ if (!dm_task_set_name(dmt, dev)) -+ return 0; -+ dm_task_no_open_count(dmt); -+ if (!dm_task_run(dmt)) -+ return 0; -+ next = dm_get_next_target(dmt, next, &start, &length, -+ &target, ¶ms); -+ if (grub_strcmp (target, "linear") != 0) -+ return 0; -+ major = grub_strtoul (params, &ptr, 10); -+ if (grub_errno) -+ { -+ grub_errno = GRUB_ERR_NONE; -+ return 0; -+ } -+ if (*ptr != ':') -+ return 0; -+ ptr++; -+ minor = grub_strtoul (ptr, 0, 10); -+ if (grub_errno) -+ { -+ grub_errno = GRUB_ERR_NONE; -+ return 0; -+ } -+ if (maj) -+ *maj = major; -+ if (min) -+ *min = minor; -+ return 1; -+} -+#endif -+ - static char * - convert_system_partition_to_system_disk (const char *os_dev, struct stat *st) - { -@@ -1325,9 +1379,39 @@ - node = NULL; - goto devmapper_out; - } -- else if (strncmp (node_uuid, "DMRAID-", 7) != 0) -- { -+ if (strncmp (node_uuid, "LVM-", 4) == 0) -+ { -+ grub_dprintf ("hostdisk", "%s is an LVM\n", path); -+ node = NULL; -+ goto devmapper_out; -+ } -+ if (strncmp (node_uuid, "mpath-", 6) == 0) -+ { -+ /* Multipath partitions have partN-mpath-* UUIDs, and are -+ linear mappings so are handled by -+ grub_util_get_dm_node_linear_info. Multipath disks are not -+ linear mappings and must be handled specially. */ -+ grub_dprintf ("hostdisk", "%s is a multipath disk\n", path); -+ mapper_name = dm_tree_node_get_name (node); -+ goto devmapper_out; -+ } -+ if (strncmp (node_uuid, "DMRAID-", 7) != 0) -+ { -+ int major, minor; -+ const char *node_name; - grub_dprintf ("hostdisk", "%s is not DM-RAID\n", path); -+ -+ if ((node_name = dm_tree_node_get_name (node)) -+ && grub_util_get_dm_node_linear_info (node_name, -+ &major, &minor)) -+ { -+ if (tree) -+ dm_tree_free (tree); -+ free (path); -+ char *ret = grub_find_device (NULL, (major << 8) | minor); -+ return ret; -+ } -+ - node = NULL; - goto devmapper_out; - } - -=== modified file 'include/grub/emu/misc.h' ---- a/include/grub/emu/misc.h 2010-12-02 13:26:46 +0000 -+++ b/include/grub/emu/misc.h 2011-05-18 07:35:47 +0000 -@@ -54,6 +54,8 @@ - - char *grub_make_system_path_relative_to_its_root (const char *path) - __attribute__ ((warn_unused_result)); -+int -+grub_util_device_is_mapped (const char *dev); - - void * EXPORT_FUNC(xmalloc) (grub_size_t size) __attribute__ ((warn_unused_result)); - void * EXPORT_FUNC(xrealloc) (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result)); - diff --git a/grub2-1.99-remove-serial.mod-test-from-00_header-748964.patch b/grub2-1.99-remove-serial.mod-test-from-00_header-748964.patch deleted file mode 100644 index 918d559..0000000 --- a/grub2-1.99-remove-serial.mod-test-from-00_header-748964.patch +++ /dev/null @@ -1,29 +0,0 @@ -From fa200c2b59c0b8346466b503cd6ac80e331c9277 Mon Sep 17 00:00:00 2001 -From: Fedora Ninjas -Date: Thu, 8 Mar 2012 13:43:39 -0800 -Subject: [GRUB2] remove serial.mod test from 00_header (#748964) - -This test doesn't belong here, upstream has removed it, and it -was blocking serial installs from working. ---- - util/grub.d/00_header.in | 4 ---- - 1 files changed, 0 insertions(+), 4 deletions(-) - -diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in -index 5c4d9db..a1a75aa 100644 ---- a/util/grub.d/00_header.in -+++ b/util/grub.d/00_header.in -@@ -113,10 +113,6 @@ for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do - done - - if [ "x$serial" = x1 ]; then -- if ! test -e "${GRUB_PREFIX}/serial.mod" ; then -- echo "Serial terminal not available on this platform." >&2 ; exit 1 -- fi -- - if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then - grub_warn "Requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used." - GRUB_SERIAL_COMMAND=serial --- -1.7.7.6 - diff --git a/grub2-gfxpayload-efi.patch b/grub2-gfxpayload-efi.patch deleted file mode 100644 index 742417a..0000000 --- a/grub2-gfxpayload-efi.patch +++ /dev/null @@ -1,63 +0,0 @@ -From: Vladimir 'phcoder' Serbinenko -Subject: Don't accept text modes on EFI when booting Linux. -Date: 2011-08-16 16:11:10 +0200 - ------------------------------------------------------------- -revno: 3402 -committer: Vladimir 'phcoder' Serbinenko -branch nick: grub -timestamp: Tue 2011-08-16 16:11:10 +0200 -message: - Don't accept text modes on EFI when booting Linux. - - * grub-core/loader/i386/linux.c (ACCEPTS_PURE_TEXT): New define. - (grub_linux_boot) [!ACCEPTS_PURE_TEXT]: Restrict to graphics modes. -diff: - -=== modified file 'grub-core/loader/i386/linux.c' ---- a/grub-core/loader/i386/linux.c 2011-05-18 07:56:33 +0000 -+++ b/grub-core/loader/i386/linux.c 2011-08-16 14:11:10 +0000 -@@ -45,15 +45,18 @@ - #include - #define HAS_VGA_TEXT 0 - #define DEFAULT_VIDEO_MODE "auto" -+#define ACCEPTS_PURE_TEXT 0 - #elif defined (GRUB_MACHINE_IEEE1275) - #include - #define HAS_VGA_TEXT 0 - #define DEFAULT_VIDEO_MODE "text" -+#define ACCEPTS_PURE_TEXT 1 - #else - #include - #include - #define HAS_VGA_TEXT 1 - #define DEFAULT_VIDEO_MODE "text" -+#define ACCEPTS_PURE_TEXT 1 - #endif - - #define GRUB_LINUX_CL_OFFSET 0x1000 -@@ -483,12 +486,22 @@ - tmp = grub_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar); - if (! tmp) - return grub_errno; -+#if ACCEPTS_PURE_TEXT - err = grub_video_set_mode (tmp, 0, 0); -+#else -+ err = grub_video_set_mode (tmp, GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0); -+#endif - grub_free (tmp); - } - else -- err = grub_video_set_mode (DEFAULT_VIDEO_MODE, 0, 0); -- -+ { -+#if ACCEPTS_PURE_TEXT -+ err = grub_video_set_mode (DEFAULT_VIDEO_MODE, 0, 0); -+#else -+ err = grub_video_set_mode (DEFAULT_VIDEO_MODE, -+ GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0); -+#endif -+ } - if (err) - { - grub_print_error (); diff --git a/grub2.spec b/grub2.spec index 6b8bc3f..80626d1 100644 --- a/grub2.spec +++ b/grub2.spec @@ -15,6 +15,10 @@ %global efi %{ix86} x86_64 ia64 %endif + +%global tarversion 2.00~beta2 +%undefine _missing_build_ids_terminate_build + Name: grub2 Epoch: 1 Version: 1.99 @@ -25,24 +29,15 @@ Group: System Environment/Base License: GPLv3+ URL: http://www.gnu.org/software/grub/ Obsoletes: grub < 1:0.98 -Source0: ftp://ftp.gnu.org/gnu/grub/grub-%{version}.tar.xz +Source0: ftp://ftp.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz Source1: 90_persistent Source2: grub.default Source3: README.Fedora Patch0: grub-1.99-handle-fwrite-return.patch Patch1: grub-1.99-grub_test_assert_printf.patch Patch2: grub-1.99-just-say-linux.patch -Patch3: grub-1.99-Workaround-for-variable-set-but-not-used-issue.patch -Patch4: grub2-handle-initramfs-on-xen.patch -Patch5: grub2-1.99-handle-more-dmraid.patch -Patch6: grub2-gfxpayload-efi.patch -# https://savannah.gnu.org/bugs/index.php?35018 -Patch7: grub-1.99-fix_grub-probe_call.patch -Patch8: grub-1.99-handle-newer-autotools.patch +Patch3: grub2-handle-initramfs-on-xen.patch Patch9: grub-1.99-gcc-4.7.0.patch -Patch10: grub2-1.99-remove-serial.mod-test-from-00_header-748964.patch -Patch11: grub-1.99-prep_install_v2.patch - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -64,7 +59,7 @@ Requires(post): dracut # TODO: ppc # ExclusiveArch: %{ix86} x86_64 %{sparc} -ExcludeArch: s390 s390x +ExcludeArch: s390 s390x ppc %description The GRand Unified Bootloader (GRUB) is a highly configurable and customizable @@ -84,34 +79,36 @@ provides support for EFI systems. %endif %prep -%setup -T -c -n grub-%{version} +%setup -T -c -n grub-%{tarversion} %ifarch %{efi} -%setup -D -q -T -a 0 -n grub-%{version} -cd grub-%{version} +echo foo +%setup -D -q -T -a 0 -n grub-%{tarversion} +echo bar +cd grub-%{tarversion} cp %{SOURCE3} . git init git config user.email "pjones@fedoraproject.org" git config user.name "Fedora Ninjas" git add . -git commit -a -q -m "%{version} baseline." +git commit -a -q -m "%{tarversion} baseline." git am %{patches} cd .. -mv grub-%{version} grub-efi-%{version} +mv grub-%{tarversion} grub-efi-%{tarversion} %endif -%setup -D -q -T -a 0 -n grub-%{version} -cd grub-%{version} +%setup -D -q -T -a 0 -n grub-%{tarversion} +cd grub-%{tarversion} cp %{SOURCE3} . git init git config user.email "pjones@fedoraproject.org" git config user.name "Fedora Ninjas" git add . -git commit -a -q -m "%{version} baseline." +git commit -a -q -m "%{tarversion} baseline." git am %{patches} %build %ifarch %{efi} -cd grub-efi-%{version} +cd grub-efi-%{tarversion} ./autogen.sh %configure \ CFLAGS="$(echo $RPM_OPT_FLAGS | sed \ @@ -138,14 +135,14 @@ make %{?_smp_mflags} cd .. %endif -cd grub-%{version} +cd grub-%{tarversion} ./autogen.sh # -static is needed so that autoconf script is able to link # test that looks for _start symbol on 64 bit platforms -%ifarch %{sparc} ppc ppc64 -PLATFORM=ieee1275 +%ifarch %{sparc} ppc64 +%define platform ieee1275 %else -PLATFORM=pc +%define platform pc %endif %configure \ CFLAGS="$(echo $RPM_OPT_FLAGS | sed \ @@ -157,7 +154,7 @@ PLATFORM=pc -e 's/-m64//g' \ -e 's/-fasynchronous-unwind-tables//g' )" \ TARGET_LDFLAGS=-static \ - --with-platform=$PLATFORM \ + --with-platform=%{platform} \ --program-transform-name=s,grub,%{name}, \ --disable-werror \ --sbindir=/sbin @@ -177,7 +174,7 @@ set -e rm -fr $RPM_BUILD_ROOT %ifarch %{efi} -cd grub-efi-%{version} +cd grub-efi-%{tarversion} make DESTDIR=$RPM_BUILD_ROOT install mv $RPM_BUILD_ROOT/etc/bash_completion.d/grub $RPM_BUILD_ROOT/etc/bash_completion.d/grub-efi sed s,grub/grub-mkconfig_lib,grub-efi/grub-mkconfig_lib, -i $RPM_BUILD_ROOT/sbin/grub2-efi-mkconfig @@ -205,7 +202,7 @@ install -m 755 grub.efi $RPM_BUILD_ROOT/boot/efi/EFI/redhat/%{name}-efi/grub.efi cd .. %endif -cd grub-%{version} +cd grub-%{tarversion} make DESTDIR=$RPM_BUILD_ROOT install # Script that makes part of grub.cfg persist across updates @@ -286,19 +283,18 @@ fi %files %defattr(-,root,root,-) /etc/bash_completion.d/grub -%{_libdir}/%{name} +%{_libdir}/grub/*-%{platform}/ %{_datarootdir}/grub/grub-mkconfig_lib /sbin/%{name}-mkconfig -/sbin/%{name}-mkdevicemap /sbin/%{name}-mknetdir /sbin/%{name}-install /sbin/%{name}-probe /sbin/%{name}-reboot /sbin/%{name}-set-default -%ifarch %{ix86} x86_64 %{sparc} -/sbin/%{name}-setup -%endif -%{_bindir}/%{name}-bin2h +/sbin/%{name}-bios-setup +/sbin/%{name}-ofpathname +/sbin/%{name}-sparc64-setup +%{_bindir}/%{name}-mkstandalone %{_bindir}/%{name}-editenv %{_bindir}/%{name}-fstest %{_bindir}/%{name}-kbdcomp @@ -325,28 +321,31 @@ fi %{_sysconfdir}/sysconfig/grub %dir /boot/%{name} %ghost %config(noreplace) /boot/%{name}/grub.cfg -%doc grub-%{version}/COPYING grub-%{version}/INSTALL grub-%{version}/NEWS -%doc grub-%{version}/README grub-%{version}/THANKS grub-%{version}/TODO -%doc grub-%{version}/ChangeLog grub-%{version}/README.Fedora +%doc grub-%{tarversion}/COPYING grub-%{tarversion}/INSTALL +%doc grub-%{tarversion}/NEWS grub-%{tarversion}/README +%doc grub-%{tarversion}/THANKS grub-%{tarversion}/TODO +%doc grub-%{tarversion}/ChangeLog grub-%{tarversion}/README.Fedora %exclude %{_mandir} %{_infodir}/grub2* +%attr(0755,root,root)/%{_datarootdir}/grub/ %ifarch %{efi} %files efi %defattr(-,root,root,-) %attr(0755,root,root)/boot/efi/EFI/redhat /etc/bash_completion.d/grub-efi -%{_libdir}/grub2-efi/ +%{_libdir}/grub/%{_arch}-efi %{_datarootdir}/grub/grub-mkconfig_lib /sbin/grub2-efi-mkconfig -/sbin/grub2-efi-mkdevicemap /sbin/grub2-efi-mknetdir /sbin/grub2-efi-install /sbin/grub2-efi-probe /sbin/grub2-efi-reboot /sbin/grub2-efi-set-default -#/sbin/grub2-efi-setup -%{_bindir}/grub2-efi-bin2h +/sbin/grub2-efi-bios-setup +/sbin/grub2-efi-ofpathname +/sbin/grub2-efi-sparc64-setup +%{_bindir}/grub2-efi-mkstandalone %{_bindir}/grub2-efi-editenv %{_bindir}/grub2-efi-fstest %{_bindir}/grub2-efi-kbdcomp @@ -371,19 +370,19 @@ fi %config(noreplace) %{_sysconfdir}/grub2-efi.cfg %config(noreplace) %{_sysconfdir}/default/grub %{_sysconfdir}/sysconfig/grub -%dir /boot/efi/EFI/redhat/grub2-efi %ghost %config(noreplace) /boot/efi/EFI/redhat/grub2-efi/grub.cfg -%doc grub-%{version}/COPYING grub-%{version}/INSTALL grub-%{version}/NEWS -%doc grub-%{version}/README grub-%{version}/THANKS grub-%{version}/TODO -%doc grub-%{version}/ChangeLog grub-%{version}/README.Fedora +%doc grub-%{tarversion}/COPYING grub-%{tarversion}/INSTALL +%doc grub-%{tarversion}/NEWS grub-%{tarversion}/README +%doc grub-%{tarversion}/THANKS grub-%{tarversion}/TODO +%doc grub-%{tarversion}/ChangeLog grub-%{tarversion}/README.Fedora %exclude %{_mandir} %{_infodir}/grub2* %endif +%attr(0755,root,root)/%{_datarootdir}/grub/ %changelog -* Mon Mar 12 2012 Peter Jones - 1.99-18 -- Handle some missed bits for newer autotools support (patch from khopp) -- Handle PReP installation on PPC. +* Wed Mar 14 2012 Peter Jones - 1.99-18 +- Rebase from 1.99 to 2.00~beta2 * Wed Mar 07 2012 Peter Jones - 1.99-17 - Update for newer autotools and gcc 4.7.0 From c8ef0525f65001718a8569feeffa39fa76dd4744 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 14 Mar 2012 16:46:33 -0400 Subject: [PATCH 05/65] Update sources for 2.00~beta2 --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index fb51ba6..1146a89 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -27e360b951f006c464299d06bbd63442 grub-1.99.tar.xz +4509839183c4593ab49a2c6044c03f18 grub-2.00~beta2.tar.xz From 278726a3214b13e81e66fd5f671a05e26b7120b1 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 15 Mar 2012 10:31:05 -0400 Subject: [PATCH 06/65] Use --with-grubdir= on configure to make it behave like -17 did. --- grub2.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/grub2.spec b/grub2.spec index 80626d1..04fa80f 100644 --- a/grub2.spec +++ b/grub2.spec @@ -22,7 +22,7 @@ Name: grub2 Epoch: 1 Version: 1.99 -Release: 18%{?dist} +Release: 19%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -120,6 +120,7 @@ cd grub-efi-%{tarversion} -e 's/-fasynchronous-unwind-tables//g' )" \ TARGET_LDFLAGS=-static \ --with-platform=efi \ + --with-grubdir=grub2 \ --program-transform-name=s,grub,%{name}-efi, \ --disable-werror \ --sbindir=/sbin @@ -155,6 +156,7 @@ cd grub-%{tarversion} -e 's/-fasynchronous-unwind-tables//g' )" \ TARGET_LDFLAGS=-static \ --with-platform=%{platform} \ + --with-grubdir=grub2 \ --program-transform-name=s,grub,%{name}, \ --disable-werror \ --sbindir=/sbin @@ -381,6 +383,9 @@ fi %attr(0755,root,root)/%{_datarootdir}/grub/ %changelog +* Thu Mar 15 2012 Peter Jones - 1.99-19 +- Use --with-grubdir= on configure to make it behave like -17 did. + * Wed Mar 14 2012 Peter Jones - 1.99-18 - Rebase from 1.99 to 2.00~beta2 From 38f9656a4b7fefb3b1ee9d4db53b81936f1db12a Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 16 Mar 2012 21:16:35 -0400 Subject: [PATCH 07/65] Fix Source0 url --- grub2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub2.spec b/grub2.spec index 04fa80f..10aaa40 100644 --- a/grub2.spec +++ b/grub2.spec @@ -29,7 +29,7 @@ Group: System Environment/Base License: GPLv3+ URL: http://www.gnu.org/software/grub/ Obsoletes: grub < 1:0.98 -Source0: ftp://ftp.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz +Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz Source1: 90_persistent Source2: grub.default Source3: README.Fedora From f26a37c87154fdf9e27bb0c203f9cc28d6ba0bbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Tue, 27 Mar 2012 21:03:12 +0200 Subject: [PATCH 08/65] Use Fix-tests-of-zeroed-partition patch by Mark Hamzy --- grub-1.99-Fix-tests-of-zeroed-partition.patch | 25 +++++++++++++++++++ grub2.spec | 6 ++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 grub-1.99-Fix-tests-of-zeroed-partition.patch diff --git a/grub-1.99-Fix-tests-of-zeroed-partition.patch b/grub-1.99-Fix-tests-of-zeroed-partition.patch new file mode 100644 index 0000000..ad5a770 --- /dev/null +++ b/grub-1.99-Fix-tests-of-zeroed-partition.patch @@ -0,0 +1,25 @@ +From c8f67c2ee40815c075f1d6e5b3d6b504fbe204f5 Mon Sep 17 00:00:00 2001 +From: Fedora Ninjas +Date: Sun, 25 Mar 2012 09:22:34 -0500 +Subject: [PATCH] Fix tests of zeroed partition + +--- + util/grub-install.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/util/grub-install.in b/util/grub-install.in +index 9c1d133..e8638af 100644 +--- a/util/grub-install.in ++++ b/util/grub-install.in +@@ -750,7 +750,7 @@ elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ] + exit 1 + fi + +- if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" = ELF ] || [ $(cmp /dev/zero "${install_device}" &>/dev/null) ]; then ++ if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" != ELF ] && ( cmp -s -n $(blockdev --getsize64 ${install_device}) /dev/zero "${install_device}" &>/dev/null ); then + # Change boot device to the harddisk root + boot_device="$ofpath" + dd if="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" of="${install_device}" status=noxfer || { +-- +1.7.7.2 + diff --git a/grub2.spec b/grub2.spec index 10aaa40..b3666b5 100644 --- a/grub2.spec +++ b/grub2.spec @@ -22,7 +22,7 @@ Name: grub2 Epoch: 1 Version: 1.99 -Release: 19%{?dist} +Release: 19%{?dist}.1 Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -38,6 +38,7 @@ Patch1: grub-1.99-grub_test_assert_printf.patch Patch2: grub-1.99-just-say-linux.patch Patch3: grub2-handle-initramfs-on-xen.patch Patch9: grub-1.99-gcc-4.7.0.patch +Patch10: grub-1.99-Fix-tests-of-zeroed-partition.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -383,6 +384,9 @@ fi %attr(0755,root,root)/%{_datarootdir}/grub/ %changelog +* Sun Mar 25 2012 Dan Horák - 1.99-19.1 +- Use Fix-tests-of-zeroed-partition patch by Mark Hamzy + * Thu Mar 15 2012 Peter Jones - 1.99-19 - Use --with-grubdir= on configure to make it behave like -17 did. From 9caa44046710efca78531836a8cd308b89123170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Tue, 27 Mar 2012 22:34:56 +0200 Subject: [PATCH 09/65] Add support for serial terminal consoles on PPC by Mark Hamzy --- grub-1.99-Fix-tests-of-zeroed-partition.patch | 2 +- grub-1.99-ppc-terminfo.patch | 154 ++++++++++++++++++ grub2.spec | 6 +- 3 files changed, 160 insertions(+), 2 deletions(-) create mode 100644 grub-1.99-ppc-terminfo.patch diff --git a/grub-1.99-Fix-tests-of-zeroed-partition.patch b/grub-1.99-Fix-tests-of-zeroed-partition.patch index ad5a770..a57711c 100644 --- a/grub-1.99-Fix-tests-of-zeroed-partition.patch +++ b/grub-1.99-Fix-tests-of-zeroed-partition.patch @@ -1,5 +1,5 @@ From c8f67c2ee40815c075f1d6e5b3d6b504fbe204f5 Mon Sep 17 00:00:00 2001 -From: Fedora Ninjas +From: Mark Hamzy Date: Sun, 25 Mar 2012 09:22:34 -0500 Subject: [PATCH] Fix tests of zeroed partition diff --git a/grub-1.99-ppc-terminfo.patch b/grub-1.99-ppc-terminfo.patch new file mode 100644 index 0000000..2b8c380 --- /dev/null +++ b/grub-1.99-ppc-terminfo.patch @@ -0,0 +1,154 @@ +From ad101ca2bd8913b989cc759bf36632c94381fc4e Mon Sep 17 00:00:00 2001 +From: Mark Hamzy +Date: Thu, 1 Mar 2012 21:18:20 -0600 +Subject: [PATCH] Migrate PPC from Yaboot to Grub2 + +Add configuration support for serial terminal consoles. This will set the maximum screen size so that text is not overwritten. + +--- + Makefile.util.def | 7 +++ + util/grub.d/20_ppc_terminfo.in | 114 ++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 121 insertions(+), 0 deletions(-) + create mode 100644 util/grub.d/20_ppc_terminfo.in + +diff --git a/Makefile.util.def b/Makefile.util.def +index 058572f..1993f9b 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -360,6 +360,13 @@ script = { + }; + + script = { ++ name = '20_ppc_terminfo'; ++ common = util/grub.d/20_ppc_terminfo.in; ++ installdir = grubconf; ++ condition = COND_HOST_LINUX; ++}; ++ ++script = { + name = '30_os-prober'; + common = util/grub.d/30_os-prober.in; + installdir = grubconf; +diff --git a/util/grub.d/20_ppc_terminfo.in b/util/grub.d/20_ppc_terminfo.in +new file mode 100644 +index 0000000..545ad62 +--- /dev/null ++++ b/util/grub.d/20_ppc_terminfo.in +@@ -0,0 +1,114 @@ ++#! /bin/sh ++set -e ++ ++# grub-mkconfig helper script. ++# Copyright (C) 2006,2007,2008,2009,2010 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 ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++# ++# GRUB is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with GRUB. If not, see . ++ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++bindir=@bindir@ ++libdir=@libdir@ ++. ${libdir}/grub/grub-mkconfig_lib ++ ++export TEXTDOMAIN=@PACKAGE@ ++export TEXTDOMAINDIR=@localedir@ ++ ++X=80 ++Y=24 ++TERMINAL=ofconsole ++ ++argument () { ++ opt=$1 ++ shift ++ ++ if test $# -eq 0; then ++ echo "$0: option requires an argument -- '$opt'" 1>&2 ++ exit 1 ++ fi ++ echo $1 ++} ++ ++check_terminfo () { ++ ++ while test $# -gt 0 ++ do ++ option=$1 ++ shift ++ ++ case "$option" in ++ terminfo | TERMINFO) ++ ;; ++ ++ -g) ++ NEWXY=`argument $option "$@"` ++ NEWX=`echo $NEWXY | cut -d x -f 1` ++ NEWY=`echo $NEWXY | cut -d x -f 2` ++ ++ if [ ${NEWX} -ge 80 ] ; then ++ X=${NEWX} ++ else ++ echo "Warning: ${NEWX} is less than the minimum size of 80" ++ fi ++ ++ if [ ${NEWY} -ge 24 ] ; then ++ Y=${NEWY} ++ else ++ echo "Warning: ${NEWY} is less than the minimum size of 24" ++ fi ++ ++ shift ++ ;; ++ ++ *) ++# # accept console or ofconsole ++# if [ "$option" != "console" -a "$option" != "ofconsole" ] ; then ++# echo "Error: GRUB_TERMINFO unknown console: $option" ++# exit 1 ++# fi ++# # perfer console ++# TERMINAL=console ++ # accept ofconsole ++ if [ "$option" != "ofconsole" ] ; then ++ echo "Error: GRUB_TERMINFO unknown console: $option" ++ exit 1 ++ fi ++ # perfer console ++ TERMINAL=ofconsole ++ ;; ++ esac ++ ++ done ++ ++} ++ ++if ! uname -m | grep -q ppc ; then ++ exit 0 ++fi ++ ++if [ "x${GRUB_TERMINFO}" != "x" ] ; then ++ F1=`echo ${GRUB_TERMINFO} | cut -d " " -f 1` ++ ++ if [ "${F1}" != "terminfo" ] ; then ++ echo "Error: GRUB_TERMINFO is set to \"${GRUB_TERMINFO}\" The first word should be terminfo." ++ exit 1 ++ fi ++ ++ check_terminfo ${GRUB_TERMINFO} ++fi ++ ++cat << EOF ++ terminfo -g ${X}x${Y} ${TERMINAL} ++EOF +-- +1.7.7.6 + diff --git a/grub2.spec b/grub2.spec index b3666b5..ce9b48f 100644 --- a/grub2.spec +++ b/grub2.spec @@ -22,7 +22,7 @@ Name: grub2 Epoch: 1 Version: 1.99 -Release: 19%{?dist}.1 +Release: 19%{?dist}.2 Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -39,6 +39,7 @@ Patch2: grub-1.99-just-say-linux.patch Patch3: grub2-handle-initramfs-on-xen.patch Patch9: grub-1.99-gcc-4.7.0.patch Patch10: grub-1.99-Fix-tests-of-zeroed-partition.patch +Patch11: grub-1.99-ppc-terminfo.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -384,6 +385,9 @@ fi %attr(0755,root,root)/%{_datarootdir}/grub/ %changelog +* Tue Mar 27 2012 Dan Horák - 1.99-19.2 +- Add support for serial terminal consoles on PPC by Mark Hamzy + * Sun Mar 25 2012 Dan Horák - 1.99-19.1 - Use Fix-tests-of-zeroed-partition patch by Mark Hamzy From eec0f81571adc0a5732dbb4fcc12a9476b6ce0e0 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 27 Mar 2012 17:09:13 -0400 Subject: [PATCH 10/65] I'm told the exclude arch change to ppc from ppc64 was wrong. --- grub2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub2.spec b/grub2.spec index ce9b48f..660973d 100644 --- a/grub2.spec +++ b/grub2.spec @@ -61,7 +61,7 @@ Requires(post): dracut # TODO: ppc # ExclusiveArch: %{ix86} x86_64 %{sparc} -ExcludeArch: s390 s390x ppc +ExcludeArch: s390 s390x ppc64 %description The GRand Unified Bootloader (GRUB) is a highly configurable and customizable From 58d787eb63fed69188623ce0e2cf58e4850aa262 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 14 Mar 2012 16:33:25 -0400 Subject: [PATCH 11/65] Rebase from 1.99 to 2.00~beta2 --- grub-1.99-fix_grub-probe_call.patch | 16 - grub-1.99-grub_test_assert_printf.patch | 16 +- grub-1.99-handle-newer-autotools.patch | 501 --------------- grub-1.99-prep_install_v2.patch | 575 ------------------ grub2-1.99-handle-more-dmraid.patch | 285 --------- ...erial.mod-test-from-00_header-748964.patch | 29 - grub2-gfxpayload-efi.patch | 63 -- grub2.spec | 95 ++- 8 files changed, 55 insertions(+), 1525 deletions(-) delete mode 100644 grub-1.99-fix_grub-probe_call.patch delete mode 100644 grub-1.99-handle-newer-autotools.patch delete mode 100644 grub-1.99-prep_install_v2.patch delete mode 100644 grub2-1.99-handle-more-dmraid.patch delete mode 100644 grub2-1.99-remove-serial.mod-test-from-00_header-748964.patch delete mode 100644 grub2-gfxpayload-efi.patch diff --git a/grub-1.99-fix_grub-probe_call.patch b/grub-1.99-fix_grub-probe_call.patch deleted file mode 100644 index 0adf117..0000000 --- a/grub-1.99-fix_grub-probe_call.patch +++ /dev/null @@ -1,16 +0,0 @@ -From: Adam Williamson -Subject: call ${grub_probe} instead of grub-probe in OSXUUID line of 30_os-prober.in -Date: 2011-12-08 17:55:47 +0000 - -=== modified file 'util/grub.d/30_os-prober.in' ---- a/util/grub.d/30_os-prober.in 2011-12-08 09:39:52.311466000 -0800 -+++ b/util/grub.d/30_os-prober.in 2011-12-08 09:41:22.984908889 -0800 -@@ -168,7 +168,7 @@ - done - ;; - macosx) -- OSXUUID="`grub-probe --target=fs_uuid --device ${DEVICE} 2> /dev/null`" -+ OSXUUID="`${grub_probe} --target=fs_uuid --device ${DEVICE} 2> /dev/null`" - osx_entry xnu_kernel 32 - osx_entry xnu_kernel64 64 - ;; diff --git a/grub-1.99-grub_test_assert_printf.patch b/grub-1.99-grub_test_assert_printf.patch index 55f514f..f6fa68d 100644 --- a/grub-1.99-grub_test_assert_printf.patch +++ b/grub-1.99-grub_test_assert_printf.patch @@ -141,27 +141,27 @@ index 06d78b7..8453d5b 100644 { grub_test_t test; diff --git a/include/grub/test.h b/include/grub/test.h -index 336d3b6..77a7598 100644 +index 5d1ba75..d876f57 100644 --- a/include/grub/test.h +++ b/include/grub/test.h -@@ -53,10 +53,14 @@ void grub_test_nonzero (int cond, const char *file, +@@ -54,10 +54,14 @@ void grub_test_nonzero (int cond, const char *file, __attribute__ ((format (printf, 5, 6))); /* Macro to fill in location details and an optional error message. */ +void grub_test_assert_helper (int cond, const char *file, -+ const char *func, grub_uint32_t line, -+ const char *condstr, const char *fmt, ...) ++ const char *func, grub_uint32_t line, ++ const char *condstr, const char *fmt, ...) + __attribute__ ((format (printf, 6, 7))); + #define grub_test_assert(cond, ...) \ - grub_test_nonzero(cond, GRUB_FILE, __FUNCTION__, __LINE__, \ - ## __VA_ARGS__, \ - "assert failed: %s", #cond) -+ grub_test_assert_helper(cond, GRUB_FILE, __FUNCTION__, __LINE__, \ -+ #cond, ## __VA_ARGS__); ++ grub_test_assert_helper(cond, GRUB_FILE, __FUNCTION__, __LINE__, \ ++ #cond, ## __VA_ARGS__); - /* Macro to define a unit test. */ - #define GRUB_UNIT_TEST(name, funp) \ + void grub_unit_test_init (void); + void grub_unit_test_fini (void); -- 1.7.3.1 diff --git a/grub-1.99-handle-newer-autotools.patch b/grub-1.99-handle-newer-autotools.patch deleted file mode 100644 index f96ea39..0000000 --- a/grub-1.99-handle-newer-autotools.patch +++ /dev/null @@ -1,501 +0,0 @@ -From: Vladimir Serbinenko -Subject: Handle newer autotools. Add some missing quotes while on it. -Date: 2012-01-24 12:17:36 +0000 - -* Makefile.am (pkglib_DATA): Remove update-grub_lib. -(pkglib_DATA): Move grub-mkconfig_lib from here ... -(pkgdata_DATA): ... here. -* Makefile.util.def (update-grub_lib): Removed. -* conf/Makefile.common (pkglib_DATA): Removed. -(pkglib_SCRIPTS): Likewise. -(pkgdata_DATA): New variable. -* tests/util/grub-shell-tester.in: Replace pkglib with pkgdata where -needed. -Add missing quotes. -Remove unused variable while on it. -* tests/util/grub-shell.in: Likewise. -* util/grub-install.in: Likewise. -* util/grub-mkconfig.in: Likewise. -* util/grub-mknetdir.in: Likewise. -* util/grub-mkrescue.in: Likewise. -* util/grub-mkstandalone.in: Likewise. -* util/grub.d/00_header.in: Likewise. -* util/grub.d/10_hurd.in: Likewise. -* util/grub.d/10_illumos.in: Likewise. -* util/grub.d/10_kfreebsd.in: Likewise. -* util/grub.d/10_linux.in: Likewise. -* util/grub.d/10_netbsd.in: Likewise. -* util/grub.d/10_windows.in: Likewise. -* util/grub.d/20_linux_xen.in: Likewise. -* util/grub.d/30_os-prober.in: Likewise. -* util/update-grub_lib.in: Removed. ---- - Makefile.am | 3 +-- - Makefile.util.def | 6 ------ - conf/Makefile.common | 3 +-- - tests/util/grub-shell-tester.in | 23 +++++++++++------------ - tests/util/grub-shell.in | 23 +++++++++++------------ - util/grub-install.in | 2 ++ - util/grub-mkconfig.in | 27 ++++++++++++++------------- - util/grub-mknetdir.in | 29 ++++++++++++++--------------- - util/grub-mkrescue.in | 9 +++++---- - util/grub.d/00_header.in | 9 +++++---- - util/grub.d/10_linux.in | 10 +++++----- - util/grub.d/20_linux_xen.in | 12 ++++++------ - util/grub.d/30_os-prober.in | 9 +++++---- - util/update-grub_lib.in | 23 ----------------------- - 14 files changed, 80 insertions(+), 108 deletions(-) - delete mode 100644 util/update-grub_lib.in - -diff --git a/Makefile.am b/Makefile.am -index 9301c91..fd3848d 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -101,8 +101,7 @@ CLEANFILES += widthspec.h - # Install config.h into platformdir - platform_HEADERS = config.h - --pkglib_DATA += grub-mkconfig_lib --pkglib_DATA += update-grub_lib -+pkgdata_DATA += grub-mkconfig_lib - - - if COND_i386_coreboot -diff --git a/Makefile.util.def b/Makefile.util.def -index 058572f..6451999 100644 ---- a/Makefile.util.def -+++ b/Makefile.util.def -@@ -435,12 +435,6 @@ script = { - }; - - script = { -- name = update-grub_lib; -- common = util/update-grub_lib.in; -- installdir = noinst; --}; -- --script = { - name = grub-kbdcomp; - common = util/grub-kbdcomp.in; - }; -diff --git a/conf/Makefile.common b/conf/Makefile.common -index 5aa13cd..2040a2e 100644 ---- a/conf/Makefile.common -+++ b/conf/Makefile.common -@@ -137,7 +137,7 @@ KERNEL_HEADER_FILES = - - man_MANS = - noinst_DATA = --pkglib_DATA = -+pkgdata_DATA = - bin_SCRIPTS = - sbin_SCRIPTS = - bin_PROGRAMS = -@@ -147,7 +147,6 @@ check_SCRIPTS = - grubconf_DATA = - check_PROGRAMS = - noinst_SCRIPTS = --pkglib_SCRIPTS = - noinst_PROGRAMS = - grubconf_SCRIPTS = - noinst_LIBRARIES = -diff --git a/tests/util/grub-shell-tester.in b/tests/util/grub-shell-tester.in -index 02e49d3..eaaab41 100644 ---- a/tests/util/grub-shell-tester.in -+++ b/tests/util/grub-shell-tester.in -@@ -19,18 +19,17 @@ - # Initialize some variables. - transform="@program_transform_name@" - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --bindir=@bindir@ --libdir=@libdir@ --builddir=@builddir@ -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+datarootdir="@datarootdir@" -+builddir="@builddir@" - PACKAGE_NAME=@PACKAGE_NAME@ - PACKAGE_TARNAME=@PACKAGE_TARNAME@ - PACKAGE_VERSION=@PACKAGE_VERSION@ - target_cpu=@target_cpu@ - - # Force build directory components --PATH=${builddir}:$PATH -+PATH="${builddir}:$PATH" - export PATH - - # Usage: usage -@@ -85,23 +84,23 @@ done - if [ "x${source}" = x ] ; then - tmpfile=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 - while read REPLY; do -- echo $REPLY >> ${tmpfile} -+ echo $REPLY >> "${tmpfile}" - done -- source=${tmpfile} -+ source="${tmpfile}" - fi - - outfile1=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 --@builddir@/grub-shell --qemu-opts="${qemuopts}" --modules=${modules} ${source} >${outfile1} -+"@builddir@/grub-shell" --qemu-opts="${qemuopts}" --modules=${modules} ${source} >"${outfile1}" - - outfile2=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 --bash ${source} >${outfile2} -+bash "${source}" >"${outfile2}" - --if ! diff -q ${outfile1} ${outfile2} >/dev/null -+if ! diff -q "${outfile1}" "${outfile2}" >/dev/null - then - echo "${source}: GRUB and BASH outputs did not match (see diff -u ${outfile1} ${outfile2})" - status=1 - else -- rm -f ${outfile1} ${outfile2} -+ rm -f "${outfile1}" "${outfile2}" - fi - - exit $status -diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in -index 0213376..461befb 100644 ---- a/tests/util/grub-shell.in -+++ b/tests/util/grub-shell.in -@@ -19,11 +19,10 @@ - # Initialize some variables. - transform="@program_transform_name@" - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --bindir=@bindir@ --libdir=@libdir@ --builddir=@builddir@ -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+datarootdir="@datarootdir@" -+builddir="@builddir@" - PACKAGE_NAME=@PACKAGE_NAME@ - PACKAGE_TARNAME=@PACKAGE_TARNAME@ - PACKAGE_VERSION=@PACKAGE_VERSION@ -@@ -140,9 +139,9 @@ EOF - - isofile=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 - if [ x$boot != xnet ]; then -- sh @builddir@/grub-mkrescue --grub-mkimage=${builddir}/grub-mkimage --output=${isofile} --override-directory=${builddir}/grub-core \ -+ sh "@builddir@/grub-mkrescue" "--grub-mkimage=${builddir}/grub-mkimage" "--output=${isofile}" "--override-directory=${builddir}/grub-core" \ - --rom-directory="${rom_directory}" \ -- /boot/grub/grub.cfg=${cfgfile} /boot/grub/testcase.cfg=${source} \ -+ "/boot/grub/grub.cfg=${cfgfile}" "/boot/grub/testcase.cfg=${source}" \ - ${files} >/dev/null 2>&1 - fi - if [ x$boot = xhd ]; then -@@ -173,12 +172,12 @@ fi - - if [ x$boot = xnet ]; then - netdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 -- sh @builddir@/grub-mknetdir --grub-mkimage=${builddir}/grub-mkimage --override-directory=${builddir}/grub-core --net-directory=$netdir -- cp ${cfgfile} $netdir/boot/grub/grub.cfg -- cp ${source} $netdir/boot/grub/testcase.cfg -- ${qemu} ${qemuopts} -nographic -serial file:/dev/stdout -monitor file:/dev/null -boot n -net user,tftp=$netdir,bootfile=/boot/grub/$target_cpu-$platform/core.0 -net nic | cat | tr -d "\r" -+ sh "@builddir@/grub-mknetdir" "--grub-mkimage=${builddir}/grub-mkimage" "--override-directory=${builddir}/grub-core" "--net-directory=$netdir" -+ cp "${cfgfile}" "$netdir/boot/grub/grub.cfg" -+ cp "${source}" "$netdir/boot/grub/testcase.cfg" -+ "${qemu}" ${qemuopts} -nographic -serial file:/dev/stdout -monitor file:/dev/null -boot n -net "user,tftp=$netdir,bootfile=/boot/grub/$target_cpu-$platform/core.0" -net nic | cat | tr -d "\r" - else -- ${qemu} ${qemuopts} -nographic -serial file:/dev/stdout -monitor file:/dev/null -${device} ${isofile} ${bootdev} | cat | tr -d "\r" -+ "${qemu}" ${qemuopts} -nographic -serial file:/dev/stdout -monitor file:/dev/null -${device} ${isofile} ${bootdev} | cat | tr -d "\r" - fi - rm -f "${isofile}" "${imgfile}" - rm -rf "${rom_directory}" -diff --git a/util/grub-install.in b/util/grub-install.in -index ff8bea8..b18d5cc 100644 ---- a/util/grub-install.in -+++ b/util/grub-install.in -@@ -21,6 +21,7 @@ transform="@program_transform_name@" - - prefix="@prefix@" - exec_prefix="@exec_prefix@" -+datarootdir="@datarootdir@" - sbindir="@sbindir@" - bindir="@bindir@" - libdir="@libdir@" -@@ -32,6 +33,7 @@ target_cpu=@target_cpu@ - platform=@platform@ - host_os=@host_os@ - pkglibdir="${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`" -+datadir="@datadir@" - localedir="@datadir@/locale" - - self="`basename $0`" -diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index afc66f8..45cc400 100644 ---- a/util/grub-mkconfig.in -+++ b/util/grub-mkconfig.in -@@ -18,26 +18,27 @@ set -e - # along with GRUB. If not, see . - - transform="@program_transform_name@" -- --prefix=@prefix@ --exec_prefix=@exec_prefix@ --sbindir=@sbindir@ --bindir=@bindir@ --libdir=@libdir@ --sysconfdir=@sysconfdir@ -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+datarootdir="@datarootdir@" -+ -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+sbindir="@sbindir@" -+bindir="@bindir@" -+sysconfdir="@sysconfdir@" - PACKAGE_NAME=@PACKAGE_NAME@ - PACKAGE_VERSION=@PACKAGE_VERSION@ - host_os=@host_os@ --datarootdir=@datarootdir@ --datadir=@datadir@ --pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"` -+datadir="@datadir@" -+pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`" - grub_cfg="" --grub_mkconfig_dir=${sysconfdir}/grub.d -+grub_mkconfig_dir="${sysconfdir}"/grub.d - - self=`basename $0` - --grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed "${transform}"` --grub_probe=${sbindir}/`echo grub-probe | sed "${transform}"` -+grub_mkdevicemap="${sbindir}/`echo grub-mkdevicemap | sed "${transform}"`" -+grub_probe="${sbindir}/`echo grub-probe | sed "${transform}"`" - grub_script_check="${bindir}/`echo grub-script-check | sed "${transform}"`" - - GRUB_PREFIX=`echo '/@bootdirname@/@grubdirname@' | sed "s,//*,/,g"` -diff --git a/util/grub-mknetdir.in b/util/grub-mknetdir.in -index b353e98..860fb6f 100644 ---- a/util/grub-mknetdir.in -+++ b/util/grub-mknetdir.in -@@ -19,25 +19,24 @@ - # Initialize some variables. - transform="@program_transform_name@" - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --sbindir=@sbindir@ --bindir=@bindir@ --libdir=@libdir@ -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+datarootdir="@datarootdir@" -+bindir="@bindir@" -+libdir="@libdir@" - PACKAGE_NAME=@PACKAGE_NAME@ - PACKAGE_TARNAME=@PACKAGE_TARNAME@ - PACKAGE_VERSION=@PACKAGE_VERSION@ - target_cpu=@target_cpu@ - platform=@platform@ - host_os=@host_os@ --pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}` --localedir=@datadir@/locale -+pkglibdir="${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`" - native_platform=@platform@ - pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst" - - self=`basename $0` - --grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` -+grub_mkimage="${bindir}/`echo grub-mkimage | sed ${transform}`" - rootdir=/srv/tftp - grub_prefix=`echo /boot/grub | sed ${transform}` - modules= -@@ -48,7 +47,7 @@ recheck=no - debug=no - debug_image= - subdir=`echo /boot/grub | sed ${transform}` --pc_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-pc -+pc_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-pc" - - # Usage: usage - # Print the usage. -@@ -170,12 +169,12 @@ process_input_dir () - config_opt= - mkdir -p "$grubdir" || exit 1 - -- for file in ${grubdir}/*.mod ${grubdir}/*.lst ${grubdir}/*.img ${grubdir}/efiemu??.o; do -- if test -f $file && [ "`basename $file`" != menu.lst ]; then -- rm -f $file || exit 1 -+ for file in "${grubdir}"/*.mod "${grubdir}"/*.lst "${grubdir}"/*.img "${grubdir}"/efiemu??.o; do -+ if test -f "$file" && [ "`basename $file`" != menu.lst ]; then -+ rm -f "$file" || exit 1 - fi - done -- for file in ${input_dir}/*.mod; do -+ for file in "${input_dir}"/*.mod; do - if test -f "$file"; then - cp -f "$file" "$grubdir/" - fi -@@ -187,7 +186,7 @@ process_input_dir () - done - - mkdir -p "$grubdir/locale" -- for file in ${input_dir}/po/*.mo; do -+ for file in "${input_dir}"/po/*.mo; do - if test -f "$file"; then - cp -f "$file" "$grubdir/locale/" - fi -@@ -213,7 +212,7 @@ process_input_dir () - source ${subdir}/grub.cfg - EOF - -- $grub_mkimage ${config_opt} -d "${input_dir}" -O ${mkimage_target} --output=${grubdir}/core.$ext --prefix=$prefix $modules $netmodules || exit 1 -+ "$grub_mkimage" ${config_opt} -d "${input_dir}" -O ${mkimage_target} "--output=${grubdir}/core.$ext" "--prefix=$prefix" $modules $netmodules || exit 1 - echo "Netboot directory for ${platform} created. Configure your DHCP server to point to ${subdir}/${platform}/core.$ext" - } - -diff --git a/util/grub-mkrescue.in b/util/grub-mkrescue.in -index f7f7517..383ee7a 100644 ---- a/util/grub-mkrescue.in -+++ b/util/grub-mkrescue.in -@@ -20,10 +20,11 @@ set -e - # Initialize some variables. - transform="@program_transform_name@" - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --bindir=@bindir@ --libdir=@libdir@ -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+datarootdir="@datarootdir@" -+bindir="@bindir@" -+libdir="@libdir@" - PACKAGE_NAME=@PACKAGE_NAME@ - PACKAGE_TARNAME=@PACKAGE_TARNAME@ - PACKAGE_VERSION=@PACKAGE_VERSION@ -diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in -index 9da1511..5c4d9db 100644 ---- a/util/grub.d/00_header.in -+++ b/util/grub.d/00_header.in -@@ -19,9 +19,10 @@ set -e - - transform="@program_transform_name@" - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --libdir=@libdir@ -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+libdir="@libdir@" -+datarootdir="@datarootdir@" - locale_dir=`echo ${GRUB_PREFIX}/locale | sed ${transform}` - grub_lang=`echo $LANG | cut -d . -f 1` - -@@ -112,7 +113,7 @@ for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do - done - - if [ "x$serial" = x1 ]; then -- if ! test -e ${GRUB_PREFIX}/serial.mod ; then -+ if ! test -e "${GRUB_PREFIX}/serial.mod" ; then - echo "Serial terminal not available on this platform." >&2 ; exit 1 - fi - -diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index edb1eda..8bc1180 100644 ---- a/util/grub.d/10_linux.in -+++ b/util/grub.d/10_linux.in -@@ -17,11 +17,11 @@ set -e - # You should have received a copy of the GNU General Public License - # along with GRUB. If not, see . - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --bindir=@bindir@ --libdir=@libdir@ --. ${libdir}/grub/grub-mkconfig_lib -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+libdir="@libdir@" -+datarootdir="@datarootdir@" -+. "${datarootdir}/grub/grub-mkconfig_lib" - - export TEXTDOMAIN=@PACKAGE@ - export TEXTDOMAINDIR=@localedir@ -diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index f37e365..9104667 100644 ---- a/util/grub.d/20_linux_xen.in -+++ b/util/grub.d/20_linux_xen.in -@@ -17,14 +17,14 @@ set -e - # You should have received a copy of the GNU General Public License - # along with GRUB. If not, see . - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --bindir=@bindir@ --libdir=@libdir@ --. ${libdir}/grub/grub-mkconfig_lib -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+libdir="@libdir@" -+datarootdir="@datarootdir@" -+. "${datarootdir}/grub/grub-mkconfig_lib" - - export TEXTDOMAIN=@PACKAGE@ --export TEXTDOMAINDIR=@localedir@ -+export TEXTDOMAINDIR="@localedir@" - - CLASS="--class gnu-linux --class gnu --class os --class xen" - -diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in -index 9eb7b3e..7336000 100644 ---- a/util/grub.d/30_os-prober.in -+++ b/util/grub.d/30_os-prober.in -@@ -17,11 +17,12 @@ set -e - # You should have received a copy of the GNU General Public License - # along with GRUB. If not, see . - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --libdir=@libdir@ -+prefix="@prefix@" -+exec_prefix="@exec_prefix@" -+datarootdir="@datarootdir@" -+libdir="@libdir@" - --. ${libdir}/grub/grub-mkconfig_lib -+. "${datarootdir}/grub/grub-mkconfig_lib" - - if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then - exit 0 -diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in -deleted file mode 100644 -index 998452e..0000000 ---- a/util/update-grub_lib.in -+++ /dev/null -@@ -1,23 +0,0 @@ --# stub for new grub-mkconfig_lib --# Copyright (C) 2007,2008 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 --# the Free Software Foundation, either version 3 of the License, or --# (at your option) any later version. --# --# GRUB is distributed in the hope that it will be useful, --# but WITHOUT ANY WARRANTY; without even the implied warranty of --# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --# GNU General Public License for more details. --# --# You should have received a copy of the GNU General Public License --# along with GRUB. If not, see . -- --prefix=@prefix@ --exec_prefix=@exec_prefix@ --libdir=@libdir@ -- --. ${libdir}/grub/grub-mkconfig_lib -- --grub_warn "update-grub_lib is deprecated, use grub-mkconfig_lib instead" --- -1.7.7.6 - diff --git a/grub-1.99-prep_install_v2.patch b/grub-1.99-prep_install_v2.patch deleted file mode 100644 index 4ca57cb..0000000 --- a/grub-1.99-prep_install_v2.patch +++ /dev/null @@ -1,575 +0,0 @@ -From: Paulo Flabiano Smorigo -Date: Fri, 24 Feb 2012 17:26:02 -0400 -Subject: [PATCH] Pull in required v2 changes for PPC ---- - -diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c -index 2fbe809..9e80757 100644 ---- a/grub-core/kern/ieee1275/cmain.c -+++ b/grub-core/kern/ieee1275/cmain.c -@@ -60,6 +60,10 @@ grub_ieee1275_find_options (void) - int is_olpc = 0; - int is_qemu = 0; - -+#ifdef __sparc__ -+ grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_PARTITION_0); -+#endif -+ - grub_ieee1275_finddevice ("/", &root); - grub_ieee1275_finddevice ("/options", &options); - grub_ieee1275_finddevice ("/openprom", &openprom); -diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index 682a8b5..13a160f 100644 ---- a/grub-core/kern/ieee1275/init.c -+++ b/grub-core/kern/ieee1275/init.c -@@ -69,36 +69,45 @@ grub_translate_ieee1275_path (char *filepath) - } - - void --grub_machine_set_prefix (void) -+grub_machine_get_bootlocation (char **device, char **path) - { - char bootpath[64]; /* XXX check length */ - char *filename; -- char *prefix; -- -- if (grub_prefix[0]) -- { -- grub_env_set ("prefix", grub_prefix); -- /* Prefix is hardcoded in the core image. */ -- return; -- } -- -+ char *type; -+ - if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", &bootpath, - sizeof (bootpath), 0)) - { - /* Should never happen. */ - grub_printf ("/chosen/bootpath property missing!\n"); -- grub_env_set ("prefix", ""); - return; - } - - /* Transform an OF device path to a GRUB path. */ - -- prefix = grub_ieee1275_encode_devname (bootpath); -+ type = grub_ieee1275_get_device_type (bootpath); -+ if (type && grub_strcmp (type, "network") == 0) -+ { -+ char *dev, *canon; -+ char *ptr; -+ dev = grub_ieee1275_get_aliasdevname (bootpath); -+ canon = grub_ieee1275_canonicalise_devname (dev); -+ ptr = canon + grub_strlen (canon) - 1; -+ while (ptr > canon && (*ptr == ',' || *ptr == ':')) -+ ptr--; -+ ptr++; -+ *ptr = 0; -+ -+ grub_free (dev); -+ grub_free (canon); -+ } -+ else -+ *device = grub_ieee1275_encode_devname (bootpath); -+ grub_free (type); - - filename = grub_ieee1275_get_filename (bootpath); - if (filename) - { -- char *newprefix; - char *lastslash = grub_strrchr (filename, '\\'); - - /* Truncate at last directory. */ -@@ -107,19 +116,9 @@ grub_machine_set_prefix (void) - *lastslash = '\0'; - grub_translate_ieee1275_path (filename); - -- newprefix = grub_xasprintf ("%s%s", prefix, filename); -- if (newprefix) -- { -- grub_free (prefix); -- prefix = newprefix; -- } -+ *path = filename; - } - } -- -- grub_env_set ("prefix", prefix); -- -- grub_free (filename); -- grub_free (prefix); - } - - /* Claim some available memory in the first /memory node. */ -@@ -192,22 +191,12 @@ static void grub_claim_heap (void) - grub_machine_mmap_iterate (heap_init); - } - --static grub_uint64_t ieee1275_get_time_ms (void); -- --void --grub_machine_init (void) -+static void -+grub_parse_cmdline (void) - { -- char args[256]; - grub_ssize_t actual; -+ char args[256]; - -- grub_ieee1275_init (); -- -- grub_console_init_early (); -- grub_claim_heap (); -- grub_console_init_lately (); -- grub_ofdisk_init (); -- -- /* Process commandline. */ - if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootargs", &args, - sizeof args, &actual) == 0 - && actual > 1) -@@ -240,6 +229,21 @@ grub_machine_init (void) - } - } - } -+} -+ -+static grub_uint64_t ieee1275_get_time_ms (void); -+ -+void -+grub_machine_init (void) -+{ -+ grub_ieee1275_init (); -+ -+ grub_console_init_early (); -+ grub_claim_heap (); -+ grub_console_init_lately (); -+ grub_ofdisk_init (); -+ -+ grub_parse_cmdline (); - - grub_install_get_time_ms (ieee1275_get_time_ms); - } -diff --git a/grub-core/kern/ieee1275/openfw.c b/grub-core/kern/ieee1275/openfw.c -index f5dc8ef..6aa57ea 100644 ---- a/grub-core/kern/ieee1275/openfw.c -+++ b/grub-core/kern/ieee1275/openfw.c -@@ -27,6 +27,8 @@ enum grub_ieee1275_parse_type - { - GRUB_PARSE_FILENAME, - GRUB_PARSE_PARTITION, -+ GRUB_PARSE_DEVICE, -+ GRUB_PARSE_DEVICE_TYPE - }; - - /* Walk children of 'devpath', calling hook for each. */ -@@ -317,14 +319,9 @@ grub_ieee1275_parse_args (const char *path, enum grub_ieee1275_parse_type ptype) - { - char type[64]; /* XXX check size. */ - char *device = grub_ieee1275_get_devname (path); -- char *args = grub_ieee1275_get_devargs (path); - char *ret = 0; - grub_ieee1275_phandle_t dev; - -- if (!args) -- /* Shouldn't happen. */ -- return 0; -- - /* We need to know what type of device it is in order to parse the full - file path properly. */ - if (grub_ieee1275_finddevice (device, &dev)) -@@ -339,49 +336,93 @@ grub_ieee1275_parse_args (const char *path, enum grub_ieee1275_parse_type ptype) - goto fail; - } - -- if (!grub_strcmp ("block", type)) -+ switch (ptype) - { -- /* The syntax of the device arguments is defined in the CHRP and PReP -- IEEE1275 bindings: "[partition][,[filename]]". */ -- char *comma = grub_strchr (args, ','); -+ case GRUB_PARSE_DEVICE: -+ ret = grub_strdup (device); -+ break; -+ case GRUB_PARSE_DEVICE_TYPE: -+ ret = grub_strdup (type); -+ break; -+ case GRUB_PARSE_FILENAME: -+ { -+ char *comma; -+ char *args; -+ -+ if (grub_strcmp ("block", type) != 0) -+ goto unknown; -+ -+ args = grub_ieee1275_get_devargs (path); -+ if (!args) -+ /* Shouldn't happen. */ -+ return 0; - -- if (ptype == GRUB_PARSE_FILENAME) -- { -- if (comma) -- { -- char *filepath = comma + 1; -- -- /* Make sure filepath has leading backslash. */ -- if (filepath[0] != '\\') -- ret = grub_xasprintf ("\\%s", filepath); -- else -- ret = grub_strdup (filepath); -+ /* The syntax of the device arguments is defined in the CHRP and PReP -+ IEEE1275 bindings: "[partition][,[filename]]". */ -+ comma = grub_strchr (args, ','); -+ -+ if (comma) -+ { -+ char *filepath = comma + 1; -+ -+ /* Make sure filepath has leading backslash. */ -+ if (filepath[0] != '\\') -+ ret = grub_xasprintf ("\\%s", filepath); -+ else -+ ret = grub_strdup (filepath); - } -+ grub_free (args); - } -- else if (ptype == GRUB_PARSE_PARTITION) -- { -- if (!comma) -- ret = grub_strdup (args); -- else -- ret = grub_strndup (args, (grub_size_t)(comma - args)); -- } -- } -- else -- { -- /* XXX Handle net devices by configuring & registering a grub_net_dev -- here, then return its name? -- Example path: "net:,,,,,". */ -+ break; -+ case GRUB_PARSE_PARTITION: -+ { -+ char *comma; -+ char *args; -+ -+ if (grub_strcmp ("block", type) != 0) -+ goto unknown; -+ -+ args = grub_ieee1275_get_devargs (path); -+ if (!args) -+ /* Shouldn't happen. */ -+ return 0; -+ -+ comma = grub_strchr (args, ','); -+ if (!comma) -+ ret = grub_strdup (args); -+ else -+ ret = grub_strndup (args, (grub_size_t)(comma - args)); -+ /* Consistently provide numbered partitions to GRUB. -+ OpenBOOT traditionally uses alphabetical partition -+ specifiers. */ -+ if (ret[0] >= 'a' && ret[0] <= 'z') -+ ret[0] = '1' + (ret[0] - 'a'); -+ grub_free (args); -+ } -+ break; -+ default: -+ unknown: - grub_printf ("Unsupported type %s for device %s\n", type, device); - } - - fail: - grub_free (device); -- grub_free (args); - return ret; - } - - char * -+grub_ieee1275_get_device_type (const char *path) -+{ -+ return grub_ieee1275_parse_args (path, GRUB_PARSE_DEVICE_TYPE); -+} -+ -+char * -+grub_ieee1275_get_aliasdevname (const char *path) -+{ -+ return grub_ieee1275_parse_args (path, GRUB_PARSE_DEVICE); -+} -+ -+char * - grub_ieee1275_get_filename (const char *path) - { - return grub_ieee1275_parse_args (path, GRUB_PARSE_FILENAME); -@@ -403,10 +444,10 @@ grub_ieee1275_encode_devname (const char *path) - /* GRUB partition 1 is OF partition 0. */ - partno++; - -- encoding = grub_xasprintf ("(%s,%d)", device, partno); -+ encoding = grub_xasprintf ("%s,%d", device, partno); - } - else -- encoding = grub_xasprintf ("(%s)", device); -+ encoding = grub_xasprintf ("%s", device); - - grub_free (partition); - grub_free (device); -diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c -index da71232..6820f4c 100644 ---- a/grub-core/kern/main.c -+++ b/grub-core/kern/main.c -@@ -129,27 +129,74 @@ grub_env_write_root (struct grub_env_var *var __attribute__ ((unused)), - return grub_strdup (val); - } - --/* Set the root device according to the dl prefix. */ - static void --grub_set_root_dev (void) -+grub_set_prefix_and_root (void) - { -- const char *prefix; -+ char *device = NULL; -+ char *path = NULL; -+ char *fwdevice = NULL; -+ char *fwpath = NULL; - - grub_register_variable_hook ("root", 0, grub_env_write_root); - -- prefix = grub_env_get ("prefix"); -- -- if (prefix) -+ { -+ char *pptr = NULL; -+ if (grub_prefix[0] == '(') -+ { -+ pptr = grub_strrchr (grub_prefix, ')'); -+ if (pptr) -+ { -+ device = grub_strndup (grub_prefix + 1, pptr - grub_prefix - 1); -+ pptr++; -+ } -+ } -+ if (!pptr) -+ pptr = grub_prefix; -+ if (pptr[0]) -+ path = grub_strdup (pptr); -+ } -+ if ((!device || device[0] == ',' || !device[0]) || !path) -+ grub_machine_get_bootlocation (&fwdevice, &fwpath); -+ -+ if (!device && fwdevice) -+ device = fwdevice; -+ else if (fwdevice && (device[0] == ',' || !device[0])) - { -- char *dev; -+ /* We have a partition, but still need to fill in the drive. */ -+ char *comma, *new_device; -+ -+ comma = grub_strchr (fwdevice, ','); -+ if (comma) -+ { -+ char *drive = grub_strndup (fwdevice, comma - fwdevice); -+ new_device = grub_xasprintf ("%s%s", drive, device); -+ grub_free (drive); -+ } -+ else -+ new_device = grub_xasprintf ("%s%s", fwdevice, device); - -- dev = grub_file_get_device_name (prefix); -- if (dev) -+ grub_free (fwdevice); -+ grub_free (device); -+ device = new_device; -+ } -+ if (fwpath && !path) -+ path = fwpath; -+ if (device) -+ { -+ char *prefix; -+ -+ prefix = grub_xasprintf ("(%s)%s", device, path ? : ""); -+ if (prefix) - { -- grub_env_set ("root", dev); -- grub_free (dev); -+ grub_env_set ("prefix", prefix); -+ grub_free (prefix); - } -+ grub_env_set ("root", device); - } -+ -+ grub_free (device); -+ grub_free (path); -+ grub_print_error (); - } - - /* Load the normal mode module and execute the normal mode if possible. */ -@@ -159,7 +206,7 @@ grub_load_normal_mode (void) - /* Load the module. */ - grub_dl_load ("normal"); - -- /* Something went wrong. Print errors here to let user know why we're entering rescue mode. */ -+ /* Print errors if any. */ - grub_print_error (); - grub_errno = 0; - -@@ -187,8 +234,7 @@ grub_main (void) - - /* It is better to set the root device as soon as possible, - for convenience. */ -- grub_machine_set_prefix (); -- grub_set_root_dev (); -+ grub_set_prefix_and_root (); - grub_env_export ("root"); - grub_env_export ("prefix"); - -diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index 4c56cc2..fc977f5 100644 ---- a/include/grub/ieee1275/ieee1275.h -+++ b/include/grub/ieee1275/ieee1275.h -@@ -195,7 +195,8 @@ char *EXPORT_FUNC(grub_ieee1275_get_filename) (const char *path); - int EXPORT_FUNC(grub_ieee1275_devices_iterate) (int (*hook) - (struct grub_ieee1275_devalias * - alias)); -- -+char *EXPORT_FUNC(grub_ieee1275_get_aliasdevname) (const char *path); - char *EXPORT_FUNC(grub_ieee1275_canonicalise_devname) (const char *path); -+char *EXPORT_FUNC(grub_ieee1275_get_device_type) (const char *path); - - #endif /* ! GRUB_IEEE1275_HEADER */ -diff --git a/include/grub/kernel.h b/include/grub/kernel.h -index 2ecc73d..09839de 100644 ---- a/include/grub/kernel.h -+++ b/include/grub/kernel.h -@@ -84,7 +84,8 @@ void grub_machine_init (void); - void EXPORT_FUNC(grub_machine_fini) (void); - - /* The machine-specific prefix initialization. */ --void grub_machine_set_prefix (void); -+void -+grub_machine_get_bootlocation (char **device, char **path); - - /* Register all the exported symbols. This is automatically generated. */ - void grub_register_exported_symbols (void); -diff --git a/util/grub-install.in b/util/grub-install.in -index ff8bea8..cbf1e1e 100644 ---- a/util/grub-install.in -+++ b/util/grub-install.in -@@ -271,7 +271,8 @@ if test "x$install_device" = x && ([ "${target_cpu}-${platform}" = "i386-pc" ] \ - fi - - if ! ([ "${target_cpu}-${platform}" = "i386-pc" ] \ -- || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ]); then -+ || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ] \ -+ || [ "${target_cpu}-${platform}" = "powerpc-ieee1275" ]); then - install_device= - fi - -@@ -522,11 +523,11 @@ if [ "x${devabstraction_module}" = "x" ] ; then - # Strip partition number - grub_partition="`echo "${grub_drive}" | sed -e 's/^[^,]*[,)]//; s/)$//'`" - grub_drive="`echo "${grub_drive}" | sed -e s/,[a-z0-9,]*//g`" -- if [ "$disk_module" = ata ] || [ "x${grub_drive}" != "x${install_drive}" ] || ([ "x$platform" != xefi ] && [ "x$platform" != xpc ] && [ x"${target_cpu}-${platform}" != x"sparc64-ieee1275" ]) ; then -+ if [ "$disk_module" = ata ] || [ "x${grub_drive}" != "x${install_drive}" ] || ([ "x$platform" != xefi ] && [ "x$platform" != xpc ] && [ x"${platform}" != x"ieee1275" ]); then - # generic method (used on coreboot and ata mod) - uuid="`"$grub_probe" --device-map="${device_map}" --target=fs_uuid --device "${grub_device}"`" - if [ "x${uuid}" = "x" ] ; then -- if [ "x$platform" != xefi ] && [ "x$platform" != xpc ] && [ x"${target_cpu}-${platform}" != x"sparc64-ieee1275" ]; then -+ if [ "x$platform" != xefi ] && [ "x$platform" != xpc ] && [ x"${platform}" != x"ieee1275" ]; then - echo "UUID needed with $platform, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 - elif [ "$disk_module" = ata ]; then - echo "UUID needed with ata mod, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 -@@ -540,11 +541,12 @@ if [ "x${devabstraction_module}" = "x" ] ; then - echo 'set prefix=($root)'"${relative_grubdir}" >> "${grubdir}/load.cfg" - config_opt="-c ${grubdir}/load.cfg " - modules="$modules search_fs_uuid" -- elif [ "x$platform" = xefi ] || [ "x$platform" = xpc ]; then -+ else - # we need to hardcode the partition number in the core image's prefix. - if [ x"$grub_partition" = x ]; then - prefix_drive="()" - else -+ # Comma is already there - prefix_drive="(,$grub_partition)" - fi - fi -@@ -612,6 +614,30 @@ elif [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${pla - - # Point boot-device at the new grub install - boot_device="$ofpath:$partno,"`"$grub_mkrelpath" "${grubdir}/core.${imgext}" | sed 's,/,\\\\,g'` -+ -+ # If a install device is defined, copy the core.elf to PReP partition. -+ if [ "${target_cpu}-${platform}" = "powerpc-ieee1275" ] \ -+ && [ -n "${install_device}" ]; then -+ if [ "$("${grub_probe}" -m "${device_map}" -d "${install_device}" -t msdos_parttype)" != "41" ]; then -+ echo "The chosen partition is not a PReP partition." -+ exit 1 -+ fi -+ -+ # Check if device is with an ELF within or is blank -+ if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" = ELF ] || cmp -s -n $(blockdev --getsize64 ${install_device}) /dev/zero ${install_device} ; then -+ # Change boot device to the harddisk root -+ boot_device="$ofpath" -+ dd if="${grubdir}/core.${imgext}" of="${install_device}" status=noxfer || { -+ echo "Failed to copy Grub to the PReP partition." -+ exit 1 -+ } -+ else -+ echo "The PReP partition is not empty. If you are sure you want to use it, run dd to clear it:" -+ echo " dd if=/dev/zero of=${install_device}" -+ exit 1 -+ fi -+ fi -+ - "$nvsetenv" boot-device "$boot_device" || { - echo "$nvsetenv failed." - echo "You will have to set boot-device manually. At the Open Firmware prompt, type:" -diff --git a/util/grub-probe.c b/util/grub-probe.c -index 0d5dac9..3512a79 100644 ---- a/util/grub-probe.c -+++ b/util/grub-probe.c -@@ -54,6 +54,7 @@ enum { - PRINT_DEVICE, - PRINT_PARTMAP, - PRINT_ABSTRACTION, -+ PRINT_MSDOS_PARTTYPE - }; - - int print = PRINT_FS; -@@ -221,6 +222,17 @@ probe (const char *path, char *device_name) - free (list); - list = tmp; - } -+ printf ("\n"); -+ goto end; -+ } -+ -+ if (print == PRINT_MSDOS_PARTTYPE) -+ { -+ if (dev->disk->partition -+ && strcmp(dev->disk->partition->partmap->name, "msdos") == 0) -+ printf ("%02x", dev->disk->partition->msdostype); -+ -+ printf ("\n"); - goto end; - } - -@@ -289,7 +301,7 @@ Probe device information for a given path (or device, if the -d option is given) - \n\ - -d, --device given argument is a system device, not a path\n\ - -m, --device-map=FILE use FILE as the device map [default=%s]\n\ -- -t, --target=(fs|fs_uuid|fs_label|drive|device|partmap|abstraction)\n\ -+ -t, --target=(fs|fs_uuid|fs_label|drive|device|partmap|abstraction|msdos_parttype)\n\ - print filesystem module, GRUB drive, system device, partition map module or abstraction module [default=fs]\n\ - -h, --help display this message and exit\n\ - -V, --version print version information and exit\n\ -@@ -348,6 +360,8 @@ main (int argc, char *argv[]) - print = PRINT_PARTMAP; - else if (!strcmp (optarg, "abstraction")) - print = PRINT_ABSTRACTION; -+ else if (!strcmp (optarg, "msdos_parttype")) -+ print = PRINT_MSDOS_PARTTYPE; - else - usage (1); - break; diff --git a/grub2-1.99-handle-more-dmraid.patch b/grub2-1.99-handle-more-dmraid.patch deleted file mode 100644 index bb82492..0000000 --- a/grub2-1.99-handle-more-dmraid.patch +++ /dev/null @@ -1,285 +0,0 @@ -From: Colin Watson -Subject: Improve devmapper support -Date: 2011-05-18 07:35:47 +0000 - -=== modified file 'grub-core/kern/emu/getroot.c' ---- a/grub-core/kern/emu/getroot.c 2011-04-21 09:26:29 +0000 -+++ b/grub-core/kern/emu/getroot.c 2011-05-18 07:35:47 +0000 -@@ -34,6 +34,10 @@ - #include - #include - -+#ifdef HAVE_DEVICE_MAPPER -+# include -+#endif -+ - #ifdef __GNU__ - #include - #include -@@ -634,32 +638,65 @@ - } - - static int --grub_util_is_dmraid (const char *os_dev) -+grub_util_is_lvm (const char *os_dev) - { -- if (! strncmp (os_dev, "/dev/mapper/nvidia_", 19)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/isw_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/hpt37x_", 19)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/hpt45x_", 19)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/via_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/lsi_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/pdc_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/jmicron_", 20)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/asr_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/sil_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/ddf1_", 17)) -- return 1; -- -- return 0; -+ if ((strncmp ("/dev/mapper/", os_dev, 12) != 0)) -+ return 0; -+ -+#ifdef HAVE_DEVICE_MAPPER -+ { -+ struct dm_tree *tree; -+ uint32_t maj, min; -+ struct dm_tree_node *node = NULL; -+ const char *node_uuid; -+ struct stat st; -+ -+ if (stat (os_dev, &st) < 0) -+ return 0; -+ -+ tree = dm_tree_create (); -+ if (! tree) -+ { -+ grub_printf ("Failed to create tree\n"); -+ grub_dprintf ("hostdisk", "dm_tree_create failed\n"); -+ return 0; -+ } -+ -+ maj = major (st.st_rdev); -+ min = minor (st.st_rdev); -+ -+ if (! dm_tree_add_dev (tree, maj, min)) -+ { -+ grub_dprintf ("hostdisk", "dm_tree_add_dev failed\n"); -+ dm_tree_free (tree); -+ return 0; -+ } -+ -+ node = dm_tree_find_node (tree, maj, min); -+ if (! node) -+ { -+ grub_dprintf ("hostdisk", "dm_tree_find_node failed\n"); -+ dm_tree_free (tree); -+ return 0; -+ } -+ node_uuid = dm_tree_node_get_uuid (node); -+ if (! node_uuid) -+ { -+ grub_dprintf ("hostdisk", "%s has no DM uuid\n", os_dev); -+ dm_tree_free (tree); -+ return 0; -+ } -+ if (strncmp (node_uuid, "LVM-", 4) != 0) -+ { -+ dm_tree_free (tree); -+ return 0; -+ } -+ dm_tree_free (tree); -+ return 1; -+ } -+#else -+ return 1; -+#endif /* HAVE_DEVICE_MAPPER */ - } - - int -@@ -671,13 +708,11 @@ - return GRUB_DEV_ABSTRACTION_NONE; - - /* Check for LVM. */ -- if (!strncmp (os_dev, "/dev/mapper/", 12) -- && ! grub_util_is_dmraid (os_dev) -- && strncmp (os_dev, "/dev/mapper/mpath", 17) != 0) -+ if (grub_util_is_lvm (os_dev)) - return GRUB_DEV_ABSTRACTION_LVM; - - /* Check for RAID. */ -- if (!strncmp (os_dev, "/dev/md", 7)) -+ if (!strncmp (os_dev, "/dev/md", 7) && ! grub_util_device_is_mapped (os_dev)) - return GRUB_DEV_ABSTRACTION_RAID; - #endif - - -=== modified file 'grub-core/kern/emu/hostdisk.c' ---- a/grub-core/kern/emu/hostdisk.c 2011-05-09 16:59:35 +0000 -+++ b/grub-core/kern/emu/hostdisk.c 2011-05-18 07:35:47 +0000 -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -331,18 +332,23 @@ - return GRUB_ERR_NONE; - } - -+int -+grub_util_device_is_mapped (const char *dev) -+{ - #ifdef HAVE_DEVICE_MAPPER --static int --device_is_mapped (const char *dev) --{ - struct stat st; - -+ if (!grub_device_mapper_supported ()) -+ return 0; -+ - if (stat (dev, &st) < 0) - return 0; - - return dm_is_dm_major (major (st.st_rdev)); -+#else -+ return 0; -+#endif /* HAVE_DEVICE_MAPPER */ - } --#endif /* HAVE_DEVICE_MAPPER */ - - #if defined (__FreeBSD__) || defined(__FreeBSD_kernel__) - /* FIXME: geom actually gives us the whole container hierarchy. -@@ -418,7 +424,7 @@ - # endif /* !defined(HAVE_DIOCGDINFO) */ - - # ifdef HAVE_DEVICE_MAPPER -- if (grub_device_mapper_supported () && device_is_mapped (dev)) { -+ if (grub_util_device_is_mapped (dev)) { - struct dm_task *task = NULL; - grub_uint64_t start, length; - char *target_type, *params, *space; -@@ -1149,6 +1155,54 @@ - return ret; - } - -+#ifdef HAVE_DEVICE_MAPPER -+static int -+grub_util_get_dm_node_linear_info (const char *dev, -+ int *maj, int *min) -+{ -+ struct dm_task *dmt; -+ void *next = NULL; -+ uint64_t length, start; -+ char *target, *params; -+ char *ptr; -+ int major, minor; -+ -+ dmt = dm_task_create(DM_DEVICE_TABLE); -+ if (!dmt) -+ return 0; -+ -+ if (!dm_task_set_name(dmt, dev)) -+ return 0; -+ dm_task_no_open_count(dmt); -+ if (!dm_task_run(dmt)) -+ return 0; -+ next = dm_get_next_target(dmt, next, &start, &length, -+ &target, ¶ms); -+ if (grub_strcmp (target, "linear") != 0) -+ return 0; -+ major = grub_strtoul (params, &ptr, 10); -+ if (grub_errno) -+ { -+ grub_errno = GRUB_ERR_NONE; -+ return 0; -+ } -+ if (*ptr != ':') -+ return 0; -+ ptr++; -+ minor = grub_strtoul (ptr, 0, 10); -+ if (grub_errno) -+ { -+ grub_errno = GRUB_ERR_NONE; -+ return 0; -+ } -+ if (maj) -+ *maj = major; -+ if (min) -+ *min = minor; -+ return 1; -+} -+#endif -+ - static char * - convert_system_partition_to_system_disk (const char *os_dev, struct stat *st) - { -@@ -1325,9 +1379,39 @@ - node = NULL; - goto devmapper_out; - } -- else if (strncmp (node_uuid, "DMRAID-", 7) != 0) -- { -+ if (strncmp (node_uuid, "LVM-", 4) == 0) -+ { -+ grub_dprintf ("hostdisk", "%s is an LVM\n", path); -+ node = NULL; -+ goto devmapper_out; -+ } -+ if (strncmp (node_uuid, "mpath-", 6) == 0) -+ { -+ /* Multipath partitions have partN-mpath-* UUIDs, and are -+ linear mappings so are handled by -+ grub_util_get_dm_node_linear_info. Multipath disks are not -+ linear mappings and must be handled specially. */ -+ grub_dprintf ("hostdisk", "%s is a multipath disk\n", path); -+ mapper_name = dm_tree_node_get_name (node); -+ goto devmapper_out; -+ } -+ if (strncmp (node_uuid, "DMRAID-", 7) != 0) -+ { -+ int major, minor; -+ const char *node_name; - grub_dprintf ("hostdisk", "%s is not DM-RAID\n", path); -+ -+ if ((node_name = dm_tree_node_get_name (node)) -+ && grub_util_get_dm_node_linear_info (node_name, -+ &major, &minor)) -+ { -+ if (tree) -+ dm_tree_free (tree); -+ free (path); -+ char *ret = grub_find_device (NULL, (major << 8) | minor); -+ return ret; -+ } -+ - node = NULL; - goto devmapper_out; - } - -=== modified file 'include/grub/emu/misc.h' ---- a/include/grub/emu/misc.h 2010-12-02 13:26:46 +0000 -+++ b/include/grub/emu/misc.h 2011-05-18 07:35:47 +0000 -@@ -54,6 +54,8 @@ - - char *grub_make_system_path_relative_to_its_root (const char *path) - __attribute__ ((warn_unused_result)); -+int -+grub_util_device_is_mapped (const char *dev); - - void * EXPORT_FUNC(xmalloc) (grub_size_t size) __attribute__ ((warn_unused_result)); - void * EXPORT_FUNC(xrealloc) (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result)); - diff --git a/grub2-1.99-remove-serial.mod-test-from-00_header-748964.patch b/grub2-1.99-remove-serial.mod-test-from-00_header-748964.patch deleted file mode 100644 index 918d559..0000000 --- a/grub2-1.99-remove-serial.mod-test-from-00_header-748964.patch +++ /dev/null @@ -1,29 +0,0 @@ -From fa200c2b59c0b8346466b503cd6ac80e331c9277 Mon Sep 17 00:00:00 2001 -From: Fedora Ninjas -Date: Thu, 8 Mar 2012 13:43:39 -0800 -Subject: [GRUB2] remove serial.mod test from 00_header (#748964) - -This test doesn't belong here, upstream has removed it, and it -was blocking serial installs from working. ---- - util/grub.d/00_header.in | 4 ---- - 1 files changed, 0 insertions(+), 4 deletions(-) - -diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in -index 5c4d9db..a1a75aa 100644 ---- a/util/grub.d/00_header.in -+++ b/util/grub.d/00_header.in -@@ -113,10 +113,6 @@ for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do - done - - if [ "x$serial" = x1 ]; then -- if ! test -e "${GRUB_PREFIX}/serial.mod" ; then -- echo "Serial terminal not available on this platform." >&2 ; exit 1 -- fi -- - if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then - grub_warn "Requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used." - GRUB_SERIAL_COMMAND=serial --- -1.7.7.6 - diff --git a/grub2-gfxpayload-efi.patch b/grub2-gfxpayload-efi.patch deleted file mode 100644 index 742417a..0000000 --- a/grub2-gfxpayload-efi.patch +++ /dev/null @@ -1,63 +0,0 @@ -From: Vladimir 'phcoder' Serbinenko -Subject: Don't accept text modes on EFI when booting Linux. -Date: 2011-08-16 16:11:10 +0200 - ------------------------------------------------------------- -revno: 3402 -committer: Vladimir 'phcoder' Serbinenko -branch nick: grub -timestamp: Tue 2011-08-16 16:11:10 +0200 -message: - Don't accept text modes on EFI when booting Linux. - - * grub-core/loader/i386/linux.c (ACCEPTS_PURE_TEXT): New define. - (grub_linux_boot) [!ACCEPTS_PURE_TEXT]: Restrict to graphics modes. -diff: - -=== modified file 'grub-core/loader/i386/linux.c' ---- a/grub-core/loader/i386/linux.c 2011-05-18 07:56:33 +0000 -+++ b/grub-core/loader/i386/linux.c 2011-08-16 14:11:10 +0000 -@@ -45,15 +45,18 @@ - #include - #define HAS_VGA_TEXT 0 - #define DEFAULT_VIDEO_MODE "auto" -+#define ACCEPTS_PURE_TEXT 0 - #elif defined (GRUB_MACHINE_IEEE1275) - #include - #define HAS_VGA_TEXT 0 - #define DEFAULT_VIDEO_MODE "text" -+#define ACCEPTS_PURE_TEXT 1 - #else - #include - #include - #define HAS_VGA_TEXT 1 - #define DEFAULT_VIDEO_MODE "text" -+#define ACCEPTS_PURE_TEXT 1 - #endif - - #define GRUB_LINUX_CL_OFFSET 0x1000 -@@ -483,12 +486,22 @@ - tmp = grub_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar); - if (! tmp) - return grub_errno; -+#if ACCEPTS_PURE_TEXT - err = grub_video_set_mode (tmp, 0, 0); -+#else -+ err = grub_video_set_mode (tmp, GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0); -+#endif - grub_free (tmp); - } - else -- err = grub_video_set_mode (DEFAULT_VIDEO_MODE, 0, 0); -- -+ { -+#if ACCEPTS_PURE_TEXT -+ err = grub_video_set_mode (DEFAULT_VIDEO_MODE, 0, 0); -+#else -+ err = grub_video_set_mode (DEFAULT_VIDEO_MODE, -+ GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0); -+#endif -+ } - if (err) - { - grub_print_error (); diff --git a/grub2.spec b/grub2.spec index 6b8bc3f..80626d1 100644 --- a/grub2.spec +++ b/grub2.spec @@ -15,6 +15,10 @@ %global efi %{ix86} x86_64 ia64 %endif + +%global tarversion 2.00~beta2 +%undefine _missing_build_ids_terminate_build + Name: grub2 Epoch: 1 Version: 1.99 @@ -25,24 +29,15 @@ Group: System Environment/Base License: GPLv3+ URL: http://www.gnu.org/software/grub/ Obsoletes: grub < 1:0.98 -Source0: ftp://ftp.gnu.org/gnu/grub/grub-%{version}.tar.xz +Source0: ftp://ftp.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz Source1: 90_persistent Source2: grub.default Source3: README.Fedora Patch0: grub-1.99-handle-fwrite-return.patch Patch1: grub-1.99-grub_test_assert_printf.patch Patch2: grub-1.99-just-say-linux.patch -Patch3: grub-1.99-Workaround-for-variable-set-but-not-used-issue.patch -Patch4: grub2-handle-initramfs-on-xen.patch -Patch5: grub2-1.99-handle-more-dmraid.patch -Patch6: grub2-gfxpayload-efi.patch -# https://savannah.gnu.org/bugs/index.php?35018 -Patch7: grub-1.99-fix_grub-probe_call.patch -Patch8: grub-1.99-handle-newer-autotools.patch +Patch3: grub2-handle-initramfs-on-xen.patch Patch9: grub-1.99-gcc-4.7.0.patch -Patch10: grub2-1.99-remove-serial.mod-test-from-00_header-748964.patch -Patch11: grub-1.99-prep_install_v2.patch - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -64,7 +59,7 @@ Requires(post): dracut # TODO: ppc # ExclusiveArch: %{ix86} x86_64 %{sparc} -ExcludeArch: s390 s390x +ExcludeArch: s390 s390x ppc %description The GRand Unified Bootloader (GRUB) is a highly configurable and customizable @@ -84,34 +79,36 @@ provides support for EFI systems. %endif %prep -%setup -T -c -n grub-%{version} +%setup -T -c -n grub-%{tarversion} %ifarch %{efi} -%setup -D -q -T -a 0 -n grub-%{version} -cd grub-%{version} +echo foo +%setup -D -q -T -a 0 -n grub-%{tarversion} +echo bar +cd grub-%{tarversion} cp %{SOURCE3} . git init git config user.email "pjones@fedoraproject.org" git config user.name "Fedora Ninjas" git add . -git commit -a -q -m "%{version} baseline." +git commit -a -q -m "%{tarversion} baseline." git am %{patches} cd .. -mv grub-%{version} grub-efi-%{version} +mv grub-%{tarversion} grub-efi-%{tarversion} %endif -%setup -D -q -T -a 0 -n grub-%{version} -cd grub-%{version} +%setup -D -q -T -a 0 -n grub-%{tarversion} +cd grub-%{tarversion} cp %{SOURCE3} . git init git config user.email "pjones@fedoraproject.org" git config user.name "Fedora Ninjas" git add . -git commit -a -q -m "%{version} baseline." +git commit -a -q -m "%{tarversion} baseline." git am %{patches} %build %ifarch %{efi} -cd grub-efi-%{version} +cd grub-efi-%{tarversion} ./autogen.sh %configure \ CFLAGS="$(echo $RPM_OPT_FLAGS | sed \ @@ -138,14 +135,14 @@ make %{?_smp_mflags} cd .. %endif -cd grub-%{version} +cd grub-%{tarversion} ./autogen.sh # -static is needed so that autoconf script is able to link # test that looks for _start symbol on 64 bit platforms -%ifarch %{sparc} ppc ppc64 -PLATFORM=ieee1275 +%ifarch %{sparc} ppc64 +%define platform ieee1275 %else -PLATFORM=pc +%define platform pc %endif %configure \ CFLAGS="$(echo $RPM_OPT_FLAGS | sed \ @@ -157,7 +154,7 @@ PLATFORM=pc -e 's/-m64//g' \ -e 's/-fasynchronous-unwind-tables//g' )" \ TARGET_LDFLAGS=-static \ - --with-platform=$PLATFORM \ + --with-platform=%{platform} \ --program-transform-name=s,grub,%{name}, \ --disable-werror \ --sbindir=/sbin @@ -177,7 +174,7 @@ set -e rm -fr $RPM_BUILD_ROOT %ifarch %{efi} -cd grub-efi-%{version} +cd grub-efi-%{tarversion} make DESTDIR=$RPM_BUILD_ROOT install mv $RPM_BUILD_ROOT/etc/bash_completion.d/grub $RPM_BUILD_ROOT/etc/bash_completion.d/grub-efi sed s,grub/grub-mkconfig_lib,grub-efi/grub-mkconfig_lib, -i $RPM_BUILD_ROOT/sbin/grub2-efi-mkconfig @@ -205,7 +202,7 @@ install -m 755 grub.efi $RPM_BUILD_ROOT/boot/efi/EFI/redhat/%{name}-efi/grub.efi cd .. %endif -cd grub-%{version} +cd grub-%{tarversion} make DESTDIR=$RPM_BUILD_ROOT install # Script that makes part of grub.cfg persist across updates @@ -286,19 +283,18 @@ fi %files %defattr(-,root,root,-) /etc/bash_completion.d/grub -%{_libdir}/%{name} +%{_libdir}/grub/*-%{platform}/ %{_datarootdir}/grub/grub-mkconfig_lib /sbin/%{name}-mkconfig -/sbin/%{name}-mkdevicemap /sbin/%{name}-mknetdir /sbin/%{name}-install /sbin/%{name}-probe /sbin/%{name}-reboot /sbin/%{name}-set-default -%ifarch %{ix86} x86_64 %{sparc} -/sbin/%{name}-setup -%endif -%{_bindir}/%{name}-bin2h +/sbin/%{name}-bios-setup +/sbin/%{name}-ofpathname +/sbin/%{name}-sparc64-setup +%{_bindir}/%{name}-mkstandalone %{_bindir}/%{name}-editenv %{_bindir}/%{name}-fstest %{_bindir}/%{name}-kbdcomp @@ -325,28 +321,31 @@ fi %{_sysconfdir}/sysconfig/grub %dir /boot/%{name} %ghost %config(noreplace) /boot/%{name}/grub.cfg -%doc grub-%{version}/COPYING grub-%{version}/INSTALL grub-%{version}/NEWS -%doc grub-%{version}/README grub-%{version}/THANKS grub-%{version}/TODO -%doc grub-%{version}/ChangeLog grub-%{version}/README.Fedora +%doc grub-%{tarversion}/COPYING grub-%{tarversion}/INSTALL +%doc grub-%{tarversion}/NEWS grub-%{tarversion}/README +%doc grub-%{tarversion}/THANKS grub-%{tarversion}/TODO +%doc grub-%{tarversion}/ChangeLog grub-%{tarversion}/README.Fedora %exclude %{_mandir} %{_infodir}/grub2* +%attr(0755,root,root)/%{_datarootdir}/grub/ %ifarch %{efi} %files efi %defattr(-,root,root,-) %attr(0755,root,root)/boot/efi/EFI/redhat /etc/bash_completion.d/grub-efi -%{_libdir}/grub2-efi/ +%{_libdir}/grub/%{_arch}-efi %{_datarootdir}/grub/grub-mkconfig_lib /sbin/grub2-efi-mkconfig -/sbin/grub2-efi-mkdevicemap /sbin/grub2-efi-mknetdir /sbin/grub2-efi-install /sbin/grub2-efi-probe /sbin/grub2-efi-reboot /sbin/grub2-efi-set-default -#/sbin/grub2-efi-setup -%{_bindir}/grub2-efi-bin2h +/sbin/grub2-efi-bios-setup +/sbin/grub2-efi-ofpathname +/sbin/grub2-efi-sparc64-setup +%{_bindir}/grub2-efi-mkstandalone %{_bindir}/grub2-efi-editenv %{_bindir}/grub2-efi-fstest %{_bindir}/grub2-efi-kbdcomp @@ -371,19 +370,19 @@ fi %config(noreplace) %{_sysconfdir}/grub2-efi.cfg %config(noreplace) %{_sysconfdir}/default/grub %{_sysconfdir}/sysconfig/grub -%dir /boot/efi/EFI/redhat/grub2-efi %ghost %config(noreplace) /boot/efi/EFI/redhat/grub2-efi/grub.cfg -%doc grub-%{version}/COPYING grub-%{version}/INSTALL grub-%{version}/NEWS -%doc grub-%{version}/README grub-%{version}/THANKS grub-%{version}/TODO -%doc grub-%{version}/ChangeLog grub-%{version}/README.Fedora +%doc grub-%{tarversion}/COPYING grub-%{tarversion}/INSTALL +%doc grub-%{tarversion}/NEWS grub-%{tarversion}/README +%doc grub-%{tarversion}/THANKS grub-%{tarversion}/TODO +%doc grub-%{tarversion}/ChangeLog grub-%{tarversion}/README.Fedora %exclude %{_mandir} %{_infodir}/grub2* %endif +%attr(0755,root,root)/%{_datarootdir}/grub/ %changelog -* Mon Mar 12 2012 Peter Jones - 1.99-18 -- Handle some missed bits for newer autotools support (patch from khopp) -- Handle PReP installation on PPC. +* Wed Mar 14 2012 Peter Jones - 1.99-18 +- Rebase from 1.99 to 2.00~beta2 * Wed Mar 07 2012 Peter Jones - 1.99-17 - Update for newer autotools and gcc 4.7.0 From 2648d4a897b3a0394f7fd4811109aab5b1d09d06 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 14 Mar 2012 16:46:33 -0400 Subject: [PATCH 12/65] Update sources for 2.00~beta2 --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index fb51ba6..1146a89 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -27e360b951f006c464299d06bbd63442 grub-1.99.tar.xz +4509839183c4593ab49a2c6044c03f18 grub-2.00~beta2.tar.xz From e6dc731cc24d827cc09b7dfe7ebcd57a30c9e504 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 15 Mar 2012 10:31:05 -0400 Subject: [PATCH 13/65] Use --with-grubdir= on configure to make it behave like -17 did. --- grub2.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/grub2.spec b/grub2.spec index 80626d1..04fa80f 100644 --- a/grub2.spec +++ b/grub2.spec @@ -22,7 +22,7 @@ Name: grub2 Epoch: 1 Version: 1.99 -Release: 18%{?dist} +Release: 19%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -120,6 +120,7 @@ cd grub-efi-%{tarversion} -e 's/-fasynchronous-unwind-tables//g' )" \ TARGET_LDFLAGS=-static \ --with-platform=efi \ + --with-grubdir=grub2 \ --program-transform-name=s,grub,%{name}-efi, \ --disable-werror \ --sbindir=/sbin @@ -155,6 +156,7 @@ cd grub-%{tarversion} -e 's/-fasynchronous-unwind-tables//g' )" \ TARGET_LDFLAGS=-static \ --with-platform=%{platform} \ + --with-grubdir=grub2 \ --program-transform-name=s,grub,%{name}, \ --disable-werror \ --sbindir=/sbin @@ -381,6 +383,9 @@ fi %attr(0755,root,root)/%{_datarootdir}/grub/ %changelog +* Thu Mar 15 2012 Peter Jones - 1.99-19 +- Use --with-grubdir= on configure to make it behave like -17 did. + * Wed Mar 14 2012 Peter Jones - 1.99-18 - Rebase from 1.99 to 2.00~beta2 From d4970aa79c5c07235d2422e2185676f10bc5936f Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 16 Mar 2012 21:16:35 -0400 Subject: [PATCH 14/65] Fix Source0 url --- grub2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub2.spec b/grub2.spec index 04fa80f..10aaa40 100644 --- a/grub2.spec +++ b/grub2.spec @@ -29,7 +29,7 @@ Group: System Environment/Base License: GPLv3+ URL: http://www.gnu.org/software/grub/ Obsoletes: grub < 1:0.98 -Source0: ftp://ftp.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz +Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz Source1: 90_persistent Source2: grub.default Source3: README.Fedora From 3eacc8828d161277e5ca8b40c4116ed1eaf1fcc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Tue, 27 Mar 2012 21:03:12 +0200 Subject: [PATCH 15/65] Use Fix-tests-of-zeroed-partition patch by Mark Hamzy --- grub-1.99-Fix-tests-of-zeroed-partition.patch | 25 +++++++++++++++++++ grub2.spec | 6 ++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 grub-1.99-Fix-tests-of-zeroed-partition.patch diff --git a/grub-1.99-Fix-tests-of-zeroed-partition.patch b/grub-1.99-Fix-tests-of-zeroed-partition.patch new file mode 100644 index 0000000..ad5a770 --- /dev/null +++ b/grub-1.99-Fix-tests-of-zeroed-partition.patch @@ -0,0 +1,25 @@ +From c8f67c2ee40815c075f1d6e5b3d6b504fbe204f5 Mon Sep 17 00:00:00 2001 +From: Fedora Ninjas +Date: Sun, 25 Mar 2012 09:22:34 -0500 +Subject: [PATCH] Fix tests of zeroed partition + +--- + util/grub-install.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/util/grub-install.in b/util/grub-install.in +index 9c1d133..e8638af 100644 +--- a/util/grub-install.in ++++ b/util/grub-install.in +@@ -750,7 +750,7 @@ elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ] + exit 1 + fi + +- if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" = ELF ] || [ $(cmp /dev/zero "${install_device}" &>/dev/null) ]; then ++ if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" != ELF ] && ( cmp -s -n $(blockdev --getsize64 ${install_device}) /dev/zero "${install_device}" &>/dev/null ); then + # Change boot device to the harddisk root + boot_device="$ofpath" + dd if="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" of="${install_device}" status=noxfer || { +-- +1.7.7.2 + diff --git a/grub2.spec b/grub2.spec index 10aaa40..b3666b5 100644 --- a/grub2.spec +++ b/grub2.spec @@ -22,7 +22,7 @@ Name: grub2 Epoch: 1 Version: 1.99 -Release: 19%{?dist} +Release: 19%{?dist}.1 Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -38,6 +38,7 @@ Patch1: grub-1.99-grub_test_assert_printf.patch Patch2: grub-1.99-just-say-linux.patch Patch3: grub2-handle-initramfs-on-xen.patch Patch9: grub-1.99-gcc-4.7.0.patch +Patch10: grub-1.99-Fix-tests-of-zeroed-partition.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -383,6 +384,9 @@ fi %attr(0755,root,root)/%{_datarootdir}/grub/ %changelog +* Sun Mar 25 2012 Dan Horák - 1.99-19.1 +- Use Fix-tests-of-zeroed-partition patch by Mark Hamzy + * Thu Mar 15 2012 Peter Jones - 1.99-19 - Use --with-grubdir= on configure to make it behave like -17 did. From 4d1b645b7d923efd205dbc7b4f220c03b500e5b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Tue, 27 Mar 2012 22:34:56 +0200 Subject: [PATCH 16/65] Add support for serial terminal consoles on PPC by Mark Hamzy --- grub-1.99-Fix-tests-of-zeroed-partition.patch | 2 +- grub-1.99-ppc-terminfo.patch | 154 ++++++++++++++++++ grub2.spec | 6 +- 3 files changed, 160 insertions(+), 2 deletions(-) create mode 100644 grub-1.99-ppc-terminfo.patch diff --git a/grub-1.99-Fix-tests-of-zeroed-partition.patch b/grub-1.99-Fix-tests-of-zeroed-partition.patch index ad5a770..a57711c 100644 --- a/grub-1.99-Fix-tests-of-zeroed-partition.patch +++ b/grub-1.99-Fix-tests-of-zeroed-partition.patch @@ -1,5 +1,5 @@ From c8f67c2ee40815c075f1d6e5b3d6b504fbe204f5 Mon Sep 17 00:00:00 2001 -From: Fedora Ninjas +From: Mark Hamzy Date: Sun, 25 Mar 2012 09:22:34 -0500 Subject: [PATCH] Fix tests of zeroed partition diff --git a/grub-1.99-ppc-terminfo.patch b/grub-1.99-ppc-terminfo.patch new file mode 100644 index 0000000..2b8c380 --- /dev/null +++ b/grub-1.99-ppc-terminfo.patch @@ -0,0 +1,154 @@ +From ad101ca2bd8913b989cc759bf36632c94381fc4e Mon Sep 17 00:00:00 2001 +From: Mark Hamzy +Date: Thu, 1 Mar 2012 21:18:20 -0600 +Subject: [PATCH] Migrate PPC from Yaboot to Grub2 + +Add configuration support for serial terminal consoles. This will set the maximum screen size so that text is not overwritten. + +--- + Makefile.util.def | 7 +++ + util/grub.d/20_ppc_terminfo.in | 114 ++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 121 insertions(+), 0 deletions(-) + create mode 100644 util/grub.d/20_ppc_terminfo.in + +diff --git a/Makefile.util.def b/Makefile.util.def +index 058572f..1993f9b 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -360,6 +360,13 @@ script = { + }; + + script = { ++ name = '20_ppc_terminfo'; ++ common = util/grub.d/20_ppc_terminfo.in; ++ installdir = grubconf; ++ condition = COND_HOST_LINUX; ++}; ++ ++script = { + name = '30_os-prober'; + common = util/grub.d/30_os-prober.in; + installdir = grubconf; +diff --git a/util/grub.d/20_ppc_terminfo.in b/util/grub.d/20_ppc_terminfo.in +new file mode 100644 +index 0000000..545ad62 +--- /dev/null ++++ b/util/grub.d/20_ppc_terminfo.in +@@ -0,0 +1,114 @@ ++#! /bin/sh ++set -e ++ ++# grub-mkconfig helper script. ++# Copyright (C) 2006,2007,2008,2009,2010 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 ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++# ++# GRUB is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with GRUB. If not, see . ++ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++bindir=@bindir@ ++libdir=@libdir@ ++. ${libdir}/grub/grub-mkconfig_lib ++ ++export TEXTDOMAIN=@PACKAGE@ ++export TEXTDOMAINDIR=@localedir@ ++ ++X=80 ++Y=24 ++TERMINAL=ofconsole ++ ++argument () { ++ opt=$1 ++ shift ++ ++ if test $# -eq 0; then ++ echo "$0: option requires an argument -- '$opt'" 1>&2 ++ exit 1 ++ fi ++ echo $1 ++} ++ ++check_terminfo () { ++ ++ while test $# -gt 0 ++ do ++ option=$1 ++ shift ++ ++ case "$option" in ++ terminfo | TERMINFO) ++ ;; ++ ++ -g) ++ NEWXY=`argument $option "$@"` ++ NEWX=`echo $NEWXY | cut -d x -f 1` ++ NEWY=`echo $NEWXY | cut -d x -f 2` ++ ++ if [ ${NEWX} -ge 80 ] ; then ++ X=${NEWX} ++ else ++ echo "Warning: ${NEWX} is less than the minimum size of 80" ++ fi ++ ++ if [ ${NEWY} -ge 24 ] ; then ++ Y=${NEWY} ++ else ++ echo "Warning: ${NEWY} is less than the minimum size of 24" ++ fi ++ ++ shift ++ ;; ++ ++ *) ++# # accept console or ofconsole ++# if [ "$option" != "console" -a "$option" != "ofconsole" ] ; then ++# echo "Error: GRUB_TERMINFO unknown console: $option" ++# exit 1 ++# fi ++# # perfer console ++# TERMINAL=console ++ # accept ofconsole ++ if [ "$option" != "ofconsole" ] ; then ++ echo "Error: GRUB_TERMINFO unknown console: $option" ++ exit 1 ++ fi ++ # perfer console ++ TERMINAL=ofconsole ++ ;; ++ esac ++ ++ done ++ ++} ++ ++if ! uname -m | grep -q ppc ; then ++ exit 0 ++fi ++ ++if [ "x${GRUB_TERMINFO}" != "x" ] ; then ++ F1=`echo ${GRUB_TERMINFO} | cut -d " " -f 1` ++ ++ if [ "${F1}" != "terminfo" ] ; then ++ echo "Error: GRUB_TERMINFO is set to \"${GRUB_TERMINFO}\" The first word should be terminfo." ++ exit 1 ++ fi ++ ++ check_terminfo ${GRUB_TERMINFO} ++fi ++ ++cat << EOF ++ terminfo -g ${X}x${Y} ${TERMINAL} ++EOF +-- +1.7.7.6 + diff --git a/grub2.spec b/grub2.spec index b3666b5..ce9b48f 100644 --- a/grub2.spec +++ b/grub2.spec @@ -22,7 +22,7 @@ Name: grub2 Epoch: 1 Version: 1.99 -Release: 19%{?dist}.1 +Release: 19%{?dist}.2 Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -39,6 +39,7 @@ Patch2: grub-1.99-just-say-linux.patch Patch3: grub2-handle-initramfs-on-xen.patch Patch9: grub-1.99-gcc-4.7.0.patch Patch10: grub-1.99-Fix-tests-of-zeroed-partition.patch +Patch11: grub-1.99-ppc-terminfo.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -384,6 +385,9 @@ fi %attr(0755,root,root)/%{_datarootdir}/grub/ %changelog +* Tue Mar 27 2012 Dan Horák - 1.99-19.2 +- Add support for serial terminal consoles on PPC by Mark Hamzy + * Sun Mar 25 2012 Dan Horák - 1.99-19.1 - Use Fix-tests-of-zeroed-partition patch by Mark Hamzy From 982cdee958c3626fd7023ac75b2340aa0f089c3f Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 27 Mar 2012 17:09:13 -0400 Subject: [PATCH 17/65] I'm told the exclude arch change to ppc from ppc64 was wrong. --- grub2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub2.spec b/grub2.spec index ce9b48f..660973d 100644 --- a/grub2.spec +++ b/grub2.spec @@ -61,7 +61,7 @@ Requires(post): dracut # TODO: ppc # ExclusiveArch: %{ix86} x86_64 %{sparc} -ExcludeArch: s390 s390x ppc +ExcludeArch: s390 s390x ppc64 %description The GRand Unified Bootloader (GRUB) is a highly configurable and customizable From 820140e8ac4c3a240f1e2e2d0aa0fad9b65f814f Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 29 Mar 2012 13:50:57 -0400 Subject: [PATCH 18/65] Manually patch this to make it look like the changes from F17. Ugh. --- grub-1.99-ppc-terminfo.patch | 17 +++++++++-------- grub2.spec | 15 +++++++++++---- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/grub-1.99-ppc-terminfo.patch b/grub-1.99-ppc-terminfo.patch index 2b8c380..b2b0d78 100644 --- a/grub-1.99-ppc-terminfo.patch +++ b/grub-1.99-ppc-terminfo.patch @@ -1,9 +1,10 @@ -From ad101ca2bd8913b989cc759bf36632c94381fc4e Mon Sep 17 00:00:00 2001 +From e263907f50e496e602edd9bd846ccb6e0565a085 Mon Sep 17 00:00:00 2001 From: Mark Hamzy -Date: Thu, 1 Mar 2012 21:18:20 -0600 +Date: Wed, 28 Mar 2012 14:46:41 -0500 Subject: [PATCH] Migrate PPC from Yaboot to Grub2 -Add configuration support for serial terminal consoles. This will set the maximum screen size so that text is not overwritten. +Add configuration support for serial terminal consoles. This will set the +maximum screen size so that text is not overwritten. --- Makefile.util.def | 7 +++ @@ -12,10 +13,10 @@ Add configuration support for serial terminal consoles. This will set the maxim create mode 100644 util/grub.d/20_ppc_terminfo.in diff --git a/Makefile.util.def b/Makefile.util.def -index 058572f..1993f9b 100644 +index c41b76e..b349758 100644 --- a/Makefile.util.def +++ b/Makefile.util.def -@@ -360,6 +360,13 @@ script = { +@@ -423,6 +423,13 @@ script = { }; script = { @@ -31,7 +32,7 @@ index 058572f..1993f9b 100644 installdir = grubconf; diff --git a/util/grub.d/20_ppc_terminfo.in b/util/grub.d/20_ppc_terminfo.in new file mode 100644 -index 0000000..545ad62 +index 0000000..10d6658 --- /dev/null +++ b/util/grub.d/20_ppc_terminfo.in @@ -0,0 +1,114 @@ @@ -58,7 +59,7 @@ index 0000000..545ad62 +exec_prefix=@exec_prefix@ +bindir=@bindir@ +libdir=@libdir@ -+. ${libdir}/grub/grub-mkconfig_lib ++. "@datadir@/@PACKAGE@/grub-mkconfig_lib" + +export TEXTDOMAIN=@PACKAGE@ +export TEXTDOMAINDIR=@localedir@ @@ -150,5 +151,5 @@ index 0000000..545ad62 + terminfo -g ${X}x${Y} ${TERMINAL} +EOF -- -1.7.7.6 +1.7.7.2 diff --git a/grub2.spec b/grub2.spec index 660973d..d11aac4 100644 --- a/grub2.spec +++ b/grub2.spec @@ -21,8 +21,8 @@ Name: grub2 Epoch: 1 -Version: 1.99 -Release: 19%{?dist}.2 +Version: 2.0 +Release: 0.21%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -59,9 +59,8 @@ Requires: gettext os-prober which Requires(pre): dracut Requires(post): dracut -# TODO: ppc # ExclusiveArch: %{ix86} x86_64 %{sparc} -ExcludeArch: s390 s390x ppc64 +ExcludeArch: s390 s390x %description The GRand Unified Bootloader (GRUB) is a highly configurable and customizable @@ -385,6 +384,14 @@ fi %attr(0755,root,root)/%{_datarootdir}/grub/ %changelog +* Thu Mar 29 2012 Peter Jones - 2.0-0.21 +- Remove ppc excludearch lines (dwa) +- Update ppc terminfo patch (hamzy) + +* Wed Mar 28 2012 Peter Jones - 2.0-0.20 +- Fix ppc64 vs ppc exclude according to what dwa tells me they need +- Fix version number to better match policy. + * Tue Mar 27 2012 Dan Horák - 1.99-19.2 - Add support for serial terminal consoles on PPC by Mark Hamzy From cda751bf1333abd43178c565413613fe4a52ec57 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Thu, 5 Apr 2012 02:14:31 +0200 Subject: [PATCH 19/65] use /etc/system-release for naming of Linux entries instead of GNU/Linux --- grub-1.99-just-say-linux.patch | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/grub-1.99-just-say-linux.patch b/grub-1.99-just-say-linux.patch index 389b163..98ab2b7 100644 --- a/grub-1.99-just-say-linux.patch +++ b/grub-1.99-just-say-linux.patch @@ -3,7 +3,6 @@ From: Peter Jones Date: Mon, 14 Mar 2011 14:27:42 -0400 Subject: [PATCH] Don't say "GNU/Linux" in generated menus. -In Fedora and RHEL we just call it Linux. --- util/grub.d/10_linux.in | 4 ++-- util/grub.d/20_linux_xen.in | 4 ++-- @@ -18,7 +17,7 @@ index a09c3e6..0b0df78 100644 if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then - OS=GNU/Linux -+ OS=Linux ++ OS="$(sed 's, release .*$,,g' /etc/system-release) Linux" else - OS="${GRUB_DISTRIBUTOR} GNU/Linux" + OS="${GRUB_DISTRIBUTOR} Linux" @@ -34,7 +33,7 @@ index ee49cd9..10422b0 100644 if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then - OS=GNU/Linux -+ OS=Linux ++ OS="$(sed 's, release .*$,,g' /etc/system-release) Linux" else - OS="${GRUB_DISTRIBUTOR} GNU/Linux" + OS="${GRUB_DISTRIBUTOR} Linux" From f16c2cd275edf1d4ead98eea55a3736e66f18863 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Thu, 5 Apr 2012 02:14:55 +0200 Subject: [PATCH 20/65] remove unused grub-1.99-Workaround-for-variable-set-but-not-used-issue.patch --- ...-for-variable-set-but-not-used-issue.patch | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 grub-1.99-Workaround-for-variable-set-but-not-used-issue.patch diff --git a/grub-1.99-Workaround-for-variable-set-but-not-used-issue.patch b/grub-1.99-Workaround-for-variable-set-but-not-used-issue.patch deleted file mode 100644 index adfead6..0000000 --- a/grub-1.99-Workaround-for-variable-set-but-not-used-issue.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 8b424dd42b64453e50a49a4c6fc455584f931b46 Mon Sep 17 00:00:00 2001 -From: Fedora Ninjas -Date: Thu, 23 Jun 2011 00:08:03 +0400 -Subject: [PATCH] Workaround for 'variable set but not used' issue - -Signed-off-by: Fedora Ninjas ---- - grub-core/lib/relocator.c | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) - -diff --git a/grub-core/lib/relocator.c b/grub-core/lib/relocator.c -index dbd5fe4..606b545 100644 ---- a/grub-core/lib/relocator.c -+++ b/grub-core/lib/relocator.c -@@ -1010,6 +1010,9 @@ malloc_in_range (struct grub_relocator *rel, - = ALIGN_UP (alloc_end, - GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT); - -+ grub_dprintf ("relocator", "requesting %lx-%lx\n", -+ (unsigned long) fstart, -+ (unsigned long) fend); - #if GRUB_RELOCATOR_HAVE_LEFTOVERS - { - struct grub_relocator_fw_leftover *lo1 = NULL; --- -1.7.5.1 - From 4f57b17a983189db627b615a91eee3fef2ac86c0 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Thu, 5 Apr 2012 02:19:01 +0200 Subject: [PATCH 21/65] don't list grub-mkconfig_lib twice /usr/share/grub/ was also listed an extra time if efi was disabled. --- grub2.spec | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/grub2.spec b/grub2.spec index d11aac4..f2f15d7 100644 --- a/grub2.spec +++ b/grub2.spec @@ -287,7 +287,7 @@ fi %defattr(-,root,root,-) /etc/bash_completion.d/grub %{_libdir}/grub/*-%{platform}/ -%{_datarootdir}/grub/grub-mkconfig_lib +%{_datarootdir}/grub/ /sbin/%{name}-mkconfig /sbin/%{name}-mknetdir /sbin/%{name}-install @@ -330,7 +330,6 @@ fi %doc grub-%{tarversion}/ChangeLog grub-%{tarversion}/README.Fedora %exclude %{_mandir} %{_infodir}/grub2* -%attr(0755,root,root)/%{_datarootdir}/grub/ %ifarch %{efi} %files efi @@ -338,7 +337,7 @@ fi %attr(0755,root,root)/boot/efi/EFI/redhat /etc/bash_completion.d/grub-efi %{_libdir}/grub/%{_arch}-efi -%{_datarootdir}/grub/grub-mkconfig_lib +%{_datarootdir}/grub/ /sbin/grub2-efi-mkconfig /sbin/grub2-efi-mknetdir /sbin/grub2-efi-install @@ -381,7 +380,6 @@ fi %exclude %{_mandir} %{_infodir}/grub2* %endif -%attr(0755,root,root)/%{_datarootdir}/grub/ %changelog * Thu Mar 29 2012 Peter Jones - 2.0-0.21 From adb84294cfad8c4267145cc27eb61bd976e5202a Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Thu, 5 Apr 2012 02:21:55 +0200 Subject: [PATCH 22/65] update spec to /usr move --- grub2.spec | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/grub2.spec b/grub2.spec index f2f15d7..41963e8 100644 --- a/grub2.spec +++ b/grub2.spec @@ -123,8 +123,7 @@ cd grub-efi-%{tarversion} --with-platform=efi \ --with-grubdir=grub2 \ --program-transform-name=s,grub,%{name}-efi, \ - --disable-werror \ - --sbindir=/sbin + --disable-werror make %{?_smp_mflags} %ifarch %{ix86} %define grubefiarch i386-efi @@ -159,8 +158,7 @@ cd grub-%{tarversion} --with-platform=%{platform} \ --with-grubdir=grub2 \ --program-transform-name=s,grub,%{name}, \ - --disable-werror \ - --sbindir=/sbin + --disable-werror make %{?_smp_mflags} @@ -288,15 +286,15 @@ fi /etc/bash_completion.d/grub %{_libdir}/grub/*-%{platform}/ %{_datarootdir}/grub/ -/sbin/%{name}-mkconfig -/sbin/%{name}-mknetdir -/sbin/%{name}-install -/sbin/%{name}-probe -/sbin/%{name}-reboot -/sbin/%{name}-set-default -/sbin/%{name}-bios-setup -/sbin/%{name}-ofpathname -/sbin/%{name}-sparc64-setup +%{_sbindir}/%{name}-mkconfig +%{_sbindir}/%{name}-mknetdir +%{_sbindir}/%{name}-install +%{_sbindir}/%{name}-probe +%{_sbindir}/%{name}-reboot +%{_sbindir}/%{name}-set-default +%{_sbindir}/%{name}-bios-setup +%{_sbindir}/%{name}-ofpathname +%{_sbindir}/%{name}-sparc64-setup %{_bindir}/%{name}-mkstandalone %{_bindir}/%{name}-editenv %{_bindir}/%{name}-fstest @@ -313,7 +311,7 @@ fi %{_bindir}/%{name}-mkrescue %endif %ifarch %{sparc} -/sbin/%{name}-ofpathname +%{_sbindir}/%{name}-ofpathname %endif %{_bindir}/%{name}-script-check %dir %{_sysconfdir}/grub.d @@ -338,15 +336,15 @@ fi /etc/bash_completion.d/grub-efi %{_libdir}/grub/%{_arch}-efi %{_datarootdir}/grub/ -/sbin/grub2-efi-mkconfig -/sbin/grub2-efi-mknetdir -/sbin/grub2-efi-install -/sbin/grub2-efi-probe -/sbin/grub2-efi-reboot -/sbin/grub2-efi-set-default -/sbin/grub2-efi-bios-setup -/sbin/grub2-efi-ofpathname -/sbin/grub2-efi-sparc64-setup +%{_sbindir}/grub2-efi-mkconfig +%{_sbindir}/grub2-efi-mknetdir +%{_sbindir}/grub2-efi-install +%{_sbindir}/grub2-efi-probe +%{_sbindir}/grub2-efi-reboot +%{_sbindir}/grub2-efi-set-default +%{_sbindir}/grub2-efi-bios-setup +%{_sbindir}/grub2-efi-ofpathname +%{_sbindir}/grub2-efi-sparc64-setup %{_bindir}/grub2-efi-mkstandalone %{_bindir}/grub2-efi-editenv %{_bindir}/grub2-efi-fstest @@ -363,7 +361,7 @@ fi %{_bindir}/grub2-efi-mkrescue %endif %ifarch %{sparc} ppc ppc64 -/sbin/grub2-efi-ofpathname +%{_sbindir}/grub2-efi-ofpathname %endif %{_bindir}/grub2-efi-script-check %dir %{_sysconfdir}/grub.d From 21e891cb1233bf7703b2f9ae914aaa6ff0b22432 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 16 Apr 2012 12:11:38 -0400 Subject: [PATCH 23/65] Fix path for grub2-efi-mkconfig post-usrmove. --- grub2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub2.spec b/grub2.spec index 41963e8..4932099 100644 --- a/grub2.spec +++ b/grub2.spec @@ -178,7 +178,7 @@ rm -fr $RPM_BUILD_ROOT cd grub-efi-%{tarversion} make DESTDIR=$RPM_BUILD_ROOT install mv $RPM_BUILD_ROOT/etc/bash_completion.d/grub $RPM_BUILD_ROOT/etc/bash_completion.d/grub-efi -sed s,grub/grub-mkconfig_lib,grub-efi/grub-mkconfig_lib, -i $RPM_BUILD_ROOT/sbin/grub2-efi-mkconfig +sed s,grub/grub-mkconfig_lib,grub-efi/grub-mkconfig_lib, -i $RPM_BUILD_ROOT%{_sbindir}/grub2-efi-mkconfig # Ghost config file install -m 755 -d $RPM_BUILD_ROOT/boot/efi/EFI/redhat/ From 49353e4bb93fba634a22670c09cf8440c75f748b Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Thu, 5 Apr 2012 02:19:50 +0200 Subject: [PATCH 24/65] drop 90_persistent script It is undocumented. It haven't been upstreamed. Upstream has 40_custom and 41_custom for the same purpose. It violates layering and code structure by guessing which (optional!) output file has been specified for grub2-mkconfig ... and makes the wrong guess for grub2-efi. --- 90_persistent | 36 ------------------------------------ grub2.spec | 4 ---- 2 files changed, 40 deletions(-) delete mode 100644 90_persistent diff --git a/90_persistent b/90_persistent deleted file mode 100644 index 634b177..0000000 --- a/90_persistent +++ /dev/null @@ -1,36 +0,0 @@ -#! /bin/sh -e - -# update-grub helper script. -# Copyright (C) 2008 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 -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# GRUB is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GRUB. If not, see . - -# The output of this script is copied from part of grub.cfg -# that correspond to itself. The achievement is that user can -# modify that part of grub.cfg directly, and it will be persistent -# across update-grub runs. - -transform="s&^&&;s,grub,grub2," -ME=$(echo $0 |sed 's,/,\\/,g') -GRUBCFG=/boot/`echo grub | sed ${transform}`/grub.cfg - -# Exit gracefully if there's no configuration file yet -[ -f ${GRUBCFG} ] || exit 0 - -awk " - BEGIN {echo = 0} - /### BEGIN $ME ###/ {echo = 1; next} - /### END $ME ###/ {echo = 0; next} - {if (echo) print} -" ${GRUBCFG} diff --git a/grub2.spec b/grub2.spec index 4932099..c2ebdac 100644 --- a/grub2.spec +++ b/grub2.spec @@ -30,7 +30,6 @@ License: GPLv3+ URL: http://www.gnu.org/software/grub/ Obsoletes: grub < 1:0.98 Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz -Source1: 90_persistent Source2: grub.default Source3: README.Fedora Patch0: grub-1.99-handle-fwrite-return.patch @@ -206,9 +205,6 @@ cd .. cd grub-%{tarversion} make DESTDIR=$RPM_BUILD_ROOT install -# Script that makes part of grub.cfg persist across updates -install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/grub.d/ - # Ghost config file install -d $RPM_BUILD_ROOT/boot/%{name} touch $RPM_BUILD_ROOT/boot/%{name}/grub.cfg From 2b1c010ce01eb9564c5420eda6572c5b2d243aa2 Mon Sep 17 00:00:00 2001 From: "David W. Aquilina" Date: Thu, 29 Mar 2012 13:55:01 -0400 Subject: [PATCH 25/65] Fix ieee1275 platform define for ppc --- grub2.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/grub2.spec b/grub2.spec index c2ebdac..26a4455 100644 --- a/grub2.spec +++ b/grub2.spec @@ -22,7 +22,7 @@ Name: grub2 Epoch: 1 Version: 2.0 -Release: 0.21%{?dist} +Release: 0.22%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -139,7 +139,7 @@ cd grub-%{tarversion} ./autogen.sh # -static is needed so that autoconf script is able to link # test that looks for _start symbol on 64 bit platforms -%ifarch %{sparc} ppc64 +%ifarch %{sparc} ppc ppc64 %define platform ieee1275 %else %define platform pc @@ -376,6 +376,9 @@ fi %endif %changelog +* Thu Mar 29 2012 David Aquilina - 2.0-0.22 +- Fix ieee1275 platform define for ppc + * Thu Mar 29 2012 Peter Jones - 2.0-0.21 - Remove ppc excludearch lines (dwa) - Update ppc terminfo patch (hamzy) From 0e6e69f9b5fb67921c736f0ca76df9fc8abb54ec Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 26 Apr 2012 11:09:57 -0400 Subject: [PATCH 26/65] Various fixes from Mads Kiilerich --- .gitignore | 1 + grub-2.00-beta4-wronly.patch | 29 ++++++ ...-support-for-PowerMac-HFS-partitions.patch | 94 +++++++++++++++++++ grub2.spec | 24 +++-- sources | 2 + 5 files changed, 144 insertions(+), 6 deletions(-) create mode 100644 grub-2.00-beta4-wronly.patch create mode 100644 grub-2.00~beta4-add-support-for-PowerMac-HFS-partitions.patch diff --git a/.gitignore b/.gitignore index d479897..5055a3b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ grub-*.tar.?z +/unifont-5.1.20080820.pcf.gz diff --git a/grub-2.00-beta4-wronly.patch b/grub-2.00-beta4-wronly.patch new file mode 100644 index 0000000..90b9c59 --- /dev/null +++ b/grub-2.00-beta4-wronly.patch @@ -0,0 +1,29 @@ +From 8e4aea82c6aba6b8b5ca68d74abafa3fe9486c36 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 19 Apr 2012 14:17:38 -0400 +Subject: [PATCH] Open device O_WRONLY in grub_util_biosdisk_write. + +revision 4225 introduced an error wherein the device we intend +to write to from e.g. grub2-bios-setup is opened read-only. The +immediate following write(2) call then fails with -EBADF. + +--- + grub-core/kern/emu/hostdisk.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c +index ea7eb3d..19748df 100644 +--- a/grub-core/kern/emu/hostdisk.c ++++ b/grub-core/kern/emu/hostdisk.c +@@ -1081,7 +1081,7 @@ grub_util_biosdisk_write (grub_disk_t disk, grub_disk_addr_t sector, + { + int fd; + grub_disk_addr_t max = ~0ULL; +- fd = open_device (disk, sector, O_RDONLY, &max); ++ fd = open_device (disk, sector, O_WRONLY, &max); + if (fd < 0) + return grub_errno; + +-- +1.7.10 + diff --git a/grub-2.00~beta4-add-support-for-PowerMac-HFS-partitions.patch b/grub-2.00~beta4-add-support-for-PowerMac-HFS-partitions.patch new file mode 100644 index 0000000..9ad7dde --- /dev/null +++ b/grub-2.00~beta4-add-support-for-PowerMac-HFS-partitions.patch @@ -0,0 +1,94 @@ +From f2dc76d4d82ac9bbe5ccb4e8ccc49c14e8574c20 Mon Sep 17 00:00:00 2001 +From: Fedora Ninjas +Date: Wed, 25 Apr 2012 13:09:15 +0200 +Subject: [PATCH 2/2] add support for PowerMac HFS partitions + +Signed-off-by: Fedora PPC secondary arch maintainer +--- + util/grub-install.in | 67 ++++++++++++++++++++++++++++++++------------------ + 1 files changed, 43 insertions(+), 24 deletions(-) + +diff --git a/util/grub-install.in b/util/grub-install.in +index 26be9d9..f1f9bae 100644 +--- a/util/grub-install.in ++++ b/util/grub-install.in +@@ -757,33 +757,52 @@ elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ] + + # If a install device is defined, copy the core.elf to PReP partition. + else +- if [ "$("${grub_probe}" -m "${device_map}" -d "${install_device}" -t msdos_parttype)" != "41" ]; then +- gettext "The chosen partition is not a PReP partition." 1>&2 +- echo 1>&2 +- exit 1 +- fi +- ++ if [ "$("${grub_probe}" -m "${device_map}" -d "${install_device}" -t msdos_parttype)" = "41" ]; then + if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" != ELF ] && ( cmp -s -n $(blockdev --getsize64 ${install_device}) /dev/zero "${install_device}" &>/dev/null ); then +- # Change boot device to the harddisk root +- boot_device="$ofpath" +- dd if="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" of="${install_device}" status=noxfer || { +- gettext "Failed to copy Grub to the PReP partition." 1>&2 +- echo 1>&2 +- exit 1 +- } ++ # Change boot device to the harddisk root ++ boot_device="$ofpath" ++ dd if="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" of="${install_device}" status=noxfer || { ++ gettext "Failed to copy Grub to the PReP partition." 1>&2 ++ echo 1>&2 ++ exit 1 ++ } + else +- gettext "The PReP partition is not empty. If you are sure you want to use it, run dd to clear it:" 1>&2 +- echo 1>&2 +- echo " dd if=/dev/zero of=${install_device}" +- exit 1 ++ gettext "The PReP partition is not empty. If you are sure you want to use it, run dd to clear it:" 1>&2 ++ echo 1>&2 ++ echo " dd if=/dev/zero of=${install_device}" ++ exit 1 + fi +- dev="`echo "${install_device}" | sed -e 's/\/dev\///' -e 's/[0-9]\+//'`" +- boot_device="`$ofpathname "$dev"`" || { +- # TRANSLATORS: "device tree path" is the name of the device +- # for IEEE1275 +- gettext_printf "Couldn't find IEEE1275 device tree path for %s.\nYou will have to set \`boot-device' variable manually.\n" "$dev" 1>&2 +- exit 1 +- } ++ dev="`echo "${install_device}" | sed -e 's/\/dev\///' -e 's/[0-9]\+//'`" ++ boot_device="`$ofpathname "$dev"`" || { ++ # TRANSLATORS: "device tree path" is the name of the device ++ # for IEEE1275 ++ gettext_printf "Couldn't find IEEE1275 device tree path for %s.\nYou will have to set \`boot-device' variable manually.\n" "$dev" 1>&2 ++ exit 1 ++ } ++ else ++ hmount ${install_device} >/dev/null 2>&1 ++ if [ $? -eq 0 ]; then ++ humount "${install_device}" ++ # Change boot device to the harddisk root ++ boot_device="$ofpath" ++ hmount "${install_device}" ++ hcopy "${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" ":" || { ++ gettext "Failed to copy Grub to the HFS partition." 1>&2 ++ gettext "Maybe the HFS partition is not empty. If you are sure you want to use it, run hformat to clear it:" 1>&2 ++ echo 1>&2 ++ echo " hformat ${install_device}" ++ exit 1 ++ } ++ humount "${install_device}" ++ # We're on PowerMac, it's either /dev/sdaX or /dev/hdaX: ++ dev="`echo "${install_device}" | sed -e 's/\/dev\/.da//'`" ++ boot_device="hd:${dev},core.${imgext}" ++ else ++ gettext "The chosen partition is neither a PReP nor a HFS partition." 1>&2 ++ echo 1>&2 ++ exit 1 ++ fi ++ fi + fi + + "$nvsetenv" boot-device "$boot_device" || { +-- +1.7.6.5 + diff --git a/grub2.spec b/grub2.spec index 26a4455..6a60ae6 100644 --- a/grub2.spec +++ b/grub2.spec @@ -16,13 +16,13 @@ %endif -%global tarversion 2.00~beta2 +%global tarversion 2.00~beta4 %undefine _missing_build_ids_terminate_build Name: grub2 Epoch: 1 Version: 2.0 -Release: 0.22%{?dist} +Release: 0.24%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -32,13 +32,15 @@ Obsoletes: grub < 1:0.98 Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz Source2: grub.default Source3: README.Fedora +Source4: http://unifoundry.com/unifont-5.1.20080820.pcf.gz Patch0: grub-1.99-handle-fwrite-return.patch Patch1: grub-1.99-grub_test_assert_printf.patch Patch2: grub-1.99-just-say-linux.patch Patch3: grub2-handle-initramfs-on-xen.patch -Patch9: grub-1.99-gcc-4.7.0.patch -Patch10: grub-1.99-Fix-tests-of-zeroed-partition.patch -Patch11: grub-1.99-ppc-terminfo.patch +Patch4: grub-1.99-Fix-tests-of-zeroed-partition.patch +Patch5: grub-1.99-ppc-terminfo.patch +Patch6: grub-2.00-beta4-wronly.patch +Patch7: grub-2.00~beta4-add-support-for-PowerMac-HFS-partitions.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -86,6 +88,8 @@ echo foo echo bar cd grub-%{tarversion} cp %{SOURCE3} . +# place unifont in the '.' from which configure is run +cp %{SOURCE4} unifont.pcf.gz git init git config user.email "pjones@fedoraproject.org" git config user.name "Fedora Ninjas" @@ -98,6 +102,8 @@ mv grub-%{tarversion} grub-efi-%{tarversion} %setup -D -q -T -a 0 -n grub-%{tarversion} cd grub-%{tarversion} cp %{SOURCE3} . +# place unifont in the '.' from which configure is run +cp %{SOURCE4} unifont.pcf.gz git init git config user.email "pjones@fedoraproject.org" git config user.name "Fedora Ninjas" @@ -177,7 +183,6 @@ rm -fr $RPM_BUILD_ROOT cd grub-efi-%{tarversion} make DESTDIR=$RPM_BUILD_ROOT install mv $RPM_BUILD_ROOT/etc/bash_completion.d/grub $RPM_BUILD_ROOT/etc/bash_completion.d/grub-efi -sed s,grub/grub-mkconfig_lib,grub-efi/grub-mkconfig_lib, -i $RPM_BUILD_ROOT%{_sbindir}/grub2-efi-mkconfig # Ghost config file install -m 755 -d $RPM_BUILD_ROOT/boot/efi/EFI/redhat/ @@ -376,6 +381,13 @@ fi %endif %changelog +* Thu Apr 26 2012 Peter Jones - 2.0-0.24 +- Various fixes from Mads Kiilerich + +* Thu Apr 19 2012 Peter Jones - 2.0-0.23 +- Update to 2.00~beta4 +- Make fonts work so we can do graphics reasonably + * Thu Mar 29 2012 David Aquilina - 2.0-0.22 - Fix ieee1275 platform define for ppc diff --git a/sources b/sources index 1146a89..ee6f23d 100644 --- a/sources +++ b/sources @@ -1 +1,3 @@ 4509839183c4593ab49a2c6044c03f18 grub-2.00~beta2.tar.xz +8c28087c5fcb3188f1244b390efffdbe unifont-5.1.20080820.pcf.gz +6902a2b408038b8d3263a86536ac4652 grub-2.00~beta4.tar.xz From 47d5e953cc5737540ff9ad5836f910a6beecf566 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 26 Apr 2012 14:09:45 -0400 Subject: [PATCH 27/65] Require: file --- grub2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub2.spec b/grub2.spec index 6a60ae6..7ccca6b 100644 --- a/grub2.spec +++ b/grub2.spec @@ -56,7 +56,7 @@ BuildRequires: autoconf automake autogen device-mapper-devel BuildRequires: freetype-devel gettext-devel git BuildRequires: texinfo -Requires: gettext os-prober which +Requires: gettext os-prober which file Requires(pre): dracut Requires(post): dracut From e55a9ea2cb733893ab6a71b54b70e40a38c17743 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Wed, 18 Apr 2012 16:16:48 +0200 Subject: [PATCH 28/65] ofpathname is not sparc specific - remove double include on sparc --- grub2.spec | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/grub2.spec b/grub2.spec index 7ccca6b..5c9f13f 100644 --- a/grub2.spec +++ b/grub2.spec @@ -301,19 +301,14 @@ fi %{_bindir}/%{name}-fstest %{_bindir}/%{name}-kbdcomp %{_bindir}/%{name}-menulst2cfg -# %{_bindir}/%{name}-mkelfimage %{_bindir}/%{name}-mkfont %{_bindir}/%{name}-mklayout %{_bindir}/%{name}-mkimage -# %{_bindir}/%{name}-mkisofs %{_bindir}/%{name}-mkpasswd-pbkdf2 %{_bindir}/%{name}-mkrelpath %ifnarch %{sparc} %{_bindir}/%{name}-mkrescue %endif -%ifarch %{sparc} -%{_sbindir}/%{name}-ofpathname -%endif %{_bindir}/%{name}-script-check %dir %{_sysconfdir}/grub.d %config %{_sysconfdir}/grub.d/??_* @@ -351,19 +346,14 @@ fi %{_bindir}/grub2-efi-fstest %{_bindir}/grub2-efi-kbdcomp %{_bindir}/grub2-efi-menulst2cfg -# %{_bindir}/grub2-efi-mkelfimage %{_bindir}/grub2-efi-mkfont %{_bindir}/grub2-efi-mklayout %{_bindir}/grub2-efi-mkimage -# %{_bindir}/grub2-efi-mkisofs %{_bindir}/grub2-efi-mkpasswd-pbkdf2 %{_bindir}/grub2-efi-mkrelpath %ifnarch %{sparc} ppc ppc64 %{_bindir}/grub2-efi-mkrescue %endif -%ifarch %{sparc} ppc ppc64 -%{_sbindir}/grub2-efi-ofpathname -%endif %{_bindir}/grub2-efi-script-check %dir %{_sysconfdir}/grub.d %config %{_sysconfdir}/grub.d/??_* From e8c09d17f9c17b8d7acfd7e2052fd593e6010ada Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Wed, 18 Apr 2012 20:08:51 +0200 Subject: [PATCH 29/65] drop GRUB_SAVEDEFAULT from default default Most users probably don't want manual boot selections to be sticky - especially considering the issues with default after installation of new kernels. This feature will also not work on the somewhat supported lvm and btrfs configurations. --- grub.default | 1 - 1 file changed, 1 deletion(-) diff --git a/grub.default b/grub.default index 9ce1bb0..81ff487 100644 --- a/grub.default +++ b/grub.default @@ -1,7 +1,6 @@ GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved -GRUB_SAVEDEFAULT=true # GRUB_TERMINAL="serial console" # GRUB_SERIAL_COMMAND="serial --unit=0 --speed=9600" GRUB_CMDLINE_LINUX="quiet rhgb" From eb331df6cf6e1bffffeff25444f0b0c5e4cbc6a4 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 27 Apr 2012 09:17:10 -0400 Subject: [PATCH 30/65] remove old sources --- sources | 1 - 1 file changed, 1 deletion(-) diff --git a/sources b/sources index ee6f23d..74a9a45 100644 --- a/sources +++ b/sources @@ -1,3 +1,2 @@ -4509839183c4593ab49a2c6044c03f18 grub-2.00~beta2.tar.xz 8c28087c5fcb3188f1244b390efffdbe unifont-5.1.20080820.pcf.gz 6902a2b408038b8d3263a86536ac4652 grub-2.00~beta4.tar.xz From b7a4ca3eb433d0e007335f89af1eef92bcbba72c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 7 May 2012 09:27:13 -0400 Subject: [PATCH 31/65] Work around #819031 Conflicts: grub2.spec --- grub2.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub2.spec b/grub2.spec index 5c9f13f..8697345 100644 --- a/grub2.spec +++ b/grub2.spec @@ -310,7 +310,7 @@ fi %{_bindir}/%{name}-mkrescue %endif %{_bindir}/%{name}-script-check -%dir %{_sysconfdir}/grub.d +%attr(0700,root,root) %dir %{_sysconfdir}/grub.d %config %{_sysconfdir}/grub.d/??_* %{_sysconfdir}/grub.d/README %config(noreplace) %{_sysconfdir}/%{name}.cfg @@ -355,7 +355,7 @@ fi %{_bindir}/grub2-efi-mkrescue %endif %{_bindir}/grub2-efi-script-check -%dir %{_sysconfdir}/grub.d +%attr(0700,root,root) %dir %{_sysconfdir}/grub.d %config %{_sysconfdir}/grub.d/??_* %{_sysconfdir}/grub.d/README %config(noreplace) %{_sysconfdir}/grub2-efi.cfg From 60f39abf64fe7b9c74fb717bb9a9a6b728551a0a Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Sun, 29 Apr 2012 16:36:14 +0200 Subject: [PATCH 32/65] Include localization files - using the grub name space is forward compatible --- grub2.spec | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/grub2.spec b/grub2.spec index 8697345..40b5730 100644 --- a/grub2.spec +++ b/grub2.spec @@ -235,13 +235,14 @@ rm $RPM_BUILD_ROOT%{_infodir}/dir # Defaults install -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/default/grub -# TODO: rename locale files to grub2 and make sure gettext works correctly -rm $RPM_BUILD_ROOT/usr/share/locale/*/LC_MESSAGES/grub.mo mkdir ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig ln -sf %{_sysconfdir}/default/grub \ ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/grub +cd .. +%find_lang grub + %clean rm -rf $RPM_BUILD_ROOT @@ -282,7 +283,7 @@ if [ "$1" = 0 ]; then /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/grub2-dev.info.gz || : fi -%files +%files -f grub.lang %defattr(-,root,root,-) /etc/bash_completion.d/grub %{_libdir}/grub/*-%{platform}/ @@ -326,7 +327,7 @@ fi %{_infodir}/grub2* %ifarch %{efi} -%files efi +%files efi -f grub.lang %defattr(-,root,root,-) %attr(0755,root,root)/boot/efi/EFI/redhat /etc/bash_completion.d/grub-efi From cd1247369f502410bd8a2160b4e77fad03b35a21 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Sun, 29 Apr 2012 16:37:16 +0200 Subject: [PATCH 33/65] Include html documentation - that is more accessible for the average user --- grub2.spec | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/grub2.spec b/grub2.spec index 40b5730..bd2a225 100644 --- a/grub2.spec +++ b/grub2.spec @@ -111,6 +111,8 @@ git add . git commit -a -q -m "%{tarversion} baseline." git am %{patches} +# Specifying .png in @image doesn't work - leaving it out +sed -i 's,\.png,,g' docs/grub-dev.texi %build %ifarch %{efi} @@ -171,10 +173,16 @@ sed -i -e 's,(grub),(%{name}),g' \ -e 's,grub.info,%{name}.info,g' \ -e 's,\* GRUB:,* GRUB2:,g' \ -e 's,/boot/grub/,/boot/%{name}/,g' \ - -e 's,grub-,%{name}-,g' \ + -e 's,\([^-]\)grub-\([a-z]\),\1%{name}-\2,g' \ docs/grub.info sed -i -e 's,grub-dev,%{name}-dev,g' docs/grub-dev.info +/usr/bin/makeinfo --html --no-split -I docs -o grub-dev.html docs/grub-dev.texi +/usr/bin/makeinfo --html --no-split -I docs -o grub.html docs/grub.texi +sed -i -e 's,/boot/grub/,/boot/%{name}/,g' \ + -e 's,\([^-]\)grub-\([a-z]\),\1%{name}-\2,g' \ + grub.html + %install set -e rm -fr $RPM_BUILD_ROOT @@ -323,6 +331,8 @@ fi %doc grub-%{tarversion}/NEWS grub-%{tarversion}/README %doc grub-%{tarversion}/THANKS grub-%{tarversion}/TODO %doc grub-%{tarversion}/ChangeLog grub-%{tarversion}/README.Fedora +%doc grub-%{tarversion}/grub.html +%doc grub-%{tarversion}/grub-dev.html grub-%{tarversion}/docs/font_char_metrics.png %exclude %{_mandir} %{_infodir}/grub2* @@ -367,6 +377,8 @@ fi %doc grub-%{tarversion}/NEWS grub-%{tarversion}/README %doc grub-%{tarversion}/THANKS grub-%{tarversion}/TODO %doc grub-%{tarversion}/ChangeLog grub-%{tarversion}/README.Fedora +%doc grub-%{tarversion}/grub.html +%doc grub-%{tarversion}/grub-dev.html grub-%{tarversion}/docs/font_char_metrics.png %exclude %{_mandir} %{_infodir}/grub2* %endif From 4b7e06e90f67ffb9c6e3b59ed13a2ec6e741350a Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 9 May 2012 16:55:11 -0400 Subject: [PATCH 34/65] Include theme support. Conflicts: grub2.spec --- .gitignore | 1 + grub2.spec | 10 ++++++++-- sources | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5055a3b..ba0cc22 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ grub-*.tar.?z /unifont-5.1.20080820.pcf.gz +/theme.tar.bz2 diff --git a/grub2.spec b/grub2.spec index bd2a225..2414607 100644 --- a/grub2.spec +++ b/grub2.spec @@ -22,7 +22,7 @@ Name: grub2 Epoch: 1 Version: 2.0 -Release: 0.24%{?dist} +Release: 0.25.beta4%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -33,6 +33,7 @@ Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz Source2: grub.default Source3: README.Fedora Source4: http://unifoundry.com/unifont-5.1.20080820.pcf.gz +Source5: theme.tar.bz2 Patch0: grub-1.99-handle-fwrite-return.patch Patch1: grub-1.99-grub_test_assert_printf.patch Patch2: grub-1.99-just-say-linux.patch @@ -56,7 +57,7 @@ BuildRequires: autoconf automake autogen device-mapper-devel BuildRequires: freetype-devel gettext-devel git BuildRequires: texinfo -Requires: gettext os-prober which file +Requires: gettext os-prober which file system-logos Requires(pre): dracut Requires(post): dracut @@ -251,6 +252,9 @@ ln -sf %{_sysconfdir}/default/grub \ cd .. %find_lang grub +cd $RPM_BUILD_ROOT +tar xjf %{SOURCE5} + %clean rm -rf $RPM_BUILD_ROOT @@ -335,6 +339,7 @@ fi %doc grub-%{tarversion}/grub-dev.html grub-%{tarversion}/docs/font_char_metrics.png %exclude %{_mandir} %{_infodir}/grub2* +/boot/grub2/themes/system %ifarch %{efi} %files efi -f grub.lang @@ -381,6 +386,7 @@ fi %doc grub-%{tarversion}/grub-dev.html grub-%{tarversion}/docs/font_char_metrics.png %exclude %{_mandir} %{_infodir}/grub2* +/boot/grub2/themes/system %endif %changelog diff --git a/sources b/sources index 74a9a45..2192e2a 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ 8c28087c5fcb3188f1244b390efffdbe unifont-5.1.20080820.pcf.gz 6902a2b408038b8d3263a86536ac4652 grub-2.00~beta4.tar.xz +df14bd3ee8942d1cc6942859eb6bcb14 theme.tar.bz2 From e5764c00760771ffb37445fe9d9f113efe818135 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 9 May 2012 16:58:23 -0400 Subject: [PATCH 35/65] Include theme support (mizmo) - Include locale support (kiilerix) - Include html docs (kiilerix) Conflicts: grub2.spec --- grub2.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/grub2.spec b/grub2.spec index 2414607..e41cd13 100644 --- a/grub2.spec +++ b/grub2.spec @@ -390,6 +390,11 @@ fi %endif %changelog +* Wed May 09 2012 Peter Jones - 2.0-0.25.beta4 +- Include theme support (mizmo) +- Include locale support (kiilerix) +- Include html docs (kiilerix) + * Thu Apr 26 2012 Peter Jones - 2.0-0.24 - Various fixes from Mads Kiilerich From 66e85d1e00d88b8d39d98621f2cfe04abb6c5a3a Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Sun, 29 Apr 2012 16:37:27 +0200 Subject: [PATCH 36/65] remove foo bar echo statements - seems to be forgotten and useless debug statements --- grub2.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/grub2.spec b/grub2.spec index e41cd13..16baf40 100644 --- a/grub2.spec +++ b/grub2.spec @@ -84,9 +84,7 @@ provides support for EFI systems. %prep %setup -T -c -n grub-%{tarversion} %ifarch %{efi} -echo foo %setup -D -q -T -a 0 -n grub-%{tarversion} -echo bar cd grub-%{tarversion} cp %{SOURCE3} . # place unifont in the '.' from which configure is run From 2df3e5efbaebe7d72ea72bf45dccea16a81c62d0 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Thu, 10 May 2012 02:44:58 +0200 Subject: [PATCH 37/65] Update to grub 2.0 beta 5 --- grub-2.00-beta4-wronly.patch | 29 ----------------------------- grub2.spec | 5 ++--- sources | 2 +- 3 files changed, 3 insertions(+), 33 deletions(-) delete mode 100644 grub-2.00-beta4-wronly.patch diff --git a/grub-2.00-beta4-wronly.patch b/grub-2.00-beta4-wronly.patch deleted file mode 100644 index 90b9c59..0000000 --- a/grub-2.00-beta4-wronly.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 8e4aea82c6aba6b8b5ca68d74abafa3fe9486c36 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Thu, 19 Apr 2012 14:17:38 -0400 -Subject: [PATCH] Open device O_WRONLY in grub_util_biosdisk_write. - -revision 4225 introduced an error wherein the device we intend -to write to from e.g. grub2-bios-setup is opened read-only. The -immediate following write(2) call then fails with -EBADF. - ---- - grub-core/kern/emu/hostdisk.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c -index ea7eb3d..19748df 100644 ---- a/grub-core/kern/emu/hostdisk.c -+++ b/grub-core/kern/emu/hostdisk.c -@@ -1081,7 +1081,7 @@ grub_util_biosdisk_write (grub_disk_t disk, grub_disk_addr_t sector, - { - int fd; - grub_disk_addr_t max = ~0ULL; -- fd = open_device (disk, sector, O_RDONLY, &max); -+ fd = open_device (disk, sector, O_WRONLY, &max); - if (fd < 0) - return grub_errno; - --- -1.7.10 - diff --git a/grub2.spec b/grub2.spec index 16baf40..ab82dbb 100644 --- a/grub2.spec +++ b/grub2.spec @@ -16,13 +16,13 @@ %endif -%global tarversion 2.00~beta4 +%global tarversion 2.00~beta5 %undefine _missing_build_ids_terminate_build Name: grub2 Epoch: 1 Version: 2.0 -Release: 0.25.beta4%{?dist} +Release: 0.26.beta5%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -40,7 +40,6 @@ Patch2: grub-1.99-just-say-linux.patch Patch3: grub2-handle-initramfs-on-xen.patch Patch4: grub-1.99-Fix-tests-of-zeroed-partition.patch Patch5: grub-1.99-ppc-terminfo.patch -Patch6: grub-2.00-beta4-wronly.patch Patch7: grub-2.00~beta4-add-support-for-PowerMac-HFS-partitions.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) diff --git a/sources b/sources index 2192e2a..f8ba959 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ 8c28087c5fcb3188f1244b390efffdbe unifont-5.1.20080820.pcf.gz -6902a2b408038b8d3263a86536ac4652 grub-2.00~beta4.tar.xz df14bd3ee8942d1cc6942859eb6bcb14 theme.tar.bz2 +be6c65c7d43991129b410942489c35ec grub-2.00~beta5.tar.xz From 171aabb89d277f3b28a981f73794b6232afa968b Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Thu, 10 May 2012 02:44:50 +0200 Subject: [PATCH 38/65] fixes for theme support - make the fonts that are used available The starfield theme is a bad example ... --- grub.default | 1 + grub2.spec | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/grub.default b/grub.default index 81ff487..5b9f56a 100644 --- a/grub.default +++ b/grub.default @@ -5,3 +5,4 @@ GRUB_DEFAULT=saved # GRUB_SERIAL_COMMAND="serial --unit=0 --speed=9600" GRUB_CMDLINE_LINUX="quiet rhgb" GRUB_DISABLE_RECOVERY="true" +GRUB_THEME=/boot/grub2/themes/system/theme.txt diff --git a/grub2.spec b/grub2.spec index ab82dbb..e60b05a 100644 --- a/grub2.spec +++ b/grub2.spec @@ -55,6 +55,7 @@ BuildRequires: /usr/lib/crt1.o glibc-static BuildRequires: autoconf automake autogen device-mapper-devel BuildRequires: freetype-devel gettext-devel git BuildRequires: texinfo +BuildRequires: dejavu-sans-fonts Requires: gettext os-prober which file system-logos Requires(pre): dracut @@ -249,8 +250,13 @@ ln -sf %{_sysconfdir}/default/grub \ cd .. %find_lang grub +# Fedora theme in /boot/grub2/themes/system/ cd $RPM_BUILD_ROOT tar xjf %{SOURCE5} +rm boot/grub2/themes/system/dejavu.pf2 +$RPM_BUILD_ROOT%{_bindir}/%{name}-mkfont -o boot/grub2/themes/system/DejaVuSans-10.pf2 -s 10 /usr/share/fonts/dejavu/DejaVuSans.ttf # "DejaVu Sans Regular 10" +$RPM_BUILD_ROOT%{_bindir}/%{name}-mkfont -o boot/grub2/themes/system/DejaVuSans-12.pf2 -s 12 /usr/share/fonts/dejavu/DejaVuSans.ttf # "DejaVu Sans Regular 12" +$RPM_BUILD_ROOT%{_bindir}/%{name}-mkfont -o boot/grub2/themes/system/DejaVuSans-Bold-14.pf2 -s 14 /usr/share/fonts/dejavu/DejaVuSans-Bold.ttf # "DejaVu Sans Bold 14" %clean rm -rf $RPM_BUILD_ROOT @@ -334,6 +340,7 @@ fi %doc grub-%{tarversion}/ChangeLog grub-%{tarversion}/README.Fedora %doc grub-%{tarversion}/grub.html %doc grub-%{tarversion}/grub-dev.html grub-%{tarversion}/docs/font_char_metrics.png +%doc grub-%{tarversion}/themes/starfield/COPYING.CC-BY-SA-3.0 %exclude %{_mandir} %{_infodir}/grub2* /boot/grub2/themes/system @@ -381,6 +388,7 @@ fi %doc grub-%{tarversion}/ChangeLog grub-%{tarversion}/README.Fedora %doc grub-%{tarversion}/grub.html %doc grub-%{tarversion}/grub-dev.html grub-%{tarversion}/docs/font_char_metrics.png +%doc grub-%{tarversion}/themes/starfield/COPYING.CC-BY-SA-3.0 %exclude %{_mandir} %{_infodir}/grub2* /boot/grub2/themes/system From 8b3c8c6612f79683b20f3153a50a6d22cb3610f1 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Thu, 10 May 2012 02:34:37 +0200 Subject: [PATCH 39/65] drop unused grub-1.99-gcc-4.7.0.patch --- grub-1.99-gcc-4.7.0.patch | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 grub-1.99-gcc-4.7.0.patch diff --git a/grub-1.99-gcc-4.7.0.patch b/grub-1.99-gcc-4.7.0.patch deleted file mode 100644 index b8f6e51..0000000 --- a/grub-1.99-gcc-4.7.0.patch +++ /dev/null @@ -1,29 +0,0 @@ -From b0f4ef523b69a497d69820c09bbb07484a6b09cc Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Wed, 7 Mar 2012 09:53:50 -0500 -Subject: [PATCH] Fix gcc error that kills build. - ---- - conf/Makefile.common | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/conf/Makefile.common b/conf/Makefile.common -index 2040a2e..b3ba765 100644 ---- a/conf/Makefile.common -+++ b/conf/Makefile.common -@@ -11,10 +11,10 @@ if COND_i386_pc - CFLAGS_PLATFORM += -mrtd -mregparm=3 - endif - if COND_i386_efi -- LDFLAGS_PLATFORM = -melf_i386 -+ LDFLAGS_PLATFORM = -m32 - endif - if COND_x86_64_efi -- LDFLAGS_PLATFORM = -melf_x86_64 -+ LDFLAGS_PLATFORM = -m64 - endif - if COND_i386_qemu - CFLAGS_PLATFORM += -mrtd -mregparm=3 --- -1.7.7.6 - From 1d74d59761ee9f8bd8226f10bb3027a6b7097bc7 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Sun, 29 Apr 2012 16:53:50 +0200 Subject: [PATCH 40/65] remove grub2-efi transformation All tools and support files are now the same for bios and efi - only the actual bootloader is different. There is thus no reason to build any tools for efi, but there is no way to avoid it. We just build and install them and overwrite with bios files. By using the same transformation we avoid the problems with the transformation being included in some un-transformed files. The old grub2-efi specific are kept as symlinks for backward compatibility. grub2-efi is still very much work-in-progress and the grub2-efi could probably be dropped very soon. It would also make sense to move all shared files to a sub-package. --- grub2.spec | 51 +++++++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/grub2.spec b/grub2.spec index e60b05a..c524f09 100644 --- a/grub2.spec +++ b/grub2.spec @@ -128,7 +128,7 @@ cd grub-efi-%{tarversion} TARGET_LDFLAGS=-static \ --with-platform=efi \ --with-grubdir=grub2 \ - --program-transform-name=s,grub,%{name}-efi, \ + --program-transform-name=s,grub,%{name}, \ --disable-werror make %{?_smp_mflags} %ifarch %{ix86} @@ -189,7 +189,6 @@ rm -fr $RPM_BUILD_ROOT %ifarch %{efi} cd grub-efi-%{tarversion} make DESTDIR=$RPM_BUILD_ROOT install -mv $RPM_BUILD_ROOT/etc/bash_completion.d/grub $RPM_BUILD_ROOT/etc/bash_completion.d/grub-efi # Ghost config file install -m 755 -d $RPM_BUILD_ROOT/boot/efi/EFI/redhat/ @@ -349,32 +348,32 @@ fi %files efi -f grub.lang %defattr(-,root,root,-) %attr(0755,root,root)/boot/efi/EFI/redhat -/etc/bash_completion.d/grub-efi -%{_libdir}/grub/%{_arch}-efi +/etc/bash_completion.d/grub +%{_libdir}/grub/%{grubefiarch} %{_datarootdir}/grub/ -%{_sbindir}/grub2-efi-mkconfig -%{_sbindir}/grub2-efi-mknetdir -%{_sbindir}/grub2-efi-install -%{_sbindir}/grub2-efi-probe -%{_sbindir}/grub2-efi-reboot -%{_sbindir}/grub2-efi-set-default -%{_sbindir}/grub2-efi-bios-setup -%{_sbindir}/grub2-efi-ofpathname -%{_sbindir}/grub2-efi-sparc64-setup -%{_bindir}/grub2-efi-mkstandalone -%{_bindir}/grub2-efi-editenv -%{_bindir}/grub2-efi-fstest -%{_bindir}/grub2-efi-kbdcomp -%{_bindir}/grub2-efi-menulst2cfg -%{_bindir}/grub2-efi-mkfont -%{_bindir}/grub2-efi-mklayout -%{_bindir}/grub2-efi-mkimage -%{_bindir}/grub2-efi-mkpasswd-pbkdf2 -%{_bindir}/grub2-efi-mkrelpath -%ifnarch %{sparc} ppc ppc64 -%{_bindir}/grub2-efi-mkrescue +%{_sbindir}/%{name}-mkconfig +%{_sbindir}/%{name}-mknetdir +%{_sbindir}/%{name}-install +%{_sbindir}/%{name}-probe +%{_sbindir}/%{name}-reboot +%{_sbindir}/%{name}-set-default +%{_sbindir}/%{name}-bios-setup +%{_sbindir}/%{name}-ofpathname +%{_sbindir}/%{name}-sparc64-setup +%{_bindir}/%{name}-mkstandalone +%{_bindir}/%{name}-editenv +%{_bindir}/%{name}-fstest +%{_bindir}/%{name}-kbdcomp +%{_bindir}/%{name}-menulst2cfg +%{_bindir}/%{name}-mkfont +%{_bindir}/%{name}-mklayout +%{_bindir}/%{name}-mkimage +%{_bindir}/%{name}-mkpasswd-pbkdf2 +%{_bindir}/%{name}-mkrelpath +%ifnarch %{sparc} +%{_bindir}/%{name}-mkrescue %endif -%{_bindir}/grub2-efi-script-check +%{_bindir}/%{name}-script-check %attr(0700,root,root) %dir %{_sysconfdir}/grub.d %config %{_sysconfdir}/grub.d/??_* %{_sysconfdir}/grub.d/README From 44de0250344628b196a86f0b22dddffa1accc777 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 10 May 2012 09:28:07 -0400 Subject: [PATCH 41/65] Update to beta5. - Update how efi building works (kiilerix) --- grub2.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/grub2.spec b/grub2.spec index c524f09..d1e684d 100644 --- a/grub2.spec +++ b/grub2.spec @@ -394,6 +394,10 @@ fi %endif %changelog +* Thu May 10 2012 Peter Jones - 2.0-0.26.beta5 +- Update to beta5. +- Update how efi building works (kiilerix) + * Wed May 09 2012 Peter Jones - 2.0-0.25.beta4 - Include theme support (mizmo) - Include locale support (kiilerix) From c86672d101403ccf7b2770e02b40c865bd77d8f3 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 10 May 2012 09:29:36 -0400 Subject: [PATCH 42/65] Don't delete stuff from theme in .spec, just remove it from the theme. --- grub2.spec | 1 - sources | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/grub2.spec b/grub2.spec index d1e684d..e95a57d 100644 --- a/grub2.spec +++ b/grub2.spec @@ -252,7 +252,6 @@ cd .. # Fedora theme in /boot/grub2/themes/system/ cd $RPM_BUILD_ROOT tar xjf %{SOURCE5} -rm boot/grub2/themes/system/dejavu.pf2 $RPM_BUILD_ROOT%{_bindir}/%{name}-mkfont -o boot/grub2/themes/system/DejaVuSans-10.pf2 -s 10 /usr/share/fonts/dejavu/DejaVuSans.ttf # "DejaVu Sans Regular 10" $RPM_BUILD_ROOT%{_bindir}/%{name}-mkfont -o boot/grub2/themes/system/DejaVuSans-12.pf2 -s 12 /usr/share/fonts/dejavu/DejaVuSans.ttf # "DejaVu Sans Regular 12" $RPM_BUILD_ROOT%{_bindir}/%{name}-mkfont -o boot/grub2/themes/system/DejaVuSans-Bold-14.pf2 -s 14 /usr/share/fonts/dejavu/DejaVuSans-Bold.ttf # "DejaVu Sans Bold 14" diff --git a/sources b/sources index f8ba959..d065bbf 100644 --- a/sources +++ b/sources @@ -1,3 +1,4 @@ 8c28087c5fcb3188f1244b390efffdbe unifont-5.1.20080820.pcf.gz df14bd3ee8942d1cc6942859eb6bcb14 theme.tar.bz2 be6c65c7d43991129b410942489c35ec grub-2.00~beta5.tar.xz +b3a7270fa115b7567ac8df878ef0ab19 theme.tar.bz2 From 4a93dbaf37fad1cbf22e208c8f32ac119f0b5e13 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 10 May 2012 09:30:40 -0400 Subject: [PATCH 43/65] Update to beta5. - Update how efi building works (kiilerix) - Fix theme support to bring in fonts correctly (kiilerix, pjones) --- grub2.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/grub2.spec b/grub2.spec index e95a57d..c44b2b2 100644 --- a/grub2.spec +++ b/grub2.spec @@ -396,6 +396,7 @@ fi * Thu May 10 2012 Peter Jones - 2.0-0.26.beta5 - Update to beta5. - Update how efi building works (kiilerix) +- Fix theme support to bring in fonts correctly (kiilerix, pjones) * Wed May 09 2012 Peter Jones - 2.0-0.25.beta4 - Include theme support (mizmo) From b9abb48d6fb4e6bf52e8a009bd1354177b190c9c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 10 May 2012 09:49:48 -0400 Subject: [PATCH 44/65] /etc/default/grub actually comes from anaconda, remove the confusion. --- grub2.spec | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/grub2.spec b/grub2.spec index c44b2b2..941cf41 100644 --- a/grub2.spec +++ b/grub2.spec @@ -30,7 +30,6 @@ License: GPLv3+ URL: http://www.gnu.org/software/grub/ Obsoletes: grub < 1:0.98 Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz -Source2: grub.default Source3: README.Fedora Source4: http://unifoundry.com/unifont-5.1.20080820.pcf.gz Source5: theme.tar.bz2 @@ -240,8 +239,6 @@ mv $RPM_BUILD_ROOT%{_infodir}/grub-dev.info $RPM_BUILD_ROOT%{_infodir}/grub2-dev rm $RPM_BUILD_ROOT%{_infodir}/dir # Defaults -install -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/default/grub - mkdir ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig ln -sf %{_sysconfdir}/default/grub \ ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/grub @@ -328,7 +325,7 @@ fi %config %{_sysconfdir}/grub.d/??_* %{_sysconfdir}/grub.d/README %config(noreplace) %{_sysconfdir}/%{name}.cfg -%config(noreplace) %{_sysconfdir}/default/grub +%ghost %config(noreplace) %{_sysconfdir}/default/grub %{_sysconfdir}/sysconfig/grub %dir /boot/%{name} %ghost %config(noreplace) /boot/%{name}/grub.cfg From eca3847de2c667dfa4cec9012d959b08d8b23e73 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 10 May 2012 10:30:52 -0400 Subject: [PATCH 45/65] This can go too. --- grub.default | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 grub.default diff --git a/grub.default b/grub.default deleted file mode 100644 index 5b9f56a..0000000 --- a/grub.default +++ /dev/null @@ -1,8 +0,0 @@ -GRUB_TIMEOUT=5 -GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" -GRUB_DEFAULT=saved -# GRUB_TERMINAL="serial console" -# GRUB_SERIAL_COMMAND="serial --unit=0 --speed=9600" -GRUB_CMDLINE_LINUX="quiet rhgb" -GRUB_DISABLE_RECOVERY="true" -GRUB_THEME=/boot/grub2/themes/system/theme.txt From 8c81c575874abe8193a2ef6c71b47b7efe6b2bdc Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 10 May 2012 14:56:32 -0400 Subject: [PATCH 46/65] Comply with the license better for theme. (#820713) --- sources | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sources b/sources index d065bbf..47cfe9f 100644 --- a/sources +++ b/sources @@ -1,4 +1,3 @@ 8c28087c5fcb3188f1244b390efffdbe unifont-5.1.20080820.pcf.gz -df14bd3ee8942d1cc6942859eb6bcb14 theme.tar.bz2 be6c65c7d43991129b410942489c35ec grub-2.00~beta5.tar.xz -b3a7270fa115b7567ac8df878ef0ab19 theme.tar.bz2 +5e5c7bae1211f558e3c0a3011fef8609 theme.tar.bz2 From d2db31fb171af0b246e72a481e53d7be9942f810 Mon Sep 17 00:00:00 2001 From: "David W. Aquilina" Date: Thu, 10 May 2012 16:25:33 -0400 Subject: [PATCH 47/65] Fix IBM patches --- grub-1.99-Fix-tests-of-zeroed-partition.patch | 2 +- grub-2.00~beta4-add-support-for-PowerMac-HFS-partitions.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-1.99-Fix-tests-of-zeroed-partition.patch b/grub-1.99-Fix-tests-of-zeroed-partition.patch index a57711c..343c378 100644 --- a/grub-1.99-Fix-tests-of-zeroed-partition.patch +++ b/grub-1.99-Fix-tests-of-zeroed-partition.patch @@ -16,7 +16,7 @@ index 9c1d133..e8638af 100644 fi - if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" = ELF ] || [ $(cmp /dev/zero "${install_device}" &>/dev/null) ]; then -+ if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" != ELF ] && ( cmp -s -n $(blockdev --getsize64 ${install_device}) /dev/zero "${install_device}" &>/dev/null ); then ++ if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" = ELF ] || (cmp -s -n $(blockdev --getsize64 ${install_device}) /dev/zero "${install_device}"); then # Change boot device to the harddisk root boot_device="$ofpath" dd if="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" of="${install_device}" status=noxfer || { diff --git a/grub-2.00~beta4-add-support-for-PowerMac-HFS-partitions.patch b/grub-2.00~beta4-add-support-for-PowerMac-HFS-partitions.patch index 9ad7dde..4cad3e7 100644 --- a/grub-2.00~beta4-add-support-for-PowerMac-HFS-partitions.patch +++ b/grub-2.00~beta4-add-support-for-PowerMac-HFS-partitions.patch @@ -23,7 +23,7 @@ index 26be9d9..f1f9bae 100644 - fi - + if [ "$("${grub_probe}" -m "${device_map}" -d "${install_device}" -t msdos_parttype)" = "41" ]; then - if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" != ELF ] && ( cmp -s -n $(blockdev --getsize64 ${install_device}) /dev/zero "${install_device}" &>/dev/null ); then + if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" = ELF ] || (cmp -s -n $(blockdev --getsize64 ${install_device}) /dev/zero "${install_device}"); then - # Change boot device to the harddisk root - boot_device="$ofpath" - dd if="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" of="${install_device}" status=noxfer || { From bf52e4d95b0c1f76f8baebde02c02a7907fee2e2 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 10 May 2012 16:34:23 -0400 Subject: [PATCH 48/65] Move mads' sed to a patch so it doesn't clutter up the git diff. --- grub2-2.0-no-png-in-texi.patch | 25 +++++++++++++++++++++++++ grub2.spec | 4 +--- 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 grub2-2.0-no-png-in-texi.patch diff --git a/grub2-2.0-no-png-in-texi.patch b/grub2-2.0-no-png-in-texi.patch new file mode 100644 index 0000000..b8b6058 --- /dev/null +++ b/grub2-2.0-no-png-in-texi.patch @@ -0,0 +1,25 @@ +From e3c5e7e3accaced35b3e3ee367068d14bbce91bf Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 10 May 2012 16:31:29 -0400 +Subject: [PATCH] Specifying .png in @image doesn't work - leaving it out + +--- + docs/grub-dev.texi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/docs/grub-dev.texi b/docs/grub-dev.texi +index 51b4787..ddde5e9 100644 +--- a/docs/grub-dev.texi ++++ b/docs/grub-dev.texi +@@ -1689,7 +1689,7 @@ right edges of two adjacent glyphs. The @strong{device width} field determines + the effective leading value that is used to render the font. + + @end itemize +-@image{font_char_metrics,,,,.png} ++@image{font_char_metrics,,,,} + + An illustration of how the various font metrics apply to characters. + +-- +1.7.10.1 + diff --git a/grub2.spec b/grub2.spec index 941cf41..7131c1f 100644 --- a/grub2.spec +++ b/grub2.spec @@ -40,6 +40,7 @@ Patch3: grub2-handle-initramfs-on-xen.patch Patch4: grub-1.99-Fix-tests-of-zeroed-partition.patch Patch5: grub-1.99-ppc-terminfo.patch Patch7: grub-2.00~beta4-add-support-for-PowerMac-HFS-partitions.patch +Patch8: grub2-2.0-no-png-in-texi.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -109,9 +110,6 @@ git add . git commit -a -q -m "%{tarversion} baseline." git am %{patches} -# Specifying .png in @image doesn't work - leaving it out -sed -i 's,\.png,,g' docs/grub-dev.texi - %build %ifarch %{efi} cd grub-efi-%{tarversion} From 9f9108bc5c885392271cf0f3c7e2f391ac59c59a Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 10 May 2012 15:01:03 -0400 Subject: [PATCH 49/65] Update package to -0.27 --- grub2.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/grub2.spec b/grub2.spec index 7131c1f..1d1de44 100644 --- a/grub2.spec +++ b/grub2.spec @@ -22,7 +22,7 @@ Name: grub2 Epoch: 1 Version: 2.0 -Release: 0.26.beta5%{?dist} +Release: 0.27.beta5%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -388,6 +388,11 @@ fi %endif %changelog +* Thu May 10 2012 Peter Jones - 2.0-0.27.beta5 +- Fix license of theme (mizmo) + Resolves: rhbz#820713 +- Fix some unfiled IBM problem. + * Thu May 10 2012 Peter Jones - 2.0-0.26.beta5 - Update to beta5. - Update how efi building works (kiilerix) From 3e73e125cdeabba94f69923967ad450e6d8681ae Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 10 May 2012 18:05:33 -0400 Subject: [PATCH 50/65] Fix merge error on /etc/default/grub ownership, and add IBM bug number. --- grub2.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/grub2.spec b/grub2.spec index 1d1de44..c29c6f9 100644 --- a/grub2.spec +++ b/grub2.spec @@ -372,7 +372,7 @@ fi %config %{_sysconfdir}/grub.d/??_* %{_sysconfdir}/grub.d/README %config(noreplace) %{_sysconfdir}/grub2-efi.cfg -%config(noreplace) %{_sysconfdir}/default/grub +%ghost %config(noreplace) %{_sysconfdir}/default/grub %{_sysconfdir}/sysconfig/grub %ghost %config(noreplace) /boot/efi/EFI/redhat/grub2-efi/grub.cfg %doc grub-%{tarversion}/COPYING grub-%{tarversion}/INSTALL @@ -391,7 +391,8 @@ fi * Thu May 10 2012 Peter Jones - 2.0-0.27.beta5 - Fix license of theme (mizmo) Resolves: rhbz#820713 -- Fix some unfiled IBM problem. +- Fix some PPC bootloader detection IBM problem + Resolves: rhbz#820722 * Thu May 10 2012 Peter Jones - 2.0-0.26.beta5 - Update to beta5. From 56a8b5e0c588174b7e9126c1a23dfe32fa179cb1 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 10 May 2012 20:47:40 -0400 Subject: [PATCH 51/65] Fix build problem with removing /etc/default/grub --- grub2.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub2.spec b/grub2.spec index c29c6f9..deebae9 100644 --- a/grub2.spec +++ b/grub2.spec @@ -323,7 +323,7 @@ fi %config %{_sysconfdir}/grub.d/??_* %{_sysconfdir}/grub.d/README %config(noreplace) %{_sysconfdir}/%{name}.cfg -%ghost %config(noreplace) %{_sysconfdir}/default/grub +%attr(0644,root,root) %ghost %config(noreplace) %{_sysconfdir}/default/grub %{_sysconfdir}/sysconfig/grub %dir /boot/%{name} %ghost %config(noreplace) /boot/%{name}/grub.cfg @@ -372,7 +372,7 @@ fi %config %{_sysconfdir}/grub.d/??_* %{_sysconfdir}/grub.d/README %config(noreplace) %{_sysconfdir}/grub2-efi.cfg -%ghost %config(noreplace) %{_sysconfdir}/default/grub +%attr(0644,root,root) %ghost %config(noreplace) %{_sysconfdir}/default/grub %{_sysconfdir}/sysconfig/grub %ghost %config(noreplace) /boot/efi/EFI/redhat/grub2-efi/grub.cfg %doc grub-%{tarversion}/COPYING grub-%{tarversion}/INSTALL From ed858ec792ab8eb648bdd139613b2c5bf1a83208 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 14 May 2012 16:51:08 -0400 Subject: [PATCH 52/65] Fix module trampoline for ppc. --- grub-2.00-Fix-module-trampoline-for-ppc.patch | 120 ++++++++++++++++++ grub2.spec | 4 + 2 files changed, 124 insertions(+) create mode 100644 grub-2.00-Fix-module-trampoline-for-ppc.patch diff --git a/grub-2.00-Fix-module-trampoline-for-ppc.patch b/grub-2.00-Fix-module-trampoline-for-ppc.patch new file mode 100644 index 0000000..60cde3a --- /dev/null +++ b/grub-2.00-Fix-module-trampoline-for-ppc.patch @@ -0,0 +1,120 @@ +Return-Path: benh@au1.ibm.com +Received: from zmta03.collab.prod.int.phx2.redhat.com (LHLO + zmta03.collab.prod.int.phx2.redhat.com) (10.5.5.33) by + zmail14.collab.prod.int.phx2.redhat.com with LMTP; Sun, 13 May 2012 + 23:43:23 -0400 (EDT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by zmta03.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id A92D5F0BC1 + for ; Sun, 13 May 2012 23:43:23 -0400 (EDT) +Received: from zmta03.collab.prod.int.phx2.redhat.com ([127.0.0.1]) + by localhost (zmta03.collab.prod.int.phx2.redhat.com [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id KDt5yD-zSoXe for ; + Sun, 13 May 2012 23:43:23 -0400 (EDT) +Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) + by zmta03.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 951A2F0843 + for ; Sun, 13 May 2012 23:43:23 -0400 (EDT) +Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.17]) + by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q4E3hNWo019302 + for ; Sun, 13 May 2012 23:43:23 -0400 +Received: from bastion.fedoraproject.org (bastion02.phx2.fedoraproject.org [10.5.126.11]) + by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4E3hLtl006033 + for ; Sun, 13 May 2012 23:43:21 -0400 +Received: by bastion02.phx2.fedoraproject.org (Postfix) + id 1B8B34040D; Mon, 14 May 2012 03:43:21 +0000 (UTC) +Delivered-To: pjones@fedoraproject.org +Received: from mx2.redhat.com (ext-mx01.rdu.redhat.com [10.11.45.6]) + by bastion02.phx2.fedoraproject.org (Postfix) with ESMTP id AF73B402BC + for ; Mon, 14 May 2012 03:43:20 +0000 (UTC) +Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) + by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id q4E3h5JZ014320 + for ; Sun, 13 May 2012 23:43:11 -0400 +Received: from /spool/local + by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted + for from ; + Mon, 14 May 2012 03:37:12 +1000 +Received: from d23relay03.au.ibm.com (202.81.31.245) + by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; + Mon, 14 May 2012 03:37:09 +1000 +Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) + by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q4E3gcbg60358704 + for ; Mon, 14 May 2012 13:42:38 +1000 +Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) + by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q4E3gb1m003356 + for ; Mon, 14 May 2012 13:42:37 +1000 +Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.190.163.12]) + by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q4E3gbsI003349; + Mon, 14 May 2012 13:42:37 +1000 +Received: from [10.61.2.137] (haven.au.ibm.com [9.190.164.82]) + (using SSLv3 with cipher AES256-SHA (256/256 bits)) + (Client did not present a certificate) + by ozlabs.au.ibm.com (Postfix) with ESMTPSA id B60A073A09; + Mon, 14 May 2012 13:42:37 +1000 (EST) +Message-ID: <1336966957.6727.15.camel@pasglop> +Subject: [PATCH] grub: Fix module trampoline for powerpc +From: Benjamin Herrenschmidt +To: Brent Baude , pjones@fedoraproject.org +Cc: hamzy@us.ibm.com, Josh Boyer +Date: Mon, 14 May 2012 13:42:37 +1000 +Organization: IBM Australia +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: 7bit +Mime-Version: 1.0 +x-cbid: 12051317-7014-0000-0000-0000011BC8AA +X-RedHat-Spam-Score: -5.01 (RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD) +X-RedHat-Spam-Score: -5.011 (RCVD_IN_DNSWL_HI,SPF_PASS,T_RP_MATCHES_RCVD) +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 +X-Scanned-By: MIMEDefang 2.68 on 10.5.110.17 +X-Scanned-By: MIMEDefang 2.67 on 10.11.45.6 + +[ --- snip --- ] + +Not sure who to send that to, I picked Peter as he's in +the rpm log as author of the of the powerpc patches, +feel free to do whatever with that one, it should ultimately +go to upstream grub I suppose ... + +Without this, grub doesn't work for me at all with fc17 beta + +[ --- snip --- ] + +The trampoline generated by grub powerpc's dl.c to call from +modules into the main grub code uses r0 as a scratch register. + +However, nowadays, gcc can (and will) generate function calls +to spill registers to the stack (well, it's even stupid enough +to do it when there's only one register to save ! go figure....) + +Those calls happen during the function prolog, before the +return address has been saved on the stack, typically it's held +in r0 at this stage. Since those calls will hit the trampoline +in grub, which clobbers r0, this will clobber the return address +and cause a crash. + +This patch changes the trampolines to use r12 instead which +is safe to use in our case. + +Note: It might be better to actually link those low level gcc +support functions statically into the modules but that's beyond +the level of grub hacking I'm prepared to do today. + +Signed-off-by: Benjamin Herrenschmidt +--- +diff --git a/grub-core/kern/powerpc/dl.c b/grub-core/kern/powerpc/dl.c +index b8a2b50..0a8ec85 100644 +--- a/grub-core/kern/powerpc/dl.c ++++ b/grub-core/kern/powerpc/dl.c +@@ -89,9 +89,9 @@ struct trampoline + + static const struct trampoline trampoline_template = + { +- 0x3c000000, +- 0x60000000, +- 0x7c0903a6, ++ 0x3d800000, ++ 0x618c0000, ++ 0x7d8903a6, + 0x4e800420, + }; + + + diff --git a/grub2.spec b/grub2.spec index deebae9..0528d68 100644 --- a/grub2.spec +++ b/grub2.spec @@ -41,6 +41,7 @@ Patch4: grub-1.99-Fix-tests-of-zeroed-partition.patch Patch5: grub-1.99-ppc-terminfo.patch Patch7: grub-2.00~beta4-add-support-for-PowerMac-HFS-partitions.patch Patch8: grub2-2.0-no-png-in-texi.patch +Patch9: grub-2.00-Fix-module-trampoline-for-ppc.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -388,6 +389,9 @@ fi %endif %changelog +* Mon May 14 2012 Peter Jones - 2.0-0.27.beta5 +- Fix module trampolining on ppc (benh) + * Thu May 10 2012 Peter Jones - 2.0-0.27.beta5 - Fix license of theme (mizmo) Resolves: rhbz#820713 From cfda7223d2d7cb5cd3ce9ab9a7dc5d3c52a33793 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Mon, 21 May 2012 17:34:05 +0200 Subject: [PATCH 53/65] rename grub.efi to grub32.efi on x86 so it doesn't collide with x86_64 --- grub2.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/grub2.spec b/grub2.spec index 0528d68..e5887c5 100644 --- a/grub2.spec +++ b/grub2.spec @@ -131,10 +131,12 @@ cd grub-efi-%{tarversion} make %{?_smp_mflags} %ifarch %{ix86} %define grubefiarch i386-efi +%define grubefiname grub32.efi %else %define grubefiarch %{_arch}-efi +%define grubefiname grub.efi %endif -./grub-mkimage -O %{grubefiarch} -p /EFI/redhat/%{name}-efi -o grub.efi -d grub-core part_gpt hfsplus fat \ +./grub-mkimage -O %{grubefiarch} -p /EFI/redhat/%{name}-efi -o %{grubefiname} -d grub-core part_gpt hfsplus fat \ ext2 btrfs normal chain boot configfile linux appleldr minicmd \ loadbios reboot halt search font gfxterm echo video efi_gop efi_uga cd .. @@ -207,7 +209,7 @@ do TGT=$(echo $MODULE |sed "s,$RPM_BUILD_ROOT,.debugroot,") # install -m 755 -D $BASE$EXT $TGT done -install -m 755 grub.efi $RPM_BUILD_ROOT/boot/efi/EFI/redhat/%{name}-efi/grub.efi +install -m 755 %{grubefiname} $RPM_BUILD_ROOT/boot/efi/EFI/redhat/%{name}-efi/%{grubefiname} cd .. %endif From 6092ed7ab1084a508025438ae81b6e38133a6a3b Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Mon, 21 May 2012 17:34:06 +0200 Subject: [PATCH 54/65] use %{name} more - especially instead of grub2-efi This also changes the location of the pre-generated .efi --- grub2.spec | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/grub2.spec b/grub2.spec index e5887c5..0794b4f 100644 --- a/grub2.spec +++ b/grub2.spec @@ -125,7 +125,7 @@ cd grub-efi-%{tarversion} -e 's/-fasynchronous-unwind-tables//g' )" \ TARGET_LDFLAGS=-static \ --with-platform=efi \ - --with-grubdir=grub2 \ + --with-grubdir=%{name} \ --program-transform-name=s,grub,%{name}, \ --disable-werror make %{?_smp_mflags} @@ -136,7 +136,7 @@ make %{?_smp_mflags} %define grubefiarch %{_arch}-efi %define grubefiname grub.efi %endif -./grub-mkimage -O %{grubefiarch} -p /EFI/redhat/%{name}-efi -o %{grubefiname} -d grub-core part_gpt hfsplus fat \ +./grub-mkimage -O %{grubefiarch} -p /EFI/redhat/%{name} -o %{grubefiname} -d grub-core part_gpt hfsplus fat \ ext2 btrfs normal chain boot configfile linux appleldr minicmd \ loadbios reboot halt search font gfxterm echo video efi_gop efi_uga cd .. @@ -162,7 +162,7 @@ cd grub-%{tarversion} -e 's/-fasynchronous-unwind-tables//g' )" \ TARGET_LDFLAGS=-static \ --with-platform=%{platform} \ - --with-grubdir=grub2 \ + --with-grubdir=%{name} \ --program-transform-name=s,grub,%{name}, \ --disable-werror @@ -192,9 +192,9 @@ make DESTDIR=$RPM_BUILD_ROOT install # Ghost config file install -m 755 -d $RPM_BUILD_ROOT/boot/efi/EFI/redhat/ -install -d $RPM_BUILD_ROOT/boot/efi/EFI/redhat/%{name}-efi -touch $RPM_BUILD_ROOT/boot/efi/EFI/redhat/%{name}-efi/grub.cfg -ln -s ../boot/efi/EFI/redhat/%{name}-efi/grub.cfg $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-efi.cfg +install -d $RPM_BUILD_ROOT/boot/efi/EFI/redhat/%{name} +touch $RPM_BUILD_ROOT/boot/efi/EFI/redhat/%{name}/grub.cfg +ln -s ../boot/efi/EFI/redhat/%{name}/grub.cfg $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-efi.cfg # Install ELF files modules and images were created from into # the shadow root, where debuginfo generator will grab them from @@ -209,7 +209,7 @@ do TGT=$(echo $MODULE |sed "s,$RPM_BUILD_ROOT,.debugroot,") # install -m 755 -D $BASE$EXT $TGT done -install -m 755 %{grubefiname} $RPM_BUILD_ROOT/boot/efi/EFI/redhat/%{name}-efi/%{grubefiname} +install -m 755 %{grubefiname} $RPM_BUILD_ROOT/boot/efi/EFI/redhat/%{name}/%{grubefiname} cd .. %endif @@ -235,8 +235,8 @@ do # install -m 755 -D $BASE$EXT $TGT done -mv $RPM_BUILD_ROOT%{_infodir}/grub.info $RPM_BUILD_ROOT%{_infodir}/grub2.info -mv $RPM_BUILD_ROOT%{_infodir}/grub-dev.info $RPM_BUILD_ROOT%{_infodir}/grub2-dev.info +mv $RPM_BUILD_ROOT%{_infodir}/grub.info $RPM_BUILD_ROOT%{_infodir}/%{name}.info +mv $RPM_BUILD_ROOT%{_infodir}/grub-dev.info $RPM_BUILD_ROOT%{_infodir}/%{name}-dev.info rm $RPM_BUILD_ROOT%{_infodir}/dir # Defaults @@ -259,8 +259,8 @@ rm -rf $RPM_BUILD_ROOT %post if [ "$1" = 1 ]; then - /sbin/install-info --info-dir=%{_infodir} %{_infodir}/grub2.info.gz || : - /sbin/install-info --info-dir=%{_infodir} %{_infodir}/grub2-dev.info.gz || : + /sbin/install-info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz || : + /sbin/install-info --info-dir=%{_infodir} %{_infodir}/%{name}-dev.info.gz || : fi %triggerun -- grub2 < 1:1.99-4 @@ -290,8 +290,8 @@ rm -r /boot/grub2.tmp/ || : %preun if [ "$1" = 0 ]; then - /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/grub2.info.gz || : - /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/grub2-dev.info.gz || : + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz || : + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/%{name}-dev.info.gz || : fi %files -f grub.lang @@ -338,7 +338,7 @@ fi %doc grub-%{tarversion}/grub-dev.html grub-%{tarversion}/docs/font_char_metrics.png %doc grub-%{tarversion}/themes/starfield/COPYING.CC-BY-SA-3.0 %exclude %{_mandir} -%{_infodir}/grub2* +%{_infodir}/%{name}* /boot/grub2/themes/system %ifarch %{efi} @@ -374,10 +374,10 @@ fi %attr(0700,root,root) %dir %{_sysconfdir}/grub.d %config %{_sysconfdir}/grub.d/??_* %{_sysconfdir}/grub.d/README -%config(noreplace) %{_sysconfdir}/grub2-efi.cfg +%config(noreplace) %{_sysconfdir}/%{name}-efi.cfg %attr(0644,root,root) %ghost %config(noreplace) %{_sysconfdir}/default/grub %{_sysconfdir}/sysconfig/grub -%ghost %config(noreplace) /boot/efi/EFI/redhat/grub2-efi/grub.cfg +%ghost %config(noreplace) /boot/efi/EFI/redhat/%{name}/grub.cfg %doc grub-%{tarversion}/COPYING grub-%{tarversion}/INSTALL %doc grub-%{tarversion}/NEWS grub-%{tarversion}/README %doc grub-%{tarversion}/THANKS grub-%{tarversion}/TODO @@ -386,7 +386,7 @@ fi %doc grub-%{tarversion}/grub-dev.html grub-%{tarversion}/docs/font_char_metrics.png %doc grub-%{tarversion}/themes/starfield/COPYING.CC-BY-SA-3.0 %exclude %{_mandir} -%{_infodir}/grub2* +%{_infodir}/%{name}* /boot/grub2/themes/system %endif From 9ef0c08463fa5b14d564ca9b1edcea7ca8f7acbe Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Mon, 21 May 2012 17:34:06 +0200 Subject: [PATCH 55/65] move common files to -tools subpackage It seems like grub2 and grub2-efi (and whatever it is called on other platforms) really should be noarch ... --- grub2.spec | 97 ++++++++++++++++++++++-------------------------------- 1 file changed, 39 insertions(+), 58 deletions(-) diff --git a/grub2.spec b/grub2.spec index 0794b4f..5b10929 100644 --- a/grub2.spec +++ b/grub2.spec @@ -58,7 +58,7 @@ BuildRequires: freetype-devel gettext-devel git BuildRequires: texinfo BuildRequires: dejavu-sans-fonts -Requires: gettext os-prober which file system-logos +Requires: %{name}-tools = %{version}-%{release} Requires(pre): dracut Requires(post): dracut @@ -68,12 +68,14 @@ ExcludeArch: s390 s390x %description The GRand Unified Bootloader (GRUB) is a highly configurable and customizable bootloader with modular architecture. It support rich varietyof kernel formats, -file systems, computer architectures and hardware devices. +file systems, computer architectures and hardware devices. This subpackage +provides support for PC BIOS systems. %ifarch %{efi} %package efi Summary: GRUB for EFI systems. Group: System Environment/Base +Requires: %{name}-tools = %{version}-%{release} %description efi The GRand Unified Bootloader (GRUB) is a highly configurable and customizable @@ -82,6 +84,17 @@ file systems, computer architectures and hardware devices. This subpackage provides support for EFI systems. %endif +%package tools +Summary: Support tools for GRUB. +Group: System Environment/Base +Requires: gettext os-prober which file system-logos + +%description tools +The GRand Unified Bootloader (GRUB) is a highly configurable and customizable +bootloader with modular architecture. It support rich varietyof kernel formats, +file systems, computer architectures and hardware devices. This subpackage +provides tools for support of all platforms. + %prep %setup -T -c -n grub-%{tarversion} %ifarch %{efi} @@ -240,6 +253,8 @@ mv $RPM_BUILD_ROOT%{_infodir}/grub-dev.info $RPM_BUILD_ROOT%{_infodir}/%{name}-d rm $RPM_BUILD_ROOT%{_infodir}/dir # Defaults +mkdir %{_sysconfdir}/default +touch %{_sysconfdir}/default/grub mkdir ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig ln -sf %{_sysconfdir}/default/grub \ ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/grub @@ -294,10 +309,26 @@ if [ "$1" = 0 ]; then /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/%{name}-dev.info.gz || : fi -%files -f grub.lang +%files %defattr(-,root,root,-) -/etc/bash_completion.d/grub %{_libdir}/grub/*-%{platform}/ +%config(noreplace) %{_sysconfdir}/%{name}.cfg +%ghost %config(noreplace) /boot/%{name}/grub.cfg +%doc grub-%{tarversion}/COPYING + +%ifarch %{efi} +%files efi +%defattr(-,root,root,-) +%{_libdir}/grub/%{grubefiarch} +%config(noreplace) %{_sysconfdir}/%{name}-efi.cfg +%attr(0755,root,root)/boot/efi/EFI/redhat +%ghost %config(noreplace) /boot/efi/EFI/redhat/%{name}/grub.cfg +%doc grub-%{tarversion}/COPYING +%endif + +%files tools -f grub.lang +%defattr(-,root,root,-) +%dir %{_libdir}/grub/ %{_datarootdir}/grub/ %{_sbindir}/%{name}-mkconfig %{_sbindir}/%{name}-mknetdir @@ -322,14 +353,16 @@ fi %{_bindir}/%{name}-mkrescue %endif %{_bindir}/%{name}-script-check +%{_sysconfdir}/bash_completion.d/grub %attr(0700,root,root) %dir %{_sysconfdir}/grub.d %config %{_sysconfdir}/grub.d/??_* %{_sysconfdir}/grub.d/README -%config(noreplace) %{_sysconfdir}/%{name}.cfg %attr(0644,root,root) %ghost %config(noreplace) %{_sysconfdir}/default/grub %{_sysconfdir}/sysconfig/grub %dir /boot/%{name} -%ghost %config(noreplace) /boot/%{name}/grub.cfg +/boot/%{name}/themes/ +%{_infodir}/%{name}* +%exclude %{_mandir} %doc grub-%{tarversion}/COPYING grub-%{tarversion}/INSTALL %doc grub-%{tarversion}/NEWS grub-%{tarversion}/README %doc grub-%{tarversion}/THANKS grub-%{tarversion}/TODO @@ -337,58 +370,6 @@ fi %doc grub-%{tarversion}/grub.html %doc grub-%{tarversion}/grub-dev.html grub-%{tarversion}/docs/font_char_metrics.png %doc grub-%{tarversion}/themes/starfield/COPYING.CC-BY-SA-3.0 -%exclude %{_mandir} -%{_infodir}/%{name}* -/boot/grub2/themes/system - -%ifarch %{efi} -%files efi -f grub.lang -%defattr(-,root,root,-) -%attr(0755,root,root)/boot/efi/EFI/redhat -/etc/bash_completion.d/grub -%{_libdir}/grub/%{grubefiarch} -%{_datarootdir}/grub/ -%{_sbindir}/%{name}-mkconfig -%{_sbindir}/%{name}-mknetdir -%{_sbindir}/%{name}-install -%{_sbindir}/%{name}-probe -%{_sbindir}/%{name}-reboot -%{_sbindir}/%{name}-set-default -%{_sbindir}/%{name}-bios-setup -%{_sbindir}/%{name}-ofpathname -%{_sbindir}/%{name}-sparc64-setup -%{_bindir}/%{name}-mkstandalone -%{_bindir}/%{name}-editenv -%{_bindir}/%{name}-fstest -%{_bindir}/%{name}-kbdcomp -%{_bindir}/%{name}-menulst2cfg -%{_bindir}/%{name}-mkfont -%{_bindir}/%{name}-mklayout -%{_bindir}/%{name}-mkimage -%{_bindir}/%{name}-mkpasswd-pbkdf2 -%{_bindir}/%{name}-mkrelpath -%ifnarch %{sparc} -%{_bindir}/%{name}-mkrescue -%endif -%{_bindir}/%{name}-script-check -%attr(0700,root,root) %dir %{_sysconfdir}/grub.d -%config %{_sysconfdir}/grub.d/??_* -%{_sysconfdir}/grub.d/README -%config(noreplace) %{_sysconfdir}/%{name}-efi.cfg -%attr(0644,root,root) %ghost %config(noreplace) %{_sysconfdir}/default/grub -%{_sysconfdir}/sysconfig/grub -%ghost %config(noreplace) /boot/efi/EFI/redhat/%{name}/grub.cfg -%doc grub-%{tarversion}/COPYING grub-%{tarversion}/INSTALL -%doc grub-%{tarversion}/NEWS grub-%{tarversion}/README -%doc grub-%{tarversion}/THANKS grub-%{tarversion}/TODO -%doc grub-%{tarversion}/ChangeLog grub-%{tarversion}/README.Fedora -%doc grub-%{tarversion}/grub.html -%doc grub-%{tarversion}/grub-dev.html grub-%{tarversion}/docs/font_char_metrics.png -%doc grub-%{tarversion}/themes/starfield/COPYING.CC-BY-SA-3.0 -%exclude %{_mandir} -%{_infodir}/%{name}* -/boot/grub2/themes/system -%endif %changelog * Mon May 14 2012 Peter Jones - 2.0-0.27.beta5 From 8d4efa50a4e3b7c2660ccc5bd30aab0bfe61511b Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 21 May 2012 14:57:29 -0400 Subject: [PATCH 56/65] Name grub.efi something that's arch-appropriate (kiilerix, pjones) - use EFI/$SOMETHING_DISTRO_BASED/ not always EFI/redhat/grub2-efi/ . - move common stuff to -tools (kiilerix) - spec file cleanups (kiilerix) --- grub2.spec | 52 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/grub2.spec b/grub2.spec index 5b10929..1640cfd 100644 --- a/grub2.spec +++ b/grub2.spec @@ -12,9 +12,26 @@ %endif %if ! 0%{?efi} + %global efi %{ix86} x86_64 ia64 + +%ifarch %{ix86} +%global grubefiarch i386-efi +%global grubefiname grubia32.efi +%endif +%ifarch x86_64 +%global grubefiarch %{_arch}-efi +%global grubefiname grubx64.efi %endif +%if 0%{?rhel} +%global efidir redhat +%endif +%if 0%{?fedora} +%global efidir fedora +%endif + +%endif %global tarversion 2.00~beta5 %undefine _missing_build_ids_terminate_build @@ -22,7 +39,7 @@ Name: grub2 Epoch: 1 Version: 2.0 -Release: 0.27.beta5%{?dist} +Release: 0.28.beta5%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -142,14 +159,8 @@ cd grub-efi-%{tarversion} --program-transform-name=s,grub,%{name}, \ --disable-werror make %{?_smp_mflags} -%ifarch %{ix86} -%define grubefiarch i386-efi -%define grubefiname grub32.efi -%else -%define grubefiarch %{_arch}-efi -%define grubefiname grub.efi -%endif -./grub-mkimage -O %{grubefiarch} -p /EFI/redhat/%{name} -o %{grubefiname} -d grub-core part_gpt hfsplus fat \ +./grub-mkimage -O %{grubefiarch} -p /EFI/%{efidir} -o %{grubefiname} \ + -d grub-core part_gpt hfsplus fat \ ext2 btrfs normal chain boot configfile linux appleldr minicmd \ loadbios reboot halt search font gfxterm echo video efi_gop efi_uga cd .. @@ -204,10 +215,9 @@ cd grub-efi-%{tarversion} make DESTDIR=$RPM_BUILD_ROOT install # Ghost config file -install -m 755 -d $RPM_BUILD_ROOT/boot/efi/EFI/redhat/ -install -d $RPM_BUILD_ROOT/boot/efi/EFI/redhat/%{name} -touch $RPM_BUILD_ROOT/boot/efi/EFI/redhat/%{name}/grub.cfg -ln -s ../boot/efi/EFI/redhat/%{name}/grub.cfg $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-efi.cfg +install -m 755 -d $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/ +touch $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/grub.cfg +ln -s ../boot/efi/EFI/%{efidir}/grub.cfg $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-efi.cfg # Install ELF files modules and images were created from into # the shadow root, where debuginfo generator will grab them from @@ -222,7 +232,7 @@ do TGT=$(echo $MODULE |sed "s,$RPM_BUILD_ROOT,.debugroot,") # install -m 755 -D $BASE$EXT $TGT done -install -m 755 %{grubefiname} $RPM_BUILD_ROOT/boot/efi/EFI/redhat/%{name}/%{grubefiname} +install -m 755 %{grubefiname} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{grubefiname} cd .. %endif @@ -253,8 +263,8 @@ mv $RPM_BUILD_ROOT%{_infodir}/grub-dev.info $RPM_BUILD_ROOT%{_infodir}/%{name}-d rm $RPM_BUILD_ROOT%{_infodir}/dir # Defaults -mkdir %{_sysconfdir}/default -touch %{_sysconfdir}/default/grub +mkdir ${RPM_BUILD_ROOT}%{_sysconfdir}/default +touch ${RPM_BUILD_ROOT}%{_sysconfdir}/default/grub mkdir ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig ln -sf %{_sysconfdir}/default/grub \ ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/grub @@ -321,8 +331,8 @@ fi %defattr(-,root,root,-) %{_libdir}/grub/%{grubefiarch} %config(noreplace) %{_sysconfdir}/%{name}-efi.cfg -%attr(0755,root,root)/boot/efi/EFI/redhat -%ghost %config(noreplace) /boot/efi/EFI/redhat/%{name}/grub.cfg +%attr(0755,root,root)/boot/efi/EFI/%{efidir} +%ghost %config(noreplace) /boot/efi/EFI/%{efidir}/grub.cfg %doc grub-%{tarversion}/COPYING %endif @@ -372,6 +382,12 @@ fi %doc grub-%{tarversion}/themes/starfield/COPYING.CC-BY-SA-3.0 %changelog +* Mon May 21 2012 Peter Jones - 2.0-0.28.beta5 +- Name grub.efi something that's arch-appropriate (kiilerix, pjones) +- use EFI/$SOMETHING_DISTRO_BASED/ not always EFI/redhat/grub2-efi/ . +- move common stuff to -tools (kiilerix) +- spec file cleanups (kiilerix) + * Mon May 14 2012 Peter Jones - 2.0-0.27.beta5 - Fix module trampolining on ppc (benh) From 939f59000f0bf7f30cb48c767352c5db991d5a44 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Mon, 21 May 2012 15:19:24 -0400 Subject: [PATCH 57/65] Make grub look for its config file on efi where the app was found. --- grub-2.00-add-fw_path-search.patch | 78 ++++++++++++++++++++++++++++++ grub2.spec | 9 ++-- 2 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 grub-2.00-add-fw_path-search.patch diff --git a/grub-2.00-add-fw_path-search.patch b/grub-2.00-add-fw_path-search.patch new file mode 100644 index 0000000..9fa6069 --- /dev/null +++ b/grub-2.00-add-fw_path-search.patch @@ -0,0 +1,78 @@ +From d829d54d0f461c7bc6a7d8bd549cfdacfac51082 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Mon, 21 May 2012 14:36:39 -0400 +Subject: [PATCH] Add fw_path variable + +--- + grub-core/kern/main.c | 16 ++++++++++++++-- + grub-core/normal/main.c | 20 +++++++++++++++++++- + 2 files changed, 33 insertions(+), 3 deletions(-) + +diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c +index 185230c..26481c6 100644 +--- a/grub-core/kern/main.c ++++ b/grub-core/kern/main.c +@@ -114,6 +114,20 @@ grub_set_prefix_and_root (void) + + grub_register_variable_hook ("root", 0, grub_env_write_root); + ++ grub_machine_get_bootlocation (&fwdevice, &fwpath); ++ ++ if (fwdevice && fwpath) ++ { ++ char *fw_path; ++ ++ fw_path = grub_xasprintf ("(%s)%s", fwdevice, fwpath); ++ if (fw_path) ++ { ++ grub_env_set ("fw_path", fw_path); ++ grub_free (fw_path); ++ } ++ } ++ + if (prefix) + { + char *pptr = NULL; +@@ -131,8 +145,6 @@ grub_set_prefix_and_root (void) + if (pptr[0]) + path = grub_strdup (pptr); + } +- if ((!device || device[0] == ',' || !device[0]) || !path) +- grub_machine_get_bootlocation (&fwdevice, &fwpath); + + if (!device && fwdevice) + device = fwdevice; +diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c +index 1963fe4..64c2a9f 100644 +--- a/grub-core/normal/main.c ++++ b/grub-core/normal/main.c +@@ -309,7 +309,25 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), + /* Guess the config filename. It is necessary to make CONFIG static, + so that it won't get broken by longjmp. */ + char *config; +- const char *prefix; ++ const char *prefix, *fw_path; ++ ++ fw_path = grub_env_get ("fw_path"); ++ if (fw_path) ++ { ++ config = grub_xasprintf ("%s/grub.cfg", fw_path); ++ if (config) ++ { ++ grub_file_t file; ++ ++ file = grub_file_open (config); ++ if (file) ++ { ++ grub_file_close (file); ++ grub_enter_normal_mode (config); ++ } ++ grub_free (config); ++ } ++ } + + prefix = grub_env_get ("prefix"); + if (prefix) +-- +1.7.10.2 + diff --git a/grub2.spec b/grub2.spec index 1640cfd..8da7afc 100644 --- a/grub2.spec +++ b/grub2.spec @@ -59,6 +59,7 @@ Patch5: grub-1.99-ppc-terminfo.patch Patch7: grub-2.00~beta4-add-support-for-PowerMac-HFS-partitions.patch Patch8: grub2-2.0-no-png-in-texi.patch Patch9: grub-2.00-Fix-module-trampoline-for-ppc.patch +Patch10: grub-2.00-add-fw_path-search.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -159,10 +160,10 @@ cd grub-efi-%{tarversion} --program-transform-name=s,grub,%{name}, \ --disable-werror make %{?_smp_mflags} -./grub-mkimage -O %{grubefiarch} -p /EFI/%{efidir} -o %{grubefiname} \ - -d grub-core part_gpt hfsplus fat \ - ext2 btrfs normal chain boot configfile linux appleldr minicmd \ - loadbios reboot halt search font gfxterm echo video efi_gop efi_uga +./grub-mkimage -O %{grubefiarch} -o %{grubefiname} -d grub-core \ + part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux \ + minicmd reboot halt search font gfxterm echo video efi_gop efi_uga \ + test gfxmenu png cd .. %endif From efff1af3f2ba4514cb4a5ea6b501ee74592b8ca5 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 21 May 2012 16:02:42 -0400 Subject: [PATCH 58/65] Fix grub2-tools requires to include epoch, so it'll work. --- grub2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub2.spec b/grub2.spec index 8da7afc..fd0542b 100644 --- a/grub2.spec +++ b/grub2.spec @@ -93,7 +93,7 @@ provides support for PC BIOS systems. %package efi Summary: GRUB for EFI systems. Group: System Environment/Base -Requires: %{name}-tools = %{version}-%{release} +Requires: %{name}-tools = %{epoch}:%{version}-%{release} %description efi The GRand Unified Bootloader (GRUB) is a highly configurable and customizable From bc70a6617c426dddf75e902096ea7061b3e91e8e Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 21 May 2012 16:29:26 -0400 Subject: [PATCH 59/65] Fix missing / --- grub-2.00-add-fw_path-search.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-2.00-add-fw_path-search.patch b/grub-2.00-add-fw_path-search.patch index 9fa6069..367415e 100644 --- a/grub-2.00-add-fw_path-search.patch +++ b/grub-2.00-add-fw_path-search.patch @@ -22,7 +22,7 @@ index 185230c..26481c6 100644 + { + char *fw_path; + -+ fw_path = grub_xasprintf ("(%s)%s", fwdevice, fwpath); ++ fw_path = grub_xasprintf ("(%s)/%s", fwdevice, fwpath); + if (fw_path) + { + grub_env_set ("fw_path", fw_path); From c10845e1547fe4e8dc8f861e731a35dfa1a64241 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 21 May 2012 16:37:32 -0400 Subject: [PATCH 60/65] Get rid of efi_uga and efi_gop, favoring all_video instead. --- grub2.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/grub2.spec b/grub2.spec index fd0542b..ad88891 100644 --- a/grub2.spec +++ b/grub2.spec @@ -39,7 +39,7 @@ Name: grub2 Epoch: 1 Version: 2.0 -Release: 0.28.beta5%{?dist} +Release: 0.29.beta5%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -162,7 +162,7 @@ cd grub-efi-%{tarversion} make %{?_smp_mflags} ./grub-mkimage -O %{grubefiarch} -o %{grubefiname} -d grub-core \ part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux \ - minicmd reboot halt search font gfxterm echo video efi_gop efi_uga \ + minicmd reboot halt search font gfxterm echo video all_video \ test gfxmenu png cd .. %endif @@ -383,6 +383,9 @@ fi %doc grub-%{tarversion}/themes/starfield/COPYING.CC-BY-SA-3.0 %changelog +* Mon May 21 2012 Peter Jones - 2.0-0.29.beta5 +- Get rid of efi_uga and efi_gop, favoring all_video instead. + * Mon May 21 2012 Peter Jones - 2.0-0.28.beta5 - Name grub.efi something that's arch-appropriate (kiilerix, pjones) - use EFI/$SOMETHING_DISTRO_BASED/ not always EFI/redhat/grub2-efi/ . From 8273501f65e94615948b8ddfc1a2e858d12a7b37 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 22 May 2012 11:40:48 -0400 Subject: [PATCH 61/65] Fix the /other/ grub2-tools require to include epoch. --- grub2.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/grub2.spec b/grub2.spec index ad88891..f17cda1 100644 --- a/grub2.spec +++ b/grub2.spec @@ -39,7 +39,7 @@ Name: grub2 Epoch: 1 Version: 2.0 -Release: 0.29.beta5%{?dist} +Release: 0.30.beta5%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -76,7 +76,7 @@ BuildRequires: freetype-devel gettext-devel git BuildRequires: texinfo BuildRequires: dejavu-sans-fonts -Requires: %{name}-tools = %{version}-%{release} +Requires: %{name}-tools = %{epoch}:%{version}-%{release} Requires(pre): dracut Requires(post): dracut @@ -383,6 +383,9 @@ fi %doc grub-%{tarversion}/themes/starfield/COPYING.CC-BY-SA-3.0 %changelog +* Tue May 22 2012 Peter Jones - 2.0-0.30.beta5 +- Fix the /other/ grub2-tools require to include epoch. + * Mon May 21 2012 Peter Jones - 2.0-0.29.beta5 - Get rid of efi_uga and efi_gop, favoring all_video instead. From 673064d5364b10e3d797685b0b014ff28ac86054 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 26 Apr 2012 14:18:21 -0400 Subject: [PATCH 62/65] Don't even say linux, actually. Resolves: rhbz#808180 --- grub-1.99-just-say-linux.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grub-1.99-just-say-linux.patch b/grub-1.99-just-say-linux.patch index 98ab2b7..62a6b32 100644 --- a/grub-1.99-just-say-linux.patch +++ b/grub-1.99-just-say-linux.patch @@ -17,10 +17,10 @@ index a09c3e6..0b0df78 100644 if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then - OS=GNU/Linux -+ OS="$(sed 's, release .*$,,g' /etc/system-release) Linux" ++ OS="$(sed 's, release .*$,,g' /etc/system-release)" else - OS="${GRUB_DISTRIBUTOR} GNU/Linux" -+ OS="${GRUB_DISTRIBUTOR} Linux" ++ OS="${GRUB_DISTRIBUTOR}" CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}" fi @@ -33,10 +33,10 @@ index ee49cd9..10422b0 100644 if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then - OS=GNU/Linux -+ OS="$(sed 's, release .*$,,g' /etc/system-release) Linux" ++ OS="$(sed 's, release .*$,,g' /etc/system-release)" else - OS="${GRUB_DISTRIBUTOR} GNU/Linux" -+ OS="${GRUB_DISTRIBUTOR} Linux" ++ OS="${GRUB_DISTRIBUTOR}" CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}" fi From a4d61ac7d23de8551ba92496dcfcaaf350862f10 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 25 May 2012 13:37:22 -0400 Subject: [PATCH 63/65] Add a patch to implement check_completed_boot --- grub-2.00-Add-check_completed_boot.patch | 161 +++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 grub-2.00-Add-check_completed_boot.patch diff --git a/grub-2.00-Add-check_completed_boot.patch b/grub-2.00-Add-check_completed_boot.patch new file mode 100644 index 0000000..f7f0f8f --- /dev/null +++ b/grub-2.00-Add-check_completed_boot.patch @@ -0,0 +1,161 @@ +From 7b886580f92bf6b766b042b6ef46cb77a5ba7451 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Fri, 25 May 2012 10:49:06 -0400 +Subject: [PATCH] Add check_completed_boot command on EFI systems. + +check_completed_boot [] + +checks for a 1-byte integer in an EFI variable guid:CompletedBoot and sets +a command-line specified timeout, with a default of 30s, if the variable is +not equal to 1. This can be used to enter the grub menus in the event that +your OS did not correctly boot on the previous boot. It also unconditionally +sets the value to 0. +--- + grub-core/Makefile.core.def | 6 ++ + grub-core/commands/efi/eficompleted.c | 117 +++++++++++++++++++++++++++++++++ + 2 files changed, 123 insertions(+) + create mode 100644 grub-core/commands/efi/eficompleted.c + +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index d0c06d5..0a21838 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -582,6 +582,12 @@ module = { + }; + + module = { ++ name = eficompleted; ++ efi = commands/efi/eficompleted.c; ++ enable = efi; ++}; ++ ++module = { + name = blocklist; + common = commands/blocklist.c; + }; +diff --git a/grub-core/commands/efi/eficompleted.c b/grub-core/commands/efi/eficompleted.c +new file mode 100644 +index 0000000..77a856a +--- /dev/null ++++ b/grub-core/commands/efi/eficompleted.c +@@ -0,0 +1,117 @@ ++/* completed.c - Check if previous boot was successful. */ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2012 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 ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++GRUB_MOD_LICENSE ("GPLv3+"); ++ ++static grub_err_t ++grub_efi_parse_guid(char *arg, grub_efi_guid_t *outguid) ++{ ++ grub_err_t status = GRUB_ERR_NONE; ++ grub_efi_guid_t guid; ++ char *s = arg; ++ grub_uint64_t guidcomp; ++ int i; ++ ++ guid.data1 = grub_cpu_to_le32 (grub_strtoul(s, &s, 16)); ++ if (*s != '-') ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid guid `%s'", arg); ++ s++; ++ ++ guid.data2 = grub_cpu_to_le16 (grub_strtoul(s, &s, 16)); ++ if (*s != '-') ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid guid `%s'", arg); ++ s++; ++ ++ guid.data2 = grub_cpu_to_le16 (grub_strtoul(s, &s, 16)); ++ if (*s != '-') ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid guid `%s'", arg); ++ s++; ++ ++ guidcomp = grub_strtoull (s, 0, 16); ++ for (i = 0; i < 8; i++) ++ guid.data4[i] = (guidcomp >> (56 - 8 * i)) & 0xff; ++ ++ grub_memcpy(outguid, &guid, sizeof (*outguid)); ++ return GRUB_ERR_NONE; ++} ++ ++static grub_err_t ++grub_cmd_completed (grub_command_t cmd __attribute__ ((unused)), ++ int argc __attribute__ ((unused)), ++ char **args __attribute__ ((unused))) ++{ ++ grub_efi_uint8_t *old_completed_boot; ++ grub_efi_uint8_t completed_boot = 0; ++ unsigned long timeout = 30; ++ grub_efi_guid_t guid; ++ grub_err_t status; ++ grub_size_t cb_size; ++ ++ if (argc < 2) ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, "too few arguments"); ++ ++ if (argc > 3) ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, "too many arguments"); ++ ++ status = grub_efi_parse_guid(args[1], &guid); ++ if (status != GRUB_ERR_NONE) ++ return status; ++ ++ if (argc > 2) ++ { ++ char *s = args[2]; ++ timeout = grub_strtoul(s, &s, 0); ++ if (grub_errno != GRUB_ERR_NONE) ++ return grub_errno; ++ } ++ ++ old_completed_boot = grub_efi_get_variable("CompletedBoot", &guid, &cb_size); ++ status = grub_efi_set_variable("CompletedBoot", &guid, &completed_boot, ++ sizeof (completed_boot)); ++ ++ if (old_completed_boot == NULL) ++ { ++ /* We assume this means it's our first boot after installation. */ ++ return GRUB_ERR_NONE; ++ } ++ ++ if (cb_size != sizeof(*old_completed_boot) || *old_completed_boot != 1) ++ grub_env_set("timeout", timeout); ++ ++ return GRUB_ERR_NONE; ++} ++ ++static grub_command_t cmd = NULL; ++ ++GRUB_MOD_INIT(eficompleted) ++{ ++ cmd = grub_register_command("check_completed_boot", grub_cmd_completed, "", ++ "Check if the last boot completed successfully."); ++} ++ ++GRUB_MOD_FINI(eficompleted) ++{ ++ grub_unregister_command (cmd); ++} +-- +1.7.10.1 + From aa709fb61db8d9bbf740e437901a34db3c053944 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 25 May 2012 14:30:50 -0400 Subject: [PATCH 64/65] Add fwsetup. --- grub-2.00-Add-fwsetup.patch | 218 ++++++++++++++++++++++++++++++++++++ grub2.spec | 4 +- 2 files changed, 221 insertions(+), 1 deletion(-) create mode 100644 grub-2.00-Add-fwsetup.patch diff --git a/grub-2.00-Add-fwsetup.patch b/grub-2.00-Add-fwsetup.patch new file mode 100644 index 0000000..b564b29 --- /dev/null +++ b/grub-2.00-Add-fwsetup.patch @@ -0,0 +1,218 @@ +From 2c7cdc59a8d6cb7800c73b90aa75cc8b21807af6 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 24 May 2012 08:37:21 -0400 +Subject: [PATCH] Add support for entering the firmware setup screen. + +This adds a command "fwsetup", with which you can enter your firmware +setup screen. The mechanism is to set a global UEFI variable with a +specific value and reboot. +--- + ChangeLog | 8 ++++ + grub-core/Makefile.core.def | 6 +++ + grub-core/commands/efi/efifwsetup.c | 88 +++++++++++++++++++++++++++++++++++ + grub-core/kern/efi/efi.c | 30 ++++++++++++ + include/grub/efi/api.h | 2 + + include/grub/efi/efi.h | 5 ++ + 6 files changed, 139 insertions(+) + create mode 100644 grub-core/commands/efi/efifwsetup.c + +diff --git a/ChangeLog b/ChangeLog +index ce52576..29ebcbd 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,11 @@ ++2012-05-24 Peter Jones ++ ++ * grub-core/Makefile.core.def: add efifwsetup module ++ * grub-core/commands/efi/efifwsetup.c: add code for fwsetup command ++ * grub-core/kern/efi/efi.c (grub_efi_set_variable): New function ++ * include/grub/efi/api.h: add define for OsIndications variable ++ * include/grub/efi/efi.h: export grub_efi_set_variable ++ + 2012-04-18 Vladimir Serbinenko + + * configure.ac: Bump to beta5. +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 000cf0d..d0c06d5 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -576,6 +576,12 @@ module = { + }; + + module = { ++ name = efifwsetup; ++ efi = commands/efi/efifwsetup.c; ++ enable = efi; ++}; ++ ++module = { + name = blocklist; + common = commands/blocklist.c; + }; +diff --git a/grub-core/commands/efi/efifwsetup.c b/grub-core/commands/efi/efifwsetup.c +new file mode 100644 +index 0000000..756a14c +--- /dev/null ++++ b/grub-core/commands/efi/efifwsetup.c +@@ -0,0 +1,88 @@ ++/* fwsetup.c - Reboot into firmware setup menu. */ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2012 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 ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++GRUB_MOD_LICENSE ("GPLv3+"); ++ ++static grub_err_t ++grub_cmd_fwsetup (grub_command_t cmd __attribute__ ((unused)), ++ int argc __attribute__ ((unused)), ++ char **args __attribute__ ((unused))) ++{ ++ grub_efi_uint64_t *old_os_indications; ++ grub_efi_uint64_t os_indications = GRUB_EFI_OS_INDICATIONS_BOOT_TO_FW_UI; ++ grub_err_t status; ++ grub_size_t oi_size; ++ grub_efi_guid_t global = GRUB_EFI_GLOBAL_VARIABLE_GUID; ++ ++ old_os_indications = grub_efi_get_variable("OsIndications", &global, ++ &oi_size); ++ ++ if (old_os_indications != NULL && oi_size == sizeof(*old_os_indications)) ++ os_indications |= *old_os_indications; ++ ++ status = grub_efi_set_variable("OsIndications", &global, &os_indications, ++ sizeof (os_indications)); ++ if (status != GRUB_ERR_NONE) ++ return status; ++ ++ grub_reboot(); ++ ++ return GRUB_ERR_BUG; ++} ++ ++static grub_command_t cmd = NULL; ++ ++static grub_efi_boolean_t ++efifwsetup_is_supported(void) ++{ ++ grub_efi_uint64_t *os_indications_supported = NULL; ++ grub_size_t oi_size = 0; ++ grub_efi_guid_t global = GRUB_EFI_GLOBAL_VARIABLE_GUID; ++ ++ os_indications_supported = grub_efi_get_variable("OsIndicationsSupported", ++ &global, &oi_size); ++ ++ if (!os_indications_supported) ++ return 0; ++ ++ if (*os_indications_supported & GRUB_EFI_OS_INDICATIONS_BOOT_TO_FW_UI) ++ return 1; ++ ++ return 0; ++} ++ ++GRUB_MOD_INIT(efifwsetup) ++{ ++ if (efifwsetup_is_supported()) ++ cmd = grub_register_command("fwsetup", grub_cmd_fwsetup, "", ++ "Reboot into firmware setup menu."); ++ ++} ++ ++GRUB_MOD_FINI(efifwsetup) ++{ ++ if (cmd) ++ grub_unregister_command (cmd); ++} +diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c +index 6f12c76..7a418a6 100644 +--- a/grub-core/kern/efi/efi.c ++++ b/grub-core/kern/efi/efi.c +@@ -230,6 +230,36 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid, + return NULL; + } + ++grub_err_t ++grub_efi_set_variable(const char *var, const grub_efi_guid_t *guid, ++ void *data, grub_size_t datasize) ++{ ++ grub_efi_status_t status; ++ grub_efi_runtime_services_t *r; ++ grub_efi_char16_t *var16; ++ grub_size_t len, len16; ++ ++ len = grub_strlen (var); ++ len16 = len * GRUB_MAX_UTF16_PER_UTF8; ++ var16 = grub_malloc ((len16 + 1) * sizeof (var16[0])); ++ if (!var16) ++ return grub_errno; ++ len16 = grub_utf8_to_utf16 (var16, len16, (grub_uint8_t *) var, len, NULL); ++ var16[len16] = 0; ++ ++ r = grub_efi_system_table->runtime_services; ++ ++ grub_efi_uint32_t attributes = GRUB_EFI_VARIABLE_NON_VOLATILE | ++ GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS | ++ GRUB_EFI_VARIABLE_RUNTIME_ACCESS; ++ ++ status = efi_call_5 (r->set_variable, var16, guid, attributes, datasize,data); ++ if (status == GRUB_EFI_SUCCESS) ++ return GRUB_ERR_NONE; ++ ++ return grub_error (GRUB_ERR_IO, "could not set EFI variable `%s'", var); ++} ++ + grub_uint64_t + grub_rtc_get_time_ms (void) + { +diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h +index 26127de..a47a4e3 100644 +--- a/include/grub/efi/api.h ++++ b/include/grub/efi/api.h +@@ -58,6 +58,8 @@ + #define GRUB_EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010 + #define GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE 0x00000020 + ++#define GRUB_EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001ULL ++ + #define GRUB_EFI_VARIABLE_NON_VOLATILE 0x0000000000000001 + #define GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000000000002 + #define GRUB_EFI_VARIABLE_RUNTIME_ACCESS 0x0000000000000004 +diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h +index e67d92b..489cf9e 100644 +--- a/include/grub/efi/efi.h ++++ b/include/grub/efi/efi.h +@@ -64,6 +64,11 @@ grub_err_t EXPORT_FUNC (grub_efi_set_virtual_address_map) (grub_efi_uintn_t memo + void *EXPORT_FUNC (grub_efi_get_variable) (const char *variable, + const grub_efi_guid_t *guid, + grub_size_t *datasize_out); ++grub_err_t ++EXPORT_FUNC (grub_efi_set_variable) (const char *var, ++ const grub_efi_guid_t *guid, ++ void *data, ++ grub_size_t datasize); + int + EXPORT_FUNC (grub_efi_compare_device_paths) (const grub_efi_device_path_t *dp1, + const grub_efi_device_path_t *dp2); +-- +1.7.10.1 + diff --git a/grub2.spec b/grub2.spec index f17cda1..c125e3c 100644 --- a/grub2.spec +++ b/grub2.spec @@ -60,6 +60,8 @@ Patch7: grub-2.00~beta4-add-support-for-PowerMac-HFS-partitions.patch Patch8: grub2-2.0-no-png-in-texi.patch Patch9: grub-2.00-Fix-module-trampoline-for-ppc.patch Patch10: grub-2.00-add-fw_path-search.patch +Patch11: grub-2.00-Add-fwsetup.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -163,7 +165,7 @@ make %{?_smp_mflags} ./grub-mkimage -O %{grubefiarch} -o %{grubefiname} -d grub-core \ part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux \ minicmd reboot halt search font gfxterm echo video all_video \ - test gfxmenu png + test gfxmenu png efifwsetup cd .. %endif From f3c723cddaa02f055196bf34c76f92510b231bc8 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 25 May 2012 15:01:32 -0400 Subject: [PATCH 65/65] Add fwsetup command (pjones) - More ppc fixes (IBM) --- grub-2.00-Dont-set-boot-on-ppc.patch | 43 ++++++++++++++++++++ grub-2.00-ppc-no-tree-scanning.patch | 59 ++++++++++++++++++++++++++++ grub2.spec | 9 ++++- 3 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 grub-2.00-Dont-set-boot-on-ppc.patch create mode 100644 grub-2.00-ppc-no-tree-scanning.patch diff --git a/grub-2.00-Dont-set-boot-on-ppc.patch b/grub-2.00-Dont-set-boot-on-ppc.patch new file mode 100644 index 0000000..11869af --- /dev/null +++ b/grub-2.00-Dont-set-boot-on-ppc.patch @@ -0,0 +1,43 @@ +From 28d9f3965f095a765ec8aaa589b4e04608b69901 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Fri, 25 May 2012 14:57:38 -0400 +Subject: [PATCH] Don't set boot device on ppc-ieee1275 + +This started with the problem that powerkvm doesn't have /dev/nvram and so +there is no way to set boot-device. +--- + util/grub-install.in | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +diff --git a/util/grub-install.in b/util/grub-install.in +index 293b756..2503aa0 100644 +--- a/util/grub-install.in ++++ b/util/grub-install.in +@@ -818,14 +818,16 @@ elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ] + fi + fi + +- "$nvsetenv" boot-device "$boot_device" || { +- # TRANSLATORS: The %s will be replaced by an external program name. +- gettext_printf "\`%s' failed.\n" "$nvsetenv" 1>&2 +- gettext "You will have to set \`boot-device' variable manually. At the IEEE1275 prompt, type:" 1>&2 +- echo 1>&2 +- echo " setenv boot-device $boot_device" 1>&2 +- exit 1 +- } ++ if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ]; then ++ "$nvsetenv" boot-device "$boot_device" || { ++ # TRANSLATORS: The %s will be replaced by an external program name. ++ gettext_printf "\`%s' failed.\n" "$nvsetenv" 1>&2 ++ gettext "You will have to set \`boot-device' variable manually. At the IEEE1275 prompt, type:" 1>&2 ++ echo 1>&2 ++ echo " setenv boot-device $boot_device" 1>&2 ++ exit 1 ++ } ++ fi + fi + elif [ x"${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = xmips-arc ]; then + dvhtool -d "${install_device}" --unix-to-vh "{grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" grub +-- +1.7.10.1 + diff --git a/grub-2.00-ppc-no-tree-scanning.patch b/grub-2.00-ppc-no-tree-scanning.patch new file mode 100644 index 0000000..f0558f7 --- /dev/null +++ b/grub-2.00-ppc-no-tree-scanning.patch @@ -0,0 +1,59 @@ +From 03f6e77635f4f311a2c7bdd581f6202fa52feef7 Mon Sep 17 00:00:00 2001 +From: Valdimir Serbinenko +Date: Sun, 13 May 2012 18:23:02 +0000 +Subject: [PATCH] Don't scan device tree if flag is set. + +Don't scan device tree if GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS is +set. + +=== modified file 'grub-core/disk/ieee1275/ofdisk.c' +--- + grub-core/disk/ieee1275/ofdisk.c | 3 ++- + grub-core/kern/ieee1275/cmain.c | 3 +++ + include/grub/ieee1275/ieee1275.h | 2 ++ + 3 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c +index 56fed0a..6b734f7 100644 +--- a/grub-core/disk/ieee1275/ofdisk.c ++++ b/grub-core/disk/ieee1275/ofdisk.c +@@ -159,7 +159,8 @@ scan (void) + } + + grub_devalias_iterate (dev_iterate_alias); +- grub_ieee1275_devices_iterate (dev_iterate); ++ if (!grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS)) ++ grub_ieee1275_devices_iterate (dev_iterate); + } + + static int +diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c +index 9e80757..e04ce5b 100644 +--- a/grub-core/kern/ieee1275/cmain.c ++++ b/grub-core/kern/ieee1275/cmain.c +@@ -88,6 +88,9 @@ grub_ieee1275_find_options (void) + if (rc >= 0 && !grub_strcmp (tmp, "Emulated PC")) + is_qemu = 1; + ++ if (rc >= 0 && grub_strncmp (tmp, "IBM", 3) == 0) ++ grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS); ++ + if (grub_strncmp (tmp, "PowerMac", sizeof ("PowerMac") - 1) == 0) + grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS); + +diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h +index fb85db9..99a4bc1 100644 +--- a/include/grub/ieee1275/ieee1275.h ++++ b/include/grub/ieee1275/ieee1275.h +@@ -116,6 +116,8 @@ enum grub_ieee1275_flag + 1 address cell is used on PowerMacs. + */ + GRUB_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS, ++ ++ GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS + }; + + extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag); +-- +1.7.10.1 + diff --git a/grub2.spec b/grub2.spec index c125e3c..5098012 100644 --- a/grub2.spec +++ b/grub2.spec @@ -39,7 +39,7 @@ Name: grub2 Epoch: 1 Version: 2.0 -Release: 0.30.beta5%{?dist} +Release: 0.31.beta5%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -61,7 +61,8 @@ Patch8: grub2-2.0-no-png-in-texi.patch Patch9: grub-2.00-Fix-module-trampoline-for-ppc.patch Patch10: grub-2.00-add-fw_path-search.patch Patch11: grub-2.00-Add-fwsetup.patch - +Patch12: grub-2.00-ppc-no-tree-scanning.patch +Patch13: grub-2.00-Dont-set-boot-on-ppc.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -385,6 +386,10 @@ fi %doc grub-%{tarversion}/themes/starfield/COPYING.CC-BY-SA-3.0 %changelog +* Fri May 25 2012 Peter Jones - 2.0-0.31.beta5 +- Add fwsetup command (pjones) +- More ppc fixes (IBM) + * Tue May 22 2012 Peter Jones - 2.0-0.30.beta5 - Fix the /other/ grub2-tools require to include epoch.