version 1.9.2.1, 2016/11/14 00:21:35
|
version 1.10.2.1, 2017/06/19 21:12:57
|
Line 40 X_TARGET_CPUTYPE="TARGET_CPUTYPE=${TARGET_CPUTYPE}"
|
Line 40 X_TARGET_CPUTYPE="TARGET_CPUTYPE=${TARGET_CPUTYPE}"
|
|
|
clean_elwix() |
clean_elwix() |
{ |
{ |
echo "+++ Clean elwix binary from ELWIX World ..." | echo "+++ Clean elwix binary from ELWIX World ... $BSDOBJ/elwix" |
rm -rf $BSDOBJ/elwix |
rm -rf $BSDOBJ/elwix |
|
|
echo "+++ Clean ELWIX RootFS firmware ..." | echo "+++ Clean ELWIX RootFS firmware ... $ROOTFS_MKDIR" |
rm -rf $ROOTFS_MKDIR |
rm -rf $ROOTFS_MKDIR |
mkdir $ROOTFS_MKDIR |
mkdir $ROOTFS_MKDIR |
|
|
echo "+++ Clean RootFS directory ..." | echo "+++ Clean RootFS directory ... $ROOTFS" |
chflags -R noschg $ROOTFS |
chflags -R noschg $ROOTFS |
rm -rf $ROOTFS |
rm -rf $ROOTFS |
mkdir $ROOTFS |
mkdir $ROOTFS |
Line 58 clean_elwix()
|
Line 58 clean_elwix()
|
|
|
prepare_elwix() |
prepare_elwix() |
{ |
{ |
echo "+++ Prepair ELWIX RootFS firmware ..." | echo "+++ Prepair ELWIX RootFS firmware ... $ROOTFS_MKDIR" |
cd $ROOTFS_MKDIR |
cd $ROOTFS_MKDIR |
cat >$MKH <<_EOF |
cat >$MKH <<_EOF |
# Auto-generated Makefile include for crungegen |
# Auto-generated Makefile include for crungegen |
Line 79 buildopts -DNO_PAM -DNO_KERBEROS WITHOUT_PAM_SUPPORT=y
|
Line 79 buildopts -DNO_PAM -DNO_KERBEROS WITHOUT_PAM_SUPPORT=y
|
buildopts -DMK_CASPER=no WITHOUT_CASPER=yes |
buildopts -DMK_CASPER=no WITHOUT_CASPER=yes |
_EOF |
_EOF |
cat $CFGDIR/$ROOTFS_CONF >>$ROOTFS_CONF |
cat $CFGDIR/$ROOTFS_CONF >>$ROOTFS_CONF |
|
echo "+++ Prepared RootFS config ... $CFGDIR/$ROOTFS_CONF" |
|
|
install -d ${BSDOBJ}/elwix |
install -d ${BSDOBJ}/elwix |
env MAKEOBJDIRPREFIX=${BSDOBJ}/elwix crunchgen -f \ | env MAKEOBJDIRPREFIX=${BSDOBJ}/elwix ${CEXEC} crunchgen -f \ |
-h $ROOTFS_MKDIR/$MKH -m $MKF \ |
-h $ROOTFS_MKDIR/$MKH -m $MKF \ |
-c elwix.c -e elwix $ROOTFS_CONF |
-c elwix.c -e elwix $ROOTFS_CONF |
if [ $? -ne 0 ]; then |
if [ $? -ne 0 ]; then |
Line 92 _EOF
|
Line 93 _EOF
|
|
|
build_elwix() |
build_elwix() |
{ |
{ |
echo "+++ Build ELWIX RootFS firmware ..." | echo "+++ Build ELWIX RootFS firmware ... $ROOTFS_MKDIR" |
cd $ROOTFS_MKDIR |
cd $ROOTFS_MKDIR |
env MAKEOBJDIRPREFIX=${BSDOBJ}/elwix make -f $MKF \ | ${CBUILD} -f $MKF \ |
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ |
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ |
${X_TARGET_CPUTYPE} __MAKE_CONF=${MAKECONF} clean |
${X_TARGET_CPUTYPE} __MAKE_CONF=${MAKECONF} clean |
env MAKEOBJDIRPREFIX=${BSDOBJ}/elwix make -f $MKF \ | ${CBUILD} -f $MKF \ |
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ |
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ |
|
${X_TARGET_CPUTYPE} __MAKE_CONF=${MAKECONF} objs |
|
${CBUILD} -f $MKF \ |
|
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ |
${X_TARGET_CPUTYPE} __MAKE_CONF=${MAKECONF} |
${X_TARGET_CPUTYPE} __MAKE_CONF=${MAKECONF} |
if [ $? -ne 0 ]; then |
if [ $? -ne 0 ]; then |
exit 1 |
exit 1 |
Line 108 build_elwix()
|
Line 112 build_elwix()
|
|
|
build_rootdir() |
build_rootdir() |
{ |
{ |
echo "+++ Build RootFS directory ..." | echo "+++ Build RootFS directory ... $ROOTFS" |
cd $ROOTFS |
cd $ROOTFS |
|
|
install -d bin; |
install -d bin; |
install -d dev; |
install -d dev; |
install -d elwix; |
install -d elwix; |
install -d elwix/etc; | install -d etc; |
install -d libexec; |
install -d libexec; |
install -d mnt; |
install -d mnt; |
install -d -m 0555 proc; |
install -d -m 0555 proc; |
Line 130 build_rootdir()
|
Line 134 build_rootdir()
|
|
|
ln -fs /usr/lib lib; |
ln -fs /usr/lib lib; |
|
|
ln -fs /elwix/etc etc; |
|
ln -fs /elwix/exports exports; |
ln -fs /elwix/exports exports; |
ln -fs /elwix/home home; |
ln -fs /elwix/home home; |
ln -fs /elwix/root root; |
ln -fs /elwix/root root; |
Line 145 install_rootfs()
|
Line 148 install_rootfs()
|
SBIN="${ROOTFS}/sbin" |
SBIN="${ROOTFS}/sbin" |
UBIN="${ROOTFS}/usr/bin" |
UBIN="${ROOTFS}/usr/bin" |
LIBEXEC="${ROOTFS}/usr/libexec" |
LIBEXEC="${ROOTFS}/usr/libexec" |
ETC="${ROOTFS}/elwix/etc" | ETC="${ROOTFS}/etc" |
|
|
PRG="/sbin/elwix" |
PRG="/sbin/elwix" |
LNPRG="${SBIN}/elwix" |
LNPRG="${SBIN}/elwix" |
|
|
echo "+++ Install ELWIX into RootFS directory ..." | echo "+++ Install ELWIX into RootFS directory ... $ROOTFS" |
install $ROOTFS_MKDIR/elwix $SBIN |
install $ROOTFS_MKDIR/elwix $SBIN |
|
|
InstallList ${ELWIX_ROOTFS} ${WORLD} ${ROOTFS} |
InstallList ${ELWIX_ROOTFS} ${WORLD} ${ROOTFS} |
Line 378 install_rootfs()
|
Line 381 install_rootfs()
|
|
|
echo "+++ ELWIX clean CVS tags ..." |
echo "+++ ELWIX clean CVS tags ..." |
CleanCVS $ETC |
CleanCVS $ETC |
CleanCVS $ETC/etc |
|
echo |
echo |
} |
} |
|
|
build_image() |
build_image() |
{ |
{ |
echo "+++ Build ELWIX RootFS image ..." | echo "+++ Build ELWIX RootFS image ... $ROOTFS --> $REL/$ROOTFS_IMG" |
makefs -s ${ROOTFS_SIZE} -o minfree=0 $REL/$ROOTFS_IMG $ROOTFS |
makefs -s ${ROOTFS_SIZE} -o minfree=0 $REL/$ROOTFS_IMG $ROOTFS |
|
echo "+++ Completed ELWIX RootFS image ... $ROOTFS --> $REL/$ROOTFS_IMG" |
} |
} |
|
|
install_image() |
install_image() |
{ |
{ |
echo "+++ Install ELWIX RootFS Image into kernel ..." | echo "+++ Install ELWIX RootFS Image into kernel ... $REL/$ROOTFS_IMG" |
mfs_size=`stat -f '%z' $REL/$ROOTFS_IMG 2>/dev/null` |
mfs_size=`stat -f '%z' $REL/$ROOTFS_IMG 2>/dev/null` |
[ -z ${mfs_size} ] && echo "Can't determine MFS image size" && exit 1 |
[ -z ${mfs_size} ] && echo "Can't determine MFS image size" && exit 1 |
|
|
Line 405 install_image()
|
Line 408 install_image()
|
|
|
cp $KERNEL_ROOTFS $NEWKERN |
cp $KERNEL_ROOTFS $NEWKERN |
dd if=$REL/$ROOTFS_IMG ibs=8192 of=$NEWKERN obs=${sec_start} oseek=1 conv=notrunc \ |
dd if=$REL/$ROOTFS_IMG ibs=8192 of=$NEWKERN obs=${sec_start} oseek=1 conv=notrunc \ |
2>/dev/null && echo "MFS image embedded into kernel" | 2>/dev/null && echo "'-> Completed MFS image embedded into kernel" |
|
|
# START=`strings -td $KERNEL_ROOTFS | grep "MFS Filesystem" | cut -d ' ' -f 1 | head -1` |
# START=`strings -td $KERNEL_ROOTFS | grep "MFS Filesystem" | cut -d ' ' -f 1 | head -1` |
# STOP=`strings -td $KERNEL_ROOTFS | grep "MFS Filesystem" | cut -d ' ' -f 1 | tail -1` |
# STOP=`strings -td $KERNEL_ROOTFS | grep "MFS Filesystem" | cut -d ' ' -f 1 | tail -1` |
Line 420 install_image()
|
Line 423 install_image()
|
cd $REL |
cd $REL |
gzip -9 $KRNNAME |
gzip -9 $KRNNAME |
cd - |
cd - |
|
|
|
echo "+++ Completed ELWIX RootFS kernel ... $NEWKERN.gz" |
} |
} |
|
|
### main() |
### main() |