OpenWrt 的世界︰樹莓派 3B 【路由器】刷機

250px-Dschuang-Dsi-Schmetterlingstraum-Zhuangzi-Butterfly-Dream

莊子在《齊物論》中說了一個故事,問著人到底是可不可能分別『現實』與『夢境』︰

昔者莊周夢為胡蝶,栩栩然胡蝶也。自喻適志與!不知周也。
俄然覺,則蘧蘧然周也。不知周之夢為胡蝶與?胡蝶之夢為周與?周與胡蝶則必有分矣。
此之謂物化

René_Descartes

150px-Meditationes_de_prima_philosophia_-_Renatus_Cartesius

250px-Descartes_Discours_de_la_Methode

笛卡兒談談方法

Library_Walk_28

一五九六年三月三十一日生於法國安德爾‧羅亞爾省的圖賴訥拉海勒內‧笛卡兒 René Descartes 是法國大哲學家,也是著名的數學家、物理學家。他對現代數學的發展做出了劃時代的貢獻,尤其因將歐式幾何學『坐標系化』故為解析幾何之父。笛卡兒也是『心物二元論』者之主要代表,提出了『普遍懷疑』的主張,為西方現代哲學思想的奠基人,他的思想深深影響了其後的歐陸幾代人之久,開創了所謂『理性主義』的哲學。笛卡兒身後留下了一句名言︰『我思故我在』。

《談談方法》Discours de la méthode,全名是『談談正確引導理性在各門科學上尋找真理的方法』Discourse on the Method of Rightly Conducting One’s Reason and of Seeking Truth in the Sciences,是笛卡兒在一六三七年出版的著名哲學論著,他對西方人的思維方式、思想觀念以及科研方法都有著深刻的影響。在這本《談談方法》一書中,笛卡兒指出研究問題的方法可以分為四大步驟:

一、永 遠不要接受任何自己都不清楚的真理,要儘可能的避免著粗疏和偏見;只能接受根據自己的判斷後那些非常清晰和明確,絲毫沒有什麼應該再懷疑的真理。也就是說只要沒有經過自己切身驗證的問題,不管它是來自什麼權威的結論,也都大可以去懷疑的。

二、將想要研究的困難複雜之問題,盡量的分解成多個較小且簡單的問題,然後逐一的解決克服。

三、思考將這些分解的小問題從簡單到複雜排列,先從容易解決的問題下手。

四、等到將所有分解的小問題都解決之後,再綜合起來驗證,檢查答案是否有遺漏,是否已經把問題徹底完全的解決了。

─── 《桶中之腦??

 

莊子『化蝶』栩栩適志與? □ □ 『變磚』 bricked 豈不黯然神傷矣!

Brick (electronics)

The word “brick“, when used in reference to consumer electronics, describes an electronic device such as a mobile device, game console, or router that, due to severe physical damage, a serious misconfiguration, corruptedfirmware, or a hardware problem, can no longer function, hence, is as technologically useful as a brick.[1]

The term derives from the vaguely rectangular shape of many electronic devices (and their detachable power supplies) and the suggestion that the device can function only as a lifeless, square object, paperweight or doorstop.

This term is commonly used as a verb. For example, “I bricked my MP3 player when I tried to modify its firmware.” It can also be used as a noun, for example, “If it’s corrupted and you apply using fastboot, your device is a brick.”

In the common usage of the term, “bricking” suggests that the damage is so serious as to have rendered the device dead.[2]

Cause and prevention

Bricking a device is usually a result of interrupting an attempt to update the device. Many devices have an update procedure which must not be interrupted before completion; if interrupted by a power failure, user intervention, or any other reason, the existing firmware may be partially overwritten and unusable. The risk of corruption can be minimized by taking all possible precautions against interruption.

Installing firmware with errors, or for a different revision of the hardware, or installing firmware incompetently patched such as DVD firmware which only plays DVDs sold in a particular region, can also cause bricking.

Devices can also be bricked by malware (malicious software)[3] and sometimes by running software not intentionally harmful but with errors that cause damage.

Some devices include two copies of firmware, one active and the other stored in fixed ROM or writable non-volatile memory and not normally accessible to processes that could corrupt it, as well as a way to copy the stored firmware over the active version, even if corrupt, so that if the active firmware is damaged, it can be replaced by the copy and the device will not be bricked. Other devices have minimal “bootloader” firmware, enabled usually by operating a switch or jumper, which does not enable the device to work normally but can reload the main firmware.

A personal computer which uses Windows operating system can be bricked by a loss of power during the update process, or by installing a faulty device driver.

Types

Bricking is classified into two types, namely hard and soft, depending on the device’s ability to function.[1]

Hard brick

Hard bricked devices generally show little to no signs of life. A hard bricked device does not power on or show any vendor logo; in essence, the screen remains turned off. Some of the major reasons for hard bricking are installing firmware not made for the device, interrupted flashing procedure or following a flashing procedure incorrectly.

Some other reasons include flashing a root file for a different file or using wrong commands. Some kernel bugs[4] have been known that affect the /data partition in the eMMC chip, which gets corrupted during certain operations such as wiping and flashing.

Recovering from a hard brick is generally considered difficult and requires the use of a more direct programming interface to the controller; such an interface exists as there must be a way to program the initial firmware on an unprogrammed device. However, additional tools or connections may be needed.

Apart from that, there are different stages of a bricked device. There are different steps to resolve this issue and this includes: Analyzing the problem, also needs some changes on the PC, analyzing the process, and at which stage the hard brick device is. [5]

Soft brick

A “soft bricked” device may show signs of life, but boots unsuccessfully or may display an error screen. Soft bricked devices can usually be fixed; for example, a soft bricked iOS device may display a screen instructing the user to plug it into a computer to perform an operating system recovery using iTunes software.[6] In some cases, Soft bricked devices are unable to be repaired without physical repairs being carried out; an example of this would be an iOS device locked with iCloud Activation Lock, of which the only solution is to contact the owner of the iCloud account the device is locked to, or to replace the entire motherboard with a non-locked board.[citation needed]

 

想當年玩 OpenWrt 路由器,每每『刷機』都戒慎恐懼呦☻

OpenWrt Debricking Guide

When people say a router is bricked, this very generally means, that it does not function properly any longer and the reasons can be various. First of all, you should calm down, relax and read flash.layout, file systems in OpenWrt and bootloader CLI. Now depending on what exactly is broken, you have several possibilities:

  1. if only something on the JFFS2 partition is broken, you are still able to → boot into OpenWrt failsafe mode
  2. if the SquashFS partition or the Kernel is broken, you cannot boot into failsafe mode any longer. But you still have a functioning bootloader and so you should follow the same procedures as when you first →installed OpenWrt via bootloader.
  3. if the bootloader is broken, there are only two options left:
    1. access your hardware through the → JTAG Port, this should allow you to write to the flash. Restore the bootloader.
    2. or desolder the flash chip, connect it to some device, that does give you write access to it and restore the bootloader. You did perform a generic.backup, right?

……

Raspberry Pi

If you don’t have a USB serial ttl but have a Raspberry Pi, you can use it to connect to the router’s serial pins. The Raspberry Pi’s uart works at 3.3V which is the correct voltage for most routers. Connect the GND to GND, the RX to TX, and the TX to RX. Leave VCC (or 3.3V) unconnected (that is, in the end you will only be connecting 3 pins out of 4).

………

 

現今藉樹莓派談 OpenWrt 點滴,果然輕鬆不少︰

大不了『重燒』 SD 卡嘛☺

就讓我們用

【系統】【備份/升級韌體】

朝向

Index of (root) / releases / 17.01.6 / targets / brcm2708 / bcm2710 /


Image Files

These are the image files for the brcm2708/bcm2710 target. Check that the sha256sum of the file you downloaded matches the sha256sum below.
Shortened image file names below have the same prefix: lede-17.01.6-brcm2708-bcm2710-...

Image for your Device sha256sum File Size Date
rpi-3-ext4-sdcard.img.gz 4fd8438178e419d871e1c16328f7f49cc479bd6b033c7497db9ba8ccab11f800 8325.9 KB Mon Sep 3 13:08:57 2018

 

版本前進吧☆

※ 參考︰

 

 

 

何妨同時也用 gparted

About

GParted is a free partition editor for graphically managing your disk partitions.

With GParted you can resize, copy, and move partitions without data loss, enabling you to:

  • Grow or shrink your C: drive
  • Create space for new operating systems
  • Attempt data rescue from lost partitions

GParted Main screen

Discover More

Features

  • Perform actions with partitions such as:
    • create or delete
    • resize or move
    • check
    • label
    • set new UUID
    • copy and paste
  • Manipulate file systems such as:
    • btrfs
    • ext2 / ext3 / ext4
    • fat16 / fat32
    • hfs / hfs+
    • linux-swap
    • lvm2 pv
    • nilfs2
    • ntfs
    • reiserfs / reiser4
    • udf
    • ufs
    • xfs

    For specific actions supported see detailed features.

 

擴大『檔案系統』呀˙!!

※ 註︰

‧ 樹莓派安裝

sudo apt-get install gparted

 

‧ OpenWrt 結果︰

root@LEDE:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                14.2G     12.8M     14.2G   0% /
tmpfs                   465.1M    452.0K    464.7M   0% /tmp
/dev/mmcblk0p1           19.9M      8.8M     11.1M  44% /boot
tmpfs                   512.0K         0    512.0K   0% /dev