From 4ac0d1a9322d12a1f4b6a57a39183c301279f7b2 Mon Sep 17 00:00:00 2001 From: emmett1 Date: Sat, 23 May 2026 17:18:31 +0800 Subject: update site --- .gitignore | 1 + buildsite.sh | 168 ++++++++++++++++++++++++++++++++++++++++++ docs/networking.md | 211 +++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/readme.md | 7 +- files/header | 31 +++++++- 5 files changed, 412 insertions(+), 6 deletions(-) create mode 100644 docs/networking.md diff --git a/.gitignore b/.gitignore index 583b6362..4c8fd64f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ outdate.list outdate.error /website/public/ /website/md2html.sh +/public/ diff --git a/buildsite.sh b/buildsite.sh index 1a1e75e6..6e24206d 100755 --- a/buildsite.sh +++ b/buildsite.sh @@ -3,6 +3,172 @@ rm -rf public mkdir -p public +html_escape() { + sed 's/\&/\&/g;s//\>/g;s/"/\"/g' +} + +port_version() { + grep '^version=' "$1/abuild" | cut -d = -f2- || true +} + +port_release() { + grep '^release=' "$1/abuild" | cut -d = -f2- || true +} + +port_depends() { + [ -f "$1/depends" ] || return 0 + grep -Ev '^(#|$)' "$1/depends" | tr '\n' ' ' | sed 's/[[:space:]]*$//' || true +} + +generate_ports_page() { + { + sed "s/@TITLE@/ports/g" files/header + cat << 'EOF' +" + echo "

Package ports generated from repos/core, repos/extra, and repos/community.

" + echo "
" + echo "" + echo "" + echo "" + echo "" + echo "" + echo "
" + echo "
0 / 0 ports
" + echo "" + echo "" + echo "" + + for repo in core extra community; do + for port in repos/$repo/*; do + [ -f "$port/abuild" ] || continue + name=${port##*/} + version=$(port_version "$port") + release=$(port_release "$port") + depends=$(port_depends "$port") + [ "$release" ] && version=$version-$release + printf '\n' \ + "$(printf '%s' "$repo" | html_escape)" \ + "$(printf '%s' "$repo" | html_escape)" \ + "$(printf '%s' "$repo" | html_escape)" \ + "$(printf '%s' "$name" | html_escape)" \ + "$(printf '%s' "$name" | html_escape)" \ + "$(printf '%s' "$version" | html_escape)" \ + "$(printf '%s' "$depends" | html_escape)" + done + done + + echo "" + echo "
reponameversiondependencies
%s%s%s%s
" + cat << 'EOF' + +EOF + cat files/footer + } > public/ports.html +} + for i in $(find . -type f -name "*.html" | sed 's|^\./||'); do dir=${i%/*} file=${i##*/} @@ -19,6 +185,8 @@ for i in $(find . -type f -name "*.html" | sed 's|^\./||'); do } > public/$dir/$file done +generate_ports_page + # docs cat docs/readme.md > docs/index.md for f in docs/*.md; do diff --git a/docs/networking.md b/docs/networking.md new file mode 100644 index 00000000..186ddfe0 --- /dev/null +++ b/docs/networking.md @@ -0,0 +1,211 @@ +Networking +========== + +This document describes how to configure networking on **Alice Linux** using `eiwd`/`wpa_supplicant` + `udhcpc`/`dhcpcd`. + +--- + +Overview +-------- + +Alice Linux uses simple, modular networking tools: + +**Link (connection)** + +* LAN: automatic (cable) +* Wi-Fi: `eiwd` or `wpa_supplicant` + +**IP configuration** + +* `udhcpc` - BusyBox DHCP client +* `dhcpcd` - DHCP client + +--- + +Establish Network Link +---------------------- + +Wired (LAN) +--------------- + +Bring interface up: + +``` +ip link set eth0 up +``` + +A physical cable connection is usually sufficient. + +> runit service enabled later will automatically bring up the interface. + +Wi-Fi +------- + +Bring interface up first: + +``` +ip link set wlan0 up +``` + +> runit service enabled later will automatically bring up the interface. + +Then choose ONE method: + +--- + +**Option A: eiwd** + +Install `eiwd` and `resolvconf` + +``` +# apkg -I eiwd resolvconf +``` + +To prevent iwd from scanning continuously while not connected, add the following lines to `/etc/iwd/main.conf`: +``` +[Scan] +DisablePeriodicScan=true +``` + +To prevent iwd from destroying / recreating wireless interfaces at startup, add the following line to `[General]`; +``` +UseDefaultInterface=true +``` + +Add network configuration. +``` +# printf 'password\n' | iwd_passphrase ssid > /var/lib/iwd/.psk +``` +> The iwd daemon monitors /var/lib/iwd and automatically loads new network configurations. + +Enable `eiwd` service: +``` +# ln -s /etc/eiwd /var/service +``` + +--- + +**Option B: wpa_supplicant** + +Install `wpa_supplicant` package. +``` +# apkg -I wpa_supplicant +``` + +Configure `wpa_supplicant.conf`: +``` +wpa_passphrase "SSID_NAME" "PASSWORD" > /etc/wpa_supplicant.conf +``` + +Enable `wpa_supplicant` service: +``` +# ln -s /etc/wpa_supplicant /var/service +``` + +--- + +Obtain IP Address (DHCP) +------------------------ + +Once the interface is connected (LAN or Wi-Fi), obtain an IP address. + +> This step is identical for both LAN and Wi-Fi. + +--- + +**Option A: udhcpc (BusyBox)** + +Enable `udhcpc` service: +``` +# ln -s /etc/sv/udhcpc /var/service +``` +> Interface and DNS settings can be adjusted in /etc/sv/udhcpc/conf. + +--- + +**Option B: dhcpcd** + +Install `dhcpcd` first: +``` +# apkg -I dhcpcd +``` + +Enable `dhcpcd` service: +``` +# ln -s /etc/sv/dhcpcd /var/service +``` + +--- + +Static Network Configuration +----------------------------- + +To use a static configuration instead of DHCP: + +``` +# vi /etc/sv/net-static/conf +``` + +Set the following variables: + +* IFACE +* IP +* NETMASK +* GATEWAY + +``` +# ln -s /etc/sv/net-static /var/service +``` + +--- + +Troubleshooting +--------------- + +Check interfaces: + +``` +ip addr +``` + +Test connectivity: + +``` +ping -c 3 8.8.8.8 +``` + +Test DNS: + +``` +ping -c 3 google.com +``` + +--- + +Quick Reference +--------------- + +LAN (DHCP) + +``` +# ip link set eth0 up +# ln -s /etc/sv/udhcpc /var/service +``` + +Wi-Fi (iwd + DHCP) + +``` +# ip link set wlan0 up +# printf 'password\n' | iwd_passphrase ssid > /var/lib/iwd/.psk +# ln -s /etc/sv/eiwd /var/service +# ln -s /etc/sv/udhcpc /var/service +``` + +Wi-Fi (wpa_supplicant + DHCP) + +``` +# ip link set wlan0 up +# wpa_passphrase "SSID" "PASS" > /etc/wpa_supplicant.conf +# ln -s /etc/sv/wpa_supplicant /var/service +# ln -s /etc/sv/udhcpc /var/service +``` diff --git a/docs/readme.md b/docs/readme.md index 39b5b35e..fb4ef6b6 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -1,3 +1,6 @@ -Here lies documentation for **Alice Linux**. +Documentation +============= + +This section covers the main parts of **Alice Linux**: installation, package +management, networking, service supervision, etc. -If you found any typo or error in docs, or even want to contribute, feel free to [open issue](https://codeberg.org/emmett1/alicelinux/issues) :D diff --git a/files/header b/files/header index 62c3186f..5faa51d9 100644 --- a/files/header +++ b/files/header @@ -5,18 +5,30 @@ Alice Linux - @TITLE@

@TITLE@

- home / docs / development / download / community / donate + home / docs / ports / development / download / community / donate
-- cgit v1.2.3