work around udev's "cosmetic warnings"
authorChristian Hofstaedtler <ch@grml.org>
Mon, 9 May 2011 19:06:52 +0000 (21:06 +0200)
committerChristian Hofstaedtler <ch@grml.org>
Mon, 9 May 2011 19:06:52 +0000 (21:06 +0200)
Debian Bug #624145. All of this should be harmless, and we're taking
extra caution by only targeting the one known problematic udev version.

etc/grml/fai/config/files/etc/initramfs-tools/hooks/000-udev-shutup/GRMLBASE [new file with mode: 0755]
etc/grml/fai/config/scripts/GRMLBASE/10-build-initramfs

diff --git a/etc/grml/fai/config/files/etc/initramfs-tools/hooks/000-udev-shutup/GRMLBASE b/etc/grml/fai/config/files/etc/initramfs-tools/hooks/000-udev-shutup/GRMLBASE
new file mode 100755 (executable)
index 0000000..f125511
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# This file is installed by grml-live in 10-build-initramfs.
+# It's purpose is to shut up so called "cosmetic warnings"
+# introduced in udev 168-1.
+
+PREREQ=""
+prereqs()
+{
+       echo "$PREREQ"
+}
+case $1 in
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+# Restrict this to the known problematic version.
+UDEV_VERSION=$(dpkg-query -W -f '${Version}' udev)
+if [ "$UDEV_VERSION" != "168-1" ]; then
+       exit 0
+fi
+
+. /usr/share/initramfs-tools/hook-functions
+
+TMPFILE=$(mktemp)
+
+cat >$TMPFILE <<EOSH
+#!/bin/sh
+# THIS FILE IS AUTOMATICALLY GENERATED BY
+# /etc/initramfs-tools/hooks/udev_shutup
+exit 0
+EOSH
+
+chmod a+rx $TMPFILE
+
+for i in cdrom_id net.agent mtd_probe; do
+       if [ ! -e "${DESTDIR}"/lib/udev/$i ]; then
+               cp -a $TMPFILE "${DESTDIR}"/lib/udev/$i
+       fi
+done
+
+rm $TMPFILE
+
+exit 0
index c3ed4ea..2d286ea 100755 (executable)
@@ -9,6 +9,7 @@
 set -e
 
 fcopy /usr/share/initramfs-tools/scripts/init-top/grml
+fcopy /etc/initramfs-tools/hooks/000-udev-shutup
 
 FILE=$(ls -1 $target/boot/vmlinuz-* 2>/dev/null| sort -r | head -1)
 KERNELVERSION=$(echo "${FILE##$target/boot/vmlinuz-}")