If you like BoxMatrix then please contribute Supportdata, Supportdata2, Firmware and/or Hardware (get in touch).
My metamonk@yahoo.com is not reachable by me since years. Please use hippie2000@webnmail.de instead.
Property:Wrapper-Linux
BoxMatrix >> Lexicon >> Computer-Terms >> Wrapper-Linux | @ BoxMatrix - IRC-Chat - Translate: de es fr it nl pl |
News | Selectors | Models | Accessories | Components | Environment | Config | Commands | System | Webif | Software | Develop | Lexicon | Community | Project | Media |
Computer | FRITZ | I18N | Telephony | Smarthome | Internet | Protocols | Multimedia | Formats | Hardware | Software | Research |
Term
Term: | Wrapper-Linux | Wiki | Freetz | IPPF | whmf | AVM | Web |
Short for: | Linux with wrapped filesystems | ||||||
Location: | Lexicon >> Computer-Terms | ||||||
Weblinks: | |||||||
Description: | Running a Linux with multiple nested Filesystems |
Goto: FRITZ!OS - wrapper - startup - mounts - SMW-Browser
Details
A Wrapper-Linux is the term used here for a single Linux Kernel with multiple sequentially started nested Filesystems
FRITZ!OS
Some early NAND models (see the Multi-Linux article) use a Wrapper-Linux which consists of 3 parts:
- The Linux Kernel
- The outer minimalistic
Wrapper
filesystem containing: - The inner FRITZ!OS
Core
filesystem
wrapper
The minimalistic Wrapper
filesystem only contains:
- busybox and its symlinks
- ld-uClibc.so and libuClibc.so and their symlinks
- inittab - init configuration
- flash_update - init / update script
- reboot - wrapper script
- filesystem_core.squashfs -
Core
filesystem image
Wrapper
filesystem - 7490 fw 7.57:
drwxr-xr-x 1 root root 2048 Oct 4 2023 /bin lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/ash -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/base64 -> busybox -rwxr-xr-x 1 root root 623504 Oct 4 2023 /bin/busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/cat -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/chgrp -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/chmod -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/chown -> busybox lrwxrwxrwx 1 root root 9 Oct 4 2023 /bin/clearshringbuf -> shringbuf lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/cp -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/date -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/dd -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/df -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/echo -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/egrep -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/false -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/fgrep -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/getopt -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/grep -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/gunzip -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/gzip -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/hostname -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/iostat -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/kill -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/ln -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/login -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/ls -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/mkdir -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/mknod -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/more -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/mount -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/mpstat -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/mv -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/netstat -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/nice -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/pidof -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/ping -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/ping6 -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/printenv -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/ps -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/pwd -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/rm -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/rmdir -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/sed -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/setserial -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/sh -> busybox lrwxrwxrwx 1 root root 9 Oct 4 2023 /bin/showshringbuf -> shringbuf lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/sleep -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/stat -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/stty -> busybox lrwxrwxrwx 1 root root 20 Oct 4 2023 /bin/supportdata_argo.dpm -> /bin/supportdata.dpm lrwxrwxrwx 1 root root 20 Oct 4 2023 /bin/supportdata_argo.dsl -> /bin/supportdata.dsl lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/sync -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/tar -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/touch -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/true -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/umount -> busybox lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/uname -> busybox lrwxrwxrwx 1 root root 9 Oct 4 2023 /bin/usermand -> usermand2 lrwxrwxrwx 1 root root 7 Oct 4 2023 /bin/vi -> busybox drwxr-xr-x 1 root root 2048 Oct 4 2023 /core drwxr-xr-x 7 root root 14540 Jan 1 1970 /dev crw-rw---- 1 root root 242, 0 Jan 1 1970 /dev/led drwxr-xr-x 1 root root 2048 Oct 4 2023 /etc -rw-r--r-- 1 root root 438 Oct 4 2023 /etc/inittab lrwxrwxrwx 1 root root 9 Oct 4 2023 /etc/mtab -> /tmp/mtab -rw-r--r-- 1 root root 42721280 Oct 4 2023 filesystem_core.squashfs drwxr-xr-x 1 root root 2048 Oct 4 2023 /lib -rwxr-xr-x 1 root root 36056 Oct 4 2023 /lib/ld-uClibc-1.0.32.so lrwxrwxrwx 1 root root 14 Oct 4 2023 /lib/ld-uClibc.so.0 -> ld-uClibc.so.1 lrwxrwxrwx 1 root root 19 Oct 4 2023 /lib/ld-uClibc.so.1 -> ld-uClibc-1.0.32.so lrwxrwxrwx 1 root root 19 Oct 4 2023 /lib/libc.so.0 -> libuClibc-1.0.32.so -rwxr-xr-x 1 root root 1406916 Oct 4 2023 /lib/libuClibc-1.0.32.so drwxr-xr-x 1 root root 2048 Oct 4 2023 /proc drwxr-xr-x 1 root root 2048 Oct 4 2023 /sbin lrwxrwxrwx 1 root root 8 Oct 4 2023 /sbin/ar7login_frominternet -> ar7login lrwxrwxrwx 1 root root 14 Oct 4 2023 /sbin/arp -> ../bin/busybox lrwxrwxrwx 1 root root 4 Oct 4 2023 /sbin/dsltest -> dsld -rwxr-xr-x 1 root root 12583 Oct 4 2023 /sbin/flash_update lrwxrwxrwx 1 root root 6 Oct 4 2023 /sbin/fsck.ext2 -> e2fsck lrwxrwxrwx 1 root root 6 Oct 4 2023 /sbin/fsck.ext3 -> e2fsck lrwxrwxrwx 1 root root 6 Oct 4 2023 /sbin/fsck.ext4 -> e2fsck lrwxrwxrwx 1 root root 14 Oct 4 2023 /sbin/halt -> ../bin/busybox lrwxrwxrwx 1 root root 14 Oct 4 2023 /sbin/ifconfig -> ../bin/busybox lrwxrwxrwx 1 root root 14 Oct 4 2023 /sbin/init -> ../bin/busybox lrwxrwxrwx 1 root root 15 Oct 4 2023 /sbin/insmod -> ../usr/bin/kmod lrwxrwxrwx 1 root root 14 Oct 4 2023 /sbin/localize -> /sbin/eventadd lrwxrwxrwx 1 root root 15 Oct 4 2023 /sbin/lsmod -> ../usr/bin/kmod lrwxrwxrwx 1 root root 15 Oct 4 2023 /sbin/modprobe -> ../usr/bin/kmod lrwxrwxrwx 1 root root 23 Oct 4 2023 /sbin/notify_avmnet -> /usr/sbin/notify_avmnet lrwxrwxrwx 1 root root 14 Oct 4 2023 /sbin/pivot_root -> ../bin/busybox lrwxrwxrwx 1 root root 14 Oct 4 2023 /sbin/poweroff -> ../bin/busybox -rwxr-xr-x 1 root root 54 Oct 4 2023 /sbin/reboot lrwxrwxrwx 1 root root 15 Oct 4 2023 /sbin/rmmod -> ../usr/bin/kmod lrwxrwxrwx 1 root root 14 Oct 4 2023 /sbin/route -> ../bin/busybox lrwxrwxrwx 1 root root 14 Oct 4 2023 /sbin/setconsole -> ../bin/busybox lrwxrwxrwx 1 root root 18 Oct 4 2023 /sbin/showaddrs -> /./sbin/showroutes lrwxrwxrwx 1 root root 14 Oct 4 2023 /sbin/switch_root -> ../bin/busybox lrwxrwxrwx 1 root root 14 Oct 4 2023 /sbin/sysctl -> ../bin/busybox lrwxrwxrwx 1 root root 16 Oct 4 2023 /sbin/udevadm -> /usr/bin/udevadm lrwxrwxrwx 1 root root 14 Oct 4 2023 /sbin/vconfig -> ../bin/busybox drwxr-xr-x 1 root root 2048 Oct 4 2023 /tmp -rw-r--r-- 1 root root 0 Oct 4 2023 /tmp/mtab drwxr-xr-x 1 root root 2048 Oct 4 2023 /var
There are quite some dead links, but they are unused either.
startup
The startup just consists of the inittab - 7490 fw 7.57:
root@fritz4:/var/mod/root# cat /wrapper/etc/inittab null::sysinit:/bin/mount -t squashfs /filesystem_core.squashfs /core -o loop null::sysinit:/bin/mount /dev /core/dev -o bind null::sysinit:/sbin/pivot_root /core/ /core/wrapper/ null::sysinit:/wrapper/sbin/flash_update ::sysinit:/etc/boot.d/1 # Start an "askfirst" shell on the console (whatever that may be) /dev/ttyS0::askfirst:-/bin/sh # Stuff to do before rebooting ::shutdown:/bin/sh -c /etc/inittab.shutdown ::restart:/sbin/init
All startup magic happens in the 5 bold sysinit
lines.
First filesystem_core.squashfs is mounted to /core
of the Wrapper
filesystem as a loop device,
This will be the later /
of the Core
filesystem. Next /dev
is "cloned" using mount bind.
Next pivot_root switches /
from the Wrapper
to the Core
filesystem. The Wrapper
stays accessible at /wrapper
.
That's why the flash_update init script from the Wrapper
filesystem could be executed in Core
filesystem context after.
Finally the Core
filesystem startup script /etc/boot.d/1
is executed to boot FRITZ!OS.
mounts
The final mount situation looks like this - 7490 fw 7.57:
root@fritz4:/var/mod/root# mount rootfs on / type rootfs (rw) /dev/root on /wrapper type yaffs (ro,relatime) devtmpfs on /wrapper/dev type devtmpfs (rw,relatime,size=119396k,nr_inodes=29849,mode=755) /dev/loop0 on / type squashfs (ro,relatime) devtmpfs on /dev type devtmpfs (rw,relatime,size=119396k,nr_inodes=29849,mode=755) proc on /proc type proc (rw,relatime) tmpfs on /var type tmpfs (rw,relatime) sysfs on /sys type sysfs (rw,relatime) devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000) securityfs on /sys/kernel/security type securityfs (rw,relatime) none on /sys/kernel/debug type debugfs (rw,relatime) /dev/mtdblock4 on /var/flash type yaffs2 (rw,sync,relatime) /dev/mtdblock5 on /var/media/ftp type yaffs2 (rw,sync,relatime) root@fritz4:/var/mod/root# df -h Filesystem Size Used Available Use% Mounted on /dev/root 48.0M 43.8M 4.2M 91% /wrapper devtmpfs 116.6M 0 116.6M 0% /wrapper/dev /dev/loop0 40.8M 40.8M 0 100% / devtmpfs 116.6M 0 116.6M 0% /dev tmpfs 116.7M 2.2M 114.5M 2% /var /dev/mtdblock4 2.0M 924.0K 1.1M 45% /var/flash /dev/mtdblock5 406.0M 1.7M 404.3M 0% /var/media/ftp
TODO
BoxMatrix lists the Wrapper
filesystem in the Firmware-Scans
sections of each model article.
But the content does not appear in the Model-Matrix
of each article covering a file it contains YET.