Pandora 1GHz ⇒ SuperZaxxon

如何同時使用Debian系統


雖然Pandora的SuperZaxxon系統具有相當輕巧的體積、快速啟動和最多遊戲支援等優點,不過最缺乏的還是寫程式和辦公需求的支持,因此,之後的Pyra掌機預設系統也將採用Debian系統,達到結合Pandora遊戲強項和Debian眾多程式的優點,不過在Pyra掌機尚未量產前,我們也可以用Pandora掌機打造這樣的雙系統環境,達到一邊寫程式一邊打電動的樂趣,做法相當簡單,只要先安裝Pandian Mark3(Debian for Pandora)系統到SDCard,然後寫一個簡單的chroot script即可,步驟如下說明:

$ vim login
#!/bin/sh
CHROOT="/media/PDROOT"
CHMODE=$1
CHUSER=$2

_usage(){
  echo "usage: login [cli|lxde] [root|user]"
}

_mount(){
  mount -o bind /dev           "$CHROOT/dev"
  mount -o bind /sys           "$CHROOT/sys"
  mount -o bind /proc          "$CHROOT/proc"
  mount -t devpts none         "$CHROOT/dev/pts"
  mount -o bind /dev/shm       "$CHROOT/dev/shm"
  #mount -o bind /var/tmp       "$CHROOT/var/tmp"
  #mount -o bind /var/run/dbus  "$CHROOT/var/run/dbus"
  #mount -o bind /var/lib/dbus  "$CHROOT/var/lib/dbus"
  #mount -o bind /etc/passwd    "$CHROOT/etc/passwd"
  #mount -o bind /etc/group     "$CHROOT/etc/group"
}

_umount(){
  umount "$CHROOT/sys"
  umount "$CHROOT/proc"
  umount "$CHROOT/dev/pts"
  umount "$CHROOT/dev/shm"
  umount "$CHROOT/dev"
  #umount "$CHROOT/var/tmp"
  #umount "$CHROOT/var/run/dbus"
  #umount "$CHROOT/var/lib/dbus"
  #umount "$CHROOT/etc/passwd"
  #umount "$CHROOT/etc/group"
}

if [ `whoami` != "root" ] ; then
  echo "run me as root !"
  exit 1
fi

if [ "$CHMODE" != "cli" ] && [ "$CHMODE" != "lxde" ] ; then
  echo "only support cli and lxde mode !"
  exit 2
fi

_umount &> /dev/null
_mount

if [ "$CHMODE" == "lxde" ] ; then
  DISPLAY=:0.0
  export DISPLAY
  xhost +
  chroot $CHROOT su - "$CHUSER" -c 'startlxde'
  killall lxpanel
  killall pcmanfm
else
  chroot $CHROOT su - "$CHUSER"
fi

_umount &> /dev/null
exit 0

P.S. $CHROOT路徑如果不是/media/PDROOT,請記得更改。

接著請使用如下指令開啟Debian系統:

$ chmod a+x ./login
$ sudo ./login lxde user


P.S. 使用者可能會發現無法切換scim輸入法,遇到這種問題時,可以使用如下方式解決(如:開啟leafpad並支援scim輸入法):

$ XMODIFIERS=@im=SCIM GTK_IM_MODULE=scim QT4_IM_MODULE=scim leafpad

如果遇到無法上網,記得修改DNS

$ sudo vim /etc/resolv.conf
# Generated by NetworkManager
nameserver 8.8.8.8


返回上一頁