diff --git a/.profile.roku b/.profile.roku index 64d462a..e666d82 100644 --- a/.profile.roku +++ b/.profile.roku @@ -24,12 +24,19 @@ EOF build() { - BUILD_PLATFORM=marlin - ENABLE_ICECC=0 - JOBS=$(nproc) - TARGET=all - BUILD_MODE=dev - PAX_DEBUG=on + local BUILD_PLATFORM=marlin + local ENABLE_ICECC=0 + local JOBS=$(nproc) + local TARGET=all + local BUILD_MODE=dev + local PAX_DEBUG=on + local OPTIONS= + + local BUILD_ROOT=$(git rev-parse --show-toplevel)/os + if [ "$?" -ne "0" ]; then + BUILD_ROOT=$(p4 -Ztag -F %clientRoot% info)/os + fi + echo $BUILD_ROOT # args=$(getopt fhstuec $*) # if [ $? -ne 0 ]; then @@ -39,11 +46,17 @@ build() while [ $# -gt 0 ]; do case "$1" in + unittests) + TARGET=build-tests-all + PAX_DEBUG=off + BUILD_PLATFORM=hostunittests + ;; unity|\ native) PAX_DEBUG=off BUILD_PLATFORM=$1 ;; + reno|\ bailey|\ marlin|\ madison) @@ -62,9 +75,19 @@ build() addon-checksum-check|\ clean|\ clobber|\ + build-tests-all|\ + build-tests-ZipMountServerTest|\ + build-tests-FuseServerTest|\ + build-tests-PluginPackageManagemnetPluginUnitTests|\ clobber-all) TARGET=$1 ;; + build-integration-tests) + OPTIONS+="BUILD_INTEGRATION_TESTS=true" + ;; + here) + BUILD_ROOT="." + ;; nopax) PAX_DEBUG=off ;; @@ -83,19 +106,15 @@ build() shift done - local GIT_ROOT=$(git rev-parse --show-toplevel) - if [ "$?" -ne "0" ]; then - GIT_ROOT=$(p4 -Ztag -F %clientRoot% info) - fi - echo $GIT_ROOT make \ ENABLE_ICECC=$ENABLE_ICECC \ BUILD_MODE=$BUILD_MODE \ PAX_DEBUG=$PAX_DEBUG \ BUILD_PLATFORM=$BUILD_PLATFORM \ + $OPTIONS \ -j $JOBS \ - -C $GIT_ROOT/os $TARGET + -C $BUILD_ROOT $TARGET #make ENABLE_ICECC=1 PAX_DEBUG=on BUILD_PLATFORM=$1 -j $(nproc) -C os all } ############################################################################### diff --git a/README.md b/README.md new file mode 100644 index 0000000..0f4441e --- /dev/null +++ b/README.md @@ -0,0 +1,57 @@ +# Swizz Army Knife + +## Install +Simply upload to /nvram/san and that's it. + +## Run +In order to load functions just run +``` +>source /nvram/san +``` + +For possible commands type +``` +>san_help +``` + +## Cheats + +### Setup debug mode. +``` +rokusetup dev on +saveenv +reset +``` + + +### Setup network from uBoot. +``` +usb start +rokusetup net auto +rokusetup tftpserver +rokusetup coreserver +saveenv +reset +``` + +``` +env set ipaddr 192.168.0.62 +env set serverip 192.168.0.64 +env set gatewayip 192.168.0.1 +env set netmask 255.255.252.0 +saveenv +usb start +ping 192.168.0.64 +``` + +``` +usb start +tftpboot acramfs.marlin.bin + +``` + +``` +usb start +rokuflash tftp acramfs.marlin.bin +``` + diff --git a/san b/san index 279bc28..d68db6b 100644 --- a/san +++ b/san @@ -2,7 +2,9 @@ set -o vi # set -x -SERVER_IP=192.168.0.64 +if [ -z $SAN_SERVER_IP ]; then + SAN_SERVER_IP=192.168.0.64 +fi DESCR="" descr(){ @@ -17,7 +19,7 @@ san_help() printf "$DESCR\n" } -UPDATE_SAN="wget -O /nvram/san http://$SERVER_IP/roku/san/san" +UPDATE_SAN="wget -O /nvram/san http://$SAN_SERVER_IP/roku/san/san" descr " update_san - update this script." descr " Manually: $UPDATE_SAN" update_san() @@ -29,7 +31,7 @@ update_san() descr " upload - upload through tftp. e.g. upload /dev/ltcore" upload() { - [ -e $1 ] && tftp -r $(basename $1) -l $1 -p $SERVER_IP + [ -e $1 ] && tftp -r $(basename $1) -l $1 -p $SAN_SERVER_IP } descr " upload_core - upload /dev/ltcore" @@ -51,6 +53,11 @@ factory_reset() touch /nvram/factoryresetflag2 && reboot } +descr " disable_wd - disable watchdog" +disable_wd() +{ + sh -c "while true ; do noreset; sleep 5; done" & +} ################################################################################ # # Firmware flash. @@ -85,7 +92,7 @@ download_from_buildarea() download_firmware() { - ACRAMFS_URL="http://$SERVER_IP/roku/$1" + ACRAMFS_URL="http://$SAN_SERVER_IP/roku/$1" echo "Downloading ${ACRAMFS_URL}" wget -O ${ACRAMFS} ${ACRAMFS_URL} if [ $? -ne 0 ]; then @@ -271,6 +278,8 @@ descr " enable_fastboot - " enable_fastboot() { su app -c "ConfigService -so fw.fastboot.capture.snapshot=true" + su app -c "ConfigService -so fw.fastboot.force.enable.snapshot=true" + fastboot_reset } descr " disable_fastboot - " @@ -280,6 +289,20 @@ disable_fastboot() fastboot_reset } +descr " enable_fastboot2 - " +enable_fastboot2() +{ + su app -c "ConfigService -so fw.fastboot.snapshot-after-precompile=true" + fastboot_reset +} + +descr " disable_fastboot2 - " +disable_fastboot2() +{ + su app -c "ConfigService -so fw.fastboot.snapshot-after-precompile=false" + fastboot_reset +} + descr " fastboot_reset - " fastboot_reset() { @@ -344,16 +367,20 @@ alias ll='ls -la' # # Done # -grep /nvram/san /nvram/autostart > /dev/null -if [ $? != 0 ]; then - cat > /nvram/autostart << EOF +descr " setup_san - " +setup_san() +{ + grep /nvram/san /nvram/autostart > /dev/null + if [ $? != 0 ]; then + cat > /nvram/autostart << EOF #!/bin/sh -/sbin/udhcpc -i eth0 -s /etc/udhcpc.sh -ifconfig -sh -c "while true ; do noreset; sleep 5; done" & +SAN_SERVER_IP=192.168.0.64 source /nvram/san +disable_wd +#setup_network EOF -fi + fi +} san_help