Re: Installation on NSLU2 does not complete (initramfs nslu2 hook requires user interaction)
Hi Joey and Martin
On Dec 15, 2007 8:19 AM, Martin Michlmayr <tbm@cyrius.com> wrote:
> * Gordon Farquharson <gordonfarquharson@gmail.com> [2007-12-15 02:13]:
> > > if ls -l /sys/class/net/$iface/device | grep -q ixp4xx_mac; then
> > > echo "firmware in use"
> > It does work (I updated the script above to use the commands in svn
> > revision 130).
>
> Gordon, can you also check which with Krzysztof's driver? I bet this
> one uses a different name.
Attached is a patch to the nslu2-utils initramfs nslu2 hook that
updates the nslu2-utils package to work with Krzysztof's driver. I
have also taken the liberty of adding some logic to the initramfs
local-top nslu2 script to remove the module loading message that only
applies to kernel versions less than 2.6.18.
Gordon
--
Gordon Farquharson
GnuPG Key ID: 32D6D676
Index: initramfs-tools/hooks/nslu2
===================================================================
--- initramfs-tools/hooks/nslu2 (revision 132)
+++ initramfs-tools/hooks/nslu2 (working copy)
@@ -7,7 +7,7 @@
}
need_ethernet() {
- if [ -n "$(lsmod |egrep 'ixp400_eth|ixp4xx_npe')" ]; then
+ if [ -n "$(lsmod |egrep 'ixp400_eth|ixp4xx_npe|ixp4xx_eth')" ]; then
return 0
else
return 1
@@ -50,7 +50,7 @@
fi
fi
;;
-*)
+2.6.1[8-9]* | 2.6.20* | 2.6.2[1-3]*)
if [ ! -e "/lib/firmware/NPE-B" ]; then
echo "Warning: ixp4xx_npe ethernet driver firmware file /lib/firmware/NPE-B not found" >&2
if need_ethernet; then
@@ -65,6 +65,21 @@
fi
fi
;;
+*)
+ if [ ! -e "/lib/firmware/NPE-B" ]; then
+ echo "Warning: ixp4xx_npe ethernet driver firmware file /lib/firmware/NPE-B not found" >&2
+ if need_ethernet; then
+ for iface in $(route -n | grep "^0.0.0.0 " | grep UG | sed 's/.* //'); do
+ if [ -n "$iface" ] && readlink /sys/class/net/"$iface"/device 2>/dev/null | grep -q ixp4xx_eth; then
+ echo "Warning: This system is using the ixp4xx_eth ethernet module;" >&2
+ echo "it's not safe to create an initramfs image for the new kernel" >&2
+ echo "without the firmware file." >&2
+ pause_error
+ fi
+ done
+ fi
+ fi
+;;
esac
# Record the root filesystem device for use during boot, since the slug's
Index: initramfs-tools/scripts/local-top/nslu2
===================================================================
--- initramfs-tools/scripts/local-top/nslu2 (revision 132)
+++ initramfs-tools/scripts/local-top/nslu2 (working copy)
@@ -16,7 +16,10 @@
# This driver is non-free; load if available.
# As of 2.6.18, it's replaced with a free driver that will be loaded by
# udev.
-echo "Loading Intel IXP400 ethernet driver"
-if ! modprobe ixp400_eth; then
- echo "Failed to load Intel IXP400 ethernet driver"
+version=$(uname -r | cut -c -6)
+if [ "$version" \< "2.6.18" ]; then
+ echo "Loading Intel IXP400 ethernet driver"
+ if ! modprobe ixp400_eth; then
+ echo "Failed to load Intel IXP400 ethernet driver"
+ fi
fi
Reply to: