forked from pool/grub2
Accepting request 574126 from home:michael-chang:branches:Base:System
- Fix disappeared snapshot menu entry (bsc#1078481) * 80_suse_btrfs_snapshot OBS-URL: https://build.opensuse.org/request/show/574126 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=290
This commit is contained in:
parent
e41839391d
commit
b83d902412
@ -1,10 +1,22 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
SNAPSHOTS="/.snapshots"
|
||||||
if [ "x${SUSE_BTRFS_SNAPSHOT_BOOTING}" = "xtrue" ] &&
|
if [ "x${SUSE_BTRFS_SNAPSHOT_BOOTING}" = "xtrue" ] &&
|
||||||
[ "x${GRUB_FS}" = "xbtrfs" ] ; then
|
[ "x${GRUB_FS}" = "xbtrfs" ] &&
|
||||||
|
[ -f "${SNAPSHOTS}/grub-snapshot.cfg" ]; then
|
||||||
|
SNAPSHOT_RID=`btrfs inspect-internal rootid ${SNAPSHOTS}`
|
||||||
|
ROOT_RID=`btrfs inspect-internal rootid /`
|
||||||
|
if [ -n "${SNAPSHOT_RID}" -a "${SNAPSHOT_RID}" != "${ROOT_RID}" ]; then
|
||||||
|
SNAPSHOT_SUBVOL=`btrfs inspect-internal subvolid-resolve ${SNAPSHOT_RID} /`
|
||||||
|
ROOT_SUBVOL=`btrfs inspect-internal subvolid-resolve ${ROOT_RID} /`
|
||||||
|
INODE=`stat -c '%i' ${SNAPSHOTS}`
|
||||||
|
if [ "x${INODE}" = "x256" -a "x${ROOT_SUBVOL}${SNAPSHOTS}" != "x${SNAPSHOT_SUBVOL}" ]; then
|
||||||
|
echo "btrfs-mount-subvol (\$root) ${SNAPSHOTS} ${SNAPSHOT_SUBVOL}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
if [ -f "/.snapshots/grub-snapshot.cfg" ]; then
|
if [ -f "${SNAPSHOTS}/grub-snapshot.cfg" ]; then
|
||||||
source "/.snapshots/grub-snapshot.cfg"
|
source "${SNAPSHOTS}/grub-snapshot.cfg"
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Feb 7 09:58:26 UTC 2018 - mchang@suse.com
|
||||||
|
|
||||||
|
- Fix disappeared snapshot menu entry (bsc#1078481)
|
||||||
|
* 80_suse_btrfs_snapshot
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Feb 6 09:44:26 UTC 2018 - mchang@suse.com
|
Tue Feb 6 09:44:26 UTC 2018 - mchang@suse.com
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user