Related
I started using Arch some months ago and I really enjoying it. Coming from a released based distro, it feels really nice been able to choose exactly what you want to run in your system and always have the packages up to date. For a while I have been planning on running ubuntu in my transformer but I just don't feel too comfortable with ubuntu , so decided to run arch in my transformer. I couldn't find a tutorial so I scavenged the net and found bits and peace that I put together to make this tutorial. What I like about arch is that I am in control of my system and I can run exactly what I want, thanks awesomely documented Arch!
This is a tutorial that will show you how to run Arch Linux in a chrooted environment within your Asus Tarsnformer. I will not provide a simple script that if you run it will do everything for you, instead I will teach you how to make your own installation by grabbing all necessary elements.
You will need:
Arch Live image: Go to http://archlinuxarm.org/developers/downloads and grab the omap 3/4 package.
Install environment: It can be your internal storage or a sd/micro card. Here I will show how to use the micro sd card.
Script for starting the chroot: I grabbed mine from http://forum.xda-developers.com/showthread.php?t=1517993&highlight=chroot and did some modifications. Thanks-miska-
Rooted Asus Transformer(Prime?) with Terminal: You need root to mount the file system and loop devices. In theory this should work in the Prime too.
Linux Machine
Step 1:
For installing arch in a (micro)sd card (I prefer micro as I don't need the dock for using it), first you need to format the card and make two partitions. (I used gparted) Make one partition fat and assign a small amount of space(I have a 4gb micro and assigned 128mb to the fat partition), then make the rest ext4. Make sure the fat partition is first and the ext one is second.
Step 2:
Now as root you need to extract the package in the ext partition of your card. REMEMBER to be root, I got stuck thinking there was something wrong with the package I downloaded but it was that I was unpacking as normal user.
Code:
# tar -c /path/to/extpartition -xzf ArchLinuxARM-omap-smp-latest.tar.gz
Now you have a arch environment in your (micro)sd card.
Step 3:
In your asus transformer create a folder called 'arch' in the root of your internal storage.
Code:
#mkdir /sdcard/arch
Or use a file manager.
Now place this script somewhere in your transformer, I usually keep it in /sdcard/Downloads
Code:
#!/bin/sh
# Modify this according to your needs
DEVICE="/dev/block/mmcblk1p2"
LOOP="no"
# Maybe this as well
MNT_PATH="/mnt/sdcard/arch"
# Modify only if you know, what are you doing
BINDS="dev dev/pts proc sys mnt/sdcard"
ANDROID_BINDS=" /system /data "
TMPS="tmp var/tmp var/log var/run"
MY_MOUNTS=""
unset PS1
# Helper functions
die() {
echo " $1"
exit 1
}
safe_mount() {
mkdir -p "$MNT_PATH""$2"
if [ "$3" ]; then
OPTION=" $3 "
else
OPTION=""
fi
if [ -z "`mount | grep " $MNT_PATH$2 "`" ]; then
mount $OPTION "$1" "$MNT_PATH$2" || die "Can't mount $2!!!"
fi
MY_MOUNTS="$MNT_PATH$2 $MY_MOUNTS"
}
# Real work
[ "`whoami || echo root`" = "root" ] || die "You must be root first!"
LOOP_ARG=""
[ "$LOOP" = "no" ] || LOOP_ARG=" -o loop "
safe_mount $DEVICE "" "$LOOP_ARG -t ext4 "
for i in $BINDS; do
safe_mount "/$i" "/$i" " -o bind "
done
if [ -d /Removable ]; then
for i in /Removable/*; do
[ -d "$i" ] && safe_mount $i /mnt$i " -o bind "
done
fi
for i in $ANDROID_BINDS; do
safe_mount $i /mnt/android$i " -o bind "
done
for i in $TMPS; do
safe_mount none /$i " -t tmpfs "
done
mount -o remount,ro "$MNT_PATH"
chroot "$MNT_PATH" /sbin/fsck.ext2 -y "$DEVICE"
mount -o remount,rw "$MNT_PATH"
# Tweak configuration of the chroot during first start
#if [ \! -f "$MNT_PATH"/etc/profile.d/tweak.sh ]; then
#mkdir -p "$MNT_PATH"/home/opensuse
echo 'nameserver 8.8.8.8' > "$MNT_PATH"/etc/resolv.conf
#echo 'net:x:3003:root,opensuse' >> "$MNT_PATH"/etc/group
#echo 'opensuse:x:1000:100::/home/opensuse:/bin/bash' >> "$MNT_PATH"/etc/passwd
#echo 'opensuse:$1$joWqOQdr$YsapocP32UtdiR3PKBXVM1:15395:0:::::' \
# >> "$MNT_PATH"/etc/shadow
#sed -i 's|^root:.*|root:$1$joWqOQdr$YsapocP32UtdiR3PKBXVM1:15395:0:::::|' \
# "$MNT_PATH"/etc/shadow
#echo '#!/bin/sh
#export TERM=linux
#export LANG="en_US.utf-8"
#export EDITOR="busybox vi"
#alias vi="busybox vi"
#precmd() { :; }
#if [ "`whoami`" = root ]; then
# export HOME=/root
# export USER=root
# hostname -F /etc/HOSTNAME
#fi
#if [ -z "$CHROOTED" ]; then
# export CHROOTED=yes
# export HOME="/home/opensuse"
# export USER="opensuse"
# su opensuse
#fi
#' > "$MNT_PATH"/etc/profile.d/tweak.sh
#fi
export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/system/xbin:/system/bin"
# Chroot
chroot "$MNT_PATH" /bin/bash
#chroot "$MNT_PATH" /root/init.sh
# Cleanup
echo "Umount everything"
for i in $MY_MOUNTS; do
umount -l $i
done
Step 4:
Chmod +x the script and run it as root.
Code:
su
#chmod +x scriptname.sh
sh scriptname.sh
The script will mount the ext partition of your (micro)sd card in /sdcard/arch and will chroot into it. It also does other really nice things, such as mounting your android partitions to /mnt so you can access them from within your arch environment. I have disabled some lines that are used to set up a some environment variables, but you should still be able to get a fully functional command-line environment and you can enable them and modify them as you want.
Step 5:
The rest is completely up to you, now you have arch running in your transformer. But what!? You need X?! really???? Ok, so lets create a vnc server so we can remote into it.
Your network connection should work, so the first thing to do is an update
Code:
#pacman -Syu
Now install xorg
Code:
#pacman -S xorg-server xorg-xinit xorg-twm xorg-xclock xterm
Now install a vncserver
Code:
#pacman -S tightvnc
And now this is the tricky part(And I spent a lot of time in this).
I grabbed this script from the UbuntuInstaller post. This is the script they use for setting a resolution at each boot. What I did was to remove the resolution prompt and fix the resolution to 1280x752(fullscreen) and remove some ubuntu stuff. I also added an export for HOME and USER that will allow you to run 'vncserver' as root.
Code:
#!/bin/bash
#############################################
# Asks User to screen size and saves as REZ #
#############################################
#echo "Now enter the screen size you want in pixels (e.g. 800x480), followed by [ENTER]:"
#read REZ
###########################################
# Tidy up previous LXDE and DBUS sessions #
###########################################
#rm /tmp/.X* > /dev/null 2>&1
#rm /tmp/.X11-unix/X* > /dev/null 2>&1
#rm /root/.vnc/localhost* > /dev/null 2>&1
#rm /var/run/dbus/pid > /dev/null 2>&1
############################################################
# enable workaround for upstart dependent installs #
# in chroot'd environment. this allows certain packages #
# that use upstart start/stop to not fail on install. #
# this means they will have to be launched manually though #
############################################################
#dpkg-divert --local --rename --add /sbin/initctl > /dev/null 2>&1
#ln -s /bin/true /sbin/initctl > /dev/null 2>&1
###############################################
# start vnc server with given resolution and #
# DBUS server, (and optionally an SSH server) #
###############################################
export HOME="/root/"
export USER="root"
vncserver :0 -geometry 1280x752
dbus-daemon --system --fork > /dev/null 2>&1
/etc/rc.d/sshd start
#echo
#echo "If you see the message 'New 'X' Desktop is localhost:0' then you are ready to VNC into your ubuntu OS.."
#echo
#echo "If VNC'ing from a different machine on the same network as the android device use the 1st address below:"
##########################################
# Output IP address of android device #
##########################################
ifconfig | grep "inet addr"
#echo
#echo "If using androidVNC, change the 'Color Format' setting to 24-bit colour, and once you've VNC'd in, change the 'input mode' to touchpad (in settings)"
#echo
#echo "To shut down the VNC server and exit the ubuntu environment, just enter 'exit' at this terminal - and WAIT for all shutdown routines to finish!"
#echo
###############################################################
# Spawn and interactive shell - this effectively halts script #
# execution until the spawning shell is exited (i.e. you want #
# to shut down vncserver and exit the ubuntu environment) #
###############################################################
/bin/bash -i
#########################################
# Disable upstart workaround and #
# kill VNC server (and optionally SSH) #
# Rename used xstartup to its first file#
#########################################
vncserver -kill :0
/etc/rc.d/sshd stop
Place this script in /root/, give it the name 'init.sh' and make sure it is executable(chmod +x). Now in the previous script comment the line:
Code:
chroot "$MNT_PATH" /bin/bash
and uncomment the line
Code:
chroot "$MNT_PATH" /root/init.sh
Step 6:
Now you should be able to start a vncserver with twm as your window manager and a xterm.
You can now go to
https://wiki.archlinux.org/index.php/Desktop_Environment
or
https://wiki.archlinux.org/index.php/Window_Manager
and set up the desktop environment that you like the most.
Remember that you need to set up the graphical environment to start manually and not at boot. In a normal environment you would usually use 'startx' which will read the .xinitrc file and run the programs from there. In our case put everything that needs to go into .xinitrc into ~/.vnc/xstartup. An example of my ~/.vnc/xstartup
Code:
#!/bin/bash
xrdb $HOME/.Xresources
exec startfluxblox
This will start an empty fluxbox window manager.
This thread is a WIP and will be updated as I have time to include and write more info.
With this guide you will be able to launch games and emulated games much more "seemlessly".
Requirements:
Keyboard ( although you could manually add everything to the launchers.xml config )
ADB
A rooted OUYA http://forum.xda-developers.com/showthread.php?t=2387507
( NOTE: Technically most arg's being passed could be done without root... More info in 3rd post. )
XBMC installed ( official or spmc... I haven't tried with a gotham build )
Advanced Launcher plugin for XBMC http://forum.xbmc.org/showthread.php?tid=85724
OR
Rom Collection Browser ( see second post )
A reasonable text editor ( If on windows - Notepad++ )
ADVANCED LAUNCHER
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
1.) Install Advanced Launcher
Copy over the Advanced Launcher plugin to the OUYA and install it ( You can install it by going to Settings -> Add-Ons -> Install From Zip File )
2.) Create a new category
Load the addon and with a keyboard press "c", which will open a popup. Choose "Create New Category" and call it "Emulation".
3.) Create a "launcher"
Open the newly created category which should prompt you to create a new launcher. Select "Files Launcher" and go through the menus ( select the launcher application [ su or am... read 3rd post ], select files path [ where the games are stored ] and set file extensions [ look at the example it gives ] )
At "Application Arguments" leave it as default ( due to a scroll limit you can't see what to type... we will modify this later )
Continue with the setup ( Set title of launcher [ typically label of system ], select platform [ which system you are emulating ], set thumbnails path and set fanart path )
4.) Adding the correct arguments
Pull launchers.xml from:
Code:
/sdcard/Android/data/com.semperpax.spmc/files/.xbmc/userdata/addon_data/plugin.program.advanced.launcher/launchers.xml
( change the "com.semperpax.spmc" to whatever version of xbmc you have installed )
Open launchers.xml and under "launchers" look for the emulator you added ( this would be the name you chose when you set the title of the launcher ) and you should see the following line:
Code:
<args>"%rom%"</args>
Change it to represent one of the arguments found in the 3rd post. for example purposes here's what the line would look like if I were setting up the Reicast:
Code:
<args>start -n com.reicast.emulator/.GL2JNIActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"</args>
Save it and push it back to the location it was pulled from.
5.) Reload XBMC ( or just the script )
Once you reload you should be able to add games... to add games hit the "c" key on your keyboard with the emulator highlighted and select "Add items". Select any game(s) you wish to add.
Afterwards you should be able to launch the games from Advanced Launcher
ROM COLLECTION BROWSER
Install RCB like you would any addon.
In order to get RCB to work there's a few changes that have to be made... 2 files to be specific.
1.) applaunch.sh
located at:
Code:
/sdcard/Android/data/com.semperpax.spmc/files/.xbmc/userdata/addon_data/script.games.rom.collection.browser/scriptfiles/applaunch.sh
or
Code:
/sdcard/Android/data/org.xbmc.xbmc/files/.xbmc/addons/script.games.rom.collection.browser/resources/scriptfiles/applaunch.sh
( change the "com.semperpax.spmc" to whatever version of xbmc you have installed )
You'll need to comment out the following lines:
Code:
case "$(uname -s)" in
Darwin)
XBMC_PID=$(ps -A | grep XBMC.app | grep -v Helper | grep -v grep | awk '{print $1}')
XBMC_BIN=$(ps -A | grep XBMC.app | grep -v Helper | grep -v grep | awk '{print $5}')
;;
Linux)
XBMC_PID=$(pidof xbmc.bin)
XBMC_BIN="xbmc"
;;
*)
echo "I don't support this OS!"
exit 1
;;
esac
Save it and push it back to the same location we pulled it from.
2.) launcher.py
located at:
Code:
/sdcard/Android/data/com.semperpax.spmc/files/.xbmc/addons/script.games.rom.collection.browser/resources/lib/launcher.py
( change the "com.semperpax.spmc" to whatever version of xbmc you have installed )
Comment out:
Code:
if(isFullScreen):
Logutil.log("Toggle to Windowed mode", util.LOG_LEVEL_INFO)
#this minimizes xbmc some apps seems to need it
try:
xbmc.executehttpapi("Action(199)")
except:
xbmc.executeJSONRPC('{"jsonrpc":"2.0","method":"Input.ExecuteAction","params":{"action":"togglefullscreen"},"id":"1"}')
toggledScreenMode = True
Code:
pre launch command
if(precmd.strip() != '' and precmd.strip() != 'call'):
Logutil.log("Got to PRE", util.LOG_LEVEL_INFO)
os.system(precmd.encode(sys.getfilesystemencoding()))
preDelay = settings.getSetting(SETTING_RCB_PRELAUNCHDELAY)
if(preDelay != ''):
preDelay = int(float(preDelay))
xbmc.sleep(preDelay)
Modify:
Code:
if(romCollection.usePopen):
import subprocess
subprocess.Popen(cmd.encode(sys.getfilesystemencoding()), shell=True)
else:
os.system(cmd.encode(sys.getfilesystemencoding()))
to this:
Code:
if(romCollection.usePopen):
import subprocess
subprocess.Popen(cmd.encode('utf-8'), shell=True)
else:
os.system(cmd.encode('utf-8'))
Comment out:
Code:
postDelay = settings.getSetting(SETTING_RCB_POSTLAUNCHDELAY)
if(postDelay != ''):
postDelay = int(float(postDelay))
xbmc.sleep(postDelay)
post launch command
if(postcmd.strip() != '' and postcmd.strip() != 'call'):
Logutil.log("Got to POST: " + postcmd.strip(), util.LOG_LEVEL_INFO)
os.system(postcmd.encode(sys.getfilesystemencoding()))
Save it and push it back to the same location we pulled it from.
3.) Create a "Rom Collection"
Hit the "U" button ( or "C" key on a keyboard ) on your OUYA controller, this will open a menu... select "Add Rom Collection".
Fill out all the info ( how you want to select info/artwork, what console, location of emulator ( su or am... read 3rd post )
On the "Emulator params" just select the default for now... we will modify this afterward.
Continue on in the setup... ( path to the roms, what file mask [ in otherwords which extensions to look for... look at the example it gives ] and lastly select a location for the artwork )
4.) Adding the correct emulator arguments
Pull config.xml from:
Code:
/sdcard/Android/data/com.semperpax.spmc/files/.xbmc/userdata/addon_data/script.games.rom.collection.browser/config.xml
( change the "com.semperpax.spmc" to whatever version of xbmc you have installed )
Open config.xml and under the rom collection you created... look for the following line:
Code:
<emulatorParams>"%ROM%"</emulatorParams>
Change it to represent one of the arguments found in the 3rd post. for example purposes here's what the line would look like if I were setting up the SNES:
Code:
<emulatorParams>start -n com.explusalpha.Snes9xPlus/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%ROM%"</emulatorParams>
Save it and push it back to the same location we pulled it from.
5.) Reload XBMC ( or just the script )
After you reload you should be able to launch the games without a problem.
There are some arguments that will require root and others that do NOT require root... If theres a root/nonroot option I will list both.
If the argument is non-root required, for the "application" use /system/bin/am
If the argument is root required, use /system/xbin/su for the "application"
-=Emulator Arguments=-
2600.EMU:
non-root:
start -n com.explusalpha.A2600Emu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
Ataroid:
non-root:
start -n com.androidemu.atari/.EmulatorActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
C64.EMU:
non-root:
start -n com.explusalpha.C64Emu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
DraStic:
non-root:
start -n com.dsemu.drastic/.DraSticActivity -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -e GAMEPATH "%rom%"
ePSXe:
non-root:
start -n com.epsxe.ePSXe/.ePSXe -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -e com.epsxe.ePSXe.isoName "%rom%"
FPSE: ( NOTE: can be rather....buggy... also will only work in nobios mode )
non-root:
start -n com.emulator.fpse/.Main -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -e path "%rom%"
GameBoid:
non-root:
start -n com.androidemu.gba/.EmulatorActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
GBA.EMU:
non-root:
start -n com.explusalpha.GbaEmu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
GBC.EMU:
non-root:
start -n com.explusalpha.GbcEmu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
GBCoid:
non-root:
start -n com.androidemu.gbc/.EmulatorActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
Gearoid:
non-root:
start -n com.androidemu.gg/.EmulatorActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
Gensoid:
non-root:
start -n com.androidemu.gens/.EmulatorActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
MD.EMU:
non-root:
start -n com.explusalpha.MdEmu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
MSX.EMU:
non-root:
start -n com.explusalpha.MsxEmu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
Mupen64Plus AE Free 2.4.4: ( playstore )
non-root: ( will load the emulator menu with the correct rom selected )
start -n paulscode.android.mupen64plus.free/paulscode.android.mupen64plusae.MainActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
root: ( will first load the emulator with the correct rom and then reload to the play menu to either resume where you last left off on your game or restart the emu so the game is at first boot )
-c 'am start -n paulscode.android.mupen64plus.free/paulscode.android.mupen64plusae.MainActivity -a android.intent.action.VIEW -eu Uri "file://%rom%" && am start -S -n paulscode.android.mupen64plus.free/paulscode.android.mupen64plusae.PlayMenuActivity'
Mupen64Plus AE 2.4.4: ( playstore )
non-root: ( will load the emulator menu with the correct rom selected )
start -n paulscode.android.mupen64plus/paulscode.android.mupen64plusae.MainActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
root: ( will first load the emulator with the correct rom and then reload to the play menu to either resume where you last left off on your game or restart the emu so the game is at first boot )
-c 'am start -n paulscode.android.mupen64plus/paulscode.android.mupen64plusae.MainActivity -a android.intent.action.VIEW -eu Uri "file://%rom%" && am start -S -n paulscode.android.mupen64plus/paulscode.android.mupen64plusae.PlayMenuActivity'
Mupen64Plus AE: ( ouya discovery )
non-root: ( will load the emulator menu with the correct rom selected )
start -n paulscode.android.mupen64plusae/.MainActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
root: ( will first load the emulator with the correct rom and then reload to the play menu to either resume where you last left off on your game or restart the emu so the game is at first boot )
-c 'am start -n paulscode.android.mupen64plusae/.MainActivity -a android.intent.action.VIEW -eu Uri "file://%rom%" && am start -S -n paulscode.android.mupen64plusae/.PlayMenuActivity'
N64oid:
non-root:
start -n com.androidemu.n64/.EmulatorActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
NEO.EMU:
non-root:
start -n com.explusalpha.NeoEmu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
NES.EMU:
non-root:
start -n com.explusalpha.NesEmu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
NESoid:
non-root:
start -n com.androidemu.nes/.EmulatorActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
NGP.EMU:
non-root:
start -n com.explusalpha.NgpEmu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
PCE.EMU:
non-root:
start -n com.PceEmu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
PPSSPP:
non-root:
start -n org.ppsspp.ppsspp/.PpssppActivity -e org.ppsspp.ppsspp.Shortcuts "%rom%"
Reicast:
non-root:
start -n com.reicast.emulator/.GL2JNIActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
RetroArch: ( example using PS1 )
non-root:
start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -e ROM "%rom%" -e LIBRETRO /data/data/com.retroarch/cores/pcsx_rearmed_libretro_neon_android.so -e CONFIGFILE /data/data/com.retroarch/retroarch.cfg -e IME tv.ouya.console.ime.keyboard/.OUYAKeyboard -n com.retroarch/.browser.retroactivity.RetroActivityFuture
( for the other emulator cores just point to the appropriate libretro*.so )
Snes9x EX+:
non-root:
start -n com.explusalpha.Snes9xPlus/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
SNesoid:
non-root:
start -n com.androidemu.snes/.EmulatorActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
SuperGNES lite:
non-root:
start -n com.bubblezapgames.supergnes_lite/.SuperGNES -a android.intent.action.VIEW -eu Uri "file://%rom%"
SuperGNES:
non-root:
start -n com.bubblezapgames.supergnes/.SuperGNES -a android.intent.action.VIEW -eu Uri "file://%rom%"
-=Game Arguments=-
coming soon...
man, thanks to the reference to ouyaforum, I've seen the link to the latest/cheapest BT+IR controller that honestly will work both my TV/LCD and the Ouya at the same time - http://www.amazon.com/Media-Blu-ray-Remote-Control-Playstation-3/dp/B0050SX9I2/. ordered and gonna give it a try.
I got a Rii bluetooth off spamazon a while back but it is not performing up to snuff.
Just curious since I don't know what all the currently most used ( or user preferred ) emulators these days are.... but if people here could start listing emulators they use or would like to see the args and setup for please do post here and I'll get to adding it into the second post.
Sega Saturn and Atari Jaguar would be cool! :good:
I just wanted to say that this looks really awesome and can't wait to try it out!
Speechless
I cant believe I never found this thread until today. This is amazing, I cant thank you enough. This makes the Ouya a 1000x better. :good::good::good:
This needs to be put in more places. Is it okay if I post a link to this thread on a couple of forums(gwenael, xbmc.org, freaktab, xbmchub, xunitytalk, and so on)? Many people are curios about launching games through xbmc on android.
This is just.........I can't even put it into words.
You just made my month.
Thank you.Thank you. Thank you.Thank you. Thank you.Thank you. Thank you.Thank you. Thank you.Thank you.
---------- Post added at 07:47 AM ---------- Previous post was at 07:38 AM ----------
IncognitoMan said:
Just curious since I don't know what all the currently most used ( or user preferred ) emulators these days are.... but if people here could start listing emulators they use or would like to see the args and setup for please do post here and I'll get to adding it into the second post.
Click to expand...
Click to collapse
ppsspp(side-loaded) is the only one I dont see that id like to know for the ouya(Retroarch/libretro along with Mupen64plus pretty much handle everything else for me)
So how do you figure these arguments out in the first place?
1995mkw said:
I cant believe I never found this thread until today. This is amazing, I cant thank you enough. This makes the Ouya a 1000x better. :good::good::good:
This needs to be put in more places. Is it okay if I post a link to this thread on a couple of forums(gwenael, xbmc.org, freaktab, xbmchub, xunitytalk, and so on)? Many people are curios about launching games through xbmc on android.
This is just.........I can't even put it into words.
You just made my month.
Thank you.Thank you. Thank you.Thank you. Thank you.Thank you. Thank you.Thank you. Thank you.Thank you.
---------- Post added at 07:47 AM ---------- Previous post was at 07:38 AM ----------
ppsspp(side-loaded) is the only one I dont see that id like to know for the ouya(Retroarch/libretro along with Mupen64plus pretty much handle everything else for me)
So how do you figure these arguments out in the first place?
Click to expand...
Click to collapse
I was meaning to right a bit more in the guide in regards to how to figure out the args ( or in this case what intents are being called upon ) but to basically sum it up you can logcat and see how the apps intents are being passed and whats being called for ( you can also do the same thing by decompiling and looking at the source but for 90% of it you *should* be able to get away with using just logcat )
So far I haven't been able to get ppsspp to work due to it missing intents we need... so until the author adds intents that we can use to call for we cant use ppsspp with this other than to load the emulator.
Also I'll be massively updating ( and cleaning ) this thread *soon* to include RCB support ( Rom Collection Browser )
Yesterday between me and EldonMcGuinness we figured out what was causing the issues with it not wanting to work on android... lucky for us the changes were small and very little had to be done to make it work ( and it basically works the same way as Advanced Launcher )... The benefit of being able to use RCB is quite nice since not only is RCB included in the main repo of plugins ( thus this works not only on frodo but gotham too! ) but also because some skins actually have RCB support as a widget... so for instance my last 10 played games are shown on the home screen...
As for posting this at other forums I'm fine with that as long as it links back here so I can answer questions or maybe take requests on which games/apps they'd like to see added to the list.
--edit:
In fact you should start seeing the changes today ( I'll probably be moving posts around and refining more throughout the day )
IncognitoMan said:
I was meaning to right a bit more in the guide in regards to how to figure out the args ( or in this case what intents are being called upon ) but to basically sum it up you can logcat and see how the apps intents are being passed and whats being called for ( you can also do the same thing by decompiling and looking at the source but for 90% of it you *should* be able to get away with using just logcat )
So far I haven't been able to get ppsspp to work due to it missing intents we need... so until the author adds intents that we can use to call for we cant use ppsspp with this other than to load the emulator.
Also I'll be massively updating ( and cleaning ) this thread *soon* to include RCB support ( Rom Collection Browser )
Yesterday between me and EldonMcGuinness we figured out what was causing the issues with it not wanting to work on android... lucky for us the changes were small and very little had to be done to make it work ( and it basically works the same way as Advanced Launcher )... The benefit of being able to use RCB is quite nice since not only is RCB included in the main repo of plugins ( thus this works not only on frodo but gotham too! ) but also because some skins actually have RCB support as a widget... so for instance my last 10 played games are shown on the home screen...
As for posting this at other forums I'm fine with that as long as it links back here so I can answer questions or maybe take requests on which games/apps they'd like to see added to the list.
Click to expand...
Click to collapse
Its a shame ppsspp wont work. However the fact that RCB is on the verge of working is quite nice(RCB is what Im using on my HTPC).
I'll try fiddling around with logcat later(Its all always good to know how to do things yourself.)
One of the things I noticed about this thread is the lack of activity(posts/veiws) despite its significance(I believe this is due to the lack of traffic in the Ouya section of xda). Im sure a lot of people are interested in this but just haven't had the opportunity to see the thread(Ive been looking for something like this since just after Christmas and only found it just now). This is is useful to more than just people with an Ouya. Anyone running an android device attached to their TV can benefit from this guide(Though the Ouya makes the most sense since it is operated with a gamepad).
So I figured posting links to this thread on the places I was originally looking(Mainly xbmc and advanced launcher related resouses/fourums. I just never thought about looking in a device specific forum despite it being the device I wanted this for in the first place) would help people find this easier.
1995mkw said:
Its a shame ppsspp wont work. However the fact that RCB is on the verge of working is quite nice(RCB is what Im using on my HTPC).
I'll try fiddling around with logcat later(Its all always good to know how to do things yourself.)
One of the things I noticed about this thread is the lack of activity(posts/veiws) despite its significance(I believe this is due to the lack of traffic in the Ouya section of xda). Im sure a lot of people are interested in this but just haven't had the opportunity to see the thread(Ive been looking for something like this since just after Christmas and only found it just now). This is is useful to more than just people with an Ouya. Anyone running an android device attached to their TV can benefit from this guide(Though the Ouya makes the most sense since it is operated with a gamepad).
So I figured posting links to this thread on the places I was originally looking(Mainly xbmc and advanced launcher related resouses/fourums. I just never thought about looking in a device specific forum despite it being the device I wanted this for in the first place) would help people find this easier.
Click to expand...
Click to collapse
I've been thinking about posting this into a more generic section once the guide is a little more... finished. As yes you are correct, the guide applies to all devices that are plugged into a tv and use xbmc ( very little of the guide has to be changed... only retroarch's IME selection and location of su is about it )
As for RCB I updated the second post so far to include what has to be changed to get it to work on android... the rest of it works similar to Advanced Launcher but I need to fill the rest out for that.
This is an amazing thread and its opened up a whole new world for me and my JXD S7800. I just figured out how to get RCB to launch Android games. It requires using nfo files as ROM files, and the %GAMECMD% param to parse the right info to the command line. GAMECMD can be entered manually within RCB but its easier to put it in the nfo file your going to use as a ROM file and then set one of your scrapers as LocalNFO.
For the file located
Code:
/addons/script.games.rom.collection.browser/resources/lib/dbupdate.py
Replace:
Code:
region = self.resolveParseResult(gamedescription, 'Region')
With:
Code:
gameCmd = self.resolveParseResult(gamedescription, 'GameCmd')
region = self.resolveParseResult(gamedescription, 'Region')
and Replace:
Code:
gameId = self.insertGame(gamename, plot, romCollection.id, publisherId, developerId, reviewerId, yearId,
With:
Code:
gameId = self.insertGame(gamename, plot, gameCmd, romCollection.id, publisherId, developerId, reviewerId, yearId,
and Replace:
Code:
def insertGame(self, gameName, description, romCollectionId, publisherId, developerId, reviewerId, yearId,
With:
Code:
def insertGame(self, gameName, description, gameCmd, romCollectionId, publisherId, developerId, reviewerId, yearId,
and Replace:
Code:
Game(self.gdb).insert((gameName, description, None, None, romCollectionId, publisherId, developerId, reviewerId, yearId,
With:
Code:
Game(self.gdb).insert((gameName, description, gameCmd, None, romCollectionId, publisherId, developerId, reviewerId, yearId,
and Replace:
Code:
Game(self.gdb).update(('name', 'description', 'romCollectionId', 'publisherId', 'developerId', 'reviewerId', 'yearId', 'maxPlayers', 'rating', 'numVotes',
'url', 'region', 'media', 'perspective', 'controllerType', 'originalTitle', 'alternateTitle', 'translatedBy', 'version', 'isFavorite', 'launchCount'),
(gameName, description, romCollectionId, publisherId, developerId, reviewerId, yearId, players, rating, votes, url, region, media, perspective, controller,
originalTitle, alternateTitle, translatedBy, version, int(isFavorite), int(launchCount)),
gameId, allowOverwriteWithNullvalues)
With:
Code:
Game(self.gdb).update(('name', 'description', 'gameCmd', 'romCollectionId', 'publisherId', 'developerId', 'reviewerId', 'yearId', 'maxPlayers', 'rating', 'numVotes',
'url', 'region', 'media', 'perspective', 'controllerType', 'originalTitle', 'alternateTitle', 'translatedBy', 'version', 'isFavorite', 'launchCount'),
(gameName, description, gameCmd, romCollectionId, publisherId, developerId, reviewerId, yearId, players, rating, votes, url, region, media, perspective, controller,
originalTitle, alternateTitle, translatedBy, version, int(isFavorite), int(launchCount)),
gameId, allowOverwriteWithNullvalues)
Then for the file located
Code:
/addons/script.games.rom.collection.browser/resources/scraper/00 - local nfo.xml
Replace:
Code:
<Game>title</Game>
With:
Code:
<Game>title</Game>
<GameCmd>gameCmd</GameCmd>
Now set your "Emulator Cmd" to:
Code:
/system/xbin/su
and your "Emulator Params" to
Code:
-c 'am start -n %GAMECMD%'
and your "Rom Fie Mask" to
Code:
*.nfo
and one of your scrapers need to be set to "local nfo"
Now set the "Rom Path" to any empty folder on your SD card. Then create text files in this folder and change their extensions to nfo. The name of the nfo is not important but inside it you need:
Code:
<game>
<gameCmd>PackageName/ActivityName</gameCmd>
<game>
An example is the following to run Punch Quest
Code:
<game>
<gameCmd>com.noodlecake.punchquest.humble/com.noodlecake.punchquest.punchquest</gameCmd>
<game>
And that's it. This setup has it working for me.
Ignore this post.
I'm having some problems with Mupen64Plus AE. I've used the root command, haven't tried the one with am. I think there's some problems with the parameters, because I've tried running the command in terminal it says that the MainActivity doesn't exist.
I checked Mupen64Plus AE on Github, and it seems like they don't use the MainActivity any longer, but I don't know what command to use instead. Oh, and I'm using an Android stick, not an Ouya, but that shouldn't matter in this case - should it? I'm still using SPMC.
Any help, please?
Cheers
sindrefyrn said:
I'm having some problems with Mupen64Plus AE. I've used the root command, haven't tried the one with am. I think there's some problems with the parameters, because I've tried running the command in terminal it says that the MainActivity doesn't exist.
I checked Mupen64Plus AE on Github, and it seems like they don't use the MainActivity any longer, but I don't know what command to use instead. Oh, and I'm using an Android stick, not an Ouya, but that shouldn't matter in this case - should it? I'm still using SPMC.
Any help, please?
Cheers
Click to expand...
Click to collapse
I'll check it out sometime today... ATM I'm using my ouya for test flashing cm10.2/cm11 builds so I haven't had much time to see if they've changed ( I did find out that retroarch changed and have fixed the args accordingly ).
IncognitoMan said:
I'll check it out sometime today... ATM I'm using my ouya for test flashing cm10.2/cm11 builds so I haven't had much time to see if they've changed ( I did find out that retroarch changed and have fixed the args accordingly ).
Click to expand...
Click to collapse
That's awesome - thanks.
sindrefyrn said:
That's awesome - thanks.
Click to expand...
Click to collapse
I'm guessing you are using the free version from the google play store...
If so then there's a *slight* change to the command... heres the command set for people wanting to use the one on the playstore. ( as of 2.4.4 )
Mupen64Plus AE Free 2.4.4:
non-root: ( will load the emulator menu with the correct rom selected )
start -n paulscode.android.mupen64plus.free/paulscode.android.mupen64plusae.MainActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
root: ( will first load the emulator with the correct rom and then reload to the play menu to either resume where you last left off on your game or restart the emu so the game is at first boot )
-c 'am start -n paulscode.android.mupen64plus.free/paulscode.android.mupen64plusae.MainActivity -a android.intent.action.VIEW -eu Uri "file://%rom%" && am start -S -n paulscode.android.mupen64plus.free/paulscode.android.mupen64plusae.PlayMenuActivity'
-----
*sigh* this is why I wish I would have a more vanilla android device to test this with...
Anyway thanks for the heads up sindrefyrn... if you run across any others that have problems let me know and I'll see about checking it out.
IncognitoMan said:
I'm guessing you are using the free version from the google play store...
If so then there's a *slight* change to the command... heres the command set for people wanting to use the one on the playstore. ( as of 2.4.4 )
Mupen64Plus AE Free 2.4.4:
non-root: ( will load the emulator menu with the correct rom selected )
start -n paulscode.android.mupen64plus.free/paulscode.android.mupen64plusae.MainActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
root: ( will first load the emulator with the correct rom and then reload to the play menu to either resume where you last left off on your game or restart the emu so the game is at first boot )
-c 'am start -n paulscode.android.mupen64plus.free/paulscode.android.mupen64plusae.MainActivity -a android.intent.action.VIEW -eu Uri "file://%rom%" && am start -S -n paulscode.android.mupen64plus.free/paulscode.android.mupen64plusae.PlayMenuActivity'
-----
*sigh* this is why I wish I would have a more vanilla android device to test this with...
Anyway thanks for the heads up sindrefyrn... if you run across any others that have problems let me know and I'll see about checking it out.
Click to expand...
Click to collapse
THANK YOU!!! :laugh:
This is amazing. I'm actually using the paid version, but even I could figure out what to do with the command.
Roms on NFS mount
First I would like to thank you for all of the work that has been put to get things working!!!!
My question is around XMBC and NFS mounts. In XMBC / Rom Collection Browser I am able to map an nfs share to my roms. When I click on a rom to play it comes up to the menu for Snes9x EX+. Is this the expected behavior? I know when I launch Snes9x that it only sees the local file system so I am guessing that is the reason that it does not play the game but wanted to check because of going through XBMC. If that is the case is there a way to mount an nfs mount to the system when the system is rooted ?
Thank you
Techhead33 said:
First I would like to thank you for all of the work that has been put to get things working!!!!
My question is around XMBC and NFS mounts. In XMBC / Rom Collection Browser I am able to map an nfs share to my roms. When I click on a rom to play it comes up to the menu for Snes9x EX+. Is this the expected behavior? I know when I launch Snes9x that it only sees the local file system so I am guessing that is the reason that it does not play the game but wanted to check because of going through XBMC. If that is the case is there a way to mount an nfs mount to the system when the system is rooted ?
Thank you
Click to expand...
Click to collapse
Should work as long as the command is passed correctly... sounds like its not finding the rom...
could you tell me where you are pointing your the roms folder? ( maybe paste the config for snes? )
If we can install full Linux OS on note 10.1 2014, then it will become the truly laptop replacement.
It seems that Linux deploy is very promising, but it require a truly working root
Someone used Linux deploy to install full Linux OS on note 10.1 2012 and turned note into a full Linux laptop when needed.
https://play.google.com/store/apps/details?id=ru.meefik.linuxdeploy
Can someone savvy give it a try?
I've played around with a few installers and in the terminal by hand for a few hours. I am not able to grant permission to chroot. Even with root. I will look into this in the future.
dasmoover said:
I've played around with a few installers and in the terminal by hand for a few hours. I am not able to grant permission to chroot. Even with root. I will look into this in the future.
Click to expand...
Click to collapse
someone managed to install Linux on note3
https://github.com/meefik/linuxdeploy/issues/77
Since note 10.1 2014 is essentially an enlarged note3, above information maybe helpful for you
Got Linux deploy (linuxonandroid) app working with work
Hello, Sorry meant to say Complete Linux Installer in the topic, not Linux Deploy!
I tried the Linux Deploy project with no luck. The post that was in this thread got me to the point that you need to apply a patch in the source code ShellEnv.java and then recompile. It sets it up so it prefaces all commands in the script with su when run. I was not able to recompile the code nor anyone that could give it to me. So I moved on to the Complete Linux Installer linuxonandroid app http://linuxonandroid.org/ I ran into the same problems but I was able to get around it because the script that is used to starts the Linux distribution is editable it is bootscript.sh placed in /data/data/com/zpwebsites.linuxonandroid/files this script is automatically created when you walk through the setup/install process while you are downloading an image file going through the setup process you can edit this file as it will be created at that point, where ever you see "$bbox and a xxxxx" in the script you change it to "su $bbox and xxxxxxx" so basically you have to preface all these points which there are a lot of with su. This is part of the situation. Second part is that you will need to setup the mount point for the loop directory by hand and you can see this in the script, then you will need to mount the loop directory and then create each directory inside to what is specified in the script.Then unmount the loop directory, or reboot and then you can finish the setup and launch the distribution.
You may run into errors along the way and you will need to correct them as needed. This is no easy task to setup unless you are familiar with linux and what the script is doing. Sorry I have no easy way but I was able to get it running with the Ubuntu small images to even include the display, still having so issues getting the xwindow to display correctly in the other large images which are close to a full distribution.
All my work was done with a terminal emulator, root explorer, a text editor, Complete Linux Installer(linuxonandroid from ZPWebSites), and a VNC client. Oh and using the spen and Bluetooth keyboard helps as it takes more time with just the touch interface and keyboard for what needs to be done.
It is possible to get running but you have to work at it, took me 3 hours to work through all the issues and I am familiar with Linux and its tools.
Hope this gets you in the direction you need because it was important to me to get this working for what I do. I have sent updates to the developer to hope he can automate this in the future. With Samsung's Android implementation with multiple user config it messes with the security context of scripts because each command can be run through an interactive terminal session. But the script needs to pass SU with the commands to get it to work.
I have a Samsung Galaxy Note 10.1 2014 WIFI P600 and should work with the other models too because not specific to a model. Seems this work with a Galaxy S4 as well since they are setup the same in the OS from what I have found.
quser1 said:
Hello, Sorry meant to say Complete Linux Installer in the topic, not Linux Deploy!
I tried the Linux Deploy project with no luck. The post that was in this thread got me to the point that you need to apply a patch in the source code ShellEnv.java and then recompile. It sets it up so it prefaces all commands in the script with su when run. I was not able to recompile the code nor anyone that could give it to me. So I moved on to the Complete Linux Installer linuxonandroid app http://linuxonandroid.org/ I ran into the same problems but I was able to get around it because the script that is used to starts the Linux distribution is editable it is bootscript.sh placed in /data/data/com/zpwebsites.linuxonandroid/files this script is automatically created when you walk through the setup/install process while you are downloading an image file going through the setup process you can edit this file as it will be created at that point, where ever you see "$bbox and a xxxxx" in the script you change it to "su $bbox and xxxxxxx" so basically you have to preface all these points which there are a lot of with su. This is part of the situation. Second part is that you will need to setup the mount point for the loop directory by hand and you can see this in the script, then you will need to mount the loop directory and then create each directory inside to what is specified in the script.Then unmount the loop directory, or reboot and then you can finish the setup and launch the distribution.
You may run into errors along the way and you will need to correct them as needed. This is no easy task to setup unless you are familiar with linux and what the script is doing. Sorry I have no easy way but I was able to get it running with the Ubuntu small images to even include the display, still having so issues getting the xwindow to display correctly in the other large images which are close to a full distribution.
All my work was done with a terminal emulator, root explorer, a text editor, Complete Linux Installer(linuxonandroid from ZPWebSites), and a VNC client. Oh and using the spen and Bluetooth keyboard helps as it takes more time with just the touch interface and keyboard for what needs to be done.
It is possible to get running but you have to work at it, took me 3 hours to work through all the issues and I am familiar with Linux and its tools.
Hope this gets you in the direction you need because it was important to me to get this working for what I do. I have sent updates to the developer to hope he can automate this in the future. With Samsung's Android implementation with multiple user config it messes with the security context of scripts because each command can be run through an interactive terminal session. But the script needs to pass SU with the commands to get it to work.
I have a Samsung Galaxy Note 10.1 2014 WIFI P600 and should work with the other models too because not specific to a model. Seems this work with a Galaxy S4 as well since they are setup the same in the OS from what I have found.
Click to expand...
Click to collapse
Can you upload the edited script?
dasmoover said:
Can you upload the edited script?
Click to expand...
Click to collapse
Yes, I will try. One thing is that the script is producing errors when you try to Exit the running distro with syntax errors on a couple of commands and I have not been able to fix them, they looks like script issues from the generated script, still need investigation and I have contacted the developer. Only way I have been able to get the system to unmount the loop device after an exit is to restart the tablet because of the script errors. Also you will need to create all the file system in the loop directory as the script is not doing it automatically.
---------- Post added at 09:43 AM ---------- Previous post was at 09:26 AM ----------
Tried to attach file so keep getting error so pasting the script here. Just so you know this is an auto created script on setup so not sure if it is different for each install.
###########################################
# Linux boot script V8 for Android v4.3 #
# Built by Zachary Powell (zacthespack) #
# and Martin Møller (Tuxling) #
# Thanks to: #
# Johan Vromans #
# Marshall Levin #
# Vaykadji #
# and to everyone at XDA! #
# Feel free to edit/use this script as you#
# like but credit Linuxonandroid.org #
###########################################
# $ver: V8 #
###########################################
###########################################
# This is a function we use to stop the #
# script in case of errors #
###########################################
error_exit() {
echo "Error: $1"
exit 1
}
###########################################
# Set up variables #
###########################################
if [ -f /data/data/com.zpwebsites.linuxonandroid/files/busybox ]; then
export bbox=/data/data/com.zpwebsites.linuxonandroid/files/busybox
elif [ -f /data/data/com.zpwebsites.linuxonandroid.opensource/files/busybox ]; then
export bbox=/data/data/com.zpwebsites.linuxonandroid.opensource/files/busybox
else
export bbox=/system/xbin/busybox
fi
export usermounts=android # Base folder all user mounts are done in, should be moved to app later
export imgfile=$(dirname $0)/ubuntu.img # Default image file, another can be set by using an argument
export bin=/system/bin
export mnt=/data/local/mnt
export USER=root
if [[ ! -d $mnt ]]; then mkdir $mnt; fi
export PATH=$bin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
export TERM=linux
export HOME=/root
###########################################
# Handle arguments if present #
###########################################
if [ $# -ne 0 ]; then
if [ -f $1 ]; then # Is full path present?
imgfile=$1
elif [ -f $(dirname $0)/$1 ]; then # Is only a filename present?
imgfile=$(dirname $0)/$1
else
error_exit "Image file not found!($1)"
fi
fi
###########################################
# If a md5 file is found we check it here #
###########################################
if [ -f $imgfile.md5 ]; then
echo "MD5 file found, use to check .img file? (y/n)"
read answer
if [ $answer == y ]; then
echo -n "Validating image checksum... "
$bbox md5sum -c -s $imgfile.md5
if [ $? -ne 0 ];then
echo "FAILED!"
error_exit "Checksum failed! The image is corrupted!"
else
echo "OK"
rm $imgfile.md5
fi
fi
fi
################################
# Find and read config file #
# or use defaults if not found #
################################
use_swap=no
cfgfile=$imgfile.config # Default config file if not specified
if [ -f $imgfile.config ]; then
source $imgfile.config
fi
###########################################
# Set Swap up if wanted #
# #
###########################################
if [ $use_swap == yes ]; then
if [ -f $imgfile.swap ]; then
echo "Swap file found, using file"
echo "Turning on swap (if it errors here you do not have swap support"
swapon $imgfile.swap
else
echo "Creating Swap file"
dd if=/dev/zero of=$imgfile.swap bs=1048576 count=1024
mkswap $imgfile.swap
echo "Turning on swap (if it errors here you do not have swap support"
swapon $imgfile.swap
fi
fi
###########################################
# Set up loop device and mount image #
###########################################
echo -n "Checking loop device... "
if [ -b /dev/block/loop255 ]; then
echo "FOUND"
else
echo "MISSING"
# Loop device not found so we create it and verify it was actually created
echo -n "Creating loop device... "
su $bbox mknod /dev/block/loop255 b 7 255
if [ -b /dev/block/loop255 ]; then
echo "OK"
else
echo "FAILED"
error_exit "Unable to create loop device!"
fi
fi
su $bbox losetup /dev/block/loop255 $imgfile
if [ $? -ne 0 ];then error_exit "Unable to attach image to loop device! (Image = $imgfile)"; fi
su $bbox mount -t ext4 /dev/block/loop255 $mnt
if [ $? -ne 0 ];then error_exit "Unable to mount the loop device!"; fi
###########################################
# Mount all required partitions #
###########################################
su $bbox mount -t devpts devpts $mnt/dev/pts
if [ $? -ne 0 ];then error_exit "Unable to mount $mnt/dev/pts!"; fi
su $bbox mount -t proc proc $mnt/proc
if [ $? -ne 0 ];then error_exit "Unable to mount $mnt/proc!"; fi
su $bbox mount -t sysfs sysfs $mnt/sys
if [ $? -ne 0 ];then error_exit "Unable to mount $mnt/sys!"; fi
su $bbox mount -o bind /sdcard $mnt/sdcard
if [ $? -ne 0 ];then error_exit "Unable to bind $mnt/sdcard!"; fi
if [[ ! -d $mnt/root/cfg ]]; then mkdir $mnt/root/cfg; fi
su $bbox mount -o bind $(dirname $imgfile) $mnt/root/cfg
su $bbox mount -o bind /sys/fs/selinux $mnt/selinux
###########################################
# Checks if you have a external sdcard #
# and mounts it if you do #
###########################################
if [ -d /sdcard/external_sd ]; then
su $bbox mount -o bind /sdcard/external_sd $mnt/external_sd
fi
if [ -d /Removable/MicroSD ]; then
su $bbox mount -o bind /Removable/MicroSD $mnt/external_sd
fi
# This is for the HD version of the Archos 70 internet tablet, may be the same for the SD card edition but i dont know.
if [ -d /storage ]; then
su $bbox mount -o bind /storage $mnt/external_sd
fi
###########################################
# Mount all user defined mounts if any #
###########################################
if [ -f $imgfile.mounts ]; then
olddir=$(pwd)
echo "Mounting user mounts"
cd $mnt
if [[ ! -d $mnt/$usermounts ]]; then su $bbox mkdir -p $usermounts; fi
echo "# Script to unmount user defined mounts, do not delete or edit!" > $imgfile.shutdown
echo "cd $mnt/$usermounts" > $imgfile.shutdown
cd $mnt/$usermounts
for entry in $(cat "$imgfile.mounts"); do
ANDROID=${entry%;*}
LINUX=${entry#*;}
if [[ -d $ANDROID ]]; then
echo -n "Mounting $ANDROID to $usermounts/$LINUX... "
if [[ ! -d $mnt/$usermounts/$LINUX ]]; then su $bbox mkdir -p $LINUX; fi
su $bbox mount -o bind $ANDROID $mnt/$usermounts/$LINUX &> /dev/null
if [ $? -ne 0 ];then
echo FAIL
if [[ -d $mnt/$usermounts/$LINUX ]]; then su $bbox rmdir -p $LINUX; fi
else
echo OK
echo "su $bbox umount $mnt/$usermounts/$LINUX" >> $imgfile.shutdown
echo "su $bbox rmdir -p $LINUX" >> $imgfile.shutdown
fi
else
echo "Android folder not found: $ANDROID"
fi
done
echo "cd $mnt" >> $imgfile.shutdown
echo "su $bbox rmdir -p $usermounts" >> $imgfile.shutdown
cd $olddir
else
echo "No user defined mount points"
fi
###########################################
# Sets up network forwarding #
###########################################
su $bbox sysctl -w net.ipv4.ip_forward=1
if [ $? -ne 0 ];then error_exit "Unable to forward network!"; fi
# If NOT $mnt/root/DONOTDELETE.txt exists we setup hosts and resolv.conf now
if [ ! -f $mnt/root/DONOTDELETE.txt ]; then
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
if [ $? -ne 0 ];then error_exit "Unable to write resolv.conf file!"; fi
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "127.0.0.1 localhost" > $mnt/etc/hosts
if [ $? -ne 0 ];then error_exit "Unable to write hosts file!"; fi
fi
###########################################
# Chroot into ubuntu #
###########################################
su $bbox chroot $mnt /root/init.sh $(basename $imgfile)
###########################################
# Shut down ubuntu #
###########################################
echo "Shutting down Linux ARM"
#for pid in `lsof | grep $mnt | sed -e's/ / /g' | cut -d' ' -f2`; do kill -9 $pid >/dev/null 2>&1; done
for pid in `su $bbox lsof | su $bbox grep $mnt | su $bbox sed -e's/ / /g' | su $bbox cut -d' ' -f2`; do su $bbox kill -9 $pid >/dev/null 2>&1; done
sleep 5
###########################################
# Unmount all user defined mounts if any #
###########################################
if [ -f $imgfile.shutdown ]; then
echo "Unmounting user defined mounts"
sh $imgfile.shutdown
rm $imgfile.shutdown
fi
su $bbox umount $mnt/root/cfg
su $bbox umount $mnt/sdcard
su $bbox umount $mnt/external_sd
su $bbox umount $mnt/dev/pts
su $bbox umount $mnt/dev
su $bbox umount $mnt/proc
su $bbox umount $mnt/sys
su $bbox umount $mnt/selinux
su $bbox umount $mnt
su $bbox losetup -d /dev/block/loop255 &> /dev/null
for those brave enough ,try SELinux Permissive Kernel,maybe all problems will be solved.
http://forum.xda-developers.com/showthread.php?t=2590311
robertchow said:
for those brave enough ,try SELinux Permissive Kernel,maybe all problems will be solved.
http://forum.xda-developers.com/showthread.php?t=2590311
Click to expand...
Click to collapse
Yes the kernel in the thread you posted allows for Linux function in Complete Linux Installer. After the kernel is installed either use Wanam Xposed and disabling SELinux to set as always Permissive, or using "setenforce 0" in terminal(this is only for the session and once the system reboots will go back to Enforcing or if "setenforce 1")
At that point if you use getenforce at a terminal will show as Permissive and Linux will boot normally with full function.
My hat goes off to the developer of the kernel because now I have everything on the tablet I need.
FYI on my Ubuntu large installs I am running into a new SELinux issue, even with it in Permissive doing an apt-get upgrade, causes issues with an error related to invalid security context selinux, cant remember the full error. I am not seeing this with the Fedora large image. When this happens with the Ubuntu ones it breaks the KDE GUI and the Application menu ends up blank. The error occurs when install packages try to address the Ubuntu Group security, packages like colord is just an example which do a security group change. Still plowing through how to fix. Till then using Fedora which I haven't used in years
Hi,
I tried with the large Ubuntu image and get an error as well with apt-get update...not being too conversant on Linux on Android, I would like to find out if you had a fix or a resolution from the developers? Might have to stay with the Xperia Z Tablet for Linux in the meantime...
Fedora 19 via Complete Linux Installer. Have Selinux Permissive Kernel, Selinux Mode Changer, and root of course. Otherwise FW is stock MJ6.
Just a few remarks:
The Fedora image is a bit small for a full blown Linux desktop. I copied the contents to a larger 8 GB image. Had to reformat the SD card with exFAT in order to store the image there. Copying was done on a desktop computer because MTP connection just stops at 4 GB.
Changes to scripts include changing the mount command for external_sd to /storage/extSdCard in boot script. Once Linux is up and running, change /root/init.sh, find the line that starts vncserver and append -dpi 300, otherwise fonts in Linux are barely readable. Wigdets are still kind of small but at least the fonts are readable now.
If you get a connection refused in AndroidVNC, you may have to set a password on the Linux terminal for user, that is su - fedora, then vncpasswd.
Todo: find out why second start of Linux fails on loop mount busy and why shutdown complains about umount of dev.
So, my note happily runs KDE desktop, LibreOffice, and kile for LaTeX. The latter was the main reason for putting Linux on the note.
caferick said:
Fedora 19 via Complete Linux Installer. Have Selinux Permissive Kernel, Selinux Mode Changer, and root of course. Otherwise FW is stock MJ6.
Just a few remarks:
The Fedora image is a bit small for a full blown Linux desktop. I copied the contents to a larger 8 GB image. Had to reformat the SD card with exFAT in order to store the image there. Copying was done on a desktop computer because MTP connection just stops at 4 GB.
Changes to scripts include changing the mount command for external_sd to /storage/extSdCard in boot script. Once Linux is up and running, change /root/init.sh, find the line that starts vncserver and append -dpi 300, otherwise fonts in Linux are barely readable. Wigdets are still kind of small but at least the fonts are readable now.
If you get a connection refused in AndroidVNC, you may have to set a password on the Linux terminal for user, that is su - fedora, then vncpasswd.
Todo: find out why second start of Linux fails on loop mount busy and why shutdown complains about umount of dev.
So, my note happily runs KDE desktop, LibreOffice, and kile for LaTeX. The latter was the main reason for putting Linux on the note.
Click to expand...
Click to collapse
Thanks for the post. I played around with linux on my note 2 and have been waiting to get it running on my 2014. How well does it handle linux?
Sent from my SM-P600 using XDA Premium 4 mobile app
Duly.noted said:
How well does it handle linux?
Click to expand...
Click to collapse
It runs reasonably well. I guess the limiting factor is disk I/O, or SD I/O in this case. I run KDE 4 in desktop mode with graphical desktop effects disabled and most of the KDE services like indexing disabled. It takes about 15-20 seconds from finished boot to desktop. Once the desktop is up and running, opening apps like LibreOffice is fast enough. Feels like with the first generation Atom netbooks. KDE is a resource hog, it would probably make sense to go for something that is lighter on resources but I chose KDE for girlfriend compatibility. She only knows KDE and I won't force her to learn the XFCE way or something even more obscure like Gnome3 http://forum.xda-developers.com/images/smilies/tongue.gif .
Vncserver runs at native full screen, ie 2560x1600 at 300 dpi. There was a noticable screen redraw lag when closing windows. That was easily fixed by disabling the desktop background image. I have not yet done any high load tasks. Only opened LibreOffice and kile for a quick check.
I have a cheapo foldable bluetooth keyboard. Need to get a small bluetooth mouse. Any recommendations? Or a small keyboard/touchpad combo I can take with me when traveling.
To Caferick - Fedora 19 step by step
Hi can you explain step by step how u got the Fedora 19 to wor pleasek? where i can find the bootscript?
Amadyl said:
Hi can you explain step by step how u got the Fedora 19 to wor pleasek? where i can find the bootscript?
Click to expand...
Click to collapse
Hum, a step by step guide would be rather longish. To answer the question: Complete Linux Installer scripts are located in /data/data/com.zpwebsites.linuxonandroid/files. There is the bootscript.sh. However, editing it is not strictly necessary. It should work as is. Alright, let's see
Preliminaries:
* need root on your device along with the usual suspects like busybox and terminal emulator (both on Google Play)
* need selinux set to permissive -> flash selinux permissive kernel (to be found in xda forums) and install something like SELinuxModeChanger (Play) set to always change SELinux mode to permissive, check by rebooting and then Configuration > General > Device Info, it should say Permissive
* useful apps include a decent file manager (I like TotalCommander), ZIP extractor (ZArchiver), text editor (Jota), these make things somewhat easier
* required app: AndroidVNC (Play)
1. Install Complete Linux Installer from Play
* start the app and open the menu by touching the < sign at the top left
* choose installation guides (or the like, my interface is not English)
* choose Fedora 19, there are four tabs, work through them in sequence, second tab presents a download button, if you have not yet installed Terminal and AndroidVNC you can use the two other buttons to do it now
* third tab asks you to unzip the downloaded image, the ZIP will probably be in /storage/emulated/0/download, move it to the root of your external SD card, unzip with Zarchiver
* there should now be a new folder fedoraXXXXX with two files in it, the fedora-*.img and an md5 file, you can safely delete the md5 file and maybe rename the image to something like fedora.img, likewise for the enclosing folder
* read the rest of tab 3 and 4
2. Start Linux
* go back to CompLinInstaller menu and push the second entry labeled Start
* a page will open and probably say Ubuntu in the drop down combo box above the Start button, change it to Fedora and type in the path to the image, like /storage/extSdCard/fedora/fedora.img
* push the Start button
* a terminal will open and a few lines will fly by. If everything goes well, you will be asked to set passwords two times, just use a trivial one like 12345678, you can change it later if you are paranoid about passwords
* you will be asked to set the resolution for VNC, type 2560x1600 which is the native resolution of the tab
* you will be asked whether you want to autostart VNC, type y
* you will be asked whether you want to start SSH server, type n
* your choice will be saved right beside the image file, in my case the file is called fedora.img.config, you can change it with any text editor
3. In the chroot terminal
* still in the terminal, the prompt should now say [email protected]
* while you are there, type su - fedora , the prompt should change to [email protected]
* type vncpasswd to set a password for VNC access, just use the same password as above, then type exit
* you are back at [email protected] If you have a keyboard (bluetooth or USB), you can edit the file init.sh with vi and append -dpi 300 to vncserver startup line. This setting will take effect at next start because vncserver. If you do not have a keyboard or do not know vi editor, you can skip this for now.
4. VNC
* start AndroidVNC, Nick: fedora, Password: 12345678, Address: localhost, Port: 5900, Color Format: 24-bit color (4bpp), Connect
* you should now see a linux desktop with tiny fonts
* hit the tabs config button to bring up AndroidVNC options, change input mode to touchpad
* you can now move the linux pointer with your finger on the display
5. Shutdown
* in VNC Linux logout just as you would log out of any other Linux desktop
* terminate VNC session by choosing Disconnect from AndroidVNC config menu
* switch to the still running terminal and type exit
* Linux now stops, wait a few seconds and close the terminal
There are still some minor problems with shutdown which I am trying to trace. A subsequent start of Linux will not work because of busy devices. So best reboot the tab and try again.
That's it for the base setup. Uh, the text is long indeed. Has it worked for you so far? Next comes customization
Corrections welcome, I typed this down from memory...
script
So we need to create script ourselves, when i've done it, i was set resolution to my tablet's resolution, then all is poor to see, that words and windows is too small to work, so it's horrible at the moment, but else works good enough. Is anyone know how to get normal UI on that big resolution? Sorry for my bad english.
Hey guys is there a walk through on how to increase the IMG size for fedora in a windowc pc ? i al ready have the SD partitioned just need to encrease the size to 10 GB
sits at boot up
My device is rooted, chroot installed, vnc installed, and busybox installed.
I install SELinux Permissive and systems sits at bootup screen. never boots to OS at any point. Just sits and the Samsung screen.
I have the Galaxy Note 10.1 SM-P600 (2014 Edition).
How long does it sit at the Samsung Boot screen before finally booting the rest of the way?
I installed using Odin 3.09.
I have running Ubuntu (xfce) on my Note 3 with Linux Deploy. VNC is not the way, it is slow. You should use framebuffer mode and you will be astonished how nice its running. Also, I modified xorg.conf for the phone to only react to stylus input and the stylus button to be right click. This setup is also working on my Note 10.1 old edition.
mdalacu said:
I have running Ubuntu (xfce) on my Note 3 with Linux Deploy. VNC is not the way, it is slow. You should use framebuffer mode and you will be astonished how nice its running. Also, I modified xorg.conf for the phone to only react to stylus input and the stylus button to be right click. This setup is also working on my Note 10.1 old edition.
Click to expand...
Click to collapse
Can we use it without linux deploy, because it doesn't work on sm-p605? Can you point us to some guide or documentation? Thanks.
Hey guys, I've just decided to get inside of the Android development world. Anyways, I'm mostly a fan of Linux, so I've made my first Linux script, I know it's simple, but I've never interacted with the user before, or picked an output. When I knew that Android made use of Linux in its core, my interest on working inside it grew up faster than ever.
In my script, firstly, you type the filename. For compatibility reasons, it'll everytime save to /sdcard/filename. Then, it will ask you how many times you want the script to log everything, and lately, every how many seconds should it save everything to the file.
The script will save, before every entry at the log, the screen status (if it's on or off), that can help to, for example, if your device has been lagging as a result of a bad screen driver or UI error.
Last thnig: it also works on recovery (maybe it give some error, and if no dumpsys is present on your recovery's ramdisk, it'll save everything as OFF).
Remember to send it anywhere excepting from /storage and any sbudir, it won't work as the Android permissions system blocks script execution on those dirs.
Code:
clear
# Wipe $logfile content in /sdcard (if any existing)
echo "Please type the filename where you want to save the log: "
read -r logfile
echo "" > /sdcard/$logfile
echo "Deleted previous log."
echo "SCREEN | CPU" >> /sdcard/$logfile
#cont=60
cont=1
#SHOWLOG=X
echo "Please type how many times the cycle must repeat: "
read -r maxcont
echo "Please type how many seconds will the interval take: "
read -r maxmin
clear
# Here it counts how many times the logging script has been ran
while [ $cont -lt $((maxcont + 1)) ];
do
# That nested while takes control of how many seconds have passed in the current cycle
while [ "$contmin" -lt "$maxmin" ];
do
contmin=$((contmin + 1))
sleep 1
clear
echo "C: $cont/$maxcont - T: $contmin/$maxmin"
done
# echo "$maxmin seconds passed."
# Logs the fist line of "busybox top" to a var
LOGVAR=$(busybox top -d 1 -n 1 | grep "idle")
# Logs the screen state (on or off) to another var
SCREENSTATE=$(dumpsys input_method | grep mScreenOn | tr -dc '[:alnum:]\n\r' | tr '[:upper:]' '[:lower:]')
# Saves a string that tells what it should expect if the screen is on
SCREENSTATEON="msystemreadytruemscreenontrue"
if [ "$SCREENSTATE" == "$SCREENSTATEON" ]
then
echo "ON: $LOGVAR" >> /sdcard/$logfile
else
echo "OFF: $LOGVAR" >> /sdcard/$logfile
fi
cont=$((cont + 1))
contmin=0
done
echo "Show logged values? [Y/N]"
read -r SHOWLOG
case $SHOWLOG in
[yY] | [yY][Ee][Ss] )
cat /sdcard/$logfile
;;
[nN] | [n|N][O|o] )
echo "Ok, goodbye. You'll see a what you've asked me to log in /sdcard/$logfile";
exit 1
;;
*) echo "You must write Y or N to continue."
;;
esac
exit 0
For example, save it as script.sh (remember to save it using Unix codifcation, if you're running Windows, else, it'll tell you that it's unable to find many binaries, as long as Linux isn't ok with CR+LF and requires LF as newline). Then, send it to the sdcard (over USB or adb push script.sh /sdcard/) , now, run ADB shell. Type the following commands:
Code:
su -c "cp -f /sdcard/script.sh /data/local/;chmod 777 /data/local/script.sh"
Then, if you want to run it:
Code:
su
sh /data/local/script.sh
That's all, I hope you enjoy it and not so many people kills me for explaining and feeling so grateful for that simple script.
Hi!!!! I have Kodi installed on a Raspberry Pi3 Model B with Rasbian, every times I exit it just turn the screen black and doesn't pass from that and I have to reboot it.
I tried to run Kodi from the Command Line whit the next script:
kodi-standalone
It worked, it exit Kodi but when I tried a second time it stays black again and block and I have to reboot it.
It only works one time!!
The exit on Kodi only works one time if a run it with that script on the command line.
I worked it out!!!
I created a bash file in the terminal to run Kodi!!
This is my bash:
`#!/bin/bash
echo $$
sleep 10s
LOG_FILE=$HOME/.kodi/temp/kodi.log
rm $LOG_FILE 2> /dev/null
/usr/lib/kodi/kodi.bin --standalone &
sleep 5s
LOG_FILE=$HOME/.kodi/temp/kodi.log
while read line ; do
if [[ $line == "application stopped" ]] ; then
echo "Killing kodi"
break
fi
done < <(tail --pid=$$ -f -n0 $LOG_FILE)
Then I just run the script:
( ./kodi1.sh )
kodi1->the name i give to the bash file!
This run the kodi and then I can exit kodi without crashing!!