perexg / satip-axe

A custom firmware with minisatip for Inverto IDL-400s/Grundig GSS.BOX/Telestar Digibit R1
132 stars 43 forks source link

Unable to build busybox #139

Open danielkucera opened 5 years ago

danielkucera commented 5 years ago
make -C apps/busybox-1.26.2 CROSS_COMPILE=/opt/STM/STLinux-2.4/devkit/sh4/bin/sh4-linux-
make[1]: Entering directory '/root/satip-axe/apps/busybox-1.26.2'
  SPLIT   include/autoconf.h -> include/config/*
  GEN     include/bbconfigopts.h
  GEN     include/common_bufsiz.h
  HOSTCC  applets/usage
  GEN     include/usage_compressed.h
  HOSTCC  applets/applet_tables
  GEN     include/applet_tables.h include/NUM_APPLETS.h
  GEN     include/applet_tables.h include/NUM_APPLETS.h
  CC      applets/applets.o
In file included from /opt/STM/STLinux-2.4/devkit/sh4/lib/gcc/sh4-linux/4.5.3/include/syslimits.h:7:0,
                 from /opt/STM/STLinux-2.4/devkit/sh4/lib/gcc/sh4-linux/4.5.3/include/limits.h:34,
                 from include/platform.h:141,
                 from include/libbb.h:13,
                 from include/busybox.h:8,
                 from applets/applets.c:9:
/opt/STM/STLinux-2.4/devkit/sh4/lib/gcc/sh4-linux/4.5.3/include/limits.h:169:61: error: no include path in which to search for limits.h
In file included from include/libbb.h:13:0,
                 from include/busybox.h:8,
                 from applets/applets.c:9:
include/platform.h:152:23: fatal error: byteswap.h: No such file or directory
compilation terminated.
scripts/Makefile.build:197: recipe for target 'applets/applets.o' failed
make[2]: *** [applets/applets.o] Error 1
Makefile:372: recipe for target 'applets_dir' failed
make[1]: *** [applets_dir] Error 2
make[1]: Leaving directory '/root/satip-axe/apps/busybox-1.26.2'
Makefile:452: recipe for target 'apps/busybox-1.26.2/busybox' failed
make: *** [apps/busybox-1.26.2/busybox] Error 2
[root@fedora satip-axe]# 
danielkucera commented 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...

perexg commented 5 years ago

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
danielkucera commented 5 years ago

Cool, can you please find that iso or link where to get it?

danielkucera commented 5 years ago

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
danielkucera commented 5 years ago

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:

@perexg , do you remember these problems? Which way you preffer?

danielkucera commented 5 years ago

proposed change #143