[libguestfs] Include patches to fix udev.
Richard W.M. Jones
rjones at fedoraproject.org
Mon May 28 15:49:43 UTC 2012
commit a21344533f835f251eb0656fe6afbb473505046a
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Mon May 28 16:48:41 2012 +0100
Include patches to fix udev.
...ove-udev-common-package-name-to-the-commo.patch | 50 ++++++++++++
...devd-has-been-renamed-since-it-joined-sys.patch | 83 ++++++++++++++++++++
...estfs-1.19.2-remove-udev-from-packagelist.patch | 11 +++
libguestfs.spec | 19 ++++-
4 files changed, 162 insertions(+), 1 deletions(-)
---
diff --git a/0001-appliance-Move-udev-common-package-name-to-the-commo.patch b/0001-appliance-Move-udev-common-package-name-to-the-commo.patch
new file mode 100644
index 0000000..f5da2f7
--- /dev/null
+++ b/0001-appliance-Move-udev-common-package-name-to-the-commo.patch
@@ -0,0 +1,50 @@
+From a7e4a6c692554e4207b3bdff65946427e66e9fce Mon Sep 17 00:00:00 2001
+From: "Richard W.M. Jones" <rjones at redhat.com>
+Date: Mon, 28 May 2012 10:01:45 -0400
+Subject: [PATCH 1/2] appliance: Move udev (common package name) to the common
+ section.
+
+This should be just code motion.
+---
+ appliance/packagelist.in | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/appliance/packagelist.in b/appliance/packagelist.in
+index c4484db..980dc0e 100644
+--- a/appliance/packagelist.in
++++ b/appliance/packagelist.in
+@@ -40,7 +40,6 @@
+ reiserfs-utils
+ libselinux
+ systemd /* for /sbin/reboot */
+- udev
+ util-linux-ng
+ vim-minimal
+ xz
+@@ -64,7 +63,6 @@
+ ntfs-3g
+ ntfsprogs
+ reiserfsprogs
+- udev
+ ufsutils
+ util-linux
+ vim-tiny
+@@ -87,7 +85,6 @@
+ ntfsprogs
+ ntfs-3g
+ reiserfsprogs
+- udev
+ util-linux-ng
+ xz
+ #endif /* ARCHLINUX */
+@@ -125,6 +122,7 @@ psmisc
+ scrub
+ strace
+ tar
++udev
+ #ifndef UBUNTU
+ /* on Ubuntu contains a file in /lib64 which conflicts with libc6 that has
+ * /lib64 as a symbolic link
+--
+1.7.10.1
+
diff --git a/0002-appliance-udevd-has-been-renamed-since-it-joined-sys.patch b/0002-appliance-udevd-has-been-renamed-since-it-joined-sys.patch
new file mode 100644
index 0000000..8cfb5f6
--- /dev/null
+++ b/0002-appliance-udevd-has-been-renamed-since-it-joined-sys.patch
@@ -0,0 +1,83 @@
+From a7868dd3c940b6cee0894e6033ba611f01a423dd Mon Sep 17 00:00:00 2001
+From: "Richard W.M. Jones" <rjones at redhat.com>
+Date: Mon, 28 May 2012 16:09:15 +0100
+Subject: [PATCH 2/2] appliance: 'udevd' has been renamed, since it joined
+ systemd.
+
+---
+ appliance/init | 57 ++++++++++++++++++++++++++++----------------------------
+ 1 file changed, 29 insertions(+), 28 deletions(-)
+
+diff --git a/appliance/init b/appliance/init
+index 4461e30..6fac4fb 100755
+--- a/appliance/init
++++ b/appliance/init
+@@ -31,36 +31,37 @@ if [ ! -L /etc/init.d/udev -a -x /etc/init.d/udev ]; then
+ fi
+ elif [ -x /sbin/start_udev ] && /sbin/start_udev; then
+ :
+-elif [ -x /sbin/udevd ]; then
+- echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
+- /sbin/udevd --daemon
+- udevadm trigger
+- udevadm settle
+-elif [ -x /lib/udev/udevd ]; then
+- echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
+- /lib/udev/udevd --daemon
+- udevadm trigger
+- udevadm settle
+ else
+- echo No udev, creating /dev manually
+- mount -t tmpfs none /dev
+- mkdir /dev/pts /dev/shm /dev/mapper
+- mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts
+- # Must do each MAKEDEV individually, because if one device fails,
+- # MAKEDEV will quit without creating the rest (RHBZ#507374).
+- for dev in mem null port zero core full ram tty console fd \
+- hda hdb hdc hdd sda sdb sdc sdd loop sd; do
+- MAKEDEV $dev ||:
++ # Find udevd and run it directly.
++ for f in /sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd; do
++ if [ -x "$f" ]; then UDEVD="$f"; fi
+ done
+- mknod /dev/ptmx c 5 2; chmod 0666 /dev/ptmx
+- mknod /dev/random c 1 8; chmod 0666 /dev/random
+- mknod /dev/urandom c 1 9; chmod 0444 /dev/urandom
+- ln -sf /proc/self/fd/0 /dev/stdin
+- ln -sf /proc/self/fd/1 /dev/stdout
+- ln -sf /proc/self/fd/2 /dev/stderr
+-
+- modprobe virtio_pci
+- modprobe virtio_net
++ if [ -n "$UDEVD" ]; then
++ echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
++ $UDEVD --daemon
++ udevadm trigger
++ udevadm settle
++ else
++ echo No udevd, creating /dev manually.
++ mount -t tmpfs none /dev
++ mkdir /dev/pts /dev/shm /dev/mapper
++ mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts
++ # Must do each MAKEDEV individually, because if one device fails,
++ # MAKEDEV will quit without creating the rest (RHBZ#507374).
++ for dev in mem null port zero core full ram tty console fd \
++ hda hdb hdc hdd sda sdb sdc sdd loop sd; do
++ MAKEDEV $dev ||:
++ done
++ mknod /dev/ptmx c 5 2; chmod 0666 /dev/ptmx
++ mknod /dev/random c 1 8; chmod 0666 /dev/random
++ mknod /dev/urandom c 1 9; chmod 0444 /dev/urandom
++ ln -sf /proc/self/fd/0 /dev/stdin
++ ln -sf /proc/self/fd/1 /dev/stdout
++ ln -sf /proc/self/fd/2 /dev/stderr
++
++ modprobe virtio_pci
++ modprobe virtio_net
++ fi
+ fi
+
+ if grep -sq selinux=1 /proc/cmdline; then
+--
+1.7.10.1
+
diff --git a/libguestfs-1.19.2-remove-udev-from-packagelist.patch b/libguestfs-1.19.2-remove-udev-from-packagelist.patch
new file mode 100644
index 0000000..dbb1c76
--- /dev/null
+++ b/libguestfs-1.19.2-remove-udev-from-packagelist.patch
@@ -0,0 +1,11 @@
+--- libguestfs/appliance/packagelist.in.orig 2012-05-28 16:44:31.259942705 +0100
++++ libguestfs/appliance/packagelist.in 2012-05-28 16:44:33.919892387 +0100
+@@ -122,7 +122,7 @@
+ scrub
+ strace
+ tar
+-udev
++/*udev*/
+ #ifndef UBUNTU
+ /* on Ubuntu contains a file in /lib64 which conflicts with libc6 that has
+ * /lib64 as a symbolic link
diff --git a/libguestfs.spec b/libguestfs.spec
index 0915bfd..bbced48 100644
--- a/libguestfs.spec
+++ b/libguestfs.spec
@@ -22,7 +22,7 @@ Summary: Access and modify virtual machine disk images
Name: libguestfs
Epoch: 1
Version: 1.19.2
-Release: 1%{?dist}
+Release: 2%{?dist}
License: LGPLv2+
Group: Development/Libraries
URL: http://libguestfs.org/
@@ -34,6 +34,16 @@ Patch1: ruby-1.9-vendor-not-site.patch
BuildRequires: autoconf, automake, libtool, gettext-devel
%endif
+# Upstream patches to fix udev since it was moved into systemd.
+Patch2: 0001-appliance-Move-udev-common-package-name-to-the-commo.patch
+Patch3: 0002-appliance-udevd-has-been-renamed-since-it-joined-sys.patch
+
+# Non-upstream patch to remove udev from the packagelist. systemd now
+# 'obsoletes' udev, but febootstrap doesn't get this relationship
+# right. When udev disappears from the repository we can remove this
+# patch.
+Patch4: libguestfs-1.19.2-remove-udev-from-packagelist.patch
+
%if 0%{?rhel} >= 7
ExclusiveArch: x86_64
%endif
@@ -676,6 +686,10 @@ for %{name}.
autoreconf -i
%endif
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+
mkdir -p daemon/m4
# Replace developer-specific README that ships with libguestfs, with
@@ -1082,6 +1096,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Mon May 28 2012 Richard W.M. Jones <rjones at redhat.com> - 1:1.19.2-2
+- Include patches to fix udev.
+
* Mon May 28 2012 Richard W.M. Jones <rjones at redhat.com> - 1:1.19.2-1
- New upstream version 1.19.2.
More information about the scm-commits
mailing list