Skip to content

Instantly share code, notes, and snippets.

@softmoth
Last active February 19, 2019 05:25
Show Gist options
  • Save softmoth/27327e5bec25bcf80cdcb13b9960706a to your computer and use it in GitHub Desktop.
Save softmoth/27327e5bec25bcf80cdcb13b9960706a to your computer and use it in GitHub Desktop.
OpenWRT upgrade; usb tether, ntfs3g samba

USB Tether

This needs extra planning, since network isn't avaialable without it. Download the needed packages (see below) manually, before upgrading, from:

After upgrade, copy them to the router:

user@laptop$ scp *ipk root@192.168.1.1:/tmp/
kmod-mii_4.4.92-1_mips_24kc.ipk              100% 3515   412.5KB/s   00:00
kmod-usb-net_4.4.92-1_mips_24kc.ipk          100%   13KB   1.1MB/s   00:00
kmod-usb-net-cdc-ether_4.4.92-1_mips_24kc.ip 100% 3757   588.9KB/s   00:00
kmod-usb-net-rndis_4.4.92-1_mips_24kc.ipk    100% 4965   930.4KB/s   00:00
librt_1.1.16-1_mips_24kc.ipk                 100%  883   325.2KB/s   00:00
libusb-1.0_1.0.21-1_mips_24kc.ipk            100%   25KB   1.1MB/s   00:00
usbutils_007-6_mips_24kc.ipk                 100%  226KB 323.6KB/s   00:00

Then install them:

root@router# cd /tmp && opkg install *.ipk

Reboot router, plug phone in (physically disconnect & reconnect if needed), and check logs:

# logread
Wed Oct 18 09:31:10 2017 kern.info kernel: [ 2209.308375] usb 1-1: new high-speed USB device number 5 using ehci-platform
Wed Oct 18 09:31:10 2017 kern.info kernel: [ 2209.470417] rndis_host 1-1:1.0 usb0: register 'rndis_host' at usb-ehci-platform.0-1, RNDIS device, 96:85:1d:1b:99:4f
Wed Oct 18 09:31:10 2017 daemon.notice netifd: Interface 'TETHER' is enabled
Wed Oct 18 09:31:10 2017 daemon.notice netifd: Network device 'usb0' link is up
Wed Oct 18 09:31:10 2017 daemon.notice netifd: Interface 'TETHER' has link connectivity
Wed Oct 18 09:31:10 2017 daemon.notice netifd: Interface 'TETHER' is setting up now
Wed Oct 18 09:31:11 2017 daemon.notice netifd: TETHER (2845): udhcpc: started, v1.25.1
Wed Oct 18 09:31:11 2017 daemon.notice netifd: TETHER (2845): udhcpc: sending discover
Wed Oct 18 09:31:14 2017 daemon.notice netifd: TETHER (2845): udhcpc: sending discover
Wed Oct 18 09:31:16 2017 daemon.notice netifd: TETHER (2845): udhcpc: sending select for 192.168.42.88
Wed Oct 18 09:31:16 2017 daemon.notice netifd: TETHER (2845): udhcpc: lease of 192.168.42.88 obtained, lease time 7200
Wed Oct 18 09:31:16 2017 daemon.notice netifd: Interface 'TETHER' is now up
Wed Oct 18 09:31:16 2017 daemon.info dnsmasq[1327]: reading /tmp/resolv.conf.auto
Wed Oct 18 09:31:16 2017 daemon.info dnsmasq[1327]: using local addresses only for domain lan
Wed Oct 18 09:31:16 2017 daemon.info dnsmasq[1327]: using nameserver 192.168.42.129#53
Wed Oct 18 09:31:16 2017 user.notice firewall: Reloading firewall due to ifup of TETHER (usb0)

Samba & NTFS-3g

Let opkg slurp in dependencies (samba*-server, fuse)

root@router# opkg install luci-app-samba kmod-usb-storage ntfs-3g

Then add this in rc.local, so it stays mounted after reboot:

mount | grep -q '/dev/sda1\>' \
  || [ ! -r /dev/sda1 ] \
  || mount /dev/sda1 /mnt/sda1

Log out & in to LuCI, and configure Samba from there.

Building packages via the SDK on Linux

https://openwrt.org/docs/guide-developer/using_the_sdk

The SDK: https://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/openwrt-sdk-18.06.2-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64.tar.xz

*.tar
*.xz
/openwrt-sdk-*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment