Usually the PirateBox is installed on a FAT USB Stick using different loopback devices for extending the root filesystem. The loopback devices are pointing to files, that ext3-filesystems. In some cases you don't want to have this, or you want to have a bigger ext3 root using the OpenWrt extroot system. The following steps are based upon OpenWrt's wiki on extroot.
The following steps assume:
The easiest way to make Internet available is on system, which have a dedicated WAN port. It will work out of the box if you home network is not 192.168.1.0/24
On systems with only one ethernet port like the MR3020 or VoCore you have two options:
If you use the wifi method, you can easily stay connected via ethernet cable. The pitfall on this method is, that the wifi settings are being lost during the PirateBox installation1). To prevent a failing installation you have to do a few additional steps later.
The steps to setup the wifi for internet connection is are the following. Change the SSID to you home SSID. If you home SSID or passphrase contains whitespaces, enclose the name with
'. If you homenetwork is unecrypted, leave out the encryption and key line. Lern more about the correct settings on OpenWrt's wiki page. This does not work with a wifi containing a captive portal.
uci set network.wlan=interface uci set network.wlan.proto=dhcp uci set wireless.radio0.disabled=0 uci set wireless.@wifi-iface.mode=sta uci set wireless.@wifi-iface.ssid=<you homenetwork> uci set wireless.@wifi-iface.encryption=psk2 uci set wireless.@wifi-iface.key=<your wifi password> uci commit /etc/init.d/network restart
If you are connected via wifi, you will be disconnected during the installation, because the wifi settings changes and you are only able to connect to the box with a static IP adress and the new wifi SSID “PirateBox - Share freely”. If you are connected via serial access, this is the easiest version.
cp /etc/config/network /etc/config/network.backup uci set network.wan=interface uci set network.wan.ifname=$( uci get network.lan.ifname ) uci set network.wan.macaddr=$( uci get network.lan.macaddr ) ## this line is needed at VoCore uci set network.wan.proto=dhcp uci del network.lan.ifname uci commit
Then connect the box via ethernet cable
Make sure your internet is working on the Box.
ping -c heise.de
If you use one of our prepared images you can find on http://stable.openwrt.piratebox.de/ar71xx_AA_BB_0.1/ this step can be skipped.
opkg install http://stable.openwrt.piratebox.de/all/packages/pbxopkg_0.0.6_all.ipk opkg update opkg install kmod-usb-storage kmod-fs-ext4 block-mount kmod-usb2 reboot & exit
Expected error messages are:
kmod: failed to insert /lib/modules/3.10.49/sd_mod.ko kmod: failed to insert /lib/modules/3.10.49/usbcore.ko kmod: failed to insert /lib/modules/3.10.49/ext4.ko
These are the reason, why this steps ands with an reboot to properly load the kernel modules
Reconnect to the Box after the reboot (and login). The following commands apply to the BarrierBreaker-release of OpenWrt.
Then run the following commands:
mkdir /mnt/sda1 mount /dev/sda1 /mnt/sda1 tar -C /overlay -cvf - . | tar -C /mnt/sda1 -xf - uci add fstab mount uci set fstab.@mount[-1].target=/overlay uci set fstab.@mount[-1].device=/dev/sda1 uci set fstab.@mount[-1].fstype=ext3 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 reboot
After this reboot the extroot is available.
Reconnect to the Box after the reboot. Check if the box accepted the extroot, run
mount and compare it to the following example
rootfs on / type rootfs (rw) /dev/root on /rom type squashfs (ro,relatime) proc on /proc type proc (rw,noatime) sysfs on /sys type sysfs (rw,noatime) tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime) /dev/sda1 on /overlay type ext4 (rw,relatime,data=ordered) <----- this line overlayfs:/overlay on / type overlayfs (rw,noatime,lowerdir=/,upperdir=/overlay) <----- this line tmpfs on /dev type tmpfs (rw,relatime,size=512k,mode=755) devpts on /dev/pts type devpts (rw,relatime,mode=600) debugfs on /sys/kernel/debug type debugfs (rw,noatime)
The next steps are used for installing the basic PirateBox.
The following step is needed if you use wifi as internet connection (true for VoCore):
mkdir -p /mnt/usb/install/ cd /mnt/usb/install/ wget http://stable.openwrt.piratebox.de/piratebox_images/piratebox_ws_1.0_img.tar.gz
It should be possible to download all needed packages using the cache option. With a clever use of the opkg options, you should be able to install all needed stuff for the imageboard and minidlna.
PirateBox relies on the ext.config2). So we change the configuration.
opkg update opkg install extendRoot ## we only make use of the configuration file sed -i 's|ext_linktarget="/usr/local"|ext_linktarget=""|g' /etc/ext.config
Then we go ahead installing PirateBox
opkg update opkg install piratebox #The following commands is that the upload-daemon is running with the lighttpd user sed -i 's|DROOPY_USE_USER="no"|DROOPY_USE_USER="yes"|g' /opt/piratebox/conf/piratebox.conf /opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf part2
After this, do a reboot.
Yes, with that way of the installation, the content in opt/piratebox is still use a loopback interface.
After the PirateBox script has finished, some settings needs to be restored.
uci set wireless.@wifi-iface.mode=ap uci set wireless.@wifi-iface.encryption=none uci set wireless.@wifi-iface.network=lan uci commit
After the next reboot the access point for PirateBox should be working as expected.
The next step is to make the lan port usable for PirateBox as well.
uci set network.lan.ifname=$( uci get network.wan.ifname ) uci del network.wan=interface uci commit
After the next reboot the LAN port is reachable under the IP
date YYYYMMDDHHMM /opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf install /etc/init.d/piratebox timesave