version 1.5, 2013/01/28 10:42:47
|
version 1.8, 2014/01/05 23:14:22
|
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" |
|
|
clean_elwix() |
clean_elwix() |
{ |
{ |
Line 38 clean_elwix()
|
Line 41 clean_elwix()
|
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 56 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 75 _EOF
|
Line 78 _EOF
|
|
|
. ${CENV} |
. ${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 | crunchgen -f -o -p ${BSDOBJ}/elwix -h $ROOTFS_MKDIR/$MKH -m $MKF \ |
| -c elwix.c -e elwix $ROOTFS_CONF |
cd - |
cd - |
} |
} |
|
|
build_elwix() |
build_elwix() |
{ |
{ |
echo "+++ Build ELWIX RootFS firmware ..." |
echo "+++ Build ELWIX RootFS firmware ..." |
cd $MKDIR | cd $ROOTFS_MKDIR |
. ${CENV} |
. ${CENV} |
MAKEOBJDIRPREFIX=${BSDOBJ}/elwix | env MAKEOBJDIRPREFIX=${BSDOBJ}/elwix make -f $MKF \ |
make -f $MKF clean | MAKEOBJDIRPREFIX=${BSDOBJ}/elwix clean |
make -f $MKF | env MAKEOBJDIRPREFIX=${BSDOBJ}/elwix make -f $MKF \ |
| MAKEOBJDIRPREFIX=${BSDOBJ}/elwix |
if [ $? -ne 0 ]; then |
if [ $? -ne 0 ]; then |
exit 1 |
exit 1 |
fi |
fi |
Line 138 install_rootfs()
|
Line 143 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 373 build_image()
|
Line 378 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 - |
} |
} |
|
|