I can't seem to catch a break...
I haven't been able to compile anything with my build environment. For at least a few weeks. I know it should work, because I compiled a build of WD40M0D prior to all my merging of source. I'm using a MacBookPro running OS X 10.5.8
When trying to build a kernel, I get errors on "bounds.s" and "prepare0":
Code:
sean-whitleys-macbook-pro:kernel-msm wdfowty$ make ARCH=arm CROSS_COMPILE=$CCOMPILER
scripts/kconfig/conf -s arch/arm/Kconfig
CHK include/linux/version.h
UPD include/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
Generating include/generated/mach-types.h
CC kernel/bounds.s
cc1: error: invalid option ‘little-endian’
cc1: error: invalid option ‘abi=aapcs-linux’
cc1: error: invalid option ‘no-thumb-interwork’
kernel/bounds.c:1: error: bad value (armv5t) for -march= switch
kernel/bounds.c:1: error: bad value (armv5t) for -mtune= switch
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
My next error, if I skip the kernel, is in building libgps.so...It claims to not be able to find librpc.so, which to the best of my knowledge is where it's supposed to be (somewhere in the out directory).
Code:
#
/Users/wdfowty/bin/mydroid/prebuilt/darwin-x86/toolchain/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld: warning: librpc.so, needed by out/target/product/passion/obj/lib/libgps.so, not found (try using -rpath or -rpath-link)
Some things I've noticed...
*Kernel error is constant across AOSP and CM source (could it be a bad .config?)
*Errors persist even after running "make clobber" or "make installclean"
I'm hoping someone can help, as I'm running on minimal knowledge and experience...Thank you in advance!
Here's the full librpc.so error on pastebin: http://pastebin.com/VBtAffE0
I know there are a lot of tutorial to compile an Android Kernel but samsung is known to release buggy kernels and none of them tells how to deal with error.
Sources:
- a bunch of others kernel building tutorial on xda (like this one : http://forum.xda-developers.com/archive/index.php/t-1557045.html)
First and foremost, you MUST use a GNU/Linux (hereafter 'Linux') distribution. Don’t use OSX or Cygwin, I got a lot of problem with them.
The easiest way is to get the latest version of Ubuntu Linux. I personally, I’m using archlinux but the installation is a bit complex for this kind of use only.
Step 0: Pre-project Setup (optionnal)
This link will help you to use the main android commands into your newly linux environment: [SCRIPT] [Ubuntu] ADB, AAPT, APKTool, Android SDK/NDK, and udev rules auto-installer
I did not use them for this but it could be useful sometime in other tasks
Step 1: Setting up a build environment
First, you will need to install the required packages:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev g++-multilib lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z-dev libgl1-mesa-dev git
Some of these packages won’t work but normally dependencies will be resolved by apt the package manager.
Next, you will need a Cross-Compile Toolchain, and for our purposes we will be using this specifically CodeSourcery release (2009q3):
Untar it either in /opt (with su permission) or create of directory for it.
Code:
cd ~/
tar xvjf arm-2009q3-68-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
It’s very important for the P68XX kernel to use this toolchain. Otherwise, you’ll have errors while compiling it and trust me, you don’t want this type of errors (look at my mdnie.c (insérer lien) thread for example). As a matter fact, I tried all of the toolchains given by the mentor website and only this one works on my linux.
Step 2: Pulling the Kernel Source
Now, we have to download the kernel from: [url=http://opensource.samsung.com/index.jsp;jsessionid=0EFA22A80FBED4451C1D9C823E3440C4[/url]
You will have an archive unzip it and copy the kernel part into the kernel_P68XX and then untar it.
Code:
mkdir ~/kernel_P68XX
tar xvf Kernel.tar.gz -C ~/kernel_P68XX
You can remove it if you want.
Code:
rm Kernel.tar.gz
Now you have to download and extract the initrd from the samsung zImage found in the official ICS image :
For the UK P6810[url=http://www.hotfile.com/dl/165045602/118260c/P6810XXLPL_P6810OXALPL_XEU.zip.html[/url]
For the Open Austria P6800 [url=http://www.hotfile.com/dl/166221509/de0b31d/P6800XXLQ2_P6800OXALQ2_ATO.zip.html[/url]
Download the zip, unzip it, untar it and copy the zImage as followed.
Then, download also and use unpack-initramfs (both files are attached at the end of this thread).
Code:
mkdir ~/initrd
mv zImage ~/initrd
mv unpack-initramfs ~/initrd
cd ~/initrd
Sudo chmod +x unpack-initramfs
./unpack-initramfs zImage
Step 3: Build the Kernel
Finally, what you've been waiting for!
We have to export a few things first, to prepare the build environment. Open a terminal and type:
Code:
export ARCH=arm
export CROSS_COMPILE=~/arm-2009q3/bin/arm-none-linux-gnueabi-
make P8-wifi_defconfig
You’ll have this :
Code:
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED
scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED
scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
#
# configuration written to
.config
#
Now edit the kernel’s configuration.
Code:
nano .config
Search for
Code:
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
Change to
Code:
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="../initrd"
Where initrd is the folder where you extracted the zImage initramfs.
Here, you can make substiantials changes to your kernel .This step is really important if you want to customize your kernel (ie : enabling features such as governors, add init.d, cifs, file systems etc.) (we'll see this on the next tutorial). But do it only if you know what you’re doing. Don’t forget to back up your file config (named .config).
Now you can build it.
Code:
make –jX
Where X is the number of tasks you want to run simultaneously. As for me, I use 4 or 5.
Now, watch the output at the end carefully and you'll see the necessary files that we need:
Code:
OBJCOPY arch/arm/boot/Image
Kernel: arch/arm/boot/Image is ready
AS arch/arm/boot/compressed/head.o
GZIP arch/arm/boot/compressed/piggy.gzip
AS arch/arm/boot/compressed/piggy.gzip.o
CC arch/arm/boot/compressed/misc.o
CC arch/arm/boot/compressed/decompress.o
SHIPPED arch/arm/boot/compressed/lib1funcs.S
AS arch/arm/boot/compressed/lib1funcs.o
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
Building modules, stage 2.
MODPOST 4 modules
CC drivers/net/wireless/ath/ath.mod.o
LD [M] drivers/net/wireless/ath/ath.ko
CC drivers/net/wireless/ath/ath6kl/ath6kl_sdio.mod.o
LD [M] drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko
CC drivers/scsi/scsi_wait_scan.mod.o
LD [M] drivers/scsi/scsi_wait_scan.ko
CC net/wireless_ath/cfg80211.mod.o
LD [M] net/wireless_ath/cfg80211.ko
Anything marked with an [M] will need to be remembered, as well as the location of the compiled kernel at /arch/arm/boot/zImage
Step 4: Dealing with Samsung's errors
Well that would be it, if Samsung had done the job properly but as far as I’m concerned I got three errors :
First one :
Code:
CC drivers/media/video/samsung/mali/common/mali_kernel_core.o
arm-none-eabi-gcc: non: No such file or directory
arm-none-eabi-gcc: versionné: No such file or directory
arm-none-eabi-gcc: non: No such file or directory
arm-none-eabi-gcc: versionné": No such file or directory
cc1: warnings being treated as errors
<command-line>:0: error: missing terminating " character
drivers/media/video/samsung/mali/common/mali_kernel_core.c: In function 'mali_kernel_constructor':
drivers/media/video/samsung/mali/common/mali_kernel_core.c:172: error: missing terminating " character
drivers/media/video/samsung/mali/common/mali_kernel_core.c:172: error: expected expression before ')' token
make[5]: *** [drivers/media/video/samsung/mali/common/mali_kernel_core.o]
Erreur 1
make[4]: ***
[drivers/media/video/samsung/mali] Erreur 2
make[3]: ***
[drivers/media/video/samsung] Erreur 2
make[2]: ***
[drivers/media/video] Erreur 2
make[1]: *** [drivers/media]
Erreur 2
make: *** [drivers] Erreur 2
A way to fix this error is to change the SVN version Makefile in drivers/media/video/Samsung/mali/Makefile. I did not dig into it but I’m sure that one of the term return a wrong value. So I changed it to the number : 1. You can assign any value you want as far as it is not a variable.
Code:
nano drivers/media/video/samsung/mali/Makefile
Search for this chain string : SVN, you’ll find this one :
Code:
# Get subversion revision number, fall back to 0000 if no svn info is available
SVN_REV:=$(shell ((svnversion | grep -qv exported && echo -n 'Revision: ' && sv… … …
Replace with:
Code:
SVN=REV:=1
Relaunch the make
Code:
make -jX
Where X is the number of tasks you want to run simultaneously. As for me, I use 4 or 5.
Second one :
Code:
arm-none-eabi-gcc: non: No such file or directory
arm-none-eabi-gcc: versionné: No such file or directory
arm-none-eabi-gcc: non: No such file or directory
arm-none-eabi-gcc: versionné": No such file or directory
cc1: warnings being treated as errors
<command-line>:0: error: missing terminating " character
drivers/media/video/samsung/ump/linux/ump_kernel_linux.c:
In function 'ump_initialize_module': drivers/media/video/samsung/ump/linux/ump_kernel_linux.c:128:
error: missing terminating " character
drivers/media/video/samsung/ump/linux/ump_kernel_linux.c:128:
error: expected expression before ')' token
drivers/media/video/samsung/ump/linux/ump_kernel_linux.c:
At top level:
drivers/media/video/samsung/ump/linux/ump_kernel_linux.c:472:
error: missing terminating " character
drivers/media/video/samsung/ump/linux/ump_kernel_linux.c:472:
error: expected expression before ',' token
make[5]: ***
[drivers/media/video/samsung/ump/linux/ump_kernel_linux.o] Erreur 1
make[4]: ***
[drivers/media/video/samsung/ump] Erreur 2
make[3]: ***
[drivers/media/video/samsung] Erreur 2
make[2]: ***
[drivers/media/video] Erreur 2
make[1]: *** [drivers/media]
Erreur 2
make: *** [drivers] Erreur 2
Do exactly the same manipulation as said above :
Modify the Makefile in drivers/media/video/Samsung/ump/Makefile.
Code:
nano drivers/media/video/Samsung/ump/Makefile
Search for this chain string : SVN, you’ll find this one :
Code:
# Get subversion revision number, fall back to 0000 if no svn info is available
SVN_REV:=$(shell ((svnversion | grep -qv exported && echo -n 'Revision: ' && sv… … …
Replace with:
Code:
SVN=REV:=1
Relaunch the make
Code:
make -jX
Where X is the number of tasks you want to run simultaneously. As for me, I use 4 or 5.
Last error but not the least :
Code:
drivers/video/samsung/lcdfreq.c: In function 'level_store':
drivers/video/samsung/s3cfb.h:262:
sorry, unimplemented: inlining failed in call to 'get_fimd_global': function
body not available
drivers/video/samsung/lcdfreq.c:150:
sorry, unimplemented: called from here
drivers/video/samsung/s3cfb.h:262:
sorry, unimplemented: inlining failed in call to 'get_fimd_global': function
body not available
drivers/video/samsung/lcdfreq.c:176:
sorry, unimplemented: called from here
make[3]: ***
[drivers/video/samsung/lcdfreq.o] Erreur 1
make[2]: ***
[drivers/video/samsung] Erreur 2
make[1]: *** [drivers/video]
Erreur 2
make: *** [drivers] Erreur 2
Fix this is very simple but took me a lot of time. I found the solution in some patch explainations for the mainstream kernel. The only thing you have to do is : remove the word “inline” in this file drivers/video/Samsung/s3cfb.h
Search for this :
Code:
extern struct fb_ops s3cfb_ops;
extern inline struct s3cfb_global *get_fimd_global(int id);
Remove “inline”:
Code:
extern struct fb_ops s3cfb_ops;
extern struct s3cfb_global *get_fimd_global(int id);
Redo the make command :
Code:
make -jX{/code]
Now you’ve got your kernel built but it's not finished yet !
[COLOR="blue"][B]Final Step: Include modules to your kernel[/B][/COLOR]
At first, I was very surprised by this step but it is essential otherwise your kernel won’t work. Actually, modules included by samsung in the initrd uncompressed before are not working as if. So you have to do this :
in the initrd you made, copy the *.ko into initrd/lib/modules
[code] cp drivers/net/wireless/ath/ath.ko drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko drivers/scsi/scsi_wait_scan.ko net/wireless_ath/cfg80211.ko ../initrd/lib/modules
Overwrite them if asked.
Clean your code, use your backup config file and rebuilt the kernel :
Code:
Make distclean
Make clean
Cp your_backup_file kernel_P68XX/.config
make –jX
Where X is the number of tasks you want to run simultaneously. As for me, I use 4 or 5.
Your final kernel is here : /arch/arm/boot/zImage
Kernel Installation
Flash via heimdall
Code:
$ adb reboot download
$ heimdall flash --kernel path/to/zImage
Maybe there's another way to do this so feel free to leave comments
Good luck !
Thanks for sharing..
Great tut, thanks a lot, will be really helpful. :good:
Thanks man.
Enviado de meu GT-P6800 usando o Tapatalk 2
Thanks guys !
Next to come : Install the kernel via cwm, Kernel optimisations and Build a custom rom for these devices.
Running my first home built kernel. :laugh:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I love android.
dedraks said:
Running my first home built kernel. :laugh:
I love android.
Click to expand...
Click to collapse
So cool you did it
Congrats !
Awesome tutorial mengpo, thanks
mengpo said:
Next to come : Install the kernel via cwm
Click to expand...
Click to collapse
Easiest to just flash via heimdall
Code:
$ adb reboot download
$ heimdall flash --kernel path/to/zImage
locerra said:
Easiest to just flash via heimdall
Code:
$ adb reboot download
$ heimdall flash --kernel path/to/zImage
Click to expand...
Click to collapse
:silly:
I did not know it was so simple !!
I'll change the tuto then !
Thanks again !
Thanks a lot !
I havent coded for ages and setting up the environment was discouraging me from even thinking about trying to play with the kernel
This is extremely useful
Alcibiade said:
Thanks a lot !
I havent coded for ages and setting up the environment was discouraging me from even thinking about trying to play with the kernel
This is extremely useful
Click to expand...
Click to collapse
You're welcome
Hi, I stumbled across this thread while trying to set up my environment to do kernel work for another device (S7562, not that it matters). The problem is that my zImage (extracted from stock Samsung ROM) does not contain any gzip archive and I can't extract the initramfs. I am asking here because I also tried using the script attached in the first post without success.
Essentially, my stock zImage does not seem to contain the hexa string "1f 8b 08" in this order. I tried with scripts and I tried it manually as well:
Code:
grep -a -b --only-matching `perl -e'print "\x1F\x8B\x08"'` zImage
That returns nothing for this kernel. Works fine for others though and I've successfully done this procedure using other ROMs from Samsung in the past. I can provide the initial boot.img and the zImage extracted from the boot.img. Let me know.
Edit - SOLVED: My image did not contain the ramdisk zipped, it was just the compiled kernel.
Thanks,
C.
COmpilation Error FOr Redmi 1S India
Plz help me to solve this error
Code:
[email protected]:~/android/kernel$ make zImage
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CC drivers/input/touchscreen/ft5x06_ts.o
drivers/input/touchscreen/ft5x06_ts.c: In function 'ft5x06_get_factory_id':
drivers/input/touchscreen/ft5x06_ts.c:432:45: warning: 'ft5336_bootloader_ver' may be used uninitialized in this function [-Wuninitialized]
error, forbidden warning: ft5x06_ts.c:432
make[3]: *** [drivers/input/touchscreen/ft5x06_ts.o] Error 1
make[2]: *** [drivers/input/touchscreen] Error 2
make[1]: *** [drivers/input] Error 2
make: *** [drivers] Error 2
mengpo said:
I know there are a lot of tutorial to compile an Android Kernel but samsung is known to release buggy kernels and none of them tells how to deal with error.
Sources:
- a bunch of others kernel building tutorial on xda (like this one : http://forum.xda-developers.com/archive/index.php/t-1557045.html)
First and foremost, you MUST use a GNU/Linux (hereafter 'Linux') distribution. Don’t use OSX or Cygwin, I got a lot of problem with them.
The easiest way is to get the latest version of Ubuntu Linux. I personally, I’m using archlinux but the installation is a bit complex for this kind of use only.
Step 0: Pre-project Setup (optionnal)
This link will help you to use the main android commands into your newly linux environment: [SCRIPT] [Ubuntu] ADB, AAPT, APKTool, Android SDK/NDK, and udev rules auto-installer
I did not use them for this but it could be useful sometime in other tasks
Step 1: Setting up a build environment
First, you will need to install the required packages:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev g++-multilib lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z-dev libgl1-mesa-dev git
Some of these packages won’t work but normally dependencies will be resolved by apt the package manager.
Next, you will need a Cross-Compile Toolchain, and for our purposes we will be using this specifically CodeSourcery release (2009q3):
Untar it either in /opt (with su permission) or create of directory for it.
Code:
cd ~/
tar xvjf arm-2009q3-68-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
It’s very important for the P68XX kernel to use this toolchain. Otherwise, you’ll have errors while compiling it and trust me, you don’t want this type of errors (look at my mdnie.c (insérer lien) thread for example). As a matter fact, I tried all of the toolchains given by the mentor website and only this one works on my linux.
Step 2: Pulling the Kernel Source
Now, we have to download the kernel from: [url=http://opensource.samsung.com/index.jsp;jsessionid=0EFA22A80FBED4451C1D9C823E3440C4[/url]
You will have an archive unzip it and copy the kernel part into the kernel_P68XX and then untar it.
Code:
mkdir ~/kernel_P68XX
tar xvf Kernel.tar.gz -C ~/kernel_P68XX
You can remove it if you want.
Code:
rm Kernel.tar.gz
Now you have to download and extract the initrd from the samsung zImage found in the official ICS image :
For the UK P6810[url=http://www.hotfile.com/dl/165045602/118260c/P6810XXLPL_P6810OXALPL_XEU.zip.html[/url]
For the Open Austria P6800 [url=http://www.hotfile.com/dl/166221509/de0b31d/P6800XXLQ2_P6800OXALQ2_ATO.zip.html[/url]
Download the zip, unzip it, untar it and copy the zImage as followed.
Then, download also and use unpack-initramfs (both files are attached at the end of this thread).
Code:
mkdir ~/initrd
mv zImage ~/initrd
mv unpack-initramfs ~/initrd
cd ~/initrd
Sudo chmod +x unpack-initramfs
./unpack-initramfs zImage
Step 3: Build the Kernel
Finally, what you've been waiting for!
We have to export a few things first, to prepare the build environment. Open a terminal and type:
Code:
export ARCH=arm
export CROSS_COMPILE=~/arm-2009q3/bin/arm-none-linux-gnueabi-
make P8-wifi_defconfig
You’ll have this :
Code:
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED
scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED
scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
#
# configuration written to
.config
#
Now edit the kernel’s configuration.
Code:
nano .config
Search for
Code:
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
Change to
Code:
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="../initrd"
Where initrd is the folder where you extracted the zImage initramfs.
Here, you can make substiantials changes to your kernel .This step is really important if you want to customize your kernel (ie : enabling features such as governors, add init.d, cifs, file systems etc.) (we'll see this on the next tutorial). But do it only if you know what you’re doing. Don’t forget to back up your file config (named .config).
Now you can build it.
Code:
make –jX
Where X is the number of tasks you want to run simultaneously. As for me, I use 4 or 5.
Now, watch the output at the end carefully and you'll see the necessary files that we need:
Code:
OBJCOPY arch/arm/boot/Image
Kernel: arch/arm/boot/Image is ready
AS arch/arm/boot/compressed/head.o
GZIP arch/arm/boot/compressed/piggy.gzip
AS arch/arm/boot/compressed/piggy.gzip.o
CC arch/arm/boot/compressed/misc.o
CC arch/arm/boot/compressed/decompress.o
SHIPPED arch/arm/boot/compressed/lib1funcs.S
AS arch/arm/boot/compressed/lib1funcs.o
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
Building modules, stage 2.
MODPOST 4 modules
CC drivers/net/wireless/ath/ath.mod.o
LD [M] drivers/net/wireless/ath/ath.ko
CC drivers/net/wireless/ath/ath6kl/ath6kl_sdio.mod.o
LD [M] drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko
CC drivers/scsi/scsi_wait_scan.mod.o
LD [M] drivers/scsi/scsi_wait_scan.ko
CC net/wireless_ath/cfg80211.mod.o
LD [M] net/wireless_ath/cfg80211.ko
Anything marked with an [M] will need to be remembered, as well as the location of the compiled kernel at /arch/arm/boot/zImage
Step 4: Dealing with Samsung's errors
Well that would be it, if Samsung had done the job properly but as far as I’m concerned I got three errors :
First one :
Code:
CC drivers/media/video/samsung/mali/common/mali_kernel_core.o
arm-none-eabi-gcc: non: No such file or directory
arm-none-eabi-gcc: versionné: No such file or directory
arm-none-eabi-gcc: non: No such file or directory
arm-none-eabi-gcc: versionné": No such file or directory
cc1: warnings being treated as errors
<command-line>:0: error: missing terminating " character
drivers/media/video/samsung/mali/common/mali_kernel_core.c: In function 'mali_kernel_constructor':
drivers/media/video/samsung/mali/common/mali_kernel_core.c:172: error: missing terminating " character
drivers/media/video/samsung/mali/common/mali_kernel_core.c:172: error: expected expression before ')' token
make[5]: *** [drivers/media/video/samsung/mali/common/mali_kernel_core.o]
Erreur 1
make[4]: ***
[drivers/media/video/samsung/mali] Erreur 2
make[3]: ***
[drivers/media/video/samsung] Erreur 2
make[2]: ***
[drivers/media/video] Erreur 2
make[1]: *** [drivers/media]
Erreur 2
make: *** [drivers] Erreur 2
A way to fix this error is to change the SVN version Makefile in drivers/media/video/Samsung/mali/Makefile. I did not dig into it but I’m sure that one of the term return a wrong value. So I changed it to the number : 1. You can assign any value you want as far as it is not a variable.
Code:
nano drivers/media/video/samsung/mali/Makefile
Search for this chain string : SVN, you’ll find this one :
Code:
# Get subversion revision number, fall back to 0000 if no svn info is available
SVN_REV:=$(shell ((svnversion | grep -qv exported && echo -n 'Revision: ' && sv… … …
Replace with:
Code:
SVN=REV:=1
Relaunch the make
Code:
make -jX
Where X is the number of tasks you want to run simultaneously. As for me, I use 4 or 5.
Second one :
Code:
arm-none-eabi-gcc: non: No such file or directory
arm-none-eabi-gcc: versionné: No such file or directory
arm-none-eabi-gcc: non: No such file or directory
arm-none-eabi-gcc: versionné": No such file or directory
cc1: warnings being treated as errors
<command-line>:0: error: missing terminating " character
drivers/media/video/samsung/ump/linux/ump_kernel_linux.c:
In function 'ump_initialize_module': drivers/media/video/samsung/ump/linux/ump_kernel_linux.c:128:
error: missing terminating " character
drivers/media/video/samsung/ump/linux/ump_kernel_linux.c:128:
error: expected expression before ')' token
drivers/media/video/samsung/ump/linux/ump_kernel_linux.c:
At top level:
drivers/media/video/samsung/ump/linux/ump_kernel_linux.c:472:
error: missing terminating " character
drivers/media/video/samsung/ump/linux/ump_kernel_linux.c:472:
error: expected expression before ',' token
make[5]: ***
[drivers/media/video/samsung/ump/linux/ump_kernel_linux.o] Erreur 1
make[4]: ***
[drivers/media/video/samsung/ump] Erreur 2
make[3]: ***
[drivers/media/video/samsung] Erreur 2
make[2]: ***
[drivers/media/video] Erreur 2
make[1]: *** [drivers/media]
Erreur 2
make: *** [drivers] Erreur 2
Do exactly the same manipulation as said above :
Modify the Makefile in drivers/media/video/Samsung/ump/Makefile.
Code:
nano drivers/media/video/Samsung/ump/Makefile
Search for this chain string : SVN, you’ll find this one :
Code:
# Get subversion revision number, fall back to 0000 if no svn info is available
SVN_REV:=$(shell ((svnversion | grep -qv exported && echo -n 'Revision: ' && sv… … …
Replace with:
Code:
SVN=REV:=1
Relaunch the make
Code:
make -jX
Where X is the number of tasks you want to run simultaneously. As for me, I use 4 or 5.
Last error but not the least :
Code:
drivers/video/samsung/lcdfreq.c: In function 'level_store':
drivers/video/samsung/s3cfb.h:262:
sorry, unimplemented: inlining failed in call to 'get_fimd_global': function
body not available
drivers/video/samsung/lcdfreq.c:150:
sorry, unimplemented: called from here
drivers/video/samsung/s3cfb.h:262:
sorry, unimplemented: inlining failed in call to 'get_fimd_global': function
body not available
drivers/video/samsung/lcdfreq.c:176:
sorry, unimplemented: called from here
make[3]: ***
[drivers/video/samsung/lcdfreq.o] Erreur 1
make[2]: ***
[drivers/video/samsung] Erreur 2
make[1]: *** [drivers/video]
Erreur 2
make: *** [drivers] Erreur 2
Fix this is very simple but took me a lot of time. I found the solution in some patch explainations for the mainstream kernel. The only thing you have to do is : remove the word “inline” in this file drivers/video/Samsung/s3cfb.h
Search for this :
Code:
extern struct fb_ops s3cfb_ops;
extern inline struct s3cfb_global *get_fimd_global(int id);
Remove “inline”:
Code:
extern struct fb_ops s3cfb_ops;
extern struct s3cfb_global *get_fimd_global(int id);
Redo the make command :
Code:
make -jX{/code]
Now you’ve got your kernel built but it's not finished yet !
[COLOR="blue"][B]Final Step: Include modules to your kernel[/B][/COLOR]
At first, I was very surprised by this step but it is essential otherwise your kernel won’t work. Actually, modules included by samsung in the initrd uncompressed before are not working as if. So you have to do this :
in the initrd you made, copy the *.ko into initrd/lib/modules
[code] cp drivers/net/wireless/ath/ath.ko drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko drivers/scsi/scsi_wait_scan.ko net/wireless_ath/cfg80211.ko ../initrd/lib/modules
Overwrite them if asked.
Clean your code, use your backup config file and rebuilt the kernel :
Code:
Make distclean
Make clean
Cp your_backup_file kernel_P68XX/.config
make –jX
Where X is the number of tasks you want to run simultaneously. As for me, I use 4 or 5.
Your final kernel is here : /arch/arm/boot/zImage
Kernel Installation
Flash via heimdall
Code:
$ adb reboot download
$ heimdall flash --kernel path/to/zImage
Maybe there's another way to do this so feel free to leave comments
Good luck !
Click to expand...
Click to collapse
@mengpo "Step 4: Dealing with Samsung's errors" is still relevent in 2016. Samsung, great work maintaining and updating your source--what committment to open source. NOT!!!