can't access tty

Follow up on my earlier post, about the error during recovery and update processes.

/bin/sh: can't access tty: job control turned off

The source of this error is incorrect init file from the recovery partition.

Just to remind you that the partition table of Toshiba AC100-118 has 13 partitions:

  1. Partition 2 - BCT - boot config table
  2. Partition 3 - PT - partition table
  3. Partition 4 - EBT - bootloader
  4. Partition 5 - SOS - recovery partition
  5. Partition 6 - LNX - linux system
  6. Partition 7 - MBR - master boot record
  7. Partition 8 - APP - applications (/system)
  8. Partition 9 - CAC - cache (/cache)
  9. Partition 10 - MSC - miscellaneous (/misc)
  10. Partition 11 - EM1 - partition table
  11. Partition 12 - UDA - user data (/data)
  12. Partition 13 - EM2 - partition table
  13. Partition 14 - UDB - user storage (/storage)

In very few words, I'll try to explain how to fix it. I assume you already know what is nvflash utility and how to work with it.

Backup

First of all we start from the backup. We are going to change the recovery partition, so it is the one we are going to save, but I strongly recommend to save ALL partitions.

LD_LIBRARY_PATH=. ./nvflash --bl ../prebuilt/fastboot.stock.bin --go
LD_LIBRARY_PATH=. ./nvflash -r --getpartitiontable partitiontable.txt
LD_LIBRARY_PATH=. ./nvflash -r --read 5 part-5.img

Copy the Image

Copy part-5.img file you downloaded to any folder far away from your backup, and work only there.

Unpacking

The unpack_bootimg tool was written by Phh. The compiled version can be found on my site.

./unpack_bootimg part-5.img
mkdir ramdisk
zcat initrd.img | ( cd ramdisk; cpio -i )

Editing

Make changes in the init file, located under ramdisk folder. Change the following line:

for dev in mmcblk1p1 mmcblk1p2 mmcblk1p3 sda1 sda2 sda3:do

to be

for dev in mmcblk0p1 mmcblk0p2 mmcblk0p3 sda1 sda2 sda3:do

Re-Packing the images

The make_bootimg tool was written by Phh, and mkbootfs was taken from the Android SDK source. The compiled versions can be found on my site. The command line of the make_bootimg tool must be according to the model you are using.

cd ..
mkbootfs ./ramdisk | gzip > ramdisk-new.img
./make_bootimg part-5.img zImage ramdisk-new.img -c 'mem=448M@0M nvmem=64M@448M 
vmalloc=320M video=tegrafb console=tty0 usbcore.old_scheme_first=1 quiet splash
tegraboot=sdmmc tegrapart=recovery:300:a00:800,boot:d00:1000:800,mbr:1d00:200:800'

Restore the partition

Use [StartSector], [NumSectors] from the partitiontable.txt you saved at the backup stage.

LD_LIBRARY_PATH=. ./nvflash --bl fastboot.bin --go
LD_LIBRARY_PATH=. ./nvflash -r --rawdevicewrite [StartSector] [NumSectors] part-[PartitionId].img
LD_LIBRARY_PATH=. ./nvflash -r --rawdevicewrite [StartSector] [NumSectors] part-2.img