Slitaz on NFS root

Slitaz won’t work out of the box on a NFS root, two problems have to been fixed:

  • Kernel
  • udhcp default script


Recompile the kernel (as described here):

  • call “tazpkg get-install linux-source”, this will install get-linux-source and all the kernel patches
  • call “tazpkg get-install slitaz-toolchain”, this will install the binaries needed for compiling kernels
  • call “tazpkg get-install ncurses-dev”, this will install ncurses files needed for the make target “menuconfig”
  • call “tazpkg get-install perl”, needed by kernel malefiles
  • call “get-linux-source”, this will download the kernel sources and patch them
  • cd into /usr/src/linux-$(version)
  • call “make menuconfig”
  • activate “IP: kernel level autoconfiguration” (CONFIG_IP_PNP)
  • activate “IP: DHCP support” (CONFIG_IP_PNP_DHCP)
  • activate “Root file system on NFS” (CONFIG_ROOT_NFS)
  • call “make bzImage”
  • copy the resulting kernel (arch/x86/boot/bzImage) beside the exisiting kernel and add it to grub’s menu.lst or copy it over the existing kernel (not prefered since it would be overwritten when doing a kernel package update).

Patch /usr/share/udhcpc/default.script

Since udhcp would pull down the exisiting ethernet connection on the device used for the NFS mount we have to check for the NFS mount. The format defininition of the /proc/mounts changed in lately kernels so there are two possible regexps, the version active works on SliTaz cooking. I’m not sure on which kernel version the format did change.

Please patch the included /usr/share/udhcpc/default.script using the patch attached

@@ -9,9 +9,19 @@
[ -n “$broadcast” ] && BROADCAST=”broadcast $broadcast”
[ -n “$subnet” ] && NETMASK=”netmask $subnet”

+# return 0 if root is mounted on a network filesystem
+root_is_nfs() {
+        ## old style
+        # grep -qe ‘^/dev/root.*\(nfs\|smbfs\|ncp\|coda\) .*’ /proc/mounts
+        ## new style
+        grep -qe ‘^.*:.* / \(nfs\|smbfs\|ncp\|coda\) .*’ /proc/mounts
case “$1” in
–               /sbin/ifconfig $interface
+               if ! root_is_nfs ; then
+                       /sbin/ifconfig $interface
+               fi
for i in /etc/ipdown.d/*; do
[ -x $i ] && $i $interface
@@ -22,9 +32,11 @@

if [ -n “$router” ] ; then
echo “deleting routers”
–                       while route del default gw dev $interface ; do
–                               :
–                       done
+                       if ! root_is_nfs ; then
+                               while route del default gw dev $interface ; do
+                                       :
+                               done
+                       fi

for i in $router ; do

Boot and have fun! 🙂

This entry was posted in Linux, WiFi/Netboot. Bookmark the permalink.

One Response to Slitaz on NFS root

  1. Pingback: Serial console on SliTaz linux « Peter Fichtner's Blog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s