Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
toh:d-link:dir-300 [2019/11/05 17:09] – [First Time Installation...] original flash layout sefralgontoh:d-link:dir-300 [2019/11/23 05:46] – [Original Firmware flash layout] sefralgon
Line 47: Line 47:
 ^ Layer0    raw flash, **mtd0** and **mtd7**, 4096 KiB  ||||||| ^ Layer0    raw flash, **mtd0** and **mtd7**, 4096 KiB  |||||||
 ^ Layer1    **mtd4** \\ ''RedBoot'' \\ 128 KiB  |  **mtd2** \\ ''upgrade'' \\ 3776 KiB  |||||  **mtd6** \\ ''LangPack'' \\ 64 KiB  |  **mtd3** \\ ''rgdb'' \\ 64 KiB  |  **mtd5** \\ ''Board/RadioCfg'' \\ 64 KiB  | ^ Layer1    **mtd4** \\ ''RedBoot'' \\ 128 KiB  |  **mtd2** \\ ''upgrade'' \\ 3776 KiB  |||||  **mtd6** \\ ''LangPack'' \\ 64 KiB  |  **mtd3** \\ ''rgdb'' \\ 64 KiB  |  **mtd5** \\ ''Board/RadioCfg'' \\ 64 KiB  |
-^ Layer2   |::: **No device** \\ ''kernel'' \\ 512 KiB  |  PackImg \\ header \\ 32B  |  **mtd1** \\ ''rootfs'' \\ 1848 KiB  |  empty \\ space \\ 8160B  | **No device** \\ ''rw data'' \\ 1408 KiB |:::|:::|:::|+^ Layer2   |::: **No device** \\ ''kernel'' \\ 512 KiB  |  PackImg \\ header \\ 32B  |  **mtd1** \\ ''rootfs'' \\ 1848 KiB  |  empty \\ space \\ 8160B  | **No device** \\ ''data'' \\ 1408 KiB |:::|:::|:::|
  
 When original firmware is flashed onto the router, first 96B are stripped, since it's a header of some kind. The rest of it is written directly to ''upgrade'' partition. Knowing this allows restoring original firmware from an alternative firmware, such as OpenWrt. A command such as ''tail -c +97 dir300a.bin > upgrade.bin'' allows to prepare file suitable for writing directly onto mtd partition. When original firmware is flashed onto the router, first 96B are stripped, since it's a header of some kind. The rest of it is written directly to ''upgrade'' partition. Knowing this allows restoring original firmware from an alternative firmware, such as OpenWrt. A command such as ''tail -c +97 dir300a.bin > upgrade.bin'' allows to prepare file suitable for writing directly onto mtd partition.
 +
 +The data on the end of upgrade partition is likely remaining from past installation of some alt firmware and not used for anything.
 +
 ==== Flash Layout ==== ==== Flash Layout ====
 First let's have a quick view at the [[docs:techref:flash.layout|Flash Layout]] with the stock firmware and once OpenWrt has been installed onto the device. This helper understanding what mtd/sysupgrade does.\\ First let's have a quick view at the [[docs:techref:flash.layout|Flash Layout]] with the stock firmware and once OpenWrt has been installed onto the device. This helper understanding what mtd/sysupgrade does.\\
  • Last modified: 2024/02/12 08:58
  • by 127.0.0.1