-
Notifications
You must be signed in to change notification settings - Fork 3
Boot Process
The latest Zipit u-boot bootloader is built directly from the openwrt build system and contains some new features not in previous builds:
- Black background with White text
- Smaller font
- USB Host Support for booting from USB disk
The default u-boot environment is:
baudrate=115200
bootdelay=2
stderr=lcd
stdin=pxa27x-mkp
stdout=lcd
verify=no
bootargs=bootargs=console=tty0 console=tty1 console=ttyS2,115200 fbcon=rotate:3 pxa2xx-cpufreq.pxa27x_maxfreq=520 pxamci.ignore_crc_errors=1 pxa27x_udc.host_portmode_init=1 root=/dev/mtdblock3 rootfstype=squashfs init=/etc/preinit
bootcmd=if mmc rescan && ext2load mmc 0 0xa0000000 boot/uboot.script ; then source 0xa0000000; elif mmc rescan && fatload mmc 0 0xa0000000 uboot.script ; then source 0xa0000000; elif usb start && ext2load usb 0:1 0xa0000000 boot/uboot.script; then source 0xa0000000; else bootm 0x50000; fi;
u-boot will first try to boot from an ext formatted sd card with /boot/uboot.script, then a fat formatted sd card with /uboot.script, then an ext formatted USB disk with /boot/uboot.script and finally from internal flash.
You can interrupt u-boot by pressing a key on the keyboard before the timeout ends if you need to change any bootloader options. Alternatively, you can use the command line u-boot env tools fw_printenv and fw_setenv from bleeding edge to modify the bootloader settings.
A pre-init script is run by the kernel before starting regular init. This pre-init script sets up a minimal file system (proc, sys, tmp, dev, mdev) and mounts any configured overlayfs. The overlayfs mounting is skipped if booting from USB or SD Card. If pre-init cannot mount the internal jffs2 partition as an overlay it will create a tmpfs overlay to use instead. This allows one to repair/replace the jffs partition in case of corruption.
Zipit bleeding edge openwrt uses busybox init instead of the typical openwrt init scripts. After pre-init is complete, it runs busybox init which is configured in /etc/inittab. The following are options are setup in inittab:
- console font
- console keymap
- run /etc/init.d scripts
- run /usr/bin/z2-shell on tty1
- if gmenu2x is installed, run it, else start ash shell
- run ebindkeys on tty2
The following init scripts are installed by default:
- alsa: alsa sound setup
- boot: setup /var and sysctl
- cpufreq: enable cpu frequency scaling (conservative governor)
- cron: start cron daemon
- dropbear: start ssh server
- local: run /etc/rc.local if available
- modules: load kernel modules listed in /etc/modules.d/
- z2gpio: setup Zipit Z2 GPIO
- z2leds: setup Zipit Z2 notification LED's
- zram: enable 16Mb compressed zram swap