Embedded systems Linux Embedded devices with PicoDebian Martin Noha 28.9.2006 24.03.2005 1
Agenda Why did I look in this stuff? What is an embedded device? Characteristic hardware global requirements for software some small distributions Pico Debian out of the box Customizing 24.03.2005 2
Why did I look in this stuff? costs Security convenience 24.03.2005 3
Why did I look in this stuff (2)? DSL termination AP basic services firewalling reporting compliant with dummies (girl friend) Conclusion: I want an embedded device 24.03.2005 4
What is an embedded device? no noise no hard disk, no fan > no moving parts may need keyboard and monitor Not very powerful processor Limited memory (64 128 MB) Compact flash instead of hard disk Limited capability for extensions No battery > no time buffering 24.03.2005 5
Characteristic hardware http://www.pcengines.ch 24.03.2005 6
Characteristic hardware (2) http://www.soekris.com 24.03.2005 7
Characteristic hardware (3) http://www.lex.com.tw Keyboard and Monitor connector Supports harddisk 24.03.2005 8
global requirements for software ability to boot from flash no write access to flash read only file system Capability to run within limited resources flexible configuration 24.03.2005 9
some small distributions Embedded Debian Monowall DSL (Dammed Small Linux) Trinux Linux Router Project Pebble > pyramid Linux PicoDebian 24.03.2005 10
PicoDebian out of the box thinned down version of the Debian Sarge hardware support depends on kernel uses Squashfs has two partitions (root and boot) generates RAM disk at boot image generation on development server configuration in chroot env. on dev. server Runs with 32MB CompactFlash Consists of two parts the SW itself and some scripts 24.03.2005 11
PicoDebian out of the box (2) Advantages flexible with all Debian packets in the background Same administration like a standard Debian system Disadvantages Squashfs requires new image and reboot for each config change chroot env has problems with module installation devices may miss in /dev all logs are deleted at power down problem with update of image online 24.03.2005 12
PicoDebian out of the box (3) Scripts are used for Image generation setting up the chroot environment Installation process Partitioning of flash in dev server install boot loader (grub) in MBR Adopt boot image to size of boot partition adopt system specific parameter e.g. fd device, boot parameter, mount table, root password, etc. generate image and copy it to flash (dd best) move flash to target system and boot 24.03.2005 13
PicoDebian out of the box (4) what can go wrong what went wrong no monitor no info about boot process > serial connection needed kernel not found > reconfigure grub Panic because of wrong root device > reconfigure grub network device not supported > new kernel needed no access because of missing passwords > Horrible update method 24.03.2005 14
PicoDebian customizing tecnical track Customizing step 1 own kernel without modules kernel update impacts only /boot change of partitions adding a seconded system extending the scripts Mainly adding a copy function and parameter adding a RW section in the boot partition that is copied to the RAM disk at boot 24.03.2005 15
PicoDebian customizing (2) tecnical track Customizing step 2 integrating unionfs change of partitions adding a 5 MB system HW adding an Atheros based WLAN mini PCI Card adding madwifi driver to kernel building AP kernel must support modules again Kernel installation is more complex E.g depmod a does not work in chroot 24.03.2005 16
PicoDebian customizing (3) tecnical track Customizing Kernel download from www.kernel.org and unpack patch with squashfs patch with unionfs patch with configure new options Make debian kernel package, unionfs tools, madwifi modules Install kernel, and unionfs tools and madwifi modules (manual work needed) Customize grub menu 24.03.2005 17
PicoDebian customizing (2) tecnical track Normal operating Update mode / / /boot /boot /etc /etc /root /root /. /. 10MB /boot Hda1 ext2 25 MB / update system Hda2 Squashfs 50 MB / (normal) root Hda3 Squashfs 5 MB for union FS ext2 selection at boot via grub or predefined (problem: /boot must be rw mounted 24.03.2005 18
PicoDebian customizing (4) tecnical track Update method enter chroot env on dev server modify elements (apt get update, upgrade ) generate image boot into update mode transfer image for hda1 and hda 3 (dd via ssh) and reboot copy main env to update env Generate update image and transfer to hda2 that s all 24.03.2005 19
PicoDebian customizing (5) tecnical track Services running DSL termination Default system applications (syslog etc) iptables firewall with wondershaper basic services ntp, dns, dhcp, ssh, snmpd squid some ipv6 stuff (not relevant) Dyndns client Hostapd and radius bridge 24.03.2005 20
PicoDebian customizing (6) tecnical track Versions based on debian sarge (tried ubuntu too) Kernel 2.6.17.11 Squashfs 3.0 (supports up to 2.6.15 officially) snapshot of unionfs (2006/06/20) official release supports only 2.6.15.x Madwifi 0.91 hostapd with 801.x authentication (TLS) Radius server 24.03.2005 21
PicoDebian rescue system for mailserver Different use case rescue system for a company mail server boots by default into a PicoDebian installation offers maintenance without mounted filesystem needes one partition and 50 MB remote hands needs to press reset only all filemgt toos are includes in the image kernel has to be patched with squashfs uses same kernel as productive system 24.03.2005 22