140 likes | 382 Views
Biswajit Paul CAIR ( DRDO ). Linux On Floppy. Linux On Floppy …. What Is Linux on Floppy ?.
E N D
Biswajit Paul CAIR ( DRDO ) Linux On Floppy
Linux On Floppy … What Is Linux on Floppy ? A general purpose, simple miniature, self-contained Linux System, along with kernel support for drivers of widely used devices and a few commonly used shell utilities, all put together onto a single Floppy disk.
Linux On Floppy … How it differs from System Boot disk ? • Boot disk • Root disk • Boot + Root disk
Linux On Floppy … Where can I use it ? • Recovery from disk Failure. • Hardened O/S Security Applications. • Firewall • Intrusion Detection System • Testing of Kernel and Applications
Linux On Floppy … How to build it ? Design Issues: To provide adequate support to the mini system, putting constraint on both kernel size and root file system size so that the complete suite can be put on a single floppy. Design Steps : • Prepare customized Linux Kernel. • Build Root File System. • Integrate into a Floppy.
Linux On Floppy … Preparing customized Linux Kernel • Kernel Configuration : Selection of the appropriate files from the kernel source directory (strictly on the basis of the purpose) # cd /usr/src/linux-2.x.x-e # make xconfig or make menuconfig or make config • Important Files : Configuration File : /usr/src/linux-2.x.x-e/.configure
Linux On Floppy … Preparing customized Linux Kernel ( contd …) • Kernel Compilation : Building of the compressed binary image with the above selected options. #editMakefile for extraversion. # make dep clean bzImage modules modules_install • Important Files: Kernel Image : /usr/src/linux-2.x.x-e/arch/i386/boot/bzImage Modules :/lib/modules/2.x.x-e
Linux On Floppy … Building Root File System • Designing RFS Structure:The design of root file system (RFS ) involves the challenge of choosing the minimum set of files from the Linux directory tree. • Criteria for file selection : • /bin, /sbin, /usr : Utilities to be provided. • /lib : Shared libraries for the binaries. • /dev : Device supports to be provided. • /etc : System configuration files. • /mnt, /var, /proc, /root : Can be set empty ( !!! ) • BusyBox can be used to populate /bin, /sbin, /usr
Linux On Floppy … Building Root File System ( contd …) Creating RAM disk Image: Zeroes -out the device : # dd if=/dev/zero of=/dev/ram0 bs=1k count=4096 Create Ext-2 File System : # mke2fs -L Flonux_rootfs -m 1 -N 1000 /dev/ram0 Mount the device : # mount -t ext2 /dev/ram0 /mnt Copy RFS tree to the deviceand unmount it # cp -dpR /root/Flonux/* /mnt and # umount /mnt Create compressed RFS : # dd if=/dev/ram0 bs=1k |gzip -v9 >/root/RFS.gz
Linux On Floppy … Integrating onto a Floppy • Integration issues : The size of the floppy should be enough to hold both kernel and RFS. • High Formatting : Depending upon the BIOS and boot Loader capacity , Floppy Can be formatted for higher capacities. • Boot Loader Selection : • LILO • GRUB • SYSLINUX • ISOLINUX
Linux On Floppy … Integrating onto a Floppy ( contd …) • Making Bootable Floppy : #mkfs.msdos /dev/fd0uxxxx # syslinux –s /dev/fd0uxxxx • Transferring Kernel Image and RFS: # mount /dev/fd0uxxxx /mnt # cp bzImage /mnt AND cp RFS.gz /mnt # umount /mnt
Linux On Floppy … Integrating onto a Floppy ( contd …) • Configuring Syslinux : The loader Configuration File ( syslinux.cfg ) should be configured accordingly. Sample Configuration : default Flonux prompt 1 timeout 10 display boot.msg label Flonux kernel bzImage append initrd=RFS.gz
Linux On Floppy … Resources • http://tldp.org/HOWTO/Bootdisk-HOWTO/index.html • http://syslinux.zytor.com/ • http://www.zelow.no/floppyfw/ • http://www.busybox.net/