How to compile Tccutils - Upgrading, Modifying and Unlocking

How to pack tccutils.
Compiling applications needed:
based on debian linux: sudo apt-get install gcc libssl-dev git
Code:
[B][SIZE=4]Compiling the tools[/SIZE][/B]
$ mkdir rom
$ cd rom
$ git clone https://github.com/naobsd/tccutils.git
$ cd tccutils/
$ cc -o tccpack tccpack.c
$ cc -o tccunpack tccunpack.c
$ cd ../
$ git clone -b ics-telechips-naobsd https://github.com/naobsd/cm_system_core.git
$ cd cm_system_core/mkbootimg/
$ cc -o mkbootimg mkbootimg.c -lcrypto
$ cc -o unpackbootimg unpackbootimg.c
$ cd ../../
$ git clone -b ics-telechips-naobsd https://github.com/naobsd/cm_external_yaffs2.git
$ cd cm_external_yaffs2/yaffs2/utils/
$ make mkyaffs2image
$ cd ../../../
$ git clone https://github.com/ehlers/unyaffs.git
$ cd unyaffs/
$ make
$ cd ../
Copy compiled binaries to somewhere you like.
Code:
[B][SIZE=4]using tools[/SIZE][/B]
[B]MTD image[/B]
$ tccunpack MTD.img
(boot.img, system.img, and recovery.img will be extracted)
$ tccpack boot.img system.img recovery.img MTD_new.img
boot.img/recovery.img
$ unpackbootimg -i boot.img
$ mkdir ramdisk
$ cd ramdisk
$ gzip -cd ../boot.img-ramdisk.gz | cpio -i
(modify files)
$ find * | cpio -o -H newc | gzip -9 > ../boot.img-ramdisk_new.gz
$ cd ../
$ mkbootimg --kernel boot.img-zImage --ramdisk boot.img-ramdisk_new.gz --cmdline `boot.img-cmdline` --base 0x`boot.img-base` --pagesize `boot.img-pagesize` -o boot_new.img
system.img
$ unyaffs -d system.img
(check page(chunk) size and spare size)
$ sudo unyaffs system.img system
$ cd system
(modify files)
$ cd ../
$ cd system
$ sudo mkyaffs2image -c (PAGESIZE, e.g. 4096(not 4)) -s (SPARESIZE, e.g. 128) . ../system_new.img
[B]Example for 4gb: sudo mkyaffs2image -c 4096 -s 128 . ../system_new.img
Example for 8gb: sudo mkyaffs2image -c 8192 -s 256 . ../system_new.img[/B]
note: i have updated some of the steps from the original post.
source: http://androtab.info/arm/telechips/customize-firmware/
This scripts below are designed to unpack Cx-01 4gb adn 8gb roms. Thank you Hairybiker for the scripts. you can update them to unpack your tcc rom.
Unpack the rom and ramdisk
ex.sh
Code:
#!/bin/bash
PATH=~/bin:$PATH
tccunpack CX1*en.rom
unpackbootimg -i boot.img
mkdir ramdisk
cd ramdisk
gunzip -cd ../boot.img-ramdisk.gz | cpio -i
cd ..
mkdir system
unyaffs -d system.img
unyaffs system.img system
RepackRom with ramdisk
mkall.sh
Code:
#!/bin/bash
PATH=~/bin:$PATH
if ( "$1" == "8") then
page=8192
step=256
else
page=4096
step=128
fi
cd system
mkyaffs2image -c $page -s $step . ../system_new.img
cd ..
cd ramdisk
find . | cpio -o -H newc | gzip -9 > ../ramdisk_new.gz
cd ..
mkbootimg --kernel boot.img-zImage --ramdisk ramdisk_new.gz --cmdline "console=null" --base 0x80000000 --pagesize $page -o boot_new.img
tccpack boot_new.img system_new.img recovery.img CX-01.v0.0.rom
Pack Rom without recompiling ramdisk
mk.sh
Code:
#!/bin/bash
PATH=~/bin:$PATH
if [ "$1" = "8" ]; then
page=8192
step=256
else
page=4096
step=128
fi
echo Page=$page Step=$step
cd system
mkyaffs2image -c $page -s $step . ../system_new.img
cd ..
tccpack boot.img system_new.img recovery.img CX-01.$1v0.0.rom

Thx, I ad this link to my telechip compile thread.

Related

[Q] clockwork 3 with linux

i currently have the old clockwork 2.5.1.0 and ready to move to ext4 and flash most likely viperrom or srf. the problem im encountering is when i extract the cwm3 zip and click run.sh like instructed it just opens up this with gedit:
#!/bin/bash
platform=`uname`;
adb="./adb";
if [ $(uname -p) == 'powerpc' ]; then
echo "Sorry, this won't work on PowerPC machines."
exit 1
fi
cd "$(dirname "$0")"
echo "Original one click made by joeykrim and one click installer made by noobnl and firon"
echo "busybox by skeeterslint"
read -n1 -s -p "Press any key to continue..."
which adb > /dev/null 2>&1
if [ $? -eq 0 ]; then
adb="./adb";
if [ "$platform" == 'Darwin' ]; then
mv adb.osx $adb > /dev/null 2>&1
fi
fi
chmod +x $adb
echo -e "Starting adb server"
$adb kill-server
which sudo > /dev/null 2>&1
if [ $? -eq 0 ]; then
$adb start-server
else
sudo $adb start-server
if [ $? -ne 0 ]; then
$adb start-server
fi
fi
state=$($adb get-state | tr -d '\r\n[:blank:]')
while [ "$state" != device ]; do
state=$($adb get-state | tr -d '\r\n[:blank:]')
read -n1 -s -p "Phone is not connected. Press any key to continue."
done
root=$($adb shell id | grep uid=0)
if [ -z "$root" ]; then
echo -e "Copy and run the exploit (may take up to two minutes)"
$adb push rageagainstthecage-arm5.bin /data/local/tmp/rageagainstthecage-arm5.bin
$adb push root.sh /data/local/tmp/root.sh
$adb shell chmod 755 /data/local/tmp/rageagainstthecage-arm5.bin
$adb shell chmod 755 /data/local/tmp/root.sh
$adb shell /data/local/tmp/root.sh
echo Wait for phone to reconnect...
sleep 20;
i=0;
state=$($adb get-state | tr -d '\r\n[:blank:]')
while [[ "$state" != device && $i -lt 30 ]]; do
state=$($adb get-state | tr -d '\r\n[:blank:]')
let i=i+1;
sleep 1;
done
if [ "$state" != "device" ]; then
echo "Phone did not reconnect after 30 seconds."
read -n1 -s -p "Pausing script. Unplug and replug USB cable and check the connection (verify with adb shell)."
fi
state=$($adb get-state | tr -d '\r\n[:blank:]')
if [ "$state" != "device" ]; then
echo "Aborting script. Phone is still not connected. Reboot the phone and try again.";
exit 1;
fi
root=$($adb shell id | grep uid=0)
if [ -z "$root" ]; then
echo "Root was not obtained. Please re-run the script."
exit 1;
fi
fi
echo "Mount system as r/w, cleanup old files, do some basic configuration"
$adb shell mount -t rfs -o remount,rw /dev/block/stl9 /system
oldroot=$($adb shell "if [ -f /system/bin/joeykrim-root.sh ]; then echo -n 'exists'; fi");
if [ -z "$oldroot" ]; then
$adb shell rm /system/bin/playlogo
$adb shell mv /system/bin/playlogo-orig /system/bin/playlogo
$adb shell chmod 755 /system/bin/playlogo
fi
$adb push rootsetup /data/local/tmp/rootsetup
$adb shell chmod 755 /data/local/tmp/rootsetup
$adb shell /data/local/tmp/rootsetup
$adb shell rm /data/local/tmp/rootsetup
$adb shell rm /system/app/Asphalt5_DEMO_ANMP_Samsung_D700_Sprint_ML.apk
$adb shell rm /system/app/FreeHDGameDemos.apk
echo "Copying files onto phone..."
$adb push su /system/xbin/su
$adb push Superuser.apk /system/app/Superuser.apk
$adb push busybox /system/xbin/busybox
$adb push remount /system/xbin/remount
echo "Setting permissions..."
$adb shell chmod 755 /system/xbin/busybox
$adb shell chmod 755 /system/xbin/remount
$adb shell chown root.shell /system/xbin/su
$adb shell chmod 4755 /system/xbin/su
$adb shell ln -s /system/xbin/su /system/bin/su
echo "Installing busybox..."
$adb shell /system/xbin/busybox --install -s /system/xbin
osversion=$(./adb shell getprop ro.build.id | tr -d '\r\n[:blank:]')
if [ "$osversion" == "FROYO" ]; then
echo Installing clockworkmod redirector
$adb push recovery /system/bin/recovery
$adb push recoveryfiles /system/bin/recoveryfiles/
$adb push recoveryres /system/bin/recoveryres/
$adb shell busybox chmod -R 0755 /system/bin/recoveryfiles/*
$adb shell busybox chmod -R 0755 /system/bin/recoveryres/*
$adb shell chmod 0755 /system/bin/recovery
$adb shell sync
fi
echo "Installing clockworkmod recovery..."
$adb push redbend_ua /data/local
$adb shell chmod 755 /data/local/redbend_ua
$adb push zImage /data/local/tmp/zImage
$adb shell /data/local/redbend_ua restore /data/local/tmp/zImage /dev/block/bml8
echo "Waiting for phone to reboot..."
sleep 5;
i=0;
state=$($adb get-state | tr -d '\r\n[:blank:]')
while [[ "$state" != device && $i -lt 45 ]]; do
state=$($adb get-state | tr -d '\r\n[:blank:]')
let i=i+1;
sleep 1;
done
echo "Cleaning up files..."
sleep 5;
$adb shell rm /data/local/redbend_ua
$adb shell rm /data/local/tmp/zImage
$adb shell rm /data/local/tmp/rageagainstthecage-arm5.bin
$adb shell rm /data/local/tmp/root.sh
if [ -z $(which sudo 2>/dev/null) ]; then
$adb kill-server
else
sudo $adb kill-server
fi
read -n1 -s -p "Press any key to exit the script."
anyone know the command in terminal to possibly run this. thanks!
It's run.bat you are supposed to run in either a command box or just double click on it in Windows. Remember the 1st time you go into Clockwork it will immediately convert you to EXT4 file system. You need to have the EXT4 compatible ROM on your sd card and flash it before rebooting from the conversion or you will get stuck at the Samsung screen.
this is for linux os though. according to the instructions im suppose to click the shell file not the batch file.
mk4cam said:
this is for linux os though. according to the instructions im suppose to click the shell file not the batch file.
Click to expand...
Click to collapse
I'm not quite sure, but as an alternate suggestion, try out heimdall in linux and flash the image file here. Also listed in my signature
Which distro are you running? You need to make the script executable and then run the script from a terminal.
Open a terminal where you extracted the cwm3.zip and run the following commands;
Code:
chmod +x run.sh
Code:
./ run.sh
You may need to run this as root or sudo.
ironlineage said:
Which distro are you running? You need to make the script executable and then run the script from a terminal.
Open a terminal where you extracted the cwm3.zip and run the following commands;
Code:
chmod +x run.sh
Code:
./ run.sh
You may need to run this as root or sudo.
Click to expand...
Click to collapse
tried it and now this:
Original one click made by joeykrim and one click installer made by noobnl and firon
busybox by skeeterslint
Press any key to continue...Starting adb server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
Phone is not connected. Press any key to continue.
im lost cause i had no issues rooting the older version via http://forum.xda-developers.com/showthread.php?t=808103. ive tried every usb port i have on this comp and every cable i have and it still cant see the phone. i think ill just have to try this when im around a windows comp next time.
If I remember correctly you need to have USB Debugging enabled on your phone and make sure it is not mounted on the computer but still charging.
ok ill try it cause i have had it mounted. ill let you know
Edit: ran it w/o mounting and same results

system.img partition size for repacking system.img ? 512M or 686M?

sudo out/host/linux-x86/bin/make_ext4fs -s -l 512M -a system system.img.new mnt-point/
sudo out/host/linux-x86/bin/make_ext4fs -s -l 686M -a system system.img.new mnt-point/
which is the one ? I believe I have to take the last one but I can't find anything clear on this confirming my thoughts.

Busybox command softlinker

Have busybox? Wish you could type "grep foo" instead of "busybox grep foo" ? This simple shell script checks your busybox for supported commands and softlinks them from /system/bin to wherever the first busybox it finds in the $PATH is.
Since I screwed up my links a couple times making this, there's also a script that strips every link to busybox out of /system/bin.
These scripts do basically no error checking. They require root access, but they don't check for it. If you don't know how to read a script to see what it does before you run it, don't run it.
That said, it's handy.
Code:
#!/system/bin/sh
# linky.sh: softlink busybox to all the commands it supports
# Now with zero error checking! Beware :P
# -speef
busybox &>/dev/null || exit 1
bbl=`busybox which busybox`
ready=0
busybox mount -o rw,remount /system
>./linky.log
for cmd in `busybox`
do
cmd=`echo $cmd|busybox awk -F, '{print $1}'`
if [ $ready -eq 0 ]
then
if [ $cmd == "functions:" ]
then
ready=1
continue
else
continue
fi
fi
echo ln -s $bbl /system/bin/$cmd
busybox ln -s $bbl /system/bin/$cmd &>> linky.log
done
busybox mount -o ro,remount /system
echo "see ./linky.log for errors!"
And its counterpart, which removes all links to busybox from /system/bin:
Code:
#!/system/bin/sh
# delinky.sh: remove all busybox links from /system/bin
# Now with zero error checking! Beware :P
# -speef
busybox &>/dev/null || exit 1
busybox mount -o rw,remount /system
for cmd in `busybox find /system/bin -type l -exec ls -l \{\} \; | busybox grep busybox|busybox awk '{print $6}'`
do
echo rm /system/bin/$cmd
busybox rm /system/bin/$cmd
done
busybox mount -o ro,remount /system

[GUIDE] Run Sickbeard/Transmission/sabnzbd/SSH/Samba/More on Shield

I've seen lots of people saying its not possible to make the shield an all in one solution for downloading, but after hours of tinkerering I've got a semi easy way of running the above services (and tons more) from the shield. This does requrie a bit of command line-fu , but I think I've got most of the hard work done. When its all said and done, we'll have a working entware-ng installation ( https://github.com/Entware-ng/Entware-ng)
--This guide is a work in progress, there are a few other items I'll add that will improve user experience, but as it stands now it should work as intended. I also haven't gotten a samba config to work yet, so if anyone can figure it out, let me know and I'll update a section on it
I've addapted this guide from a few github projects , but that likely means some commands/steps are actually useless on the shield:
https://github.com/erichlf/AndroidSeedBox
(will add other sources later)
AS ALWAYS MAKE A BACKUP OF DATA -- I AM NOT RESPONSIBLE IF YOUR DEVICE LOSES DATA (to my knowledge, there is no risk of bricking your device doing this, at worst a factory reset/reflash)
Pre-reqs:
Shield has to have ROOT
ADB set up on PC
Busybox : http://www.apkmirror.com/apk/jrummy-apps-inc/busybox-for-android/
Rom Toolbox Lite : Not on apk mirror, so side load from your favorite place
For this process, I recommend having your shield next to your computer, and share inputs with your monitor. You can do 90% of it from an ADB shell, but a few parts you will need to use a terminal on the shield itself, and keyboard is way easier than controller
Install Busybox on the shield, but use the oldest version available (I think the wget for 1.26 messes with the process)
run "ADB Shell" and run these commands on the shield (You can copy/paste multiple lines into the cmd window):
Code:
su
mount -o rw,remount /
ls /data/entware-ng >/dev/null 2>&1 || mkdir /data/entware-ng
cd .; ln -s /data/entware-ng /opt
ls /data/entware-ng/rootbin >/dev/null 2>&1 || mkdir /data/entware-ng/rootbin
cd .; ln -s /data/entware-ng/rootbin /bin
ls /data/entware-ng/rootlib >/dev/null 2>&1 || mkdir /data/entware-ng/rootlib
cd .; ln -s /data/entware-ng/rootlib /lib
ls /data/entware-ng/tmp >/dev/null 2>&1 || mkdir /data/entware-ng/tmp
cd .; ln -s /data/entware-ng/tmp /tmp
ls /data/entware-ng/home >/dev/null 2>&1 || mkdir /data/entware-ng/home
ls /data/entware-ng/home/root >/dev/null 2>&1 || mkdir /data/entware-ng/home/root
ls /data/entware-ng/home/user >/dev/null 2>&1 || mkdir /data/entware-ng/home/user
chmod 0755 /data/entware-ng/home/root
chown root.root /data/entware-ng/home/root
chmod 0755 /data/entware-ng/home/user
We've set up our staging area, and created a new home directory.
Now lets install Entware
Code:
ls /data/entware-ng/bin >/dev/null 2>&1 || mkdir /data/entware-ng/bin
ls /data/entware-ng/lib >/dev/null 2>&1 || mkdir /data/entware-ng/lib
ln -s /system/bin/sh /bin/sh
wget http://pkg.entware.net/binaries/armv7/installer/entware_install.sh -O /data/entware-ng/entware_install.sh
sh /data/entware-ng/entware_install.sh
Now lets install a new Busybox and Wget
Code:
/opt/bin/opkg install busybox
/opt/bin/opkg install wget
cd /bin; ln -s /data/entware-ng/bin/busybox sh
cd /bin; ln -s /data/entware-ng/bin/busybox echo
cd /bin; ln -s /data/entware-ng/bin/busybox rm
cd /bin; ln -s /data/entware-ng/bin/busybox rmdir
cd /bin; ln -s /data/entware-ng/bin/busybox sed
cd /bin; ln -s /data/entware-ng/bin/busybox mkdir
cd /bin; ln -s /data/entware-ng/bin/busybox head
cd /bin; ln -s /data/entware-ng/bin/busybox sort
cd /bin; ln -s /data/entware-ng/bin/busybox dirname
cd /bin; ln -s /data/entware-ng/bin/busybox ln
cd /bin; ln -s /data/entware-ng/bin/busybox mv
cd /bin; ln -s /data/entware-ng/bin/busybox cat
cd /bin; ln -s /data/entware-ng/bin/busybox chown
cd /bin; ln -s /data/entware-ng/bin/busybox chmod
cd /bin; ln -s /data/entware-ng/bin/busybox pgrep
This next step may be optional. Sets up resolv.conf (which may already exist, I'm not sure) and mtab (I don't know what this is)
Code:
echo nameserver 8.8.8.8 >/data/entware-ng/etc/resolv.conf
ls /etc >/dev/null 2>&1 || mkdir /etc
mount -o rw,remount /system
ls /etc/resolv.conf >/dev/null 2>&1 && rm /etc/resolv.conf
cd .; ln -s /data/entware-ng/etc/resolv.conf /etc/resolv.conf
cd .; ln -s /proc/mounts /etc/mtab
Create Passwd file
Code:
echo root:x:0:0:root:/opt/home/root:/bin/sh >/data/entware-ng/etc/passwd
echo shell:x:2000:2000:shell:/opt/home/user:/bin/sh >>/data/entware-ng/etc/passwd
cd .; ln -s /data/entware-ng/etc/passwd /etc/passwd
echo root:x:0:root >/data/entware-ng/etc/group
echo shell:x:2000:shell >>/data/entware-ng/etc/group
cd .; ln -s /data/entware-ng/etc/group /etc/group
echo /bin/sh > /etc/shells
echo PATH=/usr/bin:/usr/sbin:/bin:/sbin:/system/sbin:/system/bin:/system/xbin:/system/xbin/bb:/data/local/bin > /etc/profile
echo export PATH >> /etc/profile
OPTIONAL: If you want to use Open SSH with password instead of certs you can do the following step. I have done this, and haven't noticed any issues, but it may lessen the security of Root
Code:
/data/entware-ng/bin/busybox passwd root
Now let's create a script that will initialize Entware-ng after reboot
Code:
echo \#\!/system/bin/sh > /data/entware-ng/entware-init.sh
echo mount -o rw,remount rootfs / >> /data/entware-ng/entware-init.sh
echo ln -s /data/entware-ng /opt >> /data/entware-ng/entware-init.sh
echo ln -s /data/entware-ng/rootlinb /lib >> /data/entware-ng/entware-init.sh
echo ln -s /data/entware-ng/rootbin /bin >> /data/entware-ng/entware-init.sh
echo ln -s /data/entware-ng/tmp /tmp >> /data/entware-ng/entware-init.sh
echo ln -s /system/bin/sh /bin/sh >> /data/entware-ng/entware-init.sh
echo mount -o ro,remount rootfs >> /data/entware-ng/entware-init.sh
chmod 755 /data/entware-ng/entware-init.sh
Now lets create a start script that calls the initialize script we just made, but also returns a shell in the new environment
Code:
echo \#\!/system/bin/sh > /data/entware-ng/start.sh
echo ls '/opt >/dev/null 2>&1 ||' su -c /data/entware-ng/entware-init.sh >> /data/entware-ng/start.sh
echo export PATH=/opt/sbin:/opt/bin:/opt/rootbin:/opt/local/bin:/system/bin >> /data/entware-ng/start.sh
echo if busybox test $(busybox id -u) = 0; then HOME=/opt/home/root; else HOME=/opt/home/user; fi >> /data/entware-ng/start.sh
echo export HOME >> /data/entware-ng/start.sh
echo '/opt/etc/init.d/rc.unslung start' >> /data/entware-ng/start.sh
echo /bin/sh >> /data/entware-ng/start.sh
chmod 755 /data/entware-ng/start.sh
Now, lets install different services. These are optional, and there are tons more, but this will get transmission/sickbeard/ssh going
Code:
PATH=/data/entware-ng/bin:/bin /data/entware-ng/bin/opkg install vim
PATH=/data/entware-ng/bin:/bin /data/entware-ng/bin/opkg install samba36-server
PATH=/data/entware-ng/bin:/bin /data/entware-ng/bin/opkg install transmission-web transmission-daemon-openssl
PATH=/data/entware-ng/bin:/bin /data/entware-ng/bin/opkg install python
PATH=/data/entware-ng/bin:/bin /data/entware-ng/bin/opkg install python-setuptools
PATH=/data/entware-ng/bin:/bin /data/entware-ng/bin/opkg install python-pip
PATH=/data/entware-ng/bin:/bin /data/entware-ng/bin/opkg install python-cheetah
PATH=/data/entware-ng/bin:/bin /data/entware-ng/bin/opkg install openssh-server
Copy the start.sh and sysinit to the home environment
Code:
cp /data/entware-ng/start.sh /data/entware-ng/home/root/start.sh
cp /data/entware-ng/start.sh /data/entware-ng/home/root/sysinit
chown root.root /data/entware-ng/home/root/start.sh
chmod 755 /data/entware-ng/home/root/start.sh
chown root.root /data/entware-ng/home/root/sysinit
chmod 755 /data/entware-ng/home/root/sysinit
mount -o ro,remount /
mount -o ro,remount /system
Start the new environment
Code:
sh /data/entware-ng/home/root/sysinit
SICKBEARD CONIG
Install a few pre-reqs for sickbeard
Code:
pip install transmissionrpc
pip install cherrypy
Create a file in init.d to allow sickbeard to start on reboot. Please note, you will need to change the path to where your sickbeard directory is.
I'm not going to cover setting up sickbeard, there are other guides for that. I did find that it couldn't be bound to 0.0.0.0 , or local host, it needed to be hard coded for the shields IP, so I recommend setting it up as a static IP in your router.
Code:
echo PATH=/opt/bin:/opt/sbin:$PATH > /opt/etc/init.d/S96sickbeard
echo /opt/bin/python <YOUR PATH TO>/SickBeard.py -d --port 8081 >> /opt/etc/init.d/S96sickbeard
chmod 755 /opt/etc/init.d/S96sickbeard
chmod +x /opt/etc/init.d/S96sickbeard
OPENSSH CONFIG
OPTIONAL - If you want to use SSH we need to generate keys
Code:
ssh-keygen -f /opt/etc/ssh/ssh_host_rsa_key -N '' -t rsa
ssh-keygen -f /opt/etc/ssh/ssh_host_dsa_key -N '' -t dsa
ssh-keygen -f /opt/etc/ssh/ssh_host_ecdsa_key -N '' -t ecdsa -b 521
Now you'll have to get on the shield and use a terminal emulator to edit your sshd_config file. Here's a copy of mine, but I do not promise how secure it is.
Code:
# $OpenBSD: sshd_config,v 1.99 2016/07/11 03:19:44 tedu Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin:/opt/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
# The default requires explicit activation of protocol 1
Protocol 2
# HostKey for protocol version 1
#HostKey /opt/etc/ssh/ssh_host_key
#HostKeys for protocol version 2
HostKey /opt/etc/ssh/ssh_host_rsa_key
HostKey /opt/etc/ssh/ssh_host_dsa_key
HostKey /opt/etc/ssh/ssh_host_ecdsa_key
#HostKey /opt/etc/ssh/ssh_host_ed25519_key
# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024
# Ciphers and keying
#RekeyLimit default none
# Logging
#SyslogFacility AUTH
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
PermitRootLogin yes
StrictModes no
#MaxAuthTries 6
#MaxSessions 10
#RSAAuthentication yes
#PubkeyAuthentication yes
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile .ssh/authorized_keys
#AuthorizedPrincipalsFile none
#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody
# For this to work you will also need host keys in /opt/etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
PermitEmptyPasswords yes
# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
#UsePAM no
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
UsePrivilegeSeparation no
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /opt/var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none
# no default banner path
#Banner none
# enable DSCP QoS values (per RFC-4594)
#IPQoS AF21 AF11
# override default of no subsystems
Subsystem sftp /opt/lib/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server
To edit this, on the shield (Rom Toolbox Lite has a terminal emulator) run
Code:
su
cd /opt
sh ./start.sh
cd /opt/etc/ssh
vi ./sshd_config
TRANSMISSION
You'll have to configure your transmission settings, but they're located
/opt/etc/transmission/settings.json
Persist after reboot / Start Transmission/SSH/Sickbeard on boot
On the shield, open Rom Toolbox lite, and go down to "Scripter"
Import the sysinit script located /opt/home/root/sysinit and set the script to run at boot as root
Reboot and you should be able to connect via SSH, and have
Why do we need the passwd and group file ? Won't we use android's UID/GID ?
Can this method somehow be used to create custom group where we could put android's UID ?
I don't know why that step is needed, I got it from the guide I listed, and it worked without any apparent issues, so I left it in. My guess is openssh wants it to be there, but I'm not sure
So after you run all that is there a Interface for Sickbeard etc?
ahoslc said:
So after you run all that is there a Interface for Sickbeard etc?
Click to expand...
Click to collapse
It would be running on <shield IP>:8081 which you could access from the shield, or any other device on your network. Transmission would be :9091
Thanks for this. I'm trying to get python3-pip, acd_cli, and encfs installed on my Shield TV so I can mount my Amazon Cloud Drive and decrypt files for use with Plex. I have this set up on my NAS but it is too weak to do transcoding. I did set up the NAS as a middleman and mounted shares from it on the Shield TV, and while it does work, the extra step is really slow.
edit: I managed to get acd_cli working but I cannot mount my Amazon Cloud Drive share, I get I/O errors when I try to cd into it. Wonder if there's a kernel issue.
psycho_asylum said:
Thanks for this. I'm trying to get python3-pip, acd_cli, and encfs installed on my Shield TV so I can mount my Amazon Cloud Drive and decrypt files for use with Plex. I have this set up on my NAS but it is too weak to do transcoding. I did set up the NAS as a middleman and mounted shares from it on the Shield TV, and while it does work, the extra step is really slow.
edit: I managed to get acd_cli working but I cannot mount my Amazon Cloud Drive share, I get I/O errors when I try to cd into it. Wonder if there's a kernel issue.
Click to expand...
Click to collapse
So I was able to get this working https://github.com/dsoprea/GDriveFS and could cd into my google drive (But couldn't get Plex to see any files in the directory)
Soooo, even if you do get it working, its possible Plex won't be able to see it
Edit-- Did you install fuse-utils ?
chasx003 said:
Edit-- Did you install fuse-utils ?
Click to expand...
Click to collapse
Not specifically. I would think it would have been listed as a dependency and automatically installed, libfuse was though. I ended up factory restoring my Shield after I botched something, so now I'm just at 5.1 stock using the built-in Samba for now.
which version of busybox works? I am having trouble with wget and I tried v1.21.0
chasx003 said:
I've seen lots of people saying its not possible to make the shield an all in one solution for downloading, but after hours of tinkerering I've got a semi easy way of running the above services (and tons more) from the shield. This does requrie a bit of command line-fu , but I think I've got most of the hard work done. When its all said and done, we'll have a working entware-ng installation ( https://github.com/Entware-ng/Entware-ng)
[..]
FIRST
Now let's create a script that will initialize Entware-ng after reboot
Code:
echo \#\!/system/bin/sh > /data/entware-ng/entware-init.sh
echo mount -o rw,remount rootfs / >> /data/entware-ng/entware-init.sh
echo ln -s /data/entware-ng /opt >> /data/entware-ng/entware-init.sh
echo ln -s /data/entware-ng/rootlinb /lib >> /data/entware-ng/entware-init.sh
echo ln -s /data/entware-ng/rootbin /bin >> /data/entware-ng/entware-init.sh
echo ln -s /data/entware-ng/tmp /tmp >> /data/entware-ng/entware-init.sh
echo ln -s /system/bin/sh /bin/sh >> /data/entware-ng/entware-init.sh
echo mount -o ro,remount rootfs >> /data/entware-ng/entware-init.sh
chmod 755 /data/entware-ng/entware-init.sh
[..]
SECOND
Now lets create a start script that calls the initialize script we just made, but also returns a shell in the new environment
Code:
echo \#\!/system/bin/sh > /data/entware-ng/start.sh
echo ls '/opt >/dev/null 2>&1 ||' su -c /data/entware-ng/entware-init.sh >> /data/entware-ng/start.sh
echo export PATH=/opt/sbin:/opt/bin:/opt/rootbin:/opt/local/bin:/system/bin >> /data/entware-ng/start.sh
echo if busybox test $(busybox id -u) = 0; then HOME=/opt/home/root; else HOME=/opt/home/user; fi >> /data/entware-ng/start.sh
echo export HOME >> /data/entware-ng/start.sh
echo 'for file in /data/opt/etc/init.d/*' >> /data/entware-ng/start.sh
echo do >> /data/entware-ng/start.sh
echo ' $file start' >> /data/entware-ng/start.sh
echo done >> /data/entware-ng/start.sh
echo /bin/sh >> /data/entware-ng/start.sh
chmod 755 /data/entware-ng/start.sh
[..]
THIRD
Copy the start.sh and sysinit to the home environment
Code:
chown root.root /data/entware-ng/home/root/start.sh
chmod 755 /data/entware-ng/home/root/start.sh
chown root.root /data/entware-ng/home/root/sysinit
chmod 755 /data/entware-ng/home/root/sysinit
mount -o ro,remount /
mount -o ro,remount /system
[..]
FOURTH
Start the new environment
Code:
sh /data/opt/home/root/sysinit
Reboot and you should be able to connect via SSH, and have
Click to expand...
Click to collapse
In my quote there has to be something missing between the "first" and "second" steps and the "third" one.. are the two files we've just made the missing files in the home/root directory? Or where they supposed to come from somewhere else?
Also the "fourth" step, there are no /data/opt directory in my installation.
MartiniGM said:
In my quote there has to be something missing between the "first" and "second" steps and the "third" one.. are the two files we've just made the missing files in the home/root directory? Or where they supposed to come from somewhere else?
Also the "fourth" step, there are no /data/opt directory in my installation.
Click to expand...
Click to collapse
Ah! Sorry for not replying until now, life has been busy.
You are correct, there are some typos / things out of order! I'm going to go through this and fix it and will update the OP
I've taken this guide and installed rTorrent (due to superior web client and RSS capability). If anyone needs help on that, I can chime in.
Great tuto !
Working fine one Nvidia Shield TV 2017 with latest update (whithout reboot)
But after reboot I lost /opt and /bin on root :-O
mkdir /opt working fine after mount -o rw,remount /
but if i reboot it disappear
any idea ?
android.stackexchange.com said:
(root) directory is not a persistent filesystem on Android. It's a initramfs, which is packed into the boot image on your device. Although you can remount it with write permissions, changes will always be lost the next time you boot because the original ramdisk will be re-extracted from the boot image on the next boot.
Click to expand...
Click to collapse
So we need to :
$ mkboot boot.img /output-folder
$ cd /output-folder
$ gunzip -c ramdisk | cpio -i
... make some changes in the ramdisk and possibly /output-folder/img_info ...
$ find . | cpio -o -H newc | gzip > newramdisk.cpio.gz
$ cd ..
$ mkboot /output-folder newboot.img
If you're rooted, a better solution is to simply install in a chroot, either using debootstrap or other; you can obtain a nearly complete Linux system this way (init in a chroot is weird, stuff like openssh will still have to be started separately after boot, either manually or by an app/script).
If you're not rooted, you can use proot for simple path redirection; this is how termux installs arch on unrooted devices.
Using either option (chroot, proot) requires having binary files that aren't in a noexec partition; generally this means private app storage, not sdcard that's accessible to other apps. If you're building a chroot, you should be able to include the external/public storage folder in it, however a chroot also requires the partition not be mounted with nodev option.
***Note that I don't actually have a shield TV*** (I'm just interested in getting one) so I can't say if the shield's storage is mounted noexec, but the android data partition generally is. I can, however, verify that the process in general works on Android, however, as I've got two tablets running Lineage/Nougat with chroots, and a stock Moto G6 with archlinux arm in proot. To check for partitions mounted as nodev or noexec, run `mount|TERM=xterm grep --color -E 'nodev|noexec'`. You might check to see if you can use /data/local instead of app's private storage.
For installing BusyBox, *should* be a `busybox --install -s [DIR]` option that copies the binary to the destination, then symlinks applets. This should be simpler than symlinking a bunch of applets manually.
If you want a system-wide BusyBox I recommend stericson busybox: https://play.google.com/store/apps/details?id=stericson.busybox
For a terminal emulator on Android, I highly recommend termux, which is available on Google play and F-Droid. It has support for 256 color, styles, a package manager, Android integration (ie notifications from Linux scripts), boot scripts, widgets, etc: https://play.google.com/store/apps/details?id=com.termux
Another alternative: you can set up user-mode Linux for something closer to virtualization, but I have yet to see any UML binaries for use with Android; this would also make it difficult to run networking and to access files from outside the guest, but will provide a full working system with init support, and would not require root to set up and run--however, I think UML networking requires root and/or kernel support, though, and UML generally requires a disk image much like other virtualization tools. Qemu might be workable instead of UML with fewer issues.
Note that all of these solutions are still running under an Android app, and as such are subject to the android task killer. Not sure if there's any way around this without having something run directly by Android's own init system.
Efreak2004 said:
If you're rooted, a better solution is to simply install in a chroot, either using debootstrap or other; you can obtain a nearly complete Linux system this way (init in a chroot is weird, stuff like openssh will still have to be started separately after boot, either manually or by an app/script).
If you're not rooted, you can use proot for simple path redirection; this is how termux installs arch on unrooted devices.
Using either option (chroot, proot) requires having binary files that aren't in a noexec partition; generally this means private app storage, not sdcard that's accessible to other apps. If you're building a chroot, you should be able to include the external/public storage folder in it, however a chroot also requires the partition not be mounted with nodev option.
***Note that I don't actually have a shield TV*** (I'm just interested in getting one) so I can't say if the shield's storage is mounted noexec, but the android data partition generally is. I can, however, verify that the process in general works on Android, however, as I've got two tablets running Lineage/Nougat with chroots, and a stock Moto G6 with archlinux arm in proot. To check for partitions mounted as nodev or noexec, run `mount|TERM=xterm grep --color -E 'nodev|noexec'`. You might check to see if you can use /data/local instead of app's private storage.
For installing BusyBox, *should* be a `busybox --install -s [DIR]` option that copies the binary to the destination, then symlinks applets. This should be simpler than symlinking a bunch of applets manually.
If you want a system-wide BusyBox I recommend stericson busybox: https://play.google.com/store/apps/details?id=stericson.busybox
For a terminal emulator on Android, I highly recommend termux, which is available on Google play and F-Droid. It has support for 256 color, styles, a package manager, Android integration (ie notifications from Linux scripts), boot scripts, widgets, etc: https://play.google.com/store/apps/details?id=com.termux
Another alternative: you can set up user-mode Linux for something closer to virtualization, but I have yet to see any UML binaries for use with Android; this would also make it difficult to run networking and to access files from outside the guest, but will provide a full working system with init support, and would not require root to set up and run--however, I think UML networking requires root and/or kernel support, though, and UML generally requires a disk image much like other virtualization tools. Qemu might be workable instead of UML with fewer issues.
Note that all of these solutions are still running under an Android app, and as such are subject to the android task killer. Not sure if there's any way around this without having something run directly by Android's own init system.
Click to expand...
Click to collapse
Using chroot isn`t good solution. Emulators not effective too.
Stericon`s busybox is paid, meefik`s busybox is free and has more utils.
Termux is heavy, I use Teeminal Emulator: https://f-droid.org/app/jackpal.androidterm
You be able to install a lot of lightweight linux utils by installing entware-ng. For example, git pkg has 300 Mb size in termux and 15 Mb in entware.
Entware has a lot of conmon with optware and openwrt
this is a wonderful guide I'm surprised more people don't use it great job!

How To Guide [LINUX/ALL-IN-ONE] How to flash an .ofp firmware with QDL (Qualcomm Device Loader)

DO IT AT YOUR OWN RISK, I'M NOT RESPONSIBLE
- Only git and unlocked bootloader are needed.
- I recommend that you make a backup of your device before carrying out any operations (by QFILhelper or other).
- If you want to flash a different firmware/region, you need to adapt the command.
- This command has been tested and works. One user even tested a version downgrade (from C09 to C08) and it worked.
- I don't know if firmware downgrade (for example from F06 to C13) works.
- At the end, you will have "Waiting for EDL device" : switch off the device, hold down the 2 volume buttons and connect it to the PC USB port.
- The flash will last between 30 and 40 minutes.
- At the end of the installation, the device will automatically restart, try to boot the system and then load Realme UI recovery.
- Wipe data and the device will boot successfully into the system.
- Many thanks to ogree from 4pda.to
All-in-one command (download/make/extract/merge/flash/...) to flash RMX3363GDPR_11_C.13 (EUEX region) in EDL (Emergency DownLoad) mode :
Code:
mkdir qdl_flash && cd qdl_flash && git clone https://github.com/bkerler/oppo_decrypt && mv ./oppo_decrypt/ofp_qc_decrypt.py ./ofp_qc_decrypt.py && mv ./oppo_decrypt/requirements.txt ./requirements.txt && rm -rf oppo_decrypt && pip3 install -r requirements.txt && wget https://rms01.realme.net/sw/RMX3363GDPR_11_C.13_2022121304390000.zip && unzip RMX3363GDPR_11_C.13_2022121304390000.zip && rm RMX3363GDPR_11_C.13_2022121304390000.zip && mv ./RMX3363GDPR_11_C.13_2022121304390000/RMX3363GDPR_11_C.13_2022121304390000.ofp ./RMX3363GDPR_11_C.13_2022121304390000.ofp && rm -rf RMX3363GDPR_11_C.13_2022121304390000 && mkdir extracted && python3 ofp_qc_decrypt.py RMX3363GDPR_11_C.13_2022121304390000.ofp extracted && rm ./RMX3363GDPR_11_C.13_2022121304390000.ofp ofp_qc_decrypt.py requirements.txt && git clone https://git.codelinaro.org/linaro/qcomlt/qdl && mv qdl qdl_source && cd qdl_source && make && cd .. && mv ./qdl_source/qdl ./qdl && rm -rf qdl_source && mv qdl ./extracted/qdl && cd extracted && git clone https://github.com/anestisb/android-simg2img && cd android-simg2img && make && cd .. && mv ./android-simg2img/simg2img ./simg2img && rm -rf android-simg2img && simg2img super.0.b39af986.img super.1.5e90d442.img super.2.a2462fd8.img super.img && rm prog_firehose_ddr.elf super.0.b39af986.img super.1.5e90d442.img super.2.a2462fd8.img super.2.09ba91b0.img super.2.98a4bcf9.img simg2img && sudo systemctl stop ModemManager && sudo ./qdl --debug --storage ufs prog_firehose_ddr_fwupdate.elf rawprogram0.xml rawprogram1.xml rawprogram2.xml rawprogram3.xml rawprogram4.xml rawprogram5.xml patch0.xml patch1.xml patch2.xml patch3.xml patch4.xml patch5.xml

Categories

Resources