Saving the Prime and a Dungeon of Sorts..

Yes NVFlash to save the day not what? a week after it was achieved?, I was trying to Put Ubuntu back on my Prime and before I knew it I had thrashed everything, not only that the only help i got form the Dev lilstevie was, “fastboot flash boot boot.img” Problems he never probably thought of was I never sated i had a Back up of the boot.img, I did luckily but before i knew that i had Kill /system, /boot and others, to the point it wouldn’t boot luily the bricksafe that NVFlash created, After an hour of work and the Discovery that i indeed had a boot.img its safely working again

 

Now the Dungeon!

 

I’m taking another security class this Fall and this I would believe would entail Port scans among other things, My Idea is as such, on my phone, I have an IRC and web server that I will place on the off network of the class to be discovered (hopefully) but a few student, the Site will say something to the tune of “Keep climbing down the Rabbit hole and you may be surprised what you find” corny I know but But its the IRC i really want them to find, For I am hoping to have this set up on Day one of class and hope to see at least one other student log into the IRC before class ends,

IRC still available @ irc.firezen.com

End of Line.

Updating Repos and Building Chromium

Last night i read an article in Linux User & Developer Issue 115, 2012 on how to build your own copy of Chrome OS which would be labeled Chromium as its not on there specific hardware and they did not build it, They being google of course

So I booted my Build Environment VM on the Server ran it through first Update its current repos for Android Official and Cyanogen, then set out to get the Chromium Source, and this is where I sit as I am waiting for the full layout to come down. supposed to be around twelve to fourteen GB

NVFlash for the PRIME!!

And here I thought development for the Prime was Dead!, Guess not!

on XDA today I discovered that NVFlash has been released, heres the Guide, Copied from androidroot:

 

Introduction

After many months of painstaking research and development AndroidRoot.mobi is excited to release the nvflash kit for the ASUS Transformer Prime which will grant you nvflash access to your tablet.

This guide will walk you through the process of acquiring nvflash access to your Transformer Prime tablet.

As part of the process of gaining this access you will need to flash the AndroidRoot patched custom bootloader which will provide numerous other benefits over the stock bootloader. However, flashing the bootloader is a potentially very risky activity so please think carefully before you proceed.

As part of undertaking this guide you disclaim AndroidRoot and its members of all liability or responsibility for any damage incurred. By performing the following steps you undertake all risks thereof.

Please note that this procedure is an advanced process and should only be completed by competent users.

The AndroidRoot Patched Bootloader

The current AndroidRoot.mobi bootloader version for the Transformer Prime is: 9.4.2.28r01.

ChangeLog:-

* Patch: Enable ‘fastboot boot’ command (removes ‘fastboot continue’, use ‘fastboot reboot’ instead).

* Patch: Force unlocked state (protect your unlock status no matter what happens to your token).

* Patch: Remove blob requirement from ‘fastboot flash’ (Flash the raw images and not blob files).

 Prerequisites

  1. An unlocked Transformer Prime tablet
  2. Working fastboot binary & all necessary drivers
  3. The nvflash binary from NVIDIA (ICS version — this is important!)
  4. Nerves of steel!

 Generating your nvflash blob files

To gain access to nvflash you will need to generate nvflash blob files which will allow you to authenticate with the APX mode on device.

To begin please download the tf201_nvflash.tar.bz file which contains the files you will need to complete this process.

When you have downloaded the nvflash pack and unzipped it you will need to reboot your device into fastboot mode. You can do this by rebooting the device and holding the volume down key until “Checking for RCK image” appears, at this stage do nothing until the boot menu loads.  Once you are at the boot menu press the volume down key until the fastboot/usb icon is selected then press the volume up key to put the device into fastboot mode.

Now that you are in fastboot mode please run the following command to flash the AndroidRoot bootloader:-

$ fastboot -i 0x0b05 flash bootloader ebtblob.bin

Please ensure flashing succeeds before continuing this guide.
You can verify you have the AndroidRoot bootloader installed as described below.

After the flash process has completed you will need to reboot your device into fastboot again by following the process above (or otherwise) ensuring this time that instead of the text “This Device is UnLocked” appearing in the top left of the boot screen the text “AndroidRoot 9.4.2.28r01″ is present instead.

Once you are back in fastboot mode having booted with the AndroidRoot bootloader it is finally time to generate your nvflash blob files with the following command:-

$ fastboot -i 0x0b05 boot nvfblobgen.img

That command will boot the custom AndroidRoot blob generation boot image and begin generating your required files. Please note that this process can take 20 — 30 seconds and will automatically reboot once it has completed. No progress is displayed during this time, just wait patiently for it to complete.

After the reboot your device should fully boot into Android allowing you to complete the next section of the guide.

 Accessing nvflash

Once your blobs have been generated you will need to retrieve them from the “internal” SD card from the AndroidRoot directory (e.g. /sdcard/AndroidRoot). You can do this either through MTP mode or by pulling them using adb.

** You absolutely must keep these files in triplicate copies — they are your life-line **

Finally, you will now be able to access nvflash using wheelie. To do this please reboot your tablet into APX mode by holding down the volume up key during the reboot process. If successful the screen should remain blank and be detected over USB by your computer as an NVIDIA APX mode device.

To “bootstrap” into nvflash using wheelie simply run the following command:-

$ wheelie –blob blob.bin

If successful your device will boot into nvflash mode and the bootloader screen will appear on the device.

From this point you will be able to use nvflash as normal by running commands such as the following to continue booting your device:-

$ nvflash –resume –go

What Next?

Good news! You have acquired nvflash access so what should you do next?

We strongly recommend that absolutely everyone who obtains nvflash access runs the following command:-

$ nvflash –resume –rawdeviceread 0 2944 bricksafe.img

This is a very important back-up file which is to be stored safely along with your nvflash blob files.

** Failure to make this back-up file will lead to support being withheld if you brick your device. You have been warned. **

You should also back-up your unlock token and your device’s factory generated configuration by using the following two commands:-

$ nvflash –resume –read 14 factory-config.img

$ nvflash –resume –read 7 unlock-token.img

Store these files securely with the blob data and bricksafe.img

Coming Soon

We hope to provide support for more devices — watch this space.

Credits

In alphabetical order the entire AndroidRoot.mobi team: Bumble-Bee, IEF, kmdm,  lilstevie & RaYmAn.

Our beta-testers for risking their devices so that you don’t have to (in no particular order): Roach`

We would also like to take this opportunity to thank ASUS for providing the ability to unlock the Transformer Prime and to further state that DRM is not compromised since the DRM keys have already been erased from the device during the unlock process and our work can only be used on an unlocked device.

 

and a Mirror to the files from dropbox:

 

https://www.dropbox.com/s/0p6yv9plhuct8ve/cardhu_Tegra-Linux-R15.beta.1.0_armel.tbz2

https://www.dropbox.com/s/a7o7cc0kpj7q785/tf201_nvflash.tar.bz2

 

Zipping Multiple Directories

Just now I was trying to Zip multiple individual folders and couldn’t think on how to do when I came across this string

for f in *; do zip -9r “$f.zip” “$f”; done

This worked wonders but for me I was making comic book archives so I modified it as such

for f in *; do zip -9r “$f.cbz” “$f”; done

 

Worked like a charm

Cron’d Back up!

Well this Weeks mini project was to get a automated backup of all my Virtual machines on my KVM host, the first hurdle was to shut down the running VMs this is completed by executing virsh shutdown x where x is the domain number of the VM, I normally never have more then five machines running so I started the script with

 

#!/bin/bash

virsh shutdown 1

virsh shutdown 2

virsh shutdown 3

virsh shutdown 4

virsh shutdown 5

 

after this the VMs shutdown now I figured Compression would be key as most of these VMs have forty gigabyte hard drives if not bigger but normally only use about half.

 

Originally I started with tar.bz2 with the following command

sudo tar jcvf VM-Backup.tar.bz2 dir_1 dir_2

Sadly this took forever!! upon a little research it was due to the fact that bzip2 isn’t SMP compliant otherwise known as using multiple cores or CPUs

so next I tried Gzip with this command

sudo tar zcf VM-Backup.tar.gz dir_1 dir_2

To the same effect so I started to invest time in google until i found a SMP compatible BZIP2 here: http://compression.ca/pbzip2/ and was finally happy with the results with this command

sudo tar cfv VM-Backup.tar.bz2 –use-compress-prog=pbzip2 dir_1 dir_2

This used all cores available and maxed them during compression, for being a quad core system it cut the compression time roughly down to a third of what it was.

Now that things are starting to look up I decided I wanted to Log when the script ran and tag the output files with the date and time of Backup this was done by making a Variable for date

DATE=$(date +%m%d%Y-%H%M)

at this point what ever you put $DATE in it will output MMDDYYYY-HHmm so I wrote a few echo lines like this one

echo “Nightly Backup Started for $DATE” > /location/of/log

After all was said and done it was brought to my attention a question, “How do you check your backups for data integrity?” so I tagged on the end of all the compression scripts an md5 hash output

&& md5sum * > VM-Backup-$DATE.MD5 

you may notice the $DATE again I wanted to make sure the same MD5 matched the Backup file, I then thought about the space this is going to take up and figured one backup being kept is good enough to each time this script is ran it changes directory into the back up directory and deletes all files with

cd /location/of/backup/

rm *

and finished off with a reboot as I plan to run this weekly, this is my finished script changed for system anonymity

#!/bin/bash

DATE=$(date +%m%d%Y-%H%M)

#echo $DATE

echo “Nightly Backup Started for $DATE” > /location/of/log

cd /location/of/backup/

rm *

virsh shutdown 1
virsh shutdown 2
virsh shutdown 3
virsh shutdown 4
virsh shutdown 5

#sudo tar jcvf VM-Backup-$DATE.tar.bz2 dir1 dir2 && md5sum * > VM-Backup-$DATE.MD5

#sudo tar zcf VM-Backup-$DATE.tar.gz dir1 dir2 && md5sum * > VM-Backup-$DATE.MD5

sudo tar cfv VM-Backup-$DATE.tar.bz2 –use-compress-prog=pbzip2 dir1 dir2 && md5sum * > VM-Backup-$DATE.MD5

DATETWO=$(date +%m%d%Y-%H%M)

echo “Nightly Backup Complete for $DATETWO” > /location/of/log

 

sudo reboot

 

 

Enjoy and leave me tips if you have suggestions or kudos