1 / 16

COST Linux

Cheap Off-the-Shelf Tiny Linux By Dzuy Nguyen dzuy@itlogistic.net. COST Linux. What it is. Home-brewed tiny Linux distro. More like Linux From Scratch. Made from readily available hardware (i386) and binaries from your favorite distro. Customed compiled kernel.

jonah
Download Presentation

COST Linux

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Cheap Off-the-Shelf Tiny Linux By Dzuy Nguyen dzuy@itlogistic.net COST Linux

  2. What it is • Home-brewed tiny Linux distro. More like Linux From Scratch. • Made from readily available hardware (i386) and binaries from your favorite distro. • Customed compiled kernel. • Small storage device: Solid State Disk (SSD) rather than spinning hard drive.

  3. Usage: network appliances • Firewall/VPN • Router • DNS server • Load Balancer (LVS) • Proxy server • Any dedicated network service • Other projects: • Carputer • Home automation

  4. Advantage • Secured. • Reliable (no spinning part). • Crash proof. • Hardened (no extra software that you don't need). • Easy upgrade: just replace file system images. • Flexible: separation of root and application file system. • Did I mention low COST?

  5. Ingredients • Kernel: (custom) compiled as module as much as you can to keep kernel small. • Boot strap initrd to pre-load module and prepare memory as disk. • /: Busy box • Login: Tiny login (with PAM) • Logs: can be remote or local (clean with cron). • Other: binaries from your RPM or compiled apps.

  6. Compressed file system images • Root FS: for /. Resides in RAM disk (initrd), rw. Size: 4MB file system, ~2MB populated. • Local FS: Other apps and libraries. Mount either from memory or flash disk. (ro). Size: 4-8MB depends on amount of apps. • Sysconfig FS: Resides on flash disk (rw) for permanent storage. Stores system's configurations. Size: 100KB and up.

  7. Prepare file system on disk • Create a loopback file system (need loop module): • # dd if=/dev/zero of=rootfs bs=1k count=<size> • Make file system: • # mke2fs -N 2048 rootfs • Mount the file system • # mount -o loop rootfs /mnt • Copy files from target workspace.

  8. The root file system • Need: /dev, /proc, /etc, /sbin, /bin, /lib, /mnt, /usr, /var, /home, /tmp • /dev: device files (hd*, ram*, tty*, std*, etc.) • # cp -dpR /dev/hda[0-5] /mnt/dev/ • /etc: fstab, passwd, group, inittab, mtab, resolv.conf, sysconfig, etc. • (/usr)/bin and (/usr)/sbin: system utilities to be provided by busy box (and more). • /lib: libc (must have), ld-linux (most popular), libscrypt (busybox), libdl, libnsl, libresolv (and more).

  9. Shrink binaries - strip them • Strip -s: remove debug symbols • Strip -g: remove all symbols • Strip libraries and executables only. Do not strip modules

  10. Apps (/usr/local) file system • /usr/local/bin, /usr/local/sbin: application binaries • /usr/local/etc: rc scripts • /usr/local/lib: other supporting library • /usr/local/lib/modules: kernel modules • /usr/local/lib/security: PAM modules • /usr/local/lib/iptables: iptables modules (if firewall).

  11. Sysconfig file system • Store system configuration stuffs • Network configuration files. • modules.conf • Other: syslog, logrotate.conf, sysctl.conf, hosts, passwd, shadow, group (link to /etc) • Other apps' config files can be stored here and called appropriately.

  12. Initrd file system • Similar to root file system • There must be a /linuxrc executable. • The linuxrc executable can be a script or binary. If script, the shell must be present. • All linked libraries must be present and accessible. • Use linuxrc to pre-load modules and prepare (RAM) file system.

  13. Boot loader • Choice of your favorite bootloader: GRUB or LILO. • GRUB • Advantages: easy to config and don't need to re-run like LILO when kernel is upgraded. Splash screen possible. • Disadvantages: larger than LILO. • LILO • Advantages: small, works on all medium. • Must re-run LILO when kernel changes.

  14. Boot process • BIOS -> Boot loader -> kernel -> initrd -> linuxrc -> init • Init is not really needed. Can run system from linuxrc, just make sure it does not exit. Most commercial embedded system does not use init. • Init -> inittab -> rc -> rc.sys • Busybox has its own init and shell (ash). • Modify rc and rc.sys to bring up your system.

  15. Hardware • Any system with BIOS that is willing to boot our bootloader or kernel. • Cheap thin clients are available on eBay • Netier XL and SL series • Capio II 2992 • Acute Network Technologies • GTC Allwell • IBM NetVista 8363 N2200 • Single Board Computers • More (not yet hacked).

  16. Solid State Disk • DiskOnChip: manufactured by M-Systems. Available on selected boards only. GRUB must be burned in. Special driver module is needed. • DiskOnModule: available in 40 and 44 pin IDE. Sticks right on your IDE port. BIOS sees it as hard disk. • Compact Flash: cheapest SSD. Some boards have CF interface on board. IDE to CF converter is also available. • DiskOnStick: USB flash disk. Some boards can boot from these. Need to load some USB drivers in order to see as /dev/sd (SCSI) disk.

More Related