Skip to content

Instantly share code, notes, and snippets.

@wipedx
wipedx / ip6tables_setup.bash
Created April 21, 2022 07:58 — forked from velizarn/ip6tables_setup.bash
Basic setup for ip6tables - drop all traffic except local, ICMP and DHCPv6 traffic.
#!/bin/bash
# http://serverfault.com/questions/410321/debian-ip6tables-rules-setup-for-ipv6/410327#410327
# http://ipset.netfilter.org/iptables.man.html
# https://www.sixxs.net/wiki/IPv6_Firewalling
# https://www.cyberciti.biz/faq/ip6tables-ipv6-firewall-for-linux/
# https://gist.github.com/thomasfr/9712418
# https://gist.github.com/SnakeDrak/f4150f6e517e5a1d525f
# http://www.thegeekstuff.com/2011/06/iptables-rules-examples
# http://www.thegeekstuff.com/scripts/iptables-rules
DDR version 1.08 20170628
In
LPDDR3
333MHz
Bus Width=32 Col=11 Bank=8 Row=15/15 CS=2 Die Bus-Width=32 Size=4096MB
ddrconfig:7
OUT
U-Boot SPL 2017.09-ga0a2b48 (Apr 22 2018 - 12:19:12)
setup_ddr_param 1
0. If everything fails, erase the complete eMMC from UBOOT
(With 64GB eMMC, or at least mine: mmc erase 0 0x0733bfde)
Also make sure, that the eMMC is selected and not the SD
1. Install image on eMMC (and install btrfs-tools on the SD)
2. Boot eMMC once to trigger first time setup (resize partition
3. Reboot to SD and convert eMMC P7 to btrfs (btrfs-tools convert /dev/mmcblk0p7)
???
Incomplete, ended up with a kernel panic.
First of all, I'd love you to know that this practise is nowhere near good for SD Cards or any kind of Flashdrives.
I tried multiple times over a few hours to actually do that on the rock64 itself through a temporary SD Card
and my eMMC to backup. Didn't work all that well for -some- reason, idk really.
But it never compressed any of the free space into, well, nothing.
So I sat there trying to figure out how to fix it.. Because a 64GB eMMC will never fit on a 32GB SD Card.
Now, what I did is, I repeat, not a good practise for flash drives and I'm sure there's a better method of
getting the empty space to be ignored in the backup.
NOTE: I did that because of another error with btrfs in the kernel which has now been fixed.
Preconfiguring packages ...
[ 70.821600] ------------[ cut here ]------------
[ 70.822108] WARNING: at fs/btrfs/inode.c:2931
[ 70.822572] Modules linked in: ip_tables x_tables
[ 70.823108]
[ 70.823278] CPU: 3 PID: 38 Comm: kworker/u8:1 Not tainted 4.4.112-rockchip-ayufan-191 #1
[ 70.824129] Hardware name: Pine64 Rock64 (DT)
[ 70.824602] Workqueue: btrfs-endio-write btrfs_endio_write_helper
[ 70.825264] task: ffffffc0f56d0d80 task.stack: ffffffc0f56fc000
[ 70.825897] PC is at btrfs_finish_ordered_io+0x400/0x530
Message from syslogd@Nano at Mar 5 17:35:18 ...
kernel:[ 726.285033] Internal error: Oops: 8600000e [#1] SMP
Message from syslogd@Nano at Mar 5 17:35:18 ...
kernel:[ 726.828014] Process mmcqd/0 (pid: 145, stack limit = 0xffffffc0e3b2c020)
Message from syslogd@Nano at Mar 5 17:35:18 ...
kernel:[ 726.831916] Stack: (0xffffffc0e3b2fcc0 to 0xffffffc0e3b30000)
Mar 5 17:23:44 Nano systemd[1221]: Startup finished in 51ms.
Mar 5 17:23:44 Nano systemd[1]: Started User Manager for UID 1000.
Mar 5 17:23:53 Nano kernel: [ 41.221043] Plex Script Hos[1250]: unhandled level 1 translation fault (11) at 0x69735fa3, esr 0x92000005
Mar 5 17:23:53 Nano kernel: [ 41.222099] pgd = ffffffc0e6b2c000
Mar 5 17:23:53 Nano kernel: [ 41.222499] [69735fa3] *pgd=0000000000000000, *pud=0000000000000000
Mar 5 17:23:53 Nano kernel: [ 41.223230]
Mar 5 17:23:53 Nano kernel: [ 41.223401] CPU: 3 PID: 1250 Comm: Plex Script Hos Not tainted 4.4.77-rockchip-ayufan-136 #1
Mar 5 17:23:53 Nano kernel: [ 41.224322] Hardware name: Rockchip RK3328 Rock64 (DT)
Mar 5 17:23:53 Nano kernel: [ 41.224875] task: ffffffc0e3aa2940 ti: ffffffc0e6b64000 task.ti: ffffffc0e6b64000
Mar 5 16:11:28 Nano kernel: [ 131.385133] php-fpm7.0[696]: unhandled level 2 translation fault (11) at 0x7f73c00000, esr 0x92000006
Mar 5 16:11:28 Nano kernel: [ 131.386181] pgd = ffffffc0e559c000
Mar 5 16:11:28 Nano kernel: [ 131.386649] [7f73c00000] *pgd=00000000e55a1003, *pud=00000000e55a1003, *pmd=0000000000000000
Mar 5 16:11:28 Nano kernel: [ 131.387660]
Mar 5 16:11:28 Nano kernel: [ 131.387838] CPU: 1 PID: 696 Comm: php-fpm7.0 Not tainted 4.4.77-rockchip-ayufan-136 #1
Mar 5 16:11:28 Nano kernel: [ 131.388739] Hardware name: Rockchip RK3328 Rock64 (DT)
Mar 5 16:11:28 Nano kernel: [ 131.389305] task: ffffffc0e4a52940 ti: ffffffc0e55b4000 task.ti: ffffffc0e55b4000
Mar 5 16:11:28 Nano kernel: [ 131.390188] PC is at 0x5570733b70
Mar 5 16:11:28 Nano kernel: [ 131.390580] LR is at 0x557076a784
Mar 5 16:11:28 Nano kernel: [ 131.390953] pc : [<0000005570733b70>] lr : [<000000557076a784>] pstate: 00000000