Flash filesystem

This buildfile starts up the flash filesystem on an x86 board.

[virtual=x86,apic +compress] .bootstrap = {
    PATH=/proc/boot:/bin procnto

[+script] .script = {
    devc-con -e -n5 &
    reopen /dev/con1
    devf-abc123 -r -b3 -m2 -u2 -t4 &
    waitfor /fs0p0
    [+session] TERM=qansi PATH=/proc/boot:/bin esh &

[type=link] /tmp=/dev/shmem
[type=link] /bin=/fs0p0/bin
[type=link] /etc=/fs0p0/etc

[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so



The boot file

The bootstrap inline file (e.g., .bootstrap) specifies the startup program (startup-apic) and the kernel (procnto). Notice that we set the PATH environment variable to point to both /proc/boot and /bin. The /bin directory is a link (created with the [type=link]) to the flash filesystem's /fs0p0/bin path.

The script file

In the script inline file (e.g., .script file), we start up the console driver with five consoles, reopen standard input, output, and error for /dev/con1, and start the flash filesystem driver devf-abc123. The command-line options we use are:

Enable fault recovery for dirty extents, dangling extents, and partial reclaims.
Enable background reclaim at priority 3.
Specify the highest update level (2) to update files and directories.
Specify the highest number of threads. Extra threads will increase performance when background reclaim is enabled (with the -b option) and when multiple chips and/or spare blocks are available.

The devf-abc123 will automatically mount the flash partition as /fs0p0. Notice the process manager symbolic links we created at the bottom of the buildfile:

[type=link] /bin=/fs0p0/bin
[type=link] /etc=/fs0p0/etc

These symbolic links give us /bin and /etc from the flash filesystem.

For more information, see devf-generic in the QNX SDP Utilities Reference.