version 1.8.2.1, 2014/01/14 23:38:26
|
version 1.9.2.1, 2016/11/14 00:21:35
|
Line 35 NEWKERN="${REL}/${KRNNAME}"
|
Line 35 NEWKERN="${REL}/${KRNNAME}"
|
MKF="Makefile.elwix" |
MKF="Makefile.elwix" |
MKH="Makefile.inc" |
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 ..." |
Line 71 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 $ROOTFS_MKDIR/$MKH -m $MKF \ | env MAKEOBJDIRPREFIX=${BSDOBJ}/elwix crunchgen -f \ |
| -h $ROOTFS_MKDIR/$MKH -m $MKF \ |
-c elwix.c -e elwix $ROOTFS_CONF |
-c elwix.c -e elwix $ROOTFS_CONF |
|
if [ $? -ne 0 ]; then |
|
exit 1 |
|
fi |
cd - |
cd - |
} |
} |
|
|
Line 87 build_elwix()
|
Line 94 build_elwix()
|
{ |
{ |
echo "+++ Build ELWIX RootFS firmware ..." |
echo "+++ Build ELWIX RootFS firmware ..." |
cd $ROOTFS_MKDIR |
cd $ROOTFS_MKDIR |
. ${CENV} |
|
env MAKEOBJDIRPREFIX=${BSDOBJ}/elwix make -f $MKF \ |
env MAKEOBJDIRPREFIX=${BSDOBJ}/elwix make -f $MKF \ |
MAKEOBJDIRPREFIX=${BSDOBJ}/elwix clean | TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ |
| ${X_TARGET_CPUTYPE} __MAKE_CONF=${MAKECONF} clean |
env MAKEOBJDIRPREFIX=${BSDOBJ}/elwix make -f $MKF \ |
env MAKEOBJDIRPREFIX=${BSDOBJ}/elwix make -f $MKF \ |
MAKEOBJDIRPREFIX=${BSDOBJ}/elwix | 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 158 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 183 install_rootfs()
|
Line 195 install_rootfs()
|
ln -s $PRG $BIN/realpath |
ln -s $PRG $BIN/realpath |
ln -s $PRG $BIN/rm |
ln -s $PRG $BIN/rm |
ln -s $PRG $BIN/unlink |
ln -s $PRG $BIN/unlink |
ln -s $PRG $BIN/rmdir | # ln -s $PRG $BIN/rmdir |
ln -s $PRG $BIN/sleep |
ln -s $PRG $BIN/sleep |
ln -s $PRG $BIN/stty |
ln -s $PRG $BIN/stty |
ln -s $PRG $BIN/sync |
ln -s $PRG $BIN/sync |
ln -s $PRG $BIN/uuidgen | # ln -s $PRG $BIN/uuidgen |
|
|
ln -s $PRG $BIN/true |
ln -s $PRG $BIN/true |
ln -s $PRG $BIN/false |
ln -s $PRG $BIN/false |
Line 240 install_rootfs()
|
Line 252 install_rootfs()
|
|
|
ln -s $PRG $SBIN/bsdlabel |
ln -s $PRG $SBIN/bsdlabel |
ln -s $PRG $SBIN/disklabel |
ln -s $PRG $SBIN/disklabel |
ln -s $PRG $SBIN/camcontrol | # ln -s $PRG $SBIN/camcontrol |
ln -s $PRG $SBIN/comcontrol | # ln -s $PRG $SBIN/comcontrol |
ln -s $PRG $SBIN/conscontrol | # ln -s $PRG $SBIN/conscontrol |
ln -s $PRG $SBIN/devfs |
ln -s $PRG $SBIN/devfs |
ln -s $PRG $SBIN/dhclient |
ln -s $PRG $SBIN/dhclient |
ln -s $PRG $SBIN/dmesg |
ln -s $PRG $SBIN/dmesg |
Line 256 install_rootfs()
|
Line 268 install_rootfs()
|
ln -s $PRG $SBIN/fsck_4.2bsd |
ln -s $PRG $SBIN/fsck_4.2bsd |
ln -s $PRG $SBIN/fsck_msdosfs |
ln -s $PRG $SBIN/fsck_msdosfs |
ln -s $PRG $SBIN/etherswitchcfg |
ln -s $PRG $SBIN/etherswitchcfg |
ln -s $PRG $SBIN/-geom | # ln -s $PRG $SBIN/-geom |
ln -s $PRG $SBIN/glabel | # ln -s $PRG $SBIN/glabel |
ln -s $PRG $SBIN/gpart | # ln -s $PRG $SBIN/gpart |
ln -s $PRG $SBIN/graid | # ln -s $PRG $SBIN/graid |
ln -s $PRG $SBIN/growfs | # ln -s $PRG $SBIN/growfs |
ln -s $PRG $SBIN/hastctl | # ln -s $PRG $SBIN/hastctl |
ln -s $PRG $SBIN/hastd | # ln -s $PRG $SBIN/hastd |
ln -s $PRG $SBIN/ifconfig |
ln -s $PRG $SBIN/ifconfig |
ln -s $PRG $SBIN/init |
ln -s $PRG $SBIN/init |
ln -s $PRG $SBIN/ipfw |
ln -s $PRG $SBIN/ipfw |
Line 280 install_rootfs()
|
Line 292 install_rootfs()
|
ln -s $PRG $SBIN/mdmfs |
ln -s $PRG $SBIN/mdmfs |
ln -s $PRG $SBIN/mount_mfs |
ln -s $PRG $SBIN/mount_mfs |
ln -s $PRG $SBIN/mknod |
ln -s $PRG $SBIN/mknod |
ln -s $PRG $SBIN/mksnap_ffs | # ln -s $PRG $SBIN/mksnap_ffs |
ln -s $PRG $SBIN/mount |
ln -s $PRG $SBIN/mount |
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 |
ln -s $PRG $SBIN/newfs |
ln -s $PRG $SBIN/newfs |
ln -s $PRG $SBIN/newfs_msdos |
ln -s $PRG $SBIN/newfs_msdos |
ln -s $PRG $SBIN/nfsiod | # ln -s $PRG $SBIN/nfsiod |
ln -s $PRG $SBIN/nos-tun | # ln -s $PRG $SBIN/nos-tun |
ln -s $PRG $SBIN/nvmecontrol | # ln -s $PRG $SBIN/nvmecontrol |
ln -s $PRG $SBIN/pfctl |
ln -s $PRG $SBIN/pfctl |
ln -s $PRG $SBIN/pflogd |
ln -s $PRG $SBIN/pflogd |
ln -s $PRG $SBIN/quotacheck |
ln -s $PRG $SBIN/quotacheck |
Line 301 install_rootfs()
|
Line 313 install_rootfs()
|
ln -s $PRG $SBIN/halt |
ln -s $PRG $SBIN/halt |
ln -s $PRG $SBIN/fastboot |
ln -s $PRG $SBIN/fastboot |
ln -s $PRG $SBIN/fasthalt |
ln -s $PRG $SBIN/fasthalt |
ln -s $PRG $SBIN/recoverdisk | # ln -s $PRG $SBIN/recoverdisk |
ln -s $PRG $SBIN/restore |
ln -s $PRG $SBIN/restore |
ln -s $PRG $SBIN/rrestore |
ln -s $PRG $SBIN/rrestore |
ln -s $PRG $SBIN/route |
ln -s $PRG $SBIN/route |
ln -s $PRG $SBIN/rtsol |
ln -s $PRG $SBIN/rtsol |
ln -s $PRG $SBIN/shutdown |
ln -s $PRG $SBIN/shutdown |
ln -s $PRG $SBIN/savecore | # ln -s $PRG $SBIN/savecore |
ln -s $PRG $SBIN/swapon | # ln -s $PRG $SBIN/swapon |
ln -s $PRG $SBIN/swapoff | # ln -s $PRG $SBIN/swapoff |
ln -s $PRG $SBIN/swapctl | # ln -s $PRG $SBIN/swapctl |
ln -s $PRG $SBIN/sysctl |
ln -s $PRG $SBIN/sysctl |
ln -s $PRG $SBIN/tunefs |
ln -s $PRG $SBIN/tunefs |
ln -s $PRG $SBIN/umount |
ln -s $PRG $SBIN/umount |
Line 334 install_rootfs()
|
Line 346 install_rootfs()
|
ln -s $PRG $SBIN/wake |
ln -s $PRG $SBIN/wake |
ln -s $PRG $SBIN/watchdog |
ln -s $PRG $SBIN/watchdog |
ln -s $PRG $SBIN/watchdogd |
ln -s $PRG $SBIN/watchdogd |
ln -s $PRG $SBIN/inetd | # ln -s $PRG $SBIN/inetd |
ln -s $PRG $SBIN/wlandebug |
ln -s $PRG $SBIN/wlandebug |
ln -s $PRG $SBIN/chroot |
ln -s $PRG $SBIN/chroot |
ln -s $PRG $SBIN/i2c |
ln -s $PRG $SBIN/i2c |
ln -s $PRG $SBIN/iostat |
ln -s $PRG $SBIN/iostat |
ln -s $PRG $SBIN/jail | # ln -s $PRG $SBIN/jail |
ln -s $PRG $SBIN/jexec | # ln -s $PRG $SBIN/jexec |
ln -s $PRG $SBIN/jls | # ln -s $PRG $SBIN/jls |
ln -s $PRG $SBIN/ndp |
ln -s $PRG $SBIN/ndp |
ln -s $PRG $SBIN/newsyslog |
ln -s $PRG $SBIN/newsyslog |
ln -s $PRG $SBIN/nologin |
ln -s $PRG $SBIN/nologin |
Line 358 install_rootfs()
|
Line 370 install_rootfs()
|
ln -s $PRG $UBIN/passwd |
ln -s $PRG $UBIN/passwd |
|
|
ln -s $PRG $LIBEXEC/getty |
ln -s $PRG $LIBEXEC/getty |
ln -s $PRG $LIBEXEC/tftpd | # ln -s $PRG $LIBEXEC/tftpd |
|
|
strip -s $LNPRG |
strip -s $LNPRG |
|
|
Line 367 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 378 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_ROOTFS | grep "MFS Filesystem" | cut -d ' ' -f 1 | head -1` | mfs_size=`stat -f '%z' $REL/$ROOTFS_IMG 2>/dev/null` |
STOP=`strings -td $KERNEL_ROOTFS | grep "MFS Filesystem" | cut -d ' ' -f 1 | tail -1` | [ -z ${mfs_size} ] && echo "Can't determine MFS image size" && exit 1 |
STOP=$(($STOP + 1)) | |
|
|
head -c $START $KERNEL_ROOTFS >$NEWKERN | sec_info=`${CROSSTOOLDIR}/usr/bin/objdump -h $KERNEL_ROOTFS 2> /dev/null | grep " oldmfs "` |
cat $REL/$ROOTFS_IMG >>$NEWKERN | [ -z "${sec_info}" ] && echo "Can't locate mfs section within kernel" && exit 1 |
tail -c +$STOP $KERNEL_ROOTFS >>$NEWKERN | echo "'-> Object dump { ${sec_info} }" |
|
|
|
sec_size=`echo ${sec_info} | awk '{printf("%d", "0x" $3)}' 2> /dev/null` |
|
sec_start=`echo ${sec_info} | awk '{printf("%d", "0x" $6)}' 2> /dev/null` |
|
echo "'-> Start offset from $sec_start and rootfs size $sec_size byte" |
|
[ ${sec_size} -lt ${mfs_size} ] && echo "MFS image too large" && exit 1 |
|
|
|
cp $KERNEL_ROOTFS $NEWKERN |
|
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" |
|
|
|
# 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=$(($STOP + 1)) |
|
# echo "'-> Start offset from $START to $STOP byte" |
|
|
|
# head -c $START $KERNEL_ROOTFS >$NEWKERN |
|
# cat $REL/$ROOTFS_IMG >>$NEWKERN |
|
# tail -c +$STOP $KERNEL_ROOTFS >>$NEWKERN |
|
|
|
echo "'-> Compress kernel" |
cd $REL |
cd $REL |
gzip -9 $KRNNAME |
gzip -9 $KRNNAME |
cd - |
cd - |
Line 394 install_image()
|
Line 425 install_image()
|
### 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 |