Reset auto boot flag in Bootloader using iRecovery

I was using a iPhone 3G (jailbroken) and recently it got struck with showing iTunes + Cable Icon to do the restore.
I had used iRecovery under Ubuntu 14.04 and enter into interactive shell using -s option and use the below sequence to get out the recovery mode.
$ sudo irecovery -s

setenv auto-boot true
saveenv
reboot

(Ref: http://linuxsleuthing.blogspot.in/2013/09/iphone-recovering-from-recovery.html)

But now the device got struck in apple logo forever.

How to restore the auto-boot flag in boot loader so that it can move to the restore mode from which I can use iTunes or similar Tools to restore the firmware.

Any reference to tools/suggestions appreciated.

PS: I was going thro’ your Open Source iOS Reverse Engineering Book and it was very easy to understand. (I will update my feedback/comments once I had finished reading it).

Why don’t you manually enter DFU mode and restore the firmware?

Thanks snakeninny for the response.
I tried to put the device in DFU Mode (by using the Power & Home Button Sequences) but it is not working. The Device is not shown in ‘lsusb’ listing (seems it is not moving to DFU mode properly).

Any method to restore the boot loader flags so that it can move to restore mode for firmware update.

I’d suggest you try to enter DFU mode first. If there’s any problem on the way, google and fix it

I could able to reset the auto-boot flag using irecovery and now the device moves to Recovery mode. When I connect to the device using irecovery -s it shows as below

=======================================
::
:: iBoot for n82ap, Copyright 2010, Apple Inc.
::
:: BUILD_TAG: iBoot-931.71.16
::
:: BUILD_STYLE: RELEASE
:: USB_SERIAL_NUMBER: CPID:XXXX CPRV:XX CPFM:XX SCEP:XX BDID:XX ECID:XXXXXXXXXXXXXX IBFL:XX SRNM:[XXXXXXXXXXX]
::

[NAND] Device ID 0xXXXXXXXX
[NAND] BANKS_TOTAL 4
[NAND] BLOCKS_PER_BANK 8192
[NAND] PAGES_PER_BANK 1048576
[NAND] SECTORS_PER_PAGE 8
[NND] BYTES_PER_SPARE 128
[FTL:MSG] Apple NAND Driver (AND) RO
[FTL:MSG] FIL_Init [OK]
[FTL:MSG] BUF_Init [OK]
[FTL:MSG] FPart Init [OK]
read old style signature 0x43303035 (line:403)
[FTL:MSG] VFL Register [OK]
[FTL:MSG] VFL Init [OK]
[FTL:MSG] VFL_Open [OK]
[FTL:MSG] FTL Register [OK]
[FTL:WRN] Failure running _LoadFTLCxt!
[FTL:WRN] Recovering NAND Data Structures - this will take some time!
[FTL:WRN] _FTLRestore OK!
[FL:MSG] FTL_Open [OK]
Boot Failure Count: 0 Panic Fail Count: 11
image validation failed but untrusted images are permitted
Entering recovery mode, starting command prompt

PS: Masked the device specific info as (XXXXX)

Using idevicerestore could not able to restore the firmware to ios 4.2.1
iTunes is also having the same issue.

Any clues on how to get out of the recovery mode and boot the device in normal mode.
It seems the device image verification failed as per the above irecovery log message.

What happens if you press and hold home and lock buttons at the same time?