]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/unionfs/unionroot/init.unionroot
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / unionfs / unionroot / init.unionroot
1 #!/bin/sh
2
3 PATH=/usr/bin:/usr/sbin:/bin:/sbin
4 INIT=/sbin/init.sysvinit
5 ROOTBACKUP=/media/realroot
6 UNION=/media/union
7
8 if ! which unionctl; then
9         echo >&2 "ERROR: Package unionfs-utils not installed!"
10         exec ${INIT} $@
11 fi
12
13 # For shutdown
14 if ! [ -z "$@" ]; then
15         exec ${INIT} $@
16 fi
17
18 mount.busybox /proc
19 insmod /lib/modules/`uname -r`/kernel/fs/unionfs.o
20 mount.busybox -t unionfs -o dirs=/.=rw,setattr=all none ${UNION}
21 umount.busybox /proc
22
23 cd ${UNION}
24 pivot_root . ./${ROOTBACKUP}
25 exec chroot . ${INIT}