diff --git a/board/common/post-build.sh b/board/common/post-build.sh index f8d03418..bb9bc62e 100755 --- a/board/common/post-build.sh +++ b/board/common/post-build.sh @@ -61,6 +61,12 @@ rm -f "$TARGET_DIR/etc/os-release" echo "$INFIX_TAGLINE $VERSION -- $(date +"%b %e %H:%M %Z %Y")" > "$TARGET_DIR/etc/version" +# Drop Buildroot default symlink to /tmp +if [ -L "$TARGET_DIR/var/lib/avahi-autoipd" ]; then + rm "$TARGET_DIR/var/lib/avahi-autoipd" + mkdir "$TARGET_DIR/var/lib/avahi-autoipd" +fi + # Allow pdmenu (setup) and bash to be login shells, bash is added # automatically when selected in menuyconfig, but not when BusyBox # provides a symlink (for ash). The /bin/{true,false} are old UNIX @@ -73,3 +79,6 @@ grep -qsE '^/bin/true$$' "$TARGET_DIR/etc/shells" \ || echo "/bin/true" >> "$TARGET_DIR/etc/shells" grep -qsE '^/bin/false$$' "$TARGET_DIR/etc/shells" \ || echo "/bin/false" >> "$TARGET_DIR/etc/shells" +# Allow clish (symlink to /usr/bin/klish) to be a login shell +grep -qsE '^/bin/clish$$' "$TARGET_DIR/etc/shells" \ + || echo "/bin/clish" >> "$TARGET_DIR/etc/shells" diff --git a/board/netconf/rootfs/bin/askpass b/board/common/rootfs/bin/askpass similarity index 100% rename from board/netconf/rootfs/bin/askpass rename to board/common/rootfs/bin/askpass diff --git a/board/netconf/rootfs/bin/clish b/board/common/rootfs/bin/clish similarity index 100% rename from board/netconf/rootfs/bin/clish rename to board/common/rootfs/bin/clish diff --git a/board/common/rootfs/etc/avahi/avahi-autoipd.action b/board/common/rootfs/etc/avahi/avahi-autoipd.action index 997360de..2ac130a3 100755 --- a/board/common/rootfs/etc/avahi/avahi-autoipd.action +++ b/board/common/rootfs/etc/avahi/avahi-autoipd.action @@ -43,7 +43,7 @@ if [ -x /bin/ip -o -x /sbin/ip ] ; then BIND) ip addr flush dev "$2" label "$2:avahi" ip addr add "$3"/16 brd 169.254.255.255 label "$2:avahi" scope link dev "$2" proto 6 - ip route add default dev "$2" metric "$METRIC" scope link ||: + ip route add default dev "$2" metric "$METRIC" scope link proto 17 ||: ;; CONFLICT|UNBIND|STOP) diff --git a/board/netconf/rootfs/etc/iitod.json b/board/common/rootfs/etc/iitod.json similarity index 100% rename from board/netconf/rootfs/etc/iitod.json rename to board/common/rootfs/etc/iitod.json diff --git a/board/netconf/rootfs/etc/iproute2/rt_protos.d/infix.conf b/board/common/rootfs/etc/iproute2/rt_protos.d/infix.conf similarity index 100% rename from board/netconf/rootfs/etc/iproute2/rt_protos.d/infix.conf rename to board/common/rootfs/etc/iproute2/rt_protos.d/infix.conf diff --git a/board/netconf/rootfs/etc/profile.d/alias.sh b/board/common/rootfs/etc/profile.d/alias.sh similarity index 100% rename from board/netconf/rootfs/etc/profile.d/alias.sh rename to board/common/rootfs/etc/profile.d/alias.sh diff --git a/board/netconf/rootfs/etc/profile.d/cli-hint.sh b/board/common/rootfs/etc/profile.d/cli-hint.sh similarity index 100% rename from board/netconf/rootfs/etc/profile.d/cli-hint.sh rename to board/common/rootfs/etc/profile.d/cli-hint.sh diff --git a/board/common/rootfs/etc/schema-mount.xml b/board/common/rootfs/etc/schema-mount.xml new file mode 100644 index 00000000..3cccfcc1 --- /dev/null +++ b/board/common/rootfs/etc/schema-mount.xml @@ -0,0 +1,14 @@ + + + bbf-device-aggregation + urn:bbf:yang:bbf-device-aggregation + + + bbf-device-aggregation + + true + + /bbf-device-aggregation:devices/device + + + diff --git a/board/netconf/rootfs/etc/ssh/sshd_config.d/var-auth.conf b/board/common/rootfs/etc/ssh/sshd_config.d/var-auth.conf similarity index 100% rename from board/netconf/rootfs/etc/ssh/sshd_config.d/var-auth.conf rename to board/common/rootfs/etc/ssh/sshd_config.d/var-auth.conf diff --git a/board/netconf/rootfs/etc/sysctl.d/ipv4.conf b/board/common/rootfs/etc/sysctl.d/ipv4.conf similarity index 100% rename from board/netconf/rootfs/etc/sysctl.d/ipv4.conf rename to board/common/rootfs/etc/sysctl.d/ipv4.conf diff --git a/board/netconf/rootfs/etc/sysctl.d/ipv6.conf b/board/common/rootfs/etc/sysctl.d/ipv6.conf similarity index 100% rename from board/netconf/rootfs/etc/sysctl.d/ipv6.conf rename to board/common/rootfs/etc/sysctl.d/ipv6.conf diff --git a/board/netconf/rootfs/libexec/infix/probe b/board/common/rootfs/libexec/infix/probe similarity index 100% rename from board/netconf/rootfs/libexec/infix/probe rename to board/common/rootfs/libexec/infix/probe diff --git a/board/netconf/rootfs/libexec/infix/prod/fdisk b/board/common/rootfs/libexec/infix/prod/fdisk similarity index 100% rename from board/netconf/rootfs/libexec/infix/prod/fdisk rename to board/common/rootfs/libexec/infix/prod/fdisk diff --git a/board/netconf/rootfs/libexec/infix/prod/provision b/board/common/rootfs/libexec/infix/prod/provision similarity index 100% rename from board/netconf/rootfs/libexec/infix/prod/provision rename to board/common/rootfs/libexec/infix/prod/provision diff --git a/board/common/xattrs b/board/common/xattrs index b38f8f61..89db8732 100644 --- a/board/common/xattrs +++ b/board/common/xattrs @@ -1,3 +1,5 @@ # Allow users in wheel group to reboot and perform a factory reset /sbin/initctl f 4750 root wheel - - - - - /sbin/factory f 4750 root wheel - - - - - + +/var/lib/avahi-autoipd d 0755 avahi avahi - - - - - diff --git a/board/netconf/post-build.sh b/board/netconf/post-build.sh deleted file mode 100755 index 5d00adba..00000000 --- a/board/netconf/post-build.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# shellcheck disable=SC1090 -. "$BR2_CONFIG" 2>/dev/null - -# Drop Buildroot default symlink to /tmp -if [ -L "$TARGET_DIR/var/lib/avahi-autoipd" ]; then - rm "$TARGET_DIR/var/lib/avahi-autoipd" - mkdir "$TARGET_DIR/var/lib/avahi-autoipd" -fi - -# Allow clish (symlink to /usr/bin/klish) to be a login shell -grep -qsE '^/bin/clish$$' "$TARGET_DIR/etc/shells" \ - || echo "/bin/clish" >> "$TARGET_DIR/etc/shells" diff --git a/board/netconf/rootfs/.empty b/board/netconf/rootfs/.empty deleted file mode 100644 index e69de29b..00000000 diff --git a/board/netconf/rootfs/etc/avahi/avahi-autoipd.action b/board/netconf/rootfs/etc/avahi/avahi-autoipd.action deleted file mode 100755 index 2ac130a3..00000000 --- a/board/netconf/rootfs/etc/avahi/avahi-autoipd.action +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh - -# This file is part of avahi. -# -# avahi is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2 of the -# License, or (at your option) any later version. -# -# avahi is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with avahi; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. - -set -e - -# Command line arguments: -# $1 event that happened: -# BIND: Successfully claimed address -# CONFLICT: An IP address conflict happened -# UNBIND: The IP address is no longer needed -# STOP: The daemon is terminating -# $2 interface name -# $3 IP adddress - -PATH="$PATH:/usr/bin:/usr/sbin:/bin:/sbin" - -# Use a different metric for each interface, so that we can set -# identical routes to multiple interfaces. - -METRIC=$((1000 + `cat "/sys/class/net/$2/ifindex" 2>/dev/null || echo 0`)) - -if [ -x /bin/ip -o -x /sbin/ip ] ; then - - # We have the Linux ip tool from the iproute package - - case "$1" in - BIND) - ip addr flush dev "$2" label "$2:avahi" - ip addr add "$3"/16 brd 169.254.255.255 label "$2:avahi" scope link dev "$2" proto 6 - ip route add default dev "$2" metric "$METRIC" scope link proto 17 ||: - ;; - - CONFLICT|UNBIND|STOP) - ip route del default dev "$2" metric "$METRIC" scope link ||: - ip addr del "$3"/16 brd 169.254.255.255 label "$2:avahi" scope link dev "$2" - ;; - - *) - echo "Unknown event $1" >&2 - exit 1 - ;; - esac - -elif [ -x /bin/ifconfig -o -x /sbin/ifconfig ] ; then - - # We have the old ifconfig tool - - case "$1" in - BIND) - ifconfig "$2:avahi" inet "$3" netmask 255.255.0.0 broadcast 169.254.255.255 up - route add default dev "$2:avahi" metric "$METRIC" ||: - ;; - - CONFLICT|STOP|UNBIND) - route del default dev "$2:avahi" metric "$METRIC" ||: - ifconfig "$2:avahi" down - ;; - - *) - echo "Unknown event $1" >&2 - exit 1 - ;; - esac - -else - - echo "No network configuration tool found." >&2 - exit 1 - -fi - -exit 0 diff --git a/board/netconf/xattrs b/board/netconf/xattrs deleted file mode 100644 index dbe17d74..00000000 --- a/board/netconf/xattrs +++ /dev/null @@ -1 +0,0 @@ -/var/lib/avahi-autoipd d 0755 avahi avahi - - - - - diff --git a/configs/aarch64_defconfig b/configs/aarch64_defconfig index ec3d03d8..f23048e2 100644 --- a/configs/aarch64_defconfig +++ b/configs/aarch64_defconfig @@ -12,7 +12,7 @@ BR2_TARGET_GENERIC_HOSTNAME="infix" BR2_TARGET_GENERIC_ISSUE="Infix by KernelKit" BR2_INIT_FINIT=y BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y -BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs ${BR2_EXTERNAL_INFIX_PATH}/board/netconf/xattrs" +BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs" # BR2_TARGET_ENABLE_ROOT_LOGIN is not set BR2_SYSTEM_BIN_SH_BASH=y BR2_TARGET_GENERIC_GETTY_TERM="xterm" @@ -20,8 +20,8 @@ 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/netconf/rootfs" -BR2_ROOTFS_POST_BUILD_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh ${BR2_EXTERNAL_INFIX_PATH}/board/netconf/post-build.sh" +BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/rootfs" +BR2_ROOTFS_POST_BUILD_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.shsh" BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y diff --git a/configs/x86_64_defconfig b/configs/x86_64_defconfig index 6319f71a..ce8173c2 100644 --- a/configs/x86_64_defconfig +++ b/configs/x86_64_defconfig @@ -11,7 +11,7 @@ BR2_TARGET_GENERIC_HOSTNAME="infix" BR2_TARGET_GENERIC_ISSUE="Infix by KernelKit" BR2_INIT_FINIT=y BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y -BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs ${BR2_EXTERNAL_INFIX_PATH}/board/netconf/xattrs" +BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs" # BR2_TARGET_ENABLE_ROOT_LOGIN is not set BR2_SYSTEM_BIN_SH_BASH=y BR2_TARGET_GENERIC_GETTY_TERM="xterm" @@ -19,8 +19,8 @@ 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/netconf/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/netconf/post-build.sh" +BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNAL_INFIX_PATH}/board/x86_64/rootfs" +BR2_ROOTFS_POST_BUILD_SCRIPT="board/qemu/x86_64/post-build.sh ${BR2_EXTERNAL_INFIX_PATH}/board/common/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