version 1.10.2.4, 2018/07/06 00:23:20
|
version 1.12, 2021/07/16 18:35:50
|
Line 30 if [ "${USER}" != "root" ]; then
|
Line 30 if [ "${USER}" != "root" ]; then
|
exit 1 |
exit 1 |
fi |
fi |
|
|
|
if [ ! -x "${OBJDUMP}" ]; then |
|
echo |
|
echo "ELWIX project is not configured - executable objdump not found !" |
|
echo |
|
exit 1 |
|
fi |
|
|
KRNNAME="kernel_rootfs" |
KRNNAME="kernel_rootfs" |
NEWKERN="${REL}/${KRNNAME}" |
NEWKERN="${REL}/${KRNNAME}" |
MKF="Makefile.elwix" |
MKF="Makefile.elwix" |
Line 65 prepare_elwix()
|
Line 72 prepare_elwix()
|
# !!! Dont edit by hand !!! |
# !!! Dont edit by hand !!! |
# |
# |
|
|
LIBS += -L${WORLD}/lib -L${WORLD}/usr/lib | LDFLAGS += -L${WORLD}/lib -L${WORLD}/usr/lib |
| CFLAGS += -I${BSDSRC}/lib/libifconfig -I${BSDOBJ}${BSDSRC}/${TARGET}.${TARGET_ARCH}/lib/libifconfig |
_EOF |
_EOF |
cat >$ROOTFS_CONF <<_EOF |
cat >$ROOTFS_CONF <<_EOF |
srcdirs ${BSDSRC}/tools/tools ${BSDSRC}/tools/tools/ath |
srcdirs ${BSDSRC}/tools/tools ${BSDSRC}/tools/tools/ath |
srcdirs ${BSDSRC}/release/picobsd/tinyware | srcdirs ${BSDSRC}/contrib/ncurses/progs ${BSDSRC}/lib/libifconfig |
srcdirs ${BSDSRC}/bin ${BSDSRC}/sbin ${BSDSRC}/libexec ${BSDSRC}/cddl/sbin ${BSDSRC}/sbin/ggate |
srcdirs ${BSDSRC}/bin ${BSDSRC}/sbin ${BSDSRC}/libexec ${BSDSRC}/cddl/sbin ${BSDSRC}/sbin/ggate |
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 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 -DMK_CASPER=no WITHOUT_CASPER=yes MK_TESTS=no UPDATE_DEPENDFILE=no _RECURSING_CRUNCH=1 | buildopts -DMK_CASPER=no WITHOUT_CASPER=yes MK_TESTS=no UPDATE_DEPENDFILE=yes _RECURSING_CRUNCH=1 |
| |
_EOF |
_EOF |
cat $CFGDIR/$ROOTFS_CONF >>$ROOTFS_CONF |
cat $CFGDIR/$ROOTFS_CONF >>$ROOTFS_CONF |
|
cat >>$ROOTFS_CONF <<_EOF |
|
special ping6 srcdir ${BSDSRC}/sbin/ping |
|
special tput srcdir ${BSDSRC}/contrib/ncurses/progs |
|
special tset srcdir ${BSDSRC}/contrib/ncurses/progs |
|
|
|
special ifconfig lib ${BSDOBJ}${BSDSRC}/${TARGET}.${TARGET_ARCH}/lib/libifconfig/libifconfig.a |
|
_EOF |
echo "+++ Prepared RootFS config ... $CFGDIR/$ROOTFS_CONF" |
echo "+++ Prepared RootFS config ... $CFGDIR/$ROOTFS_CONF" |
|
|
install -d ${BSDOBJ}/elwix |
install -d ${BSDOBJ}/elwix |
env MAKEOBJDIRPREFIX=${BSDOBJ}/elwix ${CEXEC} 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 113 build_elwix()
|
Line 127 build_elwix()
|
cd $ROOTFS_MKDIR |
cd $ROOTFS_MKDIR |
${CBUILD} -f $MKF \ |
${CBUILD} -f $MKF \ |
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ |
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ |
${X_TARGET_CPUTYPE} __MAKE_CONF=${MAKECONF} clean |
|
${CBUILD} -f $MKF \ |
|
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 429 install_image()
|
Line 437 install_image()
|
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 |
|
|
echo "exec> ${CROSSTOOLDIR}/usr/bin/objdump -h $KERNEL_ROOTFS 2> /dev/null | grep \" oldmfs \"" | echo "exec> ${OBJDUMP} -h $KERNEL_ROOTFS 2> /dev/null | grep \" oldmfs \"" |
sec_info=`${CROSSTOOLDIR}/usr/bin/objdump -h $KERNEL_ROOTFS 2> /dev/null | grep " oldmfs "` | sec_info=`${OBJDUMP} -h $KERNEL_ROOTFS 2> /dev/null | grep " oldmfs "` |
[ -z "${sec_info}" ] && echo "Can't locate mfs section within kernel" && exit 1 |
[ -z "${sec_info}" ] && echo "Can't locate mfs section within kernel" && exit 1 |
echo "'-> Object dump { ${sec_info} }" |
echo "'-> Object dump { ${sec_info} }" |
|
|
Line 443 install_image()
|
Line 451 install_image()
|
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 "'-> Completed 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` |
# STOP=$(($STOP + 1)) | ### STOP=$(($STOP + 1)) |
# echo "'-> Start offset from $START to $STOP byte" | ### echo "'-> Start offset from $START to $STOP byte" |
|
|
# head -c $START $KERNEL_ROOTFS >$NEWKERN | ### head -c $START $KERNEL_ROOTFS >$NEWKERN |
# cat $REL/$ROOTFS_IMG >>$NEWKERN | ### cat $REL/$ROOTFS_IMG >>$NEWKERN |
# tail -c +$STOP $KERNEL_ROOTFS >>$NEWKERN | ### tail -c +$STOP $KERNEL_ROOTFS >>$NEWKERN |
|
|
echo "'-> Compress kernel" |
echo "'-> Compress kernel" |
cd $REL |
cd $REL |