Embedded systems
Embedded systems
Linux Embedded devices
with PicoDebian
Martin Noha 28.9.2006Agenda
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 CustomizingWhy did I look in this stuff ?
Why did I look in this stuff ?
• Security
• costs
Why did I look in this stuff (2) ?
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
What is an embedded device?
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
Characteristic hardware
Characteristic hardware
Characteristic hardware (2)
Characteristic hardware (2)
http://www.soekris.com
Characteristic hardware (3)
Characteristic hardware (3)
http://www.lex.com.tw
Keyboard and
Monitor connector
Supports harddisk
global requirements for software
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
some small distributions
some small distributions
Embedded Debian
Monowall
DSL (Dammed Small Linux)
Trinux
Linux Router Project
Pebble > pyramid Linux
PicoDebian
PicoDebian out of the box
PicoDebian out of the box
thinneddown 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
PicoDebian out of the box (2)
PicoDebian out of the box (2)
Advantages
flexible – with all Debian packets in the background Same administration like a standard Debian systemDisadvantages
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 downPicoDebian out of the box (3)
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.
PicoDebian out of the box (4)
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 > …
PicoDebian customizing PicoDebian customizing tecnical track 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 bootPicoDebian customizing (2) PicoDebian customizing (2) tecnical track tecnical track
Customizing step 2
integrating unionfs change of partitions – adding a 5 MB system HW adding an Atheros based WLAN mini PCICard 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 chrootPicoDebian customizing (3) PicoDebian customizing (3) tecnical track 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, unionfstools, madwifimodules Install kernel, and unionfstools andPicoDebian customizing (2) PicoDebian customizing (2) tecnical track tecnical track selection at boot – via grub or predefined 10MB /boot Hda1 ext2 25 MB / update system Hda2 Squashfs 50 MB / (normal) root Hda3 Squashfs 5 MB for union FS ext2 / /boot /etc /root /…. / /boot /etc /root /…. Normal operating Update mode
PicoDebian customizing (4) PicoDebian customizing (4) tecnical track tecnical track
Update method
enter chroot env on devserver modify elements (aptget 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 hda2PicoDebian customizing (5) PicoDebian customizing (5) tecnical track 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 bridgePicoDebian customizing (6) PicoDebian customizing (6) tecnical track 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 serverPicoDebian rescue system for PicoDebian rescue system for mailserver mailserver