2010年8月7日星期六

ubuntu under palm pre plus

原则上 允许但不希望转载此文章

this post show you how to run ubuntu under your plam pre plus.still sorry about my poor english.

What we need:
Ubuntu
Terminal in pre plus
internalz



All in ubuntu

Creat a .img file,format it.maybe ext3 is ok.(webos supports)
$ dd if=/dev/zero of=ubuntu.img seek=1000999999 bs=1 count=1
$ sudo mkfs.ext2 -F ubuntu.img
$ sudo tune2fs -c0 ubuntu.img

Creat a directory and mount the .img
$ mkdir ubuntu
$ sudo mount -o loop ubuntu.img ubuntu/

now,let's make the arm system.
$sudo apt-get install qemu-arm-static debootstrap
$sudo build-arm-chroot karmic ubuntu

you can repalce the "karmic" as "maverick",or other ubuntu edition name.

if you are in china,you may try this
build-arm-chroot karmic eabi-chroot http://ubuntu.srt.cn/ubuntu-ports/

go on when all jobs finished,chroot into the ubuntu directory.
$sudo chroot ubuntu

now,we are in our arm ubuntu.(if you are not in China,you may repalce http://ubuntu.srt.cn/ubuntu-ports as http://ports.ubuntu.com/)
#echo ‘deb http://ubuntu.srt.cn/ubuntu-ports/ karmic main universe restricted multiverse’ > /etc/apt/sources.list
#export LC_ALL=C
#apt-get update
#apt-get install lxde tightvncserver
#vncserver -geometry 1024×800

Here you can set your password to VNCserver like I did as "123456".
#apt-get clean
#vi /root/.vnc/xstartup

like this
#!/bin/sh
icewm &
lxsession

All in your palm pre plus


Get ubuntu.img onto /media/internal on the device. You can mount the device as a USB drive.
Creat a script names startarm.sh like this
#!/bin/bash
export mnt=/media/cf
mount -o loop /media/internal/ubuntu.img $mnt
mount --bind /dev $mnt/dev
mount -t devpts none $mnt/dev/pts
mount -t proc none $mnt/proc
mount -o bind /tmp $mnt/tmp
sysctl -w net.ipv4.ip_forward=1
echo " "
echo "Type exit to end session"
echo "Make sure you do a proper EXIT for a clean umount!"
chroot $mnt /bin/bash -c 'su -'
echo "Shutting down Ubuntu........"
umount $mnt/tmp
umount $mnt/dev/pts
umount $mnt/dev
umount $mnt/proc
umount $mnt

end,enjoy it.

因为pre plus里面没有恰当的vnc client,我是在我电脑上面vnc过去的。这时候,你要在你的pre plus上面打开Terminal,运行这两句
iptables -D INPUT -p tcp --dport 5901 -j ACCEPT #-D 删除一条规则,-I插入,-p协议是tcp,端口是5901,-j命令是接受
iptables -I INPUT -p tcp --dport 5901 -j ACCEPT

希望有人能把vnc client移植到webos上面,那就好玩多了。

没有评论:

发表评论