yashsingh1/xdaforums huggingface dataset:
[XPERIA X10 Android Development] anantshri:
This seems like a good start, Let me read all the detail's.

also as suggested by DoomLord, Would try the chargemon script hook for dual booting.

not very soon... i am expecting to do this by next weekend.
[XPERIA X10 Android Development] DooMLoRD:
no no... no need to flash thru recovery...

the "installation" is very safe... u dont need to format anything... u dont need to make any special system modifications (as of now atleast)...

BTW u will need 3.5GB+ free on SDCARD to use/extract this...

just connect ur phone to PC

mount ur SDCARD

create the folder "ubuntu" (without quotes) in the root of ur sdcard

extract the contents of either of the files LXDE/NETBOOK to the folder "ubuntu"

there should be 5 files (Ubuntu.sh, starttux, tuxcmd, stoptux, ubuntu.img)

once u have verified that all files are in place then unmount the SDCARD and u can use either Terminal Emulator or ADB shell from PC to execute the commands...

now u can follow the "GUIDE FOLLOWS BELOW

....

USER PORTION START HERE..." from the 1st post...

let us know if it worked!
[XPERIA X10 Android Development] Buddha:
wow. thanks for the info.

downloading the files right now.

will keep you updated ;)
[XPERIA X10 Android Development] khelwani:
Wow ,,, I think we should start a new forum in the X10's Fourms As Ubuntu for X10 :)

How is that for more powerful ??

Am a big fan of Ubuntu >>>

Thanks for all your efforts :)
[XPERIA X10 Android Development] anantshri:
DooMLoRD has given a very explanatory answer already so won't be repeating it.

Thanks Buddy to taking care of the thread in my absense.

We have not yet reached that level. Lets get the dual booting going on and then we can might need a proper forum here too :) lol
[XPERIA X10 Android Development] anantshri:
hi All,

just few updates from my side.

I have been in transit most of the time last 2-3 days so was off-line most of the time.

The update as of now from Ubuntu on Xperia side is

1) getting my phone prepared for dualbooting by getting .52 baseband. - done

2) understanding and custom tweaking chargemon. - WIP.

once i am confident on how not to screw the chargemon i will provide steps and will initiate the dual booting.

I hope i will be done with this by 2-3 days ..... will post updates as soon as i have some new stuff to report.
[XPERIA X10 Android Development] scanja500:
cant open ubuntu.sh?? :-(
[XPERIA X10 Android Development] anantshri:
One quick tip did you tried following steps.

on your terminal

$ su

# cd /sdcard/ubuntu

# pwd

/sdcard/ubuntu

# sh ubuntu.sh

i hope this way file should execute
[XPERIA X10 Android Development] scanja500:
Thx now it works!!! :-)))))
[XPERIA X10 Android Development] Yperion:
Do you use the framebuffer or try to port the drivers from android? If you manage to have native use of the screen then dualbooting with chargemon is piece of cake. I can also help on that if you wish....

Regards.
[XPERIA X10 Android Development] DooMLoRD:
@anantshri

after step (4)

can we execute:

startx

to start X session?
[XPERIA X10 Android Development] MrHassell:
startx script is a front end to xinit for running a single session of the X Window System. It is run with no arguments but can run with arguments..

~/.xinitrc starts and leaves the window manager running as the ''last'' application. Assuming that the window manager has been configured properly, the user then chooses the ''Exit'' menu item to shut down X.

~/.xsession is different in the case of using gdm or Gnome.

xrdb -load $HOME/.Xresources
xsetroot -solid gray &
xbiff -geometry -430+5 &
oclock -geometry 75x75-0-0 &
xload -geometry -80-0 &
xterm -geometry +0+60 -ls &
xterm -geometry +0-100 &
xconsole -geometry -0+0 -fn 5x7 &
exec twm

This xinitrc extract wouldn't work with X10 but can be modified using the correct values, already present. Is looking like the first cab off the rank after getting xCharge released.. @DoomLoRD how did you go with Java included sed commands? We need to catch up when you have a minute... :)

Got my X10 back working, am good to get back on with X10 work :)

Best Regards,

HRM
[XPERIA X10 Android Development] anantshri:
Thanks for the tips MrHassell and DooMLorD.

however in this case the problem is that we are running chroot environment and as such lack the display screens.

that is why we use the work around of VNCServer and hence the xstartup script is executed which is doing the task of startx in this case...

however thanks for the details coz i think this could help us in the dual booting.

one more update : I got the recovery source code J has provided the link of original recovery based on which i think i can look at that angle also which i discussed with both of you.
[XPERIA X10 Android Development] anantshri:
Yes buddy exactly my thoughts .. am yet to experiment on this front... hopefully tonight IST will try my first dual boot and will post results here.
[XPERIA X10 Android Development] Meikrekel:
Any news? I'm gonna start now on making that "ROM" with all the apps in it which I think should be in there;)
[XPERIA X10 Android Development] anantshri:
Please start on that buddy... I am going to try dual boot atleast once tonight...
[XPERIA X10 Android Development] Meikrekel:
Any news regarding the dualboot?
[XPERIA X10 Android Development] anantshri:
Me and DooMLorD did some initial work based on some stuff we were testing... tonight again we might sit together... tomorrow i am off for whole day... so planing to do something good tonight... :) will update all once i have some concrete progress.

Note: We were trying to implement the same chroot logic with loopmount on img however the stuff didn't seem to work and we get thrown back to the android os.
[XPERIA X10 Android Development] Yperion:
Even if your script fail, post it here and maybe some1 improve it to work correct...

Regards.
[XPERIA X10 Android Development] anantshri:
hey thanks for reminding.....

I totally forgot that this thread is now marked as development and i can post my progress all here.

ohk let me check and upload the latest chargemon and links for reference here.
[XPERIA X10 Android Development] anantshri:
Dual BooT Attempt one

Participants : DooMLorD, anantshri

we did following customization.

Note : i am using the freexperia xrecovery chargemon script as base for customization.

also i am right now working on getting dual boot using stock android kernel pretty much the same way as we did a chroot without the preety android gui in background.

so here is chargemon script customization as of now.

if [ -e /data/local/tmp/ubuntuboot ]
then
rm -rf /data/local/tmp/ubuntuboot
mount -o remount,rw rootfs /
cd /
rm -r /sdcard
rm init*
rm logo.rle
rm default.propx
mount -o remount,rw -t yaffs2 `mount | busybox grep /system | busybox awk '{print $1}'` /system
mount -o remount,rw -t yaffs2 `mount | busybox grep '/data yaffs2' | busybox awk '{print $1}'` /data
mkdir /mnt/sdcard
dosfsck -y /dev/block/mmcblk0p1
sleep 5
mount -t vfat -o rw,noatime,nodiratime /dev/block/mmcblk0p1 /mnt/sdcard
sleep 5
mknod /dev/block/loop255 b 7 255
losetup /dev/block/loop255 /mnt/sdcard/ubuntu/ubuntu.img
mkdir /data/local/tmp
mount -t ext2 /dev/block/loop255 /data/local/tmp
mount -t devpts devpts /data/local/tmp/dev/pts
mount -t proc proc /data/local/tmp/proc
mount -t sysfs sysfs /data/local/tmp/sys
echo "nameserver 8.8.8.8" > /data/local/tmp/etc/resolv.conf
echo "nameserver 8.8.4.4" >> /data/local/tmp/etc/resolv.conf
echo "127.0.0.1 localhost" > /data/local/tmp/etc/hosts
chroot /data/local/tmp /sbin/init
exit
fi

Also please find attached complete chargemon script.

Note:Please use Wordpad to open the file in windows.

The output was :failure.

the system was rebooting back to android i think the chrooting is having some issues.

also an interesting read would be

http://xdaforums.com/showthread.php?t=631389

although this uses fastboot however i am hoping we could port it our way.
[XPERIA X10 Android Development] anantshri:
alternate Display managers

If someone is still looking at finding more alternatives of display managers check this link

http://wiki.openmoko.org/wiki/Debian

might help us

i might work on creating the images for these later next week.
[XPERIA X10 Android Development] Yperion:
Ok, im not at home but you maybe try some things:

1st before mount the loop device try this: busybox mknod /dev/loop0 b 7 0

and mount the image on loop0

2nd if you can share the recovery.tar and when i have sometime i try to make your script to run from the recovery ramdisk, or you can try it by yourself...

ps: i have a mini pro and i cannt test the dualbooting method because it really need a lot of work, and in my screen, its impossible to do anything :(

ps2: now i see the mknod on your script :p

Regards.
[XPERIA X10 Android Development] anantshri:
Hey buddy,

pardon my ignorance but is it necessary to have ramdisk... can't i just bypass it completely.

and if not what is the exact usage of it.

also one more thing i wanted to know in case of fastboot we are able to provide options any idea how we can do it in chargemon.
[XPERIA X10 Android Development] DooMLoRD:
using ramdisk u can initiate/execute ur own init/init.rc scripts... so would be helpful for booting into ubuntu w/o getting into android OS..
[XPERIA X10 Android Development] Yperion:
We need the ramdisk, the original ramdisk is inside the boot.img and is the / folder, so even with fastboot the ramdisk is used. But with the ramdisk of the recovery we have just a basic system without all these useles stuff of android, and we dont need to mount /data and /system

ps: on the mount of the kernel filesystems (/proc /dev) try to use "mount -o bind *"

Regards.
[XPERIA X10 Android Development] anantshri:
Looks like another error in chargemon and battery drain... phone unstable.... flashing back SEUS... i have decided to move back to .54 and will continue my work on .54 instead of .52.

that allows me to work more easily.

Note : i know custom kernel's are not working or are not made compatible for .54
[XPERIA X10 Android Development] anantshri:
found the root cause of problem's

i forget to change permissions each time.

so finally made a simple script for myself

adb push chargemon /system/bin/chargemon
adb shell 04755 /system/bin/chargemon
adb shell touch /data/local/tmp/ubuntuboot
adb shell reboot

However now i have a new issue.

I am not able to chroot any of my images in my phone...

phone reboot's automatically after 1 minute.

anyone else encountered something simmilar.
[XPERIA X10 Android Development] DooMLoRD:
here is the "ramdisk" from the recovery we currently use... this one is for X10 from FreeXperia recovery... (check attachment)... Credits got to: jerpelea & zdzihu (for xRecovery)
[XPERIA X10 Android Development] Yperion:
Tnx dm, i ll try to mod it when i m back to home...

One question: if we chroot, since the ubuntu dont have a native screen output how can know that it work's?

So we must work with adb in recovery mode until we port the drivers...

But for now 1st priority is dual booting... (who knows maybe we have and db with 2 android versions soon :) )

Regards.
[XPERIA X10 Android Development] DooMLoRD:
hi Yperion... anantshri found a thread at Nexus One (N1) forums on how to boot into ubunto w/o chroot and get native display!!! they have mentioned links to native debian-arm drivers for qsd8k (N1 / X10) so lets hope anantshri can get them working for x10...
[XPERIA X10 Android Development] Yperion:
I m afraid that we must chroot at least once, maybe the guys in n1 use the bootlnader or any other hack. As im thinking right now we can make it to, but at least we need to make an endless loop on chargemon to keep down our /init, then to unmount the nand partitions and mount the ubuntu image and finally make a symlink for each folder of the ubuntu on the / directory....

Of course when the ubuntu try to initialize the enviroment maybe crash somewhere and reboots the phone, but in theory it is possible....

Regards.
[XPERIA X10 Android Development] Yperion:
Just a try with the chargemon, i m not sure if it works but i need to test something on the ramdisk before mod it...

http://db.tt/Gazpip7

Regards.
[XPERIA X10 Android Development] DooMLoRD:
i have a few suggestions/corrections:

if [ -e /data/local/tmp/ubuntuboot ]

then

rm -rf /data/local/tmp/ubuntuboot

mount -o remount,rw rootfs /

cd /

rm -r /sdcard

rm init*

rm logo.rle

rm default.prop

umount -l /data

mkdir /mnt/sdcard

mkdir /ubuntu

dosfsck -y /dev/block/mmcblk0p1

sleep 5

mount -t vfat -o rw,noatime,nodiratime /dev/block/mmcblk0p1 /mnt/sdcard

sleep 5

mknod /dev/block/loop0 b 7 0

losetup /dev/block/loop0 /mnt/sdcard/ubuntu/ubuntu.img

mount -t ext2 /dev/block/loop0 /ubuntu

mount -o bind /dev/pts /ubuntu/dev/pts

mount -o bind /proc /ubuntu/proc

mount -o bind /sys /ubuntu/sys

echo "nameserver 8.8.8.8" > /ubuntu/etc/resolv.conf

echo "nameserver 8.8.4.4" >> /ubuntu/etc/resolv.conf

echo "127.0.0.1 localhost" > /ubuntu/etc/hosts

chroot /ubuntu /ubuntu/sbin/init

exit

fi

what say?
[XPERIA X10 Android Development] Yperion:
On the default.prop it is correct, but in chroot /x1 /x2, x1 is the root dir of the new os, and x2 is the command for the initializing of the new os (i.e. /init ) but the path is based on how the fs looks after the chroot, so the corect is: chroot /ubuntu /sbin/init

Any news about the n1 way for boot? Any link?

Regards.
[XPERIA X10 Android Development] anantshri:
http://xdaforums.com/showthread.php?t=631389

Link for Nexus one thread.
[XPERIA X10 Android Development] anantshri:
I agree on chroot buddy... IT should be with reference to the internal file system after chroot.
[XPERIA X10 Android Development] Yperion:
Too bad he use "fastboot" so we cannt use his method for now...

Have you try to boot on ubuntu?

If you try it and your phone reboots, please let it boot on android and copy the file /proc/last_kmsg and upload it here...

Regards.
[XPERIA X10 Android Development] anantshri:
with

if [ -e /data/local/tmp/ubuntuboot ]
then
rm -rf /data/local/tmp/ubuntuboot
mount -o remount,rw rootfs /
cd /
rm -r /sdcard
rm init*
rm logo.rle
rm default.prop
umount -l /data
umount /cache
umount /sdcard
umount /cdrom
umount /data/DxDrm/fuse
umount -l /system
mount -o remount,rw -t yaffs2 `mount | busybox grep /system | busybox awk '{print $1}'` /system
mount -o remount,rw -t yaffs2 `mount | busybox grep '/data yaffs2' | busybox awk '{print $1}'` /data
mkdir /mnt/sdcard
dosfsck -y /dev/block/mmcblk0p1
sleep 5
mount -t vfat -o rw,noatime,nodiratime /dev/block/mmcblk0p1 /mnt/sdcard
sleep 5
mknod /dev/block/loop0 b 7 0
losetup /dev/block/loop0 /mnt/sdcard/ubuntu/ubuntu.img
mkdir /data/local/tmp
mount -t ext2 /dev/block/loop0 /data/local/tmp
mount -t devpts -o bind devpts /data/local/tmp/dev/pts
mount -t proc -o bind proc /data/local/tmp/proc
mount -t sysfs -o bind sysfs /data/local/tmp/sys
echo "nameserver 8.8.8.8" > /data/local/tmp/etc/resolv.conf
echo "nameserver 8.8.4.4" >> /data/local/tmp/etc/resolv.conf
echo "127.0.0.1 localhost" > /data/local/tmp/etc/hosts
chroot /data/local/tmp /sbin/init
exit
fi

the last_kmsg doesn't even created.

its just stuckk at SONY ERICSSON WHITE LOGO...
[XPERIA X10 Android Development] DooMLoRD:
post logcat for the bootup process... we can ask someone to check it...
[XPERIA X10 Android Development] Yperion:
Why you umount system? Try my chargemon few posts above.... At least it gives you a last_kmsg, if not we can try something else. Just try and post results and we can make it....

Regards.
[XPERIA X10 Android Development] anantshri:
logcat and last_kmsg attached for reference here...

note : this is after commenting out umount -l /system line

output is that phone boots into android gui but with errors and could not work properly till next reboot.
[XPERIA X10 Android Development] DooMLoRD:
guys i think we can create our own ramdisk for X10 based on ramdisks/custom kernels used by other QSD8250 devices for booting into Ubuntu...

if anyone can provide a link to the custom kernel (for ubuntu booting) i will extract ramdisk and then we can port it over to X10...
[XPERIA X10 Android Development] anantshri:
Link i gave previously

http://xdaforums.com/showthread.php?t=631389

another thread which i found just now.

http://www.android-devs.com/?p=152

This gives a more detailed instructions and i saw we are missing a few of them still....

Note : right now at office planning to test the other link in night time...

I hope in the mean time DooMLorD can do his magic.

Edit : after a lot of check these 4 links look a good read for all the understanding we need.

Linux on android

http://www.android-devs.com/?p=152

https://code.google.com/p/linux-on-android/

http://www.debianuserforums.org/viewtopic.php?f=7&t=456

http://www.androidfanatic.com/community-forums.html?func=view&catid=9&id=1615

now the work is some experimentation.
[XPERIA X10 Android Development] Meikrekel:
Any news here?
[XPERIA X10 Android Development] anantshri:
nothing concrete to say ....

I am just trying some more random tests... i am trying to find out which part of the statement is actually getting executed. out of all the execution statement set..

P.S. : Any update on the application list which you were preparing.
[XPERIA X10 Android Development] DooMLoRD:
trying to build a compatible ramdisk for Ubuntu on X10...
[XPERIA X10 Android Development] Meikrekel:
Uuhm, well on lxde I can get most done but I don't like that interface for a phone, but I still have that problem with VNC, every time I start ubuntu it makes a new address. Can you solve that please? After that it'll be a peace of cake to finish that list;)
[XPERIA X10 Android Development] anantshri:
are you using my ui script posted on first page... that has a check to prevent that.

also in case its still going on anything other then :1 check if you are killing vncserver or not.

also take a look @ killui.

my general practice is i do a killui and then a ui and i always get ui @ 5901.

the reason for that is

1) if vncserver is running

2) if tmp contains a file which is lock file.
[XPERIA X10 Android Development] anantshri:
Mouth watering.

however i have stumbled a few more road blocks.

I was a bit suspecious about all the chargemon steps actually executing or not.

so i tried this modified script..

if [ -e /data/local/tmp/ubuntuboot ]
then
rm -rf /data/local/tmp/ubuntuboot
mount -o remount,rw rootfs /
cd /
rm -r /sdcard
rm init*
rm logo.rle
rm default.prop
[B]# umount -l /data
# umount /cache
# umount /sdcard
# umount /cdrom
# umount /data/DxDrm/fuse
# umount -l /system
[/B] mount -o remount,rw -t yaffs2 `mount | busybox grep /system | busybox awk '{print $1}'` /system
mount -o remount,rw -t yaffs2 `mount | busybox grep '/data yaffs2' | busybox awk '{print $1}'` /data
mkdir /mnt/sdcard
dosfsck -y /dev/block/mmcblk0p1
sleep 5
mount -t vfat -o rw,noatime,nodiratime /dev/block/mmcblk0p1 /mnt/sdcard
sleep 5
mknod /dev/block/loop0 b 7 0
losetup /dev/block/loop0 /mnt/sdcard/ubuntu/ubuntu.img
mkdir /data/local/tmp
mount -t ext2 /dev/block/loop0 /data/local/tmp
mount -t devpts -o bind devpts /data/local/tmp/dev/pts
mount -t proc -o bind proc /data/local/tmp/proc
mount -t sysfs -o bind sysfs /data/local/tmp/sys
[B] echo "Reached this level" > /data/local/tmp/root/status.txt
[/B] echo "nameserver 8.8.8.8" > /data/local/tmp/etc/resolv.conf
echo "nameserver 8.8.4.4" >> /data/local/tmp/etc/resolv.conf
echo "127.0.0.1 localhost" > /data/local/tmp/etc/hosts
[B] chroot /data/local/tmp /root/xtr.sh
# chroot /data/local/tmp /sbin/init
[/B] exit
fi

modification bolded.

However this file status.txt is not getting created which means only one thing the img file loopmounting is not working.

need help in analysing the chargemon script.

my complete chargemon attached below.
[XPERIA X10 Android Development] DooMLoRD:
dude i am a bit skeptical regarding this (i am not sure if it will work):

mount -t ext2 /dev/block/loop0 /data/local/tmp

why not dump the "status.txt" to /sdcard/ OR /mnt/sdcard/ since u are already mounting it?

P.S.: put some more "debug code"/"status.txt" outputs
[XPERIA X10 Android Development] anantshri:
good idea.... will update in a an hour right now uploading some pics of my friday trip....
[XPERIA X10 Android Development] Yperion:
Try to comment the "dosfsck", there is no reason to use it, at least for this step....

Also use the mtdblock for /data and /system mount, this script runs only on x10 so there is no need to use awk....

ps: for /proc, /dev etc. use the "mount -o move /proc /ubuntu/proc" or any other path... Maybe there is some problem with bind and chroot...

Regards.
[XPERIA X10 Android Development] DooMLoRD:
@Yperion

the awk/grep trick is actually much needed on X10...

there are various partition layouts on different X10 versions... so the MTDBLOCK for /system & /data is different on some device... X10 & X10HD have different partition layouts... even some X10s also have different ones... zdzihu had found this problem out when he was creating xRecovery... thats why a unified version of xrecovery was released...
[XPERIA X10 Android Development] Yperion:
Oh, i didnt remember that... But at this point we have a bug into the script and we must remove some functions to make easier the first succesfull build...

Anyway best of luck, i wish to have a x10 but since i dont, i cant provide any actual help on the project... :(

Regards.
[XPERIA X10 Android Development] anantshri:
you are already helping a lot buddy.... I am back from work and running some test i think i might be able to pin point the problem in say 10 - 15 minutes, will update as soon as i get the point marked. and ya disabling dosfsck right now.
[XPERIA X10 Android Development] anantshri:
I think i found the problem.

SDCARD is not getting mounted and hence all the other steps getting failed.

I have modified the chargemon as listed below.

if [ -e /data/local/tmp/ubuntuboot ]
then
rm -rf /data/local/tmp/ubuntuboot
mount -o remount,rw rootfs /
cd /
rm -r /sdcard
rm init*
rm logo.rle
rm default.prop
[B] echo "Start of system " > /data/local/status.txt
mount >> /data/local//status.txt
[/B] mount -o remount,rw -t yaffs2 `mount | busybox grep /system | busybox awk '{print $1}'` /system
mount -o remount,rw -t yaffs2 `mount | busybox grep '/data yaffs2' | busybox awk '{print $1}'` /data
mkdir /mnt/sdcard
[B] echo "ReMount RW of system and data" >> /data/local/status.txt
mount >> /data/local/status.txt
[/B] sleep 5
mount -t vfat -o rw,noatime,nodiratime /dev/block/mmcblk0p1 /mnt/sdcard
sleep 5
[B] echo "SDCARD mounting" >> /data/local/status.txt
mount >> /data/local/status.txt
echo "1/1 : SD CARD Mounted" > /mnt/sdcard/status.txt
[/B] mknod /dev/block/loop0 b 7 0
[B] echo "2/2 : create loop file" >> /mnt/sdcard/status.txt
[/B] ls -l /dev/block/loop* >> /mnt/sdcard/status.txt
[B] echo -n "settingup loop : " >> /mnt/sdcard/status.txt
[/B] losetup /dev/block/loop0 /mnt/sdcard/ubuntu/ubuntu.img
[B] echo $? >> /mnt/sdcard/status.txt
[/B] mkdir /data/local/tmp
mount -t ext2 /dev/block/loop0 /data/local/tmp
mount -t devpts -o bind devpts /data/local/tmp/dev/pts
mount -t proc -o bind proc /data/local/tmp/proc
mount -t sysfs -o bind sysfs /data/local/tmp/sys
[B] echo "Mount Points" >> /mnt/sdcard/status.txt
mount >> /mnt/sdcard/status.txt
echo "IMG LISTING" >> /mnt/sdcard/status.txt
ls -l /data/local/tmp >> /mnt/sdcard/status.txt
[/B] echo "Reached this level" > /data/local/tmp/root/status.txt
echo "nameserver 8.8.8.8" > /data/local/tmp/etc/resolv.conf
echo "nameserver 8.8.4.4" >> /data/local/tmp/etc/resolv.conf
echo "127.0.0.1 localhost" > /data/local/tmp/etc/hosts
[B] echo "3/3 : Chrooting now " >> /mnt/sdcard/status.txt
[/B] chroot /data/local/tmp /root/xtr.sh
exit
fi

here i only got /data/local/status.txt as the sdcard itself is not getting mounted.
[XPERIA X10 Android Development] Yperion:
You must mount the sdcard manually in chargemon script, dont use all the options just rw and type vfat, if have problem on this check the output of "mount" command to find the block of the sd...

Regards.
[XPERIA X10 Android Development] DooMLoRD:
can u tell which version of recovery are u using? [here is how to find that out]
[XPERIA X10 Android Development] anantshri:
its free xperia recover type 2.

i installed it using flash tools latest version