asdf288 / Lakka-LibreELEC

Lakka is a lightweight Linux distribution that transforms a small computer into a full blown game console.
http://www.lakka.tv
1 stars 0 forks source link

git rev-parse HEAD when trying to compile Lakka 2.1 from Google Drive #2

Open badrianiulian opened 2 years ago

badrianiulian commented 2 years ago

When trying to compile [https://drive.google.com/drive/folders/1tjoKSu9DAnC-2eplAUqDt2wnqSZ_ZDs0](Lakka 2.1 Banana Pi – Google Drive), when reaching these lines in the scripts/image, the process halts with fatal error `$SCRIPTS/build populatefs:host

BUILD_DATE=date +%Y%m%d%H%M%S

GIT_HASH=$(git rev-parse HEAD)

` "git rev-parse HEAD" results in this fatal error: git rev-parse HEAD fatal: not a git repository (or any of the parent directories): .git

I added "git status" before that line and it results in the same fatal error: git status fatal: not a git repository (or any of the parent directories): .git

Compiling is done on Ubuntu Ubuntu 20.04.3 LTS. Linux ubuntu 5.11.0-37-generic #41~20.04.2-Ubuntu SMP Fri Sep 24 09:06:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Also I added a modified copy of "Bananapi" folder in "projects" named "Bananapro" and tried to build that project.

asdf288 commented 2 years ago

Hello, thanks for posting here. I will try to help you in the evening today, I do not have time until then. In the meantime, please post the content of your package.mk for populatefs, the result of scripts/build populatefs:host with -x enabled in the bash line in scripts/build, and if possible a directory listing of Lakka/YourBuildFolder/populatefs-xxx and Lakka/sources/populatefs. If any of these directories are empty or the content seems broken, this is where the error comes from.

asdf288 commented 2 years ago

It could also be that I forgot the git files in my source archive. Are you familiar with git? Go to your Lakka folder and look for a folder named .git. If it's missing: git clone https://github.com/libretro/Lakka-LibreELEC.git -b v2.1-rc5 (Create a new Lakka clone), then in that folder, delete everything except .git and unzip my source archive into it. Please try this first, I think this is the problem.

badrianiulian commented 2 years ago

The command git clone https://github.com/libretro/Lakka-LibreELEC.git -b v2.1-rc5 may have resolved the issue but added some new ones. Now it was stuck at applying this patch:

packages/linux/patches/linux-020_default_SMB211_for_CIFS.patch
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index d95744d..3b75c7e 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1270,9 +1270,9 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,

        vol->actimeo = CIFS_DEF_ACTIMEO;

-       /* FIXME: add autonegotiation -- for now, SMB1 is default */
-       vol->ops = &smb1_operations;
-       vol->vals = &smb1_values;
+       /* FIXME: add autonegotiation -- for now, SMB2.1 is default */
+       vol->ops = &smb21_operations;
+       vol->vals = &smb21_values;

        vol->echo_interval = SMB_ECHO_INTERVAL_DEFAULT;

My guess is that it is some remnant that modified SMB protocol for some other version of fs/cifs/connect.c ? I noticed that in the Google source it has a dot in front of the file... so to skip it when reaching it... I removed it.

badrianiulian commented 2 years ago

Another break point... something is missing:

      BUILD    sunxi-tools (host)
Executing (host): make 
make[1]: Entering directory '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/sunxi-tools-ed6f796'
gcc -g -O0 -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L -Iinclude/ -Wl,-rpath,/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/lib -L/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/lib -o fexc fexc.c script.c script_uboot.c script_bin.c script_fex.c 
gcc -g -O0 -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L -Iinclude/ -Wl,-rpath,/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/lib -L/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/lib -o bootinfo bootinfo.c 
bootinfo.c: In function 'print_script':
bootinfo.c:274:25: warning: unused parameter 'script' [-Wunused-parameter]
  274 | void print_script(void *script)
      |                   ~~~~~~^~~~~~
fexc.c: In function 'main':
fexc.c:305:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
  305 |   filename[1] = argv[optind+1]; /* out */
      |   ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
fexc.c:306:2: note: here
  306 |  case 1:
      |  ^~~~
gcc -g -O0 -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L -Iinclude/ `pkg-config --cflags libusb-1.0` -Wl,-rpath,/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/lib -L/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/lib -o fel fel.c  `pkg-config --libs libusb-1.0`
In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdint.h:26,
                 from /usr/lib/gcc/x86_64-linux-gnu/9/include/stdint.h:9,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/include/libusb-1.0/libusb.h:50,
                 from fel.c:21:
/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
  187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
      |   ^~~~~~~
gcc -g -O0 -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L -Iinclude/ -Wl,-rpath,/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/lib -L/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/lib -o pio pio.c 
In file included from /usr/include/errno.h:25,
                 from pio.c:23:
/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
  187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
      |   ^~~~~~~
pio.c: In function 'do_command':
pio.c:313:57: warning: unused parameter 'argc' [-Wunused-parameter]
  313 | static int do_command(char *buf, const char **args, int argc)
      |                                                     ~~~~^~~~
pio.c: In function 'main':
pio.c:352:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
  352 |    usage(0);
      |    ^~~~~~~~
pio.c:353:3: note: here
  353 |   case 'm':
      |   ^~~~
gcc -g -O0 -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L -Iinclude/ -c -o nand-part-main.o nand-part-main.c
ln -s fexc bin2fex
ln -s fexc fex2bin
gcc -g -O0 -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L -Iinclude/ -c -o nand-part-a10.o nand-part.c -D A10
nand-part.c: In function '_get_mbr':
nand-part.c:91:4: warning: 'strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
   91 |    strncpy((char *)mbr->magic, MBR_MAGIC, 8);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -g -O0 -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L -Iinclude/ -c -o nand-part-a20.o nand-part.c -D A20
nand-part.c: In function '_get_mbr':
nand-part.c:91:4: warning: 'strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
   91 |    strncpy((char *)mbr->magic, MBR_MAGIC, 8);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -Wl,-rpath,/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/lib -L/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/lib -o nand-part nand-part-main.o nand-part-a10.o nand-part-a20.o 
make[1]: Leaving directory '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/sunxi-tools-ed6f796'
'./fexc' -> '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/bin/fexc'
'./fel' -> '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/bin/fel'
'./nand-part' -> '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/bin/nand-part'
'./fel-gpio' -> '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/bin/fel-gpio'
'./usb-boot' -> '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/bin/usb-boot'
'./pio' -> '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/bin/pio'
'./bootinfo' -> '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/bin/bootinfo'
'./adb-devprobe.sh' -> '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/bin/adb-devprobe.sh'
      GET      gcc-linaro-arm-eabi
--2021-10-11 14:12:10--  https://releases.linaro.org/components/toolchain/binaries/4.9-2016.02/arm-eabi/gcc-linaro-4.9-2016.02-x86_64_arm-eabi.tar.xz
Resolving releases.linaro.org (releases.linaro.org)... 52.215.200.125
Connecting to releases.linaro.org (releases.linaro.org)|52.215.200.125|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://publishing-ie-linaro-org.s3.amazonaws.com/releases/components/toolchain/binaries/4.9-2016.02/arm-eabi/gcc-linaro-4.9-2016.02-x86_64_arm-eabi.tar.xz?Signature=T3iWgxN%2F84n0Uenh9z5Gds1dlRc%3D&Expires=1633950820&AWSAccessKeyId=AKIAIELXV2RYNAHFUP7A [following]
--2021-10-11 14:12:10--  https://publishing-ie-linaro-org.s3.amazonaws.com/releases/components/toolchain/binaries/4.9-2016.02/arm-eabi/gcc-linaro-4.9-2016.02-x86_64_arm-eabi.tar.xz?Signature=T3iWgxN%2F84n0Uenh9z5Gds1dlRc%3D&Expires=1633950820&AWSAccessKeyId=AKIAIELXV2RYNAHFUP7A
Resolving publishing-ie-linaro-org.s3.amazonaws.com (publishing-ie-linaro-org.s3.amazonaws.com)... 52.218.120.177
Connecting to publishing-ie-linaro-org.s3.amazonaws.com (publishing-ie-linaro-org.s3.amazonaws.com)|52.218.120.177|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 174276636 (166M) [application/octet-stream]
Saving to: 'sources/gcc-linaro-arm-eabi/gcc-linaro-arm-eabi-4.9-2016.02.tar.xz'

sources/gcc-linaro-arm-eabi/gcc-lin 100%[=================================================================>] 166.20M  18.0MB/s    in 9.4s    

2021-10-11 14:12:20 (17.6 MB/s) - 'sources/gcc-linaro-arm-eabi/gcc-linaro-arm-eabi-4.9-2016.02.tar.xz' saved [174276636/174276636]

INFO Calculated checksum is: b46f97e1eea542e98ed7e4278a4ea98c750e679b816d5a8c66286cd4fdc42448

      UNPACK   gcc-linaro-arm-eabi
          FIXCONFIG   /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/gcc-linaro-arm-eabi-4.9-2016.02/share/dejagnu/libexec/
      BUILD    gcc-linaro-arm-eabi (host)
      BUILD    u-boot (target)
make[1]: Entering directory '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405'
make[2]: Entering directory '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/doc/DocBook'
make[2]: Leaving directory '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/doc/DocBook'
make[1]: Leaving directory '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405'
make[1]: Entering directory '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405'
Configuring for Cubieboard2 - Board: sun7i, Options: CUBIEBOARD2,SPL,SUNXI_GMAC,STATUSLED=244,STATUSLED1=245,FAST_MBUS
make[1]: Leaving directory '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405'
make[1]: Entering directory '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405'
Generating include/autoconf.mk
In file included from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/linux/compiler.h:40:0,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/linux/byteorder/little_endian.h:12,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/arch/arm/include/asm/byteorder.h:29,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/compiler.h:112,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/image.h:19,
                 from include/common.h:100:
/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/linux/compiler-gcc.h:93:30: fatal error: linux/compiler-gcc6.h: No such file or directory
 #include gcc_header(__GNUC__)
                              ^
compilation terminated.
Generating include/autoconf.mk.dep
In file included from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/linux/compiler.h:40:0,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/linux/byteorder/little_endian.h:12,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/arch/arm/include/asm/byteorder.h:29,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/compiler.h:112,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/image.h:19,
                 from include/common.h:100:
/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/linux/compiler-gcc.h:93:30: fatal error: linux/compiler-gcc6.h: No such file or directory
 #include gcc_header(__GNUC__)
                              ^
compilation terminated.
Generating include/spl-autoconf.mk
In file included from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/linux/compiler.h:40:0,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/linux/byteorder/little_endian.h:12,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/arch/arm/include/asm/byteorder.h:29,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/compiler.h:112,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/image.h:19,
                 from include/common.h:100:
/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/linux/compiler-gcc.h:93:30: fatal error: linux/compiler-gcc6.h: No such file or directory
 #include gcc_header(__GNUC__)
                              ^
compilation terminated.
Generating include/tpl-autoconf.mk
In file included from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/linux/compiler.h:40:0,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/linux/byteorder/little_endian.h:12,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/arch/arm/include/asm/byteorder.h:29,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/compiler.h:112,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/image.h:19,
                 from include/common.h:100:
/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/linux/compiler-gcc.h:93:30: fatal error: linux/compiler-gcc6.h: No such file or directory
 #include gcc_header(__GNUC__)
                              ^
compilation terminated.
/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-gcc -DDO_DEPS_ONLY \
    -g  -Os   -ffunction-sections -fdata-sections -fno-common -ffixed-r9 -msoft-float  -D__KERNEL__  -I/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include  -I/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/arch/arm/include -fno-builtin -ffreestanding -nostdinc -isystem /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/toolchain/lib/gcc/armv7ve-libreelec-linux-gnueabi/6.2.0/include -pipe  -DCONFIG_ARM -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -mword-relocations -march=armv7-a -Wall -Wstrict-prototypes -fno-stack-protector -Wno-format-nonliteral -Wno-format-security -fstack-usage   \
    -o lib/asm-offsets.s lib/asm-offsets.c -c -S
In file included from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/linux/compiler.h:40:0,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/linux/byteorder/little_endian.h:12,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/arch/arm/include/asm/byteorder.h:29,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/compiler.h:112,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/image.h:19,
                 from /home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/common.h:100,
                 from lib/asm-offsets.c:15:
/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405/include/linux/compiler-gcc.h:93:30: fatal error: linux/compiler-gcc6.h: No such file or directory
 #include gcc_header(__GNUC__)
                              ^
compilation terminated.
make[1]: *** [Makefile:696: lib/asm-offsets.s] Error 1
make[1]: Leaving directory '/home/user/Downloads/Lakka-LibreELEC/build.Lakka-Bananapro.arm-8.2-devel/u-boot-sunxi-af9f405'
make: *** [Makefile:12: image] Error 2

It is searching for a non-existent linux/compiler-gcc6.h.

badrianiulian commented 2 years ago

Maybe using something like this? I found some info on gcc issues with old u-boot here

asdf288 commented 2 years ago

You are missing this patch: https://github.com/libretro/Lakka-LibreELEC/blob/v2.1-rc5/projects/Bananapi/patches/linux/0001-compiler-gcc6.patch

asdf288 commented 2 years ago

It also seems that something is wrong with your package folders. Could it be that you have mixed the original Lakka source with the modified source from the Google drive zip file? This will not work. Please start with a clean project folder as suggested above (clone Lakka from the official repo, delete everything except .git, unzip source from Google drive into it).

badrianiulian commented 2 years ago

So... restarted with only the .git folder from Lakka-LibreELEC v2.1 rc5 and the Google drive zip, I modified the populatefs url (removed the v), added the u-boot patches for gcc5/gcc6 and I reworked the ap6210module.patch (the proper way this time... using the original patch from bananapi/cubieboard2, used 2 folders linux-sunxi and linux-sunxi.patched, added lemaker's patches and created a new patch for bananapro). Now I restarted the compilation process... waiting... fingers crossed ^^ Fun stuff!

asdf288 commented 2 years ago

The wrong populatefs URL seems to be a typo in the original Lakka source. Good catch! You shouldn't need to add any patches for u-boot or linux, the compiler-gcc patches are located in projects/Bananapi/patches/linux. Make sure they exist in your Bananapro folder. Also make sure you create a Bananapro folder in packages/lakka (use the existing Bananapi folder as template).

But I don't understand this part: used 2 folders linux-sunxi and linux-sunxi.patched. Where exactly did you create these folders? Are these patch folders or package folders? If you have linux patches that are specific to your board, they should go into projects/projectname/patches/linux. If they are specific to a particular kernel, they should go into packages/linux/patches/kernel-version-name.

For example, to add patches that should be applied to every Allwinner board that uses the sunxi-3.4 kernel, you could create a folder packages/linux/patches/sunxi-3.4 and modify packages/linux/package.mk accordingly - go to linux-sun7i and add PKG_PATCH_DIRS="sunxi-3.4".

badrianiulian commented 2 years ago

I used the linux-sunxi version downloaded by Lakka build script in sources. I extracted drivers and firmware in two folders: linux-sunxi and linux-sunxi.patched I used the ap6210_module.patch to patch linux-sunxi.patched folder I added LeMaker's modifications inside the linux-sunxi.patched folder (all that could be done). The arch/arm/configs/sun7i_defconfig LeMaker's modifications I already added them to the project folder Bananapro/linux/linux.arm.conf and Bananapro/linux/linux-noump-drm-3.4-test.arm.conf At the end I built a ap6210_module_bpro.patch from the original linux-sunxi and the modified linux-sunxi.patched witch now resides in Bananapro/patches/linux

BTW... still going strong ^_^

asdf288 commented 2 years ago

Oh, I understand. Good idea, that's the right way to do it. You can delete linux-noump-drm-3.4-test.arm.conf, this was just for a test where I tried to use the DRM version of the graphics driver. It didn't work.

badrianiulian commented 2 years ago

I think that the include/linux inside u-boot-sunxi differs from the linux-sunxi provided and that is why the patching fails.

sources/u-boot/u-boot-sunxi-af9f405.tar.gz/u-boot-sunxi.../include/linux/compiler-gcc.h 3242 bytes February 6 2014 sources/linux/linux-d47d367.tar.gz/linux-sunxi.../include/linux/compiler-gcc.h 4050 bytes March 15 2015

By only adding 0001-compiler-gcc5.patch and 0001-compiler-gcc6.patch, I get to a stop in the process. I still had to add a custom patch inside the Bananapro/patches/u-boot folder (this was found before I figured out how to make a patch the right way)

So this is how the patch that fixed it looks like: Bananapro/patches/u-boot/u-boot-002-gcc6-use_gcc_inline_version_instead_c99.patch

diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 9896e54..99c6dcc 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -44,9 +44,10 @@
  */
 #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
     !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)
-# define inline                inline          __attribute__((always_inline))
-# define __inline__    __inline__      __attribute__((always_inline))
-# define __inline      __inline        __attribute__((always_inline))
+/* XXX: check __GNUC_STDC_INLINE__, fix line length */
+# define inline                inline          __attribute__((always_inline)) __attribute__((__gnu_inline__))
+# define __inline__    __inline__      __attribute__((always_inline)) __attribute__((__gnu_inline__))
+# define __inline      __inline        __attribute__((always_inline)) __attribute__((__gnu_inline__))
 #endif

 #define __deprecated                   __attribute__((deprecated))
asdf288 commented 2 years ago

The source of your problem is in the u-boot package.mk. It has the following lines:

elif [ "$PROJECT" = "OdroidC1" -o "$PROJECT" = "a20" -o "$PROJECT" = "a10" -o "$PROJECT" = "Bananapi" ]; then export PATH=$TOOLCHAIN/lib/gcc-linaro-arm-eabi/bin/:$PATH make CROSS_COMPILE="arm-eabi-" ARCH=arm mrproper make CROSS_COMPILE="arm-eabi-" ARCH=arm $UBOOT_TARGET make CROSS_COMPILE="arm-eabi-" ARCH=arm HOSTCC="$HOST_CC" HOSTSTRIP="true"

Lakka uses GCC 6 by default, but the uboot version from sunxi only supports GCC 4. For these boards, the compiler is switched to a different one (GCC 4 from Linaro). Your code never reaches this point because it doesn't check for the Bananapro project name, so it uses the default compiler (GCC 6) which is not supported by uboot-sunxi.

To mirror the original Lakka fix, you just have to add -o "$PROJECT" = "Bananapro" to the elif clause.

To avoid problems like this, you could grep the Lakka source code for "Bananapi" and see if there are other places where you have to add Bananapro. The scripts that are responsible for creating the SD card images will probably need this.

What I wrote about the missing linux GCC patch above was wrong, disregard that. It was most likely already there and has nothing to do with this.

badrianiulian commented 2 years ago

Scrapped everything again and did as you said: added Bananapro patches in packages/lakka/Bananapro, packages/libretro/mame2015 and packages/tools/u-boot. I did remove the patches I added in projects/Bananapro/patches/u-boot and it passed that stage. Still compiling though...

badrianiulian commented 2 years ago

OK... so I managed to boot up. modprobe ap6210 results in no more errors and wlan0 seems to be present after that... now how do I make it load at boot time since there is no /etc/modules (witch I'm used to)? Can't connect to WiFi from menu since scanning shows me a ' character and can't input password from keyboard or mouse. It's all I have connected for now. Also, I can't seem to make the mouse to work with retroarch... any hints? Should I wipe the data partition and let it reconfigure itself?

asdf288 commented 2 years ago

I believe there's a folder /storage/.config/modprobe.d. If not, try to create it. In this folder, create a file "ap6210.conf" with content ap6210. You can also do a google search for "libreelec config modprobe" for more help. About WiFi connecting from the Retroarch menu, sadly this has never worked for me on any device, and the mouse I am not sure if that's supported at all.

Possible solution for WiFi: Try manually connecting on the command line, and once you get it working, add the commands to /storage/.config/autostart.sh (this file is run on every Lakka boot).

About the mouse support, maybe set this to true? https://github.com/libretro/Lakka-LibreELEC/blob/28cedf2a083b15ae8fb708d8bb10b7ca4c697036/packages/libretro/retroarch/package.mk#L155

badrianiulian commented 2 years ago

I'm at work right now but will get back to it at some point in the evening. I'll try to add mouse support manually as the above link states and see how that goes. Regarding the ' character or the p character that is shown in the section for WiFi scanning from Retroarch menu, I found some bugs reported: mlnlbrt/Lakka-LibreELEC#13, libretro/Lakka-LibreELEC#325 and the best explained libretro/RetroArch#7227. For the last link, I think the links regarding the connmanctl code are outdated and the original source should be found in the git repository to actually know what was wrong and how to fix it: connmanctl.c#L61 and connmanctl.c#L93 By the way, should I upload all the mods that were made for Bananapro somewhere? Or maybe after all the testing is done?

asdf288 commented 2 years ago

Regarding the Wifi stuff I'm afraid you're on your own, I cannot test this as I don't have a board with Wifi anymore.

About uploading your changes, sure, share it! Because the Lakka project has abandoned the older branches, you need to create your own fork of Lakka in your GitHub account, then add your work to the 2.1-rc5 branch (or create a new one such as 2.1-rc5-fixed) and push your changes. This is way better than uploading a zip file like I did, but I simply do not have time to clean up the source code. You can also create a libretro forum thread for your build, other owners of the Bananapro will surely appreciate your work.

badrianiulian commented 2 years ago

Got back into it today. So I added the /storage/.config/modules-load.d/ap6210.conf with ap6210 content in it and the system loads the module at boot. Next, I got into the wifi menu and it scans/shows wifi networks as it should with some additional strings near them... something that looks like wifi_xxxxxxxxxxx_managed_psk. Also connected to USB a PS3 controller so I can type the password since the menu_mouse_enable = "true" doesn't do anything. All is good so far but after typing the password and confirming it, Retroarch outputs something like: Error /net/connman/service/wifi_xxxxxxxxxxx_managed_psk: Method "Connect" with signature "" on interface "net.connman.Service" doesn't exist. While this fails, by going through ssh (ethernet) and typing connmanctl, agent on, enable wifi (results in Error wifi: Already enabled), scan wifi, services, connect wifi_xxxxxxxxxxx_managed_psk, I input the password and the wifi connection starts to work. Could it be that there is something wrong in the connmanctl.c driver that Retroarch uses? I see that it suffered some changes since the commit used in this lakka build. Bluetooth isn't working as it keeps scanning to no end but it's not a must for now. I saw some comments in the ap6210 driver made by LeMaker for the blootooth to work... maybe this will be the next step. When the menu driver is xmb, after a while in idle, dashed oblique lines start to appear on the moving screen while the words look ok so for now I think glui works best. As for uploading the code to github, I'm still figuring how git works so it will be a while but I'll get there. I did start by forking the project but can't figure out how to create the branch at 2.1-rc5.

By the way... the day before yesterday I received a GPi case witch now is also Lakka powered since I fried a Pi Zero W board (that already had non-working HDMI) with other images that had overclocking settings. Good thing I had a spare.

asdf288 commented 2 years ago

Have you tried this? Paragraph "Not registered", or "Method "Connect" with signature ... doesn't exist" on https://wiki.archlinux.org/title/ConnMan

About GitHub, what I would do is fork Lakka into your GitHub account, create a local clone of it on your hard disk with git clone, then type git checkout -b v2.1-bananapro v2.1-rc5. This will create a new branch v2.1-bananapro that is based on the 2.1 release of Lakka. When your work is done, you can commit it and push it back to your GitHub account for others to use.

badrianiulian commented 2 years ago

I actually managed to connect only by using the paragraph mentioned above. I am trying to add the ap6210.conf file inside /storage/.config/modules-load.d for the system to load automatically at first boot. For now, my thought was by adding something like this inside packages/sysutils/systemd/package.mk:

.  # defaults
.  mkdir -p $INSTALL/usr/config
.  cp -PR $PKG_DIR/config/* $INSTALL/usr/config
+  case ${DEVICE:-$PROJECT} in
+    Bananapro)
+      echo ap6210>$INSTALL/usr/config/modules-load.d/ap6210.conf 
+      ;;
+    *)
+      ;;
+  esac
.
.  rm -rf $INSTALL/etc/modules-load.d
.  ln -sf /storage/.config/modules-load.d $INSTALL/etc/modules-load.d

Is there a way about doing this by using the projects/Bananapro folder? For now I managed to download/create the local git and modify it accordingly by using the Google source. So it includes the Bananapi project (witch I will mention that is not my work) and the BananaPro. I'll upload it as soon as I figure out this last bit. As for the wifi connection from inside retroarch, it is at a standstill. Connection still has to be done by ssh when connected to ethernet but that will have to do for now... maybe when the new kernel kicks off, by using the latest retroarch, this part will be fixed.

asdf288 commented 2 years ago

There are two methods I can think of. The first one: Add your config file to the filesystem folder in your Bananapro folder. Files in this folder are simply copied to the rootfs of the resulting image. Example: projects/Bananapro/filesystem/etc/modprobe.d/ap6210.conf The other option would be to use the kernel config file (include the ap6210 module, disable any competing modules). I think this is the cleaner option.

badrianiulian commented 2 years ago

I went with projects/Bananapro/filesystem/usr/lib/modules-load.d/ap6210.conf since it's more project oriented. To retest the image I started the compilation process two times since the first time the Ubuntu VM decided it needed a reboot (to update some security stuff). I'm done with the modifications but can't figure jack about how to upload the files using git... Till now git clone was the only command inside my brain. I created the key, used the key to clone the repo, created the branch, removed everything but .git files and added the Google source code with the Banana Pro mods, did a git add ., tried a push to origin branch and I can't see the local files inside the remote branch. Surely I'm doing something wrong. It's 01.00 hours and my brain explodes with frustration. Will try again in the morning/afternoon.

badrianiulian commented 2 years ago

Used Github Desktop in the end... some commits were surely missing. Project is uploaded on github. There is a new post on the forum with the compiled image.

asdf288 commented 2 years ago

That's awesome. Congratulations for successfully building your own image and thanks for posting your work, I'm sure others will appreciate it!