--- elwix/build_fs.sh 2014/07/29 17:15:44 1.9.4.3 +++ elwix/build_fs.sh 2017/06/15 22:34:29 1.11.2.1 @@ -5,7 +5,7 @@ # (C) AITNET ltd - Sofia/Bulgaria # by Michael Pounov # -# $Id: build_fs.sh,v 1.9.4.3 2014/07/29 17:15:44 misho Exp $ +# $Id: build_fs.sh,v 1.11.2.1 2017/06/15 22:34:29 misho Exp $ # [ -r ./config/rc.elwix ] && . ./config/rc.elwix @@ -32,53 +32,24 @@ fi clean_fsdir() { - echo "+++ Clean ELWIX FS ..." + echo "+++ Clean ELWIX FS ... $1" chflags -Rf nosunlink $1 rm -rf $1 $2 } build_fsdir() { - echo "+++ Build ELWIX FS directory ..." + echo "+++ Build ELWIX FS directory ... $1" mkdir -p $1 cd $1 - -# altroot - install -d altroot; - # altroot/var - install -d altroot/var; - install -d altroot/var/account; - install -d altroot/var/at; - install -d altroot/var/at/jobs; - install -d altroot/var/at/spool; - install -d -g 63 -m 0770 altroot/var/authpf; - install -d -m 0750 altroot/var/cron; - install -d -m 0700 altroot/var/cron/tabs; - install -d altroot/var/db; - install -d -m 0555 altroot/var/empty; - install -d altroot/var/log; - install -d -o 101 -g 101 altroot/var/log/quagga; - install -d -o 883 -g 883 altroot/var/mqtt; - install -d altroot/var/named; - install -d altroot/var/run; - install -d altroot/var/sys; - install -d -o 53 -g 53 altroot/var/run/named; - install -d -o 101 -g 101 altroot/var/run/quagga; - install -d altroot/var/spool; - install -d -o 66 -g 68 -m 0775 altroot/var/spool/lock; - install -d -g 1 altroot/var/spool/lpd; - install -d -g 1 altroot/var/spool/output; - install -d -g 1 altroot/var/spool/output/lpd; # boot install -d boot; # cf install -d cf; case ${TARGET} in i386) - # 256KB for config map - dd if=/dev/zero of=cf/map.cfg bs=65536 count=4 - chflags sunlink cf/map.cfg + ln -fs /dev/ada0g cf/map.cfg ;; mips) ln -fs /dev/map/cfg cf/map.cfg @@ -91,12 +62,12 @@ build_fsdir() install -d exports; # home install -d home; +# local + install -d local; # root install -d -m 0750 root; # pkg install -d pkg; - install -d pkg/db; - install -d pkg/lib; # tftpboot install -d tftpboot; @@ -110,15 +81,17 @@ create_etc_fstab() # Automatic generated fstab for ELWIX $2 at ${BUILD_DATE} # /dev/ufs/elwix /elwix ufs ro 0 1 -md3 /tmp mfs rw,-s8m,-oasync,-S 0 0 -md4 /var mfs rw,-s16m,-S 0 0 -/var/db /elwix/etc unionfs rw,noauto,-onoatime 0 0 _EOF } +update_etc_cfexec() +{ + echo "mount = \"/elwix\"" >> $1/etc/cfexec.conf +} + install_fsdir() { - echo "+++ Install ELWIX FS $1 in bundle OS install file ..." + echo "+++ Install ELWIX RootFS $1 in bundle OS install file ..." OSZ="" install -v ${REL}/${ROOTFS_KERN} $1/boot/kernel/kernel.gz @@ -158,6 +131,8 @@ install_fsdir() cd $1 tar -czvf $OSZ . + + echo "+++ Completed ELWIX RootFS $1 --> $OSZ" } ### main() @@ -188,6 +163,9 @@ MakeFS_etc ${FS_EXT} ${FS_EXT_ETC} ext || exit 1 create_etc_fstab ${FS} || exit 1 create_etc_fstab ${FS_EXT} ext || exit 1 +update_etc_cfexec ${FS} || exit 1 +update_etc_cfexec ${FS_EXT} ext || exit 1 + MakeFS_backup ${FS} || exit 1 MakeFS_backup ${FS_EXT} || exit 1 @@ -197,5 +175,5 @@ MakeFS_boot ${FS_EXT} || exit 1 install_fsdir ${FS} || exit 1 install_fsdir ${FS_EXT} ext || exit 1 -echo "+++ Complete build ELWIX FS" -echo "ELWIX finish version ${VERSION}, Good luck!" +echo "+++ Complete build ELWIX RootFS system" +echo "ELWIX RootFS finish version ${VERSION}, Good luck!"