SolidRun ClearFog: A (probably) easier Installation method

I was fiddling around with a ClearFog Base and struggled how to get the initial u-boot image to be recognized by the device - and ended up finding an easier way to set it up than described in the wiki. Here is how:

You need

  • an USB stick, a mmc card or some other device capable as a hard drive
  • an Image you can put on that device
  • a for your planned booting method sufficient u-boot Image and an uart-u-boot Image

I used u-boot-clearfog-base-uart.kwb and u-boot-clearfog-base-sata.kwb from the manufacturers web site 'cause I wanted to set it up using a M.2 SSD. I used for the initial booting an USB-Stick.

Now create an USB-Stick with eg. the latest OpenWrt-Image on it by typing zcat <image>-sdcard.img.gz | dd of=/dev/sdX bs=4k conv=sync status=progress. Of course replace the <image> and the X with the right values. Then insert that USB-Stick into the USB-Port of the device, connect the micro-USB console-port to your computer, if no u-boot is on the device you can set the boot option switch on the ClearFog to whatever you want, otherwise set it to uart boot mode. If the ClearFog fails to find a working u-boot Image on the selected device it falls back to uart boot, but that can last a few seconds, that's why this works. Next thing is to execute ./kwboot -t -B 115200 /dev/ttyUSB2 -b u-boot-clearfog-base-uart.kwb -p with USB2 changed to the device where the ClearFog is connected to, and powering the ClearFog up. Now kwboot transfers the u-boot Image to the device and executes it. That Image is configured that it will search for a mmc card, if it won't find some try to find a USB mass storage, if that fails search for a device on the Sata port, and finally trying to boot via PXE. But it'll find the Image on the USB Stick and boots it (Unconfirmed it searches a file named boot.scr).

I had to change eth0 and eth1 in /etc/config/network to gain access via LuCI or ssh, but after the above I was already via console on the device, and if you took a mmc as your first boot device the only thing left is to put on the u-boot Image, which you can do right after creating the device, so in this case no need for the next steps.

Next step is to configure the media on the device. I did it manually, created partitions according to the USB Stick and copied the contents to the newly created partitions. Better would be to go for a custom build here to change the squashfs to an ext4fs and get rid of the overlayfs, but that comes next. One important thing is to copy the right u-boot Image to the newly created boot media, otherwise it won't boot. So first from your "controlling" computer do a scp u-boot-clearfog-base-sata.kwb root@ and afterwards on the ClearFog console a dd if=/tmp/u-boot-clearfog-base-sata.kwb of=/dev/sda bs=512 seek=1 conv=sync with sata and sda replaced by your proper boot media. Now it's time to power off the device, set the switch to the right boot media and power it up again - and if all went right it boots your favourite OS right up... :slight_smile:

I don't have Windows or Mac-OS, so I can't' provide the right commands to create the USB stick, getting kwboot running or replaced and to copy the necessary u-boot file onto the device running OpenWrt, sorry, but they should be found somewhere in the wiki or the forum already.

Hope, that helps...


Would you mind adding this to the wiki?