Entware is repository full of apps for embeded linux like android on tv box. I have prepared installation script to install it from scratch because android is different. You have to rebuild folders in root on every reboot. Root partition is rebuilt on every boot from the image. I will use /data partition to store files (path /data/opt) and mount –bind on /opt.

Check your architecture of processor and os. My TV Box has Amlogic S912 armv8 – aarch64. Just run two commands:

uname -a
cat /proc/cpuinfo

Processor : AArch64 Processor rev 4 (aarch64)
processor : 0
processor : 1
processor : 2
processor : 3
processor : 4
processor : 5
processor : 6
processor : 7
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 wp half thumb fastmult vfp edsp neon vfpv3 tlsi vfpv4 idiva idivt
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
Hardware : Amlogic

Script will download binaries for aarch64. For another you have to change URL= and DLOADER and busybox binary.

Source of the install script and repository:

First you have to root your device!

On windows you will need Minimal ADB:
On linux just install android-tools-adb android-tools-fastboot.

  1. Install WiFi ADB:
  2. Run WiFi ADB and connect to via adb:
    adb connect ip:5555

    Accept and remember connection on TV Box

  3. Download script (source code is on the bottom):
  4. Download busybox for armv8 because my wget on TV Box was broken (it can’t finish any download):
  5. Push the script from disk to TV Box:
    adb push C:\Users\user\Desktop\ /storage/emulated/0/

    If there is permission denied use another directory.

  6. Push busybox binary:
    adb push C:\Users\user\Desktop\busybox-armv8l /storage/emulated/0/

    If there is permission denied use another directory.

  7. Run ADB shell an run all below as root with su:
    adb shell
  8. Move script from emulated internal memory to another without noexec flag:
    mv /storage/emulated/0/ /data/local
    chmod +x /data/local/

    If there will be error Read only file system, just remount it to write and run again above commands:

    mount -o rw,remount /
    mount -o rw,remount /system
  9. Run the script:
    /system/bin/sh /data/local/

    If there is a /bin you will be asked for delete. Do not delete it if it is not empty, just remove that part from script. It will delete /opt as well. Then will create neccesary folders and instsall opkg, basic enteware and dropbear for SSH.

  10. Script will create autorun script in /system/etc/init.d/ It has to be run every boot to make entware and entware services to work. If your Android rom support init.d you dont’t have to do nothing.
  11. Another Auto Start options:
    • Try to enable init.d support with Uni-Init apk or sh script: It does not work for me.
    • Try to modify init rc scripts. (it does not work for me i’ve still got init: Service exec () does not have a SELinux domain defined.)
      1. Try to rebuild image to modify /init.rc
      2. Modify init scripts from /system/rtc/init/
    • Check for any autorun static script:

      $ find /etc -type f -perm +110
      $ find /etc -name "*rc"
      $ find /etc -name "init*"
      $ grep -R /data /etc
      $ grep -R /system /etc

      I have checked either:

      dmesg | grep .sh

      I’ve got few candidates:

      init: cannot find /system/bin/’ (No such file or directory), disabling ‘kodiconf’
      init: cannot find ‘/system/bin/’ (No such file or directory), disabling ‘dtvdatas’
      init: cannot find ‘/system/bin/’ (No such file or directory), disabling ‘factoryreset’

      You can try run init.d
      First use app Uni-init to create all files ant contexts: and hen link your built-in in rom script to sysinit created by this app:

      ln -s /system/etc/init.d/sysinit /system/bin/

      now you have properly working init.d.

      There is exmaple of script to run all init.d if your need yor own:

      touch $AUTO_START
      echo -e "#!/system/bin/sh" > $AUTO_START 
      echo -e "\n" >> $AUTO_START 
      echo -e "sleep 1" >> $AUTO_START 
      echo -e "export PATH=/sbin:/system/sbin:/system/bin:/system/xbin" >> $AUTO_START 
      echo -e "/system/bin/busybox run-parts /system/etc/init.d" >> $AUTO_START 
      echo -e "\n" >> $AUTO_START
      chmod 0755 $AUTO_START

      If SELINUX blocked you…

    • Just install app SManager: or and add /system/etc/init.d/ to autostart with su privileges. (to do that click still upper directory even there is access denied)
  12. Modify /system/etc/mkshrc and add
    export PATH=$PATH
  13. Install pyload:
    opkg install ca-bundle ca-certificates
    opkg install pyload
    opkg install python-pyopenssl openssl-util
    opkg install duktape
    opkg install pillow tesseract
    opkg install python-crypto
    opkg install unrar unzip
    opkg install p7zip
    pyload --configdir=/opt/var/pyload

#set paths
SYS_DIRS="/etc /lib /bin /tmp /lib/opkg /var/lock"
echo "Mount to write"
mount -o rw,remount /
mount -o rw,remount /system
echo "Set DNS for future wget"
echo -e "nameserver\nnameserver" > /etc/resolv.conf
echo "Installing busybox for fix wget"
if [ -f "$BBOX_BIN" ]
	cp -rf $BBOX_BIN /system/xbin/busybox
	chmod 0755 /system/xbin/busybox
	#for i in $(/system/xbin/busybox ); do
	#	echo "$i"
	/system/xbin/busybox --install -s /system/xbin
	echo "Can't find $BBOX_BIN . Download it and push with adb push busybox-armv8l /storage/emulated/0/"
	echo "Sorry you have to do that manually"
	exit 1
echo -e "Before installation we have to delete all directories in: $OPT_DIR. Just CTR+C if you are not sure or run manually\nrm -rf $OPT_DIR\nrm -rf $MAIN_DIR"
umount $MAIN_DIR
rm -ri $OPT_DIR
rm -ri $MAIN_DIR
if [ -d "$MAIN_DIR" ]
	echo "Warning: Folder $MAIN_DIR exists! Remove an re run script"
	exit 1
	echo "Make $MAIN_DIR and mount --bind $OPT_DIR $MAIN_DIR"
	mkdir -p $OPT_DIR
	mkdir -p $MAIN_DIR
	mount --bind $OPT_DIR $MAIN_DIR
	#ln -s $OPT_DIR $MAIN_DIR
if [ -d "/bin" ]
	echo "Warning: Folder /bin exists! Deleting it may break you device if you are not sure just CTRL+C"
	echo "Removing /bin - if you know what are you doing just run rm -rf /bin"
	umount /bin
	rm -ri /bin
	echo "Make /bin and mount --bind $OPT_DIR/bin /bin"
	mkdir -p $OPT_DIR/bin
	mkdir -p /bin
	mount --bind $OPT_DIR/bin /bin
	#ln -s $OPT_DIR/bin /bin
	echo "Link shell /bin/sh"
	ln -s /system/bin/sh /bin/sh
echo "Checking folders..."
for folder in $SYS_DIRS
  if [ -d "$OPT_DIR$folder" ]
    echo "Warning: Folder $OPT_DIR$folder exists!"
    mkdir -p $OPT_DIR$folder
echo "Exporting path"
export PATH=/bin:$PATH:/$OPT_DIR/bin:$OPT_DIR/sbin
# Fix for multiuser environment
chmod 777 $MAIN_DIR/tmp
echo "Info: Opkg package manager deployment..."
wget $URL/opkg -O /opt/bin/opkg
chmod 755 /opt/bin/opkg
wget $URL/opkg.conf -O /opt/etc/opkg.conf
wget $URL/ -O /opt/lib/
wget $URL/ -O /opt/lib/
wget $URL/ -O /opt/lib/
wget $URL/ -O /opt/lib/
cd /opt/lib
chmod 755
ln -s $DLOADER
ln -s
ln -s
echo "Info: Basic packages installation..."
/opt/bin/opkg update --force-space
/opt/bin/opkg upgrade --force-space
/opt/bin/opkg install busybox --force-space
/opt/bin/opkg install entware-opt --force-space
echo "Install ca certs for curl https support"
/opt/bin/opkg install ca-bundle ca-certificates --force-space
# Fix for multiuser environment
chmod 777 /opt/tmp
# now copy default files - it is an alternative installation
cp -f /opt/etc/passwd.1 /opt/etc/passwd
cp -f /opt/etc/group.1 /opt/etc/group
cp -f /opt/etc/shells.1 /opt/etc/shells
if [ -f /etc/localtime ]
    ln -sf /etc/localtime /opt/etc/localtime
echo "Install SSH dropbear"
/opt/bin/opkg install dropbear --force-space
/opt/sbin/dropbear -p 22 -a
if [ $? == 0 ]; then
    echo "Info: Using standard port 22 for dropbear"
   /opt/sbin/dropbear -p 12345 -a
   echo "Warning: Using non-standard port 12345 for dropbear. Please check your init.d"
echo -e "\n\n\n"
echo "Now you can login via SSH on port 22 login: root and password: 12345"
echo -e "\n"
echo "Creating autostart script"
mkdir -p /system/etc/init.d/
chmod 0755 $AUTO_START
echo -e "#!/system/bin/sh" >> $AUTO_START 
echo -e "\n" >> $AUTO_START 
echo -e "sleep 15" >> $AUTO_START 
echo -e "mount -o rw,remount /" >> $AUTO_START 
echo -e "mount -o rw,remount /system" >> $AUTO_START 
echo -e "mkdir -p $MAIN_DIR" >> $AUTO_START 
echo -e "mount --bind $OPT_DIR $MAIN_DIR" >> $AUTO_START 
echo -e "mkdir -p /bin" >> $AUTO_START 
echo -e "mount --bind $OPT_DIR/bin /bin" >> $AUTO_START 
echo -e "mkdir -p /tmp" >> $AUTO_START 
echo -e "mount --bind $OPT_DIR/tmp /tmp" >> $AUTO_START 
echo -e "mkdir -p /usr/bin" >> $AUTO_START
echo -e "ln -snf /bin/env /usr/bin/env" >> $AUTO_START
echo -e "export PATH=\$PATH:/opt/bin:/opt/sbin" >> $AUTO_START
echo -e "/opt/etc/init.d/rc.unslung start" >> $AUTO_START 
echo -e "mount -o ro,remount /" >> $AUTO_START 
echo -e "mount -o ro,remount /system" >> $AUTO_START 
echo -e "\n" >> $AUTO_START 
echo "If init.d supported there is a script $AUTO_START or run via autostart SManager app"
echo -e "\n\n\n"
echo "Mount to read-only"
mount -o ro,remount /
mount -o ro,remount /system


sleep 15
mount -o rw,remount /
mount -o rw,remount /system
mkdir -p
mount --bind
mkdir -p /bin
mount --bind /bin /bin
mkdir -p /tmp
mount --bind /tmp /tmp
mkdir -p /usr/bin
ln -snf /bin/env /usr/bin/env
export PATH=$PATH:/opt/bin:/opt/sbin
/opt/etc/init.d/rc.unslung start
mount -o ro,remount /
mount -o ro,remount /system