Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 26, 2016 06:43PM |
Registered: 8 years ago Posts: 34 |
I see where this is going. Shall we rename the wiki to 'Piratebox on the Zsun - Windows friendly SD'?Quote
TheExpertNoob
Hey meduza, we could probably just omit the entire vfat partition and make the entire sdcard ext4 on sda1 because this method doesn't really implement the vfat partition. Which means we have to change all instances of sda2 to sda1 in the scripts, such as Presetup in step 1.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 26, 2016 06:59PM |
Admin Registered: 13 years ago Posts: 4,680 |
vi /etc/config/uhttpd /etc/init.d/uhttpd reload
uci set uhttpd.main.listen_http=9080 uci set uhttpd.main.listen_https=9443 uci comit
config wifi-iface option ssid 'yourWifiName' option device 'radio0' option mode 'sta' option network 'wwan' #option encryption 'none' option encryption 'psk2' option key 'yourSuperSecurePass'
uci set wireless.radio0.disabled=0 uci add wireless wifi-iface uci set wireless.@wifi-iface[-1].device=radio0 uci set wireless.@wifi-iface[-1].ssid='your Wifi name' uci set wireless.@wifi-iface[-1].mode='sta' uci set wireless.@wifi-iface[-1].network='wwan' uci set wireless.@wifi-iface[-1].encryption='psk2' uci set wireless.@wifi-iface[-1].key="yourSuperSecurePass" uci commit
config interface 'wwan' option proto 'dhcp'new
uci set network.wwan=interface uci set network.wwan.proto=dhcp uci commit
/etc/init.d/network reload
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 26, 2016 08:59PM |
Registered: 8 years ago Posts: 34 |
Language: HTML#uhttpd config uci set uhttpd.main.listen_http=9080 uci set uhttpd.main.listen_https=9443 uci commit #wireless config uci set wireless.radio0.channel=auto uci set wireless.radio0.txpower=18 uci set wireless.radio0.country=00 uci set wireless.radio0.disabled=0 uci add wireless wifi-iface uci set wireless.@wifi-iface[-1].device=radio0 uci set wireless.@wifi-iface[-1].ssid=';your Wifi name'; uci set wireless.@wifi-iface[-1].mode=sta uci set wireless.@wifi-iface[-1].network=wwan uci set wireless.@wifi-iface[-1].encryption=psk2 uci set wireless.@wifi-iface[-1].key=';yourSuperSecurePass'; uci set wireless.@wifi-iface[-1].disabled=0 uci commit #netwerk interface config uci set network.wwan=interface uci set network.wwan.proto=dhcp uci commit #firewall config uci set firewall.@zone[1].network=';wan wan6 wwan'; uci commit #reload new config /etc/init.d/network reload /etc/init.d/firewall reload wifi
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 27, 2016 10:08AM |
Registered: 8 years ago Posts: 34 |
* Install and init extendroot (without run and enable) (2.Setup.sh)Language: HTMLmkdir /mnt/ext mkdir /mnt/usb 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=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 reboot
Language: HTMLecho "src/gz piratebox http://stable.openwrt.piratebox.de/all/packages" >> /etc/opkg.conf sed ';s|option check_signature 1||g'; -i /etc/opkg.conf opkg update opkg install extendRoot /etc/init.d/ext init source /etc/profile
andLanguage: HTML//usr/lib/opkg/info/piratebox.postinst: .: line 26: can';t open ';/usr/local/etc/piratebox.config';
I could of course solve this by sym-linking 'ln -s /etc /usr/local/' and 'ln -s /usr /usr/local/' before the piratebox installation...Language: HTML/etc/rc.common: .: line 26: can';t open ';/usr/local/usr/share/piratebox/piratebox.common';
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 27, 2016 02:19PM |
Registered: 8 years ago Posts: 34 |
Language: HTML#run manual # some symlync ln -s /etc /usr/local/ ln -s /usr /usr/local/ # solve port 80 issue opkg install lighttpd /etc/init.d/lighttpd stop /etc/init.d/lighttpd disable # Letsgo opkg install piratebox #Connection will be closed, reconnect to ssid piratebox with fixed ip # finish install with /etc/init.d/piratebox init /etc/init.d/piratebox start /opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf install /etc/init.d/piratebox timesave chmod a+w /opt/piratebox/share/tmp /etc/init.d/piratebox enable # and enable LuCI /etc/init.d/uhhtpd start /etc/init.d/uhhtpd enable
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 27, 2016 07:26PM |
Admin Registered: 13 years ago Posts: 4,680 |
Quote
Q1: am I using the wrong packages do i need to use extendRoot-piratebox instead of the normal piratebox package?
Q2: There is a typo within the piratebox postinst file (line 18). What's the best way to adress these?
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 28, 2016 01:45AM |
Registered: 9 years ago Posts: 181 |
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 28, 2016 02:52AM |
Registered: 9 years ago Posts: 181 |
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 28, 2016 09:35AM |
Registered: 8 years ago Posts: 34 |
Darn, I did search for it but ended on the general openwrt 'Rootfs on External Storage (extroot)' wiki.Quote
Matthias
I wrote this howto based on VoCore installation. Have a look at this steps.
This is how I prepare the configuration without activating with /etc/init.d/ext init
Quote
TheExpertNoob
Also a 1-liner for disabling the internet. I'm sleepy. I'll see what you have in the morning.
Language: HTMLuci set wireless.@wifi-iface[1].disabled=1 uci commit
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 28, 2016 12:51PM |
Registered: 9 years ago Posts: 181 |
wont be needed because we did this.Language: HTMLmkdir /usr/local/ ln -s /etc /usr/local/ ln -s /usr /usr/local/
Also actually initializing extRoot after that step may actually fix minidlna.Language: HTMLsed -i ';s|ext_linktarget="/usr/local"|ext_linktarget=""|g'; /etc/ext.config
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 28, 2016 05:05PM |
Registered: 8 years ago Posts: 34 |
reconnectLanguage: HTMLuci set uhttpd.main.listen_http=9080 uci set uhttpd.main.listen_https=9443 uci commit uci set wireless.radio0.channel=auto uci set wireless.radio0.txpower=18 uci set wireless.radio0.country=00 uci set wireless.radio0.disabled=0 uci add wireless wifi-iface uci set wireless.@wifi-iface[-1].device=radio0 uci set wireless.@wifi-iface[-1].ssid=';your Wifi name'; uci set wireless.@wifi-iface[-1].mode=sta uci set wireless.@wifi-iface[-1].network=wwan uci set wireless.@wifi-iface[-1].encryption=psk2 uci set wireless.@wifi-iface[-1].key=';yourSuperSecurePass'; uci set wireless.@wifi-iface[-1].disabled=0 uci commit uci set network.wwan=interface uci set network.wwan.proto=dhcp uci commit uci set firewall.@zone[1].network=';wan wan6 wwan'; uci commit /etc/init.d/network reload && /etc/init.d/firewall reload && wifi
Sitenote: are the 'mkdir /mnt/ext' and 'mkdir /mnt/usb' needed?Language: HTMLping google.com mkdir /mnt/ext mkdir /mnt/usb 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=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 reboot
reconnectLanguage: HTMLecho "src/gz piratebox http://stable.openwrt.piratebox.de/all/packages" >> /etc/opkg.conf sed ';s|option check_signature 1||g'; -i /etc/opkg.conf opkg update opkg install extendRoot sed -i ';s|ext_linktarget="/usr/local"|ext_linktarget=""|g'; /etc/ext.config opkg install lighttpd /etc/init.d/lighttpd stop /etc/init.d/lighttpd disable opkg install piratebox
Language: HTML/etc/init.d/piratebox init /etc/init.d/piratebox start /etc/init.d/piratebox enable 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 chmod a+w /opt/piratebox/share/tmp /etc/init.d/piratebox reload /etc/init.d/uhttpd start /etc/init.d/uhttpd enable
Getting the following error'sLanguage: HTMLopkg install minidlna /etc/init.d/piratebox start /etc/init.d/uhttpd start /etc/init.d/uhttpd enable
There's no need to do "cp /opt/piratebox/src/openwrt.example.minidlna /mnt/ext/etc/config/minidlna"Language: HTML... Command failed: Not found /etc/init.d/piratebox: Creating piratebox loop image... umount: /opt/piratebox: target is busy (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1).) umount: /opt/piratebox: not mounted /etc/init.d/piratebox: WARNING: unable to umount piratebox image losetup: /dev/loop1: detach failed: No such device or address ...
A reboot is required.Language: HTMLopkg install piratebox-mod-imageboard /opt/piratebox/bin/board-autoconf.sh
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 28, 2016 08:28PM |
Admin Registered: 13 years ago Posts: 4,680 |
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 28, 2016 08:40PM |
Admin Registered: 13 years ago Posts: 4,680 |
opkg install lighttpd /etc/init.d/lighttpd stop /etc/init.d/lighttpd disable?
opkg install -d ext minidlna
this is weird. I'm wondering which command failed here... and what is already blocking /opt/piratebox.Quote
Command failed: Not found
/etc/init.d/piratebox: Creating piratebox loop image...
umount: /opt/piratebox: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)
umount: /opt/piratebox: not mounted
/etc/init.d/piratebox: WARNING: unable to umount piratebox image
losetup: /dev/loop1: detach failed: No such device or address
...
This is a problem, because the /mnt/ext is not mounted on the system, the opt/piratebox lo won't be loop1.Quote
losetup: /dev/loop1: detach failed: No such device or address
sed -i 's|/dev/loop1|/dev/loop0|g' /usr/share/piratebox/piratebox.common
opkg update && opkg install -d ram e2fsprogs export LD_LIBRARY_PATH='/lib:/usr/lib:/tmp/lib:/tmp/usr/lib' export PATH="$PATH:/tmp/bin:/tmp/sbin:/usr/sbin" /tmp/usr/sbin/mkfs.ext4 /dev/sda1
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 28, 2016 08:55PM |
Registered: 9 years ago Posts: 181 |
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 28, 2016 09:32PM |
Registered: 8 years ago Posts: 34 |
Quote
Matthias
At least I'm interested in the additional lighttpd.
The result isLanguage: HTML/etc/init.d/piratebox init /etc/init.d/piratebox start
Since I can't control the dependence and install scripts I do the additional step on forehand. The piratebox install will solve this afterwards.Language: HTML-------------- Initialize PirateBoxScripts ----------- Starting initialize PirateBox Part2.. Distribute HEADER.txt into /opt/piratebox/share/Shared Distribute README.txt into /opt/piratebox/share/Shared Starting script piratebox Generating hosts file .... Generating dnsmasq.conf ..... Generating Environment-config for lighttpd ..... Empty tmp folder rm: ';/opt/piratebox/tmp'; is a directory Copy over design files Starting dnsmasq... 0 Starting droopy... 0 Generated HTML-Shoutbox File. Generated HTML-DiskUsage File. Starting lighttpd... 2016-04-27 08:15:14: [b](network.c.410) can';t bind to port: 80 Address already in use[/b] 255
>< And all that time I was swapping the SD to my debian machine.Quote
Matthias
BTW: if you want to be fancy, this is the code to format the sd card with ext4 on the running openwrt:
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 28, 2016 09:35PM |
Registered: 9 years ago Posts: 181 |
Language: HTMLStopping uttpd and disable it Command failed: Not found /etc/init.d/piratebox: Creating piratebox loop image... umount: /opt/piratebox: target is busy (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1).) umount: /opt/piratebox: not mounted /etc/init.d/piratebox: WARNING: unable to umount piratebox image losetup: /dev/loop0: detach failed: No such device or address -------------- Initialize PirateBoxScripts ----------- Starting initialize PirateBox Part2.. Distribute HEADER.txt into /opt/piratebox/share/Shared Distribute README.txt into /opt/piratebox/share/Shared Starting script piratebox Generating hosts file .... Generating dnsmasq.conf ..... Generating Environment-config for lighttpd ..... Empty tmp folder rm: ';/opt/piratebox/tmp'; is a directory Copy over design files Starting dnsmasq... 0 Starting droopy... 0 Generated HTML-Shoutbox File. Generated HTML-DiskUsage File. Starting lighttpd... 0 Bringing PirateBox down again and leave image mounted for further installation Stopping script piratebox Stopping dnsmasq... 0 Stopping droopy... 0 Stopping lighttpd... 0 Done Configuring libffmpeg-mini. Configuring libid3tag. Configuring minidlna.
at the end of the script is not working. so trying #Try next go around.Language: PHPwget -qO- http://127.0.0.1/board/kareha.pl &> /dev/null #Try wget http://127.0.0.1/board/kareha.pl >> /dev/null
Language: HTMLcp /opt/piratebox/src/openwrt.example.minidlna /etc/config/minidlna
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 28, 2016 10:08PM |
Registered: 8 years ago Posts: 34 |
For me after install, password setting and reboot the board works just fine.Language: PHPwget -qO- http://127.0.0.1/board/kareha.pl &> /dev/null #Try wget http://127.0.0.1/board/kareha.pl >> /dev/null
Your right, is missed the part of the folder configuration thin the config.Quote
TheExpertNoob
So Im adding this back to the wiki:
Language: HTMLcp /opt/piratebox/src/openwrt.example.minidlna /etc/config/minidlna
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 28, 2016 10:31PM |
Registered: 9 years ago Posts: 181 |
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 28, 2016 11:05PM |
Registered: 9 years ago Posts: 181 |
is in the piratebox-mod-imageboard makefile along with other packages as dependincies. Is opkg trying to reinstall it as a dependency maybe because the install initially fails when we do opkg install piratebox?Language: PHPDEPENDS:=piratebox
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 29, 2016 12:51AM |
Registered: 9 years ago Posts: 181 |
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 29, 2016 12:18PM |
Registered: 8 years ago Posts: 34 |
Language: HTMLroot@piratebox:~# mount /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) overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work) 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) /dev/loop0 on /opt/piratebox type ext4 (rw,relatime,sync,data=ordered)
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 29, 2016 01:20PM |
Registered: 9 years ago Posts: 181 |
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 29, 2016 01:36PM |
Registered: 9 years ago Posts: 181 |
It might be the reason for the lighttpd error using port 80 and why piratebox install gets kicked off again when we install the imageboard/minidlna because init_done never gets placed.Language: PHP#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
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 30, 2016 07:48PM |
Registered: 8 years ago Posts: 34 |
Quote
TheExpertNoob
meduza Wrote:
-------------------------------------------------------
> @TheExpertNoob
> In the Wiki I'm missing the 'sed -i 's|/dev/loop1|/dev/loop0|g' /usr/share/piratebox/piratebox.common'
>before piratebox init.
Because changing the loop didn't make any difference. in the error I got.
Language: HTMLsed -i ';s|/dev/loop1|/dev/loop0|g'; /usr/share/piratebox/piratebox.common /etc/init.d/piratebox init /etc/init.d/piratebox start reboot
Language: HTMLroot@piratebox:~# df -h Filesystem Size Used Available Use% Mounted on rootfs 922.7M 96.8M 762.2M 11% / /dev/root 3.3M 3.3M 0 100% /rom tmpfs 29.8M 76.0K 29.8M 0% /tmp /dev/sda1 922.7M 96.8M 762.2M 11% /overlay overlayfs:/overlay 922.7M 96.8M 762.2M 11% / tmpfs 512.0K 0 512.0K 0% /dev /dev/loop0 47.4M 1.2M 42.7M 3% /opt/piratebox root@piratebox:~# /etc/init.d/piratebox stop Stopping script piratebox Stopping dnsmasq... 0 Stopping droopy... 0 Stopping lighttpd... 0 losetup: /dev/loop0: detach failed: No such device or address root@piratebox:~# df -h Filesystem Size Used Available Use% Mounted on rootfs 922.7M 96.8M 762.2M 11% / /dev/root 3.3M 3.3M 0 100% /rom tmpfs 29.8M 72.0K 29.8M 0% /tmp /dev/sda1 922.7M 96.8M 762.2M 11% /overlay overlayfs:/overlay 922.7M 96.8M 762.2M 11% / tmpfs 512.0K 0 512.0K 0% /dev root@piratebox:~#
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox April 30, 2016 09:00PM |
Registered: 8 years ago Posts: 34 |
## Connect to openwrt uci set uhttpd.main.listen_http=9080 uci set uhttpd.main.listen_https=9443 uci commit uci set wireless.radio0.channel=auto uci set wireless.radio0.txpower=18 uci set wireless.radio0.country=00 uci set wireless.radio0.disabled=0 uci add wireless wifi-iface uci set wireless.@wifi-iface[-1].device=radio0 uci set wireless.@wifi-iface[-1].ssid='test' uci set wireless.@wifi-iface[-1].mode=sta uci set wireless.@wifi-iface[-1].network=wwan uci set wireless.@wifi-iface[-1].encryption=psk2 uci set wireless.@wifi-iface[-1].key='test' uci set wireless.@wifi-iface[-1].disabled=0 uci commit uci set network.wwan=interface uci set network.wwan.proto=dhcp uci commit uci set firewall.@zone[1].network='wan wan6 wwan' uci commit /etc/init.d/network reload && /etc/init.d/firewall reload && wifi # Reconnect to openwrt ping google.com opkg update && opkg install -d ram e2fsprogs export LD_LIBRARY_PATH='/lib:/usr/lib:/tmp/lib:/tmp/usr/lib' export PATH="$PATH:/tmp/bin:/tmp/sbin:/usr/sbin" /tmp/usr/sbin/mkfs.ext4 /dev/sda1 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=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 reboot # Reconnect to openwrt echo "src/gz piratebox [stable.openwrt.piratebox.de]; >> /etc/opkg.conf sed 's|option check_signature 1||g' -i /etc/opkg.conf opkg update && opkg install extendRoot sed -i 's|ext_linktarget="/usr/local"|ext_linktarget=""|g' /etc/ext.config opkg install piratebox # Reconnect to PirateBox - Share Freely /etc/init.d/lighttpd stop /etc/init.d/lighttpd disable sed -i 's|/dev/loop1|/dev/loop0|g' /usr/share/piratebox/piratebox.common /etc/init.d/piratebox init opkg install piratebox-mod-imageboard /opt/piratebox/bin/board-autoconf.sh /etc/init.d/piratebox start chmod a+w /opt/piratebox/share/tmp opkg install minidlna cp /opt/piratebox/src/openwrt.example.minidlna /etc/config/minidlna /etc/init.d/uhttpd start /etc/init.d/uhttpd enable uci set wireless.@wifi-iface[1].disabled=1 uci commit reboot
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox May 01, 2016 12:22AM |
Registered: 9 years ago Posts: 181 |
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox May 01, 2016 06:27AM |
Registered: 8 years ago Posts: 34 |
Language: HTMLStart > Run > cmd type "diskpart" -> runs diskpart.exe from system folder type "list volume" -> now you see all your connected drives, see which one is the drive type "select volume #" -> # being the letter of your drive type "attributes disk clear readonly" -> removing the protection Then open your SD, you can now edit, delete, move files.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox May 01, 2016 07:27AM |
Admin Registered: 13 years ago Posts: 4,680 |
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox May 01, 2016 07:37AM |
Admin Registered: 13 years ago Posts: 4,680 |
/opt/piratebox/init.d/piratebox_alt cd / umount /opt/piratebox ls /dev/loop*If you can see a loop0 device? If yes, that part of the piratebox-stop command can be removed for CC.
Re: [SETUP] Zsun WiFi Card Reader an €10 PirateBox May 01, 2016 01:16PM |
Registered: 9 years ago Posts: 181 |