[Atrix 4G Android Development] exwannabe:
Booting webtop straign into a full debian

Posting from a lapdock running a debian/lxde desktop without the webtop desktop running.

Have a standard lxde up, iceweasel and the moto phone application is running fine (even the full screen mode which surprised me).

This is a work-in-progress, but here are the details:

Debian image:

Started with the one that is the core of this thread.

. installed lxde

. made adas a real user (so I could run X properly as no root in the chroot)

The key place to hack into the moto webboot crud is at /etc/X11/WebtopSession/10Webtop

In this script if I see a mounted alt os we switch out to that startup (I use /etc/alt-osh to point at the mountpoint).

STARTUP=x-session-manager
if [ -f /etc/alt-osh ] ; then
if [ -d `cat /etc/alt-osh`/bin ]; then
STARTUP=/usr/local/bin/alt-xsession
fi
fi

DBUSLAUNCH=/usr/bin/dbus-launch
STARTDBUS=yes

export DISPLAY=:0
xhost +si:localuser:adas
exec $STARTUP

/usr/bin/numlockx on || /bin/true

This invokes the non moto session startup /osh/usr/local/bin/alt_xsession:

#! /bin/sh

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib

. /lib/lsb/init-functions
ALT_OS=`cat /etc/alt-osh`

log_action_msg "Will now start ALT OSHWT 1 scripts"

# Cache Firefox files to improve startup times
# This is just a script that reads a bunch of ff files to make the first click on ff faster
# if we want this, copy to alt and run there

# [ -x /usr/bin/firefox-readahead ] && /usr/bin/firefox-readahead &

#update-font.sh	# usesless for alt i think
#sfalv -w "webdaemon -d -n"	# this started OSHWT 2 scripts and god knows what else
gnome-settings-daemon	# does this run from here or from alt osh?
sfalv -i "aiw -d"	# this allows the android framebuf to be included in the phone app
# sfalv -i "docking_manager"	# don't know yet
#webtop-smartfolder-monitor	# don't have yet
#webtop-refresh-bookmark	# don't have yet

log_action_msg "Will now start ALT OSHWT 2 scripts"

# let's run with these as is for now

sfalv -i "evbridge"	# is this the phone, or inputs being tossed to 'droid
sr-test avahi_start &	# sound

# run it
echo $ALT_OS is the new root
exec sudo chroot $ALT_OS sudo -u adas x-session-manager

Had some tomoyo issues and finaly just disabled the entire thing.

At this point the lxde geometry did not match X. I made an ugly hack to get by this and changed the /osh/etc/X11/xorg.conf file to spcifiy a virtual size of 1366 x 768 (under the SCREEN HDMI section). I doubt this is right, but it worked.

Then I could not get IP fully up as non root, turns out the 'droid kernel has some garbage and the answer is to add the user to group 3003:

addgroup aid_inet 3003

usermod -g 3003 adas

I am presently bringing it up manually (/osh/etc/init.d/webotop-restart), but all I would need to do to automate that is mount the filesystem at real boot time (/osh/ubuntu.sh is fine). My mountscript is basically what this thread uses:

#!/bin/sh

if [ ! -e /etc/alt-osh ] ; then
exit
fi
ALT_OS=`cat /etc/alt-osh`

#test for already mounted

if [ -d $ALT_OS/bin ] ; then
exit
fi

if [ ! -d $ALT_OS ] ; then
mkdir $ALT_OS
fi

mount /dev/mmcblk1p1 $ALT_OS
if [ ! -d $ALT_OS/bin ]; then
exit
fi

mount --bind /proc $ALT_OS/proc
mount --bind /dev $ALT_OS/dev
mount --bind /dev/pts $ALT_OS/dev/pts
mount --bind /dev/shm $ALT_OS/dev/shm
mount --bind /sys $ALT_OS/sys
mount --bind /tmp $ALT_OS/tmp
mount --bind /var/tmp $ALT_OS/var/tmp
mount --bind /var/run/dbus $ALT_OS/var/run/dbus
mount --bind /sdcard $ALT_OS/sdcard

if [ ! -d $ALT_OS/mnt/DEVICE ] ; then
mkdir $ALT_OS/mnt/DEVICE
fi
if [ ! -d $ALT_OS/mnt/DEVICE/osh ] ; then
mkdir $ALT_OS/mnt/DEVICE/osh
fi
mount --bind /osh $ALT_OS/mnt/DEVICE/osh

if [ ! -d $ALT_OS/mnt/DEVICE/home ] ; then
mkdir $ALT_OS/mnt/DEVICE/home
fi
mount --bind /home $ALT_OS/mnt/DEVICE/home

cp /etc/hosts $ALT_OS/etc
chmod 666 $ALT_OS/etc/hosts

cp /etc/fstab $ALT_OS/etc
chmod 666 $ALT_OS/etc/fstab

cp /etc/resolv.conf $ALT_OS/etc
chmod 666 $ALT_OS/etc/resolv.conf

I see no reason why another desktop could not be used, but note that moto-web-crud does check for lxde at some places (I forget where at the moment).

TODO:

audio, that is the biggie

start/stop clean up. Mostly just details, though it would be nice to have a desktop picker. Try and work a real one in, or maybe replace that stupid "clock" thingee?

The remaining moto synch stuff (BTW, you can link the bookmarks to /home/adas... to make that peice work if you are on firefox/iceweasle)

QUESTION:

Does anybody know where the source for moto webtop speciific programs are? I can find the general debian mods but have not found the .c for all those programs in /osh/usr/local/bin (webstart-refresh for example).

THANKS:

to the guys who started this thread. Believe it or not it was what caused me to buy this toy!