Booting from the Ether
We need to create a kernel for the ThinkNIC. I haven't been able to build a kernel and a filesystem that duplicates the functionality of the CD-ROM. Instead I went ahead and compiled my own kernel and created my own filesystem.
I have been using a 2.4 version kernel on my ThinkNIC. This version has USB support and seems to do everything I need. The ThinkNIC comes with the 2.2.15 kernel with a special patch to support USB. You can pick any version you like as long as it supports the SiS 900 Ethernet chip. You'll need to make sure to include all the options necessary for mounting the root filesystem via NFS. Also, these options shouldn't be compiled as modules. The code for these options needs to run before the root filesystem is mounted, so modules can't be loaded at that time.
When you build your kernel, make sure to include at least these options:
Network Options/IP: kernel level auto-configuration
Network Device Support/Ethernet/EISA, VLB, PCI/SiS 900/7016
Filesystems/Network Filesystems/NFS filesystem support
Filesystems/Network Filesystems/Root filesystem on NFS
Use the make bzImage command to build a compressed kernel image. The file will be placed in the arch/i386/boot/bzImage file under your Linux source code directory. Copy this file to the /tftpboot/bpbatch directory. We're still not done, but you can try booting your ThinkNIC computer again. It should boot, load the kernel, then tell you that it was unable to mount the root filesystem.
We need to create a root filesystem on the server for our ThinkNIC. I wouldn't recommend using the exact same root filesystem that you use for your server. The root filesystem contains system configuration files, and it is almost certain that your server needs a different configuration than your ThinkNIC system. At the least, the IP address needs to be different.
For this article we'll use the contents of the ThinkNIC CD-ROM for our root filesystem, but you aren't limited to that. I have used a Mandrake Linux filesystem on the ThinkNIC with great success. I have also built a filesystem from scratch. It all depends on your application for the box.
Make the directory /nfsroot/nicroot on your server, mount the ThinkNIC CD-ROM on your server and copy the contents (using the -a flag) into this directory. The root directory of your ThinkNIC will be under /nfsroot/nicroot. We'll need to make some changes to this filesystem to make the system work. The kernel that comes with the ThinkNIC must use the devfs filesystem because there are no device files on the CD-ROM. We'll need to create them, so make sure you are the root user on your server. The /nfsroot/nicroot/dev directory is a symlink; remove the symlink and make a dev directory under /nfsroot/nicroot. Now use the following command to create all the device files:
cp -a /dev/* /nfsroot/nicroot/dev
We need to make one more change. When the kernel loads, it executes the commands in /etc/rc.d/rc.sysinit. This file manipulates the Flash memory and does other things that won't work because of the different kernel on our ThinkNIC. Rename that file to something else, and create a new file that has the following lines in it:
#!/bin/sh /bin/shMake sure this file is executable, and it will bring up a shell when your system boots.
Now that your filesystem is on the server, it needs to be shared with the network using NFS. On Mandrake Linux, the RPM package that needs to be loaded is called nfs-utils. You'll need to export this directory so the ThinkNIC system can see it. Create the file /etc/exports and put the following line in the file:
This line tells the NFS server to share the /nfsroot directory with any computer on the 192.168.1.x subnet. Replace this subnet with yours. It also tells the server to share it in read/write mode. The no_root_squash option allows root users on the remote system to access the share-with-root access on the server. This is not the default and should be used with care.
You should now start your NFS server by issuing the following command on your server:
Go ahead and boot your ThinkNIC system. If everything is configured properly, your ThinkNIC should get an IP address from the DHCP server and load the BpBatch program that loads the kernel. The kernel should then mount the root filesystem using NFS, and you should be at a shell prompt. If that worked, it's time to celebrate. If that didn't work, check each step listed in the article. Each step in the boot process is covered, so it should be easy to discover which step didn't work and compare your server to the example here.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Firefox 46.0 Released
- Ubuntu Online Summit
- Devuan Beta Release
- The Qt Company's Qt Start-Up
- May 2016 Issue of Linux Journal
- The US Government and Open-Source Software
- The Death of RoboVM
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- New Container Image Standard Promises More Portable Apps
- Open-Source Project Secretly Funded by CIA
In modern computer systems, privacy and security are mandatory. However, connections from the outside over public networks automatically imply risks. One easily available solution to avoid eavesdroppers’ attempts is SSH. But, its wide adoption during the past 21 years has made it a target for attackers, so hardening your system properly is a must.
Additionally, in highly regulated markets, you must comply with specific operational requirements, proving that you conform to standards and even that you have included new mandatory authentication methods, such as two-factor authentication. In this ebook, I discuss SSH and how to configure and manage it to guarantee that your network is safe, your data is secure and that you comply with relevant regulations.Get the Guide