NetAdminTools.com
 
SignalQ Sites:
NetAdminTools - Coprolite - NoNIC - SpotBridge - NAW
RoboCoop - AreWeDown - SolarPower - SysAdminTools
Xfig - Gold Loaf - GeekPapa - FixGMC - MCJ - FixRambler
Categories:
GNU/Linux | Homebrew designs | Perl | Administration | Backup/Recovery | Bugs/Fixes | Certification | Database | Email | File/Print | Hardware | Information Grab Bag | Interoperability | GNU/Linux ABCs | Monitoring | Name Resolution | Network Services | Networking | Remote Control | Security | Desktop | Web | BSD | Solaris | GIAGD | REALbasic

Last 30 Days | Last 60 Days | Last 90 Days | All Articles | RSS | Hail Support


Categories:
·GNU/Linux
·Homebrew designs
·Perl
·Administration
·Backup/Recovery
·Bugs/Fixes
·Certification
·Database
·Email
·File/Print
·Hardware
·Information Grab Bag
·Interoperability
·GNU/Linux ABCs
·Monitoring
·Name Resolution
·Network Services
·Networking
·Remote Control
·Security
·Desktop
·Web
·BSD
·Solaris
·GIAGD
·REALbasic
·All Categories


Debian on a USBCard -- Part 3 - Compiling the Kernel
Topic: GIAGD   Posted:2004-07-24
Printer Friendly: Print

spacer
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.




Please read our Terms of Use
Microsoft, Windows, Windows XP, Windows 2003, Windows 2000, and NT are either trademarks or registered trademarks of Microsoft Corporation. NetAdminTools.com is not affiliated with Microsoft Corporation. Linux is a registered trademark of Linus Torvalds, and refers to the Linux kernel. The operating system of most distributions that contain the Linux kernel is GNU/Linux. All logos and trademarks in this site are property of their respective owner. Copyright 1997-2008 NetAdminTools.com

Created by:
MCJ
MCJ CMS