From ea6f3a3a7a9ddc06a05ade685488f31b46e04e4c Mon Sep 17 00:00:00 2001 From: Andy Kutruff <874049+akutruff@users.noreply.github.com> Date: Wed, 23 Jan 2019 10:13:42 -0500 Subject: [PATCH 1/4] Streamline U-Boot installation instructions Shows how to safely use wget and removes path ambiguities. --- hacks/flashinguboot.md | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/hacks/flashinguboot.md b/hacks/flashinguboot.md index af72e418..b64d7f9b 100644 --- a/hacks/flashinguboot.md +++ b/hacks/flashinguboot.md @@ -35,17 +35,32 @@ i.e. you have a device with 128 Mb RAM. ## Flashing the U-Boot bootloader: 1. Login via SSH -2. Get the correct [bootloader](https://github.com/Dafang-Hacks/uboot/tree/master/compiled_bootloader) for your device and RAM size. -3. Put the bootloader file in the root of your microsd card. It will get mounted to /system/sdcard on your camera. +2. Get the correct [bootloader](https://github.com/Dafang-Hacks/uboot/tree/master/compiled_bootloader) for your device and RAM size. NOTE: if you're going to use wget, you need to use the RAW link to the .bin so that you don't accidentally download html. +3. Put the bootloader file in the root of your microsd card `/system/sdcard`. 4. **Verify the MD5 hash of the file!! Do not skip this step or you may brick your camera!** -3. Run the following commands +5. Write the bootloader to flash +6. Rename the uEnv.bootfromnand.txt in your minisd card root to uEnv.txt ```bash -flash_eraseall /dev/mtd0 +cd /system/sdcard/ + +wget https://github.com/Dafang-Hacks/uboot/raw/master/compiled_bootloader/NAME_OF_YOUR_BOOTLOADER_FILE.bin + +md5sum NAME_OF_YOUR_BOOTLOADER_FILE.bin ``` + +Again, do not proceed unless the MD5 matches the version you downloaded. Now erase and write to flash. Do not do anything else between these commands as once you erase, your device will be bricked until you write the .bin. + + ```bash +flash_eraseall /dev/mtd0 + dd if=/system/sdcard/NAME_OF_YOUR_BOOTLOADER_FILE.bin of=/dev/mtd0 + +mv uEnv.bootfromnand.txt uEnv.txt + ``` + For example, if you're flashing dafang_128mb_v2.bin, your command should look like this: ```bash @@ -56,8 +71,8 @@ Don't do anything stupid inbetween. If you crash your camera, you end up without a working bootloader. ## Verify that the U-Boot-Loader works correctly -1. Rename the uEnv.bootfromnand.txt in your minisd card root to uEnv.txt -2. Reboot your camera + +Reboot your camera The bootloader is configured to enable the blue led if it has found a valid uEnv.txt during boot up. Take a look at your LED when it first turns on. From d47e11e337ce5e2017dee0740cdf0a01fb90210c Mon Sep 17 00:00:00 2001 From: Andy Kutruff <874049+akutruff@users.noreply.github.com> Date: Wed, 23 Jan 2019 12:15:12 -0500 Subject: [PATCH 2/4] add more explanation on checking the md5 of the bin --- hacks/flashinguboot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hacks/flashinguboot.md b/hacks/flashinguboot.md index b64d7f9b..22852aeb 100644 --- a/hacks/flashinguboot.md +++ b/hacks/flashinguboot.md @@ -49,7 +49,7 @@ wget https://github.com/Dafang-Hacks/uboot/raw/master/compiled_bootloader/NAME_O md5sum NAME_OF_YOUR_BOOTLOADER_FILE.bin ``` -Again, do not proceed unless the MD5 matches the version you downloaded. Now erase and write to flash. Do not do anything else between these commands as once you erase, your device will be bricked until you write the .bin. +The `md5sum` command will output a string of hex. That should match the hash listed next to the bin file you downloaded for your [bootloader](https://github.com/Dafang-Hacks/uboot/tree/master/compiled_bootloader) That is a hash of the file that will Again, do not proceed unless the MD5 matches the version you downloaded. Now erase and write to flash. Do not do anything else between these commands as once you erase, your device will be bricked until you write the .bin. ```bash From 9d676869493a85a282c1cb3873cd5a9d43a5beed Mon Sep 17 00:00:00 2001 From: Andy Kutruff <874049+akutruff@users.noreply.github.com> Date: Wed, 23 Jan 2019 12:46:22 -0500 Subject: [PATCH 3/4] remove cut/paste error --- hacks/flashinguboot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hacks/flashinguboot.md b/hacks/flashinguboot.md index 22852aeb..697186a8 100644 --- a/hacks/flashinguboot.md +++ b/hacks/flashinguboot.md @@ -49,7 +49,7 @@ wget https://github.com/Dafang-Hacks/uboot/raw/master/compiled_bootloader/NAME_O md5sum NAME_OF_YOUR_BOOTLOADER_FILE.bin ``` -The `md5sum` command will output a string of hex. That should match the hash listed next to the bin file you downloaded for your [bootloader](https://github.com/Dafang-Hacks/uboot/tree/master/compiled_bootloader) That is a hash of the file that will Again, do not proceed unless the MD5 matches the version you downloaded. Now erase and write to flash. Do not do anything else between these commands as once you erase, your device will be bricked until you write the .bin. +The `md5sum` command will output a string of hex. That should match the hash listed next to the bin file you downloaded for your [bootloader](https://github.com/Dafang-Hacks/uboot/tree/master/compiled_bootloader) Again, do not proceed unless the MD5 matches the version you downloaded. Now erase and write to flash. Do not do anything else between these commands as once you erase, your device will be bricked until you write the .bin. ```bash From 81539a878fd47274ed15cec1eb60b0593da5fe99 Mon Sep 17 00:00:00 2001 From: jmtatsch Date: Tue, 29 Jan 2019 21:31:40 +0100 Subject: [PATCH 4/4] Update flashinguboot.md --- hacks/flashinguboot.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hacks/flashinguboot.md b/hacks/flashinguboot.md index 697186a8..fdf412eb 100644 --- a/hacks/flashinguboot.md +++ b/hacks/flashinguboot.md @@ -2,7 +2,7 @@ ## What benefits does this open source bootloader have? -1. You can use H264 FullHD streaming (1920x1080)(on 128MB devices only) +1. You can use H264 FullHD streaming (1920x1080)(on 128 MB devices only) 2. You can boot your own kernel/rootfs from MicroSD 3. You can change your kernel boot-parameters (uEnv.txt) 4. You can flash your NAND using this bootloader @@ -15,7 +15,7 @@ If you flash the wrong u-boot, you can brick your device. I am not taking any re ## Requirements: -1. Determine how much RAM your device has by running following command via SSH: +1. Determine how much RAM your device has by running the following command via SSH: ```$bash cat /proc/cmdline ``` @@ -35,7 +35,7 @@ i.e. you have a device with 128 Mb RAM. ## Flashing the U-Boot bootloader: 1. Login via SSH -2. Get the correct [bootloader](https://github.com/Dafang-Hacks/uboot/tree/master/compiled_bootloader) for your device and RAM size. NOTE: if you're going to use wget, you need to use the RAW link to the .bin so that you don't accidentally download html. +2. Download the correct [bootloader](https://github.com/Dafang-Hacks/uboot/tree/master/compiled_bootloader) for your device and RAM size. NOTE: if you are using wget, you need to use the RAW link to the .bin file so that you don't accidentally download a html file. 3. Put the bootloader file in the root of your microsd card `/system/sdcard`. 4. **Verify the MD5 hash of the file!! Do not skip this step or you may brick your camera!** 5. Write the bootloader to flash @@ -49,7 +49,7 @@ wget https://github.com/Dafang-Hacks/uboot/raw/master/compiled_bootloader/NAME_O md5sum NAME_OF_YOUR_BOOTLOADER_FILE.bin ``` -The `md5sum` command will output a string of hex. That should match the hash listed next to the bin file you downloaded for your [bootloader](https://github.com/Dafang-Hacks/uboot/tree/master/compiled_bootloader) Again, do not proceed unless the MD5 matches the version you downloaded. Now erase and write to flash. Do not do anything else between these commands as once you erase, your device will be bricked until you write the .bin. +The `md5sum` command will output a string of hex. That should match the hash listed next to the bin file you downloaded for your [bootloader](https://github.com/Dafang-Hacks/uboot/tree/master/compiled_bootloader) Again, do not proceed unless the MD5 matches the version you downloaded. Now erase and write the bootloader. Do not do anything else between these commands as once you have erased your bootloader. Your device will be unable to boot until you have written a new bootloader. ```bash