Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Juuso Alasuutari (f8b2ee6d8ac682671f8ded5b8b522dd910efa7d5)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Juuso Alasuutari <scm AT mail.sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Juuso Alasuutari (f8b2ee6d8ac682671f8ded5b8b522dd910efa7d5)
  • Date: Sun, 25 Jun 2006 08:49:52 -0500

GIT changes to master grimoire by Juuso Alasuutari <iuso AT sourcemage.org>:

disk/udev/BUILD | 16 ++++-----
disk/udev/CONFIGURE | 22 ++++++++-----
disk/udev/HISTORY | 10 ++++++
disk/udev/INSTALL | 18 +++++------
disk/udev/Makefile.patch | 8 ++--
disk/udev/PRE_BUILD | 20 +++++++-----
disk/udev/ifrename_wait_retry.patch | 58
++++++++++++++++++++++++++++++++++++
7 files changed, 114 insertions(+), 38 deletions(-)

New commits:
commit f8b2ee6d8ac682671f8ded5b8b522dd910efa7d5
Merge: 5c44922247ec3e591535415f00fca8e72a66cd01
49bb843c7d730e9ade106c94ab8fa9ab5697e405
Author: Juuso Alasuutari <iuso AT sourcemage.org>
Commit: Juuso Alasuutari <iuso AT sourcemage.org>

Merge branch 'master' of
ssh://jalasuutari AT scm.sourcemage.org/smgl/grimoire

commit 5c44922247ec3e591535415f00fca8e72a66cd01
Author: Juuso Alasuutari <iuso AT sourcemage.org>
Commit: Juuso Alasuutari <iuso AT sourcemage.org>

Added patch to allow network interface renaming with existing names.
Commented out parts about static targets, only udevstart.static is
installed, and udevstart is deprecated.

diff --git a/disk/udev/BUILD b/disk/udev/BUILD
index a94395a..90cbc23 100755
--- a/disk/udev/BUILD
+++ b/disk/udev/BUILD
@@ -8,12 +8,12 @@ if [[ "$UDEV_EXTRAS" == 'y' ]]; then
make EXTRAS="extras/ata_id extras/dasd_id extras/edd_id extras/floppy
extras/scsi_id extras/usb_id extras/volume_id" \
prefix=${INSTALL_ROOT}/ exec_prefix=${INSTALL_ROOT}/ ${OPTS} \
${UDEV_DEBUG} DEST_DIR="./" V=true
-fi &&
-
-if [[ "$UDEV_STATIC" == 'y' ]]; then
- pushd __static__ &&
- # we are not going to use `make install' so no need to set its parameters
- message "${MESSAGE_COLOR}Building static utilities:
$UDEV_STATIC_TARGET${DEFAULT_COLOR}" &&
- make USE_STATIC=true V=true $OPTS $UDEV_STATIC_TARGET &&
- popd
fi
+
+#if [[ "$UDEV_STATIC" == 'y' ]]; then
+# pushd __static__ &&
+# # we are not going to use `make install' so no need to set its parameters
+# message "${MESSAGE_COLOR}Building static utilities:
$UDEV_STATIC_TARGET${DEFAULT_COLOR}" &&
+# make USE_STATIC=true V=true $OPTS $UDEV_STATIC_TARGET &&
+# popd
+#fi
diff --git a/disk/udev/CONFIGURE b/disk/udev/CONFIGURE
index 065d4ed..e387202 100755
--- a/disk/udev/CONFIGURE
+++ b/disk/udev/CONFIGURE
@@ -1,17 +1,21 @@
config_query UDEV_PERSIST 'Install persistent storage rules?' n &&
+
if [ "$RECENT_KERNEL" == "y" ]; then
config_query UDEV_PERSIST_INPUT 'Install persistent input rules?' n
fi &&
-config_query UDEV_STATIC 'Create static binaries in addition to dynamically
linked ones?' n &&
+
config_query_option UDEV_DEBUG 'Compile extra debugging messages?' n
'DEBUG=true' 'DEBUG=false' &&
-if [[ "$UDEV_STATIC" == 'y' ]]; then
- if [[ -z "$UDEV_STATIC_TARGET" ]]; then
- # add more UDEV utilities here as necessary, space-separated
- local UDEV_STATIC_TARGET="udevstart"
- fi &&
- persistent_add UDEV_STATIC_TARGET &&
- message "${MESSAGE_COLOR}Static utilities (with suffix .static):
$UDEV_STATIC_TARGET${DEFAULT_COLOR}"
-fi &&
+
+#config_query UDEV_STATIC 'Create static binaries in addition to dynamically
linked ones?' n &&
+#if [[ "$UDEV_STATIC" == 'y' ]]; then
+# if [[ -z "$UDEV_STATIC_TARGET" ]]; then
+# # add more UDEV utilities here as necessary, space-separated
+# local UDEV_STATIC_TARGET="udevstart"
+# fi &&
+# persistent_add UDEV_STATIC_TARGET &&
+# message "${MESSAGE_COLOR}Static utilities (with suffix .static):
$UDEV_STATIC_TARGET${DEFAULT_COLOR}"
+#fi &&
+
if [[ "$UDEV_PERSIST" == "y" ]]; then
UDEV_EXTRAS=y &&
persistent_add UDEV_EXTRAS
diff --git a/disk/udev/HISTORY b/disk/udev/HISTORY
index 97dee70..db612b1 100644
--- a/disk/udev/HISTORY
+++ b/disk/udev/HISTORY
@@ -1,3 +1,13 @@
+2006-06-25 Juuso Alasuutari <iuso AT sourcemage.org>
+ * PRE_BUILD: Added patch to allow network interface renaming
+ with existing names. Added comments about patches, tidied
+ code.
+ * CONFIGURE, PRE_BUILD, BUILD, INSTALL: Commented out static
+ target parts, it only installs udevstart which is deprecated
+ now.
+ * ifrename_wait_retry.patch: Added.
+ * Makefile.patch: Updated.
+
2006-06-24 Juuso Alasuutari <iuso AT sourcemage.org>
* helpers/mac2name: Edited to read DEVICE_MAC instead of MAC in
/etc/sysconfig/network/*.dev. Fixed a bug where supplying no
diff --git a/disk/udev/INSTALL b/disk/udev/INSTALL
index f4fe9b5..648c03b 100755
--- a/disk/udev/INSTALL
+++ b/disk/udev/INSTALL
@@ -64,13 +64,13 @@ if [[ "$UDEV_EXTRAS" == 'y' ]]; then
install_config_file etc/udev/60-persistent-input.rules
${UDEV_CFG}/rules.d/60-persistent-input.rules
fi
fi
-fi &&
-
-if [[ "$UDEV_STATIC" == 'y' ]]; then
- pushd __static__ &&
- # we are not supposed to use `make install'
- for FILE in $UDEV_STATIC_TARGET; do
- install -D $FILE $INSTALL_ROOT/usr/sbin/$FILE.static
- done &&
- popd
fi
+
+#if [[ "$UDEV_STATIC" == 'y' ]]; then
+# pushd __static__ &&
+# # we are not supposed to use `make install'
+# for FILE in $UDEV_STATIC_TARGET; do
+# install -D $FILE $INSTALL_ROOT/usr/sbin/$FILE.static
+# done &&
+# popd
+#fi
diff --git a/disk/udev/Makefile.patch b/disk/udev/Makefile.patch
index 6807c62..77c1c5b 100644
--- a/disk/udev/Makefile.patch
+++ b/disk/udev/Makefile.patch
@@ -1,7 +1,7 @@
---- Makefile 2005-12-03 19:11:40.000000000 +0100
-+++ Makefile.new 2005-12-03 19:12:18.000000000 +0100
-@@ -340,11 +340,6 @@
- echo $$target; \
+--- Makefile 2006-06-25 15:48:49.000000000 +0300
++++ Makefile.new 2006-06-25 15:49:39.000000000 +0300
+@@ -294,11 +294,6 @@
+ @extras="$(EXTRAS)"; for target in $$extras; do \
$(MAKE) -C $$target $@ || exit 1; \
done;
-ifndef DESTDIR
diff --git a/disk/udev/PRE_BUILD b/disk/udev/PRE_BUILD
index a74738d..c0c1f0e 100755
--- a/disk/udev/PRE_BUILD
+++ b/disk/udev/PRE_BUILD
@@ -1,9 +1,13 @@
-default_pre_build &&
-cd $SOURCE_DIRECTORY &&
-patch -p0 < $SCRIPT_DIRECTORY/Makefile.patch &&
+default_pre_build &&
+cd $SOURCE_DIRECTORY &&

-if [[ "$UDEV_STATIC" == 'y' ]]; then
- message "${MESSAGE_COLOR}Setting up static build
directory...${DEFAULT_COLOR}" &&
- mkdir __static__ &&
- cp -aRv Makefile *.{c,h} ./__static__/
-fi
+# Prevent udev restart on 'make install',
+# allow network interface renaming with existing name.
+patch -p0 < $SCRIPT_DIRECTORY/Makefile.patch &&
+patch -p0 < $SCRIPT_DIRECTORY/ifrename_wait_retry.patch
+
+#if [[ "$UDEV_STATIC" == 'y' ]]; then
+# message "${MESSAGE_COLOR}Setting up static build
directory...${DEFAULT_COLOR}" &&
+# mkdir __static__ &&
+# cp -aRv Makefile *.{c,h} ./__static__/
+#fi
diff --git a/disk/udev/ifrename_wait_retry.patch
b/disk/udev/ifrename_wait_retry.patch
new file mode 100644
index 0000000..ecc57e8
--- /dev/null
+++ b/disk/udev/ifrename_wait_retry.patch
@@ -0,0 +1,58 @@
+--- udev_device.c 2006-06-25 15:56:38.000000000 +0300
++++ udev_device.c.new 2006-06-25 15:52:20.000000000 +0300
+@@ -86,6 +86,7 @@
+ int sk;
+ struct ifreq ifr;
+ int retval;
++ int timeout = (1000000 / 50000) * 30; /* 30 seconds */
+
+ info("changing net interface name from '%s' to '%s'",
udev->dev->kernel_name, udev->name);
+ if (udev->test_run)
+@@ -102,10 +103,44 @@
+ strlcpy(ifr.ifr_newname, udev->name, IFNAMSIZ);
+
+ retval = ioctl(sk, SIOCSIFNAME, &ifr);
+- if (retval != 0)
+- err("error changing net interface name: %s", strerror(errno));
+- close(sk);
++ if (retval != 0) {
++ if (errno != EEXIST) {
++ err("error changing net interface name %s to %s: %s",
ifr.ifr_name, ifr.ifr_newname, strerror(errno));
++ goto error;
++ }
++
++ /* Destination interface already exits.
++ * First rename our interface to something temporary in case
++ * we're trying to swap with that one. */
++ strlcpy(ifr.ifr_newname, udev->dev->kernel_name, IFNAMSIZ);
++ strlcat(ifr.ifr_newname, "_temp", IFNAMSIZ);
++
++ retval = ioctl(sk, SIOCSIFNAME, &ifr);
++ if (retval != 0) {
++ err("error changing net interface name %s to %s: %s",
ifr.ifr_name, ifr.ifr_newname, strerror(errno));
++ goto error;
++ }
++
++ /* Now we loop until our target interface goes away. */
++ strlcpy(ifr.ifr_name, ifr.ifr_newname, IFNAMSIZ);
++ strlcpy(ifr.ifr_newname, udev->name, IFNAMSIZ);
++ while ((retval = ioctl(sk, SIOCSIFNAME, &ifr)) != 0) {
++ if (errno != EEXIST) {
++ err("error changing net interface name %s to
%s: %s", ifr.ifr_name, ifr.ifr_newname, strerror(errno));
++ break;
++ }
++
++ if (timeout-- <= 0) {
++ err("error changing net interface name %s to
%s: timeout", ifr.ifr_name, ifr.ifr_newname);
++ break;
++ }
+
++ usleep(50000);
++ }
++ }
++
++error:
++ close(sk);
+ return retval;
+ }
+



  • [SM-Commit] GIT changes to master grimoire by Juuso Alasuutari (f8b2ee6d8ac682671f8ded5b8b522dd910efa7d5), Juuso Alasuutari, 06/25/2006

Archive powered by MHonArc 2.6.24.

Top of Page