Bug#245535: hw-detect: Fail sometimes if /etc/network/ is missing
Package: hw-detect
Version: 0.84
Tags: d-i patch
The package hw-detect fail sometimes, when this code is executed and
/etc/network/ don't exist:
if [ -n "$newdevs" -a -n "$cardname" ]; then
for dev in $newdevs; do
echo "${dev}:${cardname}" >> /etc/network/devnames
done
fi
A description of the error is available from
<URL:http://bugs.skolelinux.no/show_bug.cgi?id=719>. The fix is
probably to make sure /etc/network/ exists before appending to the
file.
Index: hw-detect.sh
===================================================================
--- hw-detect.sh (revision 13701)
+++ hw-detect.sh (working copy)
@@ -64,6 +64,7 @@
newdevs="$(compare_devs "$olddevs" "$devs")"
if [ -n "$newdevs" -a -n "$cardname" ]; then
+ mkdir -p /etc/network
for dev in $newdevs; do
echo "${dev}:${cardname}" >> /etc/network/devnames
done
The code in question was added by joshk-guest.
Reply to: