Welcome! Log In Create A New Profile

Advanced

Rescue System

Posted by Jeff 
Rescue System
August 26, 2012 11:19AM
I've updated the rescue system to 1.3 with support for the framebuffer console. This should give you a graphical shell when you boot your device. By default the display is on your devices' primary display (lcd or hdmi) but you can override the output by editing /rescue/init-display.sh

This is a bootable image for the A10 systems. When this image is written to an empty flash card, it will use the first 32MB of the card for uBoot and a 31MB FAT32 partition (I'll refer to this as the sysconfig partition). The sysconfig partition contains the uboot environment and a /rescue directory containing a basic system.bin file, boot images, autorun scripts, and network configuration files for the rescue system. The included uBoot is configured to boot both the rescue system and any other systems that can be found on the SD card. This way, you can use the remaining space on the SD card for a larger linux installation.


Installing the rescue system
wget http://download.doozan.com/a10/a10_base-1.3.zip
unzip a10_base-1.3.zip
insert flash drive
dmesg
find drive id (sdb, in my case, using a USB SD card reader)
double check that it's the drive you're expecting to be:
fdisk -l /dev/sdb

Disk /dev/sdb: 7948 MB, 7948206080 bytes
245 heads, 62 sectors/track, 1021 cylinders
Units = cylinders of 15190 * 512 = 7777280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x5d02e879

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1021     7754464    b  W95 FAT32

Yup, that's my 8GB SD card. I've copied everything I need off of it, which is good because the following dd command is going to wipe out the partition table:

dd if=a10_base-1.3.img of=/dev/sdb bs=4096

fdisk -lu /dev/sdb

Disk /dev/sdb: 7948 MB, 7948206080 bytes
245 heads, 62 sectors/track, 1021 cylinders
Units = cylinders of 15190 * 512 = 7777280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x5d02e879

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048       63489       30721    b  W95 FAT32


alternatively, you can write the image using Windows with this program, making sure that you unzip the file first:
https://launchpad.net/win32-image-writer

Configuring the rescue system

If you're using a device with a wired network port, make sure it's attached to your network. No other configuration is needed.

If you're using a device without a wired network port, you'll need to configure the rescue system so it can connect to your wireless network. On the sysconfig partition, inside /rescue, you'll find two files named 'interfaces' and 'wpa_supplicant.conf' Depending on the type of security used on your wireless network, you will need to edit one or both of these files.

No matter what security you're using, you need to edit 'interfaces' so open that in your favorite editor (Windows users, make sure you're using an editor that respects UNIX line endings, such as Notepad2). Uncomment the two lines starting with "auto wlan0" and "iface wlan0" and then uncomment the section that corresponds with your security. If you're using Open or WEP encryption, you're done. If you're using WPA or WPA2, you'll also need to edit 'wpa_supplicant.conf'


Using the rescue system

On boot, the rescue system will search for and run any files matching the pattern init-*.sh and autorun-*.sh. It will also extract any files matching the pattern init-*.tgz and autorun-*.tgz and then run the extracted autorun.sh script. Init scripts are run just after the partitions have been mounted but before any network initialization. Autorun scipts run after everything has settled down. You can use this to write hooks to automate recovery or installation procedures.

The default rescue system comes with three init scripts:

init-extract-system-bin.sh - This script will attempt to extract the hardware configuration file from the android nand and patch it with the MAC address extracted from the android uboot environment.
init-modules.sh - This script will parse the system.bin file. If your device's system.bin lists an ethernet port, the module wil l be loaded. If no ethernet port is detected, the 8192cu wireless module will be loaded.
init-display.sh - You can override the default display device here if you've using a VGA or TV display.

There is also one default autorun script:
autorun-deviceinfo.sh - This script will dump some helpful system debugging information to /log/deviceinfo.log on the sysconfig partition. If you're running a device that is not fully supported by the rescue system, this file can help us to add support for your system.

On boot, the rescue system will fill the default display (HDMI or LCD, depending on your device) with a light blue/grey color to show that it's "on" Until the fbcon module is fixed, there's not way to use the default display as a terminal, so you'll need to use SSH to connect to the rescue system.

Let's try it out
Turn off your system, insert the SD card and boot it up. If it boots into android, you may need to power-cycle again. I find that my mele a2000 alternates between booting from NAND and MMC with each power cycle.

Now that the device has booted, you'll need to find its IP address (check your router's DHCP log). Once you've got the ip, go ahead and connect with SSH:

ssh root@192.168.0.2 (use the ip address that you found here)

the root password is 'root'

[root@rescue ~]# uname -a
Linux rescue 3.0.36 #1 PREEMPT Fri Aug 3 22:30:56 EDT 2012 armv7l GNU/Linux

It works! You're in! This is a simple linux environment with just enough tools to help you restore or recover a broken system. It can also be used as a sane environment for installing your favorite linux distribution. See the Debian install post for more details.

Additional init/autorun scripts are available in the a10-rescue-scripts repo.



Edited 1 time(s). Last edit at 08/26/2012 11:20AM by Jeff.
Building the Rescue System
August 26, 2012 11:20AM
I've added some scripts to make building the image easier.

cd ~/src
wget http://buildroot.uclibc.org/downloads/buildroot-2012.05.tar.gz
tar -xzvf buildroot-2012.05.tar.gz
cd buildroot-2012.05
git clone https://github.com/doozan/a10-rescue.git custom
cd custom
git checkout v1.3
cd ..
cp custom/buildroot-config .config
make

sudo custom/make_image.sh
Re: Rescue System
August 26, 2012 04:07PM
Nice to hear fbcon works now.
Andrew
Re: Rescue System
August 26, 2012 05:39PM
Well done, Jeff! I am going to try it out and report on how it goes. This is definitely a "must have" tool for A10 hackers!
Re: Rescue System
August 29, 2012 12:22AM
There seems to be at least one inconsistency in the scripts.
The file custom/linux-kernel-v3.0.39-sun4i-config is inconsistent with the contents of custom/buildroot-config, which says v3.0.36

BR
Re: Rescue System
August 29, 2012 07:34AM
Thanks for catching that, I've updated the repo with the correct config.
Dave
Re: Rescue System
October 20, 2012 11:15AM
I've successfully installed this on a MK802 II with 1GB RAM but the log only shows 512MB. I know I have 1GB as shown when I boot in Android. Is there something I need to change anywhere in order to use the entire 1GB RAM? Thanks.
Re: Rescue System
October 29, 2012 05:34PM
Dave Wrote:
-------------------------------------------------------
> I've successfully installed this on a MK802 II
> with 1GB RAM but the log only shows 512MB. I know
> I have 1GB as shown when I boot in Android. Is
> there something I need to change anywhere in order
> to use the entire 1GB RAM? Thanks.

The same issue here. I wish mele masters consider kindly poor MK802 owners too :) . I know it is additinal work for you and eveybody is busy but we appreciate it very much.
abifar



Edited 1 time(s). Last edit at 10/29/2012 05:35PM by abifar.
Re: Rescue System
October 30, 2012 04:28PM
Does this work with MK802 devices? I wrote it to an SD card, but the device keeps booting Android off the internal storage instead of booting off the SD card.

~Jeff
Re: Rescue System
December 14, 2012 08:45PM
I'm installing rescue system on an MK802 II stick (1GB version) for a friend, and could not boot this rescue image to the point where the dhcp request sent to the router (The router never received it). Looks like it did not boot into Android (blank screen on HDMI TV), but got stuck somewhere!

What do you guys think? how do I troubleshoot this other than opening it up and see if I can hook up serial console?

Addendum:

I've looked at the partition, it seems that the MK802 did not even try to boot the image at all (no log, and no changes in the timestamp of any files :-) Strange, what could be the reason? the image was created on a 8GB Sandisk microSD card in a SD adapter (on a Pogo V4 running Debian) and I followed Jeff's instruction to the letter. Perhaps somebody can spot my mistake below.
Thanks!

Image creation log:
root@PogoV4:/localdisk/a10# fdisk -l

Disk /dev/sda: 8004 MB, 8004304896 bytes
19 heads, 5 sectors/track, 164562 cylinders, total 15633408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xf43e6052

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    15632383     7815168   83  Linux

Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes
45 heads, 2 sectors/track, 172487 cylinders, total 15523840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x35e3e291

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            2048       63489       30721    b  W95 FAT32

root@PogoV4:/localdisk/a10# dd if=a10_base-1.3.img of=/dev/mmcblk0 bs=4096
8192+0 records in
8192+0 records out
33554432 bytes (34 MB) copied, 5.85533 s, 5.7 MB/s

root@PogoV4:/localdisk/a10# fdisk -lu /dev/mmcblk0

Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes
45 heads, 2 sectors/track, 172487 cylinders, total 15523840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x35e3e291

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            2048       63489       30721    b  W95 FAT32

cat /rescue/interfaces
# Configure Loopback
auto lo
iface lo inet loopback

#auto eth0
#iface eth0 inet dhcp

# Uncomment and adjust for your own wifi settings
auto wlan0
iface wlan0 inet dhcp
#
#  WPA/WPA2 security, uncomment the next two lines and then edit wpa_supplicant.conf
pre-up wpa_supplicant -B -Dwext -i wlan0 -c/etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant
#
#  WEP security, uncomment and edit the next three lines
#wireless-mode managed
#wireless-essid mynetworkname
#wireless-key mywepkey
#
#  Open or no security, uncomment and edit the next two lines
#wireless-mode managed
#wireless-essid mynetworkname

cat /rescue/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
# Uncomment the following lines if you're using WPA supplicant
network={
  ssid="tldn"
  psk=my_password_with_no_quote_here
}



Edited 1 time(s). Last edit at 12/15/2012 12:33AM by bodhi.
Re: Rescue System
December 17, 2012 02:40AM
I've tried this Lubuntu 12.04 and it works great, booting into the LXDE desktop. So all is well, but wonder why the rescue system did not work?
Re: Rescue System
January 11, 2013 12:14AM
Hi,

nice work !

unfortunalty, notthing happen when booting on my Eken T01a. It's a erase nand tabled i'd like to reflash, and the rescue was a chance for me .
Re: Rescue System
January 12, 2013 01:04AM
Try this: http://forum.doozan.com/read.php?6,9718,9730
(Unfortunately all a10linux.org links are dead.)

------------------------------------------------------------
My A10 tablet (Point Of View [NL] ProTab2XXL 10" ICS)
Re: Rescue System
January 13, 2013 09:52AM
äxl, thanks.

As soon as i have a debug console view, i'll probably be more informed in what's wrong @boot

Maybe tomorrow.
Re: Rescue System
January 15, 2013 04:52PM
Since i have a console on my Eken T01, i can only see a reset board error while booting from SD

U-Boot SPL 2011.09-00002-g8d13bc8-dirty (Jul 21 2012 - 21:22:26)
MMC:   SUNXI SD/MMC: 0
Loading U-Boot...   
### ERROR ### Please RESET the board ###

I have tried some uboot mmc with no success..
Re: Rescue System
January 16, 2013 04:24PM
Quote
dagoo
I have tried some uboot mmc with no success..

Which ones? Have you tried from hno? https://github.com/hno/uboot-allwinner

If here's some moderator - dagoo's concerns should really be split into another thread please.

------------------------------------------------------------
My A10 tablet (Point Of View [NL] ProTab2XXL 10" ICS)



Edited 1 time(s). Last edit at 01/16/2013 04:25PM by äxl.
Re: Rescue System
January 17, 2013 11:39AM
Quote

If here's some moderator - dagoo's concerns should really be split into another thread please.

dagoo has made a good thread here for Eken T-01 serial port at the end of the A10 specs thread. That should be split off and his posts here added to it.

Jeff - could you please split off that section of the thread to a new topic, and add his posts here to it? It would not take much effort and would certainly help others who have that device. The information is not anywhere else on the web.
Rescue System - Protab 2 IPS
January 23, 2013 08:05AM
Hi All,

I have tried some sdcard images on a Protab2 IPS9 without success and focused finally on this rescue image as it is the most defined one.

The effect is, that after this or any other image i tried, i simply got a locked-up device. More precisely, the LCD remains blank. So does the HDMI. I do not receive a wifi connection, nor is a /log directory created on the sdcard as it should by autorun-deviceinfo.sh.

My conclusion is, that booting has failed altogether in some early stage. Something is happening though, as i have to reset the device before i can boot using the nand again.

My question is how to proceed best.

I do not dare to modify the nand, as the manufacturer provides only an old image version which might have defects and the LiveSuite appears not to be useful for hand-crafted patches. Additionally, the device has now screws or any other apparent way to open it, so i cannot access any the serial port pins perhaps inside. This leaves me in a situation, where i have only go/nogo tests with sdcard images, which failed so far. It is quite strange, since another tablet of the serie, Protab2 XXL apparently boots virtually all images one throws at it.

My hope is, that any of the device hackers here might have an idea, be it either technically or be it a reference to a better suited mail-list or forum.

Kind regards
Allwinner
Re: Rescue System
January 23, 2013 10:05AM
I've a 910i mediacom. I got black LCD & HDMI too.

No console avalaible to monitor the boot process.

I've a problem though, with the img flashing;

i've dd'ed the .img from jeff to a sd card, successfully.

When i try to mount it (mount -t auto /dev/sdb1 /media/sdcard) i have this error:

invalid media value (0x31)

(regardless the "-t auto" presence)


anyone's got an idea?
Re: Rescue System
January 23, 2013 11:11AM
This is a media, download or dd error.

$ md5sum a10*
1fec0663cd0f18fb38f88fa859e794d9 a10_base-1.3.img
d53eae8f3e6a7a02a48070efa72b194d a10_base-1.3.zip

The image contains a single vfat partition which should be mountable whenever download and dd was successful.
Re: Rescue System
January 23, 2013 11:26AM
@cobalt: Please create a new thread since you have a general problem with your tablet.

Since I didn't have much trouble to boot from SD I can't help you much. Especially if you can't really fiddle with NAND.
I once read that you sometimes may have to power cycle, even with power supply attached ...

These seem to want money for services: http://upgrade-android.com/
But they have already given commits to configs and u-boot:
https://github.com/linux-sunxi/sunxi-boards/pull/5
https://github.com/linux-sunxi/u-boot-sunxi/pull/23

If nothing helps make a backup of apps, private files and all NAND. Maybe you can reassemble a LiveSuit image:
https://www.miniand.com/wiki/Allwinner/Unpacking+and+building+LiveSuit+images
http://linux-sunxi.org/LiveSuit_images

EDIT: What do you mean by the LCD stays blank? Does it turn on i.e. backlight?
I've bought a USB to Ethernet adapter. Maybe your tablet could connect through something like that easier than wireless ...

------------------------------------------------------------
My A10 tablet (Point Of View [NL] ProTab2XXL 10" ICS)



Edited 1 time(s). Last edit at 01/23/2013 12:02PM by äxl.
Re: Rescue System
January 23, 2013 12:50PM
@ äxl:

He is trying to use the rescue image. His post is relevant to the thread and does not need to be separated. Cobalt is saying that he has no LCD output when booting from SD using the rescue image. That is very common and usually due to a bad script.bin or an improperly written SD card. You've been around here long enough that you know that already and likely just did not think about it before your post. Using the wifi is fine. He just needs to get it set up correctly. They are not discussing booting from NAND and likely do not want to attempt to go there, at least not yet.

@Cobalt & Allwinner

According to [http://linux-sunxi.org/Point_Of_View_ProTab2_XXL]linux-sunxi[/url] Protab works fine. So you are doing something wrong. Recheck everything. If you can't mount the SD it is not written correctly. The first partition on the rescue image is vfat and that is what you should be trying to mount.
Rescue System - Protab 2 IPS9
January 23, 2013 05:20PM
As äxl pointed out, some support for the Protab2 IPS9 has been added to linux-sunxi, lately by Ithamar, among which i found this patch, which relates to the dram parameters of uboot.

I'm not deep enough into uboot internals to judge whether this may or may not explain my bad fortune with this and other images. Perhaps something is really different with my particular device, meaning that the rescue system is simply a few days too old. I'll try to get a word from Ithamar about it...
Re: Rescue System
January 24, 2013 04:45AM
I also have a mediacom allwinner with the same problem. One solution may be to use berryboot a10 BerryBoot - bootloader / OS installer for Allwinner A10 devices. On my tablet works.



Edited 1 time(s). Last edit at 01/24/2013 04:46AM by pippo60gd.
Rescue System - Protab 2 IPS9 (V1.0)
January 24, 2013 05:35AM
To close the thread on the above topic, i write to report, that eventually, i got the device booted using this rescue system. The problem was, that this particular device needed a specially crafted uboot/spl. The difference were the particular parameters for the dram. They differed even from the ones the device in Ithamar's hands. There are more but one version of the tablet out in the wild, mine is a V1.0.

Since i was basically put back to go/nogo testing with virtually no indication whatever, i like to emphasize that using this particular rescue system was extremely helpful. First of all, it is very small, thus i got a fast turn-around. Second, its functionality is precisely what was needed. Even before configuring the WLAN, both the /log and the console-display indicated proper boot.

Jeff, thanks a lot for making this image.



Edited 2 time(s). Last edit at 03/30/2013 07:05AM by cobalt.
Nargajuna
Re: Rescue System
March 10, 2013 12:56PM
Can someone compile a Uboot version with "#define CONFIG_SPLASH_SCREEN" ( have a look at http://www.denx.de/wiki/DULG/UBootSplashScreen ) so i can see if my tablet is booting the sdcard or not?
Re: Rescue System
June 08, 2013 10:22PM
I put the rescur system on my MK802 ii. It booted fine. However, the wifi does not work. I noticed that the wifi chip inside is rtl8188eu. Can somebody let me know how to make the wifi with this chip work? Thanks.
Re: Rescue System
June 09, 2013 11:32AM
louigi600
Re: Rescue System
June 26, 2013 07:29AM
Is there any chance of the rescue system working on an A13b SOC.
Is the fbcon working ?

Regards
David
louigi600
Re: Rescue System
June 28, 2013 03:05AM
Quote

This is a bootable image for the A10 systems. When this image is written to an empty flash card, it will use the first 32MB of the card for uBoot and a 31MB FAT32 partition (I'll refer to this as the sysconfig partition).

Something is wrong with that statement: fdisk shows that the vfat partition start at sector 2048 ... and sector size is 512 bytes.
The vfat partition should then be offset 1Mb.
Is the uboot stuff 1Mb ?
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: