TS-4710 Initrd / Busybox: Difference between revisions

From embeddedTS Manuals
No edit summary
No edit summary
Line 8: Line 8:
Uncompressing Linux... done, booting the kernel.
Uncompressing Linux... done, booting the kernel.
Booted in 0.90s
Booted in 0.90s
Initramfs Web Interface: http://ts47XX-112233
Initramfs Web Interface: http://ts47XX-112233.local
Manual: http://wiki.embeddedarm.com/wiki/TS-47XX
</pre>
</pre>



Revision as of 12:42, 8 August 2013

When the board first boots up you should have a console such as:

>> TS-BOOTROM - built Mar 14 2013 15:01:50
>> Copyright (c) 2012, Technologic Systems
.
.
Uncompressing Linux... done, booting the kernel.
Booted in 0.90s
Initramfs Web Interface: http://ts47XX-112233.local

This is a minimalistic initial ram filesystem that includes our specific utilities for the board, and is then used to bootstrap the Linux root. The initramfs is built into the kernel image so it cannot be modified without rebuilding the kernel, but it does include several bits for common configuration option we call soft jumpers.

Soft Jumpers
Jumper Function
1i Boot automatically to Debian [1]
2 Baseboard Specific
3 Baseboard Specific
4 Read Only mode [2]
5 Disable Network Autoconfiguration [3]
6 Reserved
7 Reserved
8 Skip full DRAM test on startup [4]
  1. initramfs boot is default. Configure the network in Debian before setting this jumper if you do not have the serial console.
  2. The read only mode creates a unionfs where the full Linux root is mounted read only, and a tmpfs is mounted read/write. This allows services to run that require write access, but doesn't commit any changes to disk. This can be used to protect your application from corruption caused by sudden poweroffs.
  3. Do not disable this without having access to a Serial Console.
  4. The DRAM test can be used to verify the RAM, but adds approximately 20 seconds to the boot time. This should normally only be enabled when diagnosing problems.

There are 2 ways to manipulate soft jumpers on the board. The web interface at "http://ts<model>-<last 6 chars of the MAC" has a list of checkboxes that will immediately change the values. You can also use tshwctl:

# Boot automatically to Debian:
tshwctl --setjp=1

# Or revert to the initramfs:
tshwctl --removejp=1

If you do not have a serial console, make sure you first configure Debian's network settings first before booting directly to Debian. Once JP1 is enabled, the initramfs does not run ifplugd/udhcpc to configure the network.

Most development should be done in Debian, however many applications are capable of running from the initramfs. The initramfs itself cannot be easily modified, and it is not recommended to do so. The initramfs however has several hooks for applications to use. Debian is mounted at /mnt/root as a read only filesystem which includes the /ts/ directory that includes several hooks.

/mnt/root/ts/init

For headless applications you can create a bash script with any initialization you require in /ts/init. This does not use the same $PATH as Debian, so you should enter the full path to any applications you intend to run from this environment. The init file does not exist by default and must be created:

#!/bin/sh

/path/to/your/application &

/mnt/root/ts/initramfs-xinit

Graphical applications should use /ts/initramfs-xinit. The xinit file is used to start up a window manager and any applications. The default initramfs-xinit starts a webbrowser viewing localhost:

#!/bin/sh
# Causes .Xauthority and other temp files to be written to /root/ rather than default /
export HOME=/root/
# Disables icewm toolbars
export ICEWM_PRIVCFG=/mnt/root/root/.icewm/

# minimalistic window manager
icewm-lite &

# this loop verifies the window manager has successfully started
while ! xprop -root | grep -q _NET_SUPPORTING_WM_CHECK
do
    sleep 0.1
done

# This launches the fullscreen browser.    If the xinit script ever closes, x11 will close.  This is why the last
# command is the target application which is started with "exec" so it will replace the xinit process id.
exec /usr/bin/fullscreen-webkit http://localhost