version 1.7.2.13, 2013/08/05 11:59:10
|
version 1.11.2.9, 2018/01/02 01:38:18
|
Line 32 fi
|
Line 32 fi
|
|
|
clean_fsdir() |
clean_fsdir() |
{ |
{ |
echo "+++ Clean ELWIX FS ..." | echo "+++ Clean ELWIX FS ... $1" |
| chflags -Rf nosunlink $1 |
rm -rf $1 $2 |
rm -rf $1 $2 |
} |
} |
|
|
build_fsdir() |
build_fsdir() |
{ |
{ |
echo "+++ Build ELWIX FS directory ..." | # |
| # Structure of ELWIX CF Drive mount on /elwix |
| # |
| echo "+++ Build ELWIX FS directory ... $1" |
mkdir -p $1 |
mkdir -p $1 |
|
|
cd $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 |
# boot |
install -d boot; |
install -d boot; |
# cf |
# cf |
install -d cf; |
install -d cf; |
# etc |
# etc |
install -d etc; |
install -d etc; |
install -d -o 883 -g 883 etc/mqtt; |
|
# exports |
# exports |
install -d exports; |
install -d exports; |
# home |
# home |
install -d home; |
install -d home; |
|
# local |
|
install -d local; |
|
install -d local/lib; |
# root |
# root |
install -d -m 0700 root; | install -d -m 0750 root; |
# pkg |
# pkg |
install -d pkg; |
install -d pkg; |
install -d pkg/db; |
|
install -d pkg/lib; |
|
# tftpboot |
# tftpboot |
install -d tftpboot; |
install -d tftpboot; |
|
|
Line 98 create_etc_fstab()
|
Line 75 create_etc_fstab()
|
cat >$1/etc/fstab <<_EOF |
cat >$1/etc/fstab <<_EOF |
# Automatic generated fstab for ELWIX $2 at ${BUILD_DATE} |
# 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 |
|
_EOF |
_EOF |
} |
} |
|
|
|
update_etc_cfexec() |
|
{ |
|
echo "mount = \"/elwix\"" >> $1/etc/cfexec.conf |
|
} |
|
|
install_fsdir() |
install_fsdir() |
{ |
{ |
echo "+++ Install ELWIX FS $1 in bundle OS install file ..." | echo "+++ Install ELWIX RootFS $1 in bundle OS install file ..." |
OSZ="" |
OSZ="" |
|
|
install -v ${REL}/${ROOTFS_KERN} $1/boot/kernel/kernel.gz |
install -v ${REL}/${ROOTFS_KERN} $1/boot/kernel/kernel.gz |
|
|
case "$2" in |
case "$2" in |
[Ll][Ii][Tt][Ee]_128) | [Ee][Xx][Tt]) |
install -d $1/usr |
install -d $1/usr |
cd $1/usr |
cd $1/usr |
pax -r -z -pe -f ${REL}/${ROMFS_IMG} |
pax -r -z -pe -f ${REL}/${ROMFS_IMG} |
cd - |
cd - |
|
|
install -d $1/usr/local | install -d $1/pkg |
cd $1/usr/local | cd $1/pkg |
pax -r -z -pe -f ${REL}/${ROMFS_IMG2} |
pax -r -z -pe -f ${REL}/${ROMFS_IMG2} |
cd - |
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} \ |
install -v ${REL}/${ROMFS_IMG} \ |
$1/altroot/elwix-firmware-${VERSION}_${TARGET_ARCH} |
$1/altroot/elwix-firmware-${VERSION}_${TARGET_ARCH} |
Line 154 install_fsdir()
|
Line 125 install_fsdir()
|
|
|
cd $1 |
cd $1 |
tar -czvf $OSZ . |
tar -czvf $OSZ . |
|
|
|
echo "+++ Completed ELWIX RootFS $1 --> $OSZ" |
} |
} |
|
|
### main() |
### main() |
Line 166 if [ ! -r ${REL}/${ROOTFS_KERN} -o ! -r ${REL}/${ROMFS
|
Line 139 if [ ! -r ${REL}/${ROOTFS_KERN} -o ! -r ${REL}/${ROMFS
|
exit 1 |
exit 1 |
fi |
fi |
|
|
clean_fsdir ${FS} ${REL}/${OS} | clean_fsdir ${FS} ${REL}/${OS} || exit 1 |
clean_fsdir ${FS_LITE} ${REL}/${OS_LITE} | clean_fsdir ${FS_EXT} ${REL}/${OS_EXT} || exit 1 |
#clean_fsdir ${FS_LITE128} ${REL}/${OS_LITE128} | |
|
|
build_fsdir ${FS} | build_fsdir ${FS} || exit 1 |
#build_fsdir ${FS_LITE} | build_fsdir ${FS_EXT} || exit 1 |
#build_fsdir ${FS_LITE128} | |
|
|
MakeFS_home ${FS} | MakeFS_home ${FS} || exit 1 |
#MakeFS_home ${FS_LITE} | MakeFS_home ${FS_EXT} || exit 1 |
#MakeFS_home ${FS_LITE128} | |
|
|
MakeFS_var ${FS} ${FS_ETC} | MakeFS_var ${FS} ${FS_ETC} || exit 1 |
#MakeFS_var ${FS_LITE} ${FS_ETC} | MakeFS_var ${FS_EXT} ${FS_EXT_ETC} || exit 1 |
#MakeFS_var ${FS_LITE128} ${FS_ETC} | |
|
|
MakeFS_etc ${FS} ${FS_ETC} | MakeFS_etc ${FS} ${FS_ETC} || exit 1 |
#MakeFS_etc ${FS_LITE} ${FS_ETC} lite | MakeFS_etc ${FS_EXT} ${FS_EXT_ETC} ext || exit 1 |
#MakeFS_etc ${FS_LITE128} ${FS_ETC} lite_128 | |
|
|
create_etc_fstab ${FS} | create_etc_fstab ${FS} || exit 1 |
#create_etc_fstab ${FS_LITE} lite | create_etc_fstab ${FS_EXT} ext || exit 1 |
#create_etc_fstab ${FS_LITE128} lite_128 | |
|
|
MakeFS_backup ${FS} | update_etc_cfexec ${FS} || exit 1 |
#MakeFS_backup ${FS_LITE} | update_etc_cfexec ${FS_EXT} ext || exit 1 |
#MakeFS_backup ${FS_LITE128} | |
|
|
MakeFS_boot ${FS} | MakeFS_boot ${FS} || exit 1 |
#MakeFS_boot ${FS_LITE} | MakeFS_boot ${FS_EXT} || exit 1 |
#MakeFS_boot ${FS_LITE128} | |
|
|
install_fsdir ${FS} | install_fsdir ${FS} || exit 1 |
#install_fsdir ${FS_LITE} lite | install_fsdir ${FS_EXT} ext || exit 1 |
#install_fsdir ${FS_LITE128} lite_128 | |
|
|
echo "+++ Complete build ELWIX FS" | echo "+++ Complete build ELWIX RootFS system" |
echo "ELWIX finish version ${VERSION}, Good luck!" | echo "ELWIX RootFS finish version ${VERSION}, Good luck!" |