Android kernel booting
#1
I am extracting boot img from partition 9 of the sdcard, extracted it and indicated the ramdisk to load /sbin/init from main partition.
I repackaged it, dd'd to the partition again and booted, but it boots flawlessly again. No need to say that i was expecting to see a panic on the serial console, because /sbin/init doesnt exist.

Can anyone confirm that the main kernel is on sdX9 of the sdcard? Or is it the recover partition?
Or maybe it boots from recover whenever an error arises?

I already got a debootstrapped linux ready to copy, but i was expecting to have this ready before...

Thanks in advance.
Drag00n
#2
I think that's recovery. Try sdX6.

I got the android kernel to boot Ubuntu 14.04, but only serial console for now. The disp and hdmi modules load, but my monitor doesn't detect a signal.
#3
Thanks, I'll try later and will post some info...
#4
Yep, indeed... Partition 9 was recover... I missed the bootargs .
So the good one is sdX6

partitions=bootloader@mmcblk0p2:env@mmcblk0p5:boot@mmcblk0p6Confusedystem@mmcblk0p7:misc@mmcblk0p8:recovery@mmcblk0p9:cache@mmcblk0p10:metadata@mmcblk0p11:private@mmcblk0p12:alog@mmcblk0p13:UDISK@mmcblk0p1

Also i had to edit to enforcing=0 as my debootstrapped jessie had no selinux... I'll post any advance just in case anyone cares
#5
(02-14-2016, 03:45 AM)drag00n Wrote: Yep, indeed... Partition 9 was recover... I missed the bootargs .
So the good one is sdX6

partitions=bootloader@mmcblk0p2:env@mmcblk0p5:boot@mmcblk0p6Confusedystem@mmcblk0p7:misc@mmcblk0p8:recovery@mmcblk0p9:cache@mmcblk0p10:metadata@mmcblk0p11:private@mmcblk0p12:alog@mmcblk0p13:UDISK@mmcblk0p1

Also i had to edit to enforcing=0 as my debootstrapped jessie had no selinux... I'll post any advance just in case anyone cares
Where are the bootargs stored?

EDIT: never mind; I found them in partition 5. Looks like this has a header and checksum.
#6
Yes, part5, but no cksums... I hex edited it and worked

Well, my box works with 3.10... I have to test hdmi, WiFi and so... Tty stops working but i have no inittab so ill add it to rc.local until i realize a way to do it properly with systemd, so new to me...eth100 working, later ill try to use 1000 but should be the same.
Also surprised with temperature... Android burned my finger when idle, and with linux i can barely tell if it is powered on...

Talk later..
Drag00n
#7
(02-14-2016, 12:51 PM)drag00n Wrote: Yes, part5, but no cksums... I hex edited it and worked

Well, my box works with 3.10... I have to test hdmi, WiFi and so... Tty stops working but i have no inittab so ill add it to rc.local until i realize a way to do it properly with systemd, so new to me...eth100 working, later ill try to use 1000 but should be the same.
Also surprised with temperature... Android burned my finger when idle, and with linux i can barely tell if it is powered on...

Talk later..
Drag00n

I think you might notice that the environment has reset to the default one rather than taking it from partition 5 after you modified it.  Are you getting the uboot countdown from 3 now?  bootdelay is set to 0 in the environment on the SD partition, which disables it.
#8
(02-14-2016, 03:32 PM)patrickhwood Wrote:
(02-14-2016, 12:51 PM)drag00n Wrote: Yes, part5, but no cksums... I hex edited it and worked

Well, my box works with 3.10... I have to test hdmi, WiFi and so... Tty stops working but i have no inittab so ill add it to rc.local until i realize a way to do it properly with systemd, so new to me...eth100 working, later ill try to use 1000 but should be the same.
Also surprised with temperature... Android burned my finger when idle, and with linux i can barely tell if it is powered on...

Talk later..
Drag00n

I think you might notice that the environment has reset to the default one rather than taking it from partition 5 after you modified it.  Are you getting the uboot countdown from 3 now?  bootdelay is set to 0 in the environment on the SD partition, which disables it.

Oh my, you're totally right...

I missed the line:
*** Warning - bad CRC, using default environment

So I got very lucky that default goes with selinux disabled...

And yes, now I can enter sunxi prompt from u-boot. (before I was thinking I was too slow to hit anything...)

Sorry, but I'm relatively new to ARM devices and bootloaders, be patient with me Wink

Thanks for the point.

drag00n

PS: Can I find somewhere good info about how u-boot works? I am totally blind about it and would like to know more...
#9
See http://www.denx.de/wiki/U-Boot

Note that the android uboot is a little different than the mainline, and Allwinner's a bit different from the android one.

To update the environment, there's a tool that comes with uboot called mkenvimage. It's built as part of uboot in tools/mkenvimage. Just create an ascii file with key=value settings, one per line, and do

mkenvimage -s 131072 u-boot.env.txt -o /dev/sdb5
#10
I'll take a look. Thanks!!!


Possibly Related Threads…
Thread Author Replies Views Last Post
  PineA64+: Audio in 5.0 Kernel puzzles 6 4,524 11-13-2019, 09:41 AM
Last Post: roel
  Rockpro64 NFS root mount (kernel 4.20) - ethernet help? tenspd137 0 1,616 12-06-2018, 01:14 AM
Last Post: tenspd137
  NVMe and new kernel bjbb17 0 1,412 09-25-2018, 03:39 PM
Last Post: bjbb17
  Real-time linux kernel Artyom 45 41,321 09-11-2018, 01:08 AM
Last Post: zzwpine
  DKMS on kernel 3.10.107-pine64 obrienmd 5 4,251 06-21-2018, 05:45 PM
Last Post: evilbunny
  Kernel for A64 git longsleep 179 159,148 03-25-2018, 03:25 PM
Last Post: Luke
  Gentoo for pine64 - longsleep kernel incoherent 0 2,298 12-09-2017, 08:14 AM
Last Post: incoherent
  [SOLVED] UEFI + Fedora Mainline Kernel Booting! cztian 0 2,058 07-13-2017, 08:38 PM
Last Post: cztian
  Mainline kernel [Solved] jeroen79 11 10,121 02-08-2017, 06:19 AM
Last Post: umiddelb
Question Need help : Issue in running compiled kernel with tftp+uboot dinesh.bhoyar 2 2,674 01-30-2017, 12:44 AM
Last Post: dinesh.bhoyar

Forum Jump:


Users browsing this thread: 1 Guest(s)