DIR-300 revA flashing user experience (write up)

Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Forum Index -> Atheros WiSOC based Hardware
Author Message
dir300dude
DD-WRT Novice


Joined: 22 Aug 2021
Posts: 1

PostPosted: Sun Aug 22, 2021 20:08    Post subject: DIR-300 revA flashing user experience (write up) Reply with quote
wow even the journey to register here was adventurous (wiki seems disabled , great choice! Rolling Eyes )

-----
TL:DR;
BOON/NOOB - DDWRT flashing experience write-up
- my setup
- what can be found Question
- what you actually need (walk through)Exclamation
- including what can be done wrong Sad and how to fix it Idea
- my recommendation! Arrow
- open Questions Question

-----------------------------


My Setup

- got 2 DIR-300 rev A spare
- have always wanted to try flash openwrt
- I use Ubuntu
- 6 hours!


what can be found

when you first look for DIR 300 and openwrt you tend to find some pages that seem long but reassuring!
then you become less certain when you go down the rabbit-hole especially when heading over to ddwrt!
I have compiled a list of pages that I found maybe can be helpful ... consider it a FAQ

WRT
- https://openwrt.org/toh/d-link/dir-300
- originally I hit https://oldwiki.archive.openwrt.org/toh/d-link/dir-300
- https://wiki.dd-wrt.com/wiki/index.php/D-Link_DIR-300_rev_A
- https://wiki.dd-wrt.com/wiki/index.php/Index:FAQ#Where_do_I_download_firmware.3F
- https://wiki.dd-wrt.com/wiki/index.php/Micro_Redboot#Redboot.ram

RedBoot
- https://openwrt.org/docs/techref/bootloader/redboot
- http://ecos.sourceware.org/docs-latest/redboot/persistent-state-flash.html

some more readables
- https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=45120
- https://forum.dd-wrt.com/forum/viewtopic.php?t=53967
- https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=39290
- http://networksorcery.com/enp/protocol/bootp.htm
- http://support.garz-fricke.com/products/Cupid/RedBoot/Documentation/GF_RedBoot_User_Manual_V.0.7.pdf
- https://openwrt.org/toh/netgear/fvx538/redboot#fconfig_-l



⬆️⬆️⬆️ yes you should READ it before attempting! ⬆️⬆️⬆️⬆️⬆️

---

what you actually will need!

this is based on https://openwrt.org/toh/d-link/dir-300#with_manual_step_by_step_guide
It is good from the point where you set the IP till the point where you have to flash the actual Firmware!.

Preparations

TFTP
- install TFTP server but disable it for real though for security reasons! (with systemctl disable tftpd-hpa.service )
Code:

$> sudo apt install tftpd-hpa
$> man in.tftpd


Download
ftp://ftp.dd-wrt.com/v24-sp1/Consumer/Dlink/DIR-300/
put the files into local directory e.g. ./dir300/DIR-300-WRTV2.4-SP1/

-----

Walk-through

connect Ethernet to WAN port of Router and configure your interface to use the 192.168.20.80 (mask 255.255.255.0)

run the tftp server on your own terms
Code:

> sudo /usr/sbin/in.tftpd -u $USER -a :69 -4pLs ./dir300/DIR-300-WRTV2.4-SP1/



configure `~/.telnetrc` to contain the lines

Code:

  192.168.1.1  mode line
  192.168.20.81  mode line


--

in a different shell

Code:

> arping -f 192.168.20.81 -I eth0 ; telnet 192.168.20.81 9000


reconnect power to the device and wait for "Executing boot script in 0.xxx seconds - enter ^C to abort"
be fast but not too fast and press ctrl + C

Code:

Trying 192.168.20.81...
Connected to 192.168.20.81.
Escape character is '^]'.
== Executing boot script in 0.400 seconds - enter ^C to abort
^C^C
RedBoot> load ap61.ram
Using default protocol (TFTP)
Entry point: 0x800410bc, address range: 0x80041000-0x800680d8
RedBoot> go ^]
telnet> quit
Connection closed.


reconfigure ethernet to be 192.168.1.2

Code:

> arping -f 192.168.1.1 -I eth0 ; telnet 192.168.1.1 9000


flash redboot ap61.rom

Code:

DD-WRT> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x80ff0000-0x81000000 at 0xbffe0000: .
DD-WRT> ip_address -h 192.168.1.2
IP: 192.168.1.1/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.1.2
DD-WRT> load -r -b %{FREEMEMLO} ap61.rom
Using default protocol (TFTP)
Raw file loaded 0x80080000-0x800a8717, assumed entry at 0x80080000
DD-WRT> fis create -l 0x30000 -e 0xbfc00000 RedBoot
An image named 'RedBoot' exists - continue (y/n)? y
... Erase from 0xbfc00000-0xbfc30000: ...
... Program from 0x80080000-0x800a8718 at 0xbfc00000: ...
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x80ff0000-0x81000000 at 0xbffe0000: .
DD-WRT> fconfig bootp false
bootp: Setting to false
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x80ff0000-0x81000000 at 0xbffe0000: .
DD-WRT> reset
telnet> quit


flash linux.bin

from this point it is important NOT to use %{FREEMEMLO} but 0x80041000 as provided in the ./dir300/DIR-300-WRTV2.4-SP1/flashing.txt
(at least that was what supposedly was one caveat eating 2 hours of mine )

Code:

DD-WRT> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x80ff0000-0x81000000 at 0xbffe0000: .
DD-WRT> ip_address -h 192.168.1.2
IP: 192.168.1.1/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.1.2
DD-WRT> load -r -b 0x80041000 linux.bin
Using default protocol (TFTP)
Raw file loaded 0x80041000-0x803bafff, assumed entry at 0x80041000
DD-WRT> fis create linux
... Erase from 0xbfc30000-0xbffaa000: ........................................................
... Program from 0x80041000-0x803bb000 at 0xbfc30000: ........................................................
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x80ff0000-0x81000000 at 0xbffe0000: .
DD-WRT> fconfig boot_script true
boot_script: Setting to true
DD-WRT> fconfig boot_script_timeout 4
boot_script_timeout: Setting to 4
DD-WRT> fconfig
Run script at boot: true
Boot script:
Enter script, terminate with empty line
>> fis load -l linux
>> exec
>>
Boot script timeout (1000ms resolution): 5
Use BOOTP for network configuration: false
Gateway IP address: 0.0.0.0
Local IP address: 192.168.1.1
Local IP address mask: 255.255.255.0
Default server IP address: 192.168.1.2
Console baud rate: 9600
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x80ff0000-0x81000000 at 0xbffe0000: .
DD-WRT> reset


switch over from wan to lan and wait
and navigate to http://192.168.1.1/

what can be done wrong Sad and how to fix it Idea


- not waiting long enough in fis create or load commands
- not using fconfig -n -f -d but just fconfig (see - http://ecos.sourceware.org/docs-latest/redboot/persistent-state-flash.html )
- not knowing what the "nickname" codes are for fconfig (see - https://openwrt.org/docs/techref/bootloader/redboot)


my recommendations

if you have time to kill, have a spare and want to cast a few swear words go for it ...
else stick with the original firmware!



Open Questions

- why reflash redboot? there is a redboot in place before why flash new one?
- where to find the proper smaller redboot is the ap61 allready that version?
- how to properly make a backup of the old firmware and how to flash it back
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 12620
Location: Texas, USA

PostPosted: Sun Aug 22, 2021 21:22    Post subject: Reply with quote
Thanks for letting us know that you know how to STFW and RTFM. The wiki has been updated to include locations of where to get the files from the original write-up as well as a link to this thread; I didn't back-track to see if the information was previously there, but if it was and it was removed, that was a no-no. Wiki edit access is not the same login as the forum, and registering for access is disabled because there are enough hands in the pot and also to prevent compromise and spam. If anyone reading wants to answer the open questions (which are probably already answered somewhere else), PM me.
_________________
Official Forum Rules, Guidelines & Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware‽
DON'T use Chromium-based browsersRTFM/STFW TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is‽
Please DO NOT PM me with questions; Ask in the forum. ---------------------- Linux User #377467 counter.li.org / linuxcounter.net
Display posts from previous:    Page 1 of 1
Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum