SHA256
1
0
forked from pool/grub2

Accepting request 253483 from Base:System

1

OBS-URL: https://build.opensuse.org/request/show/253483
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/grub2?expand=0&rev=102
This commit is contained in:
Stephan Kulow 2014-10-05 18:27:20 +00:00 committed by Git OBS Bridge
parent 0f5ff60671
commit 950c565c10
4 changed files with 80 additions and 1 deletions

10
80_suse_btrfs_snapshot Normal file
View File

@ -0,0 +1,10 @@
#! /bin/sh
set -e
if [ "x${SUSE_BTRFS_SNAPSHOT_BOOTING}" = "xtrue" ] &&
[ "x${GRUB_FS}" = "xbtrfs" ] ; then
cat <<EOF
if [ -f "/.snapshots/grub-snapshot.cfg" ]; then
source "/.snapshots/grub-snapshot.cfg"
fi
EOF
fi

View File

@ -0,0 +1,28 @@
From 4afd0107efa6a2d9cbe6fc71c529264dc2b9fb8a Mon Sep 17 00:00:00 2001
From: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Date: Mon, 31 Mar 2014 15:32:30 +0100
Subject: [PATCH] btrfs: fix get_root key comparison failures due to endianness
* grub-core/fs/btrfs.c (get_root): Convert
GRUB_BTRFS_ROOT_VOL_OBJECTID to little-endian.
---
ChangeLog | 7 +++++++
grub-core/fs/btrfs.c | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
index 89666b6..f7b6c15 100644
--- a/grub-core/fs/btrfs.c
+++ b/grub-core/fs/btrfs.c
@@ -1201,7 +1201,7 @@ get_root (struct grub_btrfs_data *data, struct grub_btrfs_key *key,
struct grub_btrfs_key key_out, key_in;
struct grub_btrfs_root_item ri;
- key_in.object_id = GRUB_BTRFS_ROOT_VOL_OBJECTID;
+ key_in.object_id = grub_cpu_to_le64_compile_time (GRUB_BTRFS_ROOT_VOL_OBJECTID);
key_in.offset = 0;
key_in.type = GRUB_BTRFS_ITEM_TYPE_ROOT_ITEM;
err = lower_bound (data, &key_in, &key_out,
--
1.8.4.5

View File

@ -1,3 +1,21 @@
-------------------------------------------------------------------
Tue Sep 30 03:45:04 UTC 2014 - mchang@suse.com
- packaging 20_memtest86+ and 20_ppc_terminfo in corresponing grubarch
package
-------------------------------------------------------------------
Mon Sep 29 07:22:29 UTC 2014 - fcastelli@suse.com
- Add '80_suse_btrfs_snapshot' required to show btrfs snapshots inside
of the boot menu.
-------------------------------------------------------------------
Sun Sep 28 06:16:35 UTC 2014 - arvidjaar@gmail.com
- fix btrfs on big endian systems (ppc/ppc64)
* add grub2-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch
-------------------------------------------------------------------
Sun Sep 21 06:47:12 UTC 2014 - arvidjaar@gmail.com

View File

@ -122,6 +122,7 @@ Source7: 20_memtest86+
Source10: openSUSE-UEFI-CA-Certificate.crt
Source11: SLES-UEFI-CA-Certificate.crt
Source12: grub2-snapper-plugin.sh
Source14: 80_suse_btrfs_snapshot
Source1000: PATCH_POLICY
Patch1: rename-grub-info-file-to-grub2.patch
Patch2: grub2-linux.patch
@ -156,6 +157,7 @@ Patch44: grub2-glibc-2.20.patch
Patch45: grub2-efinet-reopen-SNP-protocol-for-exclusive-use-by-grub.patch
Patch46: grub2-xen-legacy-config-device-name.patch
Patch47: grub2-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch
Patch48: grub2-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch
# Btrfs snapshot booting related patches
Patch101: grub2-btrfs-01-add-ability-to-boot-from-subvolumes.patch
Patch102: grub2-btrfs-02-export-subvolume-envvars.patch
@ -361,6 +363,7 @@ mv po/grub.pot po/%{name}.pot
%patch45 -p1
%patch46 -p1
%patch47 -p1
%patch48 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
@ -619,6 +622,15 @@ rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.h
install -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/default/grub
install -m 755 -D %{SOURCE6} $RPM_BUILD_ROOT%{_sbindir}/grub2-once
install -m 755 -D %{SOURCE12} $RPM_BUILD_ROOT%{_libdir}/snapper/plugins/grub
install -m 755 -D %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/grub.d/80_suse_btrfs_snapshot
%ifnarch %{ix86} x86_64
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/grub.d/20_memtest86+
%endif
%ifnarch ppc ppc64 ppc64le
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/grub.d/20_ppc_terminfo
%endif
%ifarch ppc ppc64 ppc64le
# Rename grub2.chrp back to grub.chrp so it is found by tools
@ -766,7 +778,13 @@ fi
%config(noreplace) %{_sysconfdir}/default/grub
%dir %{_sysconfdir}/grub.d
%{_sysconfdir}/grub.d/README
%config %{_sysconfdir}/grub.d/??_*
%config %{_sysconfdir}/grub.d/00_header
%config %{_sysconfdir}/grub.d/10_linux
%config %{_sysconfdir}/grub.d/20_linux_xen
%config %{_sysconfdir}/grub.d/30_os-prober
%config %{_sysconfdir}/grub.d/40_custom
%config %{_sysconfdir}/grub.d/41_custom
%config %{_sysconfdir}/grub.d/90_persistent
%{_sbindir}/%{name}-bios-setup
%{_sbindir}/%{name}-macbless
%{_sbindir}/%{name}-mkconfig
@ -848,8 +866,12 @@ fi
%files %{grubarch}
%defattr(-,root,root,-)
%ifarch %{ix86} x86_64
%config %{_sysconfdir}/grub.d/20_memtest86+
%endif
%dir %{_libdir}/%{name}/%{grubarch}
%ifarch ppc ppc64 ppc64le
%config %{_sysconfdir}/grub.d/20_ppc_terminfo
# This is intentionally "grub.chrp" and not "%{name}.chrp"
%{_libdir}/%{name}/%{grubarch}/grub.chrp
%{_libdir}/%{name}/%{grubarch}/bootinfo.txt
@ -898,6 +920,7 @@ fi
%defattr(-,root,root,-)
%dir %{_libdir}/snapper
%dir %{_libdir}/snapper/plugins
%config %{_sysconfdir}/grub.d/80_suse_btrfs_snapshot
%{_libdir}/snapper/plugins/grub
%ifarch x86_64