Skip to contentSkip to conversation

hotplug/Linux: remove hotplug support, rely on udev instead

PATCH In review Olaf Hering 2 participants 5 messages Oct 12, 2012 – Oct 18, 2012 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hotplug/Linux: remove hotplug support, rely on udev instead

 Makefile                              |   1 -
 README                                |   8 +++---
 install.sh                            |  14 ------------
 tools/hotplug/Linux/Makefile          |  34 +-----------------------------
 tools/hotplug/Linux/xen-backend.agent |  39 -----------------------------------
 5 files changed, 5 insertions(+), 91 deletions(-)

# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1350048922 -7200
# Node ID 597f0885494d0441b10c06938c62d50d4efb3fea # Parent e0e1350dfe9b7a6cacb1378f75d8e6536d22eb2d hotplug/Linux: remove hotplug support, rely on udev instead

Hotplug has been replaced by udev since several years. Remove the hotplug related files and install udev unconditionally.

This makes it possible to remove udev from rpm BuildRequires which reduces the buildtime dependency chain. For openSuSE:Factory it was done just now:
http://lists.opensuse.org/opensuse-buildservice/2012-10/msg00085.html

The patch by itself will have no practical impact unless someone attempts to build and run a Xen dom0 on a really old base system.

Makefile +0 -1
diff -r e0e1350dfe9b -r 597f0885494d Makefile
@@ -223,7 +223,6 @@ uninstall:
 	$(MAKE) -C xen uninstall
 	rm -rf $(D)$(CONFIG_DIR)/init.d/xendomains $(D)$(CONFIG_DIR)/init.d/xend
 	rm -rf $(D)$(CONFIG_DIR)/init.d/xencommons $(D)$(CONFIG_DIR)/init.d/xen-watchdog
-	rm -rf $(D)$(CONFIG_DIR)/hotplug/xen-backend.agent
 	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xen-backend.rules
 	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules
 	rm -f  $(D)$(SYSCONFIG_DIR)/xendomains
README +4 -4
diff -r e0e1350dfe9b -r 597f0885494d README
@@ -54,7 +54,7 @@ provided by your OS distributor:
     * pkg-config
     * bridge-utils package (/sbin/brctl)
     * iproute package (/sbin/ip)
-    * hotplug or udev
+    * udev
     * GNU bison and GNU flex
     * GNU gettext
     * 16-bit x86 assembler, loader and compiler (dev86 rpm or bin86 & bcc debs)
@@ -120,9 +120,9 @@ 4. To rebuild an existing tree without m
 
    make install and make dist differ in that make install does the
    right things for your local machine (installing the appropriate
-   version of hotplug or udev scripts, for example), but make dist
-   includes all versions of those scripts, so that you can copy the dist
-   directory to another machine and install from that distribution.
+   version of udev scripts, for example), but make dist includes all
+   versions of those scripts, so that you can copy the dist directory
+   to another machine and install from that distribution.
    
 Python Runtime Libraries
 ========================
install.sh +0 -14
diff -r e0e1350dfe9b -r 597f0885494d install.sh
@@ -27,20 +27,6 @@ tmp="`mktemp -d`"
 echo "Installing Xen from '$src' to '$dst'..."
 (cd $src; tar -cf - * ) | tar -C "$tmp" -xf -
 
-[ -x "$(which udevinfo)" ] && \
-  UDEV_VERSION=$(udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
-
-[ -z "$UDEV_VERSION" -a -x /sbin/udevadm ] && \
-  UDEV_VERSION=$(/sbin/udevadm info -V | awk '{print $NF}')
-
-if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
-  echo " - installing for udev-based system"
-  rm -rf "$tmp/etc/hotplug"
-else
-  echo " - installing for hotplug-based system"
-  rm -rf "$tmp/etc/udev"
-fi
-
 echo " - modifying permissions"
 chmod -R a+rX "$tmp"
 
tools/hotplug/Linux/Makefile +1 -33
diff -r e0e1350dfe9b -r 597f0885494d tools/hotplug/Linux/Makefile
@@ -27,32 +27,9 @@ XEN_SCRIPT_DATA += xen-hotplug-common.sh
 XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
 XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
 
-XEN_HOTPLUG_DIR = $(CONFIG_DIR)/hotplug
-XEN_HOTPLUG_SCRIPTS = xen-backend.agent
-
-UDEVVER = 0
-ifeq ($(shell [ -x /sbin/udevadm ] && echo 1),1)
-UDEVVER = $(shell /sbin/udevadm info -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/' )
-endif
-ifeq ($(shell [ -x /usr/bin/udevinfo ] && echo 1),1)
-UDEVVER = $(shell /usr/bin/udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/' )
-endif
-
 UDEV_RULES_DIR = $(CONFIG_DIR)/udev
 UDEV_RULES = xen-backend.rules xend.rules
 
-DI = $(if $(DISTDIR),$(shell readlink -f $(DISTDIR)),)
-DE = $(if $(DESTDIR),$(shell readlink -f $(DESTDIR)),)
-ifeq ($(findstring $(DI),$(DE)),$(DI))
-HOTPLUGS=install-hotplug install-udev
-else
-ifeq ($(shell [ $(UDEVVER) -ge 059 ] && echo 1),1)
-HOTPLUGS=install-udev
-else
-HOTPLUGS=install-hotplug
-endif
-endif
-
 .PHONY: all
 all:
 
@@ -60,7 +37,7 @@ all:
 build:
 
 .PHONY: install
-install: all install-initd install-scripts $(HOTPLUGS)
+install: all install-initd install-scripts install-udev
 
 # See docs/misc/distro_mapping.txt for INITD_DIR location
 .PHONY: install-initd
@@ -87,15 +64,6 @@ install-scripts:
 	    $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
 	done
 
-.PHONY: install-hotplug
-install-hotplug:
-	[ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \
-		$(INSTALL_DIR) $(DESTDIR)$(XEN_HOTPLUG_DIR)
-	set -e; for i in $(XEN_HOTPLUG_SCRIPTS); \
-	    do \
-	    $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \
-	done
-
 .PHONY: install-udev
 install-udev:
 	[ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \
tools/hotplug/Linux/xen-backend.agent deleted +0 -39
diff -r e0e1350dfe9b -r 597f0885494d tools/hotplug/Linux/xen-backend.agent
@@ -1,39 +0,0 @@
-#! /bin/bash
-
-PATH=/etc/xen/scripts:$PATH
-
-. /etc/xen/scripts/locking.sh
-
-claim_lock xenbus_hotplug_global
-
-case "$XENBUS_TYPE" in
-  tap)
-    /etc/xen/scripts/blktap "$ACTION"
-    ;;
-  vbd)
-    /etc/xen/scripts/block "$ACTION"
-    ;;
-  vtpm)
-    /etc/xen/scripts/vtpm "$ACTION"
-    ;;
-  vif)
-    [ -n "$script" ] && $script "$ACTION"
-    ;;
-  vscsi)
-    /etc/xen/scripts/vscsi "$ACTION"
-    ;;
-esac
-
-case "$ACTION" in
-  add)
-    ;;
-  remove)
-    /etc/xen/scripts/xen-hotplug-cleanup
-    ;;
-  online)
-    ;;
-  offline)
-    ;;
-esac
-
-release_lock xenbus_hotplug_global
Acked-by on v1 1/1
#1 lore raw
Quoted 18 lines · Olaf Hering

Makefile | 1 -

 README                                |   8 +++---
 install.sh                            |  14 ------------
 tools/hotplug/Linux/Makefile          |  34 +-----------------------------
 tools/hotplug/Linux/xen-backend.agent |  39 -----------------------------------
 5 files changed, 5 insertions(+), 91 deletions(-)

# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1350048922 -7200
# Node ID 597f0885494d0441b10c06938c62d50d4efb3fea # Parent e0e1350dfe9b7a6cacb1378f75d8e6536d22eb2d hotplug/Linux: remove hotplug support, rely on udev instead

Hotplug has been replaced by udev since several years. Remove the hotplug related files and install udev unconditionally.

Quoted 7 lines

This makes it possible to remove udev from rpm BuildRequires which reduces the buildtime dependency chain. For openSuSE:Factory it was done just now:
http://lists.opensuse.org/opensuse-buildservice/2012-10/msg00085.html

The patch by itself will have no practical impact unless someone attempts to build and run a Xen dom0 on a really old base system.

Does anyone have any idea what sort of timeframe hotplug agent stuff really died in, just so we can document something?

RHEL5, SLES10 and Debian Stable all have udev AFAIK, which is about as old as we care about for the dom0.

Quoted 1 line
Quoted 170 lines

diff -r e0e1350dfe9b -r 597f0885494d Makefile

Makefile +0 -1
@@ -223,7 +223,6 @@ uninstall:
 	$(MAKE) -C xen uninstall
 	rm -rf $(D)$(CONFIG_DIR)/init.d/xendomains $(D)$(CONFIG_DIR)/init.d/xend
 	rm -rf $(D)$(CONFIG_DIR)/init.d/xencommons $(D)$(CONFIG_DIR)/init.d/xen-watchdog
-	rm -rf $(D)$(CONFIG_DIR)/hotplug/xen-backend.agent
 	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xen-backend.rules
 	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules
 	rm -f  $(D)$(SYSCONFIG_DIR)/xendomains

diff -r e0e1350dfe9b -r 597f0885494d README

README +4 -4
@@ -54,7 +54,7 @@ provided by your OS distributor:
     * pkg-config
     * bridge-utils package (/sbin/brctl)
     * iproute package (/sbin/ip)
-    * hotplug or udev
+    * udev
     * GNU bison and GNU flex
     * GNU gettext
     * 16-bit x86 assembler, loader and compiler (dev86 rpm or bin86 & bcc debs)
@@ -120,9 +120,9 @@ 4. To rebuild an existing tree without m
 
    make install and make dist differ in that make install does the
    right things for your local machine (installing the appropriate
-   version of hotplug or udev scripts, for example), but make dist
-   includes all versions of those scripts, so that you can copy the dist
-   directory to another machine and install from that distribution.
+   version of udev scripts, for example), but make dist includes all
+   versions of those scripts, so that you can copy the dist directory
+   to another machine and install from that distribution.
 
 Python Runtime Libraries
 ========================

diff -r e0e1350dfe9b -r 597f0885494d install.sh

install.sh +0 -14
@@ -27,20 +27,6 @@ tmp="`mktemp -d`"
 echo "Installing Xen from '$src' to '$dst'..."
 (cd $src; tar -cf - * ) | tar -C "$tmp" -xf -
 
-[ -x "$(which udevinfo)" ] && \
-  UDEV_VERSION=$(udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
-
-[ -z "$UDEV_VERSION" -a -x /sbin/udevadm ] && \
-  UDEV_VERSION=$(/sbin/udevadm info -V | awk '{print $NF}')
-
-if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
-  echo " - installing for udev-based system"
-  rm -rf "$tmp/etc/hotplug"
-else
-  echo " - installing for hotplug-based system"
-  rm -rf "$tmp/etc/udev"
-fi
-
 echo " - modifying permissions"
 chmod -R a+rX "$tmp"
 

diff -r e0e1350dfe9b -r 597f0885494d tools/hotplug/Linux/Makefile

tools/hotplug/Linux/Makefile +1 -33
@@ -27,32 +27,9 @@ XEN_SCRIPT_DATA += xen-hotplug-common.sh
 XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
 XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
 
-XEN_HOTPLUG_DIR = $(CONFIG_DIR)/hotplug
-XEN_HOTPLUG_SCRIPTS = xen-backend.agent
-
-UDEVVER = 0
-ifeq ($(shell [ -x /sbin/udevadm ] && echo 1),1)
-UDEVVER = $(shell /sbin/udevadm info -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/' )
-endif
-ifeq ($(shell [ -x /usr/bin/udevinfo ] && echo 1),1)
-UDEVVER = $(shell /usr/bin/udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/' )
-endif
-
 UDEV_RULES_DIR = $(CONFIG_DIR)/udev
 UDEV_RULES = xen-backend.rules xend.rules
 
-DI = $(if $(DISTDIR),$(shell readlink -f $(DISTDIR)),)
-DE = $(if $(DESTDIR),$(shell readlink -f $(DESTDIR)),)
-ifeq ($(findstring $(DI),$(DE)),$(DI))
-HOTPLUGS=install-hotplug install-udev
-else
-ifeq ($(shell [ $(UDEVVER) -ge 059 ] && echo 1),1)
-HOTPLUGS=install-udev
-else
-HOTPLUGS=install-hotplug
-endif
-endif
-
 .PHONY: all
 all:
 
@@ -60,7 +37,7 @@ all:
 build:
 
 .PHONY: install
-install: all install-initd install-scripts $(HOTPLUGS)
+install: all install-initd install-scripts install-udev
 
 # See docs/misc/distro_mapping.txt for INITD_DIR location
 .PHONY: install-initd
@@ -87,15 +64,6 @@ install-scripts:
 	    $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
 	done
 
-.PHONY: install-hotplug
-install-hotplug:
-	[ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \
-		$(INSTALL_DIR) $(DESTDIR)$(XEN_HOTPLUG_DIR)
-	set -e; for i in $(XEN_HOTPLUG_SCRIPTS); \
-	    do \
-	    $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \
-	done
-
 .PHONY: install-udev
 install-udev:
 	[ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \

diff -r e0e1350dfe9b -r 597f0885494d tools/hotplug/Linux/xen-backend.agent

tools/hotplug/Linux/xen-backend.agent deleted +0 -39
@@ -1,39 +0,0 @@
-#! /bin/bash
-
-PATH=/etc/xen/scripts:$PATH
-
-. /etc/xen/scripts/locking.sh
-
-claim_lock xenbus_hotplug_global
-
-case "$XENBUS_TYPE" in
-  tap)
-    /etc/xen/scripts/blktap "$ACTION"
-    ;;
-  vbd)
-    /etc/xen/scripts/block "$ACTION"
-    ;;
-  vtpm)
-    /etc/xen/scripts/vtpm "$ACTION"
-    ;;
-  vif)
-    [ -n "$script" ] && $script "$ACTION"
-    ;;
-  vscsi)
-    /etc/xen/scripts/vscsi "$ACTION"
-    ;;
-esac
-
-case "$ACTION" in
-  add)
-    ;;
-  remove)
-    /etc/xen/scripts/xen-hotplug-cleanup
-    ;;
-  online)
-    ;;
-  offline)
-    ;;
-esac
-
-release_lock xenbus_hotplug_global

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 6 lines · Ian Campbell
Quoted 2 lines · Olaf Hering

The patch by itself will have no practical impact unless someone attempts to build and run a Xen dom0 on a really old base system.

Does anyone have any idea what sort of timeframe hotplug agent stuff really died in, just so we can document something?

SLES9 (back in 2007) had an early version of udev, hotplug was still in use. It looks like hotplug.rpm was finally dropped from SuSE Linux in 2005.

Olaf

#3 lore raw
Quoted 11 lines · Olaf Hering
Quoted 6 lines · Ian Campbell
Quoted 2 lines · Olaf Hering

The patch by itself will have no practical impact unless someone attempts to build and run a Xen dom0 on a really old base system.

Does anyone have any idea what sort of timeframe hotplug agent stuff really died in, just so we can document something?

SLES9 (back in 2007) had an early version of udev, hotplug was still in use. It looks like hotplug.rpm was finally dropped from SuSE Linux in 2005.

2005 was after 2007 though?

Any way, I've added "e.g. circa SLES9/2007 or earlier" to the end of the commit message and will apply.

#4 lore raw
Quoted 10 lines · Ian Campbell
Quoted 9 lines · Olaf Hering
Quoted 6 lines · Ian Campbell
Quoted 2 lines · Olaf Hering

The patch by itself will have no practical impact unless someone attempts to build and run a Xen dom0 on a really old base system.

Does anyone have any idea what sort of timeframe hotplug agent stuff really died in, just so we can document something?

Quoted 7 lines
Quoted 2 lines

SLES9 (back in 2007) had an early version of udev, hotplug was still in use. It looks like hotplug.rpm was finally dropped from SuSE Linux in 2005.

2005 was after 2007 though?

Any way, I've added "e.g. circa SLES9/2007 or earlier" to the end of the commit message and will apply.

Thanks.
SLES9 was branched and released in July 2004, the last service pack #4 was released in December 2007.

Olaf