Android Installing kernel with custom config - android

I want to install a different kernel on my Samsung i9300 (some config flags enabled)
So far I have installed the custom ROM
Slim-4.4.2.build.3-OFFICIAL-3091
It uses the following kernel version so far:
$ adb shell
shell#android:/ $ uname -a
Linux localhost 3.0.80+ #1 SMP PREEMPT Sat Feb 15 15:10:26 CET 2014 armv7l GNU/Linux
The kernel version of my source from which I create my kernel.zip has a newer version:
.../kernel_samsung_smdk4412$ gedit Makefile
VERSION = 3
PATCHLEVEL = 0
SUBLEVEL = 80
EXTRAVERSION =
NAME = Sneaky Weasel
...
I used the following toolchain to build the kernel successfully:
1)
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7
2)
sudo gedit .bashrc
export PATH=${PATH}:~/arm-linux-androideabi-4.7/bin
3)
cd /kernel_samsung_smdk4412/
make clean -j4 ARCH=arm CROSS_COMPILE=arm-linux-androideabi-
make ARCH=arm CROSS_COMPILE=arm-linux-androideabi- slim_i9300_defconfig
make -j4 ARCH=arm CROSS_COMPILE=arm-linux-androideabi-
I use this guide to create the flashable zip file.
It uses koush's AnyKernel to install the new Kernel with TWRP 2.6.3.1
The updater-script looks like that so far:
ui_print("AnyKernel Updater by Koush.");
ui_print("Extracting System Files...");
set_progress(1.000000);
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
package_extract_dir("system", "/system");
unmount("/system");
ui_print("Extracting Kernel files...");
package_extract_dir("kernel", "/tmp");
ui_print("Installing kernel...");
set_perm(0, 0, 0777, "/tmp/dump_image");
set_perm(0, 0, 0777, "/tmp/mkbootimg.sh");
set_perm(0, 0, 0777, "/tmp/mkbootimg");
set_perm(0, 0, 0777, "/tmp/unpackbootimg");
run_program("/tmp/dump_image", "boot", "/tmp/boot.img");
run_program("/tmp/unpackbootimg", "/tmp/boot.img", "/tmp/");
run_program("/tmp/mkbootimg.sh");
write_raw_image("/tmp/newboot.img", "boot");
ui_print("Done!");
The 4th line was edited because of what I have found here for the i9300 .
When I flash the zip via TWRP everything seems fine but when rebooting the system the old kernel version and installation date is shown in the "About Phone" section of the Settings.
What did I miss?

Instead of using AnyKernel to flash the zImage, I created a boot.img out of the zImage using this guide and then flashed it via heimdall on my i9300:
user#ubuntu1210:~/bootimg_tools$ perl split_bootimg.pl boot.img
user#ubuntu1210:~/bootimg_tools$ perl unpack_ramdisk boot.img-ramdisk.gz ramdisk
user#ubuntu1210:~/bootimg_tools$ perl repack_ramdisk ramdisk boot.img-ramdisk.cpio.gz
user#ubuntu1210:~/bootimg_tools$ cp /home/user/kernel_samsung_smdk4412/arch/arm/boot/zImage boot.img-kernel
user#ubuntu1210:~/bootimg_tools$ ./mkbootimg --kernel boot.img-kernel --ramdisk boot.img-ramdisk.cpio.gz --cmdline 'console=null androidboot.hardware=qcom user_debug=31 zcache' --base 0x80200000 --pagesize 2048 -o boot.img
user#ubuntu1210:~/bootimg_tools$ adb reboot bootloader
user#ubuntu1210:~/bootimg_tools$ sudo heimdall flash --BOOT boot.img --verbose

Related

Oneplus5 Lineage OS 15.1 kernel compilation

I am trying to compile kernel for Oneplus5 with Lineage OS 15.1 custom ROM installed. I am using google ndk toolchains for compiling kernel. I extracted the kernel source code from Lineage OS source code, also tried compiling stock ROM kernel.
After few heat and trials and fixing some files in the source code of kernel finally I managed to compile it successfully! After compilation is completed I got Image,Image.gz files in arch/arm64/boot directory.
But when I tried to flash the kernel image from TWRP recovery, device always boot into fastboot mode and got stuck there. What is the issue and what can I do to make it work.
Try running mka bootimage, then flashing the resulting boot.img with fastboot flash boot boot.img.
The slightly longer version, based on the instructions at https://wiki.lineageos.org/devices/cheeseburger/build:
apt install adb fastboot bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev openjdk-8-jdk python unzip
mkdir -p ~/bin
mkdir -p ~/android/lineage
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
echo 'PATH="$HOME/bin:$PATH"' >> .profile
echo 'export LC_ALL=C' >> .profile
git config --global user.email "you#example.com"
git config --global user.name "Your Name"
cd ~/android/lineage
repo init -u https://github.com/LineageOS/android.git -b lineage-15.1
repo sync
source build/envsetup.sh
# use extract-files.sh or follow https://gist.github.com/fourkbomb/261ced58cd029c5f7742350aafdd9825
breakfast cheeseburger
mka bootimage
If the mka bootimage step runs without errors but doesn't generate a boot.img, try running mka bacon for a few minutes, then abort it and re-run mka bootimage.
The above commands will use LineageOS' default kernel for the device, in ./android/lineage/kernel/oneplus/msm8998. You can simply make your changes there, or place a whole new kernel source in that directory. In the latter case, make sure to place a lineage_oneplus5_defconfig file in arch/arm64/configs.

Android 64bit terminal / rsync

I am trying to get my rooted LG G4 to rsync with my server. On the good old LG G2 it is running smoothly but the 64bit architecture throws errors at me.
I tried to come up with a solution from other sources (here and other sites) But it just goes on to the next file it cannot load correctly
The code I use is as follows:
export LD_PRELOAD=/system/lib64/libsigchain.so; export PATH=$PATH:/data/data/burrows.apps.busybox/app_busybox; export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/data/burrows.apps.busybox/app_busybox:/vendor/lib*:/system/lib*; /data/data/burrows.apps.busybox/app_busybox/rsync -v -E --delete -s -r -t -l --partial --size-only --rsh="/data/data/burrows.apps.busybox/app_busybox/ssh -y -i /keypath/ssh.key -p10022" user#homeip:/some/folder/ /local/folder
First it was the libsigchain.so 32/64bit error
Now it is this: CANNOT LINK EXECUTABLE DEPENDENCIES: "/system/lib/libsigchain.so" is 32-bit instead of 64-bit CANNOT LINK EXECUTABLE DEPENDENCIES: "libc.so" is 64-bit instead of 32-bit
Be it tasker, secure settings or terminal emulator ...
I would appreciate any suggestions.

tinyalsa sh: ./tinypcminfo: No such file or directory

tinyalsa elf failed to run on android shell, anybody know what is wrong with it ?
I am new to android, :-)
here are my steps:
1. download tinyalsa source code to a ubuntu 10 vm, compile it with arm-linux-gnueabi-gcc
2. adb push xx\tinypcminfo /data/local/tmp
3. adb shell -> cd /data/local/tmp ->chmod 777 tinypcminfo
4. ./tinypcminfo
5. error happened

AOSP 6.0 Build for hammerhead - proprietary binaries

I just built AOSP 6.0 for hammerhead and attempted to flash it. My phone froze at the Google logo and refused to boot. I'm assuming I need to use the proprietary binaries found here https://developers.google.com/android/nexus/drivers
How would I extract these and put them in to my build? Thanks.
Be certain to download the Nexus 5 binaries that match the version of AOSP that you're building. For example, if you're building the most recent version of AOSP, when you initialized your repo you entered this command:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-6.0.1_r72
Take that last branch code (everything after '-b') android-6.0.1_r72 and search for it over here:
https://source.android.com/source/build-numbers.html#source-code-tags-and-builds
It matches build M4B30X
Now, take that build code M4B30X and search for it over here:
https://developers.google.com/android/nexus/drivers
Download the corresponding binaries:
$ cd ~/Downloads
$ wget https://dl.google.com/dl/android/aosp/broadcom-hammerhead-m4b30x-7c7b231f.tgz
$ wget https://dl.google.com/dl/android/aosp/lge-hammerhead-m4b30x-74fa3aa5.tgz $ wget https://dl.google.com/dl/android/aosp/qcom-hammerhead-m4b30x-158606cf.tgz
Verify the integrity of each download:
$ echo "01a03cf36b20ee2460d108c1d199f4b012b084368cddfbff1e40ff8270b54d6f broadcom-hammerhead-m4b30x-7c7b231f.tgz" | sha256sum -c
$ echo "a533f4c82d430181b97ab2321acf10ab1e2b126de7bb15437c969331541af7cb lge-hammerhead-m4b30x-74fa3aa5.tgz" | sha256sum -c
$ echo "9a2760bda79e3be7bbe7203c05273c80b0d043d9aaf15be20361e35b16ef8905 qcom-hammerhead-m4b30x-158606cf.tgz" | sha256sum -c
Extract each gzip file:
$ tar xzvf broadcom-hammerhead-m4b30x-7c7b231f.tgz
$ tar xzvf lge-hammerhead-m4b30x-74fa3aa5.tgz
$ tar xzvf qcom-hammerhead-m4b30x-158606cf.tgz
Execute the resulting self-extracting files from the source tree's root folder(~/AOSP)
$ cd ~/AOSP
$ ~/Downloads/extract-broadcom-hammerhead.sh
$ ~/Downloads/extract-lge-hammerhead.sh
$ ~/Downloads/extract-qcom-hammerhead.sh
After executing each file hit the Enter key once and then hit
the Space bar until you reach the end of each document.
At the end of each document type:
I ACCEPT
and hit the Enter key.
To accommodate the new binaries you must initiate a full rebuild, so set the
environment:
$ ./ build/envsetup.sh
$ lunch aosp_hammerhead-userdebug
And make the synthetic target 'clobber' in order to clean:
$ make clobber
Now rebuild:
(If you're running a Core2Duo)
$ make -j4
(Or, if you're running something bigger)
$ make -j16
Uncompress the downloaded files, you will get bash files. Put all these files in the root directory of your AOSP project and execute them. You will have to accept the licenses and the binaries will be extracted in the right directory.
After this step. In the AOSP root directory, execute :
make clobber
It will clean the current build (out/**). It is needed for the make to notice the changes regarding the AOSP build official procedure.
Then you can compile again the sources.
make -j4
(or j8/j16 regarding your CPU threads number)

./fastboot: No such file or directory

I've struggled with this for awhile! I'm beating my head against the wall.
I am trying to run fastboot (android-linux-tools/platform-tools/fastboot) and I am getting a No such file or directory message.
I am on ubuntu 12.04 x64. I am not new to linux, I'm baffled.
$ cd ~/android-sdk-linux/platform-tools
$ ./fastboot
-bash: ./fastboot: No such file or directory
$ ./adb devices
-bash: ./adb: No such file or directory
$ ls -la
...
-rwxrwxr-x 1 nick nick 159644 Apr 16 21:10 adb
...
-rwxrwxr-x 1 nick nick 149928 Aug 16 21:10 fastboot
...
Is this a new machine where you have just downloaded the SDK? Since you are running a 64-bit distribution, check whether you have installed the ia32-libs package needed for the SDK executables to work:
sudo apt-get install ia32-libs
Try with su.
I had the same problem with .android directory and even with the ls command I could not see it(even after su). After su I could cd in the directory

Categories

Resources