Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
openwrt:zsun [2016/04/25 21:11] theexpertnoob |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Piratebox on the Zsun ===== | ||
- | Like many of us have read the [[https://hardware.slashdot.org/story/16/01/26/1430201/openwrt-turns-a-14-card-reader-into-the-smallest-wireless-ap|article]] on slashdot about the Openwrt capabilities of the Zsun Wifi card Reader. | ||
- | The idea of having PirateBox running on the smallest device yet made me order one from China. | ||
- | After many hours of installing, troubleshooting, resetting e.d. I now have a complete working Piratebox installation. | ||
- | I would like to share my installation scripts in order to let you install your own. | ||
- | <WRAP center round important 100%> | ||
- | OpenWrt (15.05 “Chaos Calmer”) and PirateBox (1.0.7) were used in the making of this tutorial. | ||
- | </WRAP> | ||
- | |||
- | **DISCLAIMER:** NOBODY will take responsibility or be liable for anything you do to your zsun. If you brick it trying these procedures, **YOU** are solely responsible for your actions. **YOU HAVE BEEN WARNED**. | ||
- | |||
- | ==== 0. Prerequisite (manual) ==== | ||
- | * Having a Zsun running OpenWrt. I've used the [[https://wiki.hackerspace.pl/projects:zsun-wifi-card-reader|hackerspace.pl]] method. | ||
- | * 1 SD card with 2 primary partitions. For the first partition I've used vfat (size:remaining), the second is ext4 (size:1GiB) Setup based on [[https://forum.piratebox.cc/read.php?8,16780,17503#msg-17503|link]]. This can be done on any linux machine with Gparted. | ||
- | * [[http://bit.ly/zsunprtbx|Download]] and extract meduza's custom zsun install package with modified ext config to the **vfat** partition of the SDcard (will become sda1). | ||
- | * Root password [[https://wiki.openwrt.org/doc/howto/firstlogin|set]]. | ||
- | * Changed the default uhhtpd (LuCI) ports to **9080** and **9443**. | ||
- | |||
- | <code> | ||
- | vi /etc/config/uhttpd | ||
- | /etc/init.d/uhttpd reload | ||
- | </code> | ||
- | |||
- | * Get internet working on the zsun. | ||
- | Adjust the wan config zone in **///etc/config/firewall//** like so: | ||
- | <code> | ||
- | config zone | ||
- | option name wan | ||
- | option network 'wan wan6 wwan' | ||
- | option input REJECT | ||
- | option output ACCEPT | ||
- | option forward REJECT | ||
- | option masq 1 | ||
- | option mtu_fix 1 | ||
- | </code> | ||
- | |||
- | **///etc/config/wireless//** should look like so (adjust essids and encryption as you need it): | ||
- | <code> | ||
- | config wifi-device 'radio0' | ||
- | option type 'mac80211' | ||
- | option hwmode '11g' | ||
- | option path 'platform/ar933x_wmac' | ||
- | option htmode 'HT20' | ||
- | option disabled '0' | ||
- | option channel 'auto' | ||
- | option txpower '18' | ||
- | option country '00' | ||
- | |||
- | config wifi-iface | ||
- | option ssid 'OpenWrt' | ||
- | option device 'radio0' | ||
- | option mode 'ap' | ||
- | option network 'lan' | ||
- | option encryption 'none' | ||
- | |||
- | config wifi-iface | ||
- | option ssid 'yourWifiName' | ||
- | option device 'radio0' | ||
- | option mode 'sta' | ||
- | option network 'wwan' | ||
- | #option encryption 'none' | ||
- | option encryption 'psk2' | ||
- | option key 'yourSuperSecurePass' | ||
- | </code> | ||
- | |||
- | Allow the wwan to get it's IP via DHCP by adding the following to **///etc/config/network//**: | ||
- | <code> | ||
- | config interface 'wwan' | ||
- | option proto 'dhcp' | ||
- | </code> | ||
- | <code>reboot</code> | ||
- | * Reconnect to OpenWRT | ||
- | <WRAP center round important 100%> | ||
- | An additional wireless connection with your own WiFi is made in 'sta' mode. Because OpenWrt (and PirateBox) are using the IP 192.168.1.1 (sub-netmask /24) the network (WiFi) you are connecting to can't use the same sub-net mask. | ||
- | </WRAP> | ||
- | * Verify your internet connection using | ||
- | <code> | ||
- | ping google.com | ||
- | opkg update | ||
- | </code> | ||
- | * Mount the first partition of the SD card to gain access to the scripts. | ||
- | <code> | ||
- | mkdir /mnt/sda1 | ||
- | mount /dev/sda1 /mnt/sda1 | ||
- | </code> | ||
- | ==== 1. PreSetup (script) ==== | ||
- | * There is a small script with the following lines | ||
- | * cd /mnt/sda1/zsun | ||
- | * Make it executable and run script ./1.preSetup.sh | ||
- | <code> | ||
- | mkdir /mnt/ext | ||
- | mkdir /mnt/usb | ||
- | mkdir /mnt/sda2 | ||
- | mount /dev/sda2 /mnt/sda2 | ||
- | tar -C /overlay -cvf - . | tar -C /mnt/sda2 -xf - | ||
- | uci add fstab mount | ||
- | uci set fstab.@mount[-1].target=/overlay | ||
- | uci set fstab.@mount[-1].device=/dev/sda2 | ||
- | uci set fstab.@mount[-1].fstype=ext4 | ||
- | uci set fstab.@mount[-1].options=rw,sync | ||
- | uci set fstab.@mount[-1].enabled=1 | ||
- | uci set fstab.@mount[-1].enabled_fsck=0 | ||
- | uci commit | ||
- | </code> | ||
- | * Reboot | ||
- | ==== 2. ApplySetup (script) ==== | ||
- | * remount the vfat partition | ||
- | <code>mount /dev/sda1 /mnt/sda1 | ||
- | cd /mnt/sda1/zsun</code> | ||
- | * Make it executable and run script ./2.applySetup.sh | ||
- | * This script includes the following lines: | ||
- | <code> | ||
- | cp -r ./extendRoot/etc/* /etc/ | ||
- | chmod o+w /etc/init.d/ext | ||
- | cp -r ./extendRoot/usr/* /usr/ | ||
- | mount /dev/sda2 /mnt/usb | ||
- | cp -r ./piratebox.zip/install /mnt/usb/ | ||
- | gzip -dc /mnt/usb/install/OpenWRT_ext4_50MB.img.gz > /mnt/usb/OpenWRT.img | ||
- | /etc/init.d/ext init | ||
- | </code> | ||
- | * Manually type this, but im not sure if it is necessary: | ||
- | <code>source /etc/profile</code> | ||
- | ==== 3. PirateboxInstall (script) ==== | ||
- | * Make it executable and run script ./3.installPiratebox.sh | ||
- | * This script includes the following lines: | ||
- | <code> | ||
- | echo "src/gz piratebox http://stable.openwrt.piratebox.de/all/packages" >> /etc/opkg.conf | ||
- | sed 's|option check_signature 1||g' -i /etc/opkg.conf | ||
- | rmdir /mnt/ext/usr | ||
- | ln -s /etc /mnt/ext/ | ||
- | ln -s /lib /mnt/ext/ | ||
- | ln -s /tmp /mnt/ext/ | ||
- | ln -s /usr /mnt/ext/ | ||
- | opkg update | ||
- | opkg -d ext install piratebox | ||
- | </code> | ||
- | ==== 4.PirateboxInstall (manual) ==== | ||
- | * After firewall configuration network has been disconnected. | ||
- | * Set fixed ip on **client pc** and finish install | ||
- | * IP: //192.168.1.2// | ||
- | * SN: //255.255.255.0// | ||
- | * GW: //192.168.1.1// | ||
- | * Log back into the zsun | ||
- | <code>/etc/init.d/piratebox init</code> | ||
- | * If you get a **losetup** error, run it again. | ||
- | * Next run: | ||
- | <code>/etc/init.d/piratebox start</code> | ||
- | === Post piratebox install config === | ||
- | <code>date</code> | ||
- | * Adjust if needed. | ||
- | <code>date YYYYMMDDHHMM</code> | ||
- | === Install timesave === | ||
- | <code> | ||
- | /opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf install | ||
- | /etc/init.d/piratebox timesave | ||
- | </code> | ||
- | === Get shoutbox working === | ||
- | <code>chmod a+w /opt/piratebox/share/tmp</code> | ||
- | <code>/etc/init.d/piratebox enable</code> | ||
- | === Install Minidlna === | ||
- | <code> | ||
- | opkg update | ||
- | opkg -d ext install minidlna | ||
- | cp /opt/piratebox/src/openwrt.example.minidlna /mnt/ext/etc/config/minidlna | ||
- | /etc/init.d/minidlna start | ||
- | /etc/init.d/minidlna enable | ||
- | </code> | ||
- | === Install Imageboard === | ||
- | <code>opkg -d ext install piratebox-mod-imageboard</code> | ||
- | * if you get and error about failing to get dependencies * libc * libc *, try this: | ||
- | <code> | ||
- | cd /tmp | ||
- | wget http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/libc_0.9.33.2-1_ar71xx.ipk | ||
- | opkg -d ext install libc_0.9.33.2-1_ar71xx.ipk | ||
- | </code> | ||
- | * Then try installing the imageboard again. | ||
- | === post install config imageboard === | ||
- | * This is a password **YOU** set for the imageboard. | ||
- | <code>/opt/piratebox/bin/board-autoconf.sh</code> | ||
- | * Verify the password set correctly | ||
- | <code>vi /opt/piratebox/www/board/config.pl</code> | ||
- | (CTRL+Z) to exit vi | ||
- | === Turn off Internet connection === | ||
- | <code>vi /etc/config/wireless</code> | ||
- | <file> | ||
- | config wifi-iface | ||
- | option network 'wwan' | ||
- | .... | ||
- | option disabled '1' | ||
- | </file> | ||
- | ==== All done! ==== | ||
- | <code>reboot</code> | ||
- | * Return your Client PC back to its original IP settings. | ||
- | ==== Credits ==== | ||
- | * Matthias - for the Piratebox Project. | ||
- | * meduza - for the majority of the scripting for the Zsun. | ||
- | * stylesuxx - for the wifi configuration and troubleshooting. | ||
- | * TheExpertNoob - for troubleshooting and this wiki guide. | ||
- | |||
- | If I forgot anyone else, PM me. |