[UTIL] Kexecboot Bootloader for Galaxy Note i717 - Boot Multiple Kernels - AT&T Samsung Galaxy Note I717

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 [email protected] [email protected] 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.

I'll admit limited understanding of what you're accomplishing here, but seems to me that this could lead to dual booting on the Note. Nice work.
Good luck.

Nice work! Thanks for the work you've done thus far. Unfortunately I have no way to help you out other than morale support! :highfive:

lactardjosh said:
I'll admit limited understanding of what you're accomplishing here, but seems to me that this could lead to dual booting on the Note. Nice work.
Good luck.
Click to expand...
Click to collapse
Pretty much what it comes down to, testing kernels and roms without having to flash into nand. I can't wait for dualbooting from Sd on the Note.
I have ORD , please help!!

My main goal here is native Linux, but if kexec works then you can boot custom Android dev kernels, native Linux kernels, other mobile OS'es, etc. The SGSIII team seems to have found some interesting kexec solutions for the Verizon SGSIII due to its locked bootloader. They've posted a good deal of kexec patches which I'm trying to bring to the Note, including a custom kexec-hardboot option that fully reboots the device into the new kernel (apparently to make sure the radio and such are working).

CalcProgrammer1 said:
My main goal here is native Linux, but if kexec works then you can boot custom Android dev kernels, native Linux kernels, other mobile OS'es, etc. The SGSIII team seems to have found some interesting kexec solutions for the Verizon SGSIII due to its locked bootloader. They've posted a good deal of kexec patches which I'm trying to bring to the Note, including a custom kexec-hardboot option that fully reboots the device into the new kernel (apparently to make sure the radio and such are working).
Click to expand...
Click to collapse
Wonderful, wonderful work!!! :thumbup::thumbup::thumbup:
Sent from my SAMSUNG-SGH-I717 using xda premium

Uh...It all sounded like this:
dual kernel (i'm gonna brick) kexec will allow (me to brick my phone).....with native linux applications ('im gonna brick my phone cause i'm stupid)....LOL
while i know what your doing, that in no way means i will ever understand it...LOL
But i will thank you in advance for what sounds like a sick mod for our notes...
Many thanks Dev !!!!

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.

CalcProgrammer1 said:
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.
Click to expand...
Click to collapse
I know you'll crack it ....
And when you do ....you'll be the galaxy note GOD !!!....LOL
your effort is much appreciated Sir ....even if I'm scared to use it , but will anyway ...lol

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

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

CalcProgrammer1 said:
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
Click to expand...
Click to collapse
Long time in the making. Glad to see you're still at it. Hope you are able to get it working. Would be pretty cool. Good luck

If you can get this working up to kernel with freedreno I'd be all over working on getting Plasma Active onto this thing. I've missed having a real linux phone since my n900 died.

Got Bluetooth working from the command line!
Code:
# rfkill unblock all
# hciattach /dev/ttyHS0 any
# hcitool scan
It detected my Note 3 which I had set to visible! Hopefully I can pair a BT keyboard with this and lose the USB OTG dependency. Still working on figuring out WiFi, I have the brcmfmac driver from 3.13 backports compiled and loaded but the WiFi chip isn't being detected so the driver never creates an interface for it. The chip is a Broadcom BCM4330 WiFi/Bluetooth chip, and although both WiFi and Bluetooth share the same chip they use different interfaces to the SoC (UART for BT and SDIO for WiFi).
I plan on doing more research into getting the hardware working before I do any more work on kexec. It will be much easier to debug kexec I think knowing how to use WiFi/BT/USB/etc. The only hardware I'm not going to attempt at all is the modem as I don't use this device as a phone anymore and don't have a SIM card in it. That said, all the rmnetX entries that I think are modem interfaces show in ifconfig -a so maybe it is working.
My kernel source is here:
https://github.com/CalcProgrammer1/ubuntu-kernel-quincyatt
The kexec branch will have the kexec hardboot patches once I figure them out. I've also got a folder set up with a script to automatically build the kernel zImage, build the modules, build the backport driver modules, build the ramdisk from a ramdisk root folder, build the boot.img, and then package that up in a flashable .zip. I'll upload parts of this system as I complete them. I also have an Ubuntu rootfs on my external ext4 (or was it 3?) SD card that I ripped straight off my TouchPad. For now I'm just using a busybox shell in my ramdisk, dropping out of kexecboot into ash, setting up a chroot for the SD card, and chrooting into the Ubuntu rootfs that way. It's not ideal since Ubuntu's init process doesn't run but it does allow me to run all the installed utilites from said rootfs.
Edit: Rii Mini Bluetooth Keyboard paired and working! It was a roundabout way of doing so because dbus and upstart don't work in chroot so I had to use an old package called bluez-compat which provides the hidd command. I sideloaded the .deb with a flash drive. The command to pair a keyboard:
Code:
# hcitool scan
Scanning ...
XX:XX:XX:XX:XX:XX Bluetooth device name
# hidd --connect XX:XX:XX:XX:XX:XX &
XX:XX:XX:XX:XX:XX will be a hex value that is your keyboard's address. You find the address with the scan command and enter it on the hidd command to connect. I didn't have to enter any kind of passcode or pairing key, after running hidd it just started working.
http://imgur.com/2sV3TJr

I got it! I finally managed to get kexec hardboot working! I had to rewrite a bit of code in the kexecboot program to support kexec-hardboot better but I now have a bootloader that is working correctly, if slowly. I'll be posting my kernel source soon (it's a branch off of CyanogenMod's msm8660-common kernel) as well as my modifications to kexecboot itself. The kexec-tools binary I took out of the HP TouchPad port unmodified so I don't have the source for that (though it shouldn't be hard to find). I'll be looking into a Note 3 port soon, basically used the Note 1 as the guinea pig for this experiment.

If, somehow, you could adapt this for the ATT Mega 6.3 so as to bypass the locked tight bootloater.....you would be considered a hero!! People would build statues of you....write songs and name their children after you!!!!!?
Sent from my SM-T310 using XDA Premium 4 mobile app

Unfortunately you require an unlocked bootloader to install the kexecboot kernel. This isn't going to be a magic bullet for locked bootloaders. People have tried. For devices with exploitable bootloaders, it may help as you won't have to fake-sign kexec-booted kernels though.

CalcProgrammer1 said:
Unfortunately you require an unlocked bootloader to install the kexecboot kernel. This isn't going to be a magic bullet for locked bootloaders. People have tried. For devices with exploitable bootloaders, it may help as you won't have to fake-sign kexec-booted kernels though.
Click to expand...
Click to collapse
Grasping at straws, My Friend. Hoping that maybe this could be something like SafeStrap and could be d/l and installed as an APK.
Sent from my SAMSUNG-SGH-I527 using XDA Premium 4 mobile app

Got Debian booting! I also figured out how to get WiFi working from a non-Android Linux OS so this is definitely on track towards a full desktop OS!
To-do:
* X server, preferably with Freedreno GPU driver eventually
* Audio (q6.* firmware files and possibly an ALSA config)
* Startup scripts for Bluetooth initialization
* Figure out how to rotate the screen

dparrothead1 said:
If, somehow, you could adapt this for the ATT Mega 6.3 so as to bypass the locked tight bootloater.....you would be considered a hero!! People would build statues of you....write songs and name their children after you!!!!!?
Sent from my SM-T310 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
I wont be having anymore children to name, but I can do a dog. He is too stoopid to know the difference. I can say aluminum foil and he will come running.
Sent from my SAMSUNG-SGH-I527 using XDA Free mobile app

Related

[DEV] Ubuntu 11.10 for A43/A101 [RELEASE 1]

Last summer I got Ubuntu 11.04 working on my A43 but didn't post anything about it. With the progress made on kexec and the new kboot bootloader, it is now possible to have multiple kernels for multiple OS'es. This means it just got a whole lot easier to boot Ubuntu without losing the ability to run OpenAOS or UrukDroid Android OS'es.
As far as I'm aware, Ubuntu doesn't work on the 2.6.29-omap1 kernel that Archos uses and is the base for most other development on gen8. However, for A43 and A101 users, OpenAOS member Nicktime made some headway in porting the 2.6.37+ kernel to gen8, but appears to have abandoned the project. I've cloned his repository and have been working to add features that he did not finish implementing. However, his kernel did have the ability to boot an Ubuntu rootfs and it works very well for desktop Linux distributions (this also works on Debian and I would assume other ARM distros as well).
As I have been unable to build an Ubuntu 11.10 rootfs using the rootstock method that Ubuntu describes here, I've started working with the HP TouchPadBuntu rootfs from this thread. This rootfs boots well on my TouchPad and I've removed the TP-specific items from it and added the gen8 items as necessary. The display is working and the touchscreen works as well (calibrated correctly as I copied my calibration from my 11.04 install). It boots into Unity 2D which is the default. I'm having issues getting the wl1271 wireless module up, I have had it running once but NetworkManager said device was not ready despite being able to iwlist scan and see a list of AP's and then connect to them manually.
RELEASE 1
You will need the rootfs and the modifications.
To install, mount your destination partition (should be at least 4GB and ext3 formatted) to a location, then run the following:
Code:
cd /media/UbuntuPartition (change this to wherever your Ubuntu partition is mounted)
tar xzf /path/to/TouchPadBuntuRootfs.tgz ./
tar xzf /path/to/Gen8Modifications.tar.gz ./
If you do not have a microSD card in the slot, you need to edit the file etc/fstab and change anything mmcblk1 to mmcblk0, this is because the SD card will identify as mmcblk0 if it exists, but if it does not exist then the internal storage gets identified as mmcblk0 instead. This is a kernel issue I have yet to find a solution to.
Kernels for Release 1
These boot from partition 3 of internal memory (/dev/mmcblk2p3)
Normal and Rotated 90 Degrees
This boots from partition 1 of external sdcard (/dev/mmcblk0p1)
Normal
These files do not need an initramfs, but to flash to device or to use with kboot you need one anyways. Simply create an empty (0 byte) file named 'initramfs.cpio.gz' and use it for this purpose.
INFO ON KERNEL MMC/SD INITIALIZATION
mmc0 (mmcblk0pX) - Micro SD card
mmc1 (mmcblk1pX, mmcblk2pX) - System and Data blocks of internal memory
mmc2 - wl1271 SDIO interface
I installed the rootfs to an 8GB microSD and boot it using root=/dev/mmcblk0p1 on the kernel command line.
USEFUL LINKS
http://dev.openaos.org/wiki/Gen8Linux2.6.37
https://github.com/CalcProgrammer1/archos-gen8-kernel-2.6.37
http://forum.xda-developers.com/showthread.php?t=1304475
http://www.omappedia.org/wiki/OMAP_WiLink_Connectivity_Home
http://www.omappedia.org/wiki/MAC802.11_based_Wilink
TIPS AND TRICKS
Disk Usage Power LED:
It is possible to make the Power LED function as a disk usage LED. This will let you know when the system is reading or writing to the memory and can be incredibly helpful in determining whether your system has locked up or is just being slow.
Simply write "mmc0" or "mmc1" (depending on what interface you wish to monitor) to:
/sys/class/leds/power/trigger (maybe power_led can't remember)
This can be changed in the kernel source in the file "archos-leds.c" as well if you want it to apply during boot time.
Charging the battery on A43:
(as root)
echo 1 > /sys/devices/platform/battery/usb_online
echo 3 > /sys/devices/platform/battery/charge_level
Enabling WiFi:
The wl1271 driver from linux-wireless requires firmware files to be placed in /lib/firmware. These files can be downloaded from here. The MAC address on the wl1271 is not stored on the actual wireless chip and instead resides in a configuration file on the system data directory in a file called system/persist.archos.WIFI_mac. This file is in the form:
Code:
Wifi MAC XX:XX:XX:XX:XX:XX
To extract just the MAC address, use
Code:
cut -f3 -d" " /media/data/system/persist.archos.WIFI_mac
Then, to set the MAC of the actual device you can do
Code:
ifconfig wlan0 hw ether `cut -f3 -d" " /media/data/system/persist.archos.WIFI_mac
ifconfig wlan0 up
I'm doing this in /etc/rc.local which is run on boot. This means the WiFi card is prepared when the system boots. However, NetworkManager still sees the card as "not ready" and you must Disable Networking and then Enable Networking before it will start showing AP's. After doing this, the WiFi works properly.
Screen Rotation:
The A43's display is 480x854 ("tall screen" orientation). For Ubuntu it is likely more useful to have a widescreen 854x480 orientation. Fortunately, this is not hard. It involves adding two parameters to your kernel's command line (either via kboot or by adding them to .config and recompiling your kernel). THIS DOES NOT ROTATE THE TOUCHSCREEN INPUT, so make sure you have an alternate input device when using rotation (BT keyboard/mouse, USB keyboard/mouse).
Code:
omapfb.vrfb=y omapfb.rotate=1
Enabling Audio:
This is pretty easy. Audio is installed and ready to go, the only issue is that the default settings in the mixer for this chip happen to disable the output entirely. To fix this, open ALSA Mixer (alsamixer) and turn on either speakers or headphones, then turn on Left Mixer and Right Mixer (hit 'M' to unmute/mute a channel). Finally, turn up the 'PCM' volume and start playing music. I recommend getting rid of Pulse Audio, but I'm still trying to figure out the best way to do so as it uses a lot of resources and provides little benefit.
PowerVR SGX 530 GPU:
The OMAP 3630 CPU has an on-board PowerVR SGX 530 graphics processor. TI provides an SDK that contains the userspace driver libraries as well as the open-source kernel drivers. There are three modules that must be built (pvrsrvkm.ko, omaplfb.ko, bufferclass_ti.ko) and loaded into the system. Then the userspace stuff must be installed. There is information here that should help. So far I've got the drivers to compile, but they aren't properly loading yet. More work to be done on getting the modules to work.
RC.LOCAL START-UP SCRIPT
This script should enable everything at boot time and should make Ubuntu easier to use on gen8 tablets. It starts WiFi and Bluetooth as well as enables USB charging.
Code:
#!/bin/sh -e
#
# rc.local
#
#MAC_ADDRESS='00:22:33:44:55:66'
MAC_ADDRESS=`cut -f3 -d" " /media/data/system/persist.archos.WIFI_mac`
ifconfig wlan0 hw ether $MAC_ADDRESS
ifconfig wlan0 up
modprobe btwilink
sleep 10
hciattach /dev/ttyS0 texas 3000000
/etc/init.d/network-manager restart
echo 1 > /sys/devices/platform/battery/usb_online
echo 3 > /sys/devices/platform/battery/charge_level
exit 0
You must have /media/data mounted in your /etc/fstab file, the entry should look like this:
Code:
/dev/mmcblk1p4 /media/data ext3 defaults 0 0
If this entry isn't in /etc/fstab, the /media/data partition will not be available at the time rc.local is run, and it will fail trying to read the MAC address. Alternatively, you can uncomment the hard-coded MAC address and use that but it's not as clean.
First off, Thanks for the effort you've put in, I just cant wait to get this up and running on my 101. Hopefully I'll have some time this weekend to sort it out but I've questions, How well does it perform? Is unity actually working? & have you tried any other distros? The reason i ask is because i was gonna buy a linux tab running plasma active but if i could eventually run it reasonably well on my 101 i'd hold out and save a couple.
Cheers again and nice work.
It runs fairly well. Unity works (2D only at the moment, not 3D), but whether that's a good thing or not I'll leave up to you (personally I don't like the Unity interface at all, and I find it slow when in 2D mode). I have GNOME 3.0 Fallback installed which runs pretty smooth and fast as it is fairly lightweight. You can use any non-3D-accelerated interface at the moment (Xfce, fluxbox, LXDE, MATE/GNOME2, etc). I've heard of people running plasma active on other non-accelerated systems (including the HP TouchPad, which is where I got my starting image). I haven't bothered as I prefer a traditional desktop-style interface.
That said, if you're willing to test I'd love feedback on how this performs on A101. I don't have an A101 and I am not sure of the status of A101 support. I'm taking Nicktime's word for it that the kernel supports A101. The actual Ubuntu image should be pretty independent of the device but the kernel needs to specifically support each individual board.
To start I'd just download the TouchPadBuntu rootfs I posted (which despite its name doesn't have anything TouchPad related in it and should at very least boot to login screen on the Archos 2.6.37 kernel without modifications). I'll hopefully get a package of modifications up soon including drivers for WiFi, Bluetooth, and a script to get everything running properly at boot.
As for 3D acceleration, I think it should be possible. There are apparently user-space drivers for OMAP3 that will work under Ubuntu. The bigger issue is getting a version of Compiz/Unity3D/Gnome Shell/whatever accelerated desktop you prefer that is compile for OpenGL ES.
Hey dude, could you give me some instructions as to how you installed the roofs.tgz to the memory card? I've got the new boot loader installed and I'm mad to get this going this weekend. Cheers in advance.
P.s. if there is a link to a tut for it that'd be excellent because I don't mind searching for myself just couldn't find any info on it. Thanks.
EDIT:
First post updated, see it for full installation details and feel free to post any questions or problems you have during or after installation. I really want to know how well this plays on A101 devices, as I don't have one to test with. Also, anyone with kernel experience that wants to take on adding additional devices, go for it! It would be great to get A70 support at least, as that is a popular device that has seen Debian/Angstrom activity in the past.
I tar'd the files to the sdcard, created a folder inside OS called ubuntu and placed the zimage & intramfs inside but it wont boot? I probably missed something so feel free to tear me one .
Wasn't even thinking...Duh...the kernels provided assume the root device is /dev/mmcblk2p3 (my Ubuntu partition on internal SD card). You probably want /dev/mmcblk0p1 (first partition on external SD card). I'll build a new kernel and post it soon, or you can take a shot at compiling your own kernel (my GitHub sources need work, for now I'd go with Nicktime's sources at Gitorious as I realized I broke some things).
Kboot should have a cmdline option where you can specify a kernel command line (and thus a root device) but I couldn't get it to work. To clarify, you ARE seeing the kernel boot messages right? If you aren't then kboot probably isn't set up correctly. Try booting another kernel (such as OpenAOS boot menu) from kboot and see if that works.
EDIT: here
CalcProgrammer1 said:
As for 3D acceleration, I think it should be possible. There are apparently user-space drivers for OMAP3 that will work under Ubuntu. The bigger issue is getting a version of Compiz/Unity3D/Gnome Shell/whatever accelerated desktop you prefer that is compile for OpenGL ES.
Click to expand...
Click to collapse
I know they
http://www.linaro.org/
are working on the Open GL ES port of Unity 3D.
Maybe u can find some sources there
And KDE should also have a builf of KDE Plasma wiht OpenGL ES.
Maybe you could add it? would be awesome.
Archos 70
Does/Will this work on the Archos 70? I'm trying to get it working but all I'm getting is static on my screen when Kboot tries to boot Ubuntu. This could be my fault and I could have just messed up the installation but I don't think so.
Thoughts?
shrewdlove said:
Does/Will this work on the Archos 70? I'm trying to get it working but all I'm getting is static on my screen when Kboot tries to boot Ubuntu. This could be my fault and I could have just messed up the installation but I don't think so.
Thoughts?
Click to expand...
Click to collapse
If you read the first post, you will see that this currently only works with A43 and A101. This is due to the kernel I'm using, which was ported by an OpenAOS user who hasn't been active in 6 months. Chances of him resuming his project are slim, so I've forked his kernel progress but don't have an A70 to work with. I could attempt to add A70 support to the kernel but I would be blind to the progress and would need testers. There aren't a ton of changes necessary, mainly just need to add the right LCD driver to make the screen work and then update the board file with the changes that have been made to the A43/A101 boards.
Unfortunately, I don't have much time as of late, I've got a senior design project and school work to deal with, plus I've been working on getting CM9 ICS to compile for gen8, and I've also been working on the HP TouchPad Ubuntu port. Adding A70 support to the kernel is low priority for me, but if any A70 owners want to take a stab at the kernel go right ahead, I'll gladly accept changes to the kernel. As far as Gen8 Ubuntu is concerned, my current focus is getting the SGX GPU up and running with TI's Graphics SDK. If successful, this GPU should be able to run hardware-accelerated Unity 3D and Compiz for a fast, fancy desktop experience.
shrewdlove said:
Does/Will this work on the Archos 70? I'm trying to get it working but all I'm getting is static on my screen when Kboot tries to boot Ubuntu. This could be my fault and I could have just messed up the installation but I don't think so.
Thoughts?
Click to expand...
Click to collapse
I've the exact same problem with my 101, at first I thought it was an issue with kboot but its able to boot uruk and bull. Every time I choose to run ubuntu it stalls with a static on the screen and I have to force a re-boot. I'm using a 2GB sd with only one partition if thats any help and the zimage in question is the one for boot from sd.
Any input?
Oh! Just looked at my kernel configuration again and I forgot to enable A101 support in the configuration file. I'll build a new kernel later today with A101 support enabled! Sorry about that. Should fix A101 but A70 still needs some real work before it will be supported.
EDIT:
Here it is
http://www.box.com/s/18d0e43877b5877ce79f
CalcProgrammer1 said:
Oh! Just looked at my kernel configuration again and I forgot to enable A101 support in the configuration file. I'll build a new kernel later today with A101 support enabled! Sorry about that. Should fix A101 but A70 still needs some real work before it will be supported.
Click to expand...
Click to collapse
Dude, don't apologize. I, and this community, appreciate what your doing. I'd love to have the knowledge to compile my own kernel and have a fully functional distro on this device, but I don't yet have that ability. You do, so any time you give up your time and effort to provide us with something new and cool is fricking brilliant. Keep working and let us know how you get on, but don't cause yourself too much hassle.
Thanks.
I've updated my previous post with an image with A101 support included. I have no way to test it. If any A101 users could take a short video or picture of the device booting Ubuntu I would like to see how it works on that device. I've also looked a bit into A70 support and it looks like the necessary modifications would be relatively straightforward, seeing as all the gen8's have essentially the same core hardware (OMAP3, Wolfson Audio, WL1271 WiFi/BT, MicroSD, POWER/VOL+/-, Power LED, etc). The primary difference (and probably most significant code change required) is the LCD panel, but seeing how the A43 got the short end of the stick on this one, the A70 should be easier to port (A43 has a DSI-interfaced serial LCD while the other gen8's have a DPI parallel LCD, DSI support is flaky at best in this kernel release).
Managed to get it to boot to ubuntu login screen but my usb keyboard doesnt get picked up, I dont know if the touch screen should register at this point but for me it doesnt. I've no bt keyboard but I can't see the device when I scan for bt from my phone either. If you want, I can take a vid of it booting to this point and send it to you. Just in case I get it to work, what are the login details (password) ?
The login is ubuntu/ubuntu (user/pass). I haven't tested the USB yet, and I'm not sure how the A101's host port is set up (the A43 supports USB OTG host but has no dedicated host port). It is a kernel issue for sure. As for the touchscreen, the A101 I think uses a USB touchscreen, so again with the USB issue. You can try forcing automatic login by modifying one of the files on the rootfs (would have to look up which one, can't remember, but should be possible). The fact that it boots is great and the fact that the panel works is also great. I'll look into USB host some more when I get a chance.
Cheers for getting back to me. Is there anyway we can pull something from either the bodhi image or android itself? or would it have to be changed at the kernel?
Pretty sure this is kernel level, the USB driver is being compiled differently than on the stock kernel (musb_hdrc should be a module, but this kernel it is built in, preventing you from loading in different modes). I booted up my A43 with a USB mouse attached, the kernel detected the mouse but then disconnected it before it could be used.

[Kernel][Patch] Virtual CD support

This is a patch to the stock 4.2.2 kernel that allows the phone to become a virtual CD drive.
Often, due to being the resident 'expert' around here I carry around an iOdd so I can install things like Windows from CD without having a bag full of windows CDs around. I thought it would be great if my phone could do this.. this is the result.
This functionality already exists in part the in kernel, but wasn't enabled and a bit buggy.
This patch only affects a single file (that doesn't look like it's changed for years) so should apply to just about any kernel, in theory.
1. Bring the cdrom flag into userspace via sysfs.
2. Implement the raw READ CD command
3. Implement raw READ TOC commands & respond to the old sff8020i request format.
I've built a boot.img from the stock 4.2.2 - there are no other changes to the kernel (I'm not really planning on maintaining another kernel - there's better people than me doing that already).
Also I've provided a GUI app to handle the mount/unmount. That will also support hard drive images (those work on unpatched kernels, so an image of a USB thumb drive should work).
Known bugs:
1. Sometimes Windows loses track of MTP after you unmount the disk (I disable it during emulation as the Win drivers really hate them being enabled at the same time). Toggling between PTP/MTP again resets it.
2. The currently mounted image doesn't always show in the app. This appears to be a kernel bug (it loses the name randomly) but is harmless.
boot-cdrom-4.2.2.img -- Compiled boot.img
cdrom.diff -- Diff file
VirtualDrive.apk -- GUI app
thank you gonna try
This looks like a really cool feature to have.
Thanks man! Now if the N4 only came with larger storage..
Is this the same thing as drive droid on the play store essentially? I've been using that to boot from my phone flawlessly so far.
Sent from my Nexus 4 using xda app-developers app
Can I just switch out the file and reboot and keep my current kernel... I see no reason why not but wanted to make sure
Sent from my Nexus 4 using xda premium
I'm the developer of DriveDroid and I was also working on something similar for a i9000 based on CyanogenMods kernel:
* cdrom option for each lun: http s://github.com/FrozenCow/android_kernel_samsung_aries/commit/a66d37b4ce5c8e1dd9231f478575a22a6c3294a4
* 2048 blocksize for cdrom luns (based on a patched from mailinglist in 2009): http s://github.com/FrozenCow/android_kernel_samsung_aries/commit/7f43f35bc6fd2b7eeee9e4051c1acf3f25462379
I see you have solved the problem a fair bit more sophisticated and likely more correct than what I did. I don't have much experience with kernel development, so could you explain your solution in a bit more detail?
I'd really like this (or similar) patch to be in the kernels of the most popular devices, so everyone can have cdrom support on their phone and DriveDroid can make use of that. Best would be to try to apply it to CyanogenMod kernels or even the official Android kernel.
(I may not post external links :-/, sorry for that)
Very useful patch, indeed!
I even ported an ancient mkisofs for that matter, to make iso images from /sdcard subdirs on the fly. Here's the trivial app I use, complete with the sources if somebody would care to write a non-hellowordish one (mkisofs itself is in libs/armeabi/libmkisofs.so to make everything simple).
Wonder why the kernel mainline is lacking such code for years?

Kexec-hardboot patch

In this post, I would like to explain what kexec-hardboot patch is.
@kernel developers: I would like to ask you to merge this patch to your kernels, because it is essential part of MultiROM - it allows me to boot any kernel without changing the boot partition. I realize that it is no small request, but the patch is not big, touches relatively stable parts of kernel and should not cause any problems. Thank you.
What is kexec?
It is syscall of Linux kernel, which allows you to boot another Linux kernel without restarting the device - "Linux boots itself". The functionality is equivalent to fastboot -c *cmdline* boot zImage initrd.img, but without PC and fastboot. It is fairly known thing, so more info at wikipedia and man kexec.
Standard kexec call unfortunatelly does not work on Nexus 6. It freezes somewhere, and it is very difficult to find out where - probably some of the drivers are not shut down/re-initialized properly, it is a common thing among Android devices, which is why kexec-hardboot was made.
What is the difference between normal and hardboot kexec?
Kexec-hardboot patch adds a real device restart to that process, so that all the drivers can be properly reinitialized. It stores new kernel to RAM, reboots the device as usual, and kernel from boot partition immediately jumps to the one which was stored to RAM before reboot.
Unlike grouper's kexec-hardboot patch, this one only requires the host kernel to be patched. This is one of the improvements I made, and I think it is pretty significant.
To summarize the process:
kexec --load-hardboot.... is called and kernel it loaded into RAM.
kexec -e is called. Special info is written to memory (to area which is not overwritten on reboot) and the device is rebooted.
After reboot, very early in the boot process, kernel checks if that special info is present in RAM and if so, it loads new kernel from RAM and jumps to it.
Kexecd' kernel starts and boots.
For more info, read the original thread.
Patches:
Kernel patch: https://gist.github.com/Tasssadar/757c939f2d028c00d089, 5.1 AOSP kernel repo
This is the kernel patch. Only the host kernel needs to be patched.
Related CONFIG options:
CONFIG_KEXEC=y
# CONFIG_ATAGS_PROC is not set
CONFIG_KEXEC_HARDBOOT=y
CONFIG_PROC_DEVICETREE=y #this one is turned on by default
All these options must be enabled.​
Userspace kexec binary: https://github.com/Tasssadar/kexec-tools
I had to change some things in kexec userspace binary because of some kernel bugs, complete description is in that repository.​
Usage:
Once you have the kernel patches and kexec userspace binary in place, just run following command to boot into new kernel:
Code:
kexec --load-hardboot zImage --initrd=initrd.img --mem-min=0x20000000 --command-line="$(cat /proc/cmdline)" --boardname=shamu --dtb
kexec -e
Note the command line parameter - cmdline from bootloader is not added automatically, you have to put it there by yourself.
Authors:
This patch was made by Mike Kasick for Samsung Epic 4G. Since that, it was ported to several devices, one of them is Asus Transformer TF201 - I used patch from TF201 and modified it a bit (basically just changed few SoC specific constants). People at #ubuntu-arm helped me out with that, thanks.
For hammerhead, I've improved the patch a bit - only the host needs to be patched now and I've added support for DTB.
For shamu, it's pretty much the same as for hammerhead.
@Tasssadar, I'm trying to incorporate the patch in my kernel (LiquidSmooth, which I compile in-line with the ROM - sources below), but I'm having issues actually booting into the secondary ROM.
Here is the portion of the log that contains the kexec call failure.
I just can't seem to figure out what my issue is - any ideas?
My device tree
My kernel source
Other potentially relevant info:
- Building the kernel in-line (using "make bootimage" for kernel incremental testing purposes)
- 5.0.2 base for host (my) kernel
- Using standard GCC for builds
- Updated to most recent MR TWRP and zip releases
Any help you might have to offer would be awesome!
CPA Poke said:
@Tasssadar, I'm trying to incorporate the patch in my kernel (LiquidSmooth, which I compile in-line with the ROM - sources below), but I'm having issues actually booting into the secondary ROM.
Here is the portion of the log that contains the kexec call failure.
I just can't seem to figure out what my issue is - any ideas?
My device tree
My kernel source
Other potentially relevant info:
- Building the kernel in-line (using "make bootimage" for kernel incremental testing purposes)
- 5.0.2 base for host (my) kernel
- Using standard GCC for builds
- Updated to most recent MR TWRP and zip releases
Any help you might have to offer would be awesome!
Click to expand...
Click to collapse
Looks like you didn't enable the config options mentioned in the first post. Also, please don't merge my hack to force-enable serial console, it doesn't play well with multirom. Also, you can enable the console by running "fastboot oem config console true", which I didn't know when I made that commit.
Tasssadar said:
Looks like you didn't enable the config options mentioned in the first post. Also, please don't merge my hack to force-enable serial console, it doesn't play well with multirom. Also, you can enable the console by running "fastboot oem config console true", which I didn't know when I made that commit.
Click to expand...
Click to collapse
[emoji33] [emoji40]
I literally can't even right now. Can't believe I missed that...rebuilding now, hopefully that takes care of it.
And thanks for the fastboot tip, I'll revert that hack.
Please keep the thread on topic for the section. If you aren't sure, read this: http://forum.xda-developers.com/nexus-6/devs-only/section-guidelines-read-t2959988
@Tasssadar, would this be better here in dev discussion (where I'm supposed to be an anal retentive moderator) or in "original development"? The reason for my asking is that your message states it's a release, as opposed to a discussion of the process of creating.
In the meantime, I've cleaned the thread...
Take care
Gary (posting as moderator of the dev discussion section.)
I put the patch here because it is quite different from most things posted in original development. It's pretty much for kernel devs only, and putting it in this section ensures it won't get lost (after couple of initial comments, there usually isn't any discussion related to this patch) and filters out most "thx" and "lolwhatsthis" posts (although obviously not all of them). I honestly didn't look up what's the exact goal of this section, it just seemed just right for this kind of thing. If you think it belongs to original development, feel free to move this topic.
Tasssadar said:
I put the patch here because it is quite different from most things posted in original development. It's pretty much for kernel devs only, and putting it in this section ensures it won't get lost (after couple of initial comments, there usually isn't any discussion related to this patch) and filters out most "thx" and "lolwhatsthis" posts (although obviously not all of them). I honestly didn't look up what's the exact goal of this section, it just seemed just right for this kind of thing. If you think it belongs to original development, feel free to move this topic.
Click to expand...
Click to collapse
Hey I don't know if you compile with ndk or cross compile for arm (statically or ndk) but I had to add some missing includes in *kexec/arch/arm/Makefile for kexec-tools to compile with the new board option. Just thought I'd mention.
https://github.com/Surge1223/androi...mmit/4b4629db76d64b7048274748d3e3366b52e1017d
Also, Ignore the other stuff. Testing kexec via module for locked devices so I have quite a bit of changes compared to regular kexec-tools.

TP-LINK WN722N (ath9k driver) install on Ubuntu touch 15.04 (Nexus 10- Manta)

I've been through all the relevant threads on AskUbuntu and they are either outdated, conflicting and/or dont work.
My Nexus10 sees the atheros AR9271 device on Bus 001 USB but does not create an additional WLAN for it.(wlan0 is the normal integrated wifi) I assume I need the ath9k or ath9k_htc driver? I installed backports 4.4.2-1 and unzipped it. If I try to do a 'make' or 'make clean' I get:'your kernel headers are incomplete/not installed'. I've already got the latest version of build-essential. If I try to install 'firmware-atheros', it cannot find the package. I've been through several other things to no avail.
I've read the driver is installed with 15.x+ anyway, true? and if so how to install it? If someone could do a step-by-step wifi driver install for a U-touch or at least Ubuntu 15.x I'd be very very grateful.
I do not want to bridge the 722n, I want to use it instead of the integrated card. Not even there yet, but just in case it matters.
Thanks!
roninisc said:
I've been through all the relevant threads on AskUbuntu and they are either outdated, conflicting and/or dont work.
My Nexus10 sees the atheros AR9271 device on Bus 001 USB but does not create an additional WLAN for it.(wlan0 is the normal integrated wifi) I assume I need the ath9k or ath9k_htc driver? I installed backports 4.4.2-1 and unzipped it. If I try to do a 'make' or 'make clean' I get:'your kernel headers are incomplete/not installed'. I've already got the latest version of build-essential. If I try to install 'firmware-atheros', it cannot find the package. I've been through several other things to no avail.
I've read the driver is installed with 15.x+ anyway, true? and if so how to install it? If someone could do a step-by-step wifi driver install for a U-touch or at least Ubuntu 15.x I'd be very very grateful.
I do not want to bridge the 722n, I want to use it instead of the integrated card. Not even there yet, but just in case it matters.
Thanks!
Click to expand...
Click to collapse
anyone anyone, Beuller...
Hey, saw this was unanswered and figured I could help. First off, you will not be able to compile or install headers in the Ubuntu Touch system, as /lib/modules/<kernel version> is a bind-mount into the read-only LXC system image, one way to work around this issue on device is to mount the LXC container's system image read-write somewhere, move out the lib/modules directory to someplace else, umount, reboot and then link your moved lib/modules back into /lib/modules. You will need to do this compilation outside of your Nexus 10 in a cross-compilation environment or in an armhf chroot (imho, a chroot running the ARM build of Ubuntu works very well for this).
Once you have that, you can install the kernel package for your device (which I believe are labeled linux-headers-manta and linux-image-manta respectively) and build the driver you seek. However the kernel already comes with backports 4.4.2 in it's tree, so you may be able to apt-get source linux-image-manta and build the driver and/or the kernel itself if you wish. (I believe building the kernel builds the firmware needed for the drivers as well, but I have no way of knowing as I haven't actually rebuilt any drivers with firmware yet in my foray into linux-image-flo's source.)
One piece of advice: Make sure to join together the config.*.ubuntu files under the debian.flo and debian.master folders to get the working .config for your device. The defconfig from arch/arm/configs doesn't have all the needed options for uTouch and won't boot it.
Your 'thanks meter' improved, and big thanks for answering, but this is beyond my level. Was hoping I could run an external wifi stick on a tablet with some flavor of linux, but looks like a no go for mortal users.
roninisc said:
Your 'thanks meter' improved, and big thanks for answering, but this is beyond my level. Was hoping I could run an external wifi stick on a tablet with some flavor of linux, but looks like a no go for mortal users.
Click to expand...
Click to collapse
Sadly at this time, it definitely seems to be. The normal linux way of building drivers doesn't work on here because the modules directory (/lib/modules/3.4.0-5-flo) is read-only, also due to this kernel headers cannot be installed, this can be worked around, but it is definitely not something that the casual user can do easily. I hope this will change so I could start compiling modules and NOT need to rebuild the entire kernel for it.
Glad I could be of help and I love answering questions, I am currently using Ubuntu Touch as my main OS on my Nexus 7 as I'm trying to make it into my own portable workstation. So I'm constantly digging into the system and learning what I can, and I love to share.

Asus Zenwatch 2 (Sparrow) - How to get rebuilt kernel work (need framebuffer console)

Hello XDA developers,
First of all my motivation to write here is to create a commandline GNU/Linux-like UI (and maybe add desktop GUI later) on the Asus Zenwatch 2, so I could see the kernel messages at bootup and use Midnight Commander without starting the entire main system (for example, get a text-mode shell and stop after every devices got initialized, firmwares got loaded, but before loading any Surfaceflinger and Dalvik stuff). I did similar thing on an Android tablet before by writing my own keyboard and touchscreen handlers based on Yaft. But that didn't help with boot-time kernel messages and the built-in framebuffer console in the kernel is probably much better. It's not enabled in the stock kernel, so I tried to recompile the Sparrow kernel from source (I didn't modify the default configs yet). After some tweaks to the kernel-source (which doesn't compile without them) I could build the Momentum-kernel and the stock Sparrow-kernel too using the provided .config files (e.g: make sparrow_defconfig). I used Android NDK's r13b gcc on Lubuntu 18.04, because an earlier attempt with NDK r18b wanted to use clang and compilation stopped early with errors.
My problem is that despite the kernel finally got compiled it doesn't seem to start at all. (I had similar experience with the Android-kernel in the past, but more success with Raspberry PI)...
I used mkbootimg to repack the generated zImage-dtb and the previously decompressed initrd into a boot.img, and ran fastboot boot on it, but booting simply stucked at fastboot screen, the animated ASUS logo never came in.
Can anyone point me into the right direction how I could troubleshoot further why the kernel doesn't work?
(I assume the 4.9 gcc isn't the issue here, though I got a zImage with slightly different filesize. I've read somewhere the earlier 14.04 Ubuntu and 4.8 gcc is advised for Sparrow kernel compilation but do these versions matter here? Should I replace the modules too on the system partition with their newly built versions, as the zImage changed?)
I know others managed to build a working kernel, for example TWRP has its own custom kernel and it works fine on the Sparrow watch... Is there any step I might have missed? Is there a debug-tool or logging which helps me to find out why the kernel doesn't boot? Something to troubleshoot the kernel-loading and booting? (A simulator for example? Or how do the experts do it in practice?)
I hope I declared every aspects to get some help. If for some reason I don't succeed I might try to make more linux-like AsteroidOS or PostmarketOS to get my complete Linux console on the smartwatch. The thing is that these don't support all hardware on the watch, that's why I'm trying with Android in the first place.
I guess if I'll be able to compile and then run the stock original kernel somehow the rest will be easy. (To enable framebuffer-console, set governors, remove unnecessary drivers, etc.)
Thanks in advance for the help, XDA gurus...

Categories

Resources