Slackware for Pandora 14.0


Linux-SWAT, on 06 Apr 2013 - 14:38, said:


Big resolution videos doesn't display on OP.


Never used YouTubu player, may try.


Gksudo doesn't work on Slackware, gksu does.


Maybe use:


gksu xdg-open /usr/share/applications/_android_i_don't_know_the_name.desktop
The commands are exceuted from some script inside the pnd.
I did try the pnd tool to extract the pnd, and then I located the .sh file and changed gksudo to gksu, and saved the pnd again.


But the next line after the gksu is a line starting with sudo, and now the log shows that it fail there as well.


Here is the log after running the modified pnd, followed by the run_gingerbread.sh script from within the pnd (edited version):

Code:
=======================================================================================
PND			 : /pandora/apps/gingerbread_r6_sw.pnd
PND_FSTYPE	  : Squashfs
APPDATADIR	  : //pandora/appdata/android_gingerbread
APPDD_FSTYPE    : auto
PND_CPUSPEED    : <unset>
EXENAME		 : pandora/run_gingerbread.sh
ARGUMENTS	   : <unset>
=======================================================================================
[ START ]--- Mount the PND ----------
Mounting : mount -t squashfs -o ro "/dev/loop0" "/mnt/utmp/android_gingerbread"
Mounting the Union FS : mount -t aufs -o exec,dirs="//pandora/appdata/android_gingerbread=rw+nolwh":"/mnt/pnd/android_gingerbread=rr" none "/mnt/utmp/android_gingerbread"
[sUCCESS]--- Mount the PND ----------
[ START ]--- Starting the application (pandora/run_gingerbread.sh ) ----------
++ id -u
+ '[' 1000 '!= 0 ]'
+ gksu -m 'Android needs root privileges to run, please enter your password' id
Gkr-Message: received an invalid, unencryptable, or non-utf8 secret
Gkr-Message: call to daemon returned an invalid response: (null).(null)()

uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
+ exec sudo -n ./pandora/run_gingerbread.sh
sudo: sorry, a password is required to run sudo
[ FAILED]--- Starting the application (pandora/run_gingerbread.sh ) ----------
[ START ]--- Restoring the frame buffer status ----------
[sUCCESS]--- Restoring the frame buffer status ----------
[ START ]--- uMount the PND ----------
[ START ]--- Waiting the Union to be available ----------
[sUCCESS]--- Waiting the Union to be available ----------
rmdir: failed to remove '/mnt/utmp/android_gingerbread': Device or resource busy
[ START ]--- Waiting the PND mount dir to be free ----------
[sUCCESS]--- Waiting the PND mount dir to be free ----------
cleanup done
[sUCCESS]--- uMount the PND ----------
=======================================================================================
Return code is : 2


******
run_gingerbread.sh:
******
#!/bin/bash
# run/kill Android from Linux, the hackjob script
# (c) Grazvydas "notaz" Ignotas, 2012
set -e -x

if [ "`id -u`" != "0" ]; then
  # gksudo causes logging not to work somehow..
  # so use it to only ask for password, use sudo to re-run the script
  gksu -m "Android needs root privileges to run, please enter your password" id
  exec sudo -n $0
fi

root=/mnt/android
mpoint_main=`pwd`
kernel_ver=`uname -r`
pnd_version=4
last_pnd_version=`cat $mpoint_main/last_pnd_version || true`
exitcode=1

trap onexit INT QUIT TERM EXIT
trap '' HUP

err()
{
  zenity --error --text "$1"
  echo "$1"
}

onexit()
{
  set +e +x

  list="/sbin/ueventd /system/bin/logcat /system/bin/sh /system/bin/servicemanager
    /system/bin/vold /system/bin/netd /system/bin/rild /system/bin/installd /sbin/adbd
    /system/bin/mediaserver /system/bin/keystore /system/bin/debuggerd
    /system/bin/dbus-daemon"
  for pr in $list; do
    pb=`basename $pr`
    p=`ps -C $pb -o pid=,cmd= | grep $pr | awk '{print $1}'`
    test -n "$p" && echo kill $p $pr && kill $p
  done
  for pr in $list; do
    pb=`basename $pr`
    p=`ps -C $pb -o pid=,cmd= | grep $pr | awk '{print $1}'`
    test -n "$p" && echo kill -9 $p $pr && kill -9 $p
  done
  list2=`ps ax | grep -v grep | grep -e ':.. /system/' -e ':.. /data/' -e ' android\.' | awk '{print $1}'`
  list3=`lsof | grep '/dev/binder' | awk '{print $2}' | uniq`
  for p in $list2 $list3; do
    test -n "$p" && echo kill $p && kill $p
  done

  sleep 0.5

  for i in `seq 4`; do
    sdmounts=`grep -e '\.android_secure' -e 'secure/asec' -e 'mnt/sdcard' /proc/mounts`
    if [ -n "$sdmounts" ]; then
	  echo "$sdmounts" | awk '{print $2}' | xargs umount
    fi

    omounts=`grep "$root/" /proc/mounts | awk '{print $2}'`
    if [ -n "$omounts" ]; then
	  for m in $omounts; do
	    if ! umount $m; then
		  umount -i $m
	    fi
	  done
    fi

    sleep 0.5
    if umount $root; then
	  break;
    fi
  done

  if ! pidof udevd > /dev/null; then
    # don't use /etc/init.d/udev, it remounts /dev blindly
    /sbin/udevd -d
    /sbin/udevadm trigger
  fi

  if ! pidof X > /dev/null; then
    # need to restore SGX, X and friends
    rmmod bufferclass_ti omaplfb pvrsrvkm
    /etc/init.d/pvr-init start
    rmmod wl1251_sdio # hmh
    /etc/init.d/NetworkManager start
    /etc/init.d/slim-init start
  fi

  if ! ps a | grep -q 'pnd_run.*run_gingerbread.sh'; then
    # something killed pnd_run, have to clean up for it
    cat > /tmp/clean_android.sh <<EOF
	  #!/bin/bash
	  trap '' HUP
	  sleep 3
	  umount $mpoint_main
	  umount $mpoint_main # needed twice??
	  losetup -a | awk -F ':' '{ print \$1 }' | xargs losetup -d 2> /dev/null
	  rm $0
EOF
    cd /tmp/
    chmod +x /tmp/clean_android.sh
    /tmp/clean_android.sh &
    sleep 1
  fi
  exit $exitcode
}


# logger, binder and ashmem
delay=0
if ! test -e /dev/log_events; then
  modprobe logger
  delay=0.5
fi
if ! test -e /dev/binder; then
  modprobe binder
  delay=0.5
fi
if ! test -e /dev/ashmem; then
  modprobe ashmem
  delay=0.5
fi
if ! test -e /sys/module/lowmemorykiller; then
  # this one is optional
  modprobe lowmemorykiller || true
fi
sleep $delay
if test ! -e /dev/log_events -o ! -e /dev/binder -o ! -e /dev/ashmem; then
  err "could not load required Android modules,\n\
perhaps you are running unsupported\nfirmware/kernel."
  exit 1
fi

if test "x$last_pnd_version" != "x$pnd_version"; then
  echo "version changed from $last_pnd_version to $pnd_version"
  rm -f rootfs.ext2
  echo "$pnd_version" > $mpoint_main/last_pnd_version
fi

if ! test -e rootfs.ext2; then
  if ! cp -v pandora/default_rootfs.ext2 rootfs.ext2; then
    err "file copy failed, not enough space?"
    exit 1
  fi
fi

if ! test -e data.ext4; then
  size=`zenity --entry --text="\
    Android needs a partition to store it's data and installed programs.\n\
    This will be stored in preallocated file of size that you have to select now.\n\
    Android documentation recommends at least 150MB, going below 50MB will cause\n\
    problems, as well as over 2GB if you are running from FAT partitioned card.\n\n\
    Please select size of Android data partition (in megabytes):\n\
    (creation may take several minutes after you press OK)" \
	  --entry-text=150`
  if test -z "$size" || ! dd if=/dev/zero of=data.ext4 bs=1M count=$size; then
    err "failed to create file, not enough space? bad input?"
    exit 1
  fi
  if ! mkfs.ext4 -O ^has_journal -m 0 -F data.ext4; then
    err "failed to create filesystem"
    exit 1
  fi
fi

if ! fsck.ext4 -y data.ext4 || ! fsck.ext2 -y rootfs.ext2; then
  if [ "$?" -ge "4" ]; then
    err "file corruption detected, try clearing appdata."
    exit 1
  fi
fi

mkdir -p $root
mount -o loop,rw,noatime rootfs.ext2 $root
mount --bind $mpoint_main/system/ $root/system/
mount -o loop,rw,noatime data.ext4 $root/data

mkdir -p $root/vendor/

# handle SGX
mkdir -p $root/vendor/pvr
echo "0 0 android" > $root/vendor/pvr/egl.cfg
rm -f $root/vendor/pvr/gralloc.omap3.so
sgx_kernel_loaded=false

# load the right SGX driver
if ! grep -q '1.5.15.2766' /proc/pvr/version 2> /dev/null; then
  echo have to change SGX kernel driver
  /etc/init.d/pvr-init stop || true
  if test -d $mpoint_main/pandora/pvr/$kernel_ver; then
    # found with this android release
    pvrbase=$mpoint_main/pandora/pvr/$kernel_ver
  elif test -d /lib/modules/$kernel_ver/kernel/drivers/gpu/pvr/1.5.15.2766; then
    # found in firmware
    pvrbase=/lib/modules/$kernel_ver/kernel/drivers/gpu/pvr/1.5.15.2766
  fi

  if [ "x$pvrbase" != "x" ]; then
    if insmod $pvrbase/pvrsrvkm.ko && insmod $pvrbase/omaplfb.ko; then
	  sgx_kernel_loaded=true
	  # optional
	  insmod $pvrbase/bufferclass_ti.ko || true
    fi
  fi
else
  sgx_kernel_loaded=true
fi

sgx_user_ready=false
#if false; then
if $sgx_kernel_loaded; then
  es=`cat /etc/powervr-esrev`
  if [ "x$es" = "x" ]; then
    err "unable to determine SGX version"
  else
    es="es$es"
    # for some braindead reason 103 is named 121 too
    sgx_ver=121
    if [ "$es" = "es5" ]; then
	  sgx_ver=125
    else
	  ln -fs /system/lib/$es/libGLESv2_POWERVR_SGX530_121.so $root/vendor/pvr/
	  ln -fs /system/lib/$es/libGLESv1_CM_POWERVR_SGX530_121.so $root/vendor/pvr/
    fi
    ln -fs /system/bin/$es/pvrsrvinit $root/vendor/pvr/
    ln -fs /system/lib/hw/gralloc.omap3.so.1 $root/vendor/pvr/gralloc.omap3.so
    ln -fs /system/lib/$es/libPVRScopeServices.so $root/vendor/pvr/
    ln -fs /system/lib/$es/libglslcompiler.so $root/vendor/pvr/
    ln -fs /system/lib/$es/libsrv_um.so $root/vendor/pvr/
    ln -fs /system/lib/$es/libIMGegl.so $root/vendor/pvr/

    echo "0 1 POWERVR_SGX530_$sgx_ver" >> $root/vendor/pvr/egl.cfg
    sgx_user_ready=true
  fi
fi

if ! $sgx_user_ready; then
  err "SGX driver load failed, no 3D support"
fi

# stop X and interfering things, get wifi ready
set +e
if pidof xfce4-session > /dev/null; then
  user=`cat /tmp/currentuser`
  # most often doesn't work 
  #if ! test -z "$user"; then
  #  su -c 'xfce4-session-logout --logout' $user
  #fi
fi
/etc/init.d/NetworkManager stop
modprobe mac80211
/etc/init.d/wl1251-init start
/etc/init.d/slim-init stop
sleep 1 # for wlan0, hmh..
chvt 2 & # may hang..
sleep 1
killall chvt 2> /dev/null || true
ifconfig wlan0 down
killall udevd || true

cp -v /lib/modules/$kernel_ver/kernel/drivers/net/wireless/wl1251/wl1251_sdio.ko $root/vendor/
mkdir -p $root/vendor/firmware
cp -v /lib/firmware/brf6300.bin $root/vendor/firmware/

set -e
cp -v /etc/pointercal $root/vendor/

# some cleanup
rm -rf $root/acct/uid/*

chroot $root /init &

# revive udev when /init is done with uevents,
# we'll need it to load firmwares and stuff
sleep 10
/sbin/udevd -d

# wait for a message
while true; do
  sleep 1

  if nc -V 2> /dev/null | grep -q GNU; then
    # GNU nc always fails
    msg=`nc -l -p 36936 localhost || true`
  else
    msg=`nc -l localhost 36936`
  fi
  if [ "x$msg" = "xquit" ]; then
    break
  fi
  echo "unknown message: $msg"
done

# real init can't be killed this way
killall init

# done, run exit handler indirectly
exitcode=0
 
Last edited by a moderator:
Replace the other sudo with gksu.

You can also edit /etc/sudoers but i won't recommend it as if you upgrade the distro, you'll have to redo that.
 
Thanks for your patience so far

I have now set my user in the sudoers file, like this

root, my_username,  ALL=(ALL) NOPASSWD: ALL

But it still asks for the password when I run the pnd, and the log shows that sudo fails due to password requirements.

So I followed your advice and replaced the sudo command with gksu (removing the -n option from that line as well, since gksu did not accept that option)

Now it first pops up asking for a password, it accepts it and a while later a message box shows:

Failed to run ./pandora/run_gingerbread.sh as user root.

Failed to communicate with gksu-run-helper.

Received:

gksu: waiting

While expecting:

gksu: waiting

log looks ok until after this line:

exec gksu ./pandora/run_gingerbread.sh

then it shows

[FAILED] -- starting the application (pandora/run_gingerbread.sh)  ---
 
Maybe you'll have to reset /etc/sudoers permissions:

  chmod 0440 /etc/sudoers
  chown 0.0 /etc/sudoers
 
 
Thanks, that worked for the permission part, now the script continues past the gksu stuff.

Now what happens is that it does quit xfce and some text are displayed on the console very briefly (to short to read anything) and then it will restart the xfce desktop again.

Here is the log, its a bit longer now

Code:
=======================================================================================

PND             : /pandora/apps/gingerbread_r6.pnd

PND_FSTYPE      : Squashfs

APPDATADIR      : //pandora/appdata/android_gingerbread

APPDD_FSTYPE    : auto

PND_CPUSPEED    : <unset>

EXENAME         : pandora/run_gingerbread.sh

ARGUMENTS       : <unset>

=======================================================================================

[ START ]--- Mount the PND ----------

Mounting : mount -t squashfs -o ro "/dev/loop0" "/mnt/utmp/android_gingerbread"

Mounting the Union FS : mount -t aufs -o exec,dirs="//pandora/appdata/android_gingerbread=rw+nolwh":"/mnt/pnd/android_gingerbread=rr" none "/mnt/utmp/android_gingerbread"

[sUCCESS]--- Mount the PND ----------

[ START ]--- Starting the application (pandora/run_gingerbread.sh ) ----------

++ id -u

+ '[' 1000 '!= 0 ]'

+ gksu -m 'Android needs root privileges to run, please enter your password' id

 
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
+ exec gksu ./pandora/run_gingerbread.sh

 
++ id -u
+ '[' 0 '!= 0 ]'
+ root=/mnt/android
++ pwd
+ mpoint_main=/mnt/utmp/android_gingerbread
++ uname -r
+ kernel_ver=3.2.30
+ pnd_version=4
++ cat /mnt/utmp/android_gingerbread/last_pnd_version
+ last_pnd_version=4
+ exitcode=1
+ trap onexit INT QUIT TERM EXIT
+ trap '' HUP
+ delay=0
+ test -e /dev/log_events
+ modprobe logger
+ delay=0.5
+ test -e /dev/binder
+ modprobe binder
+ delay=0.5
+ test -e /dev/ashmem
+ modprobe ashmem
+ delay=0.5
+ test -e /sys/module/lowmemorykiller
+ modprobe lowmemorykiller
+ sleep 0.5
+ test '!' -e /dev/log_events -o '!' -e /dev/binder -o '!' -e /dev/ashmem
+ test x4 '!=' x4
+ test -e rootfs.ext2
+ test -e data.ext4
+ fsck.ext4 -y data.ext4
e2fsck 1.42.6 (21-Sep-2012)
data.ext4: clean, 2014/249984 files, 148282/998400 blocks
+ fsck.ext2 -y rootfs.ext2
e2fsck 1.42.6 (21-Sep-2012)
rootfs.ext2: clean, 57/512 files, 530/16384 blocks
+ mkdir -p /mnt/android
+ mount -o loop,rw,noatime rootfs.ext2 /mnt/android
+ mount --bind /mnt/utmp/android_gingerbread/system/ /mnt/android/system/
+ mount -o loop,rw,noatime data.ext4 /mnt/android/data
+ mkdir -p /mnt/android/vendor/
+ mkdir -p /mnt/android/vendor/pvr
+ echo '0 0 android'
+ rm -f /mnt/android/vendor/pvr/gralloc.omap3.so
+ sgx_kernel_loaded=false
+ grep -q 1.5.15.2766 /proc/pvr/version
+ echo have to change SGX kernel driver
have to change SGX kernel driver
+ /etc/init.d/pvr-init stop
Stopping PVR
+ test -d /mnt/utmp/android_gingerbread/pandora/pvr/3.2.30
+ test -d /lib/modules/3.2.30/kernel/drivers/gpu/pvr/1.5.15.2766
+ pvrbase=/lib/modules/3.2.30/kernel/drivers/gpu/pvr/1.5.15.2766
+ '[' x/lib/modules/3.2.30/kernel/drivers/gpu/pvr/1.5.15.2766 '!= x ]'
+ insmod /lib/modules/3.2.30/kernel/drivers/gpu/pvr/1.5.15.2766/pvrsrvkm.ko
+ insmod /lib/modules/3.2.30/kernel/drivers/gpu/pvr/1.5.15.2766/omaplfb.ko
+ sgx_kernel_loaded=true
+ insmod /lib/modules/3.2.30/kernel/drivers/gpu/pvr/1.5.15.2766/bufferclass_ti.ko
+ sgx_user_ready=false
+ true
++ cat /etc/powervr-esrev
+ es=5
+ '[' x5 = x ']'
+ es=es5
+ sgx_ver=121
+ '[' es5 = es5 ']'
+ sgx_ver=125
+ ln -fs /system/bin/es5/pvrsrvinit /mnt/android/vendor/pvr/
+ ln -fs /system/lib/hw/gralloc.omap3.so.1 /mnt/android/vendor/pvr/gralloc.omap3.so
+ ln -fs /system/lib/es5/libPVRScopeServices.so /mnt/android/vendor/pvr/
+ ln -fs /system/lib/es5/libglslcompiler.so /mnt/android/vendor/pvr/
+ ln -fs /system/lib/es5/libsrv_um.so /mnt/android/vendor/pvr/
+ ln -fs /system/lib/es5/libIMGegl.so /mnt/android/vendor/pvr/
+ echo '0 1 POWERVR_SGX530_125'
+ sgx_user_ready=true
+ true
+ set +e
+ pidof xfce4-session
++ cat /tmp/currentuser
+ user=amyren
+ /etc/init.d/NetworkManager stop
Stopping Network connection manager daemon: NetworkManager/etc/init.d/NetworkManager: line 40: start-stop-daemon: command not found
+ modprobe mac80211
+ /etc/init.d/wl1251-init start
Starting WL1251 MAC80211 Wireless LAN driver: wl1251.
+ /etc/init.d/slim-init stop
 
Last edited by a moderator:
Well, i can't tell :/.

Maybe lauch it, don't type anything, so the pnd will stay mounted, then go in /mnt/utmp/android-whatever and try to check what could be launched manually to get some output.
 
Last edited by a moderator:
Hey, Linux-SWAT, do you get many issues running PNDs on SL4P?

See here (and the next few posts) for my issues trying to run Dune Dynasty:

http://boards.openpandora.org/index.php/topic/12687-dune-dynasty-classic-dune-2-modern-controls/?p=239724

I also found that I had to manually grab and symlink SuperZaxxon's version of libmikmod to get The Ur-Quan Masters to run.

Where it's a missing library (or wrong version of the library), it's not too hard to fix, but I don't know why Dune Dynasty has all those segfault errors.
 
Last edited by a moderator:
What is the exact command you typed for Ur-Quan plz ? I will include it by default when building releases.

Well i don't know neither.

With Cannonball, i removed the /lib inside the pnd, and it worked.

The EGL error is strange, i wonder which SL4P version you are running.
 
just logged into slack for the 1st time (was a long night to install) and now watching a vid over windows network and loving it works great i am a linux noob and thanks to the info was np now just need to move a few things and get some pnds tested
 
Glad you could make it.

The Linux knowledge you will acquire with Slackware is useful on any other Linux distro, but also any other UNIX, like *BSD, Solaris etc.
 
Hi have anyone tried to compile IXDream the Dreamcast Emulator for Slackware?
 
Last edited by a moderator:
Tried a bit, it runs pretty well at around 40~50 fps.

Finished Shenmue, Crazy taxi.
 
Whaaaaaaaaaaat?
Woooooow!

Mean you that realy?
I meant that on the Pandora :)
Not on the PC.

Or was this a little Joke? :D
 
That was a good Joke,you had me ;)

Today bought i SD Card for a fixed Slackware installation.
This Evening install i latest Slackware and try to Compile IXDream.
Maybe IXDream is better than NullDC?
I will try that with Linuxbochs GL Lib too ;)
 
Back
Top