version 1.2.4.14, 2012/10/09 15:23:56
|
version 1.7.4.1, 2013/10/14 12:43:44
|
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 106 build_rootdir()
|
Line 111 build_rootdir()
|
install -d mnt; |
install -d mnt; |
install -d -m 0555 proc; |
install -d -m 0555 proc; |
install -d sbin; |
install -d sbin; |
install -d system; |
|
install -d -m 1777 tmp; |
install -d -m 1777 tmp; |
install -d usr; |
install -d usr; |
install -d usr/bin; |
install -d usr/bin; |
Line 114 build_rootdir()
|
Line 118 build_rootdir()
|
install -d usr/libexec; |
install -d usr/libexec; |
install -d usr/sbin; |
install -d usr/sbin; |
install -d var; |
install -d var; |
|
install -d var/sys; |
|
|
ln -fs /usr/lib lib; |
ln -fs /usr/lib lib; |
|
|
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 280 install_rootfs()
|
Line 285 install_rootfs()
|
ln -s $PRG $SBIN/mount_cd9660 |
ln -s $PRG $SBIN/mount_cd9660 |
ln -s $PRG $SBIN/mount_msdosfs |
ln -s $PRG $SBIN/mount_msdosfs |
ln -s $PRG $SBIN/mount_nfs |
ln -s $PRG $SBIN/mount_nfs |
ln -s $PRG $SBIN/mount_ntfs | # ln -s $PRG $SBIN/mount_ntfs |
ln -s $PRG $SBIN/mount_nullfs |
ln -s $PRG $SBIN/mount_nullfs |
ln -s $PRG $SBIN/mount_udf |
ln -s $PRG $SBIN/mount_udf |
ln -s $PRG $SBIN/mount_unionfs |
ln -s $PRG $SBIN/mount_unionfs |
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 - |
} |
} |
|
|
### main() |
### main() |
if SnitVer ${WORLD}/elwix.ver; then |
if SnitVer ${WORLD}/elwix.ver; then |
clean_elwix | # clean_elwix |
prepare_elwix | # prepare_elwix |
build_elwix |
build_elwix |
|
|
build_rootdir |
build_rootdir |