[Q] Having a litte bash instead of a full Android setup? - General Questions and Answers

Hi everyone! I'd like to experiment developing little apps and run them in ARM..
I have an old HTC Polaris to play with, which originally included WinMo and now has a wiped NAND with Android Kernel...
Is it possible to, instead of running Android, having a little bash running on the device to run little scripts and compiled binaries?
I was fooling around with a custom Android setup I had, named "Not So Super Froyo RLS18". I deleted android-related files (apks, frameworks and stuff) and just left binaries, config files, libraries and firmwares...
In the root filesystem there's a sysinit.rc file, which repairs permissions, initializes services and stuff.. once it's done, I'm not sure where the boot sequence goes!
I disabled a couple services (zygote, bootanimation, for instance) and now the boot hangs in a screen saying " A N D R O I D ". At this stage, the phone started configuring some stuff and the bootanimation showed up. Well, I got there and the phone seems to be halted, even though i created a little script on /etc/init.d that echoed a hello world and called bash, but still... nothing showed up..
Is this idea kinda crazy or am I just missing something?
Cheers!

Sorry for double-posting.
I've been able to get into a bash by creating the init file at the root of /system partition, but I wasn't able to manipulate it, since ADB wasn't running in background.. So I kept untouched the sysint.rc file, and triggered from there a little bash that called "busybox run-parts [...]" to run init.d scripts.
Everything going well so far, so I tried to push it a little bit further. Since I still cannot run compiled C binaries on there (linking problems), I tried to run a minimal debian install from that little bash.
Using debootstrap, I made a little rootfs which chrooted correctly. Now I'm trying to run Xorg.
Having a configured xorg.conf file, I get "invalid argument" initializing framebuffer...
Code:
(EE) FBDEV(0): FBIOPUT_VSCREENINFO: Invalid argument
(EE) FBDEV(0): mode initialization failed
But running Xorg in verbose mode, seems to get display properties right (screen resolution, depth, etc).
Now I'm thinking about two plausible problems: Is this a permissions issue (I haven't read too much about how android handles this) or a Kernel issue (In this case, I'll have to manage and find a way to edit the NBH file)?
Any help would be appreciated..
Cheers!
PS: Sorry for double-posting.

Related

[THINK TANK] Toggle between RHack and NonRamHack

Hey Everyone,
I was just wondering that if we have a build to which we have BOTH RamHack kernels and the non-ramhack kernel, would there be a way to write a quick app or script to switch between them.
I guess we could store both kernels on the /sdcard and use a .sh script to flash_image between them, and reboot. I dont believe we can "hot-swap" between kernels, but if anyone knows a method, please respond here
If anyone can think of a better or more efficient method of doing this, I believe the whole community would benefit. Lets see if we can get something like this going....
zimphishmonger said:
Hey Everyone,
I was just wondering that if we have a build to which we have BOTH RamHack kernels and the non-ramhack kernel, would there be a way to write a quick app or script to switch between them.
I guess we could store both kernels on the /sdcard and use a .sh script to flash_image between them, and reboot. I dont believe we can "hot-swap" between kernels, but if anyone knows a method, please respond here
If anyone can think of a better or more efficient method of doing this, I believe the whole community would benefit. Lets see if we can get something like this going....
Click to expand...
Click to collapse
is it really that hard to boot into recovery and flash an update.zip?
I guess this is what you're looking for:
http://wootroot.com/blog/?page_id=1463
Ive seen it implemented on one other rom on xda, but can't remember which one ..
I am trying to make it easier and more efficient to switch between them. The uneek switch seems exactly what im looking for
I put together a version of uneeks script that can be flashed over SuperD or FastTest3.1.
ISSUE THOUGH, I cant get it to flash correctly, as I get the "update-script not found" error, even though I signed it and created the appropriate META-INF directories.
Here is the file, if anyone thinks they can fix it
Uneek Script (needs to be fixed\signed) : http://www.4shared.com/file/257220832/8b6c2940/uneek.html
Alpha release
Here is a very alpha release of a working port of uneek's RamHack/NonRamHack Toggle script ported to SuperD 1.10.2 by myself.
http://www.4shared.com/file/257253893/a61182a2/Uneek_Script.html
Instructions
extract zip file to /sdcard/uneek
Launch terminal
type 'su'
type 'sh /sdcard/uneek/install-uneek.sh' -should see no errors/messages
execute 'uneek' from /system/bin
Chose Ram option or JIT (not tested) options, all others prob dont work as I didnt modify them
reboot (you must do so to see effects take place, the kernel doesn't "hot-swap" :-( )
WiFi still works, CC & Swap work.
Issues
Switch breaks boot screen - not sure why as its stored in framework-res.apk, but still a bug
Leave me feedback\ improvements\whatever......
You still have to boot into recovery so you might as well flash a zip containing a rhack or noram-hack kernel.
I did some scripts based off Kings,
get gscript from the market ( donate if you like it )
and drop script into the gscript folder
with a little uname query you could have just one script, which switches based on the current running kernel
Edit: , actually if your kernel needs different kernel modules, then you will have to build in a copy ( which I suspect is where king got his rwsystem bit from , he copied from a script which updates the kernel modules )
Firerat said:
...<snip>...
my faster, much safer script
Code:
#!/system/bin/sh
if [ -e /data/kernels/full3d.img ];
then
if [ "`md5sum /data/kernels/full3d.img|cut -d " " -f1`" != "061284119d4ce46cbe0b585e0a8b2d0b" ];
then
echo "/data/kernels/full3d.img isn't the version I was expecting"
echo "I'm not going to flash it, as it may have become corupt"
exit 1
else
flash_image boot /data/kernels/full3d.img
echo "full3d Kernel Flashed..."
echo "Rebooting now"
sleep 1
shutdown -r now
fi
else
echo "Sorry, /data/kernels/full3d.img"
echo "seems to be missing....."
exit 1
fi
and yeah, I could never spell corrupt , is it one or two 'r's?
PS , the md5sums in the scripts are for the power off fix boot.img's I did for you guys
if you are wanting to switch to different boot.imgs then update the md5sum its checking for ( or remove the check )
Click to expand...
Click to collapse
If you have an engineering SPL installed, there isn't any need for the recovery partition, so might as well install your second kernel to the recovery partition. Boot normal = normal, boot recovery = ramhack.
lbcoder said:
If you have an engineering SPL installed, there isn't any need for the recovery partition, so might as well install your second kernel to the recovery partition. Boot normal = normal, boot recovery = ramhack.
Click to expand...
Click to collapse
and then have a script switch wlan.ko if incompatible
might as well switch with script and keep recovery for the odd times when you just want to quickly flash some zips from a list and not at your pc.
yeap, I've downloaded and flashed a rom while 'out and about' before.
Firerat said:
and then have a script switch wlan.ko if incompatible
might as well switch with script and keep recovery for the odd times when you just want to quickly flash some zips from a list and not at your pc.
yeap, I've downloaded and flashed a rom while 'out and about' before.
Click to expand...
Click to collapse
If the only difference is ramhack on one but not the other, then the wlan module will be fine -- there is NO REASON to be switching modules around with your kernel unless you use a kernel that is binary incompatible -- which means DIFFERENT VERSION.
lbcoder said:
If the only difference is ramhack on one but not the other, then the wlan module will be fine -- there is NO REASON to be switching modules around with your kernel unless you use a kernel that is binary incompatible -- which means DIFFERENT VERSION.
Click to expand...
Click to collapse
yeap, true but why not keep options open?
What if they decide they want to switch between binary incompatible kernels?
They would need to switch kernel modules anyway.
so get a script that works, and is simple to 'generate'.
I know you are trying to keep it simple, but you are actually needlessly setting up restrictions, which would then require a script to get around.
So why not use a script from the start, keeping the added convenience of a recovery image?
Firerat said:
yeap, true but why not keep options open?
What if they decide they want to switch between binary incompatible kernels?
They would need to switch kernel modules anyway.
so get a script that works, and is simple to 'generate'.
I know you are trying to keep it simple, but you are actually needlessly setting up restrictions, which would then require a script to get around.
So why not use a script from the start, keeping the added convenience of a recovery image?
Click to expand...
Click to collapse
If the only objective is to be able to easily toggle between ramhack and noramhack, then the recovery solution is (1) more reliable, (2) doesn't require reflashing NAND, (3) just easier to activate. With the reflashing approach, you have to either go into recovery and flash something, or pause-and-wait-and-autoreboot.
lbcoder said:
If the only objective is to be able to easily toggle between ramhack and noramhack, then the recovery solution is (1) more reliable, (2) doesn't require reflashing NAND, (3) just easier to activate. With the reflashing approach, you have to either go into recovery and flash something, or pause-and-wait-and-autoreboot.
Click to expand...
Click to collapse
did you ever read anything?
the script is as easy as a couple of taps, maybe home button, swipe tap tap.
( the key app here is gscript )
the flash is over very quickly, it checks md5sum first, it reboots.
you have to reboot with the recovery method anyway
recovery method restricts to binary compatible kernels, or require a script to switch kernel modules.
It is a no brainer imo, keep it flexible and keep the convenience of a true recovery.img
ok, so nand only gets what, on average 10,000 writes, is it really going to reduce its life in practice?
I like your idea, it will work but it just isn't as flexible as a script.
It is however more suited to an mt3g, offering duel ROM
I'm thinking mtdblock3 for one ROM, block4 for the other
errm, data , yeah might need to section that up somehow
any reason why a loopback can't sit on yaffs?
oh, and the ramdisk will need tweaking, obviously.
Sorry back on topic
Guys,
Either will work, if you do have incompatible kernels, and are having problems with scripts just let me know, I can probably make a script to generate a script for you.
1) Booting into recovery to change out your kernel image is totally unnecessary. You can do it via CLI with the flash_image command -- most every modded ROM already includes it.
2) Removing the recovery image just to put up a second install also seems somewhat overkill for devices as heavily limited on storage as most Android phones -- especially the G1.
3) I don't know about loopback on yaffs2 -- but I don't see any reason why it couldn't work.
4) It really seems to me that what we need is some kernel hacker who's familiar with hotswapping patched files -- a la ksplice ( http://www.ksplice.com/ ) -- to hack together a genuine, non-rebooting, RAMhack switch.
5) In all seriousness; what makes gscript superior to ASE ( http://code.google.com/p/android-scripting )?
IConrad01 said:
5) In all seriousness; what makes gscript superior to ASE ( http://code.google.com/android-scripting )?
Click to expand...
Click to collapse
Nothing, apart from its easy, it works and I haven't looked at ase yet
btw , you missed a p/ in that link
http://code.google.com/p/android-scripting/
btw , you missed a p/ in that link
http://code.google.com/p/android-scripting/
Click to expand...
Click to collapse
>_<
Pesky perniciously persistently phantasmagoric P!!!
I just keep on seeing people referring to gScript when ASE is a vastly more robust offering. It can run its scripts as daemons, run in background, run in terminal, it offers the same desktop shortcut option -- and more importantly, it can run Python, Perl, JRuby, Lua, BeanShell, JavaScript, Tcl, and shell scripts. (It loads the interpreters onto your /sdcard.) I've asked this question more than once before and I've never gotten an answer. It really seems like people just aren't aware of ASE -- which is kinda sad, considering the fact that ASE is still seeing continuing development whereas development ended on gScript sometime at the end of last year.
IConrad01 said:
>_<
Pesky perniciously persistently phantasmagoric P!!!
I just keep on seeing people referring to gScript when ASE is a vastly more robust offering. It can run its scripts as daemons, run in background, run in terminal, it offers the same desktop shortcut option -- and more importantly, it can run Python, Perl, JRuby, Lua, BeanShell, JavaScript, Tcl, and shell scripts. (It loads the interpreters onto your /sdcard.)
Click to expand...
Click to collapse
no, I am very interested in it,
I have been meaning to have a proper look at it for sometime
, I think I first saw it on @google
gscript is just handy,
unzip this, gscript from market,add, load, tick su, save , tap
But I promise , I will look at ASE
Firerat said:
and then have a script switch wlan.ko if incompatible
might as well switch with script and keep recovery for the odd times when you just want to quickly flash some zips from a list and not at your pc.
yeap, I've downloaded and flashed a rom while 'out and about' before.
Click to expand...
Click to collapse
Glad this is getting your attention....My script was pretty dirty anyways.
Anyway you can package it up in signed-zip format for easy access and modification of boot.imgs. Im having some issues with the update-script portion during the signing process tos keeping me from getting mine to be "flashable"
zimphishmonger said:
Glad this is getting your attention....My script was pretty dirty anyways.
Anyway you can package it up in signed-zip format for easy access and modification of boot.imgs. Im having some issues with the update-script portion during the signing process tos keeping me from getting mine to be "flashable"
Click to expand...
Click to collapse
still having update-script issues?
if you post it, I'll be happy to take a look for you
Oh, I've started a kernel switch script
I'll do some testing when its done and post it here for you

[Q]Need Android Gurus - Issues

Hi to everybody, I come from the BADA subforum, and there is a new project trying to port Android to samsung Wave phone.
Devs have some issues, we are in the last steps and here is a summary
will want to note that the kernel has been confirmed as able to boot into android homescreen when flashed though JTAG
we're modifying the init scripts to boot it from sdcard
the device is accessible from adb how ever the Android system services such as zygote are restart looping
i *think* i managed to execute standard boot on init.rc with adb interface, zygote and android services appear to be stuck in a restart loop:
http://code.google.com/p/badadroid/source/detail?r=192
EDIT: would like to note that while "VIBETONZ" is appearing on the log, the phone is not vibrating, nothing is appearing on the display either. If possible i'd like a check on my kernel sources Oleg. EDIT AGAIN: the phone does actually vibrate, my bad
line 3150ish you can see the zygote service and various others getting killed and restarting.
EDIT2: another debug log extracted using "adb bugreport" (very large, will want to download in order to view)
http://code.google.com/p/badadroid/source/detail?r=193
http://badadroid.googlecode.com/svn/trunk/adb logs/bugreportnb190511.log
EDIT3: it's possible that the restart loop is caused by lack of memory, this could be caused by the memory mapping of the current bootloader we're using, will have to ask rebellos and srg about that.
added a log to googlecode for procedure to boot kernel using init.rc with adb interface working ( i'm not exactly sure why this works) i may upload the zImage i'm using for this, but it'll only work if you partition your memory card in the correct layout and format.
http://code.google.com/p/badadroid/source/detail?r=194
http://code.google.com/p/badadroid/d...511v2&can=2&q=
Click to expand...
Click to collapse
We need some ideas, or whatever you can provide with your knowledge to help us in this project.
more info: http://forum.xda-developers.com/showthread.php?t=1012856&page=100
Thanks to everybody.
hi to everybody
need help, please!
anybody?
I will take a look later on this evening and see if I can tell anything.
Your kernel seems to work, most of your issues in the log that was posted in my thread come from the ramdisk and system build. Until you work at those for a bit, I don't think you're going to know where to place the blame for issues until you're clean.
For the VM crash loop:
Take all of the non critical apps and gapps out of /system/apps (stuff like vending, maps, touchwiz and so on.)
And see what you get. If you can't solve it that way, then try to do:
adb pull /dbdata/databases/com.android.providers.settings/settings.db settings.db
And see what you get. If its there, it's corrupt. If it isn't, check to make sure the directory is getting created. You can also get someone to pull settings.db from a similar device (i9000?) and try to push it to yours.
But that's only the first of your problems. You have some bad lines in init.rc (your rild daemon isn't configured correctly amongst other things), and a few things missing in /system/bin and /system/lib (calls to missing things). If you aren't using an extract of system.img from the sdk, you probably should. Then you can load in libs one at a time in a clean and controlled environment.
BTW: What Android system are you using? What device did it come from? If you built it from source, seriously, try using an emulator image first.
spacemoose1 said:
Your kernel seems to work, most of your issues in the log that was posted in my thread come from the ramdisk and system build. Until you work at those for a bit, I don't think you're going to know where to place the blame for issues until you're clean.
For the VM crash loop:
Take all of the non critical apps and gapps out of /system/apps (stuff like vending, maps, touchwiz and so on.)
And see what you get. If you can't solve it that way, then try to do:
adb pull /dbdata/databases/com.android.providers.settings/settings.db settings.db
And see what you get. If its there, it's corrupt. If it isn't, check to make sure the directory is getting created. You can also get someone to pull settings.db from a similar device (i9000?) and try to push it to yours.
But that's only the first of your problems. You have some bad lines in init.rc (your rild daemon isn't configured correctly amongst other things), and a few things missing in /system/bin and /system/lib (calls to missing things). If you aren't using an extract of system.img from the sdk, you probably should. Then you can load in libs one at a time in a clean and controlled environment.
BTW: What Android system are you using? What device did it come from? If you built it from source, seriously, try using an emulator image first.
Click to expand...
Click to collapse
It is possible it was not made clear, its a 2.2 stock ROM being ported from the Samsung Galaxy S to the Samsung Wave (formerly a BadaOS device). It is also being booted off of SD as apposed to OneNand. It uses a patched version of the SBL from the galaxy S but when Android is flashed to Nand it can boot fine (although problems are had initializing the Modem).
sabianadmin said:
It is possible it was not made clear, its a 2.2 stock ROM being ported from the Samsung Galaxy S to the Samsung Wave (formerly a BadaOS device). It is also being booted off of SD as apposed to OneNand. It uses a patched version of the SBL from the galaxy S but when Android is flashed to Nand it can boot fine (although problems are had initializing the Modem).
Click to expand...
Click to collapse
You need to compare logs from system booted from nand and from sd. Whatever errors are the same don't matter. Its the different ones that will tell you more.
But you're crashing right now because some line of code somewhere in your build is looking for a database and can't find it. If it doesn't do that when installed to nand, then your problem is that directories that the system creates to host configs and module parts aren't getting created at boot.
The modem issue, (if the error in logcat is the same whether the system booted or not, haven't seen both) looks to be a radio interface layer problem, your rild daemon isn't loading (check /system/bin/ for "rild") and make sure the line in init rc that starts it is correct.
spacemoose1 said:
some line of code somewhere in your build is looking for a database and can't find it.
Click to expand...
Click to collapse
It's a strange problem, as using the extracted system.img from the Android emulator as filesystem the above error disappears - with the same kernel/initramfs/init.rc (obviously other errors appear but the services seems to be stable).
I think we can forget the ril related errors now (I commented out the service in my build together with the DR daemon) as we have no modem driver yet ...

[Q][DEV] Kernel modules loading at boot-time : which framework ?

Hi,
Usually on linux, there is a kernel loading modules at boot-time framework, cf. modules.conf.
No longer present in android.
When typing lsmod, there is two modules loaded by default : tntfs, and bcm4329 (and voodoo_sound
if you have it).
I'm trying to figure out what is the standard procedure on android : I've noticed on the
init.rc that the tntfs.ko is loaded, but can't figure out when bcm4329.ko is loaded.
Any idea ?
Moreover, I know that voodoo controller is able to load his own kernel module (voodoo-sound)
at boot-time. Anyone knows how the voodoo dev did that ?
My current idea is to modify init.rc to source a new file - let's say init.rc.local - to keep my custom mod. It'll
allow minimal changes when updating+root : just copy the init.rc.local and change the init.rc...
Sounds like we're recreating linux boot framework. lol.
This is something I've done on the HTC Incredible and the Droid 1 in the past, but in honeycomb, this is different, not very obvious yet:
Rather than try to emulate whatever Redhat or Ubuntu has done, which usually doesn't work, I either would use the line where tntfs.ko is insmod'd in /init.ventana.rc (sorry, think that's the filename), and add in the modules you want to add right there. Make sure to save the original file so you'll have a shot at fixing it if you make a mess.
The other thing is just to find some developer that appears to know what they're doing, and download their ROM, like Roach. I just downloaded his prime 1.6 ROM and unpacked it, then noticed immediately that he's got this in there:
/system/etc/init.d/01init{stuff},
Well that seems pretty important, so I did a grep 'init.d' * -R from the / level, and could only see little of importance, not any shell file like initrc pointing to it, just that busybox is linked to it, etc.
I figured it's worth a shot to create the same file structure on the stock ROM (/system/etc/init.d/0X{name} and see if it executes :: Start it with the usual #!/system/bin/sh
# load some modules
/system/bin/inmod /system/lib/modules/cifs.ko (or whatever)
and see what happened, if anything.
Better yet, I'd just send a message to Roach or some other ROM developer and ask.
Good luck -
altsyst said:
Hi,
Usually on linux, there is a kernel loading modules at boot-time framework, cf. modules.conf.
No longer present in android.
When typing lsmod, there is two modules loaded by default : tntfs, and bcm4329 (and voodoo_sound
if you have it).
I'm trying to figure out what is the standard procedure on android : I've noticed on the
init.rc that the tntfs.ko is loaded, but can't figure out when bcm4329.ko is loaded.
Any idea ?
Moreover, I know that voodoo controller is able to load his own kernel module (voodoo-sound)
at boot-time. Anyone knows how the voodoo dev did that ?
My current idea is to modify init.rc to source a new file - let's say init.rc.local - to keep my custom mod. It'll
allow minimal changes when updating+root : just copy the init.rc.local and change the init.rc...
Sounds like we're recreating linux boot framework. lol.
Click to expand...
Click to collapse
Tested.
Does not work, because modified room probably calling busybox run-parts.
Anyway I've found a hack, I'm posting it on general section.

[Q] Motorola Xoom Rooted Gcc [SOLVED]

Hey all,
So here's what I've got / am thinking. I have a rooted Motorola Xoom 3g model, and I can access the command line. Now, I realize that Apps can only be written in / run with Java in the Dalvik VM. What I fail to understand is, that things like busybox, and even Backtrack 5 has an "arm" version that you can easily install side by side with Honeycomb. So, what I'm trying to figure out is, how can I (or why can I not) write apps in C or C++ that are system based daemon's, that are Not Apps per se for the honeycomb system, but simple *nix based programs?
So, I didn't see a good way to mark this thread as solved, but I figured it out. You need to use an ARM cross-compiler (gcc/g++ has one, or you can use Code Sourcery's compiler, which I did). It was a breeze to build a simple program on my *nix box, compile it with that (arm-none-linux-gnueabi-gcc -static hello.c -o hello) and adb push it to the Xoom!
sovereign_313 said:
So, I didn't see a good way to mark this thread as solved, but I figured it out. You need to use an ARM cross-compiler (gcc/g++ has one, or you can use Code Sourcery's compiler, which I did). It was a breeze to build a simple program on my *nix box, compile it with that (arm-none-linux-gnueabi-gcc -static hello.c -o hello) and adb push it to the Xoom!
Click to expand...
Click to collapse
The way to mark a thread as [SOLVED] is to edit the first post in advanced mode and change the title.

Linux on TF300?

Hi Guys,
I am looking for linux working on TF300T, is there anyone who has anything working? I am planning to start with linux for TF300T, I want to know if anyone has tsarted, how do I collaborate and not reinvent the wheel. I have questions regarding what bootloader to use, lilo / grub / u-boot as Nvidia has a ubuntu distribution for its chip, which uses U-boot. Lot of questions can any dev please reply, so I can think of a place to start.
Thanks
Sent from my ASUS Transformer Pad TF300T using xda premium
So far I'm quite satisfied with my android linux device ( with some chroot debian thrown in for good measure).
I'm wondering about this as well. I've got some experience with linux (servers) but not a clue how the android boot structure works.
I have found this though: http://eeepadhacks.net/transformer-hacks/how-to-install-native-ubuntu-on-eeepad-transformer/
Not to spam, but does anybody have *NIX running on the TF300? I'm very interested since Android is based on the Linux kernel, so I would think that there is some form of *NIX running on this device, since I'm hoping that there is so I could actually use this as a "laptop" for my school work.
I am fairly sure that Android is Linux. However what people are missing is the GNU environment (and tools) that the majority of the Linux distributions have. You can see that Android/Linux is vastly different from GNU/Linux.
Thus, I think the question becomes something like "Is there anyone who has GNU/Linux working on the TF300T?"
There are two methods I know of to get GNU/Linux running on Android: Chroot and Dual boot.
* The chroot method runs the linux services and programs inside Android, but is available for basically most devices.
* The dual boot method works (mostly) with the original transformer (as Citruspers has mentioned)
I myself don't have a tablet yet, but I have been looking to get a TF300T (if I don't buy a TF700T - but that is for another discussion) on the basis I can dual boot Android with a GNU distribution.
Linux = kernel. Android runs a Linux kernel. Android IS Linux.
The two biggest differences between Android and "ordinary" Linux distributions are libc (called bionic in Android) and the lack of a real X server on Android (there is a Java version at https://code.google.com/p/android-xserver/ , but it's wayyyy too slow to get anything done (it's still awesome, though). It needs to be implemented in a lower level language).
/dev/void said:
Linux = kernel. Android runs a Linux kernel. Android IS Linux.
The two biggest differences between Android and "ordinary" Linux distributions are libc (called bionic in Android) and the lack of a real X server on Android (there is a Java version at https://code.google.com/p/android-xserver/ , but it's wayyyy too slow to get anything done (it's still awesome, though). It needs to be implemented in a lower level language).
Click to expand...
Click to collapse
Any chance Wayland will work any better with Android than X? I wouldn't mine tossing a *box or even WindowMaker on my tablet (assuming they play nicely with Wayland).
Edit: Yes, I realize that Wayland barely works with GNU/Linux as it is, and it probably won't be usable even on the desktop until I'm upgrading to a new tablet. I'm not expecting it anytime soon.
Extracted from http://androidroot.mobi/2012/06/17/ubuntu-on-the-transformer-prime-preview/ regarding Ubuntu on Prime 201...
It has been a while since the last post about ubuntu on the Transformer Prime. This post is going to explain a few of the new changes, and show a video preview of the system in action.
There have been a few changes since the last update:
3.1.10 Kernel -- Asus don’t update the kernel while remaining on the same android major release, so they won’t update the kernel until at least Jellybean, but we have worked really hard to bring us up to the latest kernel. This has given us the ability to use the latest Tegra ULP GeForce binary from nvidia and maintain acceleration with the latest releases.
Linux as a bootloader -- With some work to the process we have managed to get kexecboot working to give us a boot menu that will boot not only multiple kernels from eMMC, but also to allow booting from USB, SD, and MicroSD. At this point in time the guest kernel also requires two patches, one for speed (it is really slow to boot without this patch, 30sec-5minutes) and the second to copy ATAGS, this second patch is important so that the new initrd and command line get used.
Ubuntu 12.04 LTS -- The last image was 11.10 which is a little less stable. 12.04 has a new gpower applet which can read the battery levels. 12.04 also includes the mtrack driver allowing the trackpad to work. The biggest change with the new image is the use of armhf over armel.
LVM -- Turning mmcblk0p8 (/data under android) to an lvm volume group has allowed both android and ubuntu to coexist on the eMMC without needing nvflash for reformatting. This however does require a modification to the android initrd to reflect the change and for the lvm binary to be included so it can mount /data. Ubuntu natively supports booting from logical volumes.
Click to expand...
Click to collapse
I know, I know this is TF300 forum, but it seems the TF300 is more similar to the TF201 than the primitive TF101
EndlessDissent said:
Any chance Wayland will work any better with Android than X? I wouldn't mine tossing a *box or even WindowMaker on my tablet (assuming they play nicely with Wayland).
Edit: Yes, I realize that Wayland barely works with GNU/Linux as it is, and it probably won't be usable even on the desktop until I'm upgrading to a new tablet. I'm not expecting it anytime soon.
Click to expand...
Click to collapse
Good call. While we're on the desktop managers, how about KDE's entry in the mobile device space? Aren't they supposed to have a native linux tablet going to retail soon?
My chroot runs smooth but native would be fun! Hope someone get's this working.
I hope once the guys at androidroot.mobi release the installer package for Ubuntu for the Prime, it works on TF300.
I'm looking for the ubuntu on my tf300t too.
Its strange, I know Ubuntu showed off dual booting kernel for android devices like 6 months ago. You basically docked your phone and it became a full Linux desktop with unity. But haven't heard anything since, only a page on Ubuntu's site for hardware manufacturers.
http://www.ubuntu.com/devices/android
(Sorry to revive this old-ish thread, but I didn't think it was any better to start a new one and clutter up the forum)
It seems that no one gave an honest shot into loading linux NATIVELY (not via the "linux on android" project). The original poster mentioned being interested into giving it a shot -- so how things are going on your end aditya?
I am by no means an Android rom developer, hacker, or even linux hacker, but I started my first steps into it, I thought of getting things done by this method:
Instead of wiping the whole recovery partition like the guy on the TF100 did, i'd use a somewhat altered version of a recovery where I launch a recovery-like menu where the user can continue to the "real" recovery, or boot linux
(Basically, I got myself a version of the /sbin/recovery, which has its menus altered to only show "linux" or "recovery". Selecting recovery launches the real /sbin/recovery)
If the user choose to boot linux (which could be automatically selected after a timeout), that's where kexec steps in and boots the right kernel and linux pre-baked image files
I got all that covered (my pre-recovery menu is 90% working, custom kexec'd kernel w/kexec binaries packed into my recovery), but i forgot a small detail: There is no way I could load a full 1Gb Ubuntu image into memory, (in other words, what does happen to the old mount points managed by the first kernel when I load the second kernel via kexec? Gets broken, right?) So I came into realization I would need an initial ramdisk to mount my mmc so I could finally load/mount my main 1 Gb image file.
Honestly, for somebody not into hacking, I am under the impression this is getting out of hand. This could work, but I heard we could have nvflash fully working (read: re-paritioning coming our way, just like for the TF100 where there's linux natively on its own partition).
Is there anybody else trying to do such things like I do? I might also need a reality check on what i'm doing-- altough it seems the right way to me now
Linux and GNU
It's true, Linux is the OS kernel, but with the word Linux you can also mean the GNU/Linux environment with the kernel and all the applications running on top ("The gimp" or "Libre Office" for example).
Should be nice to have a GNU/Linux system running on a tablet device; I read that Canonical (Ubuntu) is working on a project for multi-core devices but I don't know about the development stage.
/dev/void said:
Linux = kernel. Android runs a Linux kernel. Android IS Linux.
The two biggest differences between Android and "ordinary" Linux distributions are libc (called bionic in Android) and the lack of a real X server on Android (there is a Java version at .... , but it's wayyyy too slow to get anything done (it's still awesome, though). It needs to be implemented in a lower level language).
Click to expand...
Click to collapse
Trying to make this work too.
I have a basic changeroot with gentoo and compiled a kernel and initrd. I wanted to try it out using fastboot (fastboot -i 0x0b05 -c real_root=/dev/sdb1 boot kernel-genkernel-arm-3.3.8-gentoo initramfs-genkernel-arm-3.3.8-gentoo) but it doesn't even try to load the kernel. I get an error 0x120000 on the screen of the TF300. I googled a bit and found out that the TF201 has the same problem, you have to flash a boot image.
How can I make a boot image using the gentoo files? I looked into abootimg but it seems it won't work. At least it won't split up the original images, so I fear it uses another format. Has anybody tried mkbootimg?
AEblefisk said:
I have a basic changeroot with gentoo and compiled a kernel and initrd. I wanted to try it out using fastboot (fastboot -i 0x0b05 -c real_root=/dev/sdb1 boot kernel-genkernel-arm-3.3.8-gentoo initramfs-genkernel-arm-3.3.8-gentoo) but it doesn't even try to load the kernel. I get an error 0x120000 on the screen of the TF300. I googled a bit and found out that the TF201 has the same problem, you have to flash a boot image.
Click to expand...
Click to collapse
I only know a part of the story here, but here's my findings so far. I never got "fastboot boot" to work on my TF300, always giving me that 0x120000 error. I am under the impression (I MAY BE WRONG) that "fastboot boot" requires a more devloper friendly device (think HTC G1, GNex, anything Google branded).
That being said, I am curious why you wrote "real_root=/dev/sdb1" as your kernel parameters
AEblefisk said:
How can I make a boot image using the gentoo files? I looked into abootimg but it seems it won't work. At least it won't split up the original images, so I fear it uses another format. Has anybody tried mkbootimg?
Click to expand...
Click to collapse
Personally I was able to look at how a recovery image was used and flashed onto a TF300. Without going into the details, I looked at how xplodwild's recovery was being made, and hacked around that recovery to use my own (basically trivial modifications from his).
To flash my image files, I am using "fastboot flash recovery" with my own recovery, which is basicaly a mkbootimg based image file like you said (you were on the right track), but wrapped around in a BLOB file format (using blobpack / blobunpack, see this xda thread).
So to answer your question, the only way I found so far to boot my custom kernels and init rootdisks is to flash it onto the device outright.
BTW: if you were to look at a pre-baked img file, (or, if you had no idea whats the file contents like), you could load the file into a hex editor (I use 'hexer' on ubuntu/debian, thats a command-line one). If you see "SIGNED-BY-BLOB", thats a blob file (a nvidia tegra and/or asus file format). If you see something else (usually starting with "ANDROID.."), thats usually something you can either mount or unpack using linux natively (most probably with "mount -o loop file /mnt/mountpoint")
EDIT: Slightly off topic, but still for AEblefisk: if you compile your own kernel, i suggest turning on activating the framebuffer tux logo option. More importantly, you could as well try and activate the framebuffer console too, however apparently "fbcon is broken on 2.6.39.4", so says Rayman. But at least, you'd get a hint that your own kernel is loaded and running if you see 4 tuxes on screen (one per core)
Thanks for pointing me in the right direction.
Now I managed to make a blob with the gentoo kernel and ramdisk. It flashes sort of OK with fastboot, sending in 2 seconds, but the write time is 0.016s and it seems nothing is written. I boot into Android when I reboot. (I'm flashing to boot, not recovery). Maybe I'm missing some offset or blocksize parameters?
bilange said:
...
That being said, I am curious why you wrote "real_root=/dev/sdb1" as your kernel parameters
...
EDIT: Slightly off topic, but still for AEblefisk: if you compile your own kernel, i suggest turning on activating the framebuffer tux logo option. More importantly, you could as well try and activate the framebuffer console too, however apparently "fbcon is broken on 2.6.39.4", so says Rayman. But at least, you'd get a hint that your own kernel is loaded and running if you see 4 tuxes on screen (one per core)
Click to expand...
Click to collapse
The real_root is for the gentoo initrd to find the real root filesystem on microSD. I have no idea if it will turn out to be mmcblk1p1, sdb1 or something completely different. I'll probably have to correct that once my initrd boots.
Yes I'm definitely trying to make the framebuffer logos work. Seeing that lineup of 4 tuxes is a goal in itself
I'm using 3.3.8 in gentoo so I hope fbcon is fixed.
AEblefisk said:
Now I managed to make a blob with the gentoo kernel and ramdisk. It flashes sort of OK with fastboot, sending in 2 seconds, but the write time is 0.016s and it seems nothing is written. I boot into Android when I reboot. (I'm flashing to boot, not recovery). Maybe I'm missing some offset or blocksize parameters?
Click to expand...
Click to collapse
I never touched boot so far to tinker around Linux booting, for the simple reason we never use the recovery partition except to flash/nandroid backup (which I rarely do), plus it gave me with Android booting if I dont press the volume button on startup. As far as development went, I think this was a win/win situation, although lilstevie (the guy who did make Ubuntu boot natively on his TF101/200) told me to "never touch recovery, flash boot instead", he was most probably talking about deploying our custom OSes to the world to use.
Now i'm kinda lost as to why the regular Android boot is being shown up. Having 0 experience with the boot partition (which i thought was similar to recovery), i can't really help you. Maybe you should get on freenode into the #asus-transformer and ask around (Don't let the numbers of nicknames scare you, this is a low activity channel, but the most knowledgables people are hanging in there. Just be sure to do your homework (aka Google etc) before asking, you should be fine )
As a sidenote, you should probably use some (most?) of the kernel parameters used in /proc/cmdline from a live Android OS. Most specifically the "tegraboot=sdmmc gpt gpt_sector=..." part. This makes sure your kernel reads the partition table at the right (unusual) location instead of reading where ever it was on a regular system (the first 512 bytes of the drive? don't quote me on this). I suppose this doesn't prevent the kernel from booting, but it will make the SSD partitions visible from your OS.
AEblefisk said:
The real_root is for the gentoo initrd to find the real root filesystem on microSD. I have no idea if it will turn out to be mmcblk1p1, sdb1 or something completely different. I'll probably have to correct that once my initrd boots.
Yes I'm definitely trying to make the framebuffer logos work. Seeing that lineup of 4 tuxes is a goal in itself
I'm using 3.3.8 in gentoo so I hope fbcon is fixed.
Click to expand...
Click to collapse
Would that be a 'vanilla' 3.3.8? I'm asking because, in case you don't know, I think you can't have much success using the regular kernel from kernel.org, and hope it will detect all the devices (specifically touch, sensors, wifi, gps(?), etc). It will maybe boot (your guess is as good as mine), but it will surely lack a few things here and there. That's why there are a ton of devices specific github kernel code base here and there: it's basically a 'stock' kernel source code, with the constructor's additions to make their various devices work, with community enhancements on top of all that. I may be wrong on the following (if there are any veterans reading this, feel free to call me a noob and point me to the right direction), but if you try to compile ASUS' kernel source code for the TF300, funnily enough everything compiles silently UNTIL it gets to the Tegra parts where it gets noisy with over 9000 warnings all along (but it compiles). That led me to believe that 1) NVidia or ASUS are lousy coders and 2) They added (most likely) OR modified a bunch of code to the stock kernel tree to make it 100% functioning on their devices.
All that wall of text only to say that I assume that the broken fbcon issue is most probably due to either ASUS/NVidia additions to the kernel code, or a bug from the 'stock' kernel code, and i'm assuming it was fixed in later versions (which lacks device's constructor modifications then again).
--
Offtopic: it seems ASUS has released the kernel source code for TF300 for their JB update! Compile all the things!! (And hope fbcon as been fixed so I can see something out of the screen)
I'll definitely do my homework now I'm worried I may have flashed some other place than boot, since Android is still booting, so now checking all corners of the tablet is on top of the agenda.
I know some things may not work with a vanilla kernel, but I was hoping enough would work for it to boot. Then I could worry about the rest afterwards. Maybe using the JB kernel source will be easier, but I don't know how much has been changed in android which is used in linux. I suspect Google has worked more on modifying linux for android use than ASUS has worked to make their hardware run in android. Another option is to work on what Nvidia has published.
Now I'm getting more experienced. I hope I get some real progress before I brick it
It turned out I wasn't writing anything to flash. It seems the first blob(un)packing tools mentioned in http://forum.xda-developers.com/showthread.php?t=1697227 aren't working (for me on my tab anyway). But when I tried the BlobTools2 with the blobpack -s option my resulting linux blob was written to flash (using fastboot -i 0x0b05 flash boot boot.img).
Unfortunately my gentoo linux kernel wasn't any good. I never got past the first Asus logo and on top of that CWM recovery couldn't restore Android. CWM went through the motions but nothing booted. I had to flash the stock blob, then I got my Android back.

Categories

Resources