Using a Remotely-Mounted Filesystem in LinuxLink Classic
The procedure for using remotely-mounted filesystems requires you to prepare the RFS by compiling and configuring the required applications, libraries and utilities. However, instead of archiving, compressing, decompressing, and extracting the completed filesystem, you use NFS (or another network-based filesystem) to export the completed RFS, and then ensure that the target board can mount the RFS during or after the board boots.
If you booted your target hardware from the initial RAM disk without specifying any additional kernel configuration arguments, you might want to manually mount the NFS root filesystem included with your Linux distribution to access the Linux development environment for your target board.
Most of your development work will be done by cross-compiling applications for your target hardware on the host system. However, you might find it useful to directly debug or test applications on your target hardware after booting from an initial RAM disk and then subsequently mounting the NFS root filesystem.
After making the NFS-exported filesystem your new root filesystem, you must repopulate the /dev and /proc directories and refresh the linker’s shared-library information, as described in the following sections.
Changing the Root of Your System
After you have mounted an NFS-exported RFS, you will need to tell the kernel on the target to use the newly-mounted filesystem as its root filesystem. Ordinarily, the root filesystem is mounted automatically during the Linux boot process, and is the filesystem that is mounted at the directory /.
Depending on whether you are using an initrd or an initramfs filesystem, use chroot, pivot_root, or switch_root to modify the system’s notion of what the root filesystem is, as described in Changing the Root of Your Filesystem.
You can now use devfs or udev to mount the /dev and /proc directories, as described in Using devfs and Using udev. (Linux distributions from TimeSys use udev.)
Refreshing the Run-Time Linker
The final task that you must perform after changing the root filesystem is to rerun the ldconfig utility. This updates the run-time linker’s cache of shared-library locations (the /etc/ld.so.cache file) and creates or updates the necessary symbolic links. To update the cache file, issue the following command:
# /sbin/ldconfig
This step needs to be performed only once for the root filesystem, because the updated file is persistent across mounts. There is no harm in performing this step each time you mount the root filesystem, but it is not necessary.
You should also update the linker’s cache by using the ldconfig command whenever you add files outside of the /lib and /usr/lib directories.