This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Google Play Store installed on Clean TinkerOS_Android 7 Nougat V14.3.2.82
#1
Information 
Getting Google Play Store installed on Clean TinkerOS_Android 7 Nougat V14.3.2.82

following http://tinkerboarding.co.uk/wiki/index.p...Play_Store

Google Play Store ON clean install [TinkerOS_Android 7 Nougat V14.3.2.82]

notes... H/W setup...
---------------------------------------------------------------
tinker Board connected to wire LAN @ 192.168.0.21
use clean SanDisk Ultra 64GB microSDXC Memory Card..
format on windows 10.. with SDfomatter.. selected Overwrite format.. from options..
make TinkerOS_Android 7 Nougat V14.3.2.82 image on SD with Etcher..
connect usb Logitech M570 Wireless Mouse Trackball..
connect usb Mini Wireless Keyboard with Touch Pad.. needed only for recovery.. Wipe Cache Partition.. 
connect HDMI to LG 27UD68P-B 4k monitor.. set to.. [1920 x 1080 @ 60hz]..
connect power NorthPada Power Supply AC Charger Adapter 5V 3A Micro USB 5 Feet with Power On / Off Switch..
-----------------------------------------------------------------------------------------------------------------------------------------------

power on & first boot...

notes... S/W setup...
---------------------------------------------------------
set auto rotate to landscape in quick settings..
set [Sleep].. to 5 minutes.. [Screen saver].. ON.. set to Clock and set when to start.. Either..
set [Wallpaper]..click on the picture and then [Set wallpaper].. [Home screen and lock screen]..
make sure [HDMI].. is on.. [HDMI Resolution].. set to 1920x1080p60.00.. [HDMI Rotation].. 0..

set [Languages & input]... I'm in UK.. add UK keyboard and set to top 
Note... don't remove US Keyboard until after first restart...

set [Date & time]... [Automatic date & time].. GMT+1 British Summer Time.. 

set [Ethernet].. setup wired LAN now & connect to network.. this should update time and date.. 
[Settings].. in Wireless & network section click on [More].. [Ethnet].. [Ethnet Ip mode].. [Static]...
then enter details..  IP 192.168.0.21 / GW 192.168.0.1 / NetMask 255.255.255.0 / DNS1 8.8.8.8 DNS2 8.8.4.4

set Home screen App icons.. as you like..

Restart tinker board... see if all your settings hold on reboot.. 
remove US Keyboard from [Languages & input]..

set [Sound].. set sound volumes.. and make sure [Audio Output].. is set to [HDMI]..
connected StarTech.com Headset adapter & mic...
--------------------------------------------------------------

[Security].. pattern/pin/password.. NOT working.. #############
ie.. setting up a pin.. will cause [Security].. menu not to open..
so.. enable [Unknown sources].. just in case [Security].. setting page fails to open...
####################################################
if [Security Menu].. fails to open.. click here.. to see how to reset [Screen lock].. 
to swipe.. and disable PIN / Password.. ;-]..

connect laptop with Android Debug Bridge (adb) installed to tinker Board and check settings..
Code:
adb connect 192.168.0.21
adb root
adb connect 192.168.0.21
adb remount
adb shell settings list global
notes.. you can check your settings....
>adb shell settings list global >adb shell settings list system >adb shell settings list secure

===============================================
now ready to use "adb push" to copy the PlayStore, Google Play Services and 
Google Services Framework apks to /system/priv-app
================================

files to download:
----------------------

[Google Services Framework 7.1.2 (Android 7.1+): 
com.google.android.gsf_7.1.2-25_minAPI25(nodpi)_apkmirror.com.apk]
download here..
rename to : Gsf.apk
===================

[Google Play services 19.0.56 (040400-262933554) (040400):  
com.google.android.gms_19.0.56_(040400-262933554)-19056019_minAPI23(arm64-v8a,armeabi-v7a)(nodpi)_apkmirror.com.apk]
download here..
rename to : Playservices.apk
============================

[Google Play Store 16.4.25-all [0] [PR] 266806056 (nodpi) (Android 4.1+): 
com.android.vending_16.4.25-all_0_PR_266806056-81642500_minAPI16(armeabi,armeabi-v7a,mips,mips64,x86,x86_64)(nodpi)_apkmirror.com.apk]
download here..
rename to : Playstore.apk
=========================

[Google Contacts Sync 7.1.2 (Android 6.0+)
com.google.android.syncadapters.contacts_7.1.2-25_minAPI23(nodpi)_apkmirror.com.apk]
download here..
rename to : ContactsSync.apk
============================

connect, push & install APKs..
Code:
adb connect 192.168.0.21
adb root
adb connect 192.168.0.21
adb remount
adb push Gsf.apk /system/priv-app/Gsf/Gsf.apk
adb install -g -r Gsf.apk
adb push Playstore.apk /system/priv-app/Playstore/Playstore.apk
adb install -g -r Playstore.apk
adb push ContactsSync.apk /system/priv-app/ContactsSync/ContactsSync.apk
adb install -g -r ContactsSync.apk
adb push Playservices.apk /system/priv-app/Playservices/Playservices.apk
adb install -g -r Playservices.apk
-g: Grant all permissions listed in the app manifest....
-r:  Replace existing application, keeping its data.
------------------------------------------------------------
Note.. you might get a popup that you have to click on to allow and accept..
If you get any errors.. just keep pressing ok and looking out for the accept prompts ;-]..

clear cache.. [Settings].. [Storage].. click on [Cached data] to clear cached data..
go to [Settings].. [Apps].. click on each of the apps and check the Permissions are ALL [ON]..
be sure to also check the two [Additional permissions] in [Google Services Framework]...
also make sure [Draw over other apps] & [Modify system settings] is set to [Yes] if available.. 

restart tinker board in recovery to  Wipe Cache Partition...
Code:
adb connect 192.168.0.21
adb reboot recovery
Note.. use keyboard arrow keys to selected [Wipe cache partition]... [Yes]...
then... select [reboot system]... ;-]...
################################

Note.. wait a bit to check to see if you are still getting the play service errors...
if not.. then its time to open the [Play Store]...;-]... and enter your Google Account details.. and accept terms ;-]...
===============================================================================
Note.. [Play Store].. should be running.. go to [Setting].. of [Play store].. 
click on [Play Store version]... it should say..
Google Play Store is up to date.. ;-]...
========================================
restart tinker board..

Note.. wait a bit to check to see if there is any play service errors...
if not.. open the [Play Store]... search Google Play.. for Gmail and see if it will Install..
;-]..----------------------------------------------------------------------------------------
open [Gmail] from applications.. and check its working...
open  the [Play Store].. check [My apps & games].. [INSTALLED].. to see its listed.. ]]]]].......
and then check [LIBRARY].. all your previously installed apps.. ;-].. 
################################################################################
Google Play Store Now installed and working with no errors ;-]..
------------------------------------------------------------------------------
hope it helps
k,

TinkerOS_Android 7 Nougat V14.3.2.82 with Google Play Store

next>.. Termux with auto-starting SSH server & Root shell... see post[2]
Reply
#2
Termux with auto-starting SSH server & Root shell


So.. Why Termux?
well..  AOSP (Android Open Source Project) / TinkerOS_Android 7 Nougat V14.3.2.82..
doesn't come with a terminal App.. but.. this userdebug build configuration is primarily used for developing Android
and comes with su binary and adb enabled by default.. The su binary in this build is only accessible by certain uid..
root & shell, I believe.. adb can be used to connect to mksh [MirBSD Korn Shell LINUX interactive user interface]
via USB / Serial or Network tcp/ip [LAN/Wifi]..

What is Termux?
Termux is an Android terminal emulator and Linux environment app that works directly with no rooting or setup required.
A minimal base system is installed automatically - additional packages are available using the APT package manager.
here are some links that might help...
----------------------------------------------
Termux turns Android into a Linux development environment
Basic Commands Using Termux
Guide: Installing and Running a GNU/Linux Environment on Any Android Device
How to install DAT on mobile under Termux
Unveil full workstation environment on Android with Termux
Termux PHP Tutorial: Steps to Have the Full Setup for Using Termux PHP
How does Termux work on Android?
Mobile Ops and Tablet Terraform with Termux
PRoot / Emulate chroot, bind mount and binfmt_misc for non-root users
----------------------------------------------------------------------------------------

Termux Setup on tinker board with root shell
--------------------------------------------------------------
after you install the App form Play Store.. or download APK and install using file manger..
you need to find and download a su binary that has features like [su --auto-daemon]..

the default su installed..
Code:
rk3288:/ # su --help
usage: su [UID[,GID[,GID2]...]] [COMMAND [ARG...]]

Switch to WHO (default 'root') and run the given command (default sh).

where WHO is a comma-separated list of user, group,
and supplementary groups in that order.
rk3288:/ #

a more feature rich su binary - SuperSU-v2.82-SR5
Code:
rk3288:/ # su --help
SuperSU v2.82 (ndk:armeabi-v7a) - Copyright (C) 2012-2017 - Chainfire & CCMT

Usage: su [options] [--] [-] [LOGIN] [--] [args...]

Options:
 -c, --command COMMAND        pass COMMAND to the invoked shell
 -cn, --context CONTEXT       switch to SELinux CONTEXT before invoking
 -h, --help                   display this help message and exit
 -, -l, --login               pretend the shell to be a login shell
 -m, -p,
 -mm, --mount-master          connect to a shell that can manipulate the
                              master mount namespace - requires su to be
                              running as daemon, must be first parameter
 -mns, --mount-namespace PID  enter mount namespace used by PID
 --preserve-environment       do not change environment variables
 -s, --shell SHELL            use SHELL instead of the default detected shell
 -v, --version                display public version and exit
 -V                           display internal version and exit

Usage#2: su LOGIN COMMAND...

Usage#3: su {-d|--daemon|-ad|--auto-daemon|-r|--reload}
 auto version starts daemon only on SDK >= 18 or
 if SELinux is set to enforcing
 (call only from a root session)

Usage#4: su {-i|--install|-u|--uninstall}
 perform post-install / pre-uninstall maintenance
 (call only from a root session)

Usage#5: su --id pid
 identify eldest parent of pid
 (call only from a root session)
rk3288:/ #

download SR5-SuperSU-v2.82-SR5-20171001224502.zip
rename to : SuperSU.zip
=========================
extract to Folder : SuperSU
----------------------------------
go to folder and list to check..
Code:
$ ls -Flah
total 44K
drwxrwxr-x 11 k247 k247 4.0K Oct  4 09:20 ./
drwxrwxr-x  5 k247 k247 4.0K Oct  4 10:48 ../
drwx------  2 k247 k247 4.0K Oct  4 09:20 arm/
drwx------  3 k247 k247 4.0K Oct  4 09:20 arm64/
drwx------  2 k247 k247 4.0K Oct  4 09:20 armv7/
drwx------  3 k247 k247 4.0K Oct  4 09:20 common/
drwx------  3 k247 k247 4.0K Oct  4 09:20 META-INF/
drwx------  2 k247 k247 4.0K Oct  4 09:20 mips/
drwx------  2 k247 k247 4.0K Oct  4 09:20 mips64/
drwx------  2 k247 k247 4.0K Oct  4 09:20 x64/
drwx------  2 k247 k247 4.0K Oct  4 09:20 x86/
$

connect & only push the su file from armv7 folder.. to /system/xbin on tinker board..
Code:
adb connect 192.168.0.x
adb root
adb connect 192.168.0.x
adb remount
adb push armv7/su /system/xbin/su_SuperSU

then.. drop in shell & make backup copy of original su file..
Code:
adb shell
cd system/xbin/
cp -p su su_org          ### make copy of original su...
chcon u:object_r:su_exec:s0 su_org
ls -FlahZ su*
-----------------------------------------------------------------------------------------------------------
-rwsr-x--- 1 root shell u:object_r:su_exec:s0     18K 2018-08-17 03:57 su*
-rwxr-xr-x 1 root shell u:object_r:system_file:s0 74K 2008-02-29 02:33 su_SuperSU*
-rwsr-x--- 1 root shell u:object_r:su_exec:s0     18K 2018-10-05 19:16 su_org*
rk3288:/system/xbin # exit

copy su_SuperSU to su..
Code:
adb connect 192.168.0.x
adb root
adb connect 192.168.0.x
adb remount
adb shell
cd system/xbin/
cp -p su_SuperSU su       ### copy su_SuperSU over su
ls -FlahZ su*
------------------------------------------------------------------------------------------------------------
-rwxr-xr-x 1 root shell u:object_r:system_file:s0 74K 2018-10-05 20:42 su*
-rwxr-xr-x 1 root shell u:object_r:system_file:s0 74K 2008-02-29 02:33 su_SuperSU*
-rwsr-x--- 1 root shell u:object_r:su_exec:s0     18K 2018-10-05 19:16 su_org*
-------------------------------------------------------------------------------------------------------------
chcon u:object_r:su_exec:s0 su
chmod 4750 su
ls -FlahZ su*
------------------------------------------------------------------------------------------------------------
-rwsr-x--- 1 root shell u:object_r:su_exec:s0     74K 2018-10-10 21:25 su*
-rwxr-xr-x 1 root shell u:object_r:system_file:s0 74K 2008-02-29 02:33 su_SuperSU*
-rwsr-x--- 1 root shell u:object_r:su_exec:s0     18K 2018-10-10 21:24 su_org*
-------------------------------------------------------------------------------------------------------------
rk3288:/system/xbin # exit

now.. we need to have su daemon process launch when Android boots up..
sooo... after some google searches for.. "run script on boot android" 
Ramast had the answer..;-]..
----------------------------------------------------------------
basically, find the file /system/etc/install-recovery.sh 
and add the following line at the beginning /data/init.sh &

then

touch /data/init.sh
chmod 755 /data/init.sh
Done! You can now put whatever you want in /data/init.sh and it will run on startup.
--------------------------------------------------------------------------------------------------------
some tweaking.. ].. find [install-recovery.sh] file with..
Code:
find /. -name 'install-recovery.sh' 2>/dev/null
/./system/bin/install-recovery.sh
then.. add  "/data/init.sh &" at the end of the [install-recovery.sh] file..

note.. as default TinkerOS_Android 7 Nougat V14.3.2.82 install.. does not have nano, (text editor)..
and I don't know how to use touch with sed.. (text streamer).. / or echo with pipe redirection >>]]]... 
I used... 
Code:
adb pull /system/bin/install-recovery.sh .
to get the [install-recovery.sh] file 

and modify it on my system first, 
Code:
#!/system/bin/sh
if ! applypatch -c MTD:recovery:14909440:43e6f7935f5d0c8d4bc4e5e93242e01017208048; then
 applypatch -b /system/etc/recovery-resource.dat MTD:boot:10174464:83dd042d61b89b6907f01ad646b172d7936cf534 MTD:recovery 43e6f7935f5d0c8d4bc4e5e93242e01017208048 14909440 83dd042d61b89b6907f01ad646b172d7936cf534:/system/recovery-from-boot.p && log -t recovery "Installing new recovery image: succeeded" || log -t recovery "Installing new recovery image: failed"
else
 log -t recovery "Recovery image already installed"
fi
#===============
# adb connect IP
# adb root
# adb connect IP
# adb remount
# adb shell
# cat /proc/mounts | grep -E "root|system"
#--------------------------------------------------------------
# note.. once in root Android shell.. to make / (read,write)...
# mount -o rw,remount /
#----------------------------------------------------------------------------
# note.. now you can edit this file from adb root shell once path is added...
# use alias > expath
#      then > nano /system/bin/install-recovery.sh
#=================================================
# following init.sh should run at boot..
/data/init.sh &

& then push back the file to tinker board.. 
Code:
adb connect 192.168.0.x
adb root
adb connect 192.168.0.x
adb remount
adb push install-recovery.sh /system/bin/install-recovery.sh
adb shell chown root:shell /system/bin/install-recovery.sh
adb shell chmod 755 /system/bin/install-recovery.sh

check /system/bin folder..
Code:
adb shell ls -Flah /system/bin/

now.. create [init.sh] file on my system with >nano init.sh
Code:
#!/system/bin/sh
# start SuperUser deamon...
/system/xbin/su -ad &
#
# start termux SSH Server [sshd in ¬/.bashrc file]...
#/system/xbin/su shell -c "am start -n com.termux/com.termux.app.TermuxActivity" &
#/system/xbin/su shell -c "am start --user 0 -n com.termux/com.termux.app.TermuxActivity" &
# this did not work... for now use Auto-Start no root..tbc..

& push [init.sh] file to tinker board /data/init.sh..
Code:
adb connect 192.168.0.x
adb root
adb connect 192.168.0.x
adb remount
adb push init.sh /data/init.sh
adb shell chown root:shell /data/init.sh 
adb shell chmod 755 /data/init.sh

check /data folder..
Code:
adb shell ls -Flah /data/

now we have su daemon process launch when Android boots up so that..
termux root-repo / tsu & tsudo.. that require su -daemon running to function..
can give user root for whatever termux shell is installed. sh, bash, zsh... 

first.. open termux App, update & install Linux apps..
Code:
pkg upgrade
pkg install root-repo
pkg install x11-repo
pkg install openssh mosh
pkg install nano micro htop mc tmux screen tsu coreutils ncurses-utils util-linux net-tools grep pcre tree rsync mlocate man
pkg install termux-api php termux-exec termux-tools proot
pkg install git wget curl clang python python2 ecj dx 
pkg install aapt ltrace cmatrix
termux-setup-storage
mkdir /sdcard/php

remember to also make  Symbolic Link for sudo to tsudo.. 
Code:
ln -s /data/data/com.termux/files/usr/bin/tsudo /data/data/com.termux/files/usr/bin/sudo
need to look into.. termux-sudo.. tbc..

a quick test of termux:API...
Code:
termux-toast hi..... there...... \:-]....

note... sshd is setup for password-less login.. on port 8022 
--------------------------------------------------------------------------------
so you will need to copy id_rsa.pub of connecting system..
to.. ~/.ssh/authorized_keys... on tinker board..

Example.. allow my system @ 192.168.0.55 to connect to tinker board..
Code:
ssh k247@192.168.0.55 'cat ~/.ssh/id_rsa.pub' | cat >> ~/.ssh/authorized_keys
----- enter pass -----
https://wiki.termux.com/wiki/Remote_Access

Note.. need to find a way to auto run Termux @ boot, for now add sshd to .bashrc file..
open AutoStart - No root and add termux App twice..  
I had to add it twice for termux to start with session 1..
also.. it can take ups 2-4 mins before you see session 1.. ;-[...  
[Image: daJvojx.png]

next.. how to setup Bash environment variables..
open Termux.. and create > nano .bashrc
Code:
#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

# If not running interactively, don't do anything
#case $- in
#    *i*) ;;
#      *) return;;
#esac
#

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar


# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
   xterm-color|*-256color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
   if [ -x /data/data/com.termux/files/usr/bin/tput ] && tput setaf 1 >&/dev/null; then
       # We have color support; assume it's compliant with Ecma-48
       # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
       # a case would tend to support setf rather than setaf.)
       color_prompt=yes
   else
       color_prompt=
   fi
fi

#set prompt......................
#export PS1="\s\v\u\W\\$ "
#export PS1="\s:\v][\u]@\W:\\$ "
#export PS1="\s:\v][\u]@\w:\\$ "
#Bash:Virgin][User]@Home : ;-].... http://ezprompt.net
# If id command returns zero, you have root access..
if [ $(id -u) -eq 0 ];
then # you are root, set red colour prompt & set Home root Dir..
  #PS1="\\[$(tput setaf 1)\\]\\u@\\h:\\w #\\[$(tput sgr0)\\]"
  #PS1="\[\e[31m\]\s\[\e[m\]:\[\e[31m\]\v\[\e[m\]][\[\e[31m\]\u\[\e[m\]]@\w:\[\e[37m\] \[\e[m\] "
  #PS1="\[\e[31m\]\s\[\e[m\]:\[\e[31m\]\v\[\e[m\]][\[\e[31m\]\u\[\e[m\]]@\w:\[\e[37m\] \[\e[m\]\[\e[31m\]#\[\e[m\] "
  PS1="\[\e[31m\]\s\[\e[m\]:\[\e[31m\]\v\[\e[m\]][\[\e[31m\]\u\[\e[m\]]@\w:\[\e[31m\]#\[\e[m\] "
  export HOME=/data/data/com.termux/files/root
else # normal
  #PS1="[\\u@\\h:\\w] $ "
  PS1="\s:\v][\u]@\w:\\$ "
fi

# enable color support of ls and also add handy aliases
if [ -x /data/data/com.termux/files/usr/bin/dircolors ]; then
   test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
   alias ls='ls --color=auto'
   #alias dir='dir --color=auto'
   #alias vdir='vdir --color=auto'
   alias grep='grep --color=auto'
   alias fgrep='fgrep --color=auto'
   alias egrep='egrep --color=auto'
fi

# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

# some more ls aliases
#alias ll='ls -alF'
#alias ls='ls --color=auto'
alias ll='ls -Flah'
alias la='ls -ACF'
alias l='ls -CF'

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

#export LANG=en_GB.UTF-8
#export LANGUAGE=en_GB:en
# these android setting environment variable don't seem to be working.. 

#
# add kPATH/bin to $PATH... only once...
if [ "$SHLVL" = 1 ] && [ $(id -u) -ne 0 ]; then     # check for 1st shell and not root....
  [[ ":$PATH:" != *":/data/data/com.termux/files/home/kPATH/bin:"* ]] && PATH="/data/data/com.termux/files/home/kPATH/bin:${PATH}"
  #export PATH=$PATH:/data/data/com.termux/files/home/kPATH/bin
  export PATH=$PATH
fi
#

#
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
   . ~/.bash_aliases
fi
#

# start ssh server...
/data/data/com.termux/files/usr/bin/sshd
#---------------------------------------
#if ! pgrep -f "termux-chroot" >/dev/null ; then echo "[Starting chroot...]" && termux-chroot; else echo "[chroot is running]"; fi
#if ! pgrep "sshd" >/dev/null ; then echo "[Starting sshd...]" && sshd && echo "[OK]"; else echo "[ssh is running]"; fi
#----------------------------------------------------------------------------------------------------------------------
# this does not work well.. even though you can clear recent apps and close termux.. ssh connection keep running in chroot but
# gets closed after 5-10mins.. remember to keep termux running and only clear reacent apps.. also.. tsu runs bash twice??
# it can get pretty funky... needs lots more work.. tbc..

# Customizing colors - directory that is world writable
export LS_COLORS=$LS_COLORS:'ow=30;42'

>nano .bash_logout
Code:
# ~/.bash_logout: executed by bash(1) when login shell exits.

# when leaving the console clear the screen to increase privacy

if [ "$SHLVL" = 1 ]; then
  [ -x /data/data/com.termux/files/usr/bin/clear ] && /data/data/com.termux/files/usr/bin/clear
fi

...& > nano .bash_aliases
Code:
### aliases file....
#
#
### DIRS ###
#alias d="cd ~/storage/downloads"
#alias gh="cd ~/GitHub"
#alias h="cd ~"
#alias t="cd ~/temp"
alias ..='cd ..'
alias lla='ls -AFlh'
alias lld='ls -lah -d */'
#
alias cls='clear'
#

now its time to exit termux App & restart tinker board... ;-]...

open termux App.. & list home folder with alias >ll..
Code:
bash:5.0][u0_a60]@~:$

Welcome to Termux!

Wiki:            https://wiki.termux.com
Community forum: https://termux.com/community
Gitter chat:     https://gitter.im/termux/termux
IRC channel:     #termux on freenode

Working with packages:

* Search packages:   pkg search <query>
* Install a package: pkg install <package>
* Upgrade packages:  pkg upgrade

Subscribing to additional repositories:

* Root:     pkg install root-repo
* Unstable: pkg install unstable-repo
* X11:      pkg install x11-repo

Report issues at https://termux.com/issues

bash:5.0][u0_a60]@~:$ ll
total 69K
drwx------ 12 u0_a60 u0_a60 3.5K Sep 16 20:09 ./
drwx------ 18 u0_a60 u0_a60 3.5K Sep 14 02:03 ../
-rw-------  1 u0_a60 u0_a60  199 Sep 16 03:21 .bash_aliases
-rw-------  1 u0_a60 u0_a60  15K Sep 16 20:09 .bash_history
-rw-------  1 root   root   1.2K Sep 16 14:15 .bash_history_root
-rw-------  1 u0_a60 u0_a60  254 Sep  2 07:11 .bash_logout
-rw-------  1 u0_a60 u0_a60 4.8K Sep 16 05:32 .bashrc
drwx------  3 u0_a60 u0_a60 3.5K Sep  2 07:30 .cache/
drwx------  5 u0_a60 u0_a60 3.5K Sep  2 07:30 .config/
drwx------  3 u0_a60 u0_a60 3.5K Sep  2 07:30 .local/
drwx------  2 u0_a60 u0_a60 3.5K Sep  2 06:46 .ssh/
drwx------  2 u0_a60 u0_a60 3.5K Sep  2 07:44 .termux/
drwx------  3 u0_a60 u0_a60 3.5K Sep  2 21:52 code/
drwx------  3 u0_a60 u0_a60 3.5K Sep  2 07:29 kPATH/
drwx------  2 u0_a60 u0_a60 3.5K Sep  2 07:29 notes/
drwx------  2 u0_a60 u0_a60 3.5K Sep  2 07:04 storage/
drwx------  2 u0_a60 u0_a60 3.5K Sep 16 18:58 temp/
bash:5.0][u0_a60]@~:$
..also use [mkdir -p] to create folders.. kPATH/bin   notes   temp

note... if you ever find folders or files not owned by termux user u0_a60....
then you can fix by.. 
Code:
cd "folderName"

chown -R u0_a60:u0_a60 .

cd ..

chown u0_a60:u0_a60 "folderName"

note..  
..as /root home folder is mounted read only..
Code:
rk3288:/ # cat /proc/mounts | grep root
-------------------------------------------------------------------------------
rootfs / rootfs ro,seclabel,size=1013416k,nr_inodes=119724 0 0
adb connect into shell with remount...

..create root home folder under /data/data/com.termux/files/
Code:
cd /data/data/com.termux/files/
mkdir -p root
chown u0_a60:u0_a60 root
chmod 777 -R root/

when using adb shell.. to drop in Android root shell.. remember to adb remount...
Code:
adb connect 192.168.0.x
adb connect root
adb connect 192.168.0.x
adb remount
adb shell
Note... this will give you (read,write) for /system but not /......

..once in root Android shell.. to make / (read,write)...
Code:
rk3288:/ # cat /proc/mounts | grep root
rootfs / rootfs ro,seclabel,size=1013416k,nr_inodes=119724 0 0
rk3288:/ #
rk3288:/ # mount -o rw,remount /
rk3288:/ #
rk3288:/ # cat /proc/mounts | grep root
rootfs / rootfs rw,seclabel,size=1013416k,nr_inodes=119724 0 0
rk3288:/ #

to open Android root sh (Bourne shell) with LD_LIBRARY_PATH set. so to run linux apps..
adb connect into shell and run alias sush..

..now open Android root bash shell with LD_LIBRARY_PATH set... with alias subash..
..use cd to change to root home folder... ;-]...
Code:
rk3288:/ # subash
bash:5.0][root]@/:# cd
bash:5.0][root]@~:# pwd
/data/data/com.termux/files/root
bash:5.0][root]@~:# ll
total 27K
drwxrwxrwx  7 u0_a60 u0_a60 3.4K 2019-09-16 00:58 ./
drwx------ 18 u0_a60 u0_a60 3.4K 2019-09-14 02:03 ../
-rw-------  1 root   root    199 2019-09-16 03:42 .bash_aliases
-rw-------  1 root   root   1.2K 2019-09-16 06:08 .bash_history
-rw-------  1 root   root      5 2019-09-16 00:23 .bash_history_root
drwx------  3 root   root   3.4K 2019-09-02 09:41 .cache/
drwx------  5 root   root   3.4K 2019-09-02 12:03 .config/
drwx------  3 root   root   3.4K 2019-09-02 09:41 .local/
drwxrwxrwx  3 root   root   3.4K 2019-09-02 22:12 code/
drwxrwxrwx  2 root   root   3.4K 2019-09-02 22:16 temp/
bash:5.0][root]@~:#
note.. never install or update with pkg from adb connect shell ;-].....

Note.. add aliases for adb root shell in /system/etc/mkshrc...
Code:
# Copyright (c) 2010, 2012, 2013, 2014
# Thorsten Glaser <tg@mirbsd.org>
# This file is provided under the same terms as mksh.
#-
# Minimal /system/etc/mkshrc for Android
#
# Support: https://launchpad.net/mksh

: ${HOSTNAME:=$(getprop ro.product.device)}
: ${HOSTNAME:=android}
: ${TMPDIR:=/data/local/tmp}
export HOSTNAME TMPDIR

if (( USER_ID )); then PS1='$'; else PS1='#'; fi
PS4='[$EPOCHREALTIME] '; PS1='${|
local e=$?

(( e )) && REPLY+="$e|"

return $e
}$HOSTNAME:${PWD:-?} '"$PS1 "

alias ll='ls -Flah'
alias lla='ls -AFlh'
alias lld='ls -lah -d */'
alias l='ls -CF'
alias la='ls -ACF'
alias cls='clear'
alias ..='cd ..'
#
# set termux env vars...
export LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib
#export LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
export PREFIX=/data/data/com.termux/files/usr
#HOME=/data/data/com.termux/files/home
#
alias sush='su --preserve-environment -c LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so PREFIX=/data/data/com.termux/files/usr PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin:/data/data/com.termux/files/home/kPATH/bin:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets HOME=/data/data/com.termux/files/root /system/bin/sh -l'
#
alias subash='su --preserve-environment -c LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so PREFIX=/data/data/com.termux/files/usr PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin:/data/data/com.termux/files/home/kPATH/bin:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets HOME=/data/data/com.termux/files/root PS1="\[\e[31m\]\s\[\e[m\]:\[\e[31m\]\v\[\e[m\]][\[\e[31m\]\u\[\e[m\]]@\w:\[\e[31m\]#\[\e[m\]" SHELL=/data/data/com.termux/files/usr/bin/bash /data/data/com.termux/files/usr/bin/bash -l'
#
alias expath='export PATH=$PATH:/data/data/com.termux/files/home/kPATH/bin:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets'
#setPATH for termux files.... does not work.. better use alias expath in mksh when connecting to adb Andriod shell...
#export PATH=$PATH:/data/data/com.termux/files/home/kPATH/bin:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets
# add termux dirs to $PATH... only once... not done yet..
#

...show termux Bash environment variables with > id & env
Code:
bash:5.0][u0_a60]@~:$ id
uid=10060(u0_a60) gid=10060(u0_a60) groups=10060(u0_a60),3003(inet),9997(everybody),50060(all_a60)
bash:5.0][u0_a60]@~:$ env
SHELL=/data/data/com.termux/files/usr/bin/bash
PREFIX=/data/data/com.termux/files/usr
PWD=/data/data/com.termux/files/home
LOGNAME=u0_a60
EXTERNAL_STORAGE=/sdcard
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
HOME=/data/data/com.termux/files/home
LANG=en_US.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36::ow=30;42
TMPDIR=/data/data/com.termux/files/usr/tmp
SSH_CONNECTION=192.168.0.55 58326 192.168.0.21 8022
ANDROID_DATA=/data
TERM=xterm-256color
USER=u0_a60
SHLVL=1
ANDROID_ROOT=/system
SSH_CLIENT=192.168.0.55 58326 8022
PATH=/data/data/com.termux/files/home/kPATH/bin:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets
SSH_TTY=/dev/pts/1
_=/data/data/com.termux/files/usr/bin/env
bash:5.0][u0_a60]@~:$ 
bash:5.0][u0_a60]@~:$ tsu
bash:5.0][root]@/data/data/com.termux/files/home:# cd
bash:5.0][root]@~:# pwd
/data/data/com.termux/files/root
bash:5.0][root]@~:# id
uid=0(root) gid=0(root) groups=0(root)
bash:5.0][root]@~:# 
bash:5.0][root]@~:# exit
exit
bash:5.0][u0_a60]@~:$ id
uid=10060(u0_a60) gid=10060(u0_a60) groups=10060(u0_a60),3003(inet),9997(everybody),50060(all_a60)
bash:5.0][u0_a60]@~:$

TinkerOS_Android 7 Nougat V14.3.2.82 with Termux auto-starting SSH server & Root shell
------------------
hope it helps
k,

next> termux Development Environments / GPIO, & Tinker Board Device Tree..??? tbc..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)