Installing Debian Squeeze on Android Optimus - Walkthrough

Search This thread

bigsupersquid

Senior Member
Sep 22, 2010
2,254
1,671
BFE, MO
Google Pixel 4a 5G
now that you mention swype.i have the beta and in terminal emulator when you typw i with swype beta it makes the i capitol and nothing you can do to keep it lowercased.i had to use the android keyboard to type in the terminal.it wasnt really bad except when typing xbin for the folder ,it typed xbIn and there is no such folder.but it did happen on every i i typed with swype only in the terminal emulator.it works fine for everything else.

it's a known bug with the beta 3.
I put the second bug report about it on their forum, and admin acknowledged they found it themselves just after release.
try swyping a word with 'i' in it and delete the letters around it, or entering the command you need into it's dictionary in another app like messaging.
 
Last edited:

ummkiper

Senior Member
Jun 11, 2009
754
95
Denton,TX
it's a known bug with the beta 3.
I put the second bug report about it on their forum, and admin acknowledged they found it themselves just after release.
try swyping a word with 'i' in it and delete the letters around it, or entering the command you need into it's dictionary in another app like messaging.

eh its not biggie for me i just used the android keyboard and it went fine.
 

uamadman

Member
Apr 14, 2011
19
6
Think Rockets
It appears even running linux on a android doesn't get me around the youtube barrier against android phones while running on 3g. get_flash_videos works very well but seems to be based off the same restrictions.

I'm checking into 2 things:

1. I'm going to see if this barrier is still in effect when connected to a wifi.
2. Can i use my home PC as a proxy to mask my phones IPaddress and gain access to youtube restricted files. - Tried this with a market app - unsucessful.
 
Last edited:

bigsupersquid

Senior Member
Sep 22, 2010
2,254
1,671
BFE, MO
Google Pixel 4a 5G
It appears even running linux on a android doesn't get me around the youtube barrier against android phones while running on 3g. get_flash_videos works very well but seems to be based off the same restrictions.

I'm checking into 2 things:

1. I'm going to see if this barrier is still in effect when connected to a wifi.
2. Can i use my home PC as a proxy to mask my phones IPaddress and gain access to youtube restricted files. - Tried this with a market app - unsucessful.

um, restricted files?
I knew hulu blocked android browser/user agent, but wasn't aware of any similar thing with youtube.
there are videos which are age-restricted and require a login cookie, get-flash-videos probably doesn't eat cookies and so can't give the crumbs back from a browser login. probably unless you can manufacture an iceweasel plugin for get-flash-videos you're probably SOL for sites which need a login to watch with a 'normal' browser.
 

uamadman

Member
Apr 14, 2011
19
6
Think Rockets
Well i don't think is its a age restriction or requires a log on.
I PM'ed you a link that is an example. It works when i run it from my Ubuntu install on my PC but not from the android terminal.
 

bigsupersquid

Senior Member
Sep 22, 2010
2,254
1,671
BFE, MO
Google Pixel 4a 5G
I noticed last night that my wifi AP wouldn't run with debian running.
dang.
edit: ok, it wouldn't start or stop the AP during chroot. it works fine as long as the AP is initialized or halted before or after starting the chroot (with AOSP. My wifi borked completely until reboot after running the chroot with Bumblebee.)

still looking into that ringtone issue. hadn't found anything comparable running aospC except the AP. it worked as soon as I exited the chroot. :/
maybe I'll try setting up a wifi network through debian to get around that. then I wouldn't be stuck with wpa2 encryption either. :evil:
 
Last edited:

bigsupersquid

Senior Member
Sep 22, 2010
2,254
1,671
BFE, MO
Google Pixel 4a 5G
UPDATE: gnash and mplayer partly working even with VNC!

xorg is slow.
add a decent-sized GUI like xfce, and choke it all with the VNC and things really creep.
I've been experimenting with different window managers and tried dwm (tutorial here, you'll need it to use the GUI as key combos are neccesary to open programs or a terminal.)

it's tiny, and fast (and unfortunately not really user friendly with a soft keyboard.) even with the VNC, it's a lot faster than the full desktop managers.

fast enough to let gnash play short videos from youtube dropping some frames, or lame online flash browser games just to show it kind of works.
fast enough to use mplayer on files on the sdcard, with much less framedropping than gnash.

hulu force closes iceweasel testing gnash on that site, and mplayer is having issues with alsa permissions and so remains soundless, but can probably be reconfigured.

don't get me wrong, the VNC still chokes video enough to make it unpleasant to watch, but the minimal window manager is a step in the right direction towards getting flash in a usable state on this device.

if anyone's motivated besides me, sdl 1.3 has official support for android built in, supposedly.
I tested scummvm (compiled with sdl into an apk) and sdl definitely is functional, with accelerator functions supported for the gpu!

it could be used with the ndk to make single-window apps for android which run debian programs... at least in theory.
been looking into it a while, just thought I'd throw the info out there for other programmer types to poke at.

if you want to test dwm but not have to figure out how to install it:
Code:
apt-get install dwm
Code:
echo "#!/bin/sh xrdb $HOME/.Xresources 
xsetroot -solid grey 
export XKL_XMODMAP_DISABLE=1 
dwm&" > /root/.vnc/xstartup
that will set it up to autostart with the VNC.
if you want some program to run on startup, like thunar file manager for example, or iceweasel,
add the program name followed by & on another new line after dwm&
like:
Code:
echo "#!/bin/sh xrdb $HOME/.Xresources 
xsetroot -solid grey 
export XKL_XMODMAP_DISABLE=1 
dwm&
thunar&" > /root/.vnc/xstartup
enjoy the possibilities!
 
Last edited:
  • Like
Reactions: wizardlord

wizardlord

Member
Jul 3, 2011
12
1
I am going to try this over the weekend following your write up on the second page. Mainly I want to use it for the added security linux will give me while using the web on my phone. I would feel much more comfortable tethering using linux. What chipset does the wifi in the optimus v use? Thx bigsupersquid for pointing me to this thread!!!
 
Last edited:

bigsupersquid

Senior Member
Sep 22, 2010
2,254
1,671
BFE, MO
Google Pixel 4a 5G
I am going to try this over the weekend following your write up on the second page. Mainly I want to use it for the added security linux will give me while using the web on my phone. I would feel much more comfortable tethering using linux. What chipset does the wifi in the optimus v use? Thx bigsupersquid for pointing me to this thread!!!
if you're worried about security, be sure to adduser and login with whatever username you add so you're not browsing as root. also bear in mind iceweasel is slow, especially in the vnc.
I haven't yet searched out the wifi chipset specs. the phone core cpu/gpu/audio/radio is qualcomm msm7267.
to mess with wifi in debian, turn on wifi before running the debian chroot. debian will just see it as an accessible connection that way. not sure if wifi works at all with bumblebee instead of aospCmod, my bumblebee testing was rather limited, but if it does work, you'll definitely have to turn it on before the chroot. trying to turn it on or off with the chroot active will bork the wifi until reboot.
and, you're quite welcome, I've been a little surprised how little interest there's been in this.
 

dubb83

Senior Member
Mar 27, 2011
52
10
If the phone had a bit more power to run a pretty GUI I would be all over it, until then I use my pc or laptop for linux.

Great post though by the way.

Sent from my VM670 using XDA App
 

wizardlord

Member
Jul 3, 2011
12
1
I am having problems with my usb mass storage. At first I thought it was windows7 being buggy so I plugged into my laptop running ubuntu and usb mass storage worked.for a minute. Now no matter what machine I plug into mass storage doesnt work. I tried pairing with bluetooth and had no luck. I tried all the tricks mount unmount sdcard turn off on usb debugging. I even reinstalled bumblebee no dice. Unless you have some wisdom I missed out on I am going to see if radioshack can replace my phone. If that doesnt work I will get phone insurance thru virgin and reflash the stock rom then exchange.

I am still going to try this but I have to get my phone sorted. and I usually have such good luck with electronics.Everything else still works btw but I really would like mass storage to function properly.
 
Last edited:

bigsupersquid

Senior Member
Sep 22, 2010
2,254
1,671
BFE, MO
Google Pixel 4a 5G
I am having problems with my usb mass storage. At first I thought it was windows7 being buggy so I plugged into my laptop running ubuntu and usb mass storage worked.for a minute. Now no matter what machine I plug into mass storage doesnt work. I tried pairing with bluetooth and had no luck. I tried all the tricks mount unmount sdcard turn off on usb debugging. I even reinstalled bumblebee no dice. Unless you have some wisdom I missed out on I am going to see if radioshack can replace my phone. If that doesnt work I will get phone insurance thru virgin and reflash the stock rom then exchange.

I am still going to try this but I have to get my phone sorted. and I usually have such good luck with electronics.Everything else still works btw but I really would like mass storage to function properly.

I've read that formatting the SD card in a reader in a PC can help, or try another SD card if you have one.
 

wizardlord

Member
Jul 3, 2011
12
1
I got it sorted out today. It turn outs a bluetooth driver update was concflicting with usb mass storage. I was getting the audio notification from windows for a new device so I uninstalled the lg cdma device replugged it and bam. I wish I had knew it was the damn bt dongle before I trouble shooted for hours.:eek:

It turns out the new broadcom widcomm drivers wont install for most people so folks have been doing a manual uninstall but what happens is a total system wipe. These drivers sounds buggy cause my problem.:confused:

here is a link
http://answers.microsoft.com/en-us/...uter-new/ffe5f236-da04-4c3c-8df9-696080ec9d0c

http://boardreader.com/thread/Widco...2x__ffe5f236-da04-4c3c-8df9-696080ec9d0c.html


There are a bunch a folks having this issues I thought I would give my fellow gurus a heads up.:cool:

Ok so now onto business. I am going to run through the set up tonight If I run into snags I will post here.:)
 

uamadman

Member
Apr 14, 2011
19
6
Think Rockets
been a while since i posted ^.^

I'm trying to get my debian distro to register a usb to serial port.
I have some tuning software loaded to tune my race car but not serial port means bad explosion of error messages from the software.

Mine doesnt seem to recognize the command "isusb" does yours bigsquid?

Further more it seems like mine is missing the core usb modules. i'm kinda chasing a mosquito in the dark here...

A usb throughway with a 5v powersupply connecting a usb to serial and standard usb to mini usb. ... yes i am in hell ^.^
 
Last edited:

bigsupersquid

Senior Member
Sep 22, 2010
2,254
1,671
BFE, MO
Google Pixel 4a 5G
Code:
apt-get install usbutils
I think you might be after "lsusb" instead of "isusb" as well.
theres a thread (I think for the o-one p500) on here somewhere which tells how another user got usb host mode working.
http://xdaforums.com/showthread.php?t=1051282
he had to use a hacked plug and compile usb support into the kernel.

the aospbot kernel from his released rom on xda seems to have a lot of usb functions enabled in the .config file. google search "github.com aosp" if you want source. I was able to get it to compile.
you can also extract the aospbot kernel from his boot.img, I suggest finding his rom's 6/1 release from links in his thread in this section on xda.
the easiest way to test that kernel would be to flash his rom, it plays nice with debian.

I'd like to see usb support working myself, keep us posted!
 
Last edited:

uamadman

Member
Apr 14, 2011
19
6
Think Rockets

bigsupersquid

Senior Member
Sep 22, 2010
2,254
1,671
BFE, MO
Google Pixel 4a 5G
the codeaurora msm kernel looks to have host mode enabled, and host mode can be activated/deactivated from the command line.
https://www.codeaurora.org/gitweb/quic/le/?p=kernel/msm.git;a=commit;h=9ea88891c0326206e1c5a8bcbdb402ad692d0ffa
ath3nos might build for you, but I read he's having personal, um, troubles; hopefully he'll be better soon.
blarf with his IHO project (which ath3nos is building from except for zefie's xionia kernel) seems to really be on his game, but he might just point you to how to build the kernel yourself (it's not that horrible to do)
I suggest the codeaurora kernel, it's designed for the chipset in the OV and OS.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Installing Debian Squeeze on Android Optimus S - Walk-throughs

    This is slowly becoming a larger topic. So for now i will post various ways proven to work on the Optimus S and V as links below:

    Installing Debian Squeeze on Android Optimus - Walk-through Compiled by uamadman
    Install Debian Squeeze - non-loop sd-ext chroot method (prebuilt!) By bigsupersquid
    ALL-Thumbs GUI to replace LXDE By bigsupersquid
    4 Steps to Linux on your Optimus S - written by uamadman hosted by uamadman
    3
    non-loop sd-ext chroot method (prebuilt!)

    Standard disclaimer:
    These scripts and chroot method may bork up your phone, trash your userdata, destroy system files, get you slapped by your mother, make your phone catch fire and/or explode, and etc., ad nauseum.
    Use at your own risk.
    MAKE A NANDROID BACKUP BEFORE DOING THIS!
    You'll probably be just fine, but it's nice to have a backup in case something goes haywire.

    Disclaimer aside, it's worked great for me since March, hasn't crashed for months, and I use it multiple times per day.

    My main inspiration was Saurik and his Debian & Android together on G1.
    I'm sorry that I can't point to all the many, many sources I read through over the couple weeks it took me to get this set up, I took little bits from here, there, and everywhere, but Saurik's work was the main core of this system.
    Apologies if you see some tidbit of your work in this... let me know and I'll be happy to give you credit.

    Dysfunctions:
    things that don't work while the chroot is running:
    wifi hotspot in aospCmod and Bumblebee won't initialize; does work during chroot in aospCmod if turned on before chroot, though.
    network info II app won't start during chroot; if opened before chroot it's fine.
    ringtones on SDcard don't work in Bumblebee; but OI File Manager can read the sdcard during chroot.
    these things still work ok once the chroot is exited on aospCmod. The chroot borks wifi on Bumblebee until reboot.

    Info:
    This script remounts / and /system both read/write and leaves them that way until you type exit in the bash shell of the chroot. Without r/w mounting of the / directory, installing Debian packages gives some errors, since it's running in the real root filesystem. Also, the / directory is wiped out on a reboot, so it's relatively safe to have mounted r/w. /system doesn't need to be r/w, I just like it that way, and I haven't had trouble with it since I was first experimenting with this. Feel free to modify the 'boot' script if having /system mounted r/w makes you nervous.

    This has been tested on Zefie'sCM7 (outdated) and aospCmodOV ROMs.
    It also worked on Bumblebee, but not as effectively.

    The chroot will not stop Android from functioning. If Debian is busy with something, it will slow Android down, though.
    You will still get/can make phone calls, text messages, etc. You can send the VNC viewer to the background and use Android apps while the Debian system is in the background.

    On to the meat of the matter. I'm using an 8Gb SD card. I advise no smaller than 4Gb unless you just want to do command-line work in Debian and don't need a GUI.

    First, these instructions require a Linux pc. On M$ Windoze? Use a Live CD or a virtual box, or you're on your own.

    The first part of these instructions is to be completed on your pc. I'll let you know when to switch to the phone.

    1) Mount your <empty> SD card on the pc. If it's not empty, back it up, because this will wipe it out. You'll need at least two partitions on it, three if you're using something like apps2sd (which I'm not using, and not really familiar with, so this tutorial is set up assuming you don't need to dodge an existing ext partition,) and another if you have a swap-enabled kernel and want to use it.

    2) Use Gparted or a similar tool to partition the SD card. First partition FAT32 for Android, whatever size you feel you need. I'm using 1Gb.
    Second partition is an ext2, ext3, or ext4 partition. Apps2SD style, you know what size and filesystem type you need here, I don't. For Debian on the 2nd partition, I advise 3Gb or more, ext2. ext4 corrupted my files, so I switched back to ext2. If you need an apps2sd partition, Debian will go on the 3rd partition, and you'll have to modify the two attached scripts accordingly.
    If you're lucky enough to have a swap-enabled kernel, you can make a swap partition; it'll go last, whatever size is left. 256Mb-1Gb should be plenty depending on whether you use image processing or large compiling projects or some other memory hogging programs.

    3) Mount the sd FAT32 and Debian ext partitions on the pc.

    4) Download to your pc the base Debian Squeeze filesystem which I've debootstrapped, configured, and uploaded for you to save hours of hassle.
    Also download to the same directory the two attached script files.
    boot.txt

    firstrun.txt

    5) Open a ROOT shell. You need root privleges to untar the filesystem and retain its permissions. If you don't have a root shell, put sudo in front of the tar and cp-av commands.

    6) cd to the directory you downloaded the squeeze_05_2011.tar.gz into. then type
    Code:
    tar -zxvf squeeze_05_2011.tar.gz
    cp -av ./freshsqueeze/* /full/path/to/sdextDebianpartition
    sync
    and wait for it to finish.

    7) type
    Code:
    cp ./boot.txt /full/path/to/sdFAT32partition/boot
    cp ./firstrun.txt /full/path/to/sdFAT32partition/firstrun
    sync

    8) Now is the time to copy back the stuff you backed up from the SD card to the FAT32 partition, and any apps2sd style stuff if you have it. Then unmount your SD card and put it in the phone.

    Now all remaining steps are done on your Optimus. You're finished with the desktop pc.

    9) Open a terminal on your Optimus. I like SL4A, but Terminal Emulator works well too. Both are free.

    10) Next step merges your existing Android system files into the Debian partition. This is neccesary because I haven't compiled a kernel and don't know of one for the Optimus with UFS enabled. So, Debian gets bind-mounted over the Android rootfs ( / directory) and having the Android system files accessible in the Debian filesystem is required to keep them playing nicely together, while protecting the original Android files from Debian at the same time.
    Code:
    sh /sdcard/firstrun
    You won't need this script ever again unless you change ROMs and/or need to reinstall Debian. Changing ROMS without reinstalling a fresh copy of Debian may mess things up a bit since system files vary between ROMs and you'll still have the Android files from your previous ROM in your Debian filesystem.

    This script and the 'boot' script are both listed at the bottom of this post if you want to read 'em.

    11) Next, remount system r/w, copy the 'boot' file to /system/xbin and chmod 4755 /system/xbin/boot. If scripts are in /system/xbin and executable, you can run them with 'su -c'
    Code:
    su
    mount -o remount,rw /system /system
    cp /sdcard/boot /system/xbin
    chmod 4755 /system/xbin/boot
    mount -o remount,ro /system /system

    OK, a basic Debian filesystem with no extra packages is now installed!

    my Debian filesystem is on my 2nd sdcard partition. The comments in the 'boot' script should explain how to use another partition if you have apps2sd running or somesuch (I don't have many Android apps on my phone so don't need/use apps2sd function)

    to use the script as-is, your linux flavor should be in the 2nd card partition. I use Debian, but any Debian-based distro should work, for example Ubuntu or DSL.
    open a terminal and type
    Code:
    su -c boot
    don't kill the terminal app... leave it running in the background.
    when you're finished with linux, reopen the same terminal and type
    Code:
    exit
    to cleanly dismount your linux. No reboot required!

    Before you exit the first run of your new Debian system, you should download some packages. I advise tightvncserver, xfce4 (and xfce4-goodies if you want the extra glitz like a cpu monitor, bandwidth monitor, and such, without hunting the individual packages) and iceweasel so you can have a real rebranded firefox on your Optimus.
    Code:
    apt-get update
    apt-get install tightvncserver xfce4 xfce4-goodies iceweasel
    It'll take a while to download all that. Lots of data.

    Once it's done downloading, configure tightvncserver.
    Code:
    vncserver
    It'll ask you for a password. Choose one that's easy to remember. You'll need to enter it in the VNC viewer as well (next step)
    IMPORTANT!
    tightvncserver will ask you if you want a view-only password. Tell it no!

    next:
    Code:
    vncserver -kill :1
    to politely exit the vncserver. Otherwise you'll have to exit the chroot, reboot the phone, and run the 'boot' script again or it'll open server :2, :3, and so on each time you type vncserver. Each instance will eat more CPU, RAM, etc.

    configure /root/.vnc/xstartup
    Code:
    echo '#!/bin/sh
    xrdb $HOME/.Xresources
    xsetroot -solid grey
    export XKL_XMODMAP_DISABLE=1
    xfce4-session&' > /root/.vnc/xstartup
    after that,
    you should use
    Code:
    passwd
    to set a root password, and
    Code:
    adduser
    to get a non-root account on there.
    Code:
    exit
    will close the chroot. You can close the terminal after that until you're finished setting up the VNCviewer and want to start your lovely GUI.

    Now, set up the VNC viewer like in the OP. Make sure your password matches the one you gave tightvncserver!
    I advise 24 bit color. It slows things down ever so slightly, but to me, it's well worth the increase in eye candy you get over 8 bit.

    most of the tutorials on the VNC suggest modifying the /root/.bashrc file to start the vncserver automatically (like here on xda) but I don't like that myself. I use the shell a lot, and the vncserver eats system resources. So, I manually start and stop the vncserver from the command line.
    Code:
    vncserver
    to start, it defaults to a 1024x768 which seems to make programs happier than the 480x320 phone native resolution.
    Code:
    vncserver -kill :1
    to stop it politely. Otherwise a phone reboot is required to get rid of vncserver files (by clearing out everything in the / directory which isn't replaced by the boot.img ramdisk) which make it open desktop :2, :3, and so on each time you run the program.

    One major advantage to the bind-mounting in the rootfs is that Thunar works as a root explorer, and has access to the entire Android filesystem (except for the bind-mounted Debian directories, which hide the Android directories underneath, including /system/etc which is symlinked to /etc by the boot.img ramdisk,) as well as the complete Debian filesystem.
    Pretty much everything I've tried works, unless it wants speed from the display. The VNC just slows that down way to much to use for video or games or suchlike. I'm working on native window support for X, but I need more practice in C to get it done.
    Iceweasel works great, if a little slow, a rebranded full firefox on an ARMv6 device that mozilla won't release an apk for its wussy mobile version on. Go figure. The biggest problem is finding plugins compiled for ARM, the 'get plugin' button send you to sites offering x386 versions of the plugins. Yuk.
    Icedtea open source java works fine.
    Gnash plays ads but not videos.
    Gimp works well.
    Qemu works!
    Eclipse even installs and runs (very slowly)
    get-flash-videos captures flash exceptionally well. combined with an Android video player for .mp4 files, you can download and watch flash from lots of places, just not streaming.
    alsa audio works through Iceweasel. Played audio clips from yodajeff.com just to test it.
    3g works great.
    Wifi detects the connection with iwconfig, I haven't tried sending data through it but the way 3g plugs right in I bet that wifi works equally well.
    Since wifi and 3g work out of the box, I bet bluetooth would too with some config, but it needs extra packages to see the functionality.
    The network meter plugin for xfce works. The device is rmnet0.
    The cpu meter plugin also works.
    At one point I had the battery meter from xfce-power-manager working but my last install broke it somehow. Ah, well.

    once it's all together
    open a terminal

    to start it up:
    Code:
    su -c boot

    for a gui,
    Code:
    vncserver

    to kill the GUI,
    Code:
    vncserver -kill :1

    to exit the chroot,
    Code:
    exit

    the first time you run the GUI, you might want to add my Xfce_large theme to make the scrollbars and menubars easier to hit on the touchscreen. See the earlier post.

    hopefully this helps people out. I spent quite a while getting it just how I wanted it, many googlings and picking bits from here and there.

    contents of the scripts follow.
    firstrun
    Code:
    #make /sd-ext directory if it doesn't exist
     if [ ! -d /sd-ext ]
    then
    mkdir /sd-ext
    fi
    # mount 2nd sdcard partition
    # if your linux is on a different partition than 2, substitute that number for the 2 in .../mmcblk0p2 below
    # first unmount it; if not already mounted, system will echo 'umount: can't forcibly umount /dev/block/mmcblk0p2: Invalid argument' but this isn't an error to worry about
    
    umount -l /dev/block/mmcblk0p2
    mount -o noatime,exec,suid /dev/block/mmcblk0p2 /sd-ext
    #copy files from Android to Debian without overwriting anything
    yes n | cp -aiv /etc/* /sd-ext/etc
    yes n | cp -aiv /root/* /sd-ext/root
    yes n | cp -aiv /sbin/* /sd-ext/sbin
    yes n | cp -aiv /sys/* /sd-ext/sys
    boot
    Code:
    # debian lives here
    
    export mnt=/sd-ext
    
    # remount / and /system rw
    
    mount -o remount,rw / /
    mount -o remount,rw /system /system
    
    # make new subdirectories in / for binding
    
    for x in \
        bin boot home lib media \
        opt selinux tmp usr var
    do
    mkdir /$x
    done
    
    #make $mnt directory if it doesn't exist
     if [ ! -d $mnt ]
    then
    mkdir $mnt
    fi 
    
    # mount 2nd sdcard partition
    # if your linux is on a different partition than 2, substitute that number for the 2 in .../mmcblk0p2 below
    # first unmount it; if not already mounted, system will echo 'umount: can't forcibly umount /dev/block/mmcblk0p2: Invalid argument' but this isn't an error to worry about
    
    umount -l /dev/block/mmcblk0p2
    mount -o noatime,exec,suid /dev/block/mmcblk0p2 $mnt
    
    # cleanup last session's tmp files, including last VNC session
    
    rm -r -f $mnt/tmp
    mkdir $mnt/tmp
    
    # bind mount debian directories to /
    
    for x in \
        bin boot home lib media \
        opt selinux tmp usr var \
        etc root sbin
    do
    mount --bind $mnt/$x /$x
    done
    
    # set some system variables
    
    export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/etc:/sys:$PATH
    export TERM=linux 
    export USER=root
    export HOME=/root
    
     # mount proc,sys,devpts
    umount -l devpts
    mount -o remount -t proc proc /proc
    mount -o remount -t sysfs sysfs /sys
    mount -t devpts devpts /dev/pts
    
    # softlink framebuffer (for future use,) and existing mounts
    ln -s /dev/graphics/fb0 /dev/fb0
    cat /proc/mounts > /etc/fstab
    cat /proc/mounts > /etc/mtab
    
    # 'boot' with chroot into debian bash shell at /
    
    chroot / /bin/bash
    
    # done now, clean up after exit to keep Android happy
     # remove softlinks and replace backed up mtab and fstab
    rm /dev/fb0
    
    cd /
    
     # unmount subdirectories
    for x in \
        bin boot home lib media \
        opt selinux tmp usr var \
        etc root sbin
    do
    umount -l /$x
    done
    
     # remove non-Android subdirectories
    for x in \
        bin boot home lib media \
        opt selinux tmp usr var
    do
    rmdir /$x
    done
    
    # remount / and /system ro
    mount -o remount,ro / /
    mount -o remount,ro /system /system
    1
    All of this work was done by other people. I am simply compiling information and specializing it to the Optimus S.
    This method does not require a pc, and everything is done through your android interface.




    Current Abilities I've tested with success.
    Play Sound
    Surf the web
    Access entire SD Card

    Currently Working on:
    Flash Support through IceWeasel

    Completed:
    Making this a simple download and phone restore - Done


    Needs:
    A GUI with bigger buttons and scaled for 480x320 - Done thanks bigsupersquid
    Transparent Keyboard

    Sources:
    Howto Install Ubuntu by NexusOneHacks.net

    secret hidden note to self psychocats.net/ubuntu/nonfree


    Lets begin.

    You need the following requirements:
    Recommended: 2+ gigabytes of free SD card Space (Minimum 1.25gb)
    A Rooted Optimus S
    Kernel/Recovery: Xionia CWMA v1.2518.6
    ROM:The Scott Pilgrim ROM (CM7 Gingerbread, Zefie Edition)
    BusyBox Installer - You can get this from google apps store by JRummy16
    Linux Installer – You can get this from google apps store by Galoula

    Items worth having to things that make this easier:
    A Wifi Internet Connection
    A fully Charged Battery and a Wall Charger ^.^
    2 Bottles of Mountian Dew
    Your favorite Movie
    and
    The Patience to NOT Touch/use your phone for the 2 hours needed to complete the initial install process.

    I started this endeavor with a clean install of the ROM listed above.

    !!Make backups if you MUST save your data before you proceed any further!!

    Warning: In The Simplest Terms(More detail will be in the final walkthrough)
    Sometimes the Linux Installer doesn't work or if it is working and the process is interrupted while creating the .LOOP or extracting the build. The Linux Installer will stop working. I've found two (2) ways to fix the issues. The first is to go into setting and clear the cache for Linux Installer, Then open the superuser app and forget the permissions assigned to Linux Installer (Note: Try this a few times before resorting to a clean wipe, this method sometimes takes a few tries). The second is a clean wipe/recovery of the phone. Additionally if for some reason there is a interruption and the process stops. reboot the phone delete linux.loop off your sdcard and start from scratch. BEWARNED


    *Walk-through - Under Construction*
    To clarify any confusion the button names I use from left to right:
    Home : Menu : Back : Search

    Pre-Install Check List for Formatting/Reloading Rom
    install sdcard with ROM/Recovery's
    Reboot > Recovery
    wipe data/factory reset
    mounts and storage> format system
    install zip from sdcard >choose zip from sdcard > update-cm-7-04282011-NIGHTLY
    install zip from sdcard >choose zip from sdcard > gapps-gb-20110120
    Remove sdcard with ROMS
    Install sdcard marked for Linux
    mounts and storage > format sdcard
    reboot system now

    Pre-install Checklist phone prep. (If you choose to overclock your phone this would be a great time to do it)
    Wait 2 minutes for phone to fully load
    tap droid
    tap skip
    tap next/done
    Settings > Display > Screen timeout > 30 minutes
    Settings > Applications > Check Unknown sources (not sure if nessesary)
    Settings > Applications > Development > Check Stay awake (Required!!!!)
    Settings > Accounts & Sync > Add Account (Go Through Menu's should take you though Market Install)
    Market > Search Busy Box > tap BusyBox Installer by JRummy16 > free > ok
    Market > Search Linux Installer > tap Linux Installer by Galoula > free > ok
    Market > Search vnc > tap android-vnc-viewer Installer by androidVNC team + antlersoft > free > ok
    Press Home Key
    Apps> Busybox Installer >Allow Permissions> OK > Install

    Install Check List

    Warning
    DO NOT ROTATE YOUR PHONE
    ALLOW THE SCREEN TO SHUT OFF
    LOCK THE PHONE
    WHILE THIS APP IS OPEN UNLESS STATED

    (you will see bad things if you do)

    For Debian
    Apps > Linux Installer > Allow SU Permissions > Allow SU Permissions > Allow SU Permissions > Click OK (First time start up, Yes 3 Approvals. If you don't recieve 3 notifications from super user it means Linux Installer is bugged. Go Settings>Applications>Manage Applications> under the Downloaded tab find Linux Installer > Select > Clear Data > Try step again. May take a few tries.)
    Press Menu Key > Tap Setup > Tap File Size > Set to 1250 or more but must be less than the size of your SD Card.> ok > Press The Back Key (Linux installer will exit to your apps menu)

    For Ubuntu - Currently bugged. I would avoid this. The source.list seems to have issues and won't download packages.


    REQUIRED: Set you phone some where flat plugged into power Do Not Let The Screen Rotate!!!!!Apps>Linux Installer > Tap 1) Create target loop
    Be Patient Wait until the Creating LOOP menu disappears. The length of time is dependent on the size of Megabytes set in the File Size option. About 10 minutes for 1500 Mb
    Tap Liberate Loop -- Really Fast
    Tap Format target loop (ext2) - This is the Buggy Part. If you get an Error message everything is most likely ok. Pickup your phone and Physically Rotate it so the screen rotates. Two additional menu's should appear. [3) Copy and Extract into loop and Install Linux Boot Script]
    Lay your phone back down flat it doesn't matter if the screen rotates back to its original.

    From here on DO NOT let the Screen Rotate Again! The process will be interrupted and you will get to start from step 1
    Tap 3) Copy and Extract into Loop (it will start downloading and extracting the packages necessary to install Linux) This can take up to an hour. On a good 3g connection less than 45minutes.

    Tap 4) Install into loop (This takes less than 10 minutes)
    Tap Install Linux boot script

    30 Seconds Later you officially have a version of Linux installed on your phone
    CONGRATS:)

    Verify Install Works
    Apps > Terminal Emulator > Type: su > Enter > Grant Permissions > Type: linuxboot > Enter
    You should get a string of code then get something like:
    root@Linux-ARMEL:/


    Most of the next portion comes from the Nexusonehecks.net

    Setting up VNC and LXDE (so you don't have to look at terminal lines all day)
    Apps > Terminal Emulator > Type: linuxboot > Enter <---If your not already in already.
    Type > apt-get update > enter --- 5 minutes

    Tight VNC Server
    Type > apt-get install tightvncserver > Type y > Press enter --10 minutes

    LXDE
    Type > apt-get install lxde > type y > Press enter - 30 Minutes+
    After a while you should get this screen


    Press Menu > Preferences > Control key > Choose Camera Key > Back key > Back Key
    Fully Depress the Camera Button Down and Tap the number 9 on the soft key board > Release Camera key > Tap Space Bar -- now two times more :)
    Fully Depress the Camera Button Down and Tap the number 9 on the soft key board > Release Camera key > Tap Space Bar
    Fully Depress the Camera Button Down and Tap the number 9 on the soft key board > Release Camera key > Tap Space Bar
    The process should continue installing LXDE

    tightvncserver Setup
    Type> export USER=root > enter
    Type> vncserver -geometry 1024x800 > enter
    enter password > enter (use something simple you can remember i used 123123123 like they did on the nexusonehacks.net writeup)
    verify password > enter

    Press Enter after typing each line of the following code. Be Very Slow and Deliberate. Double Check Each line for Capitalization and accuracy before pressing Enter! I do not know how to edit this again --hidden note-->Perhaps some one can show me/tell me how

    cat > /root/.vnc/xtartup
    #!/bin/sh
    xrdb $HOME/.Xresources
    xsetroot -solid grey
    icewm &
    lxsession


    Now Press and Hold the Camera Key and Tap D twice on the soft keyboard > Press Enter (it may ask to press 1 do not and only press enter)
    If your camera key wasn't set look here to set it again--->Press Menu > Preferences > Control key > Choose Camera Key > Back key > Back Key

    Setting up VNC on android ... After all those command lines I'm sure this is a very very nice change xD
    Press Home Screen
    Apps > androidVNCviewer > For Password enter 123123123 (Or whatever you set it to in the previous server setup)
    Scroll to Port and enter 5901
    Change the Color Format if you wish. It runs rather nicely on 24bit color but consumes more cpu cycles.
    Tap Connect -- A Very Pretty LXDE should appear with a working CPU Monitor and everything nice

    I know you want to play but we have a little more work to do this next step uses Terminal Emulator as the auto start/config file to boot linux and start and configure tightvncserver
    Press Home
    Open Termial > Menu Key > Preferences > Initial Command > Tap to Edit
    Make Edit look like this

    export PATH=/data/local/bin:$PATH
    linuxboot
    vncserver -geometry 600x480


    Tap OK > Back out of Teminal to home

    vncserver -geometry 600x480<--- this is where you change your screen size. you need a minimum of 600x480 to use the synaptic package manager and a few other things. but when i'm surfing the net or other things I prefer 480x320 (The Exact Size of the Optimus S Screen)

    Now whenever you want to run linux simply open the Terminal Emulator. Wait 60 seconds for the code to run.
    open androidVNCviewer and click Connect

    DONE

    Extra things go here
    apt-get install synaptic - installs synaptic manager a nice GUI interface for the apt-get command
    1
    I have been running a Debian chroot on my optimus V for a few months now, squeeze and sid both work fine. I did it manually without the stuff from the market, and I use the sd-ext partition instead of a loop file
    per your GUI issues:
    I like xfce4 better than lxde on my optimus V.
    Code:
    apt-get install xfce4 xfce4-goodies
    instead of lxde.
    oh, also, the OP pointed out to me that
    Code:
    apt-get install xfce4-goodies
    alone will also pull down xfce4 as a dependency (and that I left out the word install :eek: which is now corrected.)

    modify the /root/.vnc/xstartup accordingly.
    replace
    Code:
    icewm&
    lxsession
    with
    Code:
    xfce4-session&
    or, you can cut-and paste my complete file here:
    Code:
    echo "#!/bin/sh
    xrdb $HOME/.Xresources
    xsetroot -solid grey
    export XKL_XMODMAP_DISABLE=1
    xfce4-session&" > /root/.vnc/xstartup
    I have modified a theme for xfce to be more finger-friendly.

    see attachment
    decompress that file, it contains a folder, Xfce_large.
    place the folder in /usr/share/themes
    tap on the rat in the lower-left of the desktop (opens menu)
    select Settings by tapping its arrow (xfce is twitchy about the menu through the VNC, it may take a few tries to select items on the main menu.)
    select Appearance. Then Style.
    Scroll down to Xfce_large and tap it, then tap Close at the bottom.
    Voila, oversized scrollbars and menu bar buttons!

    If you don't like the size, the settings I modified are in the gtk-2.0 subfolder of Xfce_large in the file gtkrc
    the modified settings are not tabbed over like the rest of the settings in the file.

    I also changed the default font size, icon size, icon font size, and DPI settings, but that has to be done in the settings menus.

    The optimus display is about 120 DPI, the default is 75. 120 looks much nicer I think.
    1
    You are awesome :)