Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1ad661f
package/skeleton-init-finit: fix make skeleton-init-finit-rebuild
troglobit Apr 24, 2023
67b9964
package/finit: bump for S vs 0 runlevel fixes and templating support
troglobit Apr 24, 2023
5f6ac1f
board/common: replace sshd subsystem cli with klish
troglobit Apr 24, 2023
8d9ef7d
board/common: drop clicon + www-data users, add default admin user
troglobit Apr 24, 2023
dd5f8ba
patches/klish: allow all users of group 'wheel' to connect to klishd
troglobit Apr 24, 2023
4080208
configs: enable avahi-autoipd for use as ZeroConf agent
troglobit Apr 24, 2023
8ce5333
src/confd: minor, spellcheck
troglobit Apr 24, 2023
af972db
src/confd: augment ietf-ip with an 'autoconf' setting also for IPv4
troglobit Apr 24, 2023
d125cca
src/confd: hackish w/a to get 'initctl reload' for ietf-interfaces
troglobit Apr 24, 2023
19318e8
package/confd: rename factory.cfg -> factory-config.cfg
troglobit Apr 24, 2023
4698582
package/confd: allow avahi (mDNS/SD) and sshd to be enabled by default
troglobit Apr 24, 2023
9f46d5d
package/confd: update factory-config, zeroconf for IPv4/IPv6 on eth0
troglobit Apr 24, 2023
d30eaac
configs/amd64_minimal_defconfig: simplified basic Linux build
troglobit Apr 25, 2023
4d5f9ed
configs: split defconfigs in default (NETCONF) and simplificed (native)
troglobit Apr 25, 2023
3f1eb3f
board/common: fix system timezone in "show system-information" command
troglobit Apr 25, 2023
265a946
board/common: add missing $DISK_IMAGE_SIZE to mkdisk.sh
troglobit Apr 26, 2023
0810a01
board/common: add menuconfig support for GNS3 RAM and num. of ifaces
troglobit Apr 26, 2023
359bc0e
configs: netconf build requires 512 MiB RAM and we want 10 ifaces
troglobit Apr 26, 2023
ca31290
Rename amd64 -> x86_64 and native -> classic
troglobit Apr 26, 2023
06be8e5
Simplify and refine NETCONF and Classic build variants
troglobit Apr 26, 2023
fef9c23
src/confd: set NETCONF specific motd as default
troglobit Apr 26, 2023
8c57ed2
board/common: let Bash update its PS1 hostname for each new line
troglobit Apr 26, 2023
d502e8f
configs: add aarch64_classic_defconfig, same as x86_64_classic
troglobit Apr 26, 2023
804d4fd
.github: update to bild all platform::variant defconfigs
troglobit Apr 26, 2023
ae5608e
.github: fix .ccache caching
troglobit Apr 26, 2023
6dfa8e9
board/netconf: add missing (empty) rootfs overlay
troglobit Apr 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,52 @@ on:
jobs:
build:
if: github.event.review.state == 'approved' || github.event_name == 'workflow_dispatch'
name: Build ${{ matrix.platform }}
name: Build ${{ matrix.platform }} ${{ matrix.variant }}
runs-on: ubuntu-latest
strategy:
matrix:
platform: [aarch64, amd64]
platform: [aarch64, x86_64]
variant: [netconf, classic]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set Build Variables
id: vars
run: |
echo "dir=infix-${{ matrix.platform }}" >> $GITHUB_OUTPUT
echo "tgz=infix-${{ matrix.platform }}.tar.gz" >> $GITHUB_OUTPUT
if [ "${{ matrix.variant }}" = "netconf" ]; then
target=${{ matrix.platform }}
else
target=${{ matrix.platform }}-${{ matrix.variant }}
fi
echo "dir=infix-$target" >> $GITHUB_OUTPUT
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
- name: Restore Cache of dl/
uses: actions/cache@v3
with:
path: dl/
key: dl-${{ matrix.platform }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
key: dl-${{ matrix.platform }}-${{ matrix.variant }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-${{ matrix.platform }}-${{ matrix.variant }}-
dl-${{ matrix.platform }}-
dl-
- name: Restore Cache of .ccache/
uses: actions/cache@v3
with:
path: .buildroot-ccache/
key: ccache-${{ matrix.board }}-os-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
path: .ccache/
key: ccache-${{ matrix.platform }}-${{ matrix.variant }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-${{ matrix.board }}-os-
ccache-${{ matrix.board }}-
ccache--os-
ccache-${{ matrix.platform }}-${{ matrix.variant }}-
ccache-${{ matrix.platform }}-
ccache-
- name: Configure & Build
run: |
make ${{ matrix.platform }}_defconfig
if [ "${{ matrix.variant }}" = "netconf" ]; then
target=${{ matrix.platform }}_defconfig
else
target=${{ matrix.platform }}_${{ matrix.variant }}_defconfig
fi
echo "Buildring $target ..."
make $target
make
- name: Prepare Artifact
run: |
Expand Down
28 changes: 28 additions & 0 deletions Config.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# For /etc/os-release, uses CondtionArchitechture= from systemd.unit(5)
config INFIX_ARCH
string
default "arm" if BR2_arm
default "arm64" if BR2_aarch64
default "mips64" if BR2_mips64
default "riscv64" if BR2_riscv
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"

source "$BR2_EXTERNAL_INFIX_PATH/package/Config.in"
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ may enable additional boards in the config, of course):
See the aarch64 specific [documentation](board/aarch64/README.md) for more
information.

### amd64
### x86_64

Primarily intended to be run under [QEMU][] for development & test as
well as evaluation, demo and [training][] purposes, e.g. using [GNS3][]
Expand All @@ -59,20 +59,23 @@ under `External options -> QEMU virtualization`.
GNS3
----

Download the [latest build][0] of amd64, unpack in a dedicated directory
and use ["Import Appliance"][9] to install the `.gns3a` file into GNS3.
Infix will show up in the "Router" category, it has 10 interfaces
available by default for use as switch ports or routing.
Download the [latest build][0] of the `x86_64`, or `x86_64_classic`
flavor. Unpack in a dedicated directory and use ["Import Appliance"][9]
to install the `.gns3a` file into GNS3. Infix (`x86_64`) is in the
"Router" category, it has 10 interfaces available by default for use as
switch ports or routing. The *classic* build only has one interface by
default, geared more towards acting as an end device.


Building
--------

Buildroot is almost stand-alone, but need a few locally installed tools
to bootstrap itself. For details, see the [excellent manual][manual].

Briefly, to build an Infix image; select the target and then make:

make amd64_defconfig
make x86_64_defconfig
make

Online help is available:
Expand Down
8 changes: 8 additions & 0 deletions board/classic/post-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/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
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions board/classic/rootfs/bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
pdmenu
clear
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ system()
{
h1 "SYSTEM INFORMATION"
echo "System Name : $(uname -n)"
echo "System Boot Mode : $(cat /tmp/.boot_mode)"
echo "System Variant : $VARIANT"
echo "System Description : $PRETTY_NAME"
echo "System Contact : $HOME_URL"
echo "System Timezone : $TZ"
echo "System Timezone : $(cat /etc/timezone)"
echo "System Type : $NAME"
echo "System Version : $(cat /etc/version)"
echo "System Arch : $(uname -m)"
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions board/classic/rootfs/etc/finit.d/20-infix-classic.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
run [S] /lib/infix/swup --
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions board/classic/rootfs/etc/network/interfaces.d/eth0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
auto eth0
iface eth0 inet dhcp
pre-up ip link set eth0 group iface
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ menu:system:System:System Settings
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:_Change Operating Mode::chom
exec:_Factory Reset::yorn "Reboot and factory reset device, are you sure?" factory -y
exec:_Factory Reset::yorn "Factory reset device (reboots), are you sure?" factory -y
nop
exit:_Main menu..

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
#!/bin/sh
# Only runs in native /etc and PROFINET nodes.

if initctl cond get boot/profinet; then
initctl enable snmpd
initctl disable lldpd
fi

# Factory default: all switch ports in VLAN 1 of br0
# need to check for 'length > 0' because ip command
Expand Down
35 changes: 22 additions & 13 deletions board/common/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ config SIGN_KEY

comment "Additional Artifacts"

# For /etc/os-release, uses CondtionArchitechture= from systemd.unit(5)
config INFIX_ARCH
string
default "arm" if BR2_arm
default "arm64" if BR2_aarch64
default "mips64" if BR2_mips64
default "riscv64" if BR2_riscv
default "x86_64" if BR2_x86_64

menuconfig DISK_IMAGE
bool "Disk image"
help
Expand All @@ -43,20 +34,38 @@ config DISK_IMAGE_SIZE
depends on DISK_IMAGE
default "512M"
help
Create a disk image of this size. Suffixes like K/M/G may be
used to multiply by powers of 1024. Suffixes like KB/MB/GB may
be used to multiply by powers of 1000.
Create a disk image of this size. A K/M/G suffix may be used
to multiply by powers of 1024. Suffixes like KB/MB/GB may be
used to multiply by powers of 1000. The image will be split
proportionally to fit the two rootfs, a kernel, a writable
/cfg and /var partiotions.

Minimum supported size is 512M.

config GNS3_APPLIANCE
menuconfig GNS3_APPLIANCE
bool "GNS3 Appliance"
select DISK_IMAGE
default y if BR2_x86_64
help
Create a GNS3 appliance description that, together with the
disk image, can be imported into GNS3.

config GNS3_APPLIANCE_RAM
int "Reserved RAM (MiB)"
depends on GNS3_APPLIANCE
default "192"
help
Amount of host RAM reserved for an appliance instance.

Minimum supported size is 192M.

config GNS3_APPLIANCE_IFNUM
int "Number of interfaces"
depends on GNS3_APPLIANCE
default "1"
help
Number of Ethernet interfaces to create for an appliance instance.

menuconfig FIT_IMAGE
bool "Traditional FIT image"
help
Expand Down
25 changes: 12 additions & 13 deletions board/common/mkdisk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ size2int()

dimension()
{

if [ $total -ge $((4 << G)) ]; then
bootsize=$(( 8 << M))
auxsize=$(( 8 << M))
Expand Down Expand Up @@ -161,24 +160,24 @@ cp -f $BINARIES_DIR/rootfs.itbh $root/aux/secondary.itbh

case "$arch" in
aarch64)
mkenvimage -s 0x4000 -o $root/aux/uboot.env \
$BR2_EXTERNAL_INFIX_PATH/board/common/uboot/aux-env.txt
mkenvimage -s 0x4000 -o "$root/aux/uboot.env" \
"$BR2_EXTERNAL_INFIX_PATH/board/common/uboot/aux-env.txt"
;;
x86_64)
mkdir -p $root/aux/grub
cp -f $BR2_EXTERNAL_INFIX_PATH/board/amd64/grub.cfg \
$BR2_EXTERNAL_INFIX_PATH/board/amd64/grubenv \
$root/aux/grub/
mkdir -p "$root/aux/grub"
cp -f "$BR2_EXTERNAL_INFIX_PATH/board/$arch/grub.cfg" \
"$BR2_EXTERNAL_INFIX_PATH/board/$arch/grubenv" \
"$root/aux/grub/"
;;
*)
;;
esac

rm -rf $tmp
rm -rf "$tmp"

genimage \
--rootpath $root \
--tmppath $tmp \
--inputpath $BINARIES_DIR \
--outputpath $BINARIES_DIR \
--config $root/genimage.cfg
--rootpath "$root" \
--tmppath "$tmp" \
--inputpath "$BINARIES_DIR" \
--outputpath "$BINARIES_DIR" \
--config "$root/genimage.cfg"
14 changes: 9 additions & 5 deletions board/common/mkgns3a.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#!/bin/sh

cat <<EOF >"$BINARIES_DIR/infix.gns3a"
NM="infix-${1:-custom}"
RAM=${2:-512}
IFNUM=${3:-1}

cat <<EOF >"$BINARIES_DIR/${NM}.gns3a"
{
"name": "infix",
"name": "$NM",
"category": "router",
"description": "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.",
"vendor_name": "KernelKit",
Expand All @@ -12,13 +16,13 @@ cat <<EOF >"$BINARIES_DIR/infix.gns3a"
"status": "stable",
"maintainer": "KernelKit",
"maintainer_email": "kernelkit@googlegroups.com",
"usage": "Default login is 'root', no password.\n\nType 'help' for an overview of commands and relevant configuration files.\n\nThe /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 console login is 'root', no password. For remote login, default user/pass: admin/admin also works.\n\nType 'help' for an overview of commands and relevant configuration files.\n\nThe /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/",
"port_name_format": "eth{0}",
"linked_clone": true,
"qemu": {
"adapter_type": "virtio-net-pci",
"adapters": 10,
"ram": 512,
"adapters": ${IFNUM},
"ram": ${RAM},
"cpus": 1,
"hda_disk_interface": "virtio",
"arch": "x86_64",
Expand Down
26 changes: 17 additions & 9 deletions board/common/post-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,25 @@ GIT_VERSION=$(git -C $BR2_EXTERNAL_INFIX_PATH describe --always --dirty --tags)
# original Buildroot information.
rm "$TARGET_DIR/etc/os-release"
{
echo "NAME=\"Infix\""
echo "VERSION=${GIT_VERSION}"
echo "ID=infix"
echo "ID_LIKE=\"${ID}\""
echo "VERSION_ID=${GIT_VERSION}"
echo "BUILD_ID=\"${NAME} ${VERSION}\""
echo "PRETTY_NAME=\"Infix by KernelKit\""
echo "ARCHITECTURE=\"${INFIX_ARCH}\""
echo "HOME_URL=https://github.com/KernelKit"
echo "NAME=\"Infix\""
echo "VERSION=${GIT_VERSION}"
echo "ID=infix"
echo "ID_LIKE=\"${ID}\""
echo "VERSION_ID=${GIT_VERSION}"
echo "BUILD_ID=\"${NAME} ${VERSION}\""
echo "PRETTY_NAME=\"Infix by KernelKit\""
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 "HOME_URL=https://github.com/KernelKit"
} > "$TARGET_DIR/etc/os-release"


echo "Infix by KernelKit $GIT_VERSION -- $(date +"%b %e %H:%M %Z %Y")" > "$TARGET_DIR/etc/version"

# Allow pdmenu (setup) to be a login shell
Expand Down
10 changes: 7 additions & 3 deletions board/common/post-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ ixmsg "Creating RAUC Update Bundle"
$common/mkrauc.sh $BR2_ARCH $SIGN_KEY

load_cfg DISK_IMAGE
load_cfg DISK_IMAGE_SIZE
if [ "$DISK_IMAGE" = "y" ]; then
ixmsg "Creating Disk Image"
$common/mkdisk.sh -a $BR2_ARCH
$common/mkdisk.sh -a $BR2_ARCH -s $DISK_IMAGE_SIZE
fi

load_cfg GNS3_APPLIANCE
if [ "$GNS3_APPLIANCE" = "y" ]; then
ixmsg "Creating GNS3 Appliance"
$common/mkgns3a.sh
load_cfg GNS3_APPLIANCE_RAM
load_cfg GNS3_APPLIANCE_IFNUM
load_cfg BR2_DEFCONFIG
ixmsg "Creating GNS3 Appliance, $GNS3_APPLIANCE_RAM MiB with $GNS3_APPLIANCE_IFNUM ports"
$common/mkgns3a.sh $(basename $BR2_DEFCONFIG _defconfig | tr _ -) $GNS3_APPLIANCE_RAM $GNS3_APPLIANCE_IFNUM
fi

load_cfg FIT_IMAGE
Expand Down
Loading