version 1.4.2.2, 2013/01/27 23:20:15
|
version 1.7.2.1, 2013/07/29 15:06:58
|
Line 30 if [ "${USER}" != "root" ]; then
|
Line 30 if [ "${USER}" != "root" ]; then
|
exit 1 |
exit 1 |
fi |
fi |
|
|
clean_fsdir() | clean_rel() |
{ |
{ |
echo "+++ Clean ELWIX FS ..." | echo "+++ Clean ELWIX OS release ..." |
rm -rf ${FS} ${FS_LITE} ${FS_LITE128} | rm -rf ${REL}/${OS} |
| |
echo "+++ Clean ELWIX FS release ..." | |
rm -rf ${REL}/${OS} ${REL}/${OS_LITE} ${REL}/${OS_LITE128} | |
} |
} |
|
|
build_fsdir() | build_vardir() |
{ |
{ |
echo "+++ Build ELWIX FS directory ..." | echo "+++ Build ELWIX altroot directory ..." |
mkdir -p $1 | |
|
|
cd $1 |
cd $1 |
|
|
# altroot |
# altroot |
install -d altroot; |
install -d altroot; |
# altroot/var |
# altroot/var |
Line 64 build_fsdir()
|
Line 59 build_fsdir()
|
install -d -o 883 -g 883 altroot/var/mqtt; |
install -d -o 883 -g 883 altroot/var/mqtt; |
install -d altroot/var/named; |
install -d altroot/var/named; |
install -d altroot/var/run; |
install -d altroot/var/run; |
|
install -d -m 1777 altroot/var/tmp; |
install -d altroot/var/sys; |
install -d altroot/var/sys; |
install -d -o 53 -g 53 altroot/var/run/named; |
install -d -o 53 -g 53 altroot/var/run/named; |
install -d -o 101 -g 101 altroot/var/run/quagga; |
install -d -o 101 -g 101 altroot/var/run/quagga; |
Line 72 build_fsdir()
|
Line 68 build_fsdir()
|
install -d -g 1 altroot/var/spool/lpd; |
install -d -g 1 altroot/var/spool/lpd; |
install -d -g 1 altroot/var/spool/output; |
install -d -g 1 altroot/var/spool/output; |
install -d -g 1 altroot/var/spool/output/lpd; |
install -d -g 1 altroot/var/spool/output/lpd; |
# boot |
|
install -d boot; |
|
# cf |
|
install -d cf; |
|
# etc |
|
install -d etc; |
|
install -d -o 883 -g 883 etc/mqtt; |
|
# exports |
|
install -d exports; |
|
# home |
|
install -d home; |
|
# root |
|
install -d -m 0700 root; |
|
# pkg |
|
install -d pkg; |
|
install -d pkg/db; |
|
install -d pkg/lib; |
|
# tftpboot |
|
install -d tftpboot; |
|
|
|
chown -hR root:wheel . |
chown -hR root:wheel . |
cd - |
cd - |
Line 121 mkboot()
|
Line 98 mkboot()
|
mkvar() |
mkvar() |
{ |
{ |
echo "+++ Build ELWIX FS var directory ..." |
echo "+++ Build ELWIX FS var directory ..." |
ln -s /tmp $1/altroot/var/tmp |
|
|
|
touch $1/altroot/var/run/utmp |
touch $1/altroot/var/run/utmp |
|
|
touch $1/altroot/var/account/acct |
touch $1/altroot/var/account/acct |
Line 164 create_etc_fstab()
|
Line 139 create_etc_fstab()
|
cat >$1 <<_EOF |
cat >$1 <<_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 | /dev/ufs/elwix / ufs ro 0 1 |
md3 /tmp mfs rw,-s8m,-oasync,-S 0 0 | md2 /var mfs rw,-s16m,-S 0 0 |
md4 /var mfs rw,-s16m,-S 0 0 | |
_EOF |
_EOF |
} |
} |
|
|
mketc() |
mketc() |
{ |
{ |
echo "+++ Build ELWIX FS etc directory ..." | echo "+++ Build ELWIX OS etc directory ..." |
InstallDir ${FS_ETC} $1/etc |
InstallDir ${FS_ETC} $1/etc |
|
|
chown -R root:wheel $1/etc; |
chown -R root:wheel $1/etc; |
Line 217 mketc()
|
Line 191 mketc()
|
|
|
mkbackup() |
mkbackup() |
{ |
{ |
echo "+++ Build ELWIX FS backup factory default directory ..." | echo "+++ Build ELWIX OS backup factory default directory ..." |
mkdir -p $1/altroot/backup |
mkdir -p $1/altroot/backup |
|
|
cd $1 |
cd $1 |
cp -p etc/config.xml altroot/backup |
cp -p etc/config.xml altroot/backup |
tar -czf altroot/backup/.etc.tgz etc | # tar -czf altroot/backup/.etc.tgz etc |
|
|
cd altroot | # cd altroot |
tar -czf backup/.var.tgz var | # tar -czf backup/.var.tgz var |
} |
} |
|
|
mkhome() |
mkhome() |
{ |
{ |
echo "+++ Build ELWIX FS root home directory ..." | echo "+++ Build ELWIX OS root home directory ..." |
install -d $1/root/.ssh |
install -d $1/root/.ssh |
[ -r ${CFGDIR}/root.skel/ssh/authorized_keys2 ] && \ |
[ -r ${CFGDIR}/root.skel/ssh/authorized_keys2 ] && \ |
install -v ${CFGDIR}/root.skel/ssh/authorized_keys2 $1/root/.ssh; |
install -v ${CFGDIR}/root.skel/ssh/authorized_keys2 $1/root/.ssh; |
Line 242 mkhome()
|
Line 216 mkhome()
|
install -v ${CFGDIR}/root.skel/vimrc $1/root/.vimrc; |
install -v ${CFGDIR}/root.skel/vimrc $1/root/.vimrc; |
} |
} |
|
|
install_fsdir() | install_rel() |
{ |
{ |
echo "+++ Install ELWIX FS $1 in bundle OS install file ..." | echo "+++ Install ELWIX OS $1 in bundle OS install file ..." |
OSZ="" |
OSZ="" |
|
|
install -v ${REL}/${ROOTFS_KERN} $1/boot/kernel | install -v ${KERNEL} $1/boot/kernel; |
| cd $1/boot/kernel; |
| gzip -9 kernel; |
| cd -; |
|
|
case "$2" in |
case "$2" in |
_[Ll][Ii][Tt][Ee]_128) | _128) |
install -d $1/usr | |
cd $1/usr | |
pax -r -z -pe -f ${REL}/${ROMFS_IMG} | |
cd - | |
| |
install -d $1/usr/local |
install -d $1/usr/local |
cd $1/usr/local |
cd $1/usr/local |
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_128} |
;; |
;; |
_[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} |
|
ln $1/altroot/elwix-firmware-${VERSION}_${TARGET_ARCH} \ |
|
$1/altroot/${ROMFS_IMG} |
|
ln -s /elwix/altroot/elwix-firmware-${VERSION}_${TARGET_ARCH} \ |
|
$1/${ROMFS_IMG} |
|
|
|
install -v ${REL}/${ROMFS_IMG2} \ |
|
$1/altroot/elwix-firmware2-${VERSION}_${TARGET_ARCH} |
|
ln $1/altroot/elwix-firmware2-${VERSION}_${TARGET_ARCH} \ |
|
$1/altroot/${ROMFS_IMG2} |
|
ln -s /elwix/altroot/elwix-firmware2-${VERSION}_${TARGET_ARCH} \ |
|
$1/${ROMFS_IMG2} |
|
|
|
OSZ=${REL}/${OS} |
OSZ=${REL}/${OS} |
;; |
;; |
esac |
esac |
Line 304 if [ ! -r ${REL}/${ROOTFS_KERN} -o ! -r ${REL}/${ROMFS
|
Line 254 if [ ! -r ${REL}/${ROOTFS_KERN} -o ! -r ${REL}/${ROMFS
|
exit 1 |
exit 1 |
fi |
fi |
|
|
clean_fsdir | clean_rel |
| build_vardir ${ROMFS}/elwix |
| mkboot ${ROMFS} |
| mkhome ${ROMFS}/elwix |
| mkvar ${ROMFS}/elwix |
| mketc ${ROMFS}/elwix |
| mkbackup ${ROMFS}/elwix |
| install_rel ${ROMFS} |
|
|
build_fsdir ${FS} | echo "+++ Complete build ELWIX OS" |
build_fsdir ${FS_LITE} | |
build_fsdir ${FS_LITE128} | |
| |
mkboot ${FS} | |
mkboot ${FS_LITE} | |
mkboot ${FS_LITE128} | |
| |
mkhome ${FS} | |
mkhome ${FS_LITE} | |
mkhome ${FS_LITE128} | |
| |
mkvar ${FS} | |
mkvar ${FS_LITE} | |
mkvar ${FS_LITE128} | |
| |
mketc ${FS} | |
mketc ${FS_LITE} "_lite" | |
mketc ${FS_LITE128} "_lite_128" | |
| |
mkbackup ${FS} | |
mkbackup ${FS_LITE} | |
mkbackup ${FS_LITE128} | |
| |
install_fsdir ${FS} | |
install_fsdir ${FS_LITE} "_lite" | |
install_fsdir ${FS_LITE128} "_lite_128" | |
| |
echo "+++ Complete build ELWIX FS" | |
echo "ELWIX finish version ${VERSION}, Good luck!" |
echo "ELWIX finish version ${VERSION}, Good luck!" |