summaryrefslogtreecommitdiff
path: root/guest
diff options
context:
space:
mode:
authorPÁLI Gábor János <pali.gabor@gmail.com>2022-02-18 02:24:03 +0100
committerPÁLI Gábor János <pali.gabor@gmail.com>2022-02-18 02:24:03 +0100
commit7083c078d4572375867f6e3859c31349a2524404 (patch)
tree431f9e8085d8ea65e000c00bd7306dbb34472ead /guest
parent1b2bf860386b2db32f3a54a26f2379a71a759f1d (diff)
downloadfreebsd-wifibox-alpine-7083c078d4572375867f6e3859c31349a2524404.zip
Rearrange repository layout for namespacing.
Diffstat (limited to 'guest')
-rw-r--r--guest/etc/conf.d/iptables4
-rw-r--r--guest/etc/fstab5
-rw-r--r--guest/etc/hostname1
-rw-r--r--guest/etc/inittab6
-rw-r--r--guest/etc/iptables/rules-save14
-rw-r--r--guest/etc/mkinitfs/features.d/9p.modules2
-rw-r--r--guest/etc/mkinitfs/mkinitfs.conf1
-rw-r--r--guest/etc/network/interfaces9
l---------guest/etc/network/interfaces.conf1
-rw-r--r--guest/etc/sysctl.conf1
-rw-r--r--guest/etc/udhcpc/udhcpc.conf1
l---------guest/etc/udhcpd.conf1
l---------guest/etc/wpa_supplicant/wpa_supplicant.conf1
-rw-r--r--guest/setup.sh27
14 files changed, 74 insertions, 0 deletions
diff --git a/guest/etc/conf.d/iptables b/guest/etc/conf.d/iptables
new file mode 100644
index 0000000..6e356ef
--- /dev/null
+++ b/guest/etc/conf.d/iptables
@@ -0,0 +1,4 @@
+IPTABLES_SAVE="/etc/iptables/rules-save"
+SAVE_RESTORE_OPTIONS="-c"
+SAVE_ON_STOP="no"
+IPFORWARD="yes"
diff --git a/guest/etc/fstab b/guest/etc/fstab
new file mode 100644
index 0000000..1cb358c
--- /dev/null
+++ b/guest/etc/fstab
@@ -0,0 +1,5 @@
+root / 9p trans=virtio,ro,noatime,nodiratime,norelatime 0 0
+tmpfs /tmp tmpfs size=1M 0 0
+config /media/etc 9p trans=virtio,ro,noatime,nodiratime,norelatime 0 0
+var /var 9p trans=virtio,rw 0 0
+tmpfs /var/run/chrony tmpfs size=128K,uid=100,gid=101,mode=0750 0 0
diff --git a/guest/etc/hostname b/guest/etc/hostname
new file mode 100644
index 0000000..66eb8bf
--- /dev/null
+++ b/guest/etc/hostname
@@ -0,0 +1 @@
+wifibox
diff --git a/guest/etc/inittab b/guest/etc/inittab
new file mode 100644
index 0000000..d4dbd79
--- /dev/null
+++ b/guest/etc/inittab
@@ -0,0 +1,6 @@
+::sysinit:/sbin/openrc sysinit
+::sysinit:/sbin/openrc boot
+::wait:/sbin/openrc default
+::restart:/sbin/init
+ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100
+::shutdown:/sbin/openrc shutdown
diff --git a/guest/etc/iptables/rules-save b/guest/etc/iptables/rules-save
new file mode 100644
index 0000000..326a7a8
--- /dev/null
+++ b/guest/etc/iptables/rules-save
@@ -0,0 +1,14 @@
+*filter
+:INPUT ACCEPT [24:1728]
+:FORWARD ACCEPT [480:181212]
+:OUTPUT ACCEPT [27:2041]
+[377:71090] -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
+[51:4670] -A FORWARD -i eth0 -o wlan0 -j ACCEPT
+COMMIT
+*nat
+:PREROUTING ACCEPT [64:6167]
+:INPUT ACCEPT [0:0]
+:OUTPUT ACCEPT [3:174]
+:POSTROUTING ACCEPT [3:174]
+[51:4670] -A POSTROUTING -o wlan0 -j MASQUERADE
+COMMIT
diff --git a/guest/etc/mkinitfs/features.d/9p.modules b/guest/etc/mkinitfs/features.d/9p.modules
new file mode 100644
index 0000000..e8221d6
--- /dev/null
+++ b/guest/etc/mkinitfs/features.d/9p.modules
@@ -0,0 +1,2 @@
+kernel/net/9p
+kernel/fs/9p
diff --git a/guest/etc/mkinitfs/mkinitfs.conf b/guest/etc/mkinitfs/mkinitfs.conf
new file mode 100644
index 0000000..a0ea402
--- /dev/null
+++ b/guest/etc/mkinitfs/mkinitfs.conf
@@ -0,0 +1 @@
+features="base virtio 9p"
diff --git a/guest/etc/network/interfaces b/guest/etc/network/interfaces
new file mode 100644
index 0000000..f1c5139
--- /dev/null
+++ b/guest/etc/network/interfaces
@@ -0,0 +1,9 @@
+auto lo
+iface lo inet loopback
+
+auto eth0
+
+source /etc/network/interfaces.conf
+
+auto wlan0
+iface wlan0 dhcp
diff --git a/guest/etc/network/interfaces.conf b/guest/etc/network/interfaces.conf
new file mode 120000
index 0000000..3465f4e
--- /dev/null
+++ b/guest/etc/network/interfaces.conf
@@ -0,0 +1 @@
+/media/etc/interfaces.conf \ No newline at end of file
diff --git a/guest/etc/sysctl.conf b/guest/etc/sysctl.conf
new file mode 100644
index 0000000..119d730
--- /dev/null
+++ b/guest/etc/sysctl.conf
@@ -0,0 +1 @@
+net.ipv4.ip_forward=1
diff --git a/guest/etc/udhcpc/udhcpc.conf b/guest/etc/udhcpc/udhcpc.conf
new file mode 100644
index 0000000..583ea0f
--- /dev/null
+++ b/guest/etc/udhcpc/udhcpc.conf
@@ -0,0 +1 @@
+RESOLV_CONF="/tmp/resolv.conf" \ No newline at end of file
diff --git a/guest/etc/udhcpd.conf b/guest/etc/udhcpd.conf
new file mode 120000
index 0000000..2bdb5dd
--- /dev/null
+++ b/guest/etc/udhcpd.conf
@@ -0,0 +1 @@
+/media/etc/udhcpd.conf \ No newline at end of file
diff --git a/guest/etc/wpa_supplicant/wpa_supplicant.conf b/guest/etc/wpa_supplicant/wpa_supplicant.conf
new file mode 120000
index 0000000..b5c7213
--- /dev/null
+++ b/guest/etc/wpa_supplicant/wpa_supplicant.conf
@@ -0,0 +1 @@
+/media/etc/wpa_supplicant.conf \ No newline at end of file
diff --git a/guest/setup.sh b/guest/setup.sh
new file mode 100644
index 0000000..51784b6
--- /dev/null
+++ b/guest/setup.sh
@@ -0,0 +1,27 @@
+apk add \
+ --no-network \
+ --force-non-repository \
+ /packages/*.apk
+passwd -d root
+ln -s /dev/null /root/.ash_history
+rm /etc/motd
+rc-update add networking boot
+rc-update add urandom boot
+rc-update add acpid default
+rc-update add modules boot
+rc-update add chronyd default
+rc-update add crond default
+rc-update add devfs sysinit
+rc-update add dmesg sysinit
+rc-update add hostname boot
+rc-update add hwclock boot
+rc-update add hwdrivers sysinit
+rc-update add iptables default
+rc-update add killprocs shutdown
+rc-update add mdev sysinit
+rc-update add savecache shutdown
+rc-update add sysctl boot
+rc-update add syslog boot
+rc-update add udhcpd default
+rc-update add wpa_supplicant boot
+mkdir -p /media/etc