--- elwix/build_fs.sh 2013/08/05 11:59:10 1.7.2.13 +++ elwix/build_fs.sh 2014/09/15 18:17:07 1.9.4.4 @@ -5,7 +5,7 @@ # (C) AITNET ltd - Sofia/Bulgaria # by Michael Pounov # -# $Id: build_fs.sh,v 1.7.2.13 2013/08/05 11:59:10 misho Exp $ +# $Id: build_fs.sh,v 1.9.4.4 2014/09/15 18:17:07 misho Exp $ # [ -r ./config/rc.elwix ] && . ./config/rc.elwix @@ -33,6 +33,7 @@ fi clean_fsdir() { echo "+++ Clean ELWIX FS ..." + chflags -Rf nosunlink $1 rm -rf $1 $2 } @@ -73,6 +74,14 @@ build_fsdir() install -d boot; # cf install -d cf; + case ${TARGET} in + i386) + ln -fs /dev/ada0g cf/map.cfg + ;; + mips) + ln -fs /dev/map/cfg cf/map.cfg + ;; + esac # etc install -d etc; install -d -o 883 -g 883 etc/mqtt; @@ -81,7 +90,7 @@ build_fsdir() # home install -d home; # root - install -d -m 0700 root; + install -d -m 0750 root; # pkg install -d pkg; install -d pkg/db; @@ -101,6 +110,7 @@ create_etc_fstab() /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 } @@ -112,7 +122,7 @@ install_fsdir() install -v ${REL}/${ROOTFS_KERN} $1/boot/kernel/kernel.gz case "$2" in - [Ll][Ii][Tt][Ee]_128) + [Ee][Xx][Tt]) install -d $1/usr cd $1/usr pax -r -z -pe -f ${REL}/${ROMFS_IMG} @@ -123,16 +133,8 @@ install_fsdir() pax -r -z -pe -f ${REL}/${ROMFS_IMG2} cd - - OSZ=${REL}/${OS_LITE128} + OSZ=${REL}/${OS_EXT} ;; - [Ll][Ii][Tt][Ee]) - install -d $1/usr - cd $1/usr - pax -r -z -pe -f ${REL}/${ROMFS_IMG} - cd - - - OSZ=${REL}/${OS_LITE} - ;; *) install -v ${REL}/${ROMFS_IMG} \ $1/altroot/elwix-firmware-${VERSION}_${TARGET_ARCH} @@ -166,41 +168,32 @@ if [ ! -r ${REL}/${ROOTFS_KERN} -o ! -r ${REL}/${ROMFS exit 1 fi -clean_fsdir ${FS} ${REL}/${OS} -clean_fsdir ${FS_LITE} ${REL}/${OS_LITE} -#clean_fsdir ${FS_LITE128} ${REL}/${OS_LITE128} +clean_fsdir ${FS} ${REL}/${OS} || exit 1 +clean_fsdir ${FS_EXT} ${REL}/${OS_EXT} || exit 1 -build_fsdir ${FS} -#build_fsdir ${FS_LITE} -#build_fsdir ${FS_LITE128} +build_fsdir ${FS} || exit 1 +build_fsdir ${FS_EXT} || exit 1 -MakeFS_home ${FS} -#MakeFS_home ${FS_LITE} -#MakeFS_home ${FS_LITE128} +MakeFS_home ${FS} || exit 1 +MakeFS_home ${FS_EXT} || exit 1 -MakeFS_var ${FS} ${FS_ETC} -#MakeFS_var ${FS_LITE} ${FS_ETC} -#MakeFS_var ${FS_LITE128} ${FS_ETC} +MakeFS_var ${FS} ${FS_ETC} || exit 1 +MakeFS_var ${FS_EXT} ${FS_EXT_ETC} || exit 1 -MakeFS_etc ${FS} ${FS_ETC} -#MakeFS_etc ${FS_LITE} ${FS_ETC} lite -#MakeFS_etc ${FS_LITE128} ${FS_ETC} lite_128 +MakeFS_etc ${FS} ${FS_ETC} || exit 1 +MakeFS_etc ${FS_EXT} ${FS_EXT_ETC} ext || exit 1 -create_etc_fstab ${FS} -#create_etc_fstab ${FS_LITE} lite -#create_etc_fstab ${FS_LITE128} lite_128 +create_etc_fstab ${FS} || exit 1 +create_etc_fstab ${FS_EXT} ext || exit 1 -MakeFS_backup ${FS} -#MakeFS_backup ${FS_LITE} -#MakeFS_backup ${FS_LITE128} +MakeFS_backup ${FS} || exit 1 +MakeFS_backup ${FS_EXT} || exit 1 -MakeFS_boot ${FS} -#MakeFS_boot ${FS_LITE} -#MakeFS_boot ${FS_LITE128} +MakeFS_boot ${FS} || exit 1 +MakeFS_boot ${FS_EXT} || exit 1 -install_fsdir ${FS} -#install_fsdir ${FS_LITE} lite -#install_fsdir ${FS_LITE128} lite_128 +install_fsdir ${FS} || exit 1 +install_fsdir ${FS_EXT} ext || exit 1 echo "+++ Complete build ELWIX FS" echo "ELWIX finish version ${VERSION}, Good luck!"