[Q] I'm trying to boot my Nexus 10 with your linux-kvm-arm kernel version 3.13... - General Questions and Answers

Hello to everyone,
I'm trying to boot my Nexus 10 with another kind of kernel version,because I'm not interested to use the Android kernel,but the Ubuntu pure kernel. I've chosen to use the linux-kvm-arm kernel version 3.13 :
These are the commands that I have used :
git clone git://github.com/virtualopensystems/linux-kvm-arm.git
cd linux-kvm-arm
git checkout origin/chromebook-3.13 -b chromebook-3.13
curl http://www.virtualopensystems.com/downloads/guides/kvm_on_chromebook/config > .config
and then I've added these lines to the .config file :
CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ASHMEM=y
CONFIG_ANDROID_LOGGER=y
CONFIG_ANDROID_PERSISTENT_RAM=y
CONFIG_ANDROID_RAM_CONSOLE=y
CONFIG_ANDROID_TIMED_OUTPUT=y
CONFIG_ANDROID_TIMED_GPIO is not set
CONFIG_ANDROID_LOW_MEMORY_KILLER=y
CONFIG_ANDROID_SWITCH is not set
CONFIG_ANDROID_INTF_ALARM is not set
CONFIG_FB_TILEBLITTING=y
CONFIG_PHONE is not set
CONFIG_USB_WPAN_HCD is not set
CONFIG_WIMAX_GDM72XX is not set
CONFIG_ARM_PLATFORM_DEVICES=y
CONFIG_ARM_CHROMEOS_FIRMWARE=y
CONFIG_CHROMEOS=y
CONFIG_CHROMEOS_VBC_BLK=y
CONFIG_CHROMEOS_VBC_EC=y
CONFIG_CHROMEOS_RAMOOPS_RAM_START=0x41f00000
CONFIG_CHROMEOS_RAMOOPS_RAM_SIZE=0x00100000
CONFIG_CHROMEOS_RAMOOPS_RECORD_SIZE=0x00020000
CONFIG_CHROMEOS_RAMOOPS_DUMP_OOPS=0x1
CONFIG_CLKDEV_LOOKUP=y
and then I did :
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make uImage dtbs
from here I've followed the tutorial that I've found here :
http://forum.xda-developers.com/showthread.php?t=1981788
and here :
http://forum.xda-developers.com/showthread.php?t=1981788&page=2
mkdir -p newkernel
cd newkernel
wget -c https://dl.google.com/dl/android/aosp/mantaray-kot49h-factory-174ba74f.tgz
tar xvzf mantaray-kot49h-factory-174ba74f.tgz
cd mantaray-kot49h
unzip image-mantaray-kot49h.zip
wget -c http://android-serialport-api.googlecode.com/files/getramdisk.py
chmod +x getramdisk.py
./getramdisk.py boot.img --> ramdisk.img
wget -c http://android-serialport-api.googlecode.com/files/android_bootimg_tools.tar.gz
tar xvf android_bootimg_tools.tar.gz
./mkbootimg --kernel ../../linux-kvm-arm/arch/arm/boot/zImage --ramdisk ramdisk.img --cmdline bootimg.cfg -o new-boot.img
fastboot flash boot new-boot.img
I think that something is wrong here,because it is not able to boot....I see a black screen and nothing else happens...any ideas ?

Related

post your build scripts

Code:
FILENAME=`date +%Y.%m.%d-%H.%M.%S`
export CCOMPILER=~/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
export KERN_DIR=~/mydroid/kernel
export DROID_ARCH=arm
export JCOUNT=`cat /proc/cpuinfo | grep processor | wc -l`
echo "Cleaning"
cd $KERN_DIR
make clean
echo "**Building Kernel**"
#make ARCH=$DROID_ARCH CROSS_COMPILE=$CCOMPILER -j${JCOUNT}
make ARCH=$DROID_ARCH CROSS_COMPILE=$CCOMPILER
mv $KERN_DIR/arch/arm/boot/zImage ~/droidtmp/${FILENAME}_zImage
echo "**Building WLAN**"
#make clean
cd ~/mydroid/system/wlan/ti/sta_dk_4_0_4_32
make ARCH=$DROID_ARCH CROSS_COMPILE=$CCOMPILER KERNEL_DIR=$KERN_DIR
#mv ~/mydroid/system/wlan/ti/sta_dk_4_0_4_32/wlan.ko ~/droidtmp/build/system/lib/modules/wlan.ko
cp ~/mydroid/system/wlan/ti/sta_dk_4_0_4_32/wlan.ko ~/droidtmp/${FILENAME}_wlan.ko
echo "**Building boot.img**"
~/mydroid/out/host/linux-x86/bin/mkbootimg --cmdline 'no_console_suspend=1 console=null' --kernel ~/droidtmp/${FILENAME}_zImage --ramdisk ~/droidtmp/ramdisk-new.gz -o ~/droidtmp/${FILENAME}_boot.img
#echo "**Adding boot.img to base**"
#TODO
#echo "**Signing zip**"
#TODO
Code:
#!/bin/sh
export KERNEL_DIR=/home/chris/cm-kernel
export TOOLCHAIN=/home/chris/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
cd $KERNEL_DIR
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN
echo ---Finished building kernel!
rm -r out/*
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN INSTALL_MOD_PATH=./out/modules/ modules_install
echo ---Finished building modules tree!
cd out/modules
mksquashfs . ../modules.sqf -noappend
cd ../../
echo ---Finished building module squish!
cd ~/mydroid/system/wlan/ti/sta_dk_4_0_4_32
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN KERNEL_DIR=$KERNEL_DIR
echo ---Finished building wlan.ko!
cd ~/32A
cp $KERNEL_DIR/arch/arm/boot/zImage kernel
cp $KERNEL_DIR/out/modules.sqf update/system/modules/modules.sqf
cp ~/mydroid/system/wlan/ti/sta_dk_4_0_4_32/wlan.ko ~/32A/update/system/lib/modules/wlan.ko
/home/chris/bin/mkbootimg --cmdline "no_console_suspend=1 console=null" --kernel kernel --ramdisk ramdisk -o boot.img
echo ---Finished making boot image!
echo ---Preparing flashable update
cp boot.img update/
cd update
rm *.zip
zip -r update.zip boot.img system/ META-INF/
mv update.zip ../sign
echo ---Signing update
cd ../sign
java -jar signapk.jar testkey.x509.pem testkey.pk8 update.zip update_s.zip
mv update_s.zip update.zip
mv update.zip ~/32A/
echo ---Done - image is in ~/32A!

[9001] Kernel - Extracting initrd.img from zImage and package again

Disclaimer: Do only use this information if you know what you're doing!
PATH=$PATH:/home/markus/android/sdk/platform-tools
Get kernel from phone:
adb shell
su
dd if=/dev/block/mmcblk0p8 of=/sdcard/external_sd/stockboot.img
Exit adb shell
adb pull /sdcard/external_sd/stockboot.img
Separate the zImage from the ramdisk (see below for abootimg):
abootimg -x stockboot.img
unpacks the archive and copies contents to working directory:
gunzip -c initrd.img | cpio -i
Do your edits, e.g. default.prop, add:
debug.performance.tuning=1
video.accelerate.hw=1
windowsmgr.max_events_per_sec=150
--> move all files to new folder, cd into this folder:
repacks files from working directory into an archive (MAKE SURE NO OTHER FILES ARE IN THE WORKING DIRECTORY!!)
find . | cpio -o -H newc | gzip > ../myinitrd.img
New boot.img:
./mkbootimg --kernel zImage --ramdisk myinitrd.img --cmdline "console=null androidboot.hardware=qcom androidboot.emmc=true hw=6" -o myBuiltBoot.img --base 0x00400000 --pagesize 4096
You can also use abootimg to create your new .img file, it has an easier syntax as it exports the commandline to a .cfg file and you can use that while creating the package.
Push your new kernel.img to the phone:
adb push myBuiltBoot.img /sdcard/external_sd/myBuiltBoot.img
Write kernel to kernel-partition in phone:
adb shell
su
dd if=/sdcard/external_sd/myBuiltBoot.img of=/dev/block/mmcblk0p8
adb reboot
< pray >
Sources:
http://forums.androidcentral.com/lg...ense-back-up-your-phone-without-nandroid.html
http://forum.xda-developers.com/showthread.php?t=1227269
http://forum.xda-developers.com/showthread.php?t=1292557
Also quite handy: http://packages.debian.org/de/sid/abootimg
wouldnt just editing build.prop in /system without touching kernel do the same job? ^_^
Yep. I just wanted to describe the whole process of extracting and packing the needed files. The edit was just an example. And in fact, i made a typo, it's called default.prop.

[Q] Need help modifying boot blob

Could someone point me to some instructions on how to unpack, modify, and repack a boot.blob out of a kernel?
I'm trying to update bryce's kernel to use Data2SD mod, and I'm following the instructions from here:
http://forum.xda-developers.com/showpost.php?p=29532041&postcount=15
However, I tried unpacking and repacking without even modifying anything and I just get bootlooped.
Read this: http://forum.xda-developers.com/showpost.php?p=36925180&postcount=4
Do you want to use the Data2SD mod with CM or with CROMI? For CROMI I posted a kernel with auto-detection of Data2SD in bryce's thread - only for CM you'd have to do it yourself.
Thanks for the help. I actually just figured out a different way right before seeing your reply. I use blobpack and blobunpack from BlobTools git, and abootimg installed from Ubuntu repository. This script has the extracted bryce kernel zip in a directory called result, so I overwrite his boot.blob with my new one.
Code:
#!/bin/bash
#Clean:
rm out boot.img new_boot.img boot2.blob linux_processed.zip -r
mkdir -p out
echo;echo "**** Unpacking boot.blob to boot.img";echo
cp result/boot.blob .
../linux/blobunpack boot.blob
mv boot.blob.LNX boot.img
cd out
# now in out
echo;echo "**** Unpacking boot.img";echo
abootimg -x ../boot.img
#zcat initramfs|cpio -tiv
echo;echo "**** Extracting initrd.img";echo
mkdir -p initramfs
cp initrd.img initramfs/initramfs.gz
mv initrd.img old_initrd.img
cd initramfs
# now in old/initramfs
gzip -d initramfs.gz
cpio -i < initramfs
echo;echo "**** Modifying boot information";echo
perl -pi -e 's/mmcblk0p2/mmcblk1p3/g' *
perl -pi -e 's/mmcblk0p8/mmcblk1p2/g' *
echo;echo "**** Recompressing initrd.img";echo
find | cpio -H newc -o | lzma -9 > ../initrd.img
cd ..
# now in out
echo;echo "**** Creating new_boot.img";echo
abootimg --create ../new_boot.img -f bootimg.cfg -k zImage -r initrd.img
cd ..
#now out of out
echo;echo "**** Pack boot2.blob";echo
../linux/blobpack boot2.blob LNX new_boot.img
cp boot2.blob result/boot.blob
cd result
echo;echo "**** Zip it all up";echo
zip ../linux_processed.zip * -r
cd ..
I am trying to get bryce's CM10.1 kernel working with Data2SD. I thought all I needed to do was change the mount commands in fstab.cardhu so that data (and I'm trying to do cache too) moved to external partitions.
Those perl pie commands in the middle were supposed to change internal data partition and internal cache partition into the external SD card partition 2 and 3, respectively. As far as I can tell, the changes were made correctly and the blob and zip were re-created, but it didn't work when I booted with the new blob.
Any ideas why it doesn't seem to have worked? Are there other changes I'm missing?
Edit:
Looks like my boot.blob is not being applied. I've tried both flashing the zip and dd'ing it to mmcblk0p4, but in both cases, I do not get the bootloader update screen on reboot, it just boots straight into my old settings. What am I missing?
Edit again:
Oops, I had stopped adding the signature on the blobs for some reason, looks like I'm off a few steps, because now I get bootloops again.
AW: [Q] Need help modifying boot blob
oblib__ said:
Thanks for the help. I actually just figured out a different way right before seeing your reply. I use blobpack and blobunpack from BlobTools git, and abootimg installed from Ubuntu repository. This script has the extracted bryce kernel zip in a directory called result, so I overwrite his boot.blob with my new one.
Code:
#!/bin/bash
#Clean:
rm out boot.img new_boot.img boot2.blob linux_processed.zip -r
mkdir -p out
echo;echo "**** Unpacking boot.blob to boot.img";echo
cp result/boot.blob .
../linux/blobunpack boot.blob
mv boot.blob.LNX boot.img
cd out
# now in out
echo;echo "**** Unpacking boot.img";echo
abootimg -x ../boot.img
#zcat initramfs|cpio -tiv
echo;echo "**** Extracting initrd.img";echo
mkdir -p initramfs
cp initrd.img initramfs/initramfs.gz
mv initrd.img old_initrd.img
cd initramfs
# now in old/initramfs
gzip -d initramfs.gz
cpio -i < initramfs
echo;echo "**** Modifying boot information";echo
perl -pi -e 's/mmcblk0p2/mmcblk1p3/g' *
perl -pi -e 's/mmcblk0p8/mmcblk1p2/g' *
echo;echo "**** Recompressing initrd.img";echo
find | cpio -H newc -o | lzma -9 > ../initrd.img
cd ..
# now in out
echo;echo "**** Creating new_boot.img";echo
abootimg --create ../new_boot.img -f bootimg.cfg -k zImage -r initrd.img
cd ..
#now out of out
echo;echo "**** Pack boot2.blob";echo
../linux/blobpack boot2.blob LNX new_boot.img
cp boot2.blob result/boot.blob
cd result
echo;echo "**** Zip it all up";echo
zip ../linux_processed.zip * -r
cd ..
I am trying to get bryce's CM10.1 kernel working with Data2SD. I thought all I needed to do was change the mount commands in fstab.cardhu so that data (and I'm trying to do cache too) moved to external partitions.
Those perl pie commands in the middle were supposed to change internal data partition and internal cache partition into the external SD card partition 2 and 3, respectively. As far as I can tell, the changes were made correctly and the blob and zip were re-created, but it didn't work when I booted with the new blob.
Any ideas why it doesn't seem to have worked? Are there other changes I'm missing?
Edit:
Looks like my boot.blob is not being applied. I've tried both flashing the zip and dd'ing it to mmcblk0p4, but in both cases, I do not get the bootloader update screen on reboot, it just boots straight into my old settings. What am I missing?
Edit again:
Oops, I had stopped adding the signature on the blobs for some reason, looks like I'm off a few steps, because now I get bootloops again.
Click to expand...
Click to collapse
I had a hard time getting this done too. I couldn't find working blob tools at first. So I ended up using blob tools for windows. They also sign them directly. But I am also running Ubuntu in a vm
Sent from my Nexus 4 using xda premium

HOW TO... build kernel-unpack-pack-tar .. boot.img

lesson-01: HOW t Build kernel ..​
i'm using ubuntu 12 32bit .. toolchain linaro ..
- Download source tree .. from git or official web site there is now .. for 4.1.2 and 4.2.2 ..
- Download cross compiler **toolchain** ..
- edit makefile in the kernel tree ..
Code:
ARCH = arm
CROSS-COMPILE = /directery to your compiler **toolchain** /arm-eabi- or **see in bin folder**
- open terminal .and cd to kernel tree .. **cd /home/**yourname**/Deskt...... **
-type :
Code:
make clean
make mrproper
make bcm28155_capri_ss_s2vep_rev05_defconfig
** or you can extract config.gz from phone "cat /proc/config.gz > /sdcard/config.gz" extract file from config.gz rename it like this "blablabla_defconfig" put it in /kerneltree...../arch/arm/configs **
make menuconfig **if you want to add driver or feautre like NTFS support**
make -jX
Click to expand...
Click to collapse
multitask make ..X=2.....10 depance as your computer cpu power
and you will get zImage in "/kerneltree..../arch/arm/boot "
now you have t o make boot.img .. and there is big diffrent between them .. boot.img contain ramdisk and kernel .... pagesize .. base .. to the next lesson.
lesson-02: how to unpack boot.img and get ramdisk​
zImage **kernel** is like globel driver and configuration for the device .Ramdisk launch the rom and you can make rooted kernel with it ** you have to unpack ramdisk.gz to add modification and repack it **
you can extract from orginal firmware .. or extract it from phone :
** cat /dev/block/mmcblk0p5 > /sdcard/boot.img **
now how to unpack boot.img
cd to the tools folder ..
Code:
sudo cp mkbootimg /bin/
sudo chmod 755 /bin/mkbootimg
perl split_bootimg.pl boot.img
** boot.img of the rom you will use because off the ramdisk **
will show :
Page size: 4096 (0x00001000) ***we will need this***
Code:
Kernel size: 3132176 (0x002fcb10)
Ramdisk size: 3484496 (0x00352b50)
Second size: 0 (0x00000000)
Board name:
Command line:
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
** now you can edit your ramdisk --superuser-init..it is like basic files for rom .. becaution **
Lesson-03: packing boot.img .. taring to flash via odin.​
now the packing .. we need : cmdline + pagesize + base without them it wont boot ..
how extract cmdline : ** cat /proc/cmdline > /sdcard/cmdline.txt **
you can find base in the cmdline file : [email protected]0xA2000000
for our device i9105p : base = 0xA2000000 pagesize = 4096
now packing :
Code:
./mkbootimg --pagesize 4096 --base 0xa2000000 --kernel zImage --ramdisk ramdisk.gz -o newboot.img
now we have the new boot.img you can use it with flash.zip CWM
or tar the img to flash it via odin.
Code:
$ tar -H ustar -c boot.img > kernel.tar
$ md5sum -t kernel.tar >> kernel.tar
$ mv kernel.tar kernel.tar.md5
:good:
reserved

How to edit boot.img for SM-T585?

I want to edit the boot.img for SM-T585, but I can't edit initrd.img. I'm using abootimg and I tested that it works by unpacking and repacking the boot.img without doing any thing to the initrd.img:
Code:
abootimg -x boot.img
abootimg --create newboot.img -k zImage -r initrd.img -f bootimg.cng
and this image can be flashed and the device boot normally, but when I try to modify the initrd.img:
Code:
mkdir initrd_folder && cd initrd_folder
# extract the [B]initrd.img[/B]
zcat ../initrd.img | cpio -idmv
# pack it again
find . | cpio --create --format='newc' | gzip -9 > ../newinitrd.img
From: How To Modify initrd.img
and then create the new boot.img with the new initrd.img
Code:
abootimg --create newboot.img -k zImage -r newinitrd.img -f bootimg.cfg
This new boot.img doesn't make the device boot and it only shows the Samsung logo and then reboots

Categories

Resources