Skip to content
bavier edited this page Aug 5, 2020 · 12 revisions

Installing OpenWRT

Tested in Jan 2019 on a out-of-the-box GnuBee PC2.

Preparation:

  • Download both gnubee_gb-pc2-initramfs-kernel.bin and gnubee_gb-pc2-squashfs-sysupgrade.bin from https://downloads.openwrt.org/releases/18.06.1/targets/ramips/mt7621 .
    • Probably use the -pc1 files for a GnuBee PC1.
    • Probably the 18.06.2 release works but I haven't tested from "OOB" state.
  • Optional: install minicom on a GNU/Linux laptop and get the serial cable (headphone jack--USB).
  • Not needed: an SD card in the GnuBee. I had my harddrives connected but probably not necessary yet.

Steps

  • Connect an ethernet cable directly from the black port on the GnuBee to a laptop, configure the laptop to get an IP via DHCP.
  • Optionally, connect the serial cable (I used a different laptop for this). Doing this as root may be required for read/write permission on /dev/ttyUSB0:
    • Type minicom -b 57600 -D /dev/ttyUSB0.
    • or via GNU screen: sudo screen /dev/ttyUSB0 57600.
  • Turn on the GnuBee.
    • If you have the serial cable, you'll see it doing dmesg stuff.
    • It takes about 20 seconds
  • The laptop connected via the ethernet cable should get a 192.168.10.xyz IP.
  • You should be able to connect a webbrowser to 192.168.10.1 and login to the LibreCMC firmware shipped with the GnuBee.

Replacing LibreCMC with OpenWRT

Here I followed the very helpful notes at https://stumbles.id.au/getting-started-with-the-gnubee-personal-cloud-2-or-1.html

  • In the web GUI, go to "System", "Backup/Flash Firmware". Under "Flash new firmware image", I unchecked "Keep settings" and selected the file -initramfs-kernel.bin file.
  • After rebooting, I had a new LuCI web GUI when I reconnected. The kernel was 4.14.xy.
  • I tried to change root password etc, but nothing would stick after reboots
  • What worked was flashing again with the -squashfs-sysupgrade.bin file.
  • After this, I seemed to have persistent file systems and could change the root password (either through the web GUI, via SSH, or via the serial console).

Switching to DHCP client

By default, new the OpenWRT install behaves as some kind of router (i.e., it runs a DHCP server and assigns IP addresses to clients).

  • In the web GUI under "Interfaces", I changed br-lan from "DHCP Server" to "DHCP Client"
    • I think I reboot with the ethernet cable in the blue plug
    • But this part involved some trial-and-error and at least once, I think it reset some configuation and lost my root password.
    • At one point, I had to hardcode an IP address on laptop because the GnuBee changed to "Static Address" 192.168.1.1 and was not acting as a DHCP server or client.
      • Probably I could've fixed this with the serial console command line using the udhcp command.
    • Some help testing this part and improving these instructions would be great!
  • At any rate, eventually I had the GnuBee configured as a DHCP client
  • Then I connected a LAN port on my router to the blue jack on the GnuBee.

Notes

Upgrading to 18.06.2 then 18.06.4

In Feb 2019, I updated my -PC2 to the 18.06.2 release of OpenWRT. In July 2019, I updated my -PC2 to 18.06.4. Some notes:

  • Using the web gui, I flashed the new squashfs image with "keep settings [x]" checked.
  • All my packages were gone. Perhaps this is how it is supposed to work (I didn't read the docs).
    • Config files (in /etc/config/) were preserved (I assume this is what "keep settings" does). Note: this includes the config files for packages I previously had installed.
    • Reinstalling the packages did not overwrite my customizations in /etc/config/
  • files in /root were gone.
  • /home/<myuser> was gone: perhaps I should put this on the raid in the future.

Previously I had installed OpenSSH and before doing that I had changed Dropbear to run on port 2222 (in the web gui). This was good b/c after the upgrade all packages disappeared (including openssh-server. But I was still able to SSH in on port 2222 and reinstall with opkg install openssh-server, then reboot and back to normal.

Upgrading to 18.06.4 to 19.07.2

Went smoothly, as above. Things to note:

  • user account still exists, "just" homedir wiped
  • root password unchanged by upgrade

NAS on OpenWRT

See NAS on OpenWRT for information on setting up disks, etc.