6 Software
User Manual 69/374
High Level Hardware Access
/etc/init.d/scripts/filesystem
This user space interface includes the device and
partition information of the system.
p1:
< start >
copies data from NOR to RAM and remounts
the temporarily file system, mounts USB
device to /mnt/usbdisks, prepare NAND
Example at rc.conf: Use shared memory
Useful for other applications that need shared memory.
1. Check export variable TMPFS in /etc/init.d/rc.conf
export TMPFS="tmpfs"
2. Enable shared memory section in /etc/init.d/scripts/filesystem
# Shared memory, in case a application would need it:
if [ "$TMPFS" = "tmpfs" ]
then
mount -t $TMPFS shm /dev/shm
fi
# Shared memory end
Example: Read file system usage statistics by using /bin/df
The dataflash is the only partition that is not mounted to RAM. All other have a partition size of 8MB exclude the
rootfs itself which has a size of 48 MB.
After the kernel has been loaded by the U-Boot from RAM, the system partitions are:
# df
Filesystem Size Used Available Use% Mounted on
ubi0:rootfs 48.6M 39.7M 8.9M 82% /
rwfs 7.9M 312.0K 7.6M 4% /mnt/rwfs
rwfs 7.9M 312.0K 7.6M 4% /tmp
rwfs 7.9M 312.0K 7.6M 4% /var
rwfs 7.9M 312.0K 7.6M 4% /dev
rwfs 926.3M 14.2M 907.4M 2% /etc/ppp
rwfs 7.9M 312.0K 7.6M 4% /mnt/usbdisks
ubi1:dataflash 926.3M 14.2M 907.4M 2% /mnt/dataflash
unionfs 926.3M 14.2M 907.4M 2% /usr
unionfs 926.3M 14.2M 907.4M 2% /etc
unionfs 926.3M 14.2M 907.4M 2% /opt
unionfs 926.3M 14.2M 907.4M 2% /lib
unionfs 926.3M 14.2M 907.4M 2% /home
unionfs 926.3M 14.2M 907.4M 2% /root
In case of writing log files to e.g. var directory, it is important to keep in mind that the allocated size is
8MB. If the log file reaches the size of 8MB, not further data can be stored.