version 1.4.2.1, 2013/01/28 10:48:45
|
version 1.8.2.8, 2014/07/01 19:36:35
|
Line 30 if [ "${USER}" != "root" ]; then
|
Line 30 if [ "${USER}" != "root" ]; then
|
exit 1 |
exit 1 |
fi |
fi |
|
|
NEWKERN="${REL}/kernel" | KRNNAME="kernel_rootfs" |
| NEWKERN="${REL}/${KRNNAME}" |
| MKF="Makefile.elwix" |
| MKH="Makefile.inc" |
|
|
|
# Set TARGET_CPUTYPE only for world compiling. Don't use this in kernel build! |
|
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 ..." |
rm -rf $BSDOBJ/elwix |
rm -rf $BSDOBJ/elwix |
|
|
echo "+++ Clean ELWIX RootFS firmware ..." |
echo "+++ Clean ELWIX RootFS firmware ..." |
rm -rf $MKDIR | rm -rf $ROOTFS_MKDIR |
mkdir $MKDIR | mkdir $ROOTFS_MKDIR |
|
|
echo "+++ Clean RootFS directory ..." |
echo "+++ Clean RootFS directory ..." |
chflags -R noschg $ROOTFS |
chflags -R noschg $ROOTFS |
Line 53 clean_elwix()
|
Line 59 clean_elwix()
|
prepare_elwix() |
prepare_elwix() |
{ |
{ |
echo "+++ Prepair ELWIX RootFS firmware ..." |
echo "+++ Prepair ELWIX RootFS firmware ..." |
cd $MKDIR | cd $ROOTFS_MKDIR |
cat >$MKH <<_EOF |
cat >$MKH <<_EOF |
# Auto-generated Makefile include for crungegen |
# Auto-generated Makefile include for crungegen |
# !!! Dont edit by hand !!! |
# !!! Dont edit by hand !!! |
Line 68 srcdirs ${BSDSRC}/bin ${BSDSRC}/sbin ${BSDSRC}/libexec
|
Line 74 srcdirs ${BSDSRC}/bin ${BSDSRC}/sbin ${BSDSRC}/libexec
|
srcdirs ${BSDSRC}/usr.bin ${BSDSRC}/usr.sbin ${BSDSRC}/usr.sbin/wpa |
srcdirs ${BSDSRC}/usr.bin ${BSDSRC}/usr.sbin ${BSDSRC}/usr.sbin/wpa |
srcdirs ${BSDSRC}/secure/usr.bin ${BSDSRC}/secure/usr.sbin ${BSDSRC}/secure/libexec |
srcdirs ${BSDSRC}/secure/usr.bin ${BSDSRC}/secure/usr.sbin ${BSDSRC}/secure/libexec |
|
|
|
buildopts TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} ${X_TARGET_CPUTYPE} __MAKE_CONF=${MAKECONF} |
buildopts -DNO_PAM -DNO_KERBEROS WITHOUT_PAM_SUPPORT=yes WITHOUT_KERBEROS_SUPPORT=yes WITHOUT_KERBEROS=yes |
buildopts -DNO_PAM -DNO_KERBEROS WITHOUT_PAM_SUPPORT=yes WITHOUT_KERBEROS_SUPPORT=yes WITHOUT_KERBEROS=yes |
buildopts TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} MAKEOBJDIRPREFIX=${BSDOBJ}/elwix | buildopts -DMK_CASPER=no WITHOUT_CASPER=yes |
_EOF |
_EOF |
cat $CFGDIR/$ROOTFS_CONF >>$ROOTFS_CONF |
cat $CFGDIR/$ROOTFS_CONF >>$ROOTFS_CONF |
|
|
. ${CENV} |
|
install -d ${BSDOBJ}/elwix |
install -d ${BSDOBJ}/elwix |
crunchgen -f -o -p ${BSDOBJ}/elwix -h $MKDIR/$MKH -m $MKF -c elwix.c -e elwix $ROOTFS_CONF | env MAKEOBJDIRPREFIX=${BSDOBJ}/elwix crunchgen -f \ |
| -h $ROOTFS_MKDIR/$MKH -m $MKF \ |
| -c elwix.c -e elwix $ROOTFS_CONF |
| if [ $? -ne 0 ]; then |
| exit 1 |
| fi |
cd - |
cd - |
} |
} |
|
|
build_elwix() |
build_elwix() |
{ |
{ |
echo "+++ Build ELWIX RootFS firmware ..." |
echo "+++ Build ELWIX RootFS firmware ..." |
cd $MKDIR | cd $ROOTFS_MKDIR |
. ${CENV} | env MAKEOBJDIRPREFIX=${BSDOBJ}/elwix make -f $MKF \ |
MAKEOBJDIRPREFIX=${BSDOBJ}/elwix | TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ |
make -f $MKF clean | ${X_TARGET_CPUTYPE} __MAKE_CONF=${MAKECONF} clean |
make -f $MKF | env MAKEOBJDIRPREFIX=${BSDOBJ}/elwix make -f $MKF \ |
| TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ |
| ${X_TARGET_CPUTYPE} __MAKE_CONF=${MAKECONF} |
if [ $? -ne 0 ]; then |
if [ $? -ne 0 ]; then |
exit 1 |
exit 1 |
fi |
fi |
Line 138 install_rootfs()
|
Line 151 install_rootfs()
|
LNPRG="${SBIN}/elwix" |
LNPRG="${SBIN}/elwix" |
|
|
echo "+++ Install ELWIX into RootFS directory ..." |
echo "+++ Install ELWIX into RootFS directory ..." |
install $MKDIR/elwix $SBIN | install $ROOTFS_MKDIR/elwix $SBIN |
|
|
InstallList ${ELWIX_ROOTFS} ${WORLD} ${ROOTFS} |
InstallList ${ELWIX_ROOTFS} ${WORLD} ${ROOTFS} |
|
|
Line 153 install_rootfs()
|
Line 166 install_rootfs()
|
ln -s $PRG $BIN/chio |
ln -s $PRG $BIN/chio |
ln -s $PRG $BIN/chmod |
ln -s $PRG $BIN/chmod |
ln -s $PRG $BIN/cp |
ln -s $PRG $BIN/cp |
|
ln -s $PRG $BIN/csh |
|
ln -s $PRG $BIN/-csh |
|
ln -s $PRG $BIN/tcsh |
|
ln -s $PRG $BIN/-tcsh |
ln -s $PRG $BIN/date |
ln -s $PRG $BIN/date |
ln -s $PRG $BIN/dd |
ln -s $PRG $BIN/dd |
ln -s $PRG $BIN/df |
ln -s $PRG $BIN/df |
Line 362 install_rootfs()
|
Line 379 install_rootfs()
|
echo "+++ ELWIX clean CVS tags ..." |
echo "+++ ELWIX clean CVS tags ..." |
CleanCVS $ETC |
CleanCVS $ETC |
CleanCVS $ETC/etc |
CleanCVS $ETC/etc |
|
echo |
} |
} |
|
|
build_image() |
build_image() |
Line 373 build_image()
|
Line 391 build_image()
|
install_image() |
install_image() |
{ |
{ |
echo "+++ Install ELWIX RootFS Image into kernel ..." |
echo "+++ Install ELWIX RootFS Image into kernel ..." |
START=`strings -td $KERNEL | 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 | grep "MFS Filesystem" | cut -d ' ' -f 1 | tail -1` | STOP=`strings -td $KERNEL_ROOTFS | grep "MFS Filesystem" | cut -d ' ' -f 1 | tail -1` |
STOP=$(($STOP + 1)) |
STOP=$(($STOP + 1)) |
|
|
head -c $START $KERNEL >$NEWKERN | head -c $START $KERNEL_ROOTFS >$NEWKERN |
cat $REL/$ROOTFS_IMG >>$NEWKERN |
cat $REL/$ROOTFS_IMG >>$NEWKERN |
tail -c +$STOP $KERNEL >>$NEWKERN | tail -c +$STOP $KERNEL_ROOTFS >>$NEWKERN |
|
|
cd $REL |
cd $REL |
gzip -9 kernel | gzip -9 $KRNNAME |
cd - |
cd - |
} |
} |
|
|
### main() |
### main() |
if SnitVer ${WORLD}/elwix.ver; then |
if SnitVer ${WORLD}/elwix.ver; then |
clean_elwix |
clean_elwix |
prepare_elwix | prepare_elwix || exit 1 |
build_elwix | build_elwix || exit 1 |
|
|
build_rootdir | build_rootdir || exit 1 |
install_rootfs | install_rootfs || exit 1 |
|
|
build_image | build_image || exit 1 |
install_image | install_image || exit 1 |
else |
else |
echo "Skipped ELWIX RootFS build ..." | echo "$? Skipped ELWIX RootFS build ..." |
fi |
fi |
|
|
echo "+++ Complete build ELWIX RootFS" |
echo "+++ Complete build ELWIX RootFS" |