
Build your own Distro Intro COVER STORY ROLLTools and techniques forYOUR creating custom Linux systemsOWN Tools such as Linux From Scratch, NimbleX Live CD Generator, Kiwi image system, and the Ubuntu Custom- ization Kit can help you create your own custom Linux system. BY KLAUS KNOPPER f you can’t find a Linux that strikes by Knoppix founder and Live-distro pio- these CDs were merely intended as huge your fancy, why not roll your own? A neer Klaus Knopper. bootable floppies with a command shell Inew generation of Linux tools helps and some troubleshooting tools, I started you build a custom Linux system. You Why Create a Live CD? thinking about the possibility of creating can use these distro-building tools to In 1999, collections of system repair a CD that was not just a “set of tools,” create Live CDs – bootable discs suitable tools on bootable business-card-sized but a full Linux desktop system on a CD. for troubleshooting, mass installation, CDs became a If I could put a and even ordinary end-user tasks. Add a popular mar- whole Linux sys- missing driver to the base system and re- keting give- tem on a portable master a modified DVD, then start your away at CD, I wouldn’t familiar home environment from any- Linux-related have to carry a where – without disturbing the contents expos. laptop with me to of the hard drive. Although foreign IT environ- Today’s Live systems aren’t confined ments. I could just to the CD tray. Live-Linux users also boot from USB sticks and other portable media. And not all custom distros fall in the Live niche. If you’re really ambi- tious, you can build a conventional hard-disk system file by file. This month, we examine tools for creating Linux systems. We start with a look at the doc- uments and utilities of the Linux From Scratch project. We also take you to the NimbleX website, where you can create a custom bootable CD online. And we examine a pair of competing distribution tools from a pair of major vendors: SUSE’s Kiwi and the Ubuntu Customization Kit (UCK). But first, we start with an intro- duction to the challenges of Live Linux COVER STORY Linux From Scratch .......................... 31 NimbleX Live CD Generator ....... 36 Kiwi .............................................................. 40 Ubuntu Customization Kit .......... 43 MARCH 2008 ISSUE 88 21 021-025_coverintro.indd 21 17.01.2008 18:54:23 Uhr COVER STORY Build your own Distro Intro isolinux.bin is a small program with the same purpose as lilo or grub. This mini-bootloader loads an operating sys- tem’s kernel and accepts options typed 3. Read file again from within an interactive boot shell. User Process 2. Write/modify The isolinux.bin boot loader also allows same file loading of additional menus. Some dis- tributions offer a fancy interface with graphics, interactive elements, and mouse support, but so far, the plain iso- linux bootloader has shown the best 2. Reading file /ramdisk (read-write) compatibility with the full range of BIOS NOT in ramdisk yet types. With isolinux.bin, cases in which the CD won’t boot because of problems with the BIOS/ bootloader combination are very rare. /KNOPPIX on CD (read-write) isolinux allows boot options and ker- nel choices, but you have to type them on the boot command line. If you just hit mount - t aufs -o br:/ramdisk=rw:/KNOPPIX=ro none /UNIONFS Return without entering the options, iso- linux continues to load the kernel with Figure 1: A union filesystem invisibly integrates a writable ramdisk with a read-only medium. default options set in isolinux.cfg (List- ing 2). Because isolinux is capable of slip my portable system into any avail- some of which you’ll learn about in this reading files directly from the ISO file- able computer and boot my own familiar issue. Behind the scenes, though, the de- system structure of a CD (hence the work environment. The concept of boot- velopers of these tools face the same name), no additional drivers or mounts ing from an easily transportable medium problems I faced when creating the first are necessary in order to access the ker- was a very promising idea. versions of Knoppix. No matter what nel and the initial ramdisk. Some Linux distributors offered Live special features you put inside, a good isolinux accesses the CD using BIOS demos and semi-Live bootable CDs (CDs Live system has to boot Linux, support calls. As soon as the operating system that offered some basic tools as a front write access to important files, and suc- kernel starts and switches to protected end for a hard-disk installation), but cessfully detect the system hardware. mode, everything about the CD – includ- these tools were intended for demonstra- ing its location – is “forgotten.” At that tion purposes – to get people to buy the Booting from a CD or DVD point, the operating system must find “real” product in a shrink-wrapped box. Although hard-disk-like devices (includ- where the CD is located, mount its file- I wanted a Live system for practical ing USB sticks, Zip media, and even work: software tests, presentations, and floppy disks) read a boot record at de- Listing 2: isolinux.cfg play. I did not spend much time on find- vice or partition start, the El Torito BIOS 01 DEFAULT linux ing a fancy name for this experiment; I standard for CD-ROMs and DVDs takes a 02 APPEND initrd=minirt.gz just called it Knoppix [1]. different approach to loading an OS. The Affordable USB memory sticks and developer has three options for design- 03 TIMEOUT 300 USB hard disks were not available then, ing a bootable CD or DVD: 04 PROMPT 1 so I decided to take a look at the techni- • Put a bootable floppy disk image 05 cal aspects of booting and running soft- (which cannot be larger than 2.88MB) 06 LABEL knoppix ware directly from a read-only CD. This on the CD and set floppy emulation 07 KERNEL linux task posed a unique set of problems, mode. which I will describe in this article. • Use a (very small) hard-disk image 08 APPEND initrd=minirt.gz Live systems have grown much more (a seldom-used option). sophisticated since the early days. • Start a bootloader program present on SysLinux Knoppix now comes as a full DVD the CD in no emulation mode. (See An equivalent to isolinux for DOS- image. Several tools are available for Listing 1 for a command that creates a formatted hard-disk-like devices (such creating custom Live CDs and DVDs – bootable CD ISO image.) as USB sticks and flash memory) is called SysLinux. It is quite easy to create Listing 1: Creating a Bootable CD ISO Image a bootable memory stick from a CD by just installing SysLinux and renaming 01 mkisofs -pad -l -r -J \ boot/isolinux/isolinux.cfg to syslinux. 02 -no-emul-boot -boot-load-size 4 -boot-info-table \ cfg. Knoppix versions from 5.0 and up 03 -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \ include a small utility called mkbootdev 04 -o cd-image.iso cd-data-directory for this task. 22 ISSUE 88 MARCH 2008 021-025_coverintro.indd 22 17.01.2008 18:54:59 Uhr Upcoming Conferences 2008 LINUX STORAGE & FILESYSTEM WORKSHOP THE SIXTH INTERNATIONAL CONFERENCE ON Co-located with FAST ’08 MOBILE SYSTEMS, APPLICATIONS, AND SERVICES FEBRUARY 25–26, 2008, SAN JOSE, CA, USA (MOBISYS 2008) http://www.usenix.org/lsf08 Jointly sponsored by ACM SIGMOBILE and USENIX JUNE 10–13, 2008, BRECKENRIDGE, CO, USA http://www.sigmobile.org/mobisys/2008/ 6TH USENIX CONFERENCE ON FILE AND STORAGE TECHNOLOGIES (FAST ’08) Sponsored by USENIX in cooperation with ACM SIGOPS, IEEE Mass 2008 USENIX ANNUAL TECHNICAL CONFERENCE Storage Systems Technical Committee (MSSTC), and IEEE TCOS JUNE 22–27, 2008, BOSTON, MA, USA FEBRUARY 26–29, 2008, SAN JOSE, CA, USA http://www.usenix.org/usenix08 http://www.usenix.org/fast08 2008 USENIX/ACCURATE ELECTRONIC 2008 ACM INTERNATIONAL CONFERENCE ON VIRTUAL VOTING TECHNOLOGY WORKSHOP (EVT ’08) EXECUTION ENVIRONMENTS (VEE ’08) Co-located with USENIX Security ’08 Sponsored by ACM SIGPLAN in cooperation with USENIX JULY 28–29, 2008, SAN JOSE, CA, USA MARCH 5–7, 2008, SEATTLE, WA, USA http://vee08.cs.tcd.ie 3RD USENIX WORKSHOP ON HOT TOPICS IN SECURITY (HOTSEC ’08) USABILITY, PSYCHOLOGY, AND SECURITY 2008 Co-located with USENIX Security ’08 Co-located with NSDI ’08 JULY 29, 2008, SAN JOSE, CA, USA APRIL 14, 2008, SAN FRANCISCO, CA, USA http://www.usenix.org/upsec08 17TH USENIX SECURITY SYM POSIUM JULY 28–AUGUST 1, 2008, SAN JOSE, CA, USA 1ST USENIX WORKSHOP ON LARGE-SCALE http://www.usenix.org/sec08 EXPLOITS AND EMERGENT THREATS (LEET ’08) BOTNETS, SPYWARE, WORMS, AND MORE Co-located with NSDI ’08 22ND LARGE INSTALLATION SYSTEM ADMINISTRATION APRIL 15, 2008, SAN FRANCISCO, CA, USA CONFERENCE (LISA ’08) http://www.usenix.org/leet08 Sponsored by USENIX and SAGE Paper submissions due: February 11, 2008 NOVEMBER 9–14, 2008, SAN DIEGO, CA, USA 5TH USENIX SYMPOSIUM ON NETWORKED 8TH USENIX SYMPOSIUM ON OPERATING SYSTEMS SYSTEMS DESIGN AND IMPLEMENTATION DESIGN AND IMPLEMENTATION (OSDI ’08) (NSDI ’08) DECEMBER 8–10, 2008, SAN DIEGO, CA, USA Sponsored by USENIX in cooperation with ACM SIGCOMM http://www.usenix.org/osdi08 and ACM SIGOPS Paper submissions due: May 8, 2008 APRIL 16–18, 2008, SAN FRANCISCO, CA, USA http://www.usenix.org/nsdi08 USENIX: THE ADVANCED COMPUTING SYSTEMS ASSOCIATION TECHNICAL SESSIONS AND TRAINING PROGRAM INFORMATION AND HOW TO REGISTER ARE AVAILABLE ONLINE AND FROM THE USENIX OFFICE: http://www.usenix.org/events | Email: [email protected] | Tel: +1.510.528.8649 | Fax: +1.510.548.5738 021-025_coverintro.indd 23 17.01.2008 18:55:17 Uhr COVER STORY Build your own Distro Intro system, and continue to start the system.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages5 Page
-
File Size-