forked from pool/libvirt
Accepting request 755864 from Virtualization
OBS-URL: https://build.opensuse.org/request/show/755864 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libvirt?expand=0&rev=294
This commit is contained in:
commit
7bdfa06c44
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Dec 10 08:24:09 UTC 2019 - Cédric Bosdonnat <cbosdonnat@suse.com>
|
||||||
|
|
||||||
|
- virt-create-rootfs: add SLE 15 and SLE 12 service packs support
|
||||||
|
bsc#1154093
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Dec 2 23:24:23 UTC 2019 - James Fehlig <jfehlig@suse.com>
|
Mon Dec 2 23:24:23 UTC 2019 - James Fehlig <jfehlig@suse.com>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package libvirt
|
# spec file for package libvirt
|
||||||
#
|
#
|
||||||
# Copyright (c) 2019 SUSE LLC.
|
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
Index: libvirt-5.10.0/tools/Makefile.am
|
Index: libvirt-4.0.0/tools/Makefile.am
|
||||||
===================================================================
|
===================================================================
|
||||||
--- libvirt-5.10.0.orig/tools/Makefile.am
|
--- libvirt-4.0.0.orig/tools/Makefile.am
|
||||||
+++ libvirt-5.10.0/tools/Makefile.am
|
+++ libvirt-4.0.0/tools/Makefile.am
|
||||||
@@ -60,6 +60,7 @@ PODFILES = \
|
@@ -52,6 +52,7 @@ PODFILES = \
|
||||||
virt-sanlock-cleanup.pod \
|
virt-sanlock-cleanup.pod \
|
||||||
virt-xml-validate.pod \
|
virt-xml-validate.pod \
|
||||||
virsh.pod \
|
virsh.pod \
|
||||||
@ -10,7 +10,7 @@ Index: libvirt-5.10.0/tools/Makefile.am
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
MANINFILES = \
|
MANINFILES = \
|
||||||
@@ -94,7 +95,7 @@ MAINTAINERCLEANFILES =
|
@@ -86,7 +87,7 @@ MAINTAINERCLEANFILES =
|
||||||
confdir = $(sysconfdir)/libvirt
|
confdir = $(sysconfdir)/libvirt
|
||||||
conf_DATA =
|
conf_DATA =
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ Index: libvirt-5.10.0/tools/Makefile.am
|
|||||||
bin_PROGRAMS = virsh virt-admin
|
bin_PROGRAMS = virsh virt-admin
|
||||||
libexec_SCRIPTS = libvirt-guests.sh
|
libexec_SCRIPTS = libvirt-guests.sh
|
||||||
man1_MANS = \
|
man1_MANS = \
|
||||||
@@ -121,6 +122,8 @@ bin_PROGRAMS += virt-host-validate
|
@@ -112,6 +113,8 @@ bin_PROGRAMS += virt-host-validate
|
||||||
man1_MANS += virt-host-validate.1
|
man1_MANS += virt-host-validate.1
|
||||||
endif WITH_HOST_VALIDATE
|
endif WITH_HOST_VALIDATE
|
||||||
|
|
||||||
@ -28,11 +28,11 @@ Index: libvirt-5.10.0/tools/Makefile.am
|
|||||||
virt-xml-validate: virt-xml-validate.in Makefile
|
virt-xml-validate: virt-xml-validate.in Makefile
|
||||||
$(AM_V_GEN)sed -e 's|[@]schemadir@|$(pkgdatadir)/schemas|g' \
|
$(AM_V_GEN)sed -e 's|[@]schemadir@|$(pkgdatadir)/schemas|g' \
|
||||||
-e 's|[@]VERSION@|$(VERSION)|g' \
|
-e 's|[@]VERSION@|$(VERSION)|g' \
|
||||||
Index: libvirt-5.10.0/tools/virt-create-rootfs
|
Index: libvirt-4.0.0/tools/virt-create-rootfs
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ libvirt-5.10.0/tools/virt-create-rootfs
|
+++ libvirt-4.0.0/tools/virt-create-rootfs
|
||||||
@@ -0,0 +1,214 @@
|
@@ -0,0 +1,231 @@
|
||||||
+#!/bin/sh
|
+#!/bin/sh
|
||||||
+set -e
|
+set -e
|
||||||
+
|
+
|
||||||
@ -57,7 +57,6 @@ Index: libvirt-5.10.0/tools/virt-create-rootfs
|
|||||||
+ -a, --arch target architecture
|
+ -a, --arch target architecture
|
||||||
+ -u, --url URL of the registration server
|
+ -u, --url URL of the registration server
|
||||||
+ -c, --regcode registration code for the product
|
+ -c, --regcode registration code for the product
|
||||||
+ -p, --root-pass the root password to set in the root FS
|
|
||||||
+ --dry-run don't actually run it
|
+ --dry-run don't actually run it
|
||||||
+EOF
|
+EOF
|
||||||
+}
|
+}
|
||||||
@ -67,7 +66,6 @@ Index: libvirt-5.10.0/tools/virt-create-rootfs
|
|||||||
+DISTRO=
|
+DISTRO=
|
||||||
+URL=
|
+URL=
|
||||||
+REG_CODE=
|
+REG_CODE=
|
||||||
+ROOT_PASS=
|
|
||||||
+DRY_RUN=
|
+DRY_RUN=
|
||||||
+
|
+
|
||||||
+while test $# -gt 0
|
+while test $# -gt 0
|
||||||
@ -140,14 +138,6 @@ Index: libvirt-5.10.0/tools/virt-create-rootfs
|
|||||||
+ shift
|
+ shift
|
||||||
+ ;;
|
+ ;;
|
||||||
+
|
+
|
||||||
+ -p | --root-pass)
|
|
||||||
+ if test $# -lt 2; then
|
|
||||||
+ fail "$1 needs a value"
|
|
||||||
+ fi
|
|
||||||
+ ROOT_PASS=$2
|
|
||||||
+ shift
|
|
||||||
+ ;;
|
|
||||||
+
|
|
||||||
+ --dry-run)
|
+ --dry-run)
|
||||||
+ DRY_RUN="yes"
|
+ DRY_RUN="yes"
|
||||||
+ ;;
|
+ ;;
|
||||||
@ -177,15 +167,32 @@ Index: libvirt-5.10.0/tools/virt-create-rootfs
|
|||||||
+function install_sle
|
+function install_sle
|
||||||
+{
|
+{
|
||||||
+ PRODUCT="$1"
|
+ PRODUCT="$1"
|
||||||
+ VERSION="$2"
|
+ TARGET_VERSION="$2"
|
||||||
+
|
+
|
||||||
+ case "$VERSION" in
|
+ case "$TARGET_VERSION" in
|
||||||
+ 12.0)
|
+ 12.0)
|
||||||
+ # Transform into zypper internal version scheme
|
+ # Transform into zypper internal version scheme
|
||||||
+ VERSION="12"
|
+ TARGET_VERSION="12"
|
||||||
|
+ ;;
|
||||||
|
+ 15.0)
|
||||||
|
+ TARGET_VERSION="15"
|
||||||
|
+ ;;
|
||||||
|
+ 12.*|15.*)
|
||||||
+ ;;
|
+ ;;
|
||||||
+ *)
|
+ *)
|
||||||
+ fail "Unhandled SLE version: $VERSION"
|
+ fail "Unhandled SLE version: $TARGET_VERSION"
|
||||||
|
+ ;;
|
||||||
|
+ esac
|
||||||
|
+
|
||||||
|
+ # Depending on the distro we run, we may have some preliminary things to do
|
||||||
|
+ . /etc/os-release
|
||||||
|
+ case "$VERSION_ID" in
|
||||||
|
+ 15*)
|
||||||
|
+ # on SLE 15 we need to symlink the two path to the RPM DB or the GPG
|
||||||
|
+ # key won't be found.
|
||||||
|
+ mkdir -p "$ROOT/usr/lib/sysimage/rpm"
|
||||||
|
+ mkdir -p "$ROOT/var/lib"
|
||||||
|
+ ln -s ../../usr/lib/sysimage/rpm "$ROOT/var/lib"
|
||||||
+ ;;
|
+ ;;
|
||||||
+ esac
|
+ esac
|
||||||
+
|
+
|
||||||
@ -209,13 +216,30 @@ Index: libvirt-5.10.0/tools/virt-create-rootfs
|
|||||||
+ if test -n "$URL"; then
|
+ if test -n "$URL"; then
|
||||||
+ CONNECT_ARGS="$CONNECT_ARGS --url $URL"
|
+ CONNECT_ARGS="$CONNECT_ARGS --url $URL"
|
||||||
+ fi
|
+ fi
|
||||||
+ $RUN SUSEConnect -p "$PRODUCT/$VERSION/$ARCH" --root "$ROOT" $CONNECT_ARGS
|
+
|
||||||
|
+ PATTERN=Minimal
|
||||||
|
+ case "$TARGET_VERSION" in
|
||||||
|
+ 12*)
|
||||||
|
+ $RUN SUSEConnect -p "$PRODUCT/$TARGET_VERSION/$ARCH" --root "$ROOT" $CONNECT_ARGS
|
||||||
|
+ ;;
|
||||||
|
+ 15*)
|
||||||
|
+ # Due to SLE 15 modules we need to add the product first, let it fail,
|
||||||
|
+ # add the basesystem
|
||||||
|
+ set +e
|
||||||
|
+ $RUN SUSEConnect -p "$PRODUCT/$TARGET_VERSION/$ARCH" --root "$ROOT" $CONNECT_ARGS
|
||||||
|
+ set -e
|
||||||
|
+ $RUN SUSEConnect -p "sle-module-basesystem/$TARGET_VERSION/$ARCH" --root "$ROOT" $CONNECT_ARGS
|
||||||
|
+ PATTERN=base
|
||||||
|
+ ;;
|
||||||
|
+ esac
|
||||||
+
|
+
|
||||||
+ # Then we install what we need
|
+ # Then we install what we need
|
||||||
+ call_zypper in -t pattern Minimal
|
+ call_zypper -n in --auto-agree-with-licenses -t pattern $PATTERN
|
||||||
+
|
+
|
||||||
+ # Create the baseproduct symlink
|
+ # Create the baseproduct symlink if missing
|
||||||
|
+ if ! test -e "$ROOT/etc/products.d/baseproduct"; then
|
||||||
+ ln -s $PRODUCT.prod "$ROOT/etc/products.d/baseproduct"
|
+ ln -s $PRODUCT.prod "$ROOT/etc/products.d/baseproduct"
|
||||||
|
+ fi
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+case "$DISTRO" in
|
+case "$DISTRO" in
|
||||||
@ -227,16 +251,9 @@ Index: libvirt-5.10.0/tools/virt-create-rootfs
|
|||||||
+ ;;
|
+ ;;
|
||||||
+
|
+
|
||||||
+ openSUSE-*)
|
+ openSUSE-*)
|
||||||
+ VERSION=${DISTRO:9}
|
+ TARGET_VERSION=${DISTRO:9}
|
||||||
+ case "$VERSION" in
|
+ REPO="http://download.opensuse.org/distribution/$TARGET_VERSION/repo/oss/"
|
||||||
+ 13.1)
|
+ UPDATE_REPO="http://download.opensuse.org/update/$TARGET_VERSION/"
|
||||||
+ REPO="http://download.opensuse.org/distribution/13.1/repo/oss/"
|
|
||||||
+ UPDATE_REPO="http://download.opensuse.org/update/13.1/"
|
|
||||||
+ ;;
|
|
||||||
+ *)
|
|
||||||
+ fail "Unhandled openSUSE version: $VERSION"
|
|
||||||
+ ;;
|
|
||||||
+ esac
|
|
||||||
+ call_zypper ar "$REPO" "openSUSE"
|
+ call_zypper ar "$REPO" "openSUSE"
|
||||||
+ call_zypper ar "$UPDATE_REPO" "openSUSE udpate"
|
+ call_zypper ar "$UPDATE_REPO" "openSUSE udpate"
|
||||||
+ call_zypper in --no-recommends -t pattern base
|
+ call_zypper in --no-recommends -t pattern base
|
||||||
@ -247,11 +264,11 @@ Index: libvirt-5.10.0/tools/virt-create-rootfs
|
|||||||
+ echo "pts/0" >> "$ROOT/etc/securetty"
|
+ echo "pts/0" >> "$ROOT/etc/securetty"
|
||||||
+ chroot "$ROOT" /usr/bin/passwd
|
+ chroot "$ROOT" /usr/bin/passwd
|
||||||
+fi
|
+fi
|
||||||
Index: libvirt-5.10.0/tools/virt-create-rootfs.pod
|
Index: libvirt-4.0.0/tools/virt-create-rootfs.pod
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ libvirt-5.10.0/tools/virt-create-rootfs.pod
|
+++ libvirt-4.0.0/tools/virt-create-rootfs.pod
|
||||||
@@ -0,0 +1,77 @@
|
@@ -0,0 +1,73 @@
|
||||||
+=head1 NAME
|
+=head1 NAME
|
||||||
+
|
+
|
||||||
+virt-create-rootfs - tool to create a root file system for distro containers.
|
+virt-create-rootfs - tool to create a root file system for distro containers.
|
||||||
@ -303,10 +320,6 @@ Index: libvirt-5.10.0/tools/virt-create-rootfs.pod
|
|||||||
+For SLE distributions, set the registration server to use.
|
+For SLE distributions, set the registration server to use.
|
||||||
+Default: http://scc.suse.com.
|
+Default: http://scc.suse.com.
|
||||||
+
|
+
|
||||||
+=item B<-p, --root-pass>
|
|
||||||
+
|
|
||||||
+If defined, set the root password for the new root file system.
|
|
||||||
+
|
|
||||||
+=item B<--dry-run>
|
+=item B<--dry-run>
|
||||||
+
|
+
|
||||||
+Don't do anything, just report what would be done.
|
+Don't do anything, just report what would be done.
|
||||||
|
Loading…
Reference in New Issue
Block a user