Open danielkucera opened 5 years ago
Ok, this firmware is really not easy to build, but finally I have at least booted kernel and busybox running:
/ # busybox cat /proc/cpuinfo
machine : hdk7108
processor : 0
cpu family : sh4
cpu type : STx7108
cut : 2.x
cpu flags : fpu icbi synco fpchg
cache type : split (harvard)
icache size : 32KiB (2-way)
dcache size : 32KiB (2-way)
address sizes : 32 bits physical
bogomips : 495.61
@perexg , can you please explain and/or document how to properly create the directory STLINUX=/opt/STM/STLinux-2.4
which is used for building? The Makefile doesn't say a word about it...
I don't remember. I think that I just installed their iso on centos 7. I have two byteswap.h files:
/opt/STM/STLinux-2.4/devkit/sh4/target/usr/include/bits/byteswap.h /opt/STM/STLinux-2.4/devkit/sh4/target/usr/include/byteswap.h
Cool, can you please find that iso or link where to get it?
And one more thing: I'm unable to link nano:
/root/satip-axe/toolchain/4.5.3-99/opt/STM/STLinux-2.4/devkit/sh4/bin/sh4-linux-gcc -std=gnu99 -O2 -Wall -o nano browser.o chars.o color.o cut.o files.o global.o help.o move.o nano.o prompt.o rcfile.o search.o text.o utils.o winio.o ../lib/libgnu.a -lncurses -ltinfo
/root/satip-axe/toolchain/4.5.3-99/opt/STM/STLinux-2.4/devkit/sh4/bin/../lib/gcc/sh4-linux/4.5.3/../../../../sh4-linux/bin/ld: cannot find -ltinfo
collect2: ld returned 1 exit status
Makefile:1494: recipe for target 'nano' failed
make[3]: *** [nano] Error 1
make[3]: Leaving directory '/root/satip-axe/apps/nano-2.8.1/src'
Makefile:1502: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/root/satip-axe/apps/nano-2.8.1'
Makefile:1441: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/root/satip-axe/apps/nano-2.8.1'
Makefile:635: recipe for target 'apps/nano-2.8.1/src/nano' failed
make: *** [apps/nano-2.8.1/src/nano] Error 2
Ok, I managed to build image from scratch with installed STLinux-2.4-sh4-20141119.iso and I'd like to add a pull request with howto. But I still hit two problems:
miscutils/nandwrite.c:151:35: error: ‘MTD_FILE_MODE_RAW’ undeclared (first use in this function)
and
util-linux/blkdiscard.c:71:26: error: ‘BLKSECDISCARD’ undeclared (first use in this function)
I see two possible solutions to this:
vi apps/busybox-1.26.2/miscutils/nandwrite.c
#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
# define MTD_FILE_MODE_NORMAL MTD_MODE_NORMAL
# define MTD_FILE_MODE_RAW MTD_MODE_RAW
#endif
and
vi apps/busybox-1.26.2/util-linux/blkdiscard.c
(opts & OPT_SECURE) ? BLKDISCARD : BLKDISCARD,
disable these features like this:
@@ -450,7 +466,9 @@ apps/$(BUSYBOX)/Makefile:
apps/$(BUSYBOX)/busybox: apps/$(BUSYBOX)/Makefile
make -C apps/$(BUSYBOX) CROSS_COMPILE=$(TOOLCHAIN)/bin/sh4-linux- defconfig
make -C apps/$(BUSYBOX) -j $(CPUS) CROSS_COMPILE=$(TOOLCHAIN)/bin/sh4-linux-
.PHONY: busybox
@perexg , do you remember these problems? Which way you preffer?
proposed change #143