mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-31 21:13:00 +02:00
Drop legacy Classic builds
The Classic builds served for a while as an introduction to classic embedded systems, with a user managed read-writable /etc. Today we decided to firmly take the plunge into the future with NETCONF and focus on our core platforms aarch64 and x86_64 (for Qemu). The reasons are several: reduce overhead, simplify build and release work, as well as manual testing, since Classic builds do not have any automated regression testing. The Classic builds may be resurrected later in a dedicated project. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -8,12 +8,11 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build ${{ matrix.platform }} ${{ matrix.variant }}
|
name: Build Infix ${{ matrix.platform }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
platform: [aarch64, x86_64]
|
platform: [aarch64, x86_64]
|
||||||
variant: [netconf, classic]
|
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- name: Maintenance
|
- name: Maintenance
|
||||||
@@ -25,11 +24,7 @@ jobs:
|
|||||||
- name: Set Build Variables
|
- name: Set Build Variables
|
||||||
id: vars
|
id: vars
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ matrix.variant }}" = "netconf" ]; then
|
target=${{ matrix.platform }}
|
||||||
target=${{ matrix.platform }}
|
|
||||||
else
|
|
||||||
target=${{ matrix.platform }}-${{ matrix.variant }}
|
|
||||||
fi
|
|
||||||
echo "dir=infix-$target" >> $GITHUB_OUTPUT
|
echo "dir=infix-$target" >> $GITHUB_OUTPUT
|
||||||
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
|
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
|
||||||
if [ "$target" = x86_64 ]; then
|
if [ "$target" = x86_64 ]; then
|
||||||
@@ -41,9 +36,8 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: dl/
|
path: dl/
|
||||||
key: dl-${{ matrix.variant }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
|
key: dl-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
dl-${{ matrix.variant }}-
|
|
||||||
dl-
|
dl-
|
||||||
- name: Restore Cache of .ccache/
|
- name: Restore Cache of .ccache/
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@@ -55,11 +49,7 @@ jobs:
|
|||||||
ccache-
|
ccache-
|
||||||
- name: Configure & Build
|
- name: Configure & Build
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ matrix.variant }}" = "netconf" ]; then
|
target=${{ matrix.platform }}_defconfig
|
||||||
target=${{ matrix.platform }}_defconfig
|
|
||||||
else
|
|
||||||
target=${{ matrix.platform }}_${{ matrix.variant }}_defconfig
|
|
||||||
fi
|
|
||||||
echo "Building $target ..."
|
echo "Building $target ..."
|
||||||
sudo mkdir ${{ steps.vars.outputs.out }}
|
sudo mkdir ${{ steps.vars.outputs.out }}
|
||||||
sudo chown $(id -un):$(id -gn) ${{ steps.vars.outputs.out }}
|
sudo chown $(id -un):$(id -gn) ${{ steps.vars.outputs.out }}
|
||||||
@@ -73,14 +63,14 @@ jobs:
|
|||||||
ln -s ${{ steps.vars.outputs.dir }} images
|
ln -s ${{ steps.vars.outputs.dir }} images
|
||||||
tar chfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
|
tar chfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
|
||||||
- name: Test
|
- name: Test
|
||||||
if: matrix.platform == 'x86_64' && matrix.variant == 'netconf'
|
if: matrix.platform == 'x86_64'
|
||||||
run: |
|
run: |
|
||||||
export O=${{ steps.vars.outputs.out }}
|
export O=${{ steps.vars.outputs.out }}
|
||||||
make test-qeneth
|
make test-qeneth
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.vars.outputs.out }}/${{ steps.vars.outputs.tgz }}
|
path: ${{ steps.vars.outputs.out }}/${{ steps.vars.outputs.tgz }}
|
||||||
name: artifact-${{ matrix.variant }}-${{ matrix.platform }}
|
name: artifact-${{ matrix.platform }}
|
||||||
release:
|
release:
|
||||||
if: ${{github.repository_owner == 'kernelkit' && github.ref_name == 'main'}}
|
if: ${{github.repository_owner == 'kernelkit' && github.ref_name == 'main'}}
|
||||||
name: Upload Latest Build
|
name: Upload Latest Build
|
||||||
|
|||||||
@@ -20,12 +20,11 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
if: github.repository == 'kernelkit/infix' && startsWith(github.ref, 'refs/tags/')
|
if: github.repository == 'kernelkit/infix' && startsWith(github.ref, 'refs/tags/')
|
||||||
name: Build Infix ${{ github.ref_name }} [${{ matrix.platform }}-${{ matrix.variant }}]
|
name: Build Infix ${{ github.ref_name }} [${{ matrix.platform }}]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
platform: [aarch64, x86_64]
|
platform: [aarch64, x86_64]
|
||||||
variant: [netconf, classic]
|
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- name: Maintenance
|
- name: Maintenance
|
||||||
@@ -44,11 +43,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
echo "ver=${ver}" >> $GITHUB_OUTPUT
|
echo "ver=${ver}" >> $GITHUB_OUTPUT
|
||||||
fver=${ver#v}
|
fver=${ver#v}
|
||||||
if [ "${{ matrix.variant }}" = "netconf" ]; then
|
target=${{ matrix.platform }}-${fver}
|
||||||
target=${{ matrix.platform }}-${fver}
|
|
||||||
else
|
|
||||||
target=${{ matrix.platform }}-${{ matrix.variant }}-${fver}
|
|
||||||
fi
|
|
||||||
echo "dir=infix-$target" >> $GITHUB_OUTPUT
|
echo "dir=infix-$target" >> $GITHUB_OUTPUT
|
||||||
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
|
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
|
||||||
echo "out=/mnt/x-$target" >> $GITHUB_OUTPUT
|
echo "out=/mnt/x-$target" >> $GITHUB_OUTPUT
|
||||||
@@ -56,9 +51,8 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: dl/
|
path: dl/
|
||||||
key: dl-${{ matrix.variant }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
|
key: dl-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
dl-${{ matrix.variant }}-
|
|
||||||
dl-
|
dl-
|
||||||
- name: Restore Cache of .ccache/
|
- name: Restore Cache of .ccache/
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@@ -72,11 +66,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
INFIX_RELEASE: ${{ steps.vars.outputs.ver }}
|
INFIX_RELEASE: ${{ steps.vars.outputs.ver }}
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ matrix.variant }}" = "netconf" ]; then
|
target=${{ matrix.platform }}_defconfig
|
||||||
target=${{ matrix.platform }}_defconfig
|
|
||||||
else
|
|
||||||
target=${{ matrix.platform }}_${{ matrix.variant }}_defconfig
|
|
||||||
fi
|
|
||||||
echo "Building $target ..."
|
echo "Building $target ..."
|
||||||
sudo mkdir ${{ steps.vars.outputs.out }}
|
sudo mkdir ${{ steps.vars.outputs.out }}
|
||||||
sudo chown $(id -un):$(id -gn) ${{ steps.vars.outputs.out }}
|
sudo chown $(id -un):$(id -gn) ${{ steps.vars.outputs.out }}
|
||||||
@@ -92,7 +82,7 @@ jobs:
|
|||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.vars.outputs.out }}/${{ steps.vars.outputs.tgz }}
|
path: ${{ steps.vars.outputs.out }}/${{ steps.vars.outputs.tgz }}
|
||||||
name: artifact-${{ matrix.variant }}-${{ matrix.platform }}
|
name: artifact-${{ matrix.platform }}
|
||||||
release:
|
release:
|
||||||
name: Release Infix ${{ github.ref_name }}
|
name: Release Infix ${{ github.ref_name }}
|
||||||
needs: build
|
needs: build
|
||||||
|
|||||||
@@ -112,25 +112,6 @@ config INFIX_ARCH
|
|||||||
default "riscv64" if BR2_riscv
|
default "riscv64" if BR2_riscv
|
||||||
default "x86_64" if BR2_x86_64
|
default "x86_64" if BR2_x86_64
|
||||||
|
|
||||||
# For /etc/os-release, VARIANT & VARIANT_ID used, e.g., in mnt script
|
|
||||||
choice
|
|
||||||
prompt "Select variant/flavor"
|
|
||||||
default INFIX_VARIANT_NETCONF
|
|
||||||
|
|
||||||
config INFIX_VARIANT_NETCONF
|
|
||||||
bool "NETCONF"
|
|
||||||
help
|
|
||||||
Managed NETCONF mode, /etc is a ramdisk, all configuration is
|
|
||||||
generated by sysrepo plugins using NETCONF (xml) or RESTCONF.
|
|
||||||
|
|
||||||
config INFIX_VARIANT_CLASSIC
|
|
||||||
bool "Classic /etc mode"
|
|
||||||
help
|
|
||||||
User managed mode, read-write configuration files in /etc that
|
|
||||||
is saved across reboots.
|
|
||||||
|
|
||||||
endchoice
|
|
||||||
|
|
||||||
menu "Packages"
|
menu "Packages"
|
||||||
|
|
||||||
source "$BR2_EXTERNAL_INFIX_PATH/package/Config.in"
|
source "$BR2_EXTERNAL_INFIX_PATH/package/Config.in"
|
||||||
|
|||||||
@@ -105,8 +105,7 @@ more information, see: [Infix in Virtual Environments](doc/virtual.md).
|
|||||||
>
|
>
|
||||||
> For *customer specific builds* of Infix, see your product repository.
|
> For *customer specific builds* of Infix, see your product repository.
|
||||||
|
|
||||||
[^1]: NETCONF or RESTCONF, <https://datatracker.ietf.org/doc/html/rfc8040>,
|
[^1]: NETCONF or RESTCONF, <https://datatracker.ietf.org/doc/html/rfc8040>
|
||||||
for more information, see [Infix Variants](doc/variant.md).
|
|
||||||
|
|
||||||
[^2]: An immutable operating system is one with read-only file systems,
|
[^2]: An immutable operating system is one with read-only file systems,
|
||||||
atomic updates, rollbacks, declarative configuration, and workload
|
atomic updates, rollbacks, declarative configuration, and workload
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
. "$BR2_CONFIG"
|
|
||||||
|
|
||||||
# Prevent regen of host key at every boot, /etc is saved across reboots
|
|
||||||
if [ -L "$TARGET_DIR/etc/dropbear" ]; then
|
|
||||||
rm "$TARGET_DIR/etc/dropbear"
|
|
||||||
mkdir "$TARGET_DIR/etc/dropbear"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Classic builds don't have D-Bus
|
|
||||||
if [ -f "$TARGET_DIR/etc/dnsmasq.conf" ]; then
|
|
||||||
sed -i '/enable-dbus/d' "$TARGET_DIR/etc/dnsmasq.conf"
|
|
||||||
fi
|
|
||||||
@@ -1,684 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# COLUMS and ROWS should be set on the console, if not, use fallback
|
|
||||||
if [ -z "$COLUMNS" ]; then
|
|
||||||
if command -v tput; then
|
|
||||||
COLUMNS=$(tput cols)
|
|
||||||
else
|
|
||||||
COLUMNS=80
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
h1()
|
|
||||||
{
|
|
||||||
STR="$*"
|
|
||||||
if [ -n "$plain" ]; then
|
|
||||||
echo "$STR" | tr '[:lower:]' '[:upper:]'
|
|
||||||
echo "$STR" | sed 's/./=/g'
|
|
||||||
else
|
|
||||||
printf "\033[7m%-${COLUMNS}s\033[0m" "$STR"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
h2()
|
|
||||||
{
|
|
||||||
STR="$*"
|
|
||||||
if [ -n "$plain" ]; then
|
|
||||||
echo "$STR"
|
|
||||||
echo "$STR" | sed 's/./-/g'
|
|
||||||
else
|
|
||||||
printf "\033[1m%-${COLUMNS}s\033[0m" "$STR"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
ul()
|
|
||||||
{
|
|
||||||
if [ -n "$plain" ]; then
|
|
||||||
echo "__${*}__"
|
|
||||||
else
|
|
||||||
printf "\033[54%s\033[0m" "$*"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
em()
|
|
||||||
{
|
|
||||||
if [ -n "$plain" ]; then
|
|
||||||
echo "**${*}**"
|
|
||||||
else
|
|
||||||
printf "\033[5m%s\033[0m" "$*"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
overview()
|
|
||||||
{
|
|
||||||
cat <<EOF
|
|
||||||
$(h1 "Help System Press 'Q' to quit | Arrow keys and PgUp/PgDn to scroll")
|
|
||||||
|
|
||||||
$(h2 "See Also")
|
|
||||||
help edit Tutorial on VI and Mg editors
|
|
||||||
help net Network set up introduction
|
|
||||||
setup User friendly setup and diagnostic tool
|
|
||||||
|
|
||||||
$(h2 "General Syntax")
|
|
||||||
cmd [optional arg] E.g., use 'date -h' to get help for date command
|
|
||||||
|
|
||||||
$(h2 "File system")
|
|
||||||
pwd | ls | cd Show directory, contents, or change directory
|
|
||||||
cat file Show file contents
|
|
||||||
vi | mg [file] Edit file with the VI or Micro Emacs editor
|
|
||||||
|
|
||||||
$(h2 "Services")
|
|
||||||
initctl list Lists all configurable services (svc's)
|
|
||||||
initctl enable svc Enable a service 'svc'
|
|
||||||
initctl reload Reload init process' state, start/stop svc's
|
|
||||||
initctl start svc Start a stopped service 'svc'
|
|
||||||
initctl stop svc Stop 'svc'
|
|
||||||
initctl restart svc Restart a running 'svc'
|
|
||||||
initctl status [svc] Display running status of all services, or one 'svc'
|
|
||||||
|
|
||||||
$(h2 "Tools")
|
|
||||||
setup User friendly setup and diagnostic tool
|
|
||||||
date [-h] Display current time, or sets the system date
|
|
||||||
factory Factory reset the device (on the next boot)
|
|
||||||
hwclock [-h] Query or set the hardware clock (RTC)
|
|
||||||
logout | Ctrl-D Log out from TTY
|
|
||||||
mdio | mvls Low-level MDIO access, also for Marvell switch status
|
|
||||||
tail -F file Continuously read from a file Useful for monitoring the
|
|
||||||
health of services, see 'ls /var/log/' for log files
|
|
||||||
less [file] Pagers provding easily scrollable content (q quits) >
|
|
||||||
more [file] > e.g., 'cat very-long-file | less'
|
|
||||||
most [file] > e.g., 'cat very-long-file | most'
|
|
||||||
passwd Change user password
|
|
||||||
pwgen Password generator
|
|
||||||
reboot Restart the device
|
|
||||||
reset Reset the shell prompt if it gets garbled
|
|
||||||
|
|
||||||
$(h2 "Network Tools")
|
|
||||||
ethtool [-h] Ethernet stats, and low-level MAC/PHY settings
|
|
||||||
traceroute [-h] Trace the route ip packets follow going to a host
|
|
||||||
tcpdump [-h] Display network packet headers in real-time
|
|
||||||
arping [-h] Ping hosts by ARP requests/replies
|
|
||||||
fping [-h] Send ICMP ECHO_REQUEST packets to multiple hosts
|
|
||||||
ping [-h] Send ICMP ECHO_REQUEST packets to a network host
|
|
||||||
lynx URL [-h] The text mode web browser
|
|
||||||
netcalc [-h] Calculate IP network settings from a IP address
|
|
||||||
netcat [-h] NetCat - TCP/IP swiss army knife (alias: nc)
|
|
||||||
socat [-h] Multipurpose socket relay program
|
|
||||||
ttyd [-h] Sharing a terminal over the web
|
|
||||||
|
|
||||||
ifconfig [--help] See/Reconfigure available network interfaces
|
|
||||||
route [--help] Edit the kernel's routing tables
|
|
||||||
|
|
||||||
ifup | ifdown IFACE Bring up/down interfaces in /etc/network/interfaces
|
|
||||||
|
|
||||||
ip [link|addr] Manage available network interfaces
|
|
||||||
ip [rule|route] Manage routing tables
|
|
||||||
bridge [link|vlan] Manage bridge ports and VLANs
|
|
||||||
|
|
||||||
scp Securely copy a file to a remote host file system
|
|
||||||
tftp Copy a file to/from a remote host
|
|
||||||
ftpput Store a local file on a remote machine via FTP
|
|
||||||
ftpget Retrieve a remote file via FTP
|
|
||||||
wget Get a file using HTTP or FTP from a remote host
|
|
||||||
|
|
||||||
$(h2 "Overview Commands")
|
|
||||||
df -h List disk usage (in human readable format)
|
|
||||||
free List memory usage
|
|
||||||
ps List running processes
|
|
||||||
show [arg] Show system status, see 'show help' for more info
|
|
||||||
top Displays CPU usage and top list of running tasks
|
|
||||||
|
|
||||||
$(h2 "Interesting Files")
|
|
||||||
/etc/default/svc Command line args for service 'svc' (see above)
|
|
||||||
/etc/rc.local Local setup, runs after all services have started
|
|
||||||
/etc/network/ Directory of networking setup, see 'help net'
|
|
||||||
|
|
||||||
$(h2 "Example Commands")
|
|
||||||
cd /tmp; wget ftp://192.168.55.43/file && cat file
|
|
||||||
cd /var/log; tftp -p -l messages 192.168.55.43
|
|
||||||
cat /proc/net/arp
|
|
||||||
edit /etc/network/interfaces
|
|
||||||
|
|
||||||
$(h2 "See Also")
|
|
||||||
help edit Tutorial on VI and Mg editors
|
|
||||||
help net Network set up introduction
|
|
||||||
setup User friendly setup and diagnostic tool
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
vi()
|
|
||||||
{
|
|
||||||
cat <<EOF
|
|
||||||
$(h1 "Visual Editor (vi)")
|
|
||||||
Vi is the de facto standard editor in UNIX systems. It comes with two modes:
|
|
||||||
|
|
||||||
- $(em "Command mode (default):") administrative tasks such as saving files,
|
|
||||||
executing commands, moving the cursor, cutting and pasting lines or words,
|
|
||||||
as well as finding and replacing. $(em "Return to command mode with Esc")
|
|
||||||
|
|
||||||
- $(em "Insert mode:") Everything that's typed in this mode is interpreted as
|
|
||||||
input and placed in the file.
|
|
||||||
|
|
||||||
$(h2 "Navigation commands")
|
|
||||||
|
|
||||||
h - move the cursor one character to the left
|
|
||||||
j - move the cursor down one character
|
|
||||||
k - mode the cursor up one character
|
|
||||||
l - move the cursor right one character
|
|
||||||
b - move to beginning of word, or previous word
|
|
||||||
w - move to next word
|
|
||||||
0 - move to beginning of line
|
|
||||||
$ - move to end of line
|
|
||||||
:0 - move to beginning of file
|
|
||||||
G - move to end of file
|
|
||||||
|
|
||||||
$(h2 "Editing commands")
|
|
||||||
|
|
||||||
u - undo last operation
|
|
||||||
x - delete the character the cursor is on
|
|
||||||
cw - change word, from position of cursor
|
|
||||||
dw - delete to end of word
|
|
||||||
dd - delete the line the character is on
|
|
||||||
p - paste (line, word, or char) after cursor
|
|
||||||
P - paste (line, word, or char) before cursor
|
|
||||||
|
|
||||||
$(h2 "Saving and quit commands")
|
|
||||||
|
|
||||||
:w - save the current file
|
|
||||||
:w filename - save a copy of the file named filename
|
|
||||||
:w! - try to save the file, even if it is read only
|
|
||||||
:wq - save and quit vi
|
|
||||||
ZZ - save and quit vi
|
|
||||||
:wq! - try to save the file if it is read only, quit if successful
|
|
||||||
:wq filename - save a copy of the file named filename and quit
|
|
||||||
:wq! filename - save a copy of the file named filename and quit,
|
|
||||||
override read only permissions if possible
|
|
||||||
:q - quit vi
|
|
||||||
:q! - quit vi even if the file has unsaved changes
|
|
||||||
|
|
||||||
$(h2 "Enter insert mode")
|
|
||||||
|
|
||||||
a - append new text after the cursor
|
|
||||||
i - insert text before the cursor
|
|
||||||
o - open a new line below the cursor
|
|
||||||
O - open a new line above the cursor
|
|
||||||
|
|
||||||
> Return to command mode with Esc
|
|
||||||
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
emacs()
|
|
||||||
{
|
|
||||||
cat <<EOF
|
|
||||||
$(h1 "Micro Emacs (mg)")
|
|
||||||
Mg is a bit more user-friendly than vi. It has the same familiar interface
|
|
||||||
as Notepad, but with slightly different keybindings.
|
|
||||||
|
|
||||||
$(h2 "Introduction")
|
|
||||||
|
|
||||||
Most commands involve using the Control ("Ctrl") or the Meta ("Alt") key.
|
|
||||||
The following conventions are used in the online help:
|
|
||||||
|
|
||||||
C-<chr> means hold down the Control key while typing the character <chr>
|
|
||||||
M-<chr> means hold down the Alt key while typing the character <chr>
|
|
||||||
|
|
||||||
If you don't have a Meta/Alt key, you can use Esc instead. Press and release
|
|
||||||
the Esc key and then type <chr>. This is equivalent to M-<chr>.
|
|
||||||
|
|
||||||
$(h2 "Navigation")
|
|
||||||
|
|
||||||
Though arrow keys, Home/End, and PgUp/PgDn usually work, using Mg over serial
|
|
||||||
console can sometimes cause these keys to be mismapped by terminal program.
|
|
||||||
|
|
||||||
C-f Move forward one character (can also use right arrow key)
|
|
||||||
C-b Move backward one character (can also use left arrow key)
|
|
||||||
C-p Move up one line (can also use up arrow key)
|
|
||||||
C-n Move down one line (can also use down arrow key)
|
|
||||||
M-f Move forward one word
|
|
||||||
M-b Move backward one word
|
|
||||||
C-a Move to beginning of line (can also use Home key)
|
|
||||||
C-e Move to end of line (can also use End key)
|
|
||||||
C-v Move forward one page (can also use PgDn/Page Down key)
|
|
||||||
M-v Move backward one page (can also use PgUp/Page Up key)
|
|
||||||
M-< Move to beginning of file
|
|
||||||
M-> Move to end of file
|
|
||||||
C-x g Move to line number
|
|
||||||
|
|
||||||
$(h2 "Editing")
|
|
||||||
|
|
||||||
All edit commands that kill (cut) text is placed in a kill ring (clipboard).
|
|
||||||
Note: when marking text, there is no visual mark.
|
|
||||||
|
|
||||||
C-_ Undo, also C-x u
|
|
||||||
M-% Replace word/string in file, from cursor position
|
|
||||||
M-q Reformat paragraph (set fill column with C-x f)
|
|
||||||
C-s Search forward (type C-s again to find next)
|
|
||||||
C-r Reversed search
|
|
||||||
C-Space Set beginning of mark (beginning of selected text)
|
|
||||||
C-x C-x Jump back and forth between mark and cursor position
|
|
||||||
C-x h Mark whole buffer
|
|
||||||
C-w Wipe (cut) region from mark to cursor position
|
|
||||||
M-w Copy region from mark to cursor position
|
|
||||||
C-y Yank (paste) text from kill ring
|
|
||||||
C-k Kill (cut) to end of line
|
|
||||||
M-Backspace Kill (delete) previous word
|
|
||||||
M-d Kill (delete) next word
|
|
||||||
C-d Delete character to the right
|
|
||||||
C-o Open new line at cursor
|
|
||||||
|
|
||||||
$(h2 "General Commands")
|
|
||||||
|
|
||||||
C-g Abort current command
|
|
||||||
C-l Recenter buffer on current line
|
|
||||||
C-h b List all keybindings
|
|
||||||
M-! Run shell command, output in new buffer
|
|
||||||
C-z Suspend Mg, return to shell, use 'fg' to get back
|
|
||||||
C-x C-f Open file
|
|
||||||
C-x C-i Insert file at cursor position
|
|
||||||
C-x C-s Save file
|
|
||||||
C-x s Save file (interactive)
|
|
||||||
C-x k Kill (close) file
|
|
||||||
C-x C-b List open buffers (files)
|
|
||||||
C-x b Switch to another buffer
|
|
||||||
C-x C-c Exit
|
|
||||||
|
|
||||||
$(h2 "Window Commands")
|
|
||||||
|
|
||||||
C-x 0 Unsplit, keep other window
|
|
||||||
C-x 1 Unsplit, keep this window
|
|
||||||
C-x 2 Split window in two
|
|
||||||
C-x o Go to other window
|
|
||||||
C-x p Go to previous window
|
|
||||||
C-x n Go to next window
|
|
||||||
C-x ^ Enlarge this split
|
|
||||||
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
editor()
|
|
||||||
{
|
|
||||||
case $1 in
|
|
||||||
vi)
|
|
||||||
vi
|
|
||||||
;;
|
|
||||||
ed* | em* | mg)
|
|
||||||
emacs
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
vi
|
|
||||||
emacs
|
|
||||||
cat <<EOF
|
|
||||||
$(h1 "Summary")
|
|
||||||
Use Mg or GNU Nano if you are a beginner. The system is set up to so you can
|
|
||||||
use the 'edit' command, which will start GNU Nano:
|
|
||||||
|
|
||||||
edit /etc/rc.local # Starts GNU Nano
|
|
||||||
|
|
||||||
EOF
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
networking()
|
|
||||||
{
|
|
||||||
cat <<EOF
|
|
||||||
$(h1 "Networking")
|
|
||||||
This section details how to set up everything from basic to advanced networking.
|
|
||||||
Topics covered include:
|
|
||||||
|
|
||||||
- Static vs Dynamic Addresses
|
|
||||||
- VLAN Interfaces
|
|
||||||
- Bridging Interfaces
|
|
||||||
- Link Aggregation (bonding)
|
|
||||||
- Persistent Configuration
|
|
||||||
|
|
||||||
Please note, the terms 'port' and 'interface' may be used interchangably in
|
|
||||||
the following text (and elsewher online as well). Usually the term 'port' is
|
|
||||||
reserved for Ethernet links attached to a switch or bridge, while the term
|
|
||||||
'interface' more generically refers to the physical interface in a system.
|
|
||||||
|
|
||||||
|
|
||||||
$(h2 "Static vs Dynamic Addresses")
|
|
||||||
|
|
||||||
An IPv4 address consists of four "octets" separated by periods. A static IPv4
|
|
||||||
address can look like this:
|
|
||||||
|
|
||||||
192.168.1.42
|
|
||||||
|
|
||||||
However, for networking to function properly, a device usually needs a netmask,
|
|
||||||
default route, NTP server, and at least one DNS address. Setting all these up
|
|
||||||
statically is a lot of work to maintain, in particular with many devices.
|
|
||||||
|
|
||||||
For both IPv4 and IPv6 there is an alternative called DHCP. It is a dynamic
|
|
||||||
protocol where a server on request from a client device hands out a "lease" of
|
|
||||||
an IP address, as well as lot of other network parameters, including but not
|
|
||||||
limited to the ones already mentioned. A client device can give hints to the
|
|
||||||
server, e.g., its hostname, MAC address (default), or other client identifier.
|
|
||||||
It is up to the server to honor these hints or not, but it is very common to
|
|
||||||
set up the server to honor the client's hostname and automatically update the
|
|
||||||
central name server (DNS) when the client is online.
|
|
||||||
|
|
||||||
| There are many other interesting aspects to DHCP not covered here.
|
|
||||||
| For instance, DHCP relay servers (proxies), that can be used to
|
|
||||||
| forward DHCP requests from very large networks to a central server.
|
|
||||||
| Some relay "agents" even support something called Option 82, which
|
|
||||||
| when running on a simple switch, can attach port and relay info to
|
|
||||||
| the client's DHCP request -- allowing the server to assign an IP
|
|
||||||
| address per port, even on remote switches (with a relay agent).
|
|
||||||
|
|
||||||
When your interface is setup with DHCP, use the 'ifconfig' or 'ip addr' tools
|
|
||||||
to see which address you got, if needed (see next section).
|
|
||||||
|
|
||||||
In cases when the DHCP client cannot find a DHCP server, and thus not obtain a
|
|
||||||
lesae, the system falls back to set a link-local address (169.254.*.*). This
|
|
||||||
can be disabled by editing the file /etc/dhcpcd.conf, adding:
|
|
||||||
|
|
||||||
noipv4ll
|
|
||||||
|
|
||||||
A link-local address is however very useful, in particular in combination with
|
|
||||||
mDNS to discover and access a device you do not know, or do not want to know,
|
|
||||||
the IP address to. See more in the next section.
|
|
||||||
|
|
||||||
|
|
||||||
$(h2 "DNS and mDNS")
|
|
||||||
|
|
||||||
Managing a central DNS is both painful and time consuming, most networks, and
|
|
||||||
in particular industrial, therefore only set up a DNS for static servers and
|
|
||||||
resources. Leaving end devices, switches, and in many cases even routers,
|
|
||||||
without a human-friendly name on the network. This have misled many to think
|
|
||||||
that they need to know the IP address, and often opt for static addresses on
|
|
||||||
equipment. Meaning many devices out-of-the-box have a static address set that
|
|
||||||
need to be manually changed before the device is deployed on the network.
|
|
||||||
|
|
||||||
A less time consuming, and human-friendly, way is to enable mDNS (multicast
|
|
||||||
DNS). With this protocol the device notifies all neighbors on the same LAN
|
|
||||||
of how to reach it:
|
|
||||||
|
|
||||||
"Hello everyone, my address is 169.254.47.11, you can call me device.local"
|
|
||||||
|
|
||||||
Any other device that also has mDNS enabled can then automaticall update a
|
|
||||||
local database of name-to-address mappings. Usually the name sent out is
|
|
||||||
the device's hostname. (It is up to the device manufacturer to set a useful
|
|
||||||
default hostname, i.e., model-01-02-03, where the suffix is the last octets
|
|
||||||
of the base MAC address, from the product label on the case.)
|
|
||||||
|
|
||||||
As you can see, in combination with a link-local address (previous section)
|
|
||||||
mDNS is a very attractive combination that greatly simplify device management.
|
|
||||||
|
|
||||||
Tools:
|
|
||||||
|
|
||||||
avahi-browse -a
|
|
||||||
ping foo.local
|
|
||||||
|
|
||||||
mDNS, or more correctly mDNS-SD, is also used for *Service Discovery*. E.g.,
|
|
||||||
a printer can publish IPP records with meta data on the printer type and model
|
|
||||||
or donwload URL for drivers. Switches and routers usually publish how they
|
|
||||||
can be reached: HTTP/HTTPS and SSH.
|
|
||||||
|
|
||||||
mDNS is supported in this product and should be enabled by default. To
|
|
||||||
verify that it works, in Windows, macOS, or Linux, open your web browser
|
|
||||||
and point it to <https://hostname-01-02-03.local>. This is the hostname
|
|
||||||
and three last octets of the device's base MAC address. You can also use
|
|
||||||
mDNS browsers or command line tools like mdns-scan
|
|
||||||
|
|
||||||
|
|
||||||
$(h2 "VLAN Interfaces")
|
|
||||||
|
|
||||||
A VLAN interface in Linux is an "upper" interface, e.g., 'eth0.1'. It is
|
|
||||||
where you set an IP address and interact with th rest of the world. The
|
|
||||||
base/raw/lower interface, here 'eth0', is the physical interface on which
|
|
||||||
Ethernet packets ingress and egress with a VLAN tag. To create 'eth0.1':
|
|
||||||
|
|
||||||
ip link add eth0.1 link eth0 vlan id 1
|
|
||||||
|
|
||||||
In Linux a VLAN interface is a "stackable" entity. Many VLAN interfaces
|
|
||||||
can be built on top of each other. When injecting a packet on the top
|
|
||||||
most interface, the kernel adds the corresponding VLAN "tag" when the
|
|
||||||
packet goes down the order of stacked interfaces, and then finally hits
|
|
||||||
the physical interface and proceeds to egress onto the media.
|
|
||||||
|
|
||||||
ip link add eth0.1.2 link eth0.1 vlan id 2
|
|
||||||
|
|
||||||
Injecting a packet on 'eth0.1.2' creates a double-tagged VLAN frame when
|
|
||||||
the packet egresses 'eth0'. The outermost tag has VID 1 and the inner
|
|
||||||
VID is 2.
|
|
||||||
|
|
||||||
VLAN interfaces can be used for many things, here we will focus on their
|
|
||||||
use as upper interface on a bridge.
|
|
||||||
|
|
||||||
|
|
||||||
$(h2 "Bridging Interfaces")
|
|
||||||
|
|
||||||
A bridge is the correct name for a switch. In the context of this text,
|
|
||||||
however, we will use the term to refer to the Linux bridge module in the
|
|
||||||
kernel, which implements an advanced software switch. The Linux bridge
|
|
||||||
supports "offloading" many switching functions to an underlying switching
|
|
||||||
chipset, when available. This greatly simplifies managing that switch since
|
|
||||||
the same tools one use to manage the bridge will, by extension, also be used
|
|
||||||
to manage the switch.
|
|
||||||
|
|
||||||
To create a bridge in Linux:
|
|
||||||
|
|
||||||
ip link add br0 type bridge
|
|
||||||
|
|
||||||
To add three ports (interfaces) to the bridge we use:
|
|
||||||
|
|
||||||
ip link set eth0 master br0
|
|
||||||
ip link set eth1 master br0
|
|
||||||
ip link set eth2 master br0
|
|
||||||
|
|
||||||
Bring all ports and the bridge 'up' and you have a working switch! Any frame
|
|
||||||
injected on eth0 (from the outside) can be switched to either of eth1, eth2,
|
|
||||||
*or* br0. As soon as the bridge has learned where end devices are connected,
|
|
||||||
none of the other ports will see the traffic -- like a regular switch.
|
|
||||||
|
|
||||||
Note: these ports should not (cannot) have any IP address. Instead, any IP
|
|
||||||
address is set on 'br0'. To disable IPv6 link-local address, set the
|
|
||||||
/proc/sys/net/ipv6/conf/eth0/disable_ipv6 sysctl file to '1'.
|
|
||||||
|
|
||||||
|
|
||||||
$(h2 "Bridging and VLANs")
|
|
||||||
|
|
||||||
A VLAN-aware bridge works the same way, only with VLAN separation taken into
|
|
||||||
account. All communication, as well as MAC address learning, is limited to
|
|
||||||
ports in the same VLAN. The syntax is slightly different and requires a few
|
|
||||||
more steps:
|
|
||||||
|
|
||||||
ip link add br0 type bridge vlan_filtering 1
|
|
||||||
ip link set eth0 master br0
|
|
||||||
ip link set eth1 master br0
|
|
||||||
ip link set eth2 master br0
|
|
||||||
ip link set eth3 master br0
|
|
||||||
|
|
||||||
To assign ports to different VLANs, and make sure they are regular "access"
|
|
||||||
ports (untagged). We assign eth0 and eth1 to VLAN 1 and the others to VLAN 2:
|
|
||||||
|
|
||||||
bridge vlan add vid 1 dev eth0 pvid untagged
|
|
||||||
bridge vlan add vid 1 dev eth1 pvid untagged
|
|
||||||
bridge vlan add vid 2 dev eth2 pvid untagged
|
|
||||||
bridge vlan add vid 2 dev eth3 pvid untagged
|
|
||||||
|
|
||||||
Here's the twist, to be able to reach the bridge (switch) itself from each
|
|
||||||
VLAN, we need to ensure the bridge itself is a tagged member of each VLAN:
|
|
||||||
|
|
||||||
bridge vlan add vid 1 dev br0 self
|
|
||||||
bridge vlan add vid 2 dev br0 self
|
|
||||||
|
|
||||||
This way we can add VLAN interfaces on top of br0, which we in turn can set
|
|
||||||
a static or dynamic IP address on:
|
|
||||||
|
|
||||||
ip link add vlan1 link br0 type vlan id 1
|
|
||||||
ip link add vlan2 link br0 type vlan id 2
|
|
||||||
|
|
||||||
The resulting stack of interfaces look like this:
|
|
||||||
|
|
||||||
:
|
|
||||||
vlan1 : vlan2 Layer-3 :: IP Networking
|
|
||||||
\\ : / _________________________
|
|
||||||
.-------------.
|
|
||||||
| br0 | Layer-2 :: Switching
|
|
||||||
'-------------' _________________________
|
|
||||||
/ | : | \\
|
|
||||||
eth0 eth1 : eth2 eth3 Layer-1 :: Link layer
|
|
||||||
:
|
|
||||||
|
|
||||||
|
|
||||||
$(h2 "Persistent Configuration")
|
|
||||||
|
|
||||||
A simple end device can get by with the following in /etc/network/interfaces:
|
|
||||||
|
|
||||||
auto lo
|
|
||||||
iface lo inet loopback
|
|
||||||
|
|
||||||
auto eth0
|
|
||||||
iface eth0 inet dhcp
|
|
||||||
|
|
||||||
This brings up both the loopback (required for UNIX networking to function),
|
|
||||||
and the (presumed only) Ethernet interface. The loopback gets its standard
|
|
||||||
address, 127.0.0.1, and eth0 will request its IP address using DHCP.
|
|
||||||
|
|
||||||
To set up the bridge example (above), is actually quite a lot easier than
|
|
||||||
using the command line ip and bridge tools. Create the file 'bridge':
|
|
||||||
|
|
||||||
edit /etc/network/interfaces.d/bridge
|
|
||||||
|
|
||||||
Paste in the following content:
|
|
||||||
|
|
||||||
iface e0
|
|
||||||
bridge-access 1
|
|
||||||
iface e1
|
|
||||||
bridge-access 1
|
|
||||||
iface e2
|
|
||||||
bridge-access 2
|
|
||||||
iface e3
|
|
||||||
bridge-access 2
|
|
||||||
|
|
||||||
auto br0
|
|
||||||
iface br0
|
|
||||||
bridge-ports e0 e1 e2 e3
|
|
||||||
bridge-vlan-aware yes
|
|
||||||
bridge-stp on
|
|
||||||
bridge-vids 1 2
|
|
||||||
|
|
||||||
auto vlan1
|
|
||||||
iface vlan1 inet dhcp
|
|
||||||
vlan-id 1
|
|
||||||
vlan-raw-device br0
|
|
||||||
|
|
||||||
auto vlan2
|
|
||||||
iface vlan2 inet static
|
|
||||||
vlan-id 2
|
|
||||||
vlan-raw-device br0
|
|
||||||
address 192.168.2.1/24
|
|
||||||
|
|
||||||
Notice how 'vlan1' only has a DHCP and 'vlan2' uses a static address. It is
|
|
||||||
possible to combine the two if needed. Use 'inet dhcp' and add an 'address'
|
|
||||||
statement to the iface stanza.
|
|
||||||
|
|
||||||
|
|
||||||
$(h2 "Port Classification")
|
|
||||||
|
|
||||||
The bundled 'show' script is a very handy tool. It use several tricks to make
|
|
||||||
information about the system more accessible. On switching capable hardware
|
|
||||||
products, switch ports are identified early at system bootstrap and placed in
|
|
||||||
the 'port' group. See 'ip link' output:
|
|
||||||
|
|
||||||
...
|
|
||||||
4: e0: <BROADCAST,MULTICAST> master br0 state UP $(em "group port")
|
|
||||||
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
|
|
||||||
...
|
|
||||||
|
|
||||||
When running in Qemu or other hardware it may be useful to manually classify
|
|
||||||
certain interfaces as ports. This can be achieved in many ways, here we show
|
|
||||||
two. First /etc/mactab, which is read at boot to rename interfaces according
|
|
||||||
their matching MAC address, one interface per line:
|
|
||||||
|
|
||||||
e0 52:54:00:12:34:56
|
|
||||||
e1 52:54:00:12:34:57
|
|
||||||
e2 52:54:00:12:34:58
|
|
||||||
e3 52:54:00:12:34:59
|
|
||||||
|
|
||||||
Another way is to add something like this to /etc/rc.local:
|
|
||||||
|
|
||||||
for port in eth0 eth1 eth3 eth4; do
|
|
||||||
ip link set \$port group port
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
$(h2 "Interesting Files")
|
|
||||||
|
|
||||||
- /etc/dhcpcd.conf General DHCP and ZeroConf (LL) settings
|
|
||||||
- /etc/network/interfaces The original, useful for small setups
|
|
||||||
- /etc/network/interfaces.d/* Snippets, useful for non-trivial setups
|
|
||||||
- /etc/mactab Rename interfaces: 'NAME16CHARS WHITESPACE MAC'
|
|
||||||
- /etc/sysctl.conf Interface and TCP/IP settings, e.g., routing
|
|
||||||
- /etc/sysctl.d/* Snippets, useful for per-subsystem settings
|
|
||||||
|
|
||||||
|
|
||||||
$(h1 "Summary")
|
|
||||||
All persistent networking is set up in /etc/network/interfaces using the
|
|
||||||
program ifupdown-ng. The tools to reconfigure networking at runtime are:
|
|
||||||
|
|
||||||
ifup [-a] [IFACES]
|
|
||||||
ifdown [-a] [IFACES]
|
|
||||||
|
|
||||||
When changing the configuration at runtime you usually have to bring the
|
|
||||||
affected interfaces down (ifdown e0 e1 e2 e3), if they were set up with
|
|
||||||
/etc/network/interfaces before. Then do the change, and bring it all up
|
|
||||||
again.
|
|
||||||
|
|
||||||
Both tools understand dependencies between interfaces, so when a 'ifup -a'
|
|
||||||
command is received it brings up all interfaces: adding links to br0 before
|
|
||||||
adding VLANs, the vlan1 and vlan2 interfaces on top so it of it all. Then
|
|
||||||
finally it can start the DHCP client on vlan1 and set the static IP address
|
|
||||||
on vlan2.
|
|
||||||
|
|
||||||
$(em ">>> Be careful with these tools when logged in remotely! <<<")
|
|
||||||
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
topic()
|
|
||||||
{
|
|
||||||
topic=$1
|
|
||||||
[ -n "$1" ] && shift
|
|
||||||
|
|
||||||
case $topic in
|
|
||||||
ed*)
|
|
||||||
# shellcheck disable=SC2068
|
|
||||||
editor $*
|
|
||||||
;;
|
|
||||||
net*)
|
|
||||||
networking
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
overview
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$1" = "-p" ]; then
|
|
||||||
shift
|
|
||||||
pager="cat"
|
|
||||||
plain="yes"
|
|
||||||
else
|
|
||||||
if command -v most; then
|
|
||||||
pager=most
|
|
||||||
elif command -v less; then
|
|
||||||
pager="less -R"
|
|
||||||
elif command -v more; then
|
|
||||||
pager="more"
|
|
||||||
else
|
|
||||||
pager="cat"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -t 1 ] ; then
|
|
||||||
fn=$(mktemp /tmp/system-help.XXXXXX)
|
|
||||||
# shellcheck disable=SC2086,SC2068
|
|
||||||
topic $@ >"$fn"
|
|
||||||
$pager "$fn"
|
|
||||||
rm "$fn"
|
|
||||||
else
|
|
||||||
topic "$*"
|
|
||||||
fi
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Changes hostname in /etc/hostname and /etc/hosts
|
|
||||||
|
|
||||||
current=$(cat /etc/hostname)
|
|
||||||
newname=$1
|
|
||||||
|
|
||||||
[ -n "$newname" ] || exit 1
|
|
||||||
|
|
||||||
sed -i "s/$current/$newname/" /etc/hosts
|
|
||||||
sed -i "s/$current/$newname/" /etc/hostname
|
|
||||||
|
|
||||||
hostname $newname
|
|
||||||
|
|
||||||
initctl touch sysklogd
|
|
||||||
initctl touch dnsmasq
|
|
||||||
initctl reload
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
pdmenu
|
|
||||||
clear
|
|
||||||
@@ -1,327 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Displays basic information about the system
|
|
||||||
# shellcheck disable=SC2048,SC2086
|
|
||||||
. /etc/os-release
|
|
||||||
|
|
||||||
bopt="-c"
|
|
||||||
opt="-br"
|
|
||||||
all=""
|
|
||||||
plain=""
|
|
||||||
|
|
||||||
TTY=$(resize)
|
|
||||||
eval "$TTY"
|
|
||||||
|
|
||||||
# COLUMS and ROWS should be set on the console, if not, use fallback
|
|
||||||
if [ -z "$COLUMNS" ]; then
|
|
||||||
if command -v tput; then
|
|
||||||
COLUMNS=$(tput cols)
|
|
||||||
else
|
|
||||||
COLUMNS=80
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
h1()
|
|
||||||
{
|
|
||||||
STR="$*"
|
|
||||||
if [ -n "$plain" ]; then
|
|
||||||
echo "$STR" | tr '[:lower:]' '[:upper:]'
|
|
||||||
else
|
|
||||||
printf "\033[7m%-${COLUMNS}s\033[0m\n" "$STR"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
h2()
|
|
||||||
{
|
|
||||||
STR="$*"
|
|
||||||
if [ -n "$plain" ]; then
|
|
||||||
echo "$STR"
|
|
||||||
echo "$STR" | sed 's/./-/g'
|
|
||||||
else
|
|
||||||
printf "\033[1m%-${COLUMNS}s\033[0m\n" "$STR"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
dm()
|
|
||||||
{
|
|
||||||
if [ -n "$plain" ]; then
|
|
||||||
echo "${*}"
|
|
||||||
else
|
|
||||||
printf "\033[2m%s\033[0m\n" "$*"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
ul()
|
|
||||||
{
|
|
||||||
if [ -n "$plain" ]; then
|
|
||||||
printf "__%s__" "$*"
|
|
||||||
else
|
|
||||||
printf "\033[4%s\033[0m" "$*"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
em()
|
|
||||||
{
|
|
||||||
if [ -n "$plain" ]; then
|
|
||||||
printf "**%s**" "$*"
|
|
||||||
else
|
|
||||||
printf "\033[5m%s\033[0m" "$*"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
usage()
|
|
||||||
{
|
|
||||||
cat <<EOF
|
|
||||||
usage:
|
|
||||||
show [opt] cmd
|
|
||||||
|
|
||||||
options:
|
|
||||||
-a Show all, of something
|
|
||||||
-f Show full output, not brief port/iface listings
|
|
||||||
-h Show this help text
|
|
||||||
-n Show output without any footer
|
|
||||||
-p Show plain output, no bells or whistles
|
|
||||||
|
|
||||||
commands:
|
|
||||||
port PORT Show port configuration and link information
|
|
||||||
ports Show ports available for bridging
|
|
||||||
vlans Show port groups in bridge
|
|
||||||
ifaces Show interfaces and their addresses
|
|
||||||
fdb Show forwarding database (unicast)
|
|
||||||
mdb Show multicast forwarding database
|
|
||||||
ip route Show routing table
|
|
||||||
log [FILE] Show latest entries from syslog, or other FILE
|
|
||||||
rmon PORT Show RMON counters for PORT (when applicable)
|
|
||||||
system Show OS details
|
|
||||||
version Show OS verson
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
# Usage 1: show port eth0
|
|
||||||
# Usage 2: show port
|
|
||||||
# Usage 3: show ports
|
|
||||||
#
|
|
||||||
# The first show ethtool output for 'eth0' (in this case). The latter
|
|
||||||
# two are the same, showing a summary of all interfaces classified as
|
|
||||||
# access ports.
|
|
||||||
ports()
|
|
||||||
{
|
|
||||||
if [ $# -gt 0 ] && [ -e "/sys/class/net/$1" ]; then
|
|
||||||
for port in $*; do
|
|
||||||
ethtool "$port"
|
|
||||||
done
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
h1 "PORT STATE MAC ADDRESS FLAGS"
|
|
||||||
if grep -q port /etc/iproute2/group && [ -z "$all" ]; then
|
|
||||||
ip $opt link show group port
|
|
||||||
else
|
|
||||||
ip $opt link show
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$plain" ] && [ -z "$nofoot" ]; then
|
|
||||||
dm "______________________________________________________________________________"
|
|
||||||
dm "Use: '[ip|bridge] --help' and '[ip|bridge] link help' for more details."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
vlans()
|
|
||||||
{
|
|
||||||
h1 "INTERFACE VLAN FLAGS"
|
|
||||||
bridge $bopt vlan show |tail +2 | awk 'NF { iface=$1; vid=$2; printf("%-16s %4d ", iface, vid); for (i=3; i <= NF; i++) printf("%s ", $i); printf("\n"); }'
|
|
||||||
if [ -z "$plain" ] && [ -z "$nofoot" ]; then
|
|
||||||
dm "______________________________________________________________________________"
|
|
||||||
dm "See: 'bridge --help' and 'bridge vlan help' for more details."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
ifaces()
|
|
||||||
{
|
|
||||||
h1 "INTERFACE STATE ADDRESS"
|
|
||||||
if [ -n "$all" ]; then
|
|
||||||
ip $opt addr show
|
|
||||||
elif grep -q iface /etc/iproute2/group; then
|
|
||||||
ip $opt addr show group iface
|
|
||||||
else
|
|
||||||
ip $opt addr show |awk '{ if ($1 !~ /eth[0-9]*/ && $1 !~ /.*@NONE/) { print }}'
|
|
||||||
fi
|
|
||||||
if [ -z "$plain" ] && [ -z "$nofoot" ]; then
|
|
||||||
dm "______________________________________________________________________________"
|
|
||||||
dm "See: 'ip --help' and 'ip address help' for more details."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
log()
|
|
||||||
{
|
|
||||||
if [ -n "$1" ] && [ -r "/var/log/$1" ]; then
|
|
||||||
fn="/var/log/$1"
|
|
||||||
else
|
|
||||||
fn="/var/log/syslog"
|
|
||||||
fi
|
|
||||||
if [ -n "$all" ]; then
|
|
||||||
cat $fn
|
|
||||||
else
|
|
||||||
tail -$LINES $fn
|
|
||||||
fi
|
|
||||||
if [ -z "$plain" ] && [ -z "$nofoot" ]; then
|
|
||||||
dm "______________________________________________________________________________"
|
|
||||||
dm "See: 'tail -25 /log/FILE', 'tail -F /log/FILE' to continuously monitor files."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
rmon()
|
|
||||||
{
|
|
||||||
if [ -z "$*" ]; then
|
|
||||||
echo "Missing argument, see 'show port' for available interfaces"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
for port in $*; do
|
|
||||||
ethtool -S "$port"
|
|
||||||
done
|
|
||||||
if [ -z "$plain" ] && [ -z "$nofoot" ]; then
|
|
||||||
dm "______________________________________________________________________________"
|
|
||||||
dm "See: 'ethtool --help' for more details."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
rstp()
|
|
||||||
{
|
|
||||||
mstpctl showbridge
|
|
||||||
echo "br0 port info"
|
|
||||||
mstpctl showport br0
|
|
||||||
}
|
|
||||||
|
|
||||||
fdb()
|
|
||||||
{
|
|
||||||
bridge $bopt fdb show
|
|
||||||
}
|
|
||||||
|
|
||||||
mdb()
|
|
||||||
{
|
|
||||||
bridge $bopt mdb show
|
|
||||||
}
|
|
||||||
|
|
||||||
routes()
|
|
||||||
{
|
|
||||||
ip $opt route show
|
|
||||||
}
|
|
||||||
|
|
||||||
igmp()
|
|
||||||
{
|
|
||||||
querierctl $@
|
|
||||||
}
|
|
||||||
|
|
||||||
system()
|
|
||||||
{
|
|
||||||
h1 "SYSTEM INFORMATION"
|
|
||||||
echo "System Name : $(uname -n)"
|
|
||||||
echo "System Variant : $VARIANT"
|
|
||||||
echo "System Description : $PRETTY_NAME"
|
|
||||||
echo "System Contact : $HOME_URL"
|
|
||||||
echo "System Timezone : $(cat /etc/timezone)"
|
|
||||||
echo "System Type : $NAME"
|
|
||||||
echo "System Version : $(cat /etc/version)"
|
|
||||||
echo "System Arch : $(uname -m)"
|
|
||||||
echo "Kernel Version : $(uname -sr)"
|
|
||||||
}
|
|
||||||
|
|
||||||
version()
|
|
||||||
{
|
|
||||||
cat /etc/version
|
|
||||||
}
|
|
||||||
|
|
||||||
while [ "$1" != "" ]; do
|
|
||||||
case $1 in
|
|
||||||
-a)
|
|
||||||
all=1
|
|
||||||
;;
|
|
||||||
-f)
|
|
||||||
opt=""
|
|
||||||
if [ -n "$plain" ]; then
|
|
||||||
opt="-color=never"
|
|
||||||
bopt="-color=never"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
-n)
|
|
||||||
nofoot="yes"
|
|
||||||
;;
|
|
||||||
-p)
|
|
||||||
plain="yes"
|
|
||||||
opt="$opt -color=never"
|
|
||||||
bopt="$bopt -color=never"
|
|
||||||
;;
|
|
||||||
-h)
|
|
||||||
usage
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
break
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
cmd=$1
|
|
||||||
if [ -n "$cmd" ]; then
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $cmd in
|
|
||||||
help)
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
port*)
|
|
||||||
ports $*
|
|
||||||
;;
|
|
||||||
vlan*)
|
|
||||||
vlans
|
|
||||||
;;
|
|
||||||
fdb)
|
|
||||||
fdb
|
|
||||||
;;
|
|
||||||
mdb)
|
|
||||||
mdb
|
|
||||||
;;
|
|
||||||
if*)
|
|
||||||
ifaces
|
|
||||||
;;
|
|
||||||
ip)
|
|
||||||
cmd=$1
|
|
||||||
shift
|
|
||||||
case $cmd in
|
|
||||||
addr*)
|
|
||||||
ifaces
|
|
||||||
;;
|
|
||||||
route*)
|
|
||||||
routes
|
|
||||||
;;
|
|
||||||
igmp*)
|
|
||||||
igmp $*
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
log)
|
|
||||||
log $1
|
|
||||||
;;
|
|
||||||
rmon)
|
|
||||||
rmon $*
|
|
||||||
;;
|
|
||||||
route*)
|
|
||||||
routes
|
|
||||||
;;
|
|
||||||
span*)
|
|
||||||
rstp
|
|
||||||
;;
|
|
||||||
sys*)
|
|
||||||
system
|
|
||||||
;;
|
|
||||||
ver*)
|
|
||||||
version
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
usage
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#set -x
|
|
||||||
|
|
||||||
usage()
|
|
||||||
{
|
|
||||||
cat <<EOF
|
|
||||||
usage:
|
|
||||||
yorn [-h] ["Do you want to run command?" command]
|
|
||||||
|
|
||||||
options:
|
|
||||||
-h Show this help text
|
|
||||||
-p Show plain output, no bells or whistles
|
|
||||||
|
|
||||||
Displays the yes-or-no question and runs command on yes.
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
|
||||||
usage
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
-h)
|
|
||||||
usage
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
-p)
|
|
||||||
plain=1
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
question=$1
|
|
||||||
shift
|
|
||||||
command=$*
|
|
||||||
if [ -z "$command" ]; then
|
|
||||||
usage
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$plain" ]; then
|
|
||||||
if dialog --erase-on-exit --colors --defaultno --yesno "\Zb$question\ZB" 0 0; then
|
|
||||||
yorn=y
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# shellcheck disable=SC2162,SC3045
|
|
||||||
read -n 1 -p "$question (y/N): " yorn
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$yorn" = "y" ] || [ "$yorn" = "Y" ]; then
|
|
||||||
$command
|
|
||||||
fi
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
# System-wide .bashrc file for interactive bash(1) shells.
|
|
||||||
|
|
||||||
# If not running interactively, don't do anything
|
|
||||||
[ -z "$PS1" ] && return
|
|
||||||
|
|
||||||
# Reevaluate for each line, in case hostname changes
|
|
||||||
function prompt_command
|
|
||||||
{
|
|
||||||
PS1="\u@$(hostname):\w\$ "
|
|
||||||
}
|
|
||||||
export PROMPT_COMMAND=prompt_command
|
|
||||||
|
|
||||||
# check the window size after each command and, if necessary,
|
|
||||||
# update the values of LINES and COLUMNS.
|
|
||||||
shopt -s checkwinsize
|
|
||||||
|
|
||||||
# Disble built-ins
|
|
||||||
enable -n help
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
# Infix's configuration for dhcpcd.
|
|
||||||
# See dhcpcd.conf(5) for details.
|
|
||||||
|
|
||||||
# Allow users of this group to interact with dhcpcd via the control socket.
|
|
||||||
#controlgroup wheel
|
|
||||||
|
|
||||||
# Inform the DHCP server of our hostname for DDNS.
|
|
||||||
#hostname
|
|
||||||
|
|
||||||
# Use the hardware address of the interface for the Client ID.
|
|
||||||
#clientid
|
|
||||||
# or
|
|
||||||
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
|
|
||||||
# Some non-RFC compliant DHCP servers do not reply with this set.
|
|
||||||
# In this case, comment out duid and enable clientid above.
|
|
||||||
duid
|
|
||||||
|
|
||||||
# Persist interface configuration when dhcpcd exits.
|
|
||||||
persistent
|
|
||||||
|
|
||||||
# vendorclassid is set to blank to avoid sending the default of
|
|
||||||
# dhcpcd-<version>:<os>:<machine>:<platform>
|
|
||||||
vendorclassid
|
|
||||||
|
|
||||||
# A list of options to request from the DHCP server.
|
|
||||||
option domain_name_servers, domain_name, domain_search
|
|
||||||
option classless_static_routes
|
|
||||||
# Respect the network MTU. This is applied to DHCP routes.
|
|
||||||
option interface_mtu
|
|
||||||
|
|
||||||
# Request a hostname from the network
|
|
||||||
option host_name
|
|
||||||
|
|
||||||
# Most distributions have NTP support.
|
|
||||||
#option ntp_servers
|
|
||||||
|
|
||||||
# Rapid commit support.
|
|
||||||
# Safe to enable by default because it requires the equivalent option set
|
|
||||||
# on the server to actually work.
|
|
||||||
option rapid_commit
|
|
||||||
|
|
||||||
# A ServerID is required by RFC2131.
|
|
||||||
require dhcp_server_identifier
|
|
||||||
|
|
||||||
# Generate SLAAC address using the Hardware Address of the interface
|
|
||||||
#slaac hwaddr
|
|
||||||
# OR generate Stable Private IPv6 Addresses based from the DUID
|
|
||||||
slaac private
|
|
||||||
|
|
||||||
# Background immediately, do not wait for DHCP lease (speed up boot process)
|
|
||||||
background
|
|
||||||
@@ -1,144 +0,0 @@
|
|||||||
#
|
|
||||||
# Run-time configuration file for dialog
|
|
||||||
#
|
|
||||||
# Automatically generated by "dialog --create-rc <file>"
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Types of values:
|
|
||||||
#
|
|
||||||
# Number - <number>
|
|
||||||
# String - "string"
|
|
||||||
# Boolean - <ON|OFF>
|
|
||||||
# Attribute - (foreground,background,highlight?,underline?,reverse?)
|
|
||||||
|
|
||||||
# Set aspect-ration.
|
|
||||||
aspect = 0
|
|
||||||
|
|
||||||
# Set separator (for multiple widgets output).
|
|
||||||
separate_widget = ""
|
|
||||||
|
|
||||||
# Set tab-length (for textbox tab-conversion).
|
|
||||||
tab_len = 0
|
|
||||||
|
|
||||||
# Make tab-traversal for checklist, etc., include the list.
|
|
||||||
visit_items = OFF
|
|
||||||
|
|
||||||
# Shadow dialog boxes? This also turns on color.
|
|
||||||
use_shadow = ON
|
|
||||||
|
|
||||||
# Turn color support ON or OFF
|
|
||||||
use_colors = ON
|
|
||||||
|
|
||||||
# Screen color
|
|
||||||
screen_color = (WHITE,BLUE,OFF)
|
|
||||||
|
|
||||||
# Shadow color
|
|
||||||
shadow_color = (BLACK,BLACK,OFF)
|
|
||||||
|
|
||||||
# Dialog box color
|
|
||||||
dialog_color = (BLACK,CYAN,OFF)
|
|
||||||
|
|
||||||
# Dialog box title color
|
|
||||||
title_color = (BLACK,CYAN,ON)
|
|
||||||
|
|
||||||
# Dialog box border color
|
|
||||||
border_color = dialog_color
|
|
||||||
|
|
||||||
# Active button color
|
|
||||||
button_active_color = (CYAN,BLACK,ON)
|
|
||||||
|
|
||||||
# Inactive button color
|
|
||||||
button_inactive_color = dialog_color
|
|
||||||
|
|
||||||
# Active button key color
|
|
||||||
button_key_active_color = (WHITE,BLACK,ON)
|
|
||||||
|
|
||||||
# Inactive button key color
|
|
||||||
button_key_inactive_color = (WHITE,CYAN,ON)
|
|
||||||
|
|
||||||
# Active button label color
|
|
||||||
button_label_active_color = button_active_color
|
|
||||||
|
|
||||||
# Inactive button label color
|
|
||||||
button_label_inactive_color = dialog_color
|
|
||||||
|
|
||||||
# Input box color
|
|
||||||
inputbox_color = (BLACK,CYAN,OFF)
|
|
||||||
|
|
||||||
# Input box border color
|
|
||||||
inputbox_border_color = inputbox_color
|
|
||||||
|
|
||||||
# Search box color
|
|
||||||
searchbox_color = inputbox_color
|
|
||||||
|
|
||||||
# Search box title color
|
|
||||||
searchbox_title_color = (BLUE,WHITE,ON)
|
|
||||||
|
|
||||||
# Search box border color
|
|
||||||
searchbox_border_color = (WHITE,WHITE,ON)
|
|
||||||
|
|
||||||
# File position indicator color
|
|
||||||
position_indicator_color = searchbox_title_color
|
|
||||||
|
|
||||||
# Menu box color
|
|
||||||
menubox_color = dialog_color
|
|
||||||
|
|
||||||
# Menu box border color
|
|
||||||
menubox_border_color = dialog_color
|
|
||||||
|
|
||||||
# Item color
|
|
||||||
item_color = inputbox_color
|
|
||||||
|
|
||||||
# Selected item color
|
|
||||||
item_selected_color = button_key_active_color
|
|
||||||
|
|
||||||
# Tag color
|
|
||||||
tag_color = button_inactive_color
|
|
||||||
|
|
||||||
# Selected tag color
|
|
||||||
tag_selected_color = (CYAN,BLACK,OFF)
|
|
||||||
|
|
||||||
# Tag key color
|
|
||||||
tag_key_color = button_key_inactive_color
|
|
||||||
|
|
||||||
# Selected tag key color
|
|
||||||
tag_key_selected_color = (WHITE,BLACK,ON)
|
|
||||||
|
|
||||||
# Check box color
|
|
||||||
check_color = inputbox_color
|
|
||||||
|
|
||||||
# Selected check box color
|
|
||||||
check_selected_color = button_key_active_color
|
|
||||||
|
|
||||||
# Up arrow color
|
|
||||||
uarrow_color = (GREEN,WHITE,ON)
|
|
||||||
|
|
||||||
# Down arrow color
|
|
||||||
darrow_color = uarrow_color
|
|
||||||
|
|
||||||
# Item help-text color
|
|
||||||
itemhelp_color = (WHITE,BLACK,OFF)
|
|
||||||
|
|
||||||
# Active form text color
|
|
||||||
form_active_text_color = button_key_active_color
|
|
||||||
|
|
||||||
# Form text color
|
|
||||||
form_text_color = (WHITE,CYAN,ON)
|
|
||||||
|
|
||||||
# Readonly form item color
|
|
||||||
form_item_readonly_color = (CYAN,WHITE,ON)
|
|
||||||
|
|
||||||
# Dialog box gauge color
|
|
||||||
gauge_color = searchbox_title_color
|
|
||||||
|
|
||||||
# Dialog box border2 color
|
|
||||||
border2_color = dialog_color
|
|
||||||
|
|
||||||
# Input box border2 color
|
|
||||||
inputbox_border2_color = inputbox_color
|
|
||||||
|
|
||||||
# Search box border2 color
|
|
||||||
searchbox_border2_color = inputbox_color
|
|
||||||
|
|
||||||
# Menu box border2 color
|
|
||||||
menubox_border2_color = dialog_color
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
run [S] /libexec/infix/swup --
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
# NetBox mdev.conf based on https://github.com/slashbeast/mdev-like-a-boss/
|
|
||||||
|
|
||||||
# Syntax:
|
|
||||||
# [-]devicename_regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
|
|
||||||
# [-]$ENVVAR=regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
|
|
||||||
# [-]@maj,min[-min2] user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
|
|
||||||
#
|
|
||||||
# [-]: do not stop on this match, continue reading mdev.conf
|
|
||||||
# =: move, >: move and create a symlink
|
|
||||||
# !: do not create device node
|
|
||||||
# @|$|*: run cmd if $ACTION=remove, @cmd if $ACTION=add, *cmd in all cases
|
|
||||||
|
|
||||||
# support module loading on hotplug
|
|
||||||
$MODALIAS=.* root:root 660 @modprobe -b "$MODALIAS"
|
|
||||||
|
|
||||||
# null may already exist; therefore ownership has to be changed with command
|
|
||||||
null root:root 666 @chmod 666 $MDEV
|
|
||||||
zero root:root 666
|
|
||||||
full root:root 666
|
|
||||||
random root:root 444
|
|
||||||
urandom root:root 444
|
|
||||||
hwrandom root:root 444
|
|
||||||
grsec root:root 660
|
|
||||||
|
|
||||||
# Kernel-based Virtual Machine.
|
|
||||||
#kvm root:kvm 660
|
|
||||||
|
|
||||||
# vhost-net, to be used with kvm.
|
|
||||||
#vhost-net root:kvm 660
|
|
||||||
|
|
||||||
kmem root:root 640
|
|
||||||
mem root:root 640
|
|
||||||
port root:root 640
|
|
||||||
# console may already exist; therefore ownership has to be changed with command
|
|
||||||
console root:tty 600 @chmod 600 $MDEV
|
|
||||||
ptmx root:tty 666
|
|
||||||
pty.* root:tty 660
|
|
||||||
|
|
||||||
# Typical devices
|
|
||||||
tty root:tty 666
|
|
||||||
tty[0-9]* root:tty 660
|
|
||||||
vcsa*[0-9]* root:tty 660
|
|
||||||
ttyS[0-9]* root:dialout 660
|
|
||||||
|
|
||||||
# block devices
|
|
||||||
ram([0-9]*) root:disk 660 >rd/%1
|
|
||||||
loop([0-9]+) root:disk 660 >loop/%1
|
|
||||||
sr[0-9]* root:cdrom 660 @ln -sf $MDEV cdrom
|
|
||||||
fd[0-9]* root:floppy 660
|
|
||||||
#SUBSYSTEM=block;.* root:disk 660 */libexec/infix/storage-device
|
|
||||||
|
|
||||||
# Run settle-nics every time new NIC appear.
|
|
||||||
# If you don't want to auto-populate /etc/mactab with NICs,
|
|
||||||
# run 'settle-nis' without '--write-mactab' param.
|
|
||||||
#-SUBSYSTEM=net;DEVPATH=.*/net/.*;.* root:root 600 @/libexec/infix/settle-nics --write-mactab
|
|
||||||
|
|
||||||
net/tun[0-9]* root:netdev 660
|
|
||||||
net/tap[0-9]* root:root 600
|
|
||||||
|
|
||||||
# alsa sound devices and audio stuff
|
|
||||||
#SUBSYSTEM=sound;.* root:audio 660 @/libexec/infix/sound-control
|
|
||||||
|
|
||||||
adsp root:audio 660 >sound/
|
|
||||||
audio root:audio 660 >sound/
|
|
||||||
dsp root:audio 660 >sound/
|
|
||||||
mixer root:audio 660 >sound/
|
|
||||||
sequencer.* root:audio 660 >sound/
|
|
||||||
|
|
||||||
|
|
||||||
# raid controllers
|
|
||||||
cciss!(.*) root:disk 660 =cciss/%1
|
|
||||||
ida!(.*) root:disk 660 =ida/%1
|
|
||||||
rd!(.*) root:disk 660 =rd/%1
|
|
||||||
|
|
||||||
|
|
||||||
fuse root:root 666
|
|
||||||
|
|
||||||
card[0-9] root:video 660 =dri/
|
|
||||||
|
|
||||||
agpgart root:root 660 >misc/
|
|
||||||
psaux root:root 660 >misc/
|
|
||||||
rtc root:root 664 >misc/
|
|
||||||
|
|
||||||
# input stuff
|
|
||||||
SUBSYSTEM=input;.* root:plugdev 660
|
|
||||||
|
|
||||||
# v4l stuff
|
|
||||||
vbi[0-9] root:video 660 >v4l/
|
|
||||||
video[0-9] root:video 660 >v4l/
|
|
||||||
|
|
||||||
# dvb stuff
|
|
||||||
dvb.* root:video 660
|
|
||||||
|
|
||||||
# drm etc
|
|
||||||
dri/.* root:video 660
|
|
||||||
|
|
||||||
# Don't create old usbdev* devices.
|
|
||||||
usbdev[0-9].[0-9]* root:root 660 !
|
|
||||||
|
|
||||||
# Stop creating x:x:x:x which looks like /dev/dm-*
|
|
||||||
[0-9]+\:[0-9]+\:[0-9]+\:[0-9]+ root:root 660 !
|
|
||||||
|
|
||||||
# /dev/cpu support.
|
|
||||||
microcode root:root 600 =cpu/
|
|
||||||
cpu([0-9]+) root:root 600 =cpu/%1/cpuid
|
|
||||||
msr([0-9]+) root:root 600 =cpu/%1/msr
|
|
||||||
|
|
||||||
# Populate /dev/bus/usb.
|
|
||||||
#SUBSYSTEM=usb;DEVTYPE=usb_device;.* root:root 660 */libexec/infix/dev-bus-usb
|
|
||||||
|
|
||||||
# Catch-all other devices, Right now useful only for debuging.
|
|
||||||
#.* root:root 660 */libexec/infix/catch-all
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
[2m[1mNote:[0m[2m use help, show, and setup commands to set up and diagnose the system.[0m
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
# interfaces(5) file used by ifup(8) and ifdown(8)
|
|
||||||
auto lo
|
|
||||||
iface lo inet loopback
|
|
||||||
|
|
||||||
source-directory /etc/network/interfaces.d
|
|
||||||
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
#!/usr/bin/pdmenu
|
|
||||||
|
|
||||||
title:Setup & Diagnostics
|
|
||||||
|
|
||||||
color:desktop:blue:blue
|
|
||||||
color:title:blue:white
|
|
||||||
color:base:blue:white
|
|
||||||
|
|
||||||
menu:main:Main Menu:Use arrow keys, Enter, Escape, and Q to navigate
|
|
||||||
show:_System Settings..::system
|
|
||||||
show:_Network Settings..::network
|
|
||||||
show:_Tools..::tools
|
|
||||||
nop
|
|
||||||
exec:Show _fdb:truncate:show -p fdb
|
|
||||||
exec:Show _mdb:truncate:show -p mdb
|
|
||||||
exec:Show _ports:truncate:show -p ports
|
|
||||||
exec:Show _vlans:truncate:show -p vlans
|
|
||||||
exec:Show _interfaces:truncate:show -p iface
|
|
||||||
exec:Show _routes:truncate:show -p route
|
|
||||||
nop
|
|
||||||
exec:Show _online users:truncate:w
|
|
||||||
exec:Show _CPU Load::top
|
|
||||||
nop
|
|
||||||
show:_Help..::help
|
|
||||||
exit:_Quit
|
|
||||||
|
|
||||||
menu:help:Help:Help Menu
|
|
||||||
exec:Introduction:truncate:/bin/help -p
|
|
||||||
exec:Editors:truncate:/bin/help -p edit
|
|
||||||
exec:Networking:truncate:/bin/help -p net
|
|
||||||
nop
|
|
||||||
exit:_Main menu..
|
|
||||||
|
|
||||||
menu:network:Network:Network Settings
|
|
||||||
exec:Show all _links:truncated:ip -br link
|
|
||||||
exec:Show all _addresses:truncated:ip -br address
|
|
||||||
exec:Show managed _interfaces:truncated:ifparse --all
|
|
||||||
nop
|
|
||||||
exec:Take _interface down:edit:ifdown ~Enter name of interface to take down:~
|
|
||||||
exec:Take _interface up:edit:ifup ~Enter name of interface to take up:~
|
|
||||||
nop
|
|
||||||
exec:Edit _dhcpcd.conf::edit /etc/dhcpcd.conf
|
|
||||||
exec:Edit _dnsmasq.conf::edit /etc/dnsmasq.conf
|
|
||||||
exec:Edit _interfaces::edit /etc/network/interfaces
|
|
||||||
exec:Edit _mactab::edit /etc/mactab
|
|
||||||
exec:Edit _sysctl.conf::edit /etc/sysctl.conf
|
|
||||||
nop
|
|
||||||
exit:_Main menu..
|
|
||||||
|
|
||||||
menu:system:System:System Settings
|
|
||||||
exec:List _log files:truncate:ls -l /var/log
|
|
||||||
exec:Show _log file:edit,truncate:show -p -a log ~Show logfile, Enter for syslog:syslog~
|
|
||||||
exec:Change _hostname:edit:hostnm ~Enter new hostname \[-a-zA-Z0-9\]:~
|
|
||||||
exec:Change your _password::passwd
|
|
||||||
exec:Edit _rc.local::edit /etc/rc.local
|
|
||||||
nop
|
|
||||||
exec:_Show State of Services:truncate:initctl -p
|
|
||||||
exec:_Reload services:truncate:initctl reload;sleep 2;initctl -p
|
|
||||||
exec:Show _available services:truncate:initctl -p ls
|
|
||||||
exec:_Enable service:edit:initctl enable ~Enter name of service (filename) to enable:~
|
|
||||||
exec:_Disable service:edit:initctl disable ~Enter name of service (filename) to disable:~
|
|
||||||
nop
|
|
||||||
exec:_Factory Reset::yorn "Factory reset device (reboots), are you sure?" factory -y
|
|
||||||
nop
|
|
||||||
exit:_Main menu..
|
|
||||||
|
|
||||||
menu:tools:Tools:Tools
|
|
||||||
exec:_Ping:edit,pause:ping ~Enter address (IP or name) to ping:~
|
|
||||||
exec:_Shell Prompt::/bin/bash --login
|
|
||||||
exec:_SSH:edit,pause:ssh ~Enter [username@]address (IP or name) to SSH to:~
|
|
||||||
exec:_Telnet:edit,pause:telnet ~Enter address (IP or name) to telnet to:~
|
|
||||||
exec:_Traceroute:edit,pause:mtr ~Enter address (IP or name) to traceroute to:~
|
|
||||||
exec:Browse _WWW:edit,pause:lynx ~Enter URL to browse:~
|
|
||||||
nop
|
|
||||||
exit:_Main menu..
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# This file is run at the very end of runlevel S (bootstrap)
|
|
||||||
#
|
|
||||||
# Note: 1) not all initctl commands are allowed here
|
|
||||||
# 2) to enable IP forwarding, use /etc/sysctl.conf, or /etc/sysctl.d/
|
|
||||||
# 3) ensure the script calls `exit 0` at the end
|
|
||||||
#
|
|
||||||
|
|
||||||
# Uncomment to classify all interfaces starting with 'eth' as ports.
|
|
||||||
#for port in $(ip -br link |awk '/eth/{print $1}'); do
|
|
||||||
# ip link set $port group port
|
|
||||||
#done
|
|
||||||
|
|
||||||
# Uncomment to enable IP masquerading (NAT) of all traffic egressing
|
|
||||||
# the WAN interface, here eth0. E.g., if you are a router for your
|
|
||||||
# LAN on eth1.
|
|
||||||
#iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Factory default:
|
|
||||||
# 1) all switch ports in VLAN 1 of br0
|
|
||||||
# 2) no switch ports => DHCP on eth0
|
|
||||||
# 3) no eth0
|
|
||||||
|
|
||||||
create_bridge()
|
|
||||||
{
|
|
||||||
nm=$1
|
|
||||||
shift
|
|
||||||
ports=$@
|
|
||||||
|
|
||||||
touch "/etc/network/interfaces.d/$nm"
|
|
||||||
for port in $ports; do
|
|
||||||
cat <<-EOF >>"/etc/network/interfaces.d/$nm"
|
|
||||||
iface $port
|
|
||||||
bridge-access 1
|
|
||||||
post-up ip link set $port group port
|
|
||||||
EOF
|
|
||||||
done
|
|
||||||
cat <<-EOF >> "/etc/network/interfaces.d/$nm"
|
|
||||||
|
|
||||||
auto $nm
|
|
||||||
iface $nm
|
|
||||||
bridge-ports $ports
|
|
||||||
bridge-vlan-aware yes
|
|
||||||
bridge-stp on
|
|
||||||
bridge-vids 1
|
|
||||||
|
|
||||||
auto vlan1
|
|
||||||
iface vlan1 inet dhcp
|
|
||||||
vlan-id 1
|
|
||||||
vlan-raw-device $nm
|
|
||||||
post-up ip link set vlan1 group iface
|
|
||||||
EOF
|
|
||||||
ip link set vlan1 group iface
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check if already set up
|
|
||||||
[ -z "$(ls -A /etc/network/interfaces.d/)" ] || exit 0
|
|
||||||
|
|
||||||
# Check for custom hostname from Qemu/Qeneth
|
|
||||||
nm=$(cat /sys/firmware/qemu_fw_cfg/by_name/opt/hostname/raw)
|
|
||||||
if [ -n "$nm" ]; then
|
|
||||||
hostnm "$nm"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# need to check for 'length > 0' because ip command
|
|
||||||
# outputs empty json objects for non-port group ifs
|
|
||||||
ports=$(ip -json link show group port | jq -r '.[].ifname | select(length > 0)' | tr "\n" " ")
|
|
||||||
if [ -n "$ports" ]; then
|
|
||||||
create_bridge br0 $ports
|
|
||||||
else
|
|
||||||
ifaces=$(ip -json addr show |jq -r '.[] | select(.link_type=="ether").ifname')
|
|
||||||
for iface in $ifaces; do
|
|
||||||
cat <<-EOF > "/etc/network/interfaces.d/$iface"
|
|
||||||
auto $iface
|
|
||||||
iface $iface inet dhcp
|
|
||||||
pre-up ip link set $iface group iface
|
|
||||||
EOF
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Probe for various types of harware features
|
|
||||||
|
|
||||||
if dmesg |grep -q QEMU || test -d /sys/module/qemu_fw_cfg; then
|
|
||||||
initctl -nbq cond set qemu
|
|
||||||
fi
|
|
||||||
@@ -60,7 +60,7 @@ cat <<EOF >"$BINARIES_DIR/${NM}.gns3a"
|
|||||||
"status": "stable",
|
"status": "stable",
|
||||||
"maintainer": "$VENDOR_NAME",
|
"maintainer": "$VENDOR_NAME",
|
||||||
"maintainer_email": "${SUPPORT_URL#mailto:}",
|
"maintainer_email": "${SUPPORT_URL#mailto:}",
|
||||||
"usage": "Default login, user/pass: admin/admin\n\nType 'help' for an overview of commands and relevant configuration files.\n\nFor Classic builds the following applies: the /etc directory is writable, use the passwd tool after login as part of your set up.\nFor networking, classify interfaces as switchports with /etc/mactab, syntax: 'MAC-address eN', where N is the port number (1-MAX).\nTo set up bridging and management interfaces, use /etc/network/interfaces, and /etc/network/interfaces.d/",
|
"usage": "Default login, user/pass: admin/admin\n\nType 'cli' (and Enter) followed by 'help' for an overview of commands and relevant configuration files.",
|
||||||
"port_name_format": "eth{0}",
|
"port_name_format": "eth{0}",
|
||||||
"linked_clone": true,
|
"linked_clone": true,
|
||||||
"qemu": {
|
"qemu": {
|
||||||
|
|||||||
@@ -40,13 +40,6 @@ rm -f "$TARGET_DIR/etc/os-release"
|
|||||||
if [ -n "$INFIX_RELEASE" ]; then
|
if [ -n "$INFIX_RELEASE" ]; then
|
||||||
echo "IMAGE_VERSION=\"$INFIX_RELEASE\""
|
echo "IMAGE_VERSION=\"$INFIX_RELEASE\""
|
||||||
fi
|
fi
|
||||||
if [ "$INFIX_VARIANT_NETCONF" = "y" ]; then
|
|
||||||
echo "VARIANT=\"Managed NETCONF\""
|
|
||||||
echo "VARIANT_ID=netconf"
|
|
||||||
else
|
|
||||||
echo "VARIANT=\"Classic, writable /etc\""
|
|
||||||
echo "VARIANT_ID=classic"
|
|
||||||
fi
|
|
||||||
echo "ARCHITECTURE=\"${INFIX_ARCH}\""
|
echo "ARCHITECTURE=\"${INFIX_ARCH}\""
|
||||||
echo "HOME_URL=$INFIX_HOME"
|
echo "HOME_URL=$INFIX_HOME"
|
||||||
if [ -n "$INFIX_VENDOR" ]; then
|
if [ -n "$INFIX_VENDOR" ]; then
|
||||||
|
|||||||
@@ -77,9 +77,9 @@ config QEMU_MACHINE_RAM
|
|||||||
string "RAM size (k/M/G)"
|
string "RAM size (k/M/G)"
|
||||||
default "384M"
|
default "384M"
|
||||||
help
|
help
|
||||||
The default, 384 MiB, works for most configurations, even less for
|
The default, 384 MiB, works for most configurations. However,
|
||||||
the Infix Classic builds. However, if you get kernel panic with:
|
if you get kernel panic with: "System is deadlocked on memory",
|
||||||
"System is deadlocked on memory", try increasing this one.
|
try increasing this one.
|
||||||
|
|
||||||
config QEMU_KERNEL
|
config QEMU_KERNEL
|
||||||
string
|
string
|
||||||
|
|||||||
@@ -126,11 +126,6 @@ if ! mount_rw cfg >/dev/null 2>&1; then
|
|||||||
# Even if /mnt/var isn't available, if /mnt/cfg isn't either, then
|
# Even if /mnt/var isn't available, if /mnt/cfg isn't either, then
|
||||||
# there's no point in overlaying one ramdisk on top of another.
|
# there's no point in overlaying one ramdisk on top of another.
|
||||||
vlibsrc=
|
vlibsrc=
|
||||||
else
|
|
||||||
# Classic Infix has read-write /etc across boots
|
|
||||||
if [ "$VARIANT_ID" != "netconf" ]; then
|
|
||||||
etcsrc=/mnt/cfg
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if check_factory; then
|
if check_factory; then
|
||||||
|
|||||||
@@ -1,120 +0,0 @@
|
|||||||
BR2_aarch64=y
|
|
||||||
BR2_ARM_FPU_VFPV4=y
|
|
||||||
BR2_TOOLCHAIN_EXTERNAL=y
|
|
||||||
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
|
|
||||||
BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY=y
|
|
||||||
BR2_DL_DIR="${BR2_EXTERNAL_INFIX_PATH}/dl"
|
|
||||||
BR2_CCACHE=y
|
|
||||||
BR2_CCACHE_DIR="${BR2_EXTERNAL_INFIX_PATH}/.ccache"
|
|
||||||
BR2_ENABLE_DEBUG=y
|
|
||||||
BR2_GLOBAL_PATCH_DIR="${BR2_EXTERNAL_INFIX_PATH}/patches"
|
|
||||||
BR2_TARGET_GENERIC_HOSTNAME="infix"
|
|
||||||
BR2_TARGET_GENERIC_ISSUE="Infix by KernelKit"
|
|
||||||
BR2_INIT_FINIT=y
|
|
||||||
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
|
|
||||||
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs"
|
|
||||||
BR2_TARGET_GENERIC_GETTY_TERM="xterm"
|
|
||||||
BR2_SYSTEM_DHCP="eth0"
|
|
||||||
BR2_ENABLE_LOCALE_WHITELIST="C en_US en_CA"
|
|
||||||
BR2_GENERATE_LOCALE="en_US en_CA"
|
|
||||||
BR2_TARGET_TZ_INFO=y
|
|
||||||
BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/rootfs ${BR2_EXTERNAL_INFIX_PATH}/board/classic/rootfs"
|
|
||||||
BR2_ROOTFS_POST_BUILD_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh ${BR2_EXTERNAL_INFIX_PATH}/board/classic/post-build.sh"
|
|
||||||
BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image.sh"
|
|
||||||
BR2_LINUX_KERNEL=y
|
|
||||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
|
||||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.22"
|
|
||||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
|
||||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/linux_defconfig"
|
|
||||||
BR2_LINUX_KERNEL_DTS_SUPPORT=y
|
|
||||||
BR2_LINUX_KERNEL_INTREE_DTS_NAME="alder/alder marvell/armada-3720-espressobin marvell/armada-3720-espressobin-emmc marvell/armada-3720-espressobin-v7 marvell/armada-3720-espressobin-v7-emmc marvell/armada-3720-espressobin-ultra marvell/cn9130-crb-A marvell/cn9130-crb-B microchip/sparx5_pcb135_emmc_no_psci"
|
|
||||||
BR2_LINUX_KERNEL_CUSTOM_DTS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/dts"
|
|
||||||
BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME=y
|
|
||||||
BR2_LINUX_KERNEL_INSTALL_TARGET=y
|
|
||||||
BR2_PACKAGE_BUSYBOX_CONFIG="${BR2_EXTERNAL_INFIX_PATH}/board/common/busybox_defconfig"
|
|
||||||
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
|
|
||||||
BR2_PACKAGE_STRACE=y
|
|
||||||
BR2_PACKAGE_STRESS_NG=y
|
|
||||||
BR2_PACKAGE_JQ=y
|
|
||||||
BR2_PACKAGE_MDIO_TOOLS=y
|
|
||||||
BR2_PACKAGE_RNG_TOOLS=y
|
|
||||||
BR2_PACKAGE_UBOOT_TOOLS=y
|
|
||||||
BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT=y
|
|
||||||
BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y
|
|
||||||
BR2_PACKAGE_UBOOT_TOOLS_FIT_CHECK_SIGN=y
|
|
||||||
BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE=y
|
|
||||||
BR2_PACKAGE_CA_CERTIFICATES=y
|
|
||||||
BR2_PACKAGE_LIBCURL_CURL=y
|
|
||||||
BR2_PACKAGE_NSS_MDNS=y
|
|
||||||
BR2_PACKAGE_ONIGURUMA=y
|
|
||||||
BR2_PACKAGE_AVAHI=y
|
|
||||||
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
|
|
||||||
BR2_PACKAGE_AVAHI_DAEMON=y
|
|
||||||
BR2_PACKAGE_AVAHI_DEFAULT_SERVICES=y
|
|
||||||
BR2_PACKAGE_CHRONY=y
|
|
||||||
BR2_PACKAGE_DHCPCD=y
|
|
||||||
BR2_PACKAGE_DNSMASQ=y
|
|
||||||
BR2_PACKAGE_DROPBEAR=y
|
|
||||||
BR2_PACKAGE_DROPBEAR_DISABLE_REVERSEDNS=y
|
|
||||||
BR2_PACKAGE_DROPBEAR_WTMP=y
|
|
||||||
BR2_PACKAGE_DROPBEAR_LASTLOG=y
|
|
||||||
BR2_PACKAGE_DROPBEAR_LEGACY_CRYPTO=y
|
|
||||||
BR2_PACKAGE_ETHTOOL=y
|
|
||||||
BR2_PACKAGE_FPING=y
|
|
||||||
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
|
|
||||||
BR2_PACKAGE_IPROUTE2=y
|
|
||||||
BR2_PACKAGE_IPTABLES=y
|
|
||||||
BR2_PACKAGE_IPTABLES_NFTABLES=y
|
|
||||||
BR2_PACKAGE_LLDPD=y
|
|
||||||
BR2_PACKAGE_LYNX=y
|
|
||||||
BR2_PACKAGE_MTR=y
|
|
||||||
BR2_PACKAGE_NETCALC=y
|
|
||||||
BR2_PACKAGE_NFTABLES=y
|
|
||||||
BR2_PACKAGE_NMAP=y
|
|
||||||
BR2_PACKAGE_NMAP_NMAP=y
|
|
||||||
BR2_PACKAGE_NMAP_NPING=y
|
|
||||||
BR2_PACKAGE_OPENRESOLV=y
|
|
||||||
BR2_PACKAGE_SOCAT=y
|
|
||||||
BR2_PACKAGE_TCPDUMP=y
|
|
||||||
BR2_PACKAGE_TRACEROUTE=y
|
|
||||||
BR2_PACKAGE_DIALOG=y
|
|
||||||
BR2_PACKAGE_PDMENU=y
|
|
||||||
BR2_PACKAGE_HTOP=y
|
|
||||||
BR2_PACKAGE_IRQBALANCE=y
|
|
||||||
BR2_PACKAGE_KMOD_TOOLS=y
|
|
||||||
BR2_PACKAGE_PWGEN=y
|
|
||||||
BR2_PACKAGE_RAUC=y
|
|
||||||
BR2_PACKAGE_RAUC_GPT=y
|
|
||||||
BR2_PACKAGE_RAUC_NETWORK=y
|
|
||||||
BR2_PACKAGE_SYSKLOGD=y
|
|
||||||
BR2_PACKAGE_SYSKLOGD_LOGGER=y
|
|
||||||
BR2_PACKAGE_WATCHDOGD=y
|
|
||||||
BR2_PACKAGE_MG=y
|
|
||||||
BR2_PACKAGE_MOST=y
|
|
||||||
BR2_PACKAGE_NANO=y
|
|
||||||
BR2_TARGET_ROOTFS_SQUASHFS=y
|
|
||||||
# BR2_TARGET_ROOTFS_TAR is not set
|
|
||||||
BR2_PACKAGE_HOST_E2FSPROGS=y
|
|
||||||
BR2_PACKAGE_HOST_ENVIRONMENT_SETUP=y
|
|
||||||
BR2_PACKAGE_HOST_GENEXT2FS=y
|
|
||||||
BR2_PACKAGE_HOST_GENIMAGE=y
|
|
||||||
BR2_PACKAGE_HOST_RAUC=y
|
|
||||||
BR2_PACKAGE_HOST_UBOOT_TOOLS=y
|
|
||||||
BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
|
|
||||||
BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y
|
|
||||||
INFIX_VENDOR_HOME="https://github.com/kernelkit"
|
|
||||||
INFIX_DESC="Infix is a Network Operating System based on Linux. It can be set up both as a switch, with offloading using switchdev, and a router with firewalling."
|
|
||||||
INFIX_HOME="https://github.com/kernelkit/infix/"
|
|
||||||
INFIX_DOC="https://github.com/kernelkit/infix/tree/main/doc"
|
|
||||||
INFIX_VARIANT_CLASSIC=y
|
|
||||||
BR2_PACKAGE_FACTORY=y
|
|
||||||
BR2_PACKAGE_FINIT_SULOGIN=y
|
|
||||||
BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
|
|
||||||
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
|
|
||||||
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
|
|
||||||
BR2_PACKAGE_FINIT_PLUGIN_MODPROBE=y
|
|
||||||
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
|
|
||||||
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
|
|
||||||
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
|
|
||||||
BR2_PACKAGE_IFUPDOWN_NG=y
|
|
||||||
BR2_PACKAGE_TETRIS=y
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
BR2_x86_64=y
|
|
||||||
BR2_x86_corei7=y
|
|
||||||
BR2_TOOLCHAIN_EXTERNAL=y
|
|
||||||
BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY=y
|
|
||||||
BR2_DL_DIR="${BR2_EXTERNAL_INFIX_PATH}/dl"
|
|
||||||
BR2_CCACHE=y
|
|
||||||
BR2_CCACHE_DIR="${BR2_EXTERNAL_INFIX_PATH}/.ccache"
|
|
||||||
BR2_ENABLE_DEBUG=y
|
|
||||||
BR2_GLOBAL_PATCH_DIR="${BR2_EXTERNAL_INFIX_PATH}/patches"
|
|
||||||
BR2_TARGET_GENERIC_HOSTNAME="infix"
|
|
||||||
BR2_TARGET_GENERIC_ISSUE="Infix by KernelKit"
|
|
||||||
BR2_INIT_FINIT=y
|
|
||||||
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
|
|
||||||
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs"
|
|
||||||
BR2_TARGET_GENERIC_GETTY_TERM="xterm"
|
|
||||||
BR2_SYSTEM_DHCP="eth0"
|
|
||||||
BR2_ENABLE_LOCALE_WHITELIST="C en_US en_CA"
|
|
||||||
BR2_GENERATE_LOCALE="en_US en_CA"
|
|
||||||
BR2_TARGET_TZ_INFO=y
|
|
||||||
BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNAL_INFIX_PATH}/board/x86_64/rootfs ${BR2_EXTERNAL_INFIX_PATH}/board/classic/rootfs"
|
|
||||||
BR2_ROOTFS_POST_BUILD_SCRIPT="board/qemu/x86_64/post-build.sh ${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh ${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh ${BR2_EXTERNAL_INFIX_PATH}/board/classic/post-build.sh"
|
|
||||||
BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image.sh"
|
|
||||||
BR2_LINUX_KERNEL=y
|
|
||||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
|
||||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.22"
|
|
||||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
|
||||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/board/x86_64/linux_defconfig"
|
|
||||||
BR2_LINUX_KERNEL_INSTALL_TARGET=y
|
|
||||||
BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y
|
|
||||||
BR2_PACKAGE_BUSYBOX_CONFIG="${BR2_EXTERNAL_INFIX_PATH}/board/common/busybox_defconfig"
|
|
||||||
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
|
|
||||||
BR2_PACKAGE_JQ=y
|
|
||||||
BR2_PACKAGE_RNG_TOOLS=y
|
|
||||||
BR2_PACKAGE_UBOOT_TOOLS=y
|
|
||||||
BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT=y
|
|
||||||
BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y
|
|
||||||
BR2_PACKAGE_UBOOT_TOOLS_FIT_CHECK_SIGN=y
|
|
||||||
BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE=y
|
|
||||||
BR2_PACKAGE_CA_CERTIFICATES=y
|
|
||||||
BR2_PACKAGE_LIBCURL_CURL=y
|
|
||||||
BR2_PACKAGE_NSS_MDNS=y
|
|
||||||
BR2_PACKAGE_ONIGURUMA=y
|
|
||||||
BR2_PACKAGE_AVAHI=y
|
|
||||||
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
|
|
||||||
BR2_PACKAGE_AVAHI_DAEMON=y
|
|
||||||
BR2_PACKAGE_AVAHI_DEFAULT_SERVICES=y
|
|
||||||
BR2_PACKAGE_DHCPCD=y
|
|
||||||
BR2_PACKAGE_DNSMASQ=y
|
|
||||||
BR2_PACKAGE_DROPBEAR=y
|
|
||||||
BR2_PACKAGE_DROPBEAR_DISABLE_REVERSEDNS=y
|
|
||||||
BR2_PACKAGE_DROPBEAR_WTMP=y
|
|
||||||
BR2_PACKAGE_DROPBEAR_LASTLOG=y
|
|
||||||
BR2_PACKAGE_DROPBEAR_LEGACY_CRYPTO=y
|
|
||||||
BR2_PACKAGE_ETHTOOL=y
|
|
||||||
BR2_PACKAGE_FPING=y
|
|
||||||
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
|
|
||||||
BR2_PACKAGE_IPROUTE2=y
|
|
||||||
BR2_PACKAGE_IPTABLES=y
|
|
||||||
BR2_PACKAGE_IPTABLES_NFTABLES=y
|
|
||||||
BR2_PACKAGE_LLDPD=y
|
|
||||||
BR2_PACKAGE_LYNX=y
|
|
||||||
BR2_PACKAGE_MTR=y
|
|
||||||
BR2_PACKAGE_NETCALC=y
|
|
||||||
BR2_PACKAGE_NFTABLES=y
|
|
||||||
BR2_PACKAGE_NMAP=y
|
|
||||||
BR2_PACKAGE_NMAP_NMAP=y
|
|
||||||
BR2_PACKAGE_NMAP_NPING=y
|
|
||||||
BR2_PACKAGE_OPENRESOLV=y
|
|
||||||
BR2_PACKAGE_SOCAT=y
|
|
||||||
BR2_PACKAGE_TCPDUMP=y
|
|
||||||
BR2_PACKAGE_TRACEROUTE=y
|
|
||||||
BR2_PACKAGE_DIALOG=y
|
|
||||||
BR2_PACKAGE_PDMENU=y
|
|
||||||
BR2_PACKAGE_HTOP=y
|
|
||||||
BR2_PACKAGE_IRQBALANCE=y
|
|
||||||
BR2_PACKAGE_KMOD_TOOLS=y
|
|
||||||
BR2_PACKAGE_PWGEN=y
|
|
||||||
BR2_PACKAGE_RAUC=y
|
|
||||||
BR2_PACKAGE_RAUC_GPT=y
|
|
||||||
BR2_PACKAGE_RAUC_NETWORK=y
|
|
||||||
BR2_PACKAGE_SYSKLOGD=y
|
|
||||||
BR2_PACKAGE_SYSKLOGD_LOGGER=y
|
|
||||||
BR2_PACKAGE_WATCHDOGD=y
|
|
||||||
BR2_PACKAGE_MG=y
|
|
||||||
BR2_PACKAGE_MOST=y
|
|
||||||
BR2_PACKAGE_NANO=y
|
|
||||||
BR2_TARGET_ROOTFS_SQUASHFS=y
|
|
||||||
# BR2_TARGET_ROOTFS_TAR is not set
|
|
||||||
BR2_TARGET_EDK2=y
|
|
||||||
BR2_TARGET_GRUB2=y
|
|
||||||
BR2_TARGET_GRUB2_X86_64_EFI=y
|
|
||||||
BR2_TARGET_GRUB2_BUILTIN_MODULES_EFI="boot linux ext2 squash4 part_gpt normal efi_gop configfile loadenv test echo reboot net efinet tftp loopback"
|
|
||||||
BR2_TARGET_GRUB2_BUILTIN_CONFIG_EFI="${BR2_EXTERNAL_INFIX_PATH}/board/x86_64/grub-embed.cfg"
|
|
||||||
BR2_TARGET_GRUB2_INSTALL_TOOLS=y
|
|
||||||
BR2_PACKAGE_HOST_DOSFSTOOLS=y
|
|
||||||
BR2_PACKAGE_HOST_E2FSPROGS=y
|
|
||||||
BR2_PACKAGE_HOST_ENVIRONMENT_SETUP=y
|
|
||||||
BR2_PACKAGE_HOST_GENEXT2FS=y
|
|
||||||
BR2_PACKAGE_HOST_GENIMAGE=y
|
|
||||||
BR2_PACKAGE_HOST_MTOOLS=y
|
|
||||||
BR2_PACKAGE_HOST_RAUC=y
|
|
||||||
BR2_PACKAGE_HOST_UBOOT_TOOLS=y
|
|
||||||
BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
|
|
||||||
BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y
|
|
||||||
INFIX_VENDOR_HOME="https://github.com/kernelkit"
|
|
||||||
INFIX_DESC="Infix is a Network Operating System based on Linux. It can be set up both as a switch, with offloading using switchdev, and a router with firewalling."
|
|
||||||
INFIX_HOME="https://github.com/kernelkit/infix/"
|
|
||||||
INFIX_DOC="https://github.com/kernelkit/infix/tree/main/doc"
|
|
||||||
INFIX_VARIANT_CLASSIC=y
|
|
||||||
BR2_PACKAGE_FACTORY=y
|
|
||||||
BR2_PACKAGE_FINIT_SULOGIN=y
|
|
||||||
BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
|
|
||||||
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
|
|
||||||
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
|
|
||||||
BR2_PACKAGE_FINIT_PLUGIN_MODPROBE=y
|
|
||||||
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
|
|
||||||
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
|
|
||||||
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
|
|
||||||
BR2_PACKAGE_IFUPDOWN_NG=y
|
|
||||||
BR2_PACKAGE_TETRIS=y
|
|
||||||
DISK_IMAGE_BOOT_BIN=y
|
|
||||||
@@ -24,7 +24,6 @@ the `help` command.
|
|||||||
- [Find Your Device on the Network](discovery.md)
|
- [Find Your Device on the Network](discovery.md)
|
||||||
- [Hardware Info & Status](hardware.md)
|
- [Hardware Info & Status](hardware.md)
|
||||||
- [Scripting Infix](scripting.md)
|
- [Scripting Infix](scripting.md)
|
||||||
- [Infix Variants](variant.md)
|
|
||||||
- [Virtual Environments](virtual.md)
|
- [Virtual Environments](virtual.md)
|
||||||
- [Vital Product Data (VPD)](vpd.md)
|
- [Vital Product Data (VPD)](vpd.md)
|
||||||
- [YANG to Ethtool Mapping](eth-counters.md)
|
- [YANG to Ethtool Mapping](eth-counters.md)
|
||||||
|
|||||||
@@ -331,8 +331,6 @@ rollbacks when upgrading to a new version.
|
|||||||
|
|
||||||
Non-volatile storage of the system configuration and user data.
|
Non-volatile storage of the system configuration and user data.
|
||||||
Concretely, user data is everything stored under `/root` and `/home`.
|
Concretely, user data is everything stored under `/root` and `/home`.
|
||||||
Depending on the operating mode, the configuration is either the NETCONF
|
|
||||||
databases from `/cfg`, or the contents of `/etc` in classic mode.
|
|
||||||
|
|
||||||
|
|
||||||
### `var` - Variable Data
|
### `var` - Variable Data
|
||||||
|
|||||||
@@ -1,67 +0,0 @@
|
|||||||
Infix Variants
|
|
||||||
==============
|
|
||||||
|
|
||||||
Infix comes in two *flavors*. Both have a default `admin` account,
|
|
||||||
allowed to log in from remote, with the default password `admin` --
|
|
||||||
*customer specific builds* may have something else, e.g., per-device
|
|
||||||
generated factory password.
|
|
||||||
|
|
||||||
|
|
||||||
NETCONF
|
|
||||||
-------
|
|
||||||
|
|
||||||
Infix use by [sysrepo][1] and [Netopeer][2] to provide NETCONF support.
|
|
||||||
A set of sysrepo plugins configure the network, using the Linux iproute2
|
|
||||||
tool suite, generate configuration files in `/etc`, and control the all
|
|
||||||
system daemons, e.g., enable DHCP client on an interface.
|
|
||||||
|
|
||||||
Configuration of an Infix device can be done remotely, using command
|
|
||||||
line tools like [netconf-client][3] and [netopeer2-cli][2], or desktop
|
|
||||||
GUI tools like [NETCONFc][4] and [MG-SOFT NetConf Browser][5]. It is
|
|
||||||
also possible to log in to the device using SSH and set it up locally
|
|
||||||
using the built-in [CLI](cli/introduction.md)[^1].
|
|
||||||
|
|
||||||
> **Note:** unlike Infix Classic, the `/etc` directory is a volatile RAM
|
|
||||||
> disk populated on each boot from the `startup-config`, ensuring a
|
|
||||||
> coherent centralized view of the system.
|
|
||||||
|
|
||||||
For more information, see [Containers in Infix](container.md).
|
|
||||||
|
|
||||||
[^1]: A [RESTCONF][7] based WebUI is also in progress.
|
|
||||||
|
|
||||||
|
|
||||||
Classic
|
|
||||||
-------
|
|
||||||
|
|
||||||
Infix Classic is very much like a traditional embedded Linux system.
|
|
||||||
Stripped down, single read-only image, reusing the same Linux kernel and
|
|
||||||
Buildroot base as the NETCONF variant. Unlike the NETCONF variant, it
|
|
||||||
is up to the administrator to manually modify system configuration files
|
|
||||||
in `/etc`[^2] and control system services using the `initctl` tool.
|
|
||||||
|
|
||||||
For example, networking is configured by editing the [ifupdown-ng][6]
|
|
||||||
files in `/etc/network/interfaces`.
|
|
||||||
|
|
||||||
To perform a factory reset, wiping all changes in `/etc`, and all other
|
|
||||||
areas of the file system that are persistent, use the <kbd>factory</kbd>
|
|
||||||
tool.
|
|
||||||
|
|
||||||
See the online <kbd>help</kbd> command for an introduction to the system
|
|
||||||
and help on available tools, like text editors, network debugging, etc.
|
|
||||||
|
|
||||||
> **Note:** the Classic builds are legacy at this point. They were
|
|
||||||
> initially used for educational purposes, and sometimes as slightly
|
|
||||||
> more useful end-devices in GNS3. Little to no testing is done on
|
|
||||||
> them and they may eventually be migrated to a separate repository.
|
|
||||||
|
|
||||||
[^2]: In Classic builds the `/etc` directory is saved across reboots on
|
|
||||||
a separate read-write partition.
|
|
||||||
|
|
||||||
[1]: https://www.sysrepo.org/
|
|
||||||
[2]: https://github.com/CESNET/netopeer
|
|
||||||
[3]: https://pypi.org/project/netconf-client/
|
|
||||||
[4]: http://www.seguesoft.com/index.php/netconfc/
|
|
||||||
[5]: https://www.mg-soft.si/mgNetConfBrowser.html
|
|
||||||
[6]: https://github.com/ifupdown-ng/ifupdown-ng
|
|
||||||
[7]: https://datatracker.ietf.org/doc/html/rfc8040
|
|
||||||
|
|
||||||
+6
-7
@@ -40,14 +40,13 @@ The Infix test suite is built around Qemu and [Qeneth][qeth], see:
|
|||||||
GNS3
|
GNS3
|
||||||
----
|
----
|
||||||
|
|
||||||
Download the [latest build][rels] of the `x86_64`, or `x86_64_classic`
|
Download the [latest build][rels] of the `x86_64`, or `aarch64` if your
|
||||||
flavor. Unpack the tarball in a dedicated directory and use ["Import
|
host machine is Arm. Unpack the tarball in a dedicated directory and
|
||||||
Appliance"][APPL] to install the `.gns3a` file into [GNS3][].
|
use ["Import Appliance"][APPL] to install the `.gns3a` file into
|
||||||
|
[GNS3][].
|
||||||
|
|
||||||
Infix (`x86_64`) is in the "Router" category, it has with 10 interfaces
|
Infix is in the "Router" category, it comes with 10 interfaces available
|
||||||
available by default for use as switch ports or routing. The *classic*
|
by default for use as switch ports or routing.
|
||||||
build only has one interface by default, geared more towards acting as
|
|
||||||
an end device.
|
|
||||||
|
|
||||||
[Qemu]: https://www.qemu.org/
|
[Qemu]: https://www.qemu.org/
|
||||||
[GNS3]: https://gns3.com/
|
[GNS3]: https://gns3.com/
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ whitelist()
|
|||||||
{
|
{
|
||||||
nm=$(basename "$1")
|
nm=$(basename "$1")
|
||||||
case $nm in
|
case $nm in
|
||||||
aarch64_classic_defconfig | cn9130_crb_boot_defconfig | fireant_boot_defconfig | x86_64_classic_defconfig)
|
cn9130_crb_boot_defconfig | fireant_boot_defconfig)
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
Reference in New Issue
Block a user