Try dropping custom sort again

See-also: https://github.com/rpm-software-management/rpm/pull/2249
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
This commit is contained in:
Robbie Harwood 2022-11-01 17:28:58 +00:00
parent bc32a76bab
commit 3d407d2111
259 changed files with 319 additions and 827 deletions

View File

@ -4,14 +4,14 @@ Date: Mon, 8 Jul 2019 12:55:29 +0200
Subject: [PATCH] re-write .gitignore Subject: [PATCH] re-write .gitignore
--- ---
.gitignore | 152 ++++++++++++++++++++++++++++++++++++++ .gitignore | 150 ++++++++++++++++++++++++++++++++++++++
docs/.gitignore | 5 ++ docs/.gitignore | 5 ++
grub-core/.gitignore | 16 ++++ grub-core/.gitignore | 16 ++++
grub-core/lib/.gitignore | 1 + grub-core/lib/.gitignore | 1 +
include/grub/gcrypt/.gitignore | 2 + include/grub/gcrypt/.gitignore | 2 +
po/.gitignore | 5 ++ po/.gitignore | 5 ++
util/bash-completion.d/.gitignore | 2 + util/bash-completion.d/.gitignore | 2 +
7 files changed, 183 insertions(+) 7 files changed, 181 insertions(+)
create mode 100644 docs/.gitignore create mode 100644 docs/.gitignore
create mode 100644 grub-core/.gitignore create mode 100644 grub-core/.gitignore
create mode 100644 grub-core/lib/.gitignore create mode 100644 grub-core/lib/.gitignore
@ -20,10 +20,10 @@ Subject: [PATCH] re-write .gitignore
create mode 100644 util/bash-completion.d/.gitignore create mode 100644 util/bash-completion.d/.gitignore
diff --git a/.gitignore b/.gitignore diff --git a/.gitignore b/.gitignore
index f6a1bd0517..594d0134d3 100644 index f6a1bd0517..208d1d2325 100644
--- a/.gitignore --- a/.gitignore
+++ b/.gitignore +++ b/.gitignore
@@ -275,3 +275,155 @@ widthspec.bin @@ -275,3 +275,153 @@ widthspec.bin
/xfs_test /xfs_test
/xzcompress_test /xzcompress_test
/zfs_test /zfs_test
@ -152,8 +152,6 @@ index f6a1bd0517..594d0134d3 100644
+/grub*-reboot.8 +/grub*-reboot.8
+/grub*-render-label +/grub*-render-label
+/grub*-render-label.1 +/grub*-render-label.1
+/grub*-rpm-sort
+/grub*-rpm-sort.8
+/grub*-script-check +/grub*-script-check
+/grub*-script-check.1 +/grub*-script-check.1
+/grub*-set-bootflag +/grub*-set-bootflag

View File

@ -1,457 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Robert Marshall <rmarshall@redhat.com>
Date: Mon, 16 Mar 2015 14:14:19 -0400
Subject: [PATCH] Use rpm's sort for grub2-mkconfig
Add an option for rpm-based systems to use the rpm-sort library to sort
kernels. This avoids problems due to discrepancies between `sort -V`
and rpm.
Signed-off-by: Robert Marshall <rmarshall@redhat.com>
[pjones: fix --enable-rpm-sort configure option]
Signed-off-by: Peter Jones <pjones@redhat.com>
[thierry.vignaud: fix build with rpm-4.16]
Signed-off-by: Thierry Vignaud <thierry.vignaud@gmail.com>
[tim: fix disabling grub-rpm-sort by ./configure]
Signed-off-by: Tim Landscheidt <tim@tim-landscheidt.de>
[javierm: don't check for rpmvercmp in librpm]
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
[rharwood: commit message, migrate to h2m]
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
---
configure.ac | 36 ++++++
Makefile.util.def | 17 +++
util/grub-rpm-sort.c | 281 +++++++++++++++++++++++++++++++++++++++++++++
docs/man/grub-rpm-sort.h2m | 2 +
util/grub-mkconfig_lib.in | 11 +-
5 files changed, 346 insertions(+), 1 deletion(-)
create mode 100644 util/grub-rpm-sort.c
create mode 100644 docs/man/grub-rpm-sort.h2m
diff --git a/configure.ac b/configure.ac
index 8331f95b64..87c8f17393 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,6 +72,7 @@ grub_TRANSFORM([grub-mkrelpath])
grub_TRANSFORM([grub-mkrescue])
grub_TRANSFORM([grub-probe])
grub_TRANSFORM([grub-reboot])
+grub_TRANSFORM([grub-rpm-sort])
grub_TRANSFORM([grub-script-check])
grub_TRANSFORM([grub-set-default])
grub_TRANSFORM([grub-sparc64-setup])
@@ -1837,6 +1838,35 @@ fi
AC_SUBST([LIBDEVMAPPER])
+AC_ARG_ENABLE([rpm-sort],
+ [AS_HELP_STRING([--enable-rpm-sort],
+ [enable native rpm sorting of kernels in grub (default=guessed)])])
+if test x"$enable_rpm_sort" = xno ; then
+ rpm_sort_excuse="explicitly disabled"
+else
+ enable_rpm_sort=yes
+fi
+
+if test x"$rpm_sort_excuse" = x ; then
+ # Check for rpmlib header.
+ AC_CHECK_HEADER([rpm/rpmlib.h], [],
+ [rpm_sort_excuse="need rpm/rpmlib header"])
+fi
+
+if test x"$rpm_sort_excuse" = x ; then
+ # Check for rpmio library.
+ AC_CHECK_LIB([rpmio], [rpmvercmp], [],
+ [rpm_sort_excuse="rpmio missing rpmvercmp"])
+fi
+
+if test x"$rpm_sort_excuse" = x ; then
+ LIBRPM="-lrpmio";
+ AC_DEFINE([HAVE_RPMIO], [1],
+ [Define to 1 if you have the rpmio library.])
+fi
+
+AC_SUBST([LIBRPM])
+
LIBGEOM=
if test x$host_kernel = xkfreebsd; then
AC_CHECK_LIB([geom], [geom_gettree], [],
@@ -2024,6 +2054,7 @@ AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes])
AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes])
AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes])
AM_CONDITIONAL([COND_GRUB_MOUNT], [test x$enable_grub_mount = xyes])
+AM_CONDITIONAL([COND_GRUB_RPM_SORT], [test x$enable_rpm_sort = xyes])
AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x])
if test x$FONT_SOURCE != x ; then
HAVE_FONT_SOURCE=1
@@ -2145,6 +2176,11 @@ echo grub-mount: Yes
else
echo grub-mount: No "($grub_mount_excuse)"
fi
+if [ x"$rpm_sort_excuse" = x ]; then
+echo grub-rpm-sort: Yes
+else
+echo grub-rpm-sort: No "($rpm_sort_excuse)"
+fi
if [ x"$starfield_excuse" = x ]; then
echo starfield theme: Yes
echo With DejaVuSans font from $DJVU_FONT_SOURCE
diff --git a/Makefile.util.def b/Makefile.util.def
index 2c9b283a23..bc10cc7972 100644
--- a/Makefile.util.def
+++ b/Makefile.util.def
@@ -703,6 +703,23 @@ program = {
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
};
+program = {
+ name = grub-rpm-sort;
+ mansection = 8;
+ installdir = sbin;
+
+ common = grub-core/kern/emu/misc.c;
+ common = grub-core/kern/emu/argp_common.c;
+ common = grub-core/osdep/init.c;
+ common = util/misc.c;
+ common = util/grub-rpm-sort.c;
+
+ ldadd = libgrubkern.a;
+ ldadd = grub-core/lib/gnulib/libgnu.a;
+ ldadd = '$(LIBDEVMAPPER) $(LIBRPM)';
+ condition = COND_GRUB_RPM_SORT;
+};
+
script = {
name = grub-mkconfig;
common = util/grub-mkconfig.in;
diff --git a/util/grub-rpm-sort.c b/util/grub-rpm-sort.c
new file mode 100644
index 0000000000..f33bd1ed56
--- /dev/null
+++ b/util/grub-rpm-sort.c
@@ -0,0 +1,281 @@
+#include <config.h>
+#include <grub/types.h>
+#include <grub/util/misc.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include <assert.h>
+#include <argp.h>
+#include <rpm/rpmlib.h>
+
+static size_t
+read_file (const char *input, char **ret)
+{
+ FILE *in;
+ size_t s;
+ size_t sz = 2048;
+ size_t offset = 0;
+ char *text;
+
+ if (!strcmp(input, "-"))
+ in = stdin;
+ else
+ in = grub_util_fopen(input, "r");
+
+ text = xmalloc (sz);
+
+ if (!in)
+ grub_util_error (_("cannot open `%s': %s"), input, strerror (errno));
+
+ while ((s = fread (text + offset, 1, sz - offset, in)) != 0)
+ {
+ offset += s;
+ if (sz - offset == 0)
+ {
+ sz += 2048;
+ text = xrealloc (text, sz);
+ }
+ }
+
+ text[offset] = '\0';
+ *ret = text;
+
+ if (in != stdin)
+ fclose(in);
+
+ return offset + 1;
+}
+
+/* returns name/version/release */
+/* NULL string pointer returned if nothing found */
+static void
+split_package_string (char *package_string, char **name,
+ char **version, char **release)
+{
+ char *package_version, *package_release;
+
+ /* Release */
+ package_release = strrchr (package_string, '-');
+
+ if (package_release != NULL)
+ *package_release++ = '\0';
+
+ *release = package_release;
+
+ /* Version */
+ package_version = strrchr(package_string, '-');
+
+ if (package_version != NULL)
+ *package_version++ = '\0';
+
+ *version = package_version;
+ /* Name */
+ *name = package_string;
+
+ /* Bubble up non-null values from release to name */
+ if (*name == NULL)
+ {
+ *name = (*version == NULL ? *release : *version);
+ *version = *release;
+ *release = NULL;
+ }
+ if (*version == NULL)
+ {
+ *version = *release;
+ *release = NULL;
+ }
+}
+
+/*
+ * package name-version-release comparator for qsort
+ * expects p, q which are pointers to character strings (char *)
+ * which will not be altered in this function
+ */
+static int
+package_version_compare (const void *p, const void *q)
+{
+ char *local_p, *local_q;
+ char *lhs_name, *lhs_version, *lhs_release;
+ char *rhs_name, *rhs_version, *rhs_release;
+ int vercmpflag = 0;
+
+ local_p = alloca (strlen (*(char * const *)p) + 1);
+ local_q = alloca (strlen (*(char * const *)q) + 1);
+
+ /* make sure these allocated */
+ assert (local_p);
+ assert (local_q);
+
+ strcpy (local_p, *(char * const *)p);
+ strcpy (local_q, *(char * const *)q);
+
+ split_package_string (local_p, &lhs_name, &lhs_version, &lhs_release);
+ split_package_string (local_q, &rhs_name, &rhs_version, &rhs_release);
+
+ /* Check Name and return if unequal */
+ vercmpflag = rpmvercmp ((lhs_name == NULL ? "" : lhs_name),
+ (rhs_name == NULL ? "" : rhs_name));
+ if (vercmpflag != 0)
+ return vercmpflag;
+
+ /* Check version and return if unequal */
+ vercmpflag = rpmvercmp ((lhs_version == NULL ? "" : lhs_version),
+ (rhs_version == NULL ? "" : rhs_version));
+ if (vercmpflag != 0)
+ return vercmpflag;
+
+ /* Check release and return the version compare value */
+ vercmpflag = rpmvercmp ((lhs_release == NULL ? "" : lhs_release),
+ (rhs_release == NULL ? "" : rhs_release));
+
+ return vercmpflag;
+}
+
+static void
+add_input (const char *filename, char ***package_names, size_t *n_package_names)
+{
+ char *orig_input_buffer = NULL;
+ char *input_buffer;
+ char *position_of_newline;
+ char **names = *package_names;
+ char **new_names = NULL;
+ size_t n_names = *n_package_names;
+
+ if (!*package_names)
+ new_names = names = xmalloc (sizeof (char *) * 2);
+
+ if (read_file (filename, &orig_input_buffer) < 2)
+ {
+ if (new_names)
+ free (new_names);
+ if (orig_input_buffer)
+ free (orig_input_buffer);
+ return;
+ }
+
+ input_buffer = orig_input_buffer;
+ while (input_buffer && *input_buffer &&
+ (position_of_newline = strchrnul (input_buffer, '\n')))
+ {
+ size_t sz = position_of_newline - input_buffer;
+ char *new;
+
+ if (sz == 0)
+ {
+ input_buffer = position_of_newline + 1;
+ continue;
+ }
+
+ new = xmalloc (sz+1);
+ strncpy (new, input_buffer, sz);
+ new[sz] = '\0';
+
+ names = xrealloc (names, sizeof (char *) * (n_names + 1));
+ names[n_names] = new;
+ n_names++;
+
+ /* move buffer ahead to next line */
+ input_buffer = position_of_newline + 1;
+ if (*position_of_newline == '\0')
+ input_buffer = NULL;
+ }
+
+ free (orig_input_buffer);
+
+ *package_names = names;
+ *n_package_names = n_names;
+}
+
+static char *
+help_filter (int key, const char *text, void *input __attribute__ ((unused)))
+{
+ return (char *)text;
+}
+
+static struct argp_option options[] = {
+ { 0, }
+};
+
+struct arguments
+{
+ size_t ninputs;
+ size_t input_max;
+ char **inputs;
+};
+
+static error_t
+argp_parser (int key, char *arg, struct argp_state *state)
+{
+ struct arguments *arguments = state->input;
+ switch (key)
+ {
+ case ARGP_KEY_ARG:
+ assert (arguments->ninputs < arguments->input_max);
+ arguments->inputs[arguments->ninputs++] = xstrdup (arg);
+ break;
+ default:
+ return ARGP_ERR_UNKNOWN;
+ }
+ return 0;
+}
+
+static struct argp argp = {
+ options, argp_parser, N_("[INPUT_FILES]"),
+ N_("Sort a list of strings in RPM version sort order."),
+ NULL, help_filter, NULL
+};
+
+int
+main (int argc, char *argv[])
+{
+ struct arguments arguments;
+ char **package_names = NULL;
+ size_t n_package_names = 0;
+ int i;
+
+ grub_util_host_init (&argc, &argv);
+
+ memset (&arguments, 0, sizeof (struct arguments));
+ arguments.input_max = argc+1;
+ arguments.inputs = xmalloc ((arguments.input_max + 1)
+ * sizeof (arguments.inputs[0]));
+ memset (arguments.inputs, 0, (arguments.input_max + 1)
+ * sizeof (arguments.inputs[0]));
+
+ /* Parse our arguments */
+ if (argp_parse (&argp, argc, argv, 0, 0, &arguments) != 0)
+ grub_util_error ("%s", _("Error in parsing command line arguments\n"));
+
+ /* If there's no inputs in argv, add one for stdin */
+ if (!arguments.ninputs)
+ {
+ arguments.ninputs = 1;
+ arguments.inputs[0] = xmalloc (2);
+ strcpy(arguments.inputs[0], "-");
+ }
+
+ for (i = 0; i < arguments.ninputs; i++)
+ add_input(arguments.inputs[i], &package_names, &n_package_names);
+
+ if (package_names == NULL || n_package_names < 1)
+ grub_util_error ("%s", _("Invalid input\n"));
+
+ qsort (package_names, n_package_names, sizeof (char *),
+ package_version_compare);
+
+ /* send sorted list to stdout */
+ for (i = 0; i < n_package_names; i++)
+ {
+ fprintf (stdout, "%s\n", package_names[i]);
+ free (package_names[i]);
+ }
+
+ free (package_names);
+ for (i = 0; i < arguments.ninputs; i++)
+ free (arguments.inputs[i]);
+
+ free (arguments.inputs);
+
+ return 0;
+}
diff --git a/docs/man/grub-rpm-sort.h2m b/docs/man/grub-rpm-sort.h2m
new file mode 100644
index 0000000000..fe711ae102
--- /dev/null
+++ b/docs/man/grub-rpm-sort.h2m
@@ -0,0 +1,2 @@
+[NAME]
+grub-rpm-sort \- sort input according to RPM version compare
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index 0f6505bf3b..42c2ea9ba5 100644
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -33,6 +33,9 @@ fi
if test "x$grub_mkrelpath" = x; then
grub_mkrelpath="${bindir}/@grub_mkrelpath@"
fi
+if test "x$grub_rpm_sort" = x; then
+ grub_rpm_sort="${sbindir}/@grub_rpm_sort@"
+fi
if command -v gettext >/dev/null; then
:
@@ -218,6 +221,12 @@ version_sort ()
esac
}
+if [ "x$grub_rpm_sort" != x -a -x "$grub_rpm_sort" ]; then
+ kernel_sort="$grub_rpm_sort"
+else
+ kernel_sort=version_sort
+fi
+
version_test_numeric ()
{
version_test_numeric_a="$1"
@@ -234,7 +243,7 @@ version_test_numeric ()
version_test_numeric_a="$version_test_numeric_b"
version_test_numeric_b="$version_test_numeric_c"
fi
- if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | version_sort | head -n 1 | grep -qx "$version_test_numeric_b" ; then
+ if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | "$kernel_sort" | head -n 1 | grep -qx "$version_test_numeric_b" ; then
return 0
else
return 1

View File

@ -14,7 +14,7 @@ Signed-off-by: Robert Marshall <rmarshall@redhat.com>
Signed-off-by: Peter Jones <pjones@redhat.com> Signed-off-by: Peter Jones <pjones@redhat.com>
[luto: fix grub-setpassword -o's output path] [luto: fix grub-setpassword -o's output path]
Signed-off-by: Andy Lutomirski <luto@kernel.org> Signed-off-by: Andy Lutomirski <luto@kernel.org>
[rharwood: migrate man page to h2m] [rharwood: migrate man page to h2m, context]
Signed-off-by: Robbie Harwood <rharwood@redhat.com> Signed-off-by: Robbie Harwood <rharwood@redhat.com>
--- ---
configure.ac | 1 + configure.ac | 1 +
@ -29,7 +29,7 @@ Signed-off-by: Robbie Harwood <rharwood@redhat.com>
create mode 100644 util/grub.d/01_users.in create mode 100644 util/grub.d/01_users.in
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index 87c8f17393..916bede6bf 100644 index 8331f95b64..7f59ad788f 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -72,6 +72,7 @@ grub_TRANSFORM([grub-mkrelpath]) @@ -72,6 +72,7 @@ grub_TRANSFORM([grub-mkrelpath])
@ -37,11 +37,11 @@ index 87c8f17393..916bede6bf 100644
grub_TRANSFORM([grub-probe]) grub_TRANSFORM([grub-probe])
grub_TRANSFORM([grub-reboot]) grub_TRANSFORM([grub-reboot])
+grub_TRANSFORM([grub-set-password]) +grub_TRANSFORM([grub-set-password])
grub_TRANSFORM([grub-rpm-sort])
grub_TRANSFORM([grub-script-check]) grub_TRANSFORM([grub-script-check])
grub_TRANSFORM([grub-set-default]) grub_TRANSFORM([grub-set-default])
grub_TRANSFORM([grub-sparc64-setup])
diff --git a/Makefile.util.def b/Makefile.util.def diff --git a/Makefile.util.def b/Makefile.util.def
index bc10cc7972..8ca4c14f0b 100644 index 2c9b283a23..4ee22c5daa 100644
--- a/Makefile.util.def --- a/Makefile.util.def
+++ b/Makefile.util.def +++ b/Makefile.util.def
@@ -452,6 +452,12 @@ script = { @@ -452,6 +452,12 @@ script = {
@ -57,7 +57,7 @@ index bc10cc7972..8ca4c14f0b 100644
script = { script = {
name = '10_windows'; name = '10_windows';
common = util/grub.d/10_windows.in; common = util/grub.d/10_windows.in;
@@ -741,6 +747,13 @@ script = { @@ -724,6 +730,13 @@ script = {
installdir = sbin; installdir = sbin;
}; };

View File

@ -24,7 +24,7 @@ Resolves: rhbz#1226325
create mode 100644 util/grub-get-kernel-settings.in create mode 100644 util/grub-get-kernel-settings.in
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index 916bede6bf..4f1676967e 100644 index 7f59ad788f..0d0e6782a1 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -65,6 +65,7 @@ grub_TRANSFORM([grub-install]) @@ -65,6 +65,7 @@ grub_TRANSFORM([grub-install])
@ -36,10 +36,10 @@ index 916bede6bf..4f1676967e 100644
grub_TRANSFORM([grub-mklayout]) grub_TRANSFORM([grub-mklayout])
grub_TRANSFORM([grub-mkpasswd-pbkdf2]) grub_TRANSFORM([grub-mkpasswd-pbkdf2])
diff --git a/Makefile.util.def b/Makefile.util.def diff --git a/Makefile.util.def b/Makefile.util.def
index 8ca4c14f0b..43a1c7453b 100644 index 4ee22c5daa..18a9242776 100644
--- a/Makefile.util.def --- a/Makefile.util.def
+++ b/Makefile.util.def +++ b/Makefile.util.def
@@ -733,6 +733,13 @@ script = { @@ -716,6 +716,13 @@ script = {
installdir = sbin; installdir = sbin;
}; };

View File

@ -27,10 +27,10 @@ index 005f093809..535c0f0249 100644
if test "x${grub_cfg}" != "x"; then if test "x${grub_cfg}" != "x"; then
rm -f "${grub_cfg}.new" rm -f "${grub_cfg}.new"
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index 42c2ea9ba5..fafeac9506 100644 index 0f6505bf3b..5e96f6cc5d 100644
--- a/util/grub-mkconfig_lib.in --- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in
@@ -52,7 +52,11 @@ grub_warn () @@ -49,7 +49,11 @@ grub_warn ()
make_system_path_relative_to_its_root () make_system_path_relative_to_its_root ()
{ {

View File

@ -24,7 +24,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
[iwienand@redhat.com: skip machine ID check when updating entries] [iwienand@redhat.com: skip machine ID check when updating entries]
Signed-off-by: Ian Wienand <iwienand@redhat.com> Signed-off-by: Ian Wienand <iwienand@redhat.com>
[rharwood: commit message composits, drop man pages] [rharwood: use sort(1), commit message composits, drop man pages]
Signed-off-by: Robbie Harwood <rharwood@redhat.com> Signed-off-by: Robbie Harwood <rharwood@redhat.com>
--- ---
util/grub-mkconfig.in | 9 +- util/grub-mkconfig.in | 9 +-
@ -74,7 +74,7 @@ index 535c0f0249..f55339a3f6 100644
if test "x${grub_cfg}" != "x"; then if test "x${grub_cfg}" != "x"; then
rm -f "${grub_cfg}.new" rm -f "${grub_cfg}.new"
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index fafeac9506..d8bb406936 100644 index 5e96f6cc5d..301d8a8a1e 100644
--- a/util/grub-mkconfig_lib.in --- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in
@@ -30,6 +30,9 @@ fi @@ -30,6 +30,9 @@ fi
@ -87,7 +87,7 @@ index fafeac9506..d8bb406936 100644
if test "x$grub_mkrelpath" = x; then if test "x$grub_mkrelpath" = x; then
grub_mkrelpath="${bindir}/@grub_mkrelpath@" grub_mkrelpath="${bindir}/@grub_mkrelpath@"
fi fi
@@ -125,8 +128,19 @@ EOF @@ -122,8 +125,19 @@ EOF
fi fi
} }
@ -107,7 +107,7 @@ index fafeac9506..d8bb406936 100644
old_ifs="$IFS" old_ifs="$IFS"
IFS=' IFS='
' '
@@ -161,18 +175,18 @@ prepare_grub_to_access_device () @@ -158,18 +172,18 @@ prepare_grub_to_access_device ()
# otherwise set root as per value in device.map. # otherwise set root as per value in device.map.
fs_hint="`"${grub_probe}" --device $@ --target=compatibility_hint`" fs_hint="`"${grub_probe}" --device $@ --target=compatibility_hint`"
if [ "x$fs_hint" != x ]; then if [ "x$fs_hint" != x ]; then
@ -131,7 +131,7 @@ index fafeac9506..d8bb406936 100644
fi fi
IFS="$old_ifs" IFS="$old_ifs"
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 7bb3a211a7..f1548a2605 100644 index 7bb3a211a7..2851952659 100644
--- a/util/grub.d/10_linux.in --- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in
@@ -82,6 +82,218 @@ case x"$GRUB_FS" in @@ -82,6 +82,218 @@ case x"$GRUB_FS" in
@ -207,7 +207,7 @@ index 7bb3a211a7..f1548a2605 100644
+ bls="${bls%.conf}" + bls="${bls%.conf}"
+ bls="${bls##*/}" + bls="${bls##*/}"
+ echo "${bls}" + echo "${bls}"
+ done | ${kernel_sort} 2>/dev/null | tac)) || : + done | sort -Vr 2>/dev/null)) || :
+ +
+ echo "${files[@]}" + echo "${files[@]}"
+} +}

View File

@ -20,10 +20,10 @@ Signed-off-by: Robbie Harwood <rharwood@redhat.com>
create mode 100644 util/grub-switch-to-blscfg.in create mode 100644 util/grub-switch-to-blscfg.in
diff --git a/Makefile.util.def b/Makefile.util.def diff --git a/Makefile.util.def b/Makefile.util.def
index 43a1c7453b..a90879fa9b 100644 index 18a9242776..88f55e35c4 100644
--- a/Makefile.util.def --- a/Makefile.util.def
+++ b/Makefile.util.def +++ b/Makefile.util.def
@@ -1365,6 +1365,13 @@ program = { @@ -1348,6 +1348,13 @@ program = {
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
}; };
@ -381,7 +381,7 @@ index 0000000000..a851424beb
+# Bye. +# Bye.
+exit 0 +exit 0
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index f1548a2605..c02c1f0820 100644 index 2851952659..e490e1a43a 100644
--- a/util/grub.d/10_linux.in --- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in
@@ -138,7 +138,7 @@ blsdir="/boot/loader/entries" @@ -138,7 +138,7 @@ blsdir="/boot/loader/entries"

View File

@ -38,7 +38,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
delete mode 100644 grub-core/lib/i386/backtrace.c delete mode 100644 grub-core/lib/i386/backtrace.c
diff --git a/Makefile.util.def b/Makefile.util.def diff --git a/Makefile.util.def b/Makefile.util.def
index a90879fa9b..48512bc631 100644 index 88f55e35c4..bda9fd1211 100644
--- a/Makefile.util.def --- a/Makefile.util.def
+++ b/Makefile.util.def +++ b/Makefile.util.def
@@ -51,6 +51,12 @@ library = { @@ -51,6 +51,12 @@ library = {

View File

@ -10,10 +10,10 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
2 files changed, 27 insertions(+) 2 files changed, 27 insertions(+)
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index 4f1676967e..b809c00784 100644 index 0d0e6782a1..302300711f 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -1443,7 +1443,15 @@ grub_PROG_TARGET_CC @@ -1442,7 +1442,15 @@ grub_PROG_TARGET_CC
if test "x$TARGET_APPLE_LINKER" != x1 ; then if test "x$TARGET_APPLE_LINKER" != x1 ; then
grub_PROG_OBJCOPY_ABSOLUTE grub_PROG_OBJCOPY_ABSOLUTE
fi fi

View File

@ -43,7 +43,7 @@ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
create mode 100644 util/grub.d/01_menu_auto_hide.in create mode 100644 util/grub.d/01_menu_auto_hide.in
diff --git a/Makefile.util.def b/Makefile.util.def diff --git a/Makefile.util.def b/Makefile.util.def
index 48512bc631..314e6f2acf 100644 index bda9fd1211..cb8e3c3270 100644
--- a/Makefile.util.def --- a/Makefile.util.def
+++ b/Makefile.util.def +++ b/Makefile.util.def
@@ -458,6 +458,12 @@ script = { @@ -458,6 +458,12 @@ script = {

View File

@ -49,10 +49,10 @@ Signed-off-by: Robbie Harwood <rharwood@redhat.com>
create mode 100644 docs/man/grub-set-bootflag.h2m create mode 100644 docs/man/grub-set-bootflag.h2m
diff --git a/Makefile.util.def b/Makefile.util.def diff --git a/Makefile.util.def b/Makefile.util.def
index 314e6f2acf..0b85a7fce4 100644 index cb8e3c3270..d066652e9b 100644
--- a/Makefile.util.def --- a/Makefile.util.def
+++ b/Makefile.util.def +++ b/Makefile.util.def
@@ -1446,3 +1446,10 @@ program = { @@ -1429,3 +1429,10 @@ program = {
ldadd = grub-core/lib/gnulib/libgnu.a; ldadd = grub-core/lib/gnulib/libgnu.a;
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
}; };

View File

@ -17,10 +17,10 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
3 files changed, 64 insertions(+), 16 deletions(-) 3 files changed, 64 insertions(+), 16 deletions(-)
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index b809c00784..b1ca894791 100644 index 302300711f..008f6c273b 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -850,11 +850,23 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p @@ -849,11 +849,23 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow" TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
fi fi
@ -45,7 +45,7 @@ index b809c00784..b1ca894791 100644
AC_CACHE_CHECK([for options to get soft-float], grub_cv_target_cc_soft_float, [ AC_CACHE_CHECK([for options to get soft-float], grub_cv_target_cc_soft_float, [
grub_cv_target_cc_soft_float=no grub_cv_target_cc_soft_float=no
if test "x$target_cpu" = xarm64; then if test "x$target_cpu" = xarm64; then
@@ -1984,6 +1996,41 @@ HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include" @@ -1954,6 +1966,41 @@ HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include"
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include" TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include"
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include" TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include"

View File

@ -9,10 +9,10 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
1 file changed, 20 insertions(+) 1 file changed, 20 insertions(+)
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index b1ca894791..f42be65332 100644 index 008f6c273b..54462e0892 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -1261,6 +1261,26 @@ if test "x$target_cpu" = xarm; then @@ -1260,6 +1260,26 @@ if test "x$target_cpu" = xarm; then
done done
]) ])

View File

@ -19,10 +19,10 @@ Signed-off-by: Robbie Harwood <rharwood@redhat.com>
create mode 100644 grub-core/commands/version.c create mode 100644 grub-core/commands/version.c
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index f42be65332..2af5f23adf 100644 index 54462e0892..7b4e1854d3 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -285,6 +285,19 @@ AC_SUBST(target_cpu) @@ -284,6 +284,19 @@ AC_SUBST(target_cpu)
AC_SUBST(platform) AC_SUBST(platform)
# Define default variables # Define default variables

View File

@ -14,9 +14,8 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
util/grub-menulst2cfg.c | 2 +- util/grub-menulst2cfg.c | 2 +-
util/grub-mkfont.c | 13 +++++++------ util/grub-mkfont.c | 13 +++++++------
util/grub-probe.c | 2 +- util/grub-probe.c | 2 +-
util/grub-rpm-sort.c | 2 +-
util/setup.c | 2 +- util/setup.c | 2 +-
11 files changed, 18 insertions(+), 17 deletions(-) 10 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c
index eeea092752..f08a1bb841 100644 index eeea092752..f08a1bb841 100644
@ -185,19 +184,6 @@ index c08e46bbb4..c6fac732b4 100644
for (i = PRINT_FS; i < ARRAY_SIZE (targets); i++) for (i = PRINT_FS; i < ARRAY_SIZE (targets); i++)
if (strcmp (arg, targets[i]) == 0) if (strcmp (arg, targets[i]) == 0)
diff --git a/util/grub-rpm-sort.c b/util/grub-rpm-sort.c
index f33bd1ed56..8345944105 100644
--- a/util/grub-rpm-sort.c
+++ b/util/grub-rpm-sort.c
@@ -232,7 +232,7 @@ main (int argc, char *argv[])
struct arguments arguments;
char **package_names = NULL;
size_t n_package_names = 0;
- int i;
+ unsigned int i;
grub_util_host_init (&argc, &argv);
diff --git a/util/setup.c b/util/setup.c diff --git a/util/setup.c b/util/setup.c
index da5f2c07f5..8b22bb8cca 100644 index da5f2c07f5..8b22bb8cca 100644
--- a/util/setup.c --- a/util/setup.c

View File

@ -11,10 +11,10 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
2 files changed, 12 insertions(+), 4 deletions(-) 2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index 2af5f23adf..091ab32836 100644 index 7b4e1854d3..490353713a 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -1453,11 +1453,11 @@ fi @@ -1452,11 +1452,11 @@ fi
# Set them to their new values for the tests below. # Set them to their new values for the tests below.
CC="$TARGET_CC" CC="$TARGET_CC"
if test x"$platform" = xemu ; then if test x"$platform" = xemu ; then
@ -29,7 +29,7 @@ index 2af5f23adf..091ab32836 100644
fi fi
CPPFLAGS="$TARGET_CPPFLAGS" CPPFLAGS="$TARGET_CPPFLAGS"
@@ -2020,6 +2020,14 @@ if test x"$enable_werror" != xno ; then @@ -1990,6 +1990,14 @@ if test x"$enable_werror" != xno ; then
HOST_CFLAGS="$HOST_CFLAGS -Werror" HOST_CFLAGS="$HOST_CFLAGS -Werror"
fi fi

View File

@ -10,10 +10,10 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
2 files changed, 4 insertions(+), 1 deletion(-) 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index 091ab32836..de707f7e0b 100644 index 490353713a..a02d40a05b 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -2028,6 +2028,9 @@ if test x"$enable_wextra" != xno ; then @@ -1998,6 +1998,9 @@ if test x"$enable_wextra" != xno ; then
HOST_CFLAGS="$HOST_CFLAGS -Wextra" HOST_CFLAGS="$HOST_CFLAGS -Wextra"
fi fi

View File

@ -23,7 +23,7 @@ Signed-off-by: Christian Glombek <lorbus@fedoraproject.org>
create mode 100644 util/grub.d/01_fallback_counting.in create mode 100644 util/grub.d/01_fallback_counting.in
diff --git a/Makefile.util.def b/Makefile.util.def diff --git a/Makefile.util.def b/Makefile.util.def
index 0b85a7fce4..27a13bc734 100644 index d066652e9b..e10fe766d1 100644
--- a/Makefile.util.def --- a/Makefile.util.def
+++ b/Makefile.util.def +++ b/Makefile.util.def
@@ -458,6 +458,12 @@ script = { @@ -458,6 +458,12 @@ script = {

View File

@ -21,7 +21,7 @@ Signed-off-by: Robbie Harwood <rharwood@redhat.com>
rename util/grub.d/{01_menu_auto_hide.in => 12_menu_auto_hide.in} (58%) rename util/grub.d/{01_menu_auto_hide.in => 12_menu_auto_hide.in} (58%)
diff --git a/Makefile.util.def b/Makefile.util.def diff --git a/Makefile.util.def b/Makefile.util.def
index 27a13bc734..2e6ad979c3 100644 index e10fe766d1..b4ce5383b7 100644
--- a/Makefile.util.def --- a/Makefile.util.def
+++ b/Makefile.util.def +++ b/Makefile.util.def
@@ -459,14 +459,14 @@ script = { @@ -459,14 +459,14 @@ script = {

Some files were not shown because too many files have changed in this diff Show More