View Single Post
Old 10-17-2021, 07:41 AM   #9
katadelos
rm -rf /
katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.
 
Posts: 219
Karma: 3333683
Join Date: Nov 2019
Location: United Kingdom
Device: K5, KT, KT2, KT3, KT4, KV, PW2, PW3, PW4, PW5
Quote:
Originally Posted by wishindo View Post
As that toolchain seems to need to be built on Gentoo, and I'm using Ubuntu 20.04 on WSL1 on Windows 10, I'll just use the toolchain in the Amazon Kindle 8th Gen source package as that builds just fine.
You can build those toolchains on Ubuntu if you've installed all of the required dependencies.

Quote:
Originally Posted by wishindo View Post
Code:
linux-2.6.26$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- imx35_luigi_defconfig
Makefile:436: *** mixed implicit and normal rules: deprecated syntax
Makefile:1556: *** mixed implicit and normal rules: deprecated syntax
make: *** No rule to make target 'imx35_luigi_defconfig'.  Stop.
So a defconfig build failed...
Heed the warning from make - if you look at line 436 of the top-level makefile, you'll see that it's the bit that handles all of the make *config targets; the problem with mixed implicit and normal rules is why those targets are playing up.

You can fix this (in a hacky way) like so:

Code:
diff --git a/Makefile b/Makefile
index 3ed09d0d..232a7658 100644
--- a/Makefile
+++ b/Makefile
@@ -433,7 +433,11 @@ ifeq ($(config-targets),1)
 include $(srctree)/arch/$(SRCARCH)/Makefile
 export KBUILD_DEFCONFIG
 
-config %config: scripts_basic outputmakefile FORCE
+config: scripts_basic outputmakefile FORCE
+       $(Q)mkdir -p include/linux include/config
+       $(Q)$(MAKE) $(build)=scripts/kconfig $@
+
+%config: scripts_basic outputmakefile FORCE
        $(Q)mkdir -p include/linux include/config
        $(Q)$(MAKE) $(build)=scripts/kconfig $@
 
@@ -1553,7 +1557,11 @@ endif
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 
 # Modules
-/ %/: prepare scripts FORCE
+/: prepare scripts FORCE
+       $(cmd_crmodverdir)
+       $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
+       $(build)=$(build-dir)
+%/: prepare scripts FORCE
        $(cmd_crmodverdir)
        $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
        $(build)=$(build-dir)
Quote:
Originally Posted by wishindo View Post
sudo And edit it to add USB and SCSI support

Code:
linux-2.6.26$ sudo nano .config
[ Wrote 1557 lines ]
Hand editing .config is not the greatest of ideas - many of the config symbols require other symbols to be enabled first or select other symbols when enabled. Using the menuconfig target helps to keep things consistent and lets you view these dependencies in detail by using the search feature:

Code:
  │ Symbol: USB_STORAGE [=n]                                                                                                                                                                 │  
  │ Prompt: USB Mass Storage support                                                                                                                                                         │  
  │   Defined at drivers/usb/storage/Kconfig:9                                                                                                                                               │  
  │   Depends on: USB_SUPPORT && USB && SCSI                                                                                                                                                 │  
  │   Location:                                                                                                                                                                              │  
  │     -> Device Drivers                                                                                                                                                                    │  
  │       -> USB support (USB_SUPPORT [=y])
Quote:
Originally Posted by wishindo View Post
Okay, I've managed to build the Kernel modules, but I get
Code:
insmod: error inserting '/mnt/us/usb-storage.ko': -1 Invalid module format
when I try to insert the modules.
Use dmesg to view the kernel log - it'll give you some slightly more verbose information on why insmod is failing. From experience, it'll likely be a vermagic problem which would imply some problem with your build environment.
katadelos is offline   Reply With Quote