Accepting request 412486 from Virtualization
- appliance fixes (fate#316274): * re-add helper script mount-rootfs-and-chroot.sh for virt-rescue appliance.patch * make guestfs-data a requirement of guestfs-tools OBS-URL: https://build.opensuse.org/request/show/412486 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libguestfs?expand=0&rev=41
This commit is contained in:
commit
21f8977f4b
15
appliance.patch
Normal file
15
appliance.patch
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
Index: libguestfs-1.32.4/appliance/init
|
||||||
|
===================================================================
|
||||||
|
--- libguestfs-1.32.4.orig/appliance/init
|
||||||
|
+++ libguestfs-1.32.4/appliance/init
|
||||||
|
@@ -182,7 +182,9 @@ else
|
||||||
|
echo
|
||||||
|
echo "Note: The contents of / are the rescue appliance."
|
||||||
|
echo "You have to mount the guest's partitions under /sysroot"
|
||||||
|
- echo "before you can examine them."
|
||||||
|
+ echo "before you can examine them. A helper script for that exists:"
|
||||||
|
+ echo "mount-rootfs-and-chroot.sh /dev/sda2"
|
||||||
|
+
|
||||||
|
echo
|
||||||
|
bash -i
|
||||||
|
echo
|
@ -1,3 +1,11 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jul 20 19:47:22 UTC 2016 - cbosdonnat@suse.com
|
||||||
|
|
||||||
|
- appliance fixes (fate#316274):
|
||||||
|
* re-add helper script mount-rootfs-and-chroot.sh for virt-rescue
|
||||||
|
appliance.patch
|
||||||
|
* make guestfs-data a requirement of guestfs-tools
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Jul 20 08:32:21 UTC 2016 - cbosdonnat@suse.com
|
Wed Jul 20 08:32:21 UTC 2016 - cbosdonnat@suse.com
|
||||||
|
|
||||||
|
@ -199,9 +199,11 @@ Summary: Compatibility package for guestfs-tools
|
|||||||
License: GPL-2.0
|
License: GPL-2.0
|
||||||
Group: System/Filesystems
|
Group: System/Filesystems
|
||||||
Patch0: 0000-hotfix.patch
|
Patch0: 0000-hotfix.patch
|
||||||
|
Patch100: appliance.patch
|
||||||
|
|
||||||
Source0: %{name}-%{version}.tar.xz
|
Source0: %{name}-%{version}.tar.xz
|
||||||
Source1: libguestfs.rpmlintrc
|
Source1: libguestfs.rpmlintrc
|
||||||
|
Source100: mount-rootfs-and-chroot.sh
|
||||||
Source789653: Pod-Simple-3.23.tar.xz
|
Source789653: Pod-Simple-3.23.tar.xz
|
||||||
#
|
#
|
||||||
Source10001: libguestfs.test.simple.run-libugestfs-test-tool.sh
|
Source10001: libguestfs.test.simple.run-libugestfs-test-tool.sh
|
||||||
@ -256,7 +258,7 @@ Requires: perl(Win::Hivex)
|
|||||||
Requires: perl(Win::Hivex::Regedit)
|
Requires: perl(Win::Hivex::Regedit)
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
Recommends: guestfs-data
|
Requires: guestfs-data
|
||||||
Conflicts: guestfs-data < %{version}
|
Conflicts: guestfs-data < %{version}
|
||||||
Conflicts: libguestfs0 < %{version}
|
Conflicts: libguestfs0 < %{version}
|
||||||
|
|
||||||
@ -558,6 +560,7 @@ It can import a variety of guest operating systems from libvirt-managed hosts.
|
|||||||
: _ignore_exclusive_arch '%{?_ignore_exclusive_arch}'
|
: _ignore_exclusive_arch '%{?_ignore_exclusive_arch}'
|
||||||
%setup -q -a 789653
|
%setup -q -a 789653
|
||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
|
%patch100 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
bison --version
|
bison --version
|
||||||
@ -681,6 +684,14 @@ rm -rf $RPM_BUILD_ROOT/tmp
|
|||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/tmp/usr/bin
|
||||||
|
cp %{S:100} $RPM_BUILD_ROOT/tmp/usr/bin
|
||||||
|
chmod a+x $RPM_BUILD_ROOT/tmp/usr/bin/*
|
||||||
|
pushd $RPM_BUILD_ROOT/tmp
|
||||||
|
tar czf $RPM_BUILD_ROOT/%{_libdir}/guestfs/supermin.d/zz-scripts.tar.gz usr
|
||||||
|
popd
|
||||||
|
rm -rf $RPM_BUILD_ROOT/tmp
|
||||||
|
|
||||||
%if %{with p2v}
|
%if %{with p2v}
|
||||||
# Remove the kickstart files from p2v package
|
# Remove the kickstart files from p2v package
|
||||||
rm $RPM_BUILD_ROOT/%{_datadir}/virt-p2v/p2v.ks.in
|
rm $RPM_BUILD_ROOT/%{_datadir}/virt-p2v/p2v.ks.in
|
||||||
|
45
mount-rootfs-and-chroot.sh
Normal file
45
mount-rootfs-and-chroot.sh
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Usage: $0 /dev/sda5
|
||||||
|
rootfs=$1
|
||||||
|
mnt=/sysroot
|
||||||
|
mounts=
|
||||||
|
|
||||||
|
if test -b "${rootfs}"
|
||||||
|
then
|
||||||
|
|
||||||
|
mkdir -v -p "${mnt}"
|
||||||
|
|
||||||
|
if mount -v "${rootfs}" "${mnt}"
|
||||||
|
then
|
||||||
|
|
||||||
|
for i in dev dev/pts proc sys selinux
|
||||||
|
do
|
||||||
|
if test -d /${i} && test -d "${mnt}/${i}" && test "`stat -c %D /`" != "`stat -c %D ${i}`"
|
||||||
|
then
|
||||||
|
mount -v --bind /${i} "${mnt}/${i}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
chroot "${mnt}" su -
|
||||||
|
|
||||||
|
while read b m rest
|
||||||
|
do
|
||||||
|
case "${m}" in
|
||||||
|
${mnt}*)
|
||||||
|
mounts="${m} ${mounts}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done <<-EOF
|
||||||
|
`
|
||||||
|
cat < /proc/mounts
|
||||||
|
`
|
||||||
|
EOF
|
||||||
|
|
||||||
|
for i in ${mounts}
|
||||||
|
do
|
||||||
|
umount -v "${i}"
|
||||||
|
done
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user