LEDE Compile Fail mkyaffs problem

LOG:
mkyaffs2image.c: In function 'main':
mkyaffs2image.c:470:6: error: environment variable SOURCE_DATE_EPOCH must expand to a non-negative integer less than or equal to 253402300799
fprintf(stderr,"mkyaffs2image: image building tool for YAFFS2 built "__DAT

i cant find any environment variable SOURCE_DATE_EPOCH with LEDE

Someone know this problem?

That sounds like the "compile time" variable SOURCE_DATE_EPOCH gets set wrong during the build process. That might be related to your specific build-host or git environment, or something. Are you doing a standard "make" from a normal git source repo?

Apparently yaffs needs the value of that variable for its verbose version string, and likely yaffs is compiled first of those tools that need the value, so you get the error related to yaffs.

SOURCE_DATE_EPOCH is introduced in toplevel.mk (
https://git.lede-project.org/?p=source.git;a=blob;f=include/toplevel.mk;hb=HEAD#l17 )
and the value for it is calculated by scripts/get_source_date_epoch.sh ( https://git.lede-project.org/?p=source.git;a=blob;f=scripts/get_source_date_epoch.sh;hb=HEAD )

For some reason the system apparently gets the version wrong from git dates, or something like that.

You might try overriding the detection by putting the current value to the file "version.date" that the script uses as the first option. I use that myself, if I want to set the embedded build time explicitly to something. (the file needs to be in the buildroot root, where you normally run the build commands)

date +%s > version.date

Or if you are bypassing the LEDE make system and doing some direct make for yaffs, you might try setting the environment variable directly before the make (emulating the script). Something like:

SOURCE_DATE_EPOCH=`date +%s`

Ps.

Finding the variable in sources is actually pretty easy. E.g. search the git repo:
https://git.lede-project.org/?p=source.git&a=search&h=HEAD&st=commit&s=SOURCE_DATE_EPOCH

Thank You!
I search it from google baidu,find nothing....
and also search github for nothing...
but forget search git-lede

i run get_source_date_epoch.sh now it can compile!
Than you!

i thank this get_source_date_epoch.sh when i compling it doesn't run so it cant find the environment variable SOURCE_DATE_EPOCH.

Love you man!

Looks like you are doing an out of tree build of tools/mkyaffs2image: https://bugs.lede-project.org/index.php?do=details&task_id=196.

Looks like you are doing an out of tree build of tools/mkyaffs2image: https://bugs.lede-project.org/index.php?do=details&task_id=1964.

im not doing this out of tree build,i run make in the openwrt file and use make to compile the firmware.

i use make V=99 and config is dafult (maybe add some language)
and today i make disclean and execute get source date epoch.sh but also show up this problem...

what can i do now?

What is your build system? Ubuntu 16.10 or something older?

The environment variable should definitely be set automatically in the compilation process if all Makefiles, make include files & build scripts are at their default state, so that sounds really strange for a normal build.

Could you please upload the output of ./scripts/diffconfig.sh and the build log from make tools/yaffs2/{clean,compile} V=s to somewhere, e.g. pastebin and then post the links here.

Have your tried deleting .config and then just selecting one device and compiling?

Ps. Note that V=99 has been deprecated 4 years ago, although it still works for compatibility reasons. V=s is the current equivalent.

1 Like

@rbt Moved this topic to the For Developers category. Thanks.

Hi~ @hnyman
This is diffconfig.sh

“#!/bin/sh
grep ^CONFIG_TARGET_ .config | head -n3 > tmp/.diffconfig.head
grep ^CONFIG_TARGET_DEVICE_ .config >> tmp/.diffconfig.head
grep '^CONFIG_ALL=y' .config >> tmp/.diffconfig.head
grep '^CONFIG_ALL_KMODS=y' .config >> tmp/.diffconfig.head
grep '^CONFIG_ALL_NONSHARED=y' .config >> tmp/.diffconfig.head
grep '^CONFIG_DEVEL=y' .config >> tmp/.diffconfig.head
grep '^CONFIG_TOOLCHAINOPTS=y' .config >> tmp/.diffconfig.head
grep '^CONFIG_BUSYBOX_CUSTOM=y' .config >> tmp/.diffconfig.head
grep '^CONFIG_TARGET_PER_DEVICE_ROOTFS=y' .config >> tmp/.diffconfig.head
./scripts/config/conf --defconfig=tmp/.diffconfig.head -w tmp/.diffconfig.stage1 Config.in >/dev/null
./scripts/kconfig.pl '>+' tmp/.diffconfig.stage1 .config >> tmp/.diffconfig.head
./scripts/config/conf --defconfig=tmp/.diffconfig.head -w tmp/.diffconfig.stage2 Config.in >/dev/null
./scripts/kconfig.pl '>' tmp/.diffconfig.stage2 .config >> tmp/.diffconfig.head
cat tmp/.diffconfig.head
rm -f tmp/.diffconfig tmp/.diffconfig.head ”

and this is log

make[1]: Entering directory '/home/rabbit/lede'
make[2]: Entering directory '/home/rabbit/lede/tools/yaffs2'
rm -f /home/rabbit/lede/staging_dir/host/bin/mkyaffs2image
rm -rf /home/rabbit/lede/build_dir/host/yaffs2_android /home/rabbit/lede/staging_dir/host/stamp/.yaffs2_android_installed /home/rabbit/lede/build_dir/host/yaffs2_android/.built
make[2]: Leaving directory '/home/rabbit/lede/tools/yaffs2'
make[1]: Leaving directory '/home/rabbit/lede'
make[1]: Entering directory '/home/rabbit/lede'
mkdir -p /home/rabbit/lede/build_dir/target-mipsel_24kc_musl-1.1.15/stamp
touch /home/rabbit/lede/staging_dir/target-mipsel_24kc_musl-1.1.15/.prepared
mkdir -p /home/rabbit/lede/build_dir/host/stamp /home/rabbit/lede/staging_dir/host/include/sys
install -m0644 /home/rabbit/lede/tools/include/.h /home/rabbit/lede/staging_dir/host/include/
install -m0644 /home/rabbit/lede/tools/include/sys/
.h /home/rabbit/lede/staging_dir/host/include/sys/
ln -sf lib /home/rabbit/lede/staging_dir/host/lib64
touch /home/rabbit/lede/staging_dir/host/.prepared
make[2]: Entering directory '/home/rabbit/lede/tools/flock'
make[2]: Leaving directory '/home/rabbit/lede/tools/flock'
make[2]: Entering directory '/home/rabbit/lede/tools/flock'
make[2]: Leaving directory '/home/rabbit/lede/tools/flock'
make[2]: Entering directory '/home/rabbit/lede/tools/tar'
make[2]: Leaving directory '/home/rabbit/lede/tools/tar'
make[2]: Entering directory '/home/rabbit/lede/tools/tar'
make[2]: Leaving directory '/home/rabbit/lede/tools/tar'
make[2]: Entering directory '/home/rabbit/lede/tools/xz'
make[2]: Leaving directory '/home/rabbit/lede/tools/xz'
make[2]: Entering directory '/home/rabbit/lede/tools/xz'
make[2]: Leaving directory '/home/rabbit/lede/tools/xz'
make[2]: Entering directory '/home/rabbit/lede/tools/patch'
make[2]: Leaving directory '/home/rabbit/lede/tools/patch'
make[2]: Entering directory '/home/rabbit/lede/tools/patch'
make[2]: Leaving directory '/home/rabbit/lede/tools/patch'
make[2]: Entering directory '/home/rabbit/lede/tools/yaffs2'
. /home/rabbit/lede/include/shell.sh; xzcat /home/rabbit/lede/dl/yaffs2_android-2008-12-18.tar.xz | tar -C /home/rabbit/lede/build_dir/host/yaffs2_android/.. -xf -
[ ! -d ./src/ ] || cp -fpR ./src/* /home/rabbit/lede/build_dir/host/yaffs2_android
Applying ./patches/100-compile.patch using plaintext:
patching file yaffs2/utils/Makefile
patching file yaffs2/utils/mkyaffs2image.c
patching file yaffs2/devextras.h
Applying ./patches/110-openbsd-compat.patch using plaintext:
patching file yaffs2/yaffs_guts.h
touch /home/rabbit/lede/build_dir/host/yaffs2_android/.prepared95cf644ccf413579f8f44a278175ecb4
(cd /home/rabbit/lede/build_dir/host/yaffs2_android/; if [ -x configure ]; then cp -fpR /home/rabbit/lede/scripts/config.{guess,sub} /home/rabbit/lede/build_dir/host/yaffs2_android// && bash ./configure CC="gcc" CFLAGS="-O2 -I/home/rabbit/lede/staging_dir/host/include -I/home/rabbit/lede/staging_dir/host/usr/include " CPPFLAGS="-I/home/rabbit/lede/staging_dir/host/include -I/home/rabbit/lede/staging_dir/host/usr/include " LDFLAGS="-L/home/rabbit/lede/staging_dir/host/lib -L/home/rabbit/lede/staging_dir/host/usr/lib " SHELL="/usr/bin/env bash" --target=x86_64-linux-gnu --host=x86_64-linux-gnu --build=x86_64-linux-gnu --program-prefix="" --program-suffix="" --prefix=/home/rabbit/lede/staging_dir/host --exec-prefix=/home/rabbit/lede/staging_dir/host --sysconfdir=/home/rabbit/lede/staging_dir/host/etc --localstatedir=/home/rabbit/lede/staging_dir/host/var --sbindir=/home/rabbit/lede/staging_dir/host/bin ; fi )
touch /home/rabbit/lede/build_dir/host/yaffs2_android/.configured
make -C /home/rabbit/lede/build_dir/host/yaffs2_android/yaffs2/utils CC="gcc" CFLAGS="-O2 -I/home/rabbit/lede/staging_dir/host/include -I/home/rabbit/lede/staging_dir/host/usr/include -include endian.h" mkyaffs2image
make[3]: Entering directory '/home/rabbit/lede/build_dir/host/yaffs2_android/yaffs2/utils'
ln -s ../yaffs_ecc.c yaffs_ecc.c
gcc -c -I.. -DCONFIG_YAFFS_UTIL -O2 -I/home/rabbit/lede/staging_dir/host/include -I/home/rabbit/lede/staging_dir/host/usr/include -include endian.h yaffs_ecc.c -o yaffs_ecc.o
gcc -c -I.. -DCONFIG_YAFFS_UTIL -O2 -I/home/rabbit/lede/staging_dir/host/include -I/home/rabbit/lede/staging_dir/host/usr/include -include endian.h mkyaffs2image.c -o mkyaffs2image.o
Makefile:43: recipe for target 'mkyaffs2image.o' failed
make[3]: Leaving directory '/home/rabbit/lede/build_dir/host/yaffs2_android/yaffs2/utils'
Makefile:39: recipe for target '/home/rabbit/lede/build_dir/host/yaffs2_android/.built' failed
make[2]: Leaving directory '/home/rabbit/lede/tools/yaffs2'
tools/Makefile:148: recipe for target 'tools/yaffs2/compile' failed
make[1]: Leaving directory '/home/rabbit/lede'
/home/rabbit/lede/include/toplevel.mk:194: recipe for target 'tools/yaffs2/compile' failed

im using this os

maybe older....

Not diffconfig.sh itself, but the output of it when you run it...
It produces a diff of your .config compared to the defaults.

How can i get this output of ./scripts/diffconfig.sh?
sorry this is my first time use linux....

If is a command, a script "diffconfig.sh" in the "scripts" directory of your build system.
You run it exactly as "make". It will produce your a short list of the changed config items. Example below:

perus@u1610:/Openwrt/lede$ ./scripts/diffconfig.sh 
CONFIG_TARGET_ar71xx=y
CONFIG_TARGET_ar71xx_generic=y
CONFIG_TARGET_MULTI_PROFILE=y
CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_wndr3700=y
CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_wndr3700v2=y
CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_wndr3800=y
CONFIG_DEVEL=y
CONFIG_BUSYBOX_CUSTOM=y
CONFIG_BUILD_LOG=y
CONFIG_BUSYBOX_CONFIG_DIFF=y

why i run it in scripts file cannot show anything but ./scripts/.... can....

CONFIG_TARGET_ramips=y
CONFIG_TARGET_ramips_mt7620=y
CONFIG_TARGET_ramips_mt7620_DEVICE_psg1218=y
'# CONFIG_FEED_luci is not set
'# CONFIG_FEED_packages is not set
'# CONFIG_FEED_routing is not set
'# CONFIG_FEED_telephony is not set

this is when i run make -i V=s output
i dont know why so many not set...

Hi~
when i use make -i V=s run the first time complie, next time i run make V=s it pass complie....
so weird.....
maybe when i use clean, it will show up again....

I also have a problem....
i cant use git pull to update my sources...
this is my file...

so how can i use git pull to update....
Thank You!

It‘s Done.....
Sometimes it will happend but excute .sh or update feeds git pull will fix it.

whatever, it maybe will show up again, next i will find a way to fix it.