Related
so ive been trying all day to get my /sd-ext to mount . ive added mount commands to the init files in /system/etc/init.d but none of them seem to run on boot. what should i do?
are you talking about app2sd or am i misunderstanding you?
yes trying to implement commands for a dirty ext apps2sd on cm6 nexus
the builders have said it will be in a future release when they are happy with performance
superg81 said:
the builders have said it will be in a future release when they are happy with performance
Click to expand...
Click to collapse
wow that was not helpful in any way
well **** me,i was trying to be nice.piss off
ahronzombi said:
wow that was not helpful in any way
Click to expand...
Click to collapse
just incase someone else runs into douches who dont help
I spent all night trying to do this so im going to document this.
-None of this stuff is my work , thanks to Pershoot, teamdouch and cyanogen for the files to push
-This is a very ugly hack. Maybe someone else can make this simpler by making a flashable rom with this already applied. I'm not knowledgeable enough at this point to make this any easier or i would.
-I dont dev , i dont make roms and i dont claim to be good at this. !!!!PLEASE USE AT YOUR OWN RISK!!! BACKUP!!!!
-Feel free to take this and fix my flaws, dont need to give me credit.
okay this is how i got apps2ext in cm6 nexus
Im doing this right after flashing cm , haven't installed apps or registered my account on the phone. i have a existing ext partition.
1.Symlink
(copy any of your apps to the new location if you already have a running system without this hack)
Code:
adb remount
Code:
adb shell mkdir /sd-ext
Code:
adb shell mkdir /sd-ext/app
Code:
adb shell rm /data/app
Code:
adb shell ln -s /sd-ext/app /data/app
2.init files
Okay i added this to a few init files. but you need to add this line to an init file in
/system/etc/init.d/
Code:
busybox mount -t ext2 /dev/block/mmcblk0p2 /sd-ext/
any may work for example this is /system/etc/init.d/00banner
Code:
#!/system/bin/sh
#
# Print startup info
#
busybox mount -t ext2 /dev/block/mmcblk0p2 /sd-ext/
L="log -p i -t cm"
$L "Welcome to Android `getprop ro.build.version.release` / `getprop ro.modversion`";
$L " _ ";
$L " __ __ _ ___ _ _ __ ___ __ _ _ _ _ __ __))";
$L "((_ \\(/'((_( ((\\( ((_)((_( (('((\\( ((\`1( ((_)((_( ";
$L " )) _))";
$L " ";
3.flash boot.img of kang-o-rama froyo. its in the (final) update zip at http://forum.xda-developers.com/showpost.php?p=6973422&postcount=2139
extract and copy the boot.img file to your sdcard
Code:
adb shell flash_image boot /sdcard/boot.img
Code:
adb shell reboot recovery
4. Now you have apps2ext, but wifi wont work
So........
flash pershoots nexus froyo kernel from http://droidbasement.com/db-blog/ using your recovery
THIS IS UGLY I KNOW
If your smarter than me please make this easier for all of us, this took me hours to figure out on my own + twitter
Thanks ahead of time to whom ever helps with this
What was the need for the boot.img step? I believe after creating the symlink you don't need anything else
right on bro, thanks a bunch for ur research, i was looking for something like this. U da man
i would also like to know why is the boot.img necessary
xxmonsterx said:
i would also like to know why is the boot.img necessary
Click to expand...
Click to collapse
Because Kang-o-rama has Apps2sd in the ramdisk (not the zImage) inside of boot.img.
So, flashing Kang-o-rama's boot.img will give you K-O-R's kernel with integrated Apps2sd. But ofcourse it breaks wifi, because you have not yet replaced the /system/lib/modules/bcm4329.ko file.
Now, Pershoot's kernel flash (as well as nearly any kernel flash) actually pulls the ramdisk out of your existing boot.img, integrates it with his zImage, and then repacks a new boot.img - and, critically, it also copies in the matching bcm4329.ko driver.
So, you don't have to actually flash Pershoot's kernel - you should just need to pull the /system/lib/modules/bcm4329.ko file out of Kang-o-rama when you take out the boot.img. Then flash the boot.img AND replace the .ko at the same time, and you ought to be golden.
So, assuming that you put the .ko file in the root of your SD card :
Code:
adb shell flash_image boot /sdcard/boot.img
adb remount
adb shell
su (if you are not already root in the ADB session for some reason...)
cp /system/lib/modules/bcm4329.ko /system/lib/modules/bcm4329.ko.bak
cp -f /sdcard/bcm4329.ko /system/lib/modules/bcm4329.ko
chmod 644 /system/lib/modules/bcm4329.ko
reboot
And you should be good to go - using Kang-o's kernel if that is acceptable for you.
want to edit your boot.img?
included files in zip: mkbootimg (i compiled this file from android source), unpack-bootimg.pl, repack-bootimg.pl
i edited the repack script to compile the nexus s img correctly.
Code:
--base 0x30000000 --pagesize 4096
first dump original boot.img:
Code:
cat /dev/mtd/mtd2 > /sdcard/boot.img
then drag/drop to your linux box to edit file.
use unpack script:
Code:
./unpack-bootimg.pl boot.img
you will end up with 2 compressed files and 1 folder.
finished editing and want to repack boot.img, for example:
Code:
./repack-bootimg.pl <kernel> <ramdisk-directory> <outfile>
most info and scripts pulled from here: http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images, thanks to the original author.
test your new boot.img:
Code:
fastboot boot boot.img
Two things:
1. if you have any bad blocks in your boot partition, this method will fail to extract the boot.img (you need to skip bad blocks, but cat will just get an error)
2. you can replace just the kernel (leaving the ramdisk and parameters intact) using:
Code:
% fastboot flash zimage zImage
The bootloader will read-modify-write the boot partition, replacing the kernel only.
how would you skip bad blocks? i never thought of a phone as having bad blocks.
k0mpresd said:
i never thought of a phone as having bad blocks.
Click to expand...
Click to collapse
All flash devices can have bad blocks. But it usually isn't something the end user would notice, unless there are so many and something is wrong that you're losing drive space.
edit: more info here if your curious http://en.wikipedia.org/wiki/Flash_memory
hmm, very strange thing happening to me. I've only gotten my boot.img to compile and boot successfully once with this method, but now I can't seem to get it to compile? I keep getting errors of the file name or file type. I'm using the correct usage.. If I compile manually with mkbootimg on the cmd line it'll compile but it won't boot. Just bootloops at the Google splash..
Jroid try my Matr1x kernel and see what happens
Sent from my Nexus S using XDA App
The problem seems to be compiling the boot with the perl scripts, not the kernel itself.
Try manually:
Once unpacked do the boot.img-ramdisk.cpio.gz with the following command (moved to the ramdisk folder):
Code:
#sudo find . | cpio -o -H newc | gzip > ../<your boot name>.img-ramdisk.cpio.gz
Then cd ../
And repack:
Code:
#./mkbootimg --kernel <your boot name>.img-kernel.gz --ramdisk <your boot name>.img-ramdisk.cpio.gz --base 0x30000000 --pagesize 4096 -o boot.img
you can replace just the kernel (leaving the ramdisk and parameters intact) using:
Code:
% fastboot flash zimage zImage
The bootloader will read-modify-write the boot partition, replacing the kernel only.
Click to expand...
Click to collapse
It won't work on the Nexus S.
python08 said:
It won't work on the Nexus S.
Click to expand...
Click to collapse
exactly, i'd love to be able to do this for some testing but it doesn't allow me.
EDIT: yes it does. Swetland is right
Chamb' said:
Try manually:
Once unpacked do the boot.img-ramdisk.cpio.gz with the following command (moved to the ramdisk folder):
Code:
#sudo find . | cpio -o -H newc | gzip > ../<your boot name>.img-ramdisk.cpio.gz
Then cd ../
And repack:
Code:
#./mkbootimg --kernel <your boot name>.img-kernel.gz --ramdisk <your boot name>.img-ramdisk.cpio.gz --base 0x30000000 --pagesize 4096 -o boot.img
Click to expand...
Click to collapse
I've tied compiling a boot both manually (with cmdline) and with the perl scripts and have used a simple kernel.gz and ramdisk.cpio.gz for my file names.. doesn't really matter what I name it as long as it has the correct file format in this .gz and .cpio.gz right? the manual compile goes fine with base 0x30000000 and pagesize 4096
however, it does not boot and will bootloop at the Google splash
Used boot.img extracted from (what ROM ?) cat /dev/mtd/mtd2 ?
Is the phone start with this boot.img (unchanged) if you flash it by typing "fastboot flash..." ?
After that, just try to unpack and repack the boot.img without changes on ramdisk or kernel, if it works that means your changes suck (^^).
These commands (or perl scripts) work perfectly for me.
Lol I will try doing that. The boot.img I used is from stock 2.3.4, edited the ramdisk (specifically init.rc & init.herring.rc)
Like I said, first time I used the perl scripts I edited my ramdisk, threw in a netarchy kernel, it compiled fine and booted. Now if I use the perl script to repack with an aosp kernel, it gives me an error about file name and/or extension being wrong. Or complains it can't find mkbootimg when its there and executable. I'll re run it again and post errors
Sent from my Nexus S
he guys where is the boot image located? not the animation, the google logo at the start of the booting!
Sent from my Nexus S using XDA Premium App
ok so when I used the repack-bootimg.pl script, it kept giving me this error:
Code:
boot.img-kernel.gz Not a directory at ./repack-bootimg.pl line 13.
So I ran mkbootimg manually, without a cmdline comment as stated above. It compiled
and booted beautifully all stock with no init.rc or init.herring.rc edits.
however when I compile a boot.img coupled with a stock kernel and a modified ramdisk, I get a non-booting boot.img. One came out at 2.9 mb and the other at 5.6 mb neither boots using the same cmd that compiled the working boot. Must be my edits.. I literally only changed about 1 line in init.rc and another line in init.herring.rc that causing it not to boot.
By the way, I got some info on a stock boot.img using the unpackbootimg binary (not the perl script) and here's what it outputs:
Code:
#BOARD_KERNEL_CMDLINE console=ttyFIQ0 no_console_suspend
BOARD_KERNEL_BASE 30000000
BOARD_PAGE_SIZE 00001000
I enter that pagesize and it says it's not a valid value when I compile boot.img's
Borky_16 said:
he guys where is the boot image located? not the animation, the google logo at the start of the booting!
Sent from my Nexus S using XDA Premium App
Click to expand...
Click to collapse
part of the kernel
to change-https://github.com/morfic/Samsung-logo
ogdobber said:
part of the kernel
to change-https://github.com/morfic/Samsung-logo
Click to expand...
Click to collapse
yeah i know thanks for the link a helping source though!
Sent from my Nexus S using XDA Premium App
Sorry for the Control C Control V of it, but I just found this topic now..
I`m facing this problem when I try to unpack boot.img..
I have done it 2 days ago but dunno why, now I can`t..
Follows what is happening..
Code:
[email protected]:~/NS-bootwork$ ./unpack-bootimg.pl boot.img
Found a secondary file after the ramdisk image.
According to the spec (mkbootimg.h) this file can exist,
but this script is not designed to deal with this scenario.
The Kernel is built, as a zImage and the WLAN as a bmc3429.ko..
Just repeating, I have built this Kernel 2 days ago in the same way, without any problems, but now I`m struggling on the message after inputting ./unpack-bootimg.pl boot.img..
Dunno what else to try, I re-downloaded the unpack-bootimg.pl from 2 different sources, and still the same error..
Any ideas?
Many thanks..
P.S.: Ubuntu 11.04 x64..
EDIT
Well, I already solve it!
That is what I did..
As unpack-bootimg.pl was not working (don`t know why) I used split_bootimg.pl script, splitting the boot.img and created new ramdisk img..
Code:
./split_bootimg.pl boot.img
mkdir ramdisk
cd ramdisk
gzip -dc ../boot.img-ramdisk.gz | cpio -i
find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
Then after just compiled the Kernel with
Code:
./mkbootimg --kernel zImage --ramdisk newramdisk.cpio.gz --base 0x30000000 --pagesize 4096 --cmdline _console_suspend=1 console=bull's -o newtestboot.img'no
Witches includes " --cmdline _console_suspend=1 console=bull's" to not break BT functionality, in the case of Nexus S..
I found the tools here work well: http://glandium.org/blog/?p=2214
...if you then use the code originally posted above:
Code:
sudo find . | cpio -o -H newc | gzip > ../<your boot name>.img-ramdisk.cpio.gz
./mkbootimg --kernel <your boot name>.img-kernel.gz --ramdisk <your boot name>.img-ramdisk.cpio.gz --base 0x30000000 --pagesize 4096 -o boot.img
HP Touchpad running Sailfish SDK with libhybris....
Yep.. Using ICS\CM9 because I tried and tried and tried with CM10.1 and no go.
Started with an N950 Nokia Sailfish SDK Image from a meego thread.
=) You thought it would be a video of the touchpad and sailfish eh? Maybe later..
NOTE. There is ZERO Applications with this. It is just the SDK. Not worth messing with unless you REALLY want to. You WILL need to create a lvm partition that is /dev/store/ubuntu formatted as ext3 that is around 2gb or more.. And you will need to create some space on boot. Take a look at the Ubuntu Touch Partition Creator on the Ubuntu Touch thread.. or just create it yourself..
It is just like this except we have the touchscreen working and a mouse if you want with a y cable.
If you need help with Hybris give me a shout.. and you DO NOT have an HP Touchpad.. Read the end of my ubuntu touch thread or around page 30 and on to read what I did.
Jolla is about to come out with an awesome porting guide for the OS. And it just involves using the .zip file from cyanogenmod.. No recompiling. I just wanted to do this for fun.
hybris was not easy to install for ICS. I configured with ics headers and built with jb headers from nfc during make and removed test_gps from the Makefiles... do not run make clean.. just make install.
Woot Woot!
Thanks to STSKeeps... because.. he invented libhybris starting on a HP Touchpad. Yep.. I bet sailfish sdk has seen the touchpad before. =)
Thanks to.. SourenAraya from the meego thread.
http://talk.maemo.org/showthread.php?p=1387183
Not like Ubuntu Touch at all.. No LXC container.. no chroot.. just /system folder.. and you can use it.
http://gdurl.com/N-C1/download RootFS
http://gdurl.com/T0IP/download Kernel
This kernel uses a console=ttyS0 but your better off using console=ttyUSB0 and a prolific rs-232 to usb adapter... and getting a getty\console if you want to look around while its up. Or create the HP Touchpad headphone jack uart cable that requires a 4 pin headphone cable with a mic and stereo speakers. Google it.. I bought the cable but never spliced it.
Important files\folders that were changed
/system
/libhybris (make install only)
/headertest
/var/lib/environment/compositor/* (EGL_PLATFORM=null)
/usr/bin/wifi
/usr/bin/ts_srv
/lib/systemd/system/ts_srv.service
/lib/systemd/system/wifi.service
/lib/systemd/system/default.target.wants
/lib/modules
/lib/firmware
.bashrc
That is where the root filesystems differ. /usr/bin/wifi does more then you think.
My notes.. in case I lose this file.. most of the info here is not useful.. but.. whatever.
Got Tearing???? hehehe
cp arch/arm/boot/uImage ~/moboot/tools
cd ~/moboot/tools
rm uImage.Mer
rm uRamdisk
rm kernel.img
./uimage-extract uImage
rm uImage
mkimage -A arm -O linux -T kernel -C none -a 0x40208000 -e 0x40208000 -n "Kernel" -d kernel.img uImage
mkimage -A arm -O linux -T ramdisk -C none -a 0x60000000 -e 0x60000000 -n "Image" -d ramdisk.img uRamdisk
mkimage -A arm -O linux -T multi -a 0x40208000 -e 0x40208000 -C none -n "multi image" -d uImage:uRamdisk uImage.Mer
cat uImage.Mer | novacom put finemo-apps-wayland | Nemo Apps | pattern
| nemo-complete-wayland | Nemo Comple-> | pattern
| nemo-mobile-session-wayland | Wayland con-> | package
| nemo-rnd-wayland | Nemo RND Wa-> | pattern
| nemo-ux-wayland le:///boot/uImage.Mer
sed -i '$ a nameserver 8.8.8.8' > /etc/resolv.conf
echo "nameserver 8.8.8.8" > /etc/resolv.conf
./autogen.sh --prefix=/usr --enable-wayland --with-android-headers=/headertest --with-default-egl-platform=ics --enable-debug --enable-mesa --enable-trace
./autogen.sh --prefix=/usr --enable-debug --enable-mesa --enable-trace --enable-alinker=jb
QT_QPA_EGLFS_DEPTH=24 /usr/lib/qt5/bin/qmlscene -platform eglfs
QT_QPA_EGLFS_DEPTH=32 /usr/lib/qt5/bin/qmlscene -platform eglfs
QT_QPA_EGLFS_DEPTH=16 /usr/lib/qt5/bin/qmlscene -platform eglfs
QT_QPA_EGLFS_PHYSICAL_WIDTH=1024 QT_QPA_EGLFS_PHYSICAL_HEIGHT=768
QT_WAYLAND_GL_CONFIG=brcm_egl QT_QPA_EGLFS_WIDTH=1024 QT_QPA_EGLFS_HEIGHT=768 QT_QPA_EGLFS_DEPTH=24 QT_QPA_PLATFORM=eglfs /usr/lib/qt5/bin/qmlscene -platform eglfs ./usr/lib/qt5/examples/qtwayland/qml-compositor/main.qml
QT_QPA_EGLFS_HIDECURSOR=1 QT_QPA_EGLFS_PHYSICAL_WIDTH=400 QT_QPA_EGLFS_PHYSICAL_HEIGHT=300 QT_QPA_EGLFS_DEPTH=24 /usr/lib/qt5/bin/qmlscene -platform eglfs
zypper install make gcc automake libtool wayland-devel gcc-c++ libX11-devel
./autogen.sh --prefix=/usr --enable-wayland --with-android-headers=/headertest --enable-mesa --enable-debug --enable-trace --with-default-egl-platform=null
make
make install
[[email protected] libhybris]# mv eglplatform_null.la eglplatform_jb.la
[[email protected] libhybris]# mv eglplatform_null.so eglplatform_jb.so
test_glesv2 works!
gpasswd -a nemo hybris
gpasswd -a root hybris
echo 5.9.68.173 repo.pub.meego.com | tee -a /etc/hosts
echo 5.9.68.173 releases.nemomobile.org | tee -a /etc/hosts
move hybris into external!!!!
remove sgx and n950 stuff
egl-utils eglext-tests!!!!!!!!!!!!!!!!!!
releases.nemomobile.org
zypper in qt5-qtwayland-wayland_egl-examples qt5-plugin-imageformat-jpeg qt5-plugin-platform-eglfs qt5-qtsvg-plugin-imageformat-svg gettext
./autogen.sh --prefix=/usr --enable-gallium-llvm --enable-gallium-egl --with-state-trackers=egl --enable-glew=no --enable-glw=no --enable-glut=no --enable-gles1=yes --enable-gles2=yes --enable-egl=yes --enable-gallium-egl --enable-osmesa=no --with-egl-platforms=fbdev,wayland --enable-glx-tls --enable-glx=yes --enable-dri=no
/home/justin/UTA/ubuntu/hybris ./usr/lib/qt5/examples/qtwayland/qml-compositor/WindowChrome.qml
PRODUCT_PACKAGES += \
libcamera_compat_layer \
libis_compat_layer \
libmedia_compat_layer \
libsf_compat_layer \
libui_compat_layer \
direct_camera_test \
direct_input_test \
direct_media_test \
direct_sf_test \
libubuntu_application_api \
ubuntuappmanager \
ubuntu_chroot \
uchroot \
upstart-property-watcher
./autogen.sh --prefix=/usr --with-x --enable-gallium-llvm --with-dri-drivers=swrast --with-state-trackers=egl --enable-glew=no --enable-glw=no --enable-glut=no --enable-gles1=yes --enable-gles2=yes --enable-egl=yes --enable-gallium-egl --enable-osmesa=no --with-gallium-drivers=swrast --with-egl-platforms=x11,fbdev,wayland --enable-glx-tls --enable-glx=yes --enable-dri
nemo-apps-wayland | Nemo Apps | pattern
| nemo-complete-wayland | Nemo Comple-> | pattern
| nemo-mobile-session-wayland | Wayland con-> | package
| nemo-rnd-wayland | Nemo RND Wa-> | pattern
| nemo-ux-wayland
Sat Nov 16 17:09:11 EET 2013
./autogen.sh --prefix=/usr --with-x --enable-gallium-llvm --with-dri-drivers=swrast --with-state-trackers=egl --enable-glew=no --enable-glw=no --enable-glut=no --enable-gles1=yes --enable-gles2=yes --enable-egl=yes --enable-gallium-egl --enable-osmesa=no --with-egl-platforms=x11,fbdev,wayland --enable-glx-tls --enable-glx=yes --enable-dri
PATH="/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/nemo/bin:/sbin"
Sat Nov 16 17:09:11 EET 2013
I/gralloc (19700): width = 163 mm (159.568 dpi)
I/gralloc (19700): height = 122 mm (159.895 dpi)
QT_QPA_EGLFS_PHYSICAL_WIDTH=163 QT_QPA_EGLFS_PHYSICAL_HEIGHT=122 QT_QPA_EGLFS_DEPTH=32 QT_QPA_PLATFORM=eglfs /usr/lib/qt5/bin/qmlscene -platform eglfs
I/SurfaceFlinger( 1111): EGLSurface: 8-8-8-0, config=0x7
cd /dev
rm -f /dev/log
mkdir /dev/log
chmod 777 /dev/log
cd /dev/log
ln -s /dev/log_main main
ln -s /dev/log_system system
ln -s /dev/log_events events
ln -s /dev/log_radio radio
mkdir /dev/graphics
cd /dev/graphics
ln -s /dev/fb0 fb0
chmod 666 /dev/graphics/fb0
chmod 666 /dev/fb0
chmod 666 /dev/genlock
chmod 666 /dev/log*
chmod 666 /dev/log/*
chmod 666 /dev/kgsl*
Looks promising!. I can't wait to try Jolla on my tablet, long live the Touchpad
you make my day man, now waiting for jola
thank you
Hi, there this sounds great.
Can you Tell me where I find instructions for installing Nemo Mobile on the TP?
I Remember having it installed on the N900 about 2 years ago.
Thanks a lot:fingers-crossed:
Coffee Cactus said:
Hi, there this sounds great.
Can you Tell me where I find instructions for installing Nemo Mobile on the TP?
I Remember having it installed on the N900 about 2 years ago.
Thanks a lot:fingers-crossed:
Click to expand...
Click to collapse
I have a private image and kernel that runs it. It doesnt do that much.. I think. I haven't really played with it.. I did have a gui and touch though.
I suppose I can retry with 3.0.1 and then upload it....
I got the nemo thing from... hmm how did I build it? For nemo.. I think I built it from the instructions for another device.. then I compiled my own /system folder and compiled libhybris. Got that working.
Then I went after Qt5.. Then it worked. It was also a pain to get hybris to work with ics.. that I remember.
OH.. move hybris into external!!!!
remove sgx and n950 stuff
egl-utils eglext-tests!!!!!!!!!!!!!!!!!!
Most likely I compiled an image for the Nexus or just downloaded one, but then after it booted on the touchpad kernel with the nemo ramdisk built into the kernel and most likely modified, I started to remove stuff with yum or whatever.. before recompiling hybris.. the n950 packages screwed stuff up and broke the touchscreen?
Anyway.. it ended up working.. don't think I tested sound or bluetooth or wifi though. pretty sure settings was blank? Nemo needed more work? Doubt that will happen because of Jolla and Sailfish.
I'm trying to port ubuntu touch to oneplus one, it compiled without any errors. I have a problem where adbd does not start? and it's hard to debug without adbd. btw: adbd starts at recovery.
here is the last_kmsg: (i need more than 10 post to post links.......fuuu!) (paste(dot)ubuntu.com/10341700/) (it has some block errors because i was forced to do a hard reboot)
Here is the full post for this port: (i need more than 10 post to post links.......fuuu!) Google: [WIP] Ubuntu touch for OnePlus One - OnePlus Forums site:forums.oneplus.net
Did you solve the issue and if so, how?
Thanks!
I'm currently trying to get it working on Note 3 and also stuck on this problem for some days.
The built-in adbd seems to be libary shared with some android components, which of course is very uncomfortable for debugging purposes.
We exchange it with a statically linked one and load it from the data partition right after it was mounted.
Ubuntu touch initrd:
Download
Patched adbd to work outside of android environment:
Download
copy adbd to /data/debug/ on your android device
extract the initrd.img:
Code:
gzip -dc initrd.img-touch-0.83 | cpio -id
open scripts/touch and add the following on line 224:
Code:
# Mount the data partition to a temporary mount point
# FIXME: data=journal used as a workaround for bug 1387214
mount -o discard,data=journal $path /tmpmnt
# Workaround for adb
/tmpmnt/debug/adbd&
and rebuild initrd:
Code:
find ./ | cpio -H newc -o > ../initrd.cpio
gzip ../initrd.cpio
Wootever said:
I'm currently trying to get it working on Note 3 and also stuck on this problem for some days.
The built-in adbd seems to be libary shared with some android components, which of course is very uncomfortable for debugging purposes.
We exchange it with a statically linked one and load it from the data partition right after it was mounted.
Ubuntu touch initrd:
Download
Patched adbd to work outside of android environment:
Download
copy adbd to /data/debug/ on your android device
extract the initrd.img:
Code:
gzip -dc initrd.img-touch-0.83 | cpio -id
open scripts/touch and add the following on line 224:
Code:
# Mount the data partition to a temporary mount point
# FIXME: data=journal used as a workaround for bug 1387214
mount -o discard,data=journal $path /tmpmnt
# Workaround for adb
/tmpmnt/debug/adbd&
and rebuild initrd:
Code:
find ./ | cpio -H newc -o > ../initrd.cpio
gzip ../initrd.cpio
Click to expand...
Click to collapse
This doesn't work for me (Moto G)
h2o64 said:
This doesn't work for me (Moto G)
Click to expand...
Click to collapse
Hey h2o64,
I'm not really an expert, but the last heading in the Porting Guide (can't post the direct link, try porting guide ubuntu touch in u'r preferred search engine ) under Troubleshooting might work?
Sorry if this is a stupid suggestion, as i said, i don't have that much (successfull) experience in porting.
demokrit011 said:
Hey h2o64,
I'm not really an expert, but the last heading in the Porting Guide (can't post the direct link, try porting guide ubuntu touch in u'r preferred search engine ) under Troubleshooting might work?
Sorry if this is a stupid suggestion, as i said, i don't have that much (successfull) experience in porting. [emoji14]
Click to expand...
Click to collapse
I already tested it
Hi all,
I am trying to get an insecure kernel for Nexus 6, marshmallow 6.0, and I stuck at a bootloop.
The AOSP tag android-6.0.0_r1 builds without any errors. Then I flash the produced insecure boot image on a nexus 6, which had the latest 6.0 factory images.
Has anyone managed to do this procedure?
Btw, I am compiling the AOSP sources, and not the kernel sources.
In AOSP, I think, the kernel/zImage is precompiled, and the aosp build system bundles it into a boot image.
So, if someone has managed to build a working insecure boot.img from any marshmallow branch please let me know.
Or has done the same thing from kernels sources, also let me know.
EDIT:
How to compile an insecure kernel:
0. This will use the precompiled kernel found in aosp sources.
So we are not actually compiling. But this title might help some folks googling the topic.
2. modify device/<maker>/<codename>/fstab.<codename>/, and remove verify tag from system
3. make -jN bootimage
Alternatively, you can follow the procedure by ziddey, and removing the verify tag from fstab.shamu, allows the kernel to be booted!
NOTE: insecure kernel is not permissive.
How to compile a permissive kernel:
0. Now we will actually compile the kernel.
1. Download the kernel sources, and checkout the branch you want. Do these modifications.
Finally compile the kernel. (There are many tutorials for kernel compilation online)
2. copy the kernel (arch/arm/boot/zImage-dtb) to your aosp_dir/device/<maker>/<codename>-kernel/
3. Disable verification (as w/ insecure kernel)
4. make -j8 bootimage
How to compile an insecure and permissive kernel:
Not sure about this. I 'd play with configurations in aosp_dir/device/<maker>/<codename>,
or maybe try an eng build. If anyone knows just post it!
I have tried these with the kernel branch "android-msm-shamu-3.10-marshmallow-mr1",
and the aosp tag "android-6.0.1_r21".
I have also tried to unpack and repack the boot.img using unpackbootimg and mkbootimg from https://github.com/osm0sis/mkbootimg.
I have extracted ramdisk, edited the default prob, repacked ramdisk, and packed using:
Code:
mkbootimg --kernel su_boot.img-zImage --ramdisk su_boot.img-ramdisk.gz --cmdline 'console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=shamu msm_rtb.filter=0x37 ehci-hcd.park=3 utags.blkdev=/dev/block/platform/msm_sdcc.1/by-name/utags utags.backup=/dev/block/platform/msm_sdcc.1/by-name/utagsBackup coherent_pool=8M' --base 00000000 --pagesize 2048 --kernel_offset 00008000 --ramdisk_offset 02000000 --tags_offset 01e00000 --board "" -o ins_su_boot.img
Have I missed anything?
*EDIT* also tried w/ 'abootimg'. Still no luck.
Screwing around with random files found on the internet is not going to solve your problem. Use the program from *AOSP*. And make sure your parameters match (I'm not going to verify them for you). Bootloops are always cute, what did you change? Typically running make bootimg should make you a good bootimg from AOSP sources.
Well, turns out that in this case, that assumption is not correct.
The first issue is that the verity keys are not present in a custom built boot.img. At least not ones without also involving an entire system build (not that they would match the system partition that you already have).
So to solve that, edit the fstab file in the shamu device tree to remove the verify parameter from the system partition. Once that is done, it should no longer randomly reboot.
UNFORTUNATELY, that may not be enough to make the whole thing work properly still, since there appears to be some other differences between the AOSP userdebug's boot.img and the google user build. You will be able to adb in, but the android subsystem won't run.
These utilities I have used were the ones that have been successfully used to pack/unpack boot images by others. I have also done this successfully in the past, for another device running earlier versions.
Yeap. That's the problem. A kernel build from AOSP sources does not work out of the box with the rest of the system, if it is a production build. This used to work for Lollipop, but I guess they tighten security up.
Building zImage from kernel sources is still not a solution for me, as I can't properly pack/unpack a Marshmallow boot.img
The problem might be something very stupid, OS specific, and I don't want to waste any more time on this.
For now I will live with SuperSu and adbd insecure.
Maybe at some point I might try to remove the verification to see whether the rest of the stuff play nicely.
Thanks for your time!
[edit]
Answer is root. http://forum.xda-developers.com/showpost.php?p=64110288&postcount=1283
[/edit]
I spent a while tonight trying to figure this out as well. Simply dumping boot.img and recreating it works fine. But something goes wrong when unpacking/repacking the ramdisk. Stripping bootsize from bootimg.cfg so abootimg recalculates it doesn't help.
1. I did find that mkboot "works": https://github.com/ModdingMyMind/mkbootimg_tools
Simply run `mkboot boot.img boot` to dump to dir boot. Make changes to ramdisk, and then run `mkboot boot newboot.img` to create a new image. However, for whatever reason, this causes at least one issue for me. The sbin dir, despite being 755 in the ramdisk is 750 again in Android. Not sure what's going on here since I can redump newboot.img and confirm that sbin is 755.
2. I looked at seSuperuser/super-bootimg and found https://github.com/seSuperuser/super-bootimg/blob/master/scripts/bootimg.sh
The relevant part is in doneBootImgEdit(). Looking at the comments, Husson found that appending the changes to the inflated ramdisk cpio and then deflating it works. I just tested this and indeed it does work.
Husson only appends new/changed files; as a test, I tried appending the entire new ramdisk onto the old one, and sure enough, it bugs out again. Will have to investigate why this happening later, but for now, this is good enough.
As well, abootimg also comes with the tools abootimg-pack-initrd and aboot-unpack-initrd, which takes care of gzip/cpio. Of course, since the packing part doesn't work, we can't use it.
So, here's an example. Say you want to change fstab.shamu (to remove /system verification and/or /data forced encryption):
Code:
# extract boot.img
abootimg -x boot.img
# unpack the extracted initrd.img to ramdisk dir
abootimg-unpack-initrd
cd ramdisk
# make your changes to ramdisk/fstab.shamu here....
echo fstab.shamu | cpio -o -H newc > ../initrd2
cd ..
# inflate initrd.img
cp initrd.img initrd.gz
gunzip initrd.gz
# append and create new initrd.img
cat initrd initrd2 |gzip -9 -c > newinitrd.img
# strip bootsize from bootimg.cfg
sed 1d bootimg.cfg > newbootimg.cfg
# create new boot.img
abootimg --create newboot.img -f newbootimg.cfg -k zImage -r newinitrd.img
newboot.img should be a working boot image. If modifying multiple files, it may be easiest to create a different dir with those files and use find . |cpio -o -H newc > ../initrd2
Hope this helps. And if anyone can explain why this is necessary / how to recreate initrd from scratch, I can continue being lazy.
Thanks @phhusson
[edit]
Damn. I tried applying a different init file and it ate ****.
[/edit]
ziddey said:
I spent a while tonight trying to figure this out as well. Simply dumping boot.img and recreating it works fine. But something goes wrong when unpacking/repacking the ramdisk. Stripping bootsize from bootimg.cfg so abootimg recalculates it doesn't help.
1. I did find that mkboot "works": https://github.com/ModdingMyMind/mkbootimg_tools
Simply run `mkboot boot.img boot` to dump to dir boot. Make changes to ramdisk, and then run `mkboot boot newboot.img` to create a new image. However, for whatever reason, this causes at least one issue for me. The sbin dir, despite being 755 in the ramdisk is 750 again in Android. Not sure what's going on here since I can redump newboot.img and confirm that sbin is 755.
2. I looked at seSuperuser/super-bootimg and found https://github.com/seSuperuser/super-bootimg/blob/master/scripts/bootimg.sh
The relevant part is in doneBootImgEdit(). Looking at the comments, Husson found that appending the changes to the inflated ramdisk cpio and then deflating it works. I just tested this and indeed it does work.
Husson only appends new/changed files; as a test, I tried appending the entire new ramdisk onto the old one, and sure enough, it bugs out again. Will have to investigate why this happening later, but for now, this is good enough.
As well, abootimg also comes with the tools abootimg-pack-initrd and aboot-unpack-initrd, which takes care of gzip/cpio. Of course, since the packing part doesn't work, we can't use it.
So, here's an example. Say you want to change fstab.shamu (to remove /system verification and/or /data forced encryption):
Code:
# extract boot.img
abootimg -x boot.img
# unpack the extracted initrd.img to ramdisk dir
abootimg-unpack-initrd
cd ramdisk
# make your changes to ramdisk/fstab.shamu here....
echo fstab.shamu | cpio -o -H newc > ../initrd2
cd ..
# inflate initrd.img
cp initrd.img initrd.gz
gunzip initrd.gz
# append and create new initrd.img
cat initrd initrd2 |gzip -9 -c > newinitrd.img
# strip bootsize from bootimg.cfg
sed 1d bootimg.cfg > newbootimg.cfg
# create new boot.img
abootimg --create newboot.img -f newbootimg.cfg -k zImage -r newinitrd.img
newboot.img should be a working boot image. If modifying multiple files, it may be easiest to create a different dir with those files and use find . |cpio -o -H newc > ../initrd2
Hope this helps. And if anyone can explain why this is necessary / how to recreate initrd from scratch, I can continue being lazy.
Thanks @phhusson
[edit]
Damn. I tried applying a different init file and it ate ****.
[/edit]
Click to expand...
Click to collapse
My guess, and the reason why I tried appending without further thinking, is that the new initramfs files contains SELinux labels, which standard GNU/Linux cpio tool doesn't support.
One would have to investigate the changes in mkbootfs done recently.
Also, I guess mkboot is using Android's mkbootfs, which forces the permissions by itself I think.
Though the fact that extracting back give the result you expected is weird.
In super-bootimg I chose to change init.rc to chmod /sbin
Wow. http://forum.xda-developers.com/showpost.php?p=64110288&postcount=1283
Just tested and sure enough, everything is working.
Thanks @shoey63
Hopefully a final update:
The difference is in ownership. Unpacking (cpio -i) as a regular user will not preserve the ownership. However, repacking (cpio -o) does.
To repack, add -R 0.0 to cpio (i.e. --owner root.root).
e.g.
Code:
find . |cpio -o -H newc -R 0.0 | gzip -9 > ../newinitrd.img
I just tested and this works just fine without being root.
ziddey said:
Hopefully a final update:
The difference is in ownership. Unpacking (cpio -i) as a regular user will not preserve the ownership. However, repacking (cpio -o) does.
To repack, add -R 0.0 to cpio (i.e. --owner root.root).
e.g.
Code:
find . |cpio -o -H newc -R 0.0 | gzip -9 > ../newinitrd.img
I just tested and this works just fine without being root.
Click to expand...
Click to collapse
Erf that's weird, I'm pretty sure I always ran the script as root...
Anyway, thanks for the info! I'll probably update my scripts with it
I just wanted to post that using root to extract the cpio file fixed the boot failure for me on my Nexus 9 with 6.0.1. You also need to use root to find the files and create the cpio file because some files are only accessible by root of course. I guess that should have been obvious (usually needed for /dev nodes) as @phhusson said, but this time I didn't do that until reading here.
To unpack the boot.img file I used: https://github.com/osm0sis/mkbootimg.git
To pack the boot.img file I used: https://android.googlesource.com/platform/system/core/+/master/mkbootimg
I'm not sure you need the official google packer, but I just happened to use when it worked.
EDIT: I needed to update boot.img and I tried it using the osm0sis packer and it worked.
Hey guys. Thanks for the replies!
I needed a permissive kernel this time, and I have played around with the sources and your recommendations and got it working. :good:
The post by ziddey might be the easiest way to make any kernel bootable, by disabling the verification from fstab.
(and uses just one packing/unpacking tool)
You can do the same thing from sources, again by modifying the fstab on aosp.
You can build an insecure kernel by using the pre-built kernel (is aosp),
or compile and then pack a permissive one.
This procedure wasn't working for me back then when I tried it (hence this thread). I am not sure if it was my fault or the initial marshmallow release had differences from the sources. More info on the first post.