In this article we transferred the filesystem to our UBCard. Now, we need to create a kernel. Before we create our kernel, though, we need to know what options to compile in. We are starting with our GIAGD .config from this article. Now, we are using VMware to bring this filesystem up. Since we don’t know exactly what network or SCSI drivers are needed for VMware, we can use our Superrescue CD to determine the devices. We found it works best to boot the CD via an ISO image. Use this by setting the “Use ISO image” checkbox in the device config in VMWare. Note that we are using our USB drive as a physical disk, rather than an image. Since we already had the CD, we just created an iso image of it using cat:
root@srv-1 / # cat /dev/cdroms/cdrom0 > sr.iso root@srv-1 / # root@srv-1 / # ls -l sr.iso -rw-r--r-- 1 root root 734363648 Jul 24 05:01 sr.iso root@srv-1 / # |
Let’s boot and see what our devices are. First, we need to set the BIOS so that the CDROM boots first:
Here is the network configuration:
Here is the SCSI driver needed:
Let’s create a kernel. Note that you do not have to do this as root, and you probably shouldn’t ever compile kernels for other systems as root if you can help it.
u-1@srv-1 u-1 $ mkdir usbkern u-1@srv-1 u-1 $ cd usbkern u-1@srv-1 usbkern $ ls /usr/src linux linux-2.4.24 linux-2.4.25.tar.gz linux-2.4.22 linux-2.4.24.tar.gz linux-2.4.26 linux-2.4.22-gentoo-r5 linux-2.4.25 linux-2.4.26.tar.gz linux-2.4.22.tar.gz linux-2.4.25-gentoo-r3 linux-2.6.0.tar.gz u-1@srv-1 usbkern $ cp /usr/src/linux-2.4.26.tar.gz ./ u-1@srv-1 usbkern $ tar -xzf linux-2.4.26.tar.gz u-1@srv-1 usbkern $ cd lin* u-1@srv-1 linux-2.4.26 $ cp crackersconfig.txt .config u-1@srv-1 linux-2.4.26 $ u-1@srv-1 linux-2.4.26 $ make oldconfig . . . Cryptographic API (CONFIG_CRYPTO) [N/y/?] * * Library routines * CRC32 functions (CONFIG_CRC32) [N/y/m/?] zlib decompression support (CONFIG_ZLIB_INFLATE) [N/y/m/?] zlib compression support (CONFIG_ZLIB_DEFLATE) [N/y/m/?] Hotplug firmware loading support (EXPERIMENTAL) (CONFIG_FW_LOADER) [N/y/m/?] *** End of Linux kernel configuration. *** Check the top-level Makefile for additional configuration. *** Next, you must run 'make dep'. |
At this point, we just add in the Buslogic SCSI driver and the PCnet network driver via make menuconfig, and recompile our kernel:
u-1@srv-1 linux-2.4.26 $ make dep clean bzImage . . . Boot sector 512 bytes. Setup is 2528 bytes. System is 1209 kB warning: kernel is too big for standalone boot from floppy make[1]: Leaving directory `/home/u-1/usbkern/linux-2.4.26/arch/i386/boot' u-1@srv-1 linux-2.4.26 $ |
We have a kernel. Let’s mount the filesystem on the USBCard and copy the kernel over.
root@srv-1 usbcard # mount -t ext3 /dev/sdc1 /mnt root@srv-1 usbcard # roott@srv-1 usbcard # cp /home/u-1/usbkern/linux-2.4.26/arch /i386/boot/bzImage /mnt root@srv-1 usbcard # cp /home/u-1/usbkern/linux-2.4.26/System.map root@srv-1 usbcard # cd / root@srv-1 / # umount /mnt |
In the last part of this article we will finish up the configuration so the system is ready to boot.