forked from pool/grub2
Accepting request 215036 from home:oertel:branches:Base:System
- Add changes to allow build for s390x arch: added grub2-s390x-01-Changes-made-and-files-added-in-order-to-allow-s390x.patch - refresh 0002-script-create-menus-for-btrfs-snapshot.patch * Fix bootable snapshots not found while root is on Btrfs subvolume (bnc#859587) * Create missing slave config in /.snapshots/<num>/ * Prefix with SUSE_ for related options OBS-URL: https://build.opensuse.org/request/show/215036 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=69
This commit is contained in:
parent
2b365a069c
commit
e1c7fd0494
@ -14,6 +14,12 @@ v1:
|
||||
* Introduce GRUB_ENABLE_CUSTOM_SNAPSHOT_SUBMENU to allow custom
|
||||
submenu for listing snapshots rather than the default one.
|
||||
|
||||
v2:
|
||||
* Fix bootable snapshots not found while root is on Btrfs subvolume
|
||||
(bnc#859587)
|
||||
* Create missing slave config in /.snapshots/<num>/
|
||||
* Prefix with SUSE_ for related options
|
||||
|
||||
Signed-off-by: Michael Chang <mchang@suse.com>
|
||||
|
||||
Index: grub-2.02~beta2/Makefile.util.def
|
||||
@ -44,9 +50,9 @@ Index: grub-2.02~beta2/util/grub-mkconfig.in
|
||||
GRUB_CMDLINE_LINUX_RECOVERY \
|
||||
- GRUB_USE_LINUXEFI
|
||||
+ GRUB_USE_LINUXEFI \
|
||||
+ GRUB_DISABLE_BOOTING_SNAPSHOT \
|
||||
+ GRUB_DISABLE_BOOTING_SNAPSHOT_SUBMENU \
|
||||
+ GRUB_ENABLE_CUSTOM_SNAPSHOT_SUBMENU
|
||||
+ SUSE_DISABLE_BOOTING_SNAPSHOT \
|
||||
+ SUSE_DISABLE_BOOTING_SNAPSHOT_SUBMENU \
|
||||
+ SUSE_ENABLE_CUSTOM_SNAPSHOT_SUBMENU
|
||||
|
||||
if test "x${grub_cfg}" != "x"; then
|
||||
rm -f "${grub_cfg}.new"
|
||||
@ -54,7 +60,7 @@ Index: grub-2.02~beta2/util/grub.d/80_btrfs_snapshot.in
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ grub-2.02~beta2/util/grub.d/80_btrfs_snapshot.in
|
||||
@@ -0,0 +1,174 @@
|
||||
@@ -0,0 +1,171 @@
|
||||
+#! /bin/sh
|
||||
+set -e
|
||||
+
|
||||
@ -103,20 +109,20 @@ Index: grub-2.02~beta2/util/grub.d/80_btrfs_snapshot.in
|
||||
+grub_mkconfig_dir=`dirname $0`
|
||||
+grub_script_check="${bindir}/grub2-script-check"
|
||||
+
|
||||
+# Stockpile directory for created slave config for snapshots without it
|
||||
+scanned_snapshot_cfg_dir="/boot/grub2/scanned_snapshot_cfg"
|
||||
+
|
||||
+# The real root (subvolume) where system installed to
|
||||
+rel_root=`make_system_path_relative_to_its_root /`
|
||||
+
|
||||
+# Remove any slave config if booting snapshot gets disabled, in case it will become
|
||||
+# inconsistent on further updates, note this also removes master_snapshot_cfg
|
||||
+
|
||||
+# Temporarily we disable this as it is quite new and still in developing
|
||||
+# It's subjected to be enabled by default in future as the option name
|
||||
+# GRUB_DISABLE_BOOTING_SNAPSHOT suggests. So for new you'll need to explicit
|
||||
+# specify GRUB_DISABLE_BOOTING_SNAPSHOT=false the update the config
|
||||
+if [ "x${GRUB_DISABLE_BOOTING_SNAPSHOT}" != "xfalse" ]; then
|
||||
+# SUSE_DISABLE_BOOTING_SNAPSHOT suggests. So for new you'll need to explicit
|
||||
+# specify SUSE_DISABLE_BOOTING_SNAPSHOT=false the update the config
|
||||
+if [ "x${SUSE_DISABLE_BOOTING_SNAPSHOT}" != "xfalse" ]; then
|
||||
+ rm -f "/${slave_cfg}"
|
||||
+ rm -f "${master_snapshot_cfg}"
|
||||
+ rm -rf "${scanned_snapshot_cfg_dir}"
|
||||
+ exit 0
|
||||
+fi
|
||||
+
|
||||
@ -133,18 +139,18 @@ Index: grub-2.02~beta2/util/grub.d/80_btrfs_snapshot.in
|
||||
+
|
||||
+ # Scan existing snapshots to create their missing slave configs
|
||||
+ # This should only be done once
|
||||
+ if [ ! -d "$scanned_snapshot_cfg_dir" ]; then
|
||||
+
|
||||
+ mkdir -p "$scanned_snapshot_cfg_dir"
|
||||
+ for s_dir in /.snapshots/*; do
|
||||
+
|
||||
+ for snapshot in /.snapshots/*/snapshot; do
|
||||
+ snapshot="${s_dir}/snapshot"
|
||||
+ config="${snapshot}/etc/default/grub"
|
||||
+
|
||||
+ bootdir="${snapshot}/boot"
|
||||
+ outdir="${scanned_snapshot_cfg_dir}${snapshot}"
|
||||
+
|
||||
+ # skip if slave config already exists in snapshot
|
||||
+ if [ -f "${snapshot}/${slave_cfg}" ]; then
|
||||
+ if [ ! -d "$snapshot" ]; then
|
||||
+ continue
|
||||
+ elif [ -f "${snapshot}/${slave_cfg}" ]; then
|
||||
+ continue
|
||||
+ elif [ -f "${s_dir}/${slave_cfg_name}" ]; then
|
||||
+ continue
|
||||
+ fi
|
||||
+
|
||||
@ -162,13 +168,10 @@ Index: grub-2.02~beta2/util/grub.d/80_btrfs_snapshot.in
|
||||
+
|
||||
+ # Check if the config is sane to use
|
||||
+ if ${grub_script_check} "/${slave_cfg}.new"; then
|
||||
+ mkdir -p "$outdir"
|
||||
+ mv -f "/${slave_cfg}.new" "${outdir}/${slave_cfg_name}"
|
||||
+ mv -f "/${slave_cfg}.new" "${s_dir}/${slave_cfg_name}"
|
||||
+ fi
|
||||
+ done
|
||||
+
|
||||
+ fi
|
||||
+
|
||||
+fi
|
||||
+
|
||||
+# Create the bootable snapshots submenus in master config, use the ${OS} to indicate
|
||||
@ -183,7 +186,7 @@ Index: grub-2.02~beta2/util/grub.d/80_btrfs_snapshot.in
|
||||
+# any other submenu with more integrated information retrieved from certain snapshot
|
||||
+# utility's metadata and this option would help to get their boot menu tidy without
|
||||
+# submenu with duplicated purpose.
|
||||
+if [ "x${GRUB_DISABLE_BOOTING_SNAPSHOT_SUBMENU}" != "xtrue" ]; then
|
||||
+if [ "x${SUSE_DISABLE_BOOTING_SNAPSHOT_SUBMENU}" != "xtrue" ]; then
|
||||
+ cat <<EOF
|
||||
+if [ -f \${config_directory}/`basename ${master_snapshot_cfg}` ]; then
|
||||
+ source \${config_directory}/`basename ${master_snapshot_cfg}`
|
||||
@ -193,31 +196,31 @@ Index: grub-2.02~beta2/util/grub.d/80_btrfs_snapshot.in
|
||||
+EOF
|
||||
+fi
|
||||
+
|
||||
+# Still we create the file regardless GRUB_DISABLE_BOOTING_SNAPSHOT_SUBMENU, as it
|
||||
+# Still we create the file regardless SUSE_DISABLE_BOOTING_SNAPSHOT_SUBMENU, as it
|
||||
+# could be source to run as a backup
|
||||
+# Here we search and list snapshots created by snapper by using it's convention on
|
||||
+# naming snapshots
|
||||
+
|
||||
+if [ "x${GRUB_ENABLE_CUSTOM_SNAPSHOT_SUBMENU}" != "xtrue" ]; then
|
||||
+if [ "x${SUSE_ENABLE_CUSTOM_SNAPSHOT_SUBMENU}" != "xtrue" ]; then
|
||||
+
|
||||
+# Write default config if custom one not in use
|
||||
+ cat <<EOF >"${master_snapshot_cfg}"
|
||||
+insmod regexp
|
||||
+submenu "Bootable snapshots for ${OS}" {
|
||||
+ for x in /.snapshots/*; do
|
||||
+ if [ -f "\$x/snapshot/${slave_cfg}" ]; then
|
||||
+ for x in ${rel_root}/.snapshots/*; do
|
||||
+ if [ -f "\$x/${slave_cfg_name}" ]; then
|
||||
+ snapshot_found=true
|
||||
+ submenu "\$x" "\$x" {
|
||||
+ set subvol="\$2/snapshot"
|
||||
+ submenu "\$x" "\$x/snapshot" "\$x/${slave_cfg_name}" {
|
||||
+ set subvol="\$2"
|
||||
+ export subvol
|
||||
+ source "\${subvol}/${slave_cfg}"
|
||||
+ source "\$3"
|
||||
+ }
|
||||
+ elif [ -f "${scanned_snapshot_cfg_dir}\$x/snapshot/${slave_cfg_name}" ]; then
|
||||
+ elif [ -f "\$x/snapshot/${slave_cfg}" ]; then
|
||||
+ snapshot_found=true
|
||||
+ submenu "\$x" "\$x" {
|
||||
+ set subvol="\$2/snapshot"
|
||||
+ submenu "\$x" "\$x/snapshot" "\$x/snapshot/${slave_cfg}" {
|
||||
+ set subvol="\$2"
|
||||
+ export subvol
|
||||
+ source "${scanned_snapshot_cfg_dir}\${subvol}/${slave_cfg_name}"
|
||||
+ source "\$3"
|
||||
+ }
|
||||
+ fi
|
||||
+ done
|
||||
|
@ -0,0 +1,311 @@
|
||||
From f38ada424e7d991a0121253ba1abc430b86a990b Mon Sep 17 00:00:00 2001
|
||||
From: John Jolly <jjolly@suse.de>
|
||||
Date: Wed, 22 Jan 2014 01:18:10 -0700
|
||||
Subject: [PATCH 1/3] - Changes made and files added in order to allow s390x
|
||||
build
|
||||
|
||||
---
|
||||
grub-core/kern/emu/cache_s.S | 1 +
|
||||
grub-core/kern/emu/lite.c | 2 ++
|
||||
grub-core/kern/s390x/dl.c | 37 +++++++++++++++++++++++++++++++++++
|
||||
grub-core/lib/s390x/setjmp.S | 46 ++++++++++++++++++++++++++++++++++++++++++++
|
||||
grub-core/lib/setjmp.S | 2 ++
|
||||
include/grub/cache.h | 2 +-
|
||||
include/grub/s390x/setjmp.h | 29 ++++++++++++++++++++++++++++
|
||||
include/grub/s390x/time.h | 27 ++++++++++++++++++++++++++
|
||||
include/grub/s390x/types.h | 32 ++++++++++++++++++++++++++++++
|
||||
9 files changed, 177 insertions(+), 1 deletion(-)
|
||||
create mode 100644 grub-core/kern/s390x/dl.c
|
||||
create mode 100644 grub-core/lib/s390x/setjmp.S
|
||||
create mode 100644 include/grub/s390x/setjmp.h
|
||||
create mode 100644 include/grub/s390x/time.h
|
||||
create mode 100644 include/grub/s390x/types.h
|
||||
|
||||
diff --git a/grub-core/kern/emu/cache_s.S b/grub-core/kern/emu/cache_s.S
|
||||
index 8ca695c..83e52d6 100644
|
||||
--- a/grub-core/kern/emu/cache_s.S
|
||||
+++ b/grub-core/kern/emu/cache_s.S
|
||||
@@ -24,6 +24,7 @@ FUNCTION (grub_arch_sync_caches)
|
||||
#elif defined(__powerpc__)
|
||||
#include "../powerpc/cache.S"
|
||||
#elif defined(__ia64__) || defined(__arm__) || defined(__aarch64__) || defined(__mips__)
|
||||
+#elif defined(__s390x__)
|
||||
#else
|
||||
#error "No target cpu type is defined"
|
||||
#endif
|
||||
diff --git a/grub-core/kern/emu/lite.c b/grub-core/kern/emu/lite.c
|
||||
index 947c669..4e15872 100644
|
||||
--- a/grub-core/kern/emu/lite.c
|
||||
+++ b/grub-core/kern/emu/lite.c
|
||||
@@ -17,6 +17,8 @@
|
||||
#elif defined(__aarch64__)
|
||||
#include "../arm64/dl_helper.c"
|
||||
#include "../arm64/dl.c"
|
||||
+#elif defined(__s390x__)
|
||||
+#include "../s390x/dl.c"
|
||||
#else
|
||||
#error "No target cpu type is defined"
|
||||
#endif
|
||||
diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c
|
||||
--- a/grub-core/kern/dl.c
|
||||
+++ b/grub-core/kern/dl.c
|
||||
@@ -229,7 +229,7 @@
|
||||
unsigned i;
|
||||
const Elf_Shdr *s;
|
||||
grub_size_t tsize = 0, talign = 1;
|
||||
-#if !defined (__i386__) && !defined (__x86_64__)
|
||||
+#if !defined (__i386__) && !defined (__x86_64__) && !defined (__s390x__)
|
||||
grub_size_t tramp;
|
||||
grub_size_t got;
|
||||
grub_err_t err;
|
||||
@@ -245,7 +245,7 @@
|
||||
talign = s->sh_addralign;
|
||||
}
|
||||
|
||||
-#if !defined (__i386__) && !defined (__x86_64__)
|
||||
+#if !defined (__i386__) && !defined (__x86_64__) && !defined (__s390x__)
|
||||
err = grub_arch_dl_get_tramp_got_size (e, &tramp, &got);
|
||||
if (err)
|
||||
return err;
|
||||
@@ -308,7 +308,7 @@
|
||||
mod->segment = seg;
|
||||
}
|
||||
}
|
||||
-#if !defined (__i386__) && !defined (__x86_64__)
|
||||
+#if !defined (__i386__) && !defined (__x86_64__) && !defined (__s390x__)
|
||||
ptr = (char *) ALIGN_UP ((grub_addr_t) ptr, GRUB_ARCH_DL_TRAMP_ALIGN);
|
||||
mod->tramp = ptr;
|
||||
mod->trampptr = ptr;
|
||||
diff --git a/grub-core/kern/s390x/dl.c b/grub-core/kern/s390x/dl.c
|
||||
new file mode 100644
|
||||
index 0000000..9be5a9e
|
||||
--- /dev/null
|
||||
+++ b/grub-core/kern/s390x/dl.c
|
||||
@@ -0,0 +1,40 @@
|
||||
+/* dl.c - arch-dependent part of loadable module support */
|
||||
+/*
|
||||
+ * GRUB -- GRand Unified Bootloader
|
||||
+ * Copyright (C) 2002,2004,2005,2007,2009 Free Software Foundation, Inc.
|
||||
+ *
|
||||
+ * GRUB is free software: you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * 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 <http://www.gnu.org/licenses/>.
|
||||
+ */
|
||||
+
|
||||
+#include <grub/dl.h>
|
||||
+
|
||||
+/* Check if EHDR is a valid ELF header. */
|
||||
+grub_err_t
|
||||
+grub_arch_dl_check_header (void *ehdr)
|
||||
+{
|
||||
+ (void)(ehdr);
|
||||
+ return GRUB_ERR_BUG;
|
||||
+}
|
||||
+
|
||||
+/* Relocate symbols. */
|
||||
+grub_err_t
|
||||
+grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
+ Elf_Shdr *s, grub_dl_segment_t seg)
|
||||
+{
|
||||
+ (void)(mod);
|
||||
+ (void)(ehdr);
|
||||
+ (void)(s);
|
||||
+ (void)(seg);
|
||||
+ return GRUB_ERR_BUG;
|
||||
+}
|
||||
diff --git a/grub-core/lib/s390x/setjmp.S b/grub-core/lib/s390x/setjmp.S
|
||||
new file mode 100644
|
||||
index 0000000..a3ae29b
|
||||
--- /dev/null
|
||||
+++ b/grub-core/lib/s390x/setjmp.S
|
||||
@@ -0,0 +1,46 @@
|
||||
+/*
|
||||
+ * GRUB -- GRand Unified Bootloader
|
||||
+ * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc.
|
||||
+ *
|
||||
+ * GRUB is free software: you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * 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 <http://www.gnu.org/licenses/>.
|
||||
+ */
|
||||
+
|
||||
+#include <grub/symbol.h>
|
||||
+#include <grub/dl.h>
|
||||
+
|
||||
+ .file "setjmp.S"
|
||||
+
|
||||
+GRUB_MOD_LICENSE "GPLv3+"
|
||||
+
|
||||
+ .text
|
||||
+
|
||||
+/*
|
||||
+ * int grub_setjmp (grub_jmp_buf env)
|
||||
+ */
|
||||
+FUNCTION(grub_setjmp)
|
||||
+ stmg %r11,%r15,0(%r2)
|
||||
+ lghi %r2,0
|
||||
+ br %r14
|
||||
+
|
||||
+/*
|
||||
+ * int grub_longjmp (grub_jmp_buf env, int val)
|
||||
+ */
|
||||
+FUNCTION(grub_longjmp)
|
||||
+ chi %r3,0
|
||||
+ jne .L2
|
||||
+ lghi %r3,1
|
||||
+.L2:
|
||||
+ lmg %r11,%r15,0(%r2)
|
||||
+ lgr %r2,%r3
|
||||
+ br %r14
|
||||
diff --git a/grub-core/lib/setjmp.S b/grub-core/lib/setjmp.S
|
||||
index 2e49742..0b6fb93 100644
|
||||
--- a/grub-core/lib/setjmp.S
|
||||
+++ b/grub-core/lib/setjmp.S
|
||||
@@ -11,6 +11,8 @@
|
||||
#include "./arm/setjmp.S"
|
||||
#elif defined(__aarch64__)
|
||||
#include "./arm64/setjmp.S"
|
||||
+#elif defined(__s390x__)
|
||||
+#include "./s390x/setjmp.S"
|
||||
#else
|
||||
#error "Unknown target cpu type"
|
||||
#endif
|
||||
diff --git a/include/grub/cache.h b/include/grub/cache.h
|
||||
index 2928305..9f8e42b 100644
|
||||
--- a/include/grub/cache.h
|
||||
+++ b/include/grub/cache.h
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/types.h>
|
||||
|
||||
-#if defined (__i386__) || defined (__x86_64__)
|
||||
+#if defined (__i386__) || defined (__x86_64__) || defined (__s390x__)
|
||||
static inline void
|
||||
grub_arch_sync_caches (void *address __attribute__ ((unused)),
|
||||
grub_size_t len __attribute__ ((unused)))
|
||||
diff --git a/include/grub/s390x/setjmp.h b/include/grub/s390x/setjmp.h
|
||||
new file mode 100644
|
||||
index 0000000..5ed87ed
|
||||
--- /dev/null
|
||||
+++ b/include/grub/s390x/setjmp.h
|
||||
@@ -0,0 +1,29 @@
|
||||
+/*
|
||||
+ * GRUB -- GRand Unified Bootloader
|
||||
+ * Copyright (C) 2002,2004,2006,2007,2009 Free Software Foundation, Inc.
|
||||
+ *
|
||||
+ * GRUB is free software: you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * 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 <http://www.gnu.org/licenses/>.
|
||||
+ */
|
||||
+
|
||||
+#ifndef GRUB_SETJMP_CPU_HEADER
|
||||
+#define GRUB_SETJMP_CPU_HEADER 1
|
||||
+
|
||||
+#include <grub/types.h>
|
||||
+
|
||||
+typedef grub_uint64_t grub_jmp_buf[5];
|
||||
+
|
||||
+int grub_setjmp (grub_jmp_buf env) __attribute__ ((returns_twice));
|
||||
+void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn));
|
||||
+
|
||||
+#endif /* ! GRUB_SETJMP_CPU_HEADER */
|
||||
diff --git a/include/grub/s390x/time.h b/include/grub/s390x/time.h
|
||||
new file mode 100644
|
||||
index 0000000..1af9274
|
||||
--- /dev/null
|
||||
+++ b/include/grub/s390x/time.h
|
||||
@@ -0,0 +1,27 @@
|
||||
+/*
|
||||
+ * GRUB -- GRand Unified Bootloader
|
||||
+ * Copyright (C) 2007 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 <http://www.gnu.org/licenses/>.
|
||||
+ */
|
||||
+
|
||||
+#ifndef KERNEL_CPU_TIME_HEADER
|
||||
+#define KERNEL_CPU_TIME_HEADER 1
|
||||
+
|
||||
+static __inline void
|
||||
+grub_cpu_idle (void)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+#endif /* ! KERNEL_CPU_TIME_HEADER */
|
||||
diff --git a/include/grub/s390x/types.h b/include/grub/s390x/types.h
|
||||
new file mode 100644
|
||||
index 0000000..249ca8a
|
||||
--- /dev/null
|
||||
+++ b/include/grub/s390x/types.h
|
||||
@@ -0,0 +1,32 @@
|
||||
+/*
|
||||
+ * GRUB -- GRand Unified Bootloader
|
||||
+ * Copyright (C) 2002,2004,2006,2007 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 <http://www.gnu.org/licenses/>.
|
||||
+ */
|
||||
+
|
||||
+#ifndef GRUB_TYPES_CPU_HEADER
|
||||
+#define GRUB_TYPES_CPU_HEADER 1
|
||||
+
|
||||
+/* The size of void *. */
|
||||
+#define GRUB_TARGET_SIZEOF_VOID_P 8
|
||||
+
|
||||
+/* The size of long. */
|
||||
+#define GRUB_TARGET_SIZEOF_LONG 8
|
||||
+
|
||||
+/* s390x is big-endian. */
|
||||
+#define GRUB_TARGET_WORDS_BIGENDIAN 1
|
||||
+
|
||||
+
|
||||
+#endif /* ! GRUB_TYPES_CPU_HEADER */
|
||||
--
|
||||
1.7.12.4
|
||||
|
@ -1,3 +1,18 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 24 13:48:13 CET 2014 - jjolly@suse.com
|
||||
|
||||
- Add changes to allow build for s390x arch: added
|
||||
grub2-s390x-01-Changes-made-and-files-added-in-order-to-allow-s390x.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 22 05:19:35 UTC 2014 - mchang@suse.com
|
||||
|
||||
- refresh 0002-script-create-menus-for-btrfs-snapshot.patch
|
||||
* Fix bootable snapshots not found while root is on Btrfs subvolume
|
||||
(bnc#859587)
|
||||
* Create missing slave config in /.snapshots/<num>/
|
||||
* Prefix with SUSE_ for related options
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 17 06:23:04 UTC 2014 - mchang@suse.com
|
||||
|
||||
|
34
grub2.spec
34
grub2.spec
@ -26,6 +26,9 @@ BuildRequires: glibc-devel-32bit
|
||||
%else
|
||||
BuildRequires: gcc
|
||||
BuildRequires: glibc-devel
|
||||
%ifarch s390x
|
||||
BuildRequires: glibc-static
|
||||
%endif
|
||||
%endif
|
||||
BuildRequires: automake
|
||||
BuildRequires: bison
|
||||
@ -67,6 +70,11 @@ BuildRequires: pesign-obs-integration
|
||||
%define platform pc
|
||||
%endif
|
||||
|
||||
%ifarch s390x
|
||||
%define grubcpu s390x
|
||||
%define platform emu
|
||||
%endif
|
||||
|
||||
%define grubarch %{grubcpu}-%{platform}
|
||||
|
||||
# build efi bootloader on some platforms only:
|
||||
@ -128,6 +136,7 @@ Patch34: grub2-secureboot-use-linuxefi-on-uefi-in-os-prober.patch
|
||||
Patch35: grub2-linguas.sh-no-rsync.patch
|
||||
Patch36: 0001-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch
|
||||
Patch37: grub2-use-DejaVuSansMono-for-starfield-theme.patch
|
||||
Patch38: grub2-s390x-01-Changes-made-and-files-added-in-order-to-allow-s390x.patch
|
||||
# Btrfs snapshot booting related patches
|
||||
Patch101: 0002-btrfs-add-ability-to-boot-from-subvolumes.patch
|
||||
Patch102: 0003-cmdline-add-envvar-loader_cmdline_append.patch
|
||||
@ -149,7 +158,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%if 0%{?only_x86_64:1}
|
||||
ExclusiveArch: x86_64
|
||||
%else
|
||||
ExclusiveArch: %{ix86} x86_64 ppc ppc64
|
||||
ExclusiveArch: %{ix86} x86_64 ppc ppc64 s390x
|
||||
%endif
|
||||
|
||||
%description
|
||||
@ -257,6 +266,7 @@ mv po/grub.pot po/%{name}.pot
|
||||
%patch35 -p1
|
||||
%patch36 -p1
|
||||
%patch37 -p1
|
||||
%patch38 -p1
|
||||
%patch101 -p1
|
||||
%patch102 -p1
|
||||
%patch103 -p1
|
||||
@ -362,6 +372,12 @@ cd build
|
||||
%define _target_platform i386-%{_vendor}-%{_target_os}%{?_gnu}
|
||||
%endif
|
||||
|
||||
%ifarch s390x
|
||||
%define _devmapper --disable-device-mapper
|
||||
%else
|
||||
%define _devmapper --enable-device-mapper
|
||||
%endif
|
||||
|
||||
# -static is needed so that autoconf script is able to link
|
||||
# test that looks for _start symbol on 64 bit platforms
|
||||
../configure TARGET_LDFLAGS=-static \
|
||||
@ -369,6 +385,7 @@ cd build
|
||||
--sysconfdir=%{_sysconfdir} \
|
||||
--target=%{_target_platform} \
|
||||
--with-platform=%{platform} \
|
||||
%{_devmapper} \
|
||||
--program-transform-name=s,grub,%{name},
|
||||
make %{?_smp_mflags}
|
||||
%endif
|
||||
@ -574,7 +591,6 @@ fi
|
||||
%{_sysconfdir}/grub.d/README
|
||||
%config %{_sysconfdir}/grub.d/??_*
|
||||
%{_sbindir}/%{name}-bios-setup
|
||||
%{_sbindir}/%{name}-install
|
||||
%{_sbindir}/%{name}-macbless
|
||||
%{_sbindir}/%{name}-mkconfig
|
||||
%{_sbindir}/%{name}-once
|
||||
@ -601,6 +617,12 @@ fi
|
||||
%{_bindir}/%{name}-render-label
|
||||
%{_bindir}/%{name}-script-check
|
||||
%{_bindir}/%{name}-syslinux2cfg
|
||||
%ifarch s390x
|
||||
%{_bindir}/%{name}-emu
|
||||
%{_bindir}/%{name}-emu-lite
|
||||
%else
|
||||
%{_sbindir}/%{name}-install
|
||||
%endif
|
||||
%dir %{_libdir}/%{name}
|
||||
%dir %{_datadir}/%{name}
|
||||
%dir %{_datadir}/%{name}/themes
|
||||
@ -630,13 +652,17 @@ fi
|
||||
%{_mandir}/man1/%{name}-script-check.1.*
|
||||
%{_mandir}/man1/%{name}-syslinux2cfg.1.*
|
||||
%{_mandir}/man8/%{name}-bios-setup.8.*
|
||||
%{_mandir}/man8/%{name}-install.8.*
|
||||
%{_mandir}/man8/%{name}-mkconfig.8.*
|
||||
%{_mandir}/man8/%{name}-ofpathname.8.*
|
||||
%{_mandir}/man8/%{name}-probe.8.*
|
||||
%{_mandir}/man8/%{name}-reboot.8.*
|
||||
%{_mandir}/man8/%{name}-set-default.8.*
|
||||
%{_mandir}/man8/%{name}-sparc64-setup.8.*
|
||||
%ifarch s390x
|
||||
%{_mandir}/man1/%{name}-emu.1.*
|
||||
%else
|
||||
%{_mandir}/man8/%{name}-install.8.*
|
||||
%endif
|
||||
|
||||
%files branding-upstream
|
||||
%{_datadir}/%{name}/themes/starfield
|
||||
@ -650,7 +676,7 @@ fi
|
||||
%{_libdir}/%{name}/%{grubarch}/%{name}.chrp
|
||||
%{_libdir}/%{name}/%{grubarch}/bootinfo.txt
|
||||
%endif
|
||||
%ifnarch ppc ppc64
|
||||
%ifnarch ppc ppc64 s390x
|
||||
%{_libdir}/%{name}/%{grubarch}/*.image
|
||||
%endif
|
||||
%{_libdir}/%{name}/%{grubarch}/*.img
|
||||
|
Loading…
Reference in New Issue
Block a user