[UTIL] Kexecboot Bootloader for Galaxy Note i717 - Boot Multiple Kernels

Search This thread

CalcProgrammer1

Senior Member
Oct 8, 2007
650
756
Kansas City
I finally figured out how to properly reset the phone! No more waiting 30+ seconds for the watchdog timer to throw the reset switch now. It reboots almost instantly after hitting the go button. Uploading the changes to the kernel and will post a new build soon.

Edit: New build up, and I fixed the broken colors as well!
 
Last edited:
  • Like
Reactions: JamieD81

JamieD81

Senior Member
Nov 11, 2009
4,204
8,144
Duncan
I finally figured out how to properly reset the phone! No more waiting 30+ seconds for the watchdog timer to throw the reset switch now. It reboots almost instantly after hitting the go button. Uploading the changes to the kernel and will post a new build soon.

Edit: New build up, and I fixed the broken colors as well!

I should dust off the i717 and try her out. Now that kexec is working perhaps multirom is in order.. :)
 

CalcProgrammer1

Senior Member
Oct 8, 2007
650
756
Kansas City
I've never used multirom before but I'd be interested to see it if you do get a port going. I think the kernel changes were just getting hardboot implemented so you should be able to build off of my kernel. I'm mainly focusing on kexec-hardboot on the Note 3 now, was mostly using the Note as a learning platform before going for the Note 3. It would be nice to main CM but have a tiny TW partition just to use the TW camera and such, but I don't really have the Android knowledge to make this work (I mainly focus on non-Android Linux stuff).
 

dparrothead1

Senior Member
Mar 13, 2011
2,570
1,801
Florida
I've never used multirom before but I'd be interested to see it if you do get a port going. I think the kernel changes were just getting hardboot implemented so you should be able to build off of my kernel. I'm mainly focusing on kexec-hardboot on the Note 3 now, was mostly using the Note as a learning platform before going for the Note 3. It would be nice to main CM but have a tiny TW partition just to use the TW camera and such, but I don't really have the Android knowledge to make this work (I mainly focus on non-Android Linux stuff).

If anyone can do it, Jamie can!

Sent from my SM-T310 using XDA Premium 4 mobile app
 
I finally figured out how to properly reset the phone! No more waiting 30+ seconds for the watchdog timer to throw the reset switch now. It reboots almost instantly after hitting the go button. Uploading the changes to the kernel and will post a new build soon.

Edit: New build up, and I fixed the broken colors as well!

"Folder links are not yet supported". Did you link directly to the file for install?
Edit: Only asking as I can't seem to download the build. ;)

Sent from my SAMSUNG-SGH-I717
 
Last edited:
Huh? I linked to a MEGA folder. I can view it just fine...are you using a weird mobile version or something? Try opening the page in a desktop browser.

Using the MEGA app as all my browsers will kick me to use the app and won't let me access mega directly. I can't remember if I tried changing the user agent. I'll try that or use my desktop as you have suggested. Thanks for getting back. Just thought it strange that I couldn't download a mobile support file from my mobile device. ;) First time I've run into this issue.

Sent from my SAMSUNG-SGH-I717
 

CalcProgrammer1

Senior Member
Oct 8, 2007
650
756
Kansas City
I use MEGA because Dropbox banned my sharing permission because I had too many downloads. My early CM11 builds for the Note 3 were really popular before the official nightlies started :) MEGA doesn't seem to have that limitation.
 
  • Like
Reactions: developweb
I use MEGA because Dropbox banned my sharing permission because I had too many downloads. My early CM11 builds for the Note 3 were really popular before the official nightlies started :) MEGA doesn't seem to have that limitation.

No worries. Fired up the old PC and was able to download. Now I'll have to read your instructions on execution to try it out. I did try changing the user agent on my phone browsers but all downloads were still unsuccessfull.(They'd give me strange file names and queued download messages and unsuccessful download). Thanks again.

Edit: I've flashed Kexecboot to check out the interface was working and it worked like a charm. So now to the little bit of work on my part. I booted to my ArchLinux usb key on an old pc and installed abootimg to extract the files required from my desired kernel. Thank goodness it was in the AUR as I didn't want to do a whole new Arch build (Rolling distros are a real piece of work if you don't update regularly LOL). Worked like a charm. Now to see if my boot.cfg file works. I'll let you know how things go. If I can get things like this to work, I'm sure anyone visiting this forum will be able to.
 
Last edited:
  • Like
Reactions: CalcProgrammer1

Top Liked Posts

  • There are no posts matching your filters.
  • 20
    Well, it only took 2 years lol!

    What is Kexec?

    Kexec (kernel-execute) is a function of the Linux kernel that allows it to act as a bootloader to boot other kernels. Unfortunately, the standard implementation of kexec doesn't work quite right on most ARM devices due to poor driver support for hardware resets. The workaround is kexec-hardboot, a patch set that allows a kernel to be staged in RAM before performing an actual hardware reset through the phone's bootloader. Upon reboot the kexec-supporting kernel will check the magic location in RAM to see if a previously stored kernel is available, and if so, it will transfer execution to that kernel instead of booting itself.

    Why use Kexec

    It's a second-stage bootloader. The standard Android bootloader only allows two kernels to be installed at once - boot and recovery. This means that if you want a working recovery, you're only allowed one real OS kernel. If you want to dual-boot (or tri-boot or more) you're screwed. Kexec provides an answer to this. By replacing the boot kernel, kexec (with the kexecboot GUI) acts as a "second stage bootloader" allowing you to boot any number of kernels from any available storage devices. For instance, you have kexecboot in your boot partition and you can keep a kernel for Android installed in your Android system partition as well as an Ubuntu kernel and root filesystem on your SD card and be able to switch between Android and Ubuntu at boot time.

    What is kexecboot

    http://imgur.com/4GYomKX

    Kexecboot is a graphical front-end for kexec. I have modified it to work with the kexec-hardboot patches. It scans all available storage devices for a boot.cfg file in which you define kernels, ramdisks, and kernel commandlines. You control it using volume up and down to move cursor, power to select.

    Download

    Get it here: https://mega.co.nz/#F!0ct3EaTD!wHWnGo1M_2smyKdzGMIYmw

    The code

    Kernel builder: https://github.com/CalcProgrammer1/kernel_quincyatt_kexec

    This repository contains all the things you need to build a flashable kexecboot/kexec-hardboot enabled kernel image. It contains the ramdisk with the kexecboot binary and a script to package a flashable zip file. Included as submodules are the kernel source itself (kexec-hardboot branch, required to build the image) and the kexecboot source (optional, not used by default as you must build it using an ARM system, a pre-built binary is included if you don't want to build your own). The kernel source includes a defconfig called kexec_quincyatt_defconfig that sets the required config options for building a kexec-hardboot kernel.

    Kexecboot Configuration File

    Kexecboot replaces your boot kernel, so when you power up your phone it will go straight to the Kexecboot screen. The issue is now to provide kernels for kexecboot to boot into. This requires some work on your part, as you will have to store the kernel files (zImage and initrd) in a partition and write a configuration file to tell kexecboot where they are. This configuration file may contain multiple kernels, allowing you to have several different kernels available for the same OS or multiple OSes entirely. If you're coming from an Android system that distributes their kernel as a boot.img, you can use the abootimg program to extract it into a separate zImage and initrd.img binary.

    The configuration file must be located on the path /boot/boot.cfg. This is relative to whatever partition/disk you are on, so for instance if you're setting up Android to boot from kexecboot, you would put your configuration file in /system/boot/boot.cfg (/data/boot/boot.cfg would work as well). You can also put a boot.cfg file on your SD card as long as you follow the /boot/boot.cfg path. Kexecboot automatically scans all available partitions for a boot.cfg file before it starts and builds a list of all available kernels across all detected boot.cfg files, so you may have Android in your /system partition and Debian on your SD card and both kernel lists will be shown together.

    The Kexecboot web site provides a nice tutorial: http://kexecboot.org/documentation/how_to_write_config

    The Note i717 bootloader passes a fairly long string of kernel arguments to the boot kernel. Since kexecboot overrides this for the kexec-booted kernel, you must provide this boot string in your boot.cfg file. Additionally, you may edit or add arguments to the command string here (such as setting console=tty0 instead of the default console=null so you can use the framebuffer console).

    For example, here is my /system/boot/boot.cfg for CyanogenMod 11 (with kernel and initrd.img, extracted via abootimg, in /system/boot/)

    Code:
    # kexecboot configuration file
    
    # CM11 default kernel
    LABEL=CyanogenMod 11
    KERNEL=/boot/zImage
    INITRD=/boot/initrd.img
    APPEND="androidboot.hardware=qcom usb_id_pin_rework=true no_console_suspend=true zcache sec_log=0x80000@0x40270008 sec_dbg=0x100000@0x402f000c sec_debug.reset_reason=0x1a2b3c00 pmem_sf_addr=0x7a000000 pmem_sf_size=0x6000000 console=null sec_debug.enable=0 sec_debug.enable_user=0 appsbark=0 msm_watchdog.enable=1 msm_watchdog.bark_time=30 msm_watchdog.bite_time=31 vmalloc=512m hw_rev=12 lpj=67702 androidboot.emmc=true androidboot.serialno=32c245ca androidboot.baseband=csfb"

    I'm not sure how much of that you actually need, but you do need at least some of it because with an empty APPEND= it does not boot. You also do have to put the quotation marks around it or else parsing of one of the options will fail.
    4
    I finally figured out how to properly reset the phone! No more waiting 30+ seconds for the watchdog timer to throw the reset switch now. It reboots almost instantly after hitting the go button. Uploading the changes to the kernel and will post a new build soon.

    Edit: New build up, and I fixed the broken colors as well!

    I should dust off the i717 and try her out. Now that kexec is working perhaps multirom is in order.. :)
    4
    Kexec is actually (if done right) a good way *not* to brick your phone. To run kernels, you usually have to flash them to a restricted boot section of the memory, and if you flash all non-working kernels (to download, recovery, and main) then you have no way to use your phone, as it won't boot up. If you use kexec, your working kernel is safely stored on the boot partition and your development kernels can be wherever, and if it doesn't boot you can just hold down POWER to hard reboot into your good kernel.

    The problem is that it doesn't seem to be working, I think I have the kexec support built properly but haven't been able to boot any kernels without it crashing.
    3
    So I'm still confused as to why my kexec didn't work. I'm going to build a TouchPad kernel with it enabled and repeat the test on it, since I have a known-good kernel to boot against. I'll let you know how that goes.

    Sent from my SAMSUNG-SGH-I717
    3
    Ok, so long-time-no-see but I'm reviving this post! Now that my Note 3 is happily running Cyanogenmod I have no urgent need for my Note 1 and can hack on it!

    So far I haven't gotten kexec working, but I do have:

    1. Kexecboot (graphical kexec frontend) is working, detects OS images appropriately

    2. Framebuffer Console (text-mode display, USB OTG keyboard supported for interactive command line)

    3. Overriding bootloader command line (to enable the fbconsole you need console=tty1 but the bootloader passes console=null)

    4. Framebuffer console rotation (boot up in landscape or portrait, no way to switch without recompiling at the moment)

    5. Most of kexec-hardboot ported from the HP TouchPad port, no clue if it's promising or not as so far it just crashes after a while of nothing

    6. Ubuntu 13.04 (desktop edition) rootfs installed on SD card in a chroot, also taken from HP TouchPad

    What I'm working on:

    1. Kexec-hardboot port (needed to use kexec properly and boot kernels)

    2. Fixing fbconsole glitching (framebuffer console displays garbled text that slowly clears up, no clue why...reading /dev/fb0 repeatedly clears up the display immediately and is a dirty hack that works well enough for testing)

    3. Networking (either USB Ethernet or integrated WiFi, going to try backported brcmfmac driver)

    4. Ubuntu (that's the long-term plan here)

    5. Note 3 S800 port if I get everything figured out here