Compare commits

..
1 Commits
Author SHA1 Message Date
Tobias Waldekranz 747b211348 klinfix: Initial add
Infix integration of klish and klish-plugin-sysrepo.
2023-03-29 16:14:43 +02:00
1089 changed files with 21596 additions and 91174 deletions
+29 -43
View File
@@ -2,16 +2,17 @@ Contributing to Infix
=====================
We welcome any and all help in the form of bug reports, fixes, patches
to add new features -- *preferably as GitHub pull requests*.
to add new features -- *preferably as GitHub pull requests*. Other
methods are of course also possible: emailing the [maintainers][] a
patch or even a raw file, a feature request or an alert of a problem.
If you are unsure of what to do, or how to implement an idea or bug fix,
open an issue with `"[RFC]: Unsure if this is a bug ... ?"`, or use the
[GitHub discussions forum](https://github.com/orgs/kernelkit/discussions).
Talking about code and problems first is often the best way to get started
before submitting a pull request.
If you are unsure of what to do, or how to implement an idea or bugfix,
open an issue with `"[RFC: Unsure if this is a bug ... ?"`, or use the
GitHub discussions forum, so we can discuss it. Talking about the code
first is the best way to get started before submitting a pull request.
When submitting a bug report, patch, or pull request, please start by
stating the version the change is made against, what it does, *and why*.
Either way, when sending an email, patch, or pull request, start by
stating the version the change is made against, what it does, and why.
Please take care to ensure you follow the project coding style and the
commit message format. If you follow these recommendations you help
@@ -21,28 +22,13 @@ the maintainer(s) and make it easier for them to include your code.
Coding Style
------------
Before jumping into code, remember to **document new features** and bug
fixes. Both the manual and ChangeLog are in the `doc/` sub-directory
and it is expected that you provide a human-readable summary for the
release notes (ChangeLog) and at least a configuration example in the
manual for new features.
> **Tip:** Always submit code that follows the style of surrounding code!
> **Tip:** consider ["Readme driven development"][RDD] for new features.
> It is amazing how many flaws in your own bright ideas come to bare
> when you suddenly have to explain them to someone else!
First of all, lines are allowed to be longer than 72 characters these
days. In fact, there exist no enforced maximum, but keeping it around
100 chars is OK.
We expect code contributions for:
- C code in [Linux Coding Style][Linux]
- Python code should follow [PEP-8][]
> **However,** always submit code that follows the style of surrounding
> code! Legacy takes precedence, and remember, we read code a lot more
> than write it, so legibility is important.
As a final note, lines are allowed to be longer than 72 characters these
days. There is no enforced maximum, but the team usually keep it around
100 characters for both C and Python.
The coding style itself is otherwise strictly Linux [KNF][].
Commit Messages
@@ -52,21 +38,22 @@ Commit messages exist to track *why* a change was made. Try to be as
clear and concise as possible in your commit messages, and always, be
proud of your work and set up a proper GIT identity for your commits:
$ git config --global user.name "Jacky Linker"
$ git config --global user.email jacky.linker@example.com
git config --global user.name "Jane Doe"
git config --global user.email jane.doe@example.com
Example commit message from the [Pro Git][gitbook] online book, notice
how `git commit -s` is used to automatically add a `Signed-off-by`:
subsystem: brief, but clear and concise summary of changes
Brief, but clear and concise summary of changes
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as
the subject of an email and the rest of the text as the body. The
empty line separating summary from body is critical. Tools like
rebase can get confused if the empty line is missing.
blank line separating the ummary from the body is critical (unless
you omit the body entirely); tools like rebase can get confused if
you run the two together.
Further paragraphs should be separated with empty lines.
Further paragraphs come after blank lines.
- Bullet points are okay, too
@@ -74,19 +61,18 @@ how `git commit -s` is used to automatically add a `Signed-off-by`:
by a single space, with blank lines in between, but conventions
vary here
Signed-off-by: Jacky Linker <jacky.linker@example.com>
Signed-off-by: Jane Doe <jane.doe@example.com>
Code of Conduct
---------------
It is expected of everyone to respect the [Code of Conduct][conduct].
The *"maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, discussion forum threads, issues, and
other contributions that are not aligned to this Code of Conduct."*
The *"maintainers have the right and responsibility to remove, edit,
or reject comments, commits, code, wiki edits, issues, and other
contributions that are not aligned to this Code of Conduct."*
[Linux]: https://www.kernel.org/doc/html/v6.9/process/coding-style.html
[PEP-8]: https://peps.python.org/pep-0008/
[RDD]: https://tom.preston-werner.com/2010/08/23/readme-driven-development
[gitbook]: https://git-scm.com/book/ch5-2.html
[conduct]: CODE-OF-CONDUCT.md
[1]: ../doc/MAINTAINERS
[KNF]: https://en.wikipedia.org/wiki/Kernel_Normal_Form
[gitbook]: https://git-scm.com/book/ch5-2.html
[conduct]: CODE-OF-CONDUCT.md
-69
View File
@@ -1,69 +0,0 @@
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
name: "\U0001F41E Bug report"
description: Create a bug report
labels:
- "bug"
- "triage"
body:
- type: markdown
attributes:
value: |
**Thank :heart: you for taking the time to fill out this bug report!**
We kindly ask that you search to see if an issue [already exists](https://github.com/kernelkit/infix/issues?q=is%3Aissue+sort%3Acreated-desc+) for the bug you encountered.
- type: textarea
attributes:
label: Current Behavior
description: |
A clear and concise description of the issue you're experiencing.
value: |
For code snippets, logs, commands, etc., please use triple backticks:
```
admin@infix-c0-ff-ee:/> show log
May 15 07:21:02 infix-00-00-00 container[3192]: Failed creating container test from curios-httpd-v24.03.0
- (press h for help or q to quit)
```
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: |
A clear and concise description of what you expected to happen.
value: |
```
admin@infix-c0-ff-ee:/> show log
May 15 07:21:02 infix-c0-ff-ee container[3192]: Successfully created container test from curios-httpd-v24.03.0
- (press h for help or q to quit)
```
validations:
required: true
- type: textarea
attributes:
label: Steps To Reproduce
description: |
Steps to reproduce the issue. For example:
1. Built from source
2. Upgrade to latest release, vYY.MM.P
3. Factory reset
4. Enable feature
5. Check the logs/show command/operational status
validations:
required: false
- type: textarea
attributes:
label: Additional information
description: |
- Relevant parts of `startup-config`
- Output from `show interfaces`, if applicable
- Other observations, screenshots, log files ...
**Tip:** You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
-7
View File
@@ -1,7 +0,0 @@
contact_links:
- name: "🔍 Look for my Issue"
url: https://github.com/kernelkit/infix/issues?q=is%3Aissue+sort%3Acreated-desc+
about: Thank ❤️ you for your time! We kindly ask that you first check if an issue already exists.
- name: "💬 Discussions and Q&A"
url: https://github.com/kernelkit/infix/discussions
about: Discussions are perfect for quick questions, bouncing ideas, and things that may be a bug.
@@ -1,45 +0,0 @@
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
name: "\U0001F6E0 Feature request"
description: Suggest a new feature, idea or improvement of the OS
labels:
- "feature"
- "triage"
body:
- type: markdown
attributes:
value: |
**Thank :heart: you for taking the time to fill out this feature request!**
We kindly ask that you search to see if an issue [already exists](https://github.com/kernelkit/infix/issues?q=is%3Aissue+sort%3Acreated-desc+) for your feature. We are also happy to accept contributions from our users. For details see [CONTRIBUTING](https://github.com/kernelkit/infix/blob/master/.github/CONTRIBUTING.md).
- type: textarea
attributes:
label: Description
description: |
A clear and concise description of the problem or missing feature.
**Example:** *I'm always frustrated when [...]*, or *I'd like to see support for [...]*
validations:
required: true
- type: textarea
attributes:
label: Additional Information
description: |
Any other related information, e.g. existing YANG model(s), or possibly screenshots about the feature request here.
validations:
required: false
- type: textarea
attributes:
label: General Information
description: |
Appended to all feature requests for future readers.
value: |
Anyone can help out by [sponsoring][1] development of new features or [contributing][2] pull requests.
Please use this issue for discussions related to the feature.
[1]: https://github.com/kernelkit/infix/blob/main/.github/SUPPORT.md
[2]: https://github.com/kernelkit/infix/blob/main/.github/CONTRIBUTING.md
validations:
required: true
-1
View File
@@ -1 +0,0 @@
Paid support and development provided by Addiva Elektronik <https://addiva.se>
-31
View File
@@ -1,31 +0,0 @@
## Description
<!--
-- A description of changes, detailing *why* changes are made.
-- Remember: assign a reviewer, or use @mentions if org. member.
-->
## Other information
<!-- Other relevant info, e.g., before/after screenshots -->
## Checklist
Tick *relevant* boxes, this PR is-a or has-a:
- [ ] Bugfix
- [ ] Regression tests
- [ ] ChangeLog updates (for next release)
- [ ] Feature
- [ ] YANG model change => revision updated?
- [ ] Regression tests added?
- [ ] ChangeLog updates (for next release)
- [ ] Documentation added?
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (please detail in commit messages)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):
+36 -115
View File
@@ -1,153 +1,74 @@
name: Bob the Builder
#on:
# push:
# branches:
# - '*'
# pull_request:
# branches:
# - '*'
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
name: Build Infix ${{ matrix.target }}
runs-on: [ self-hosted, latest ]
name: Build ${{ matrix.platform }}
runs-on: ubuntu-latest
strategy:
matrix:
target: [aarch64, x86_64]
platform: [aarch64, amd64]
fail-fast: false
steps:
- name: Cleanup Build Folder
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- uses: actions/checkout@v4
with:
clean: true
submodules: recursive
- uses: actions/checkout@v3
- name: Set Build Variables
id: vars
run: |
target=${{ matrix.target }}
echo "dir=infix-$target" >> $GITHUB_OUTPUT
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
echo "dir=infix-${{ matrix.platform }}" >> $GITHUB_OUTPUT
echo "tgz=infix-${{ matrix.platform }}.tar.gz" >> $GITHUB_OUTPUT
- name: Restore Cache of dl/
uses: actions/cache@v4
uses: actions/cache@v3
with:
path: dl/
key: dl-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
key: dl-${{ matrix.platform }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-${{ matrix.platform }}-
dl-
- name: Restore Cache of .ccache/
uses: actions/cache@v4
uses: actions/cache@v3
with:
path: .ccache/
key: ccache-${{ matrix.target }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
path: .buildroot-ccache/
key: ccache-${{ matrix.board }}-os-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-${{ matrix.target }}-
ccache-
- name: Configure ${{ matrix.target }}
ccache-${{ matrix.board }}-os-
ccache-${{ matrix.board }}-
ccache--os-
- name: Configure & Build
run: |
make ${{ matrix.target }}_defconfig
- name: Unit Test ${{ matrix.target }}
run: |
make test-unit
- name: Build ${{ matrix.target }}
run: |
echo "Building ${{ matrix.target }}_defconfig ..."
make ${{ matrix.platform }}_defconfig
make
- name: Check SBOM from Build
- name: Prepare Artifact
run: |
make legal-info
- name: Prepare ${{ matrix.target }} Artifact
run: |
cd output/
cd output
mv images ${{ steps.vars.outputs.dir }}
ln -s ${{ steps.vars.outputs.dir }} images
tar chfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
- uses: actions/upload-artifact@v4
tar cfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
ls -l
ls -l ${{ steps.vars.outputs.dir }}
- uses: actions/upload-artifact@v3
with:
path: output/${{ steps.vars.outputs.tgz }}
name: artifact-${{ matrix.target }}
test:
name: Regression Test of Infix x86_64
needs: build
runs-on: [ self-hosted, regression ]
steps:
- uses: actions/checkout@v4
with:
clean: true
submodules: recursive
- name: Configure x86_64
run: |
make x86_64_defconfig
- uses: actions/download-artifact@v4
with:
pattern: "artifact-*"
merge-multiple: true
- name: Restore x86-64 output/
run: |
ls -l
mkdir -p output
mv infix-x86_64.tar.gz output/
cd output/
tar xf infix-x86_64.tar.gz
ln -s infix-x86_64 images
- name: Regression Test
run: |
make test
- name: Publish Test Result
# Ensure this runs even if Regression Test fails
if: always()
run: cat test/.log/last/result-gh.md >> $GITHUB_STEP_SUMMARY
release:
if: ${{github.repository_owner == 'kernelkit' && github.ref_name == 'main'}}
name: Upload Latest Build
needs: test
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v3
- uses: pyTooling/Actions/releaser@main
with:
pattern: "artifact-*"
merge-multiple: true
- name: Create checksums ...
run: |
for file in *.tar.gz; do
sha256sum $file > $file.sha256
done
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
omitName: true
omitBody: true
omitBodyDuringUpdate: true
prerelease: true
tag: "latest"
tag: latest
rm: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "*.tar.gz*"
files: artifact/*
- name: Summary
run: |
cat <<EOF >> $GITHUB_STEP_SUMMARY
-92
View File
@@ -1,92 +0,0 @@
name: Coverity Scan
on:
schedule:
- cron: '5 0 * * 6'
workflow_dispatch:
env:
PROJECT_NAME: Infix
CONTACT_EMAIL: troglobit@gmail.com
jobs:
coverity:
if: ${{github.repository_owner == 'kernelkit'}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Fetch latest Coverity Scan MD5
id: var
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
run: |
wget -q https://scan.coverity.com/download/cxx/linux64 \
--post-data "token=$TOKEN&project=${PROJECT_NAME}&md5=1" \
-O coverity-latest.tar.gz.md5
echo "md5=$(cat coverity-latest.tar.gz.md5)" | tee -a $GITHUB_OUTPUT
- uses: actions/cache@v4
id: cache
with:
path: coverity-latest.tar.gz
key: ${{ runner.os }}-coverity-${{ steps.var.outputs.md5 }}
restore-keys: |
${{ runner.os }}-coverity-${{ steps.var.outputs.md5 }}
${{ runner.os }}-coverity-
${{ runner.os }}-coverity
- name: Download Coverity Scan
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
run: |
if [ ! -f coverity-latest.tar.gz ]; then
wget -q https://scan.coverity.com/download/cxx/linux64 \
--post-data "token=$TOKEN&project=${PROJECT_NAME}" \
-O coverity-latest.tar.gz
else
echo "Latest Coverity Scan available from cache :-)"
md5sum coverity-latest.tar.gz
fi
mkdir coverity
tar xzf coverity-latest.tar.gz --strip 1 -C coverity
- name: Install dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install pkg-config libjansson-dev libev-dev \
libcrypt-dev libglib2.0-dev libpcre2-dev \
libuev-dev libite-dev
- name: Build dependencies
run: |
git clone https://github.com/CESNET/libyang.git
mkdir libyang/build
(cd libyang/build && cmake .. && make all && sudo make install)
git clone https://github.com/sysrepo/sysrepo.git
mkdir sysrepo/build
(cd sysrepo/build && cmake .. && make all && sudo make install)
make dep
- name: Check applications
run: |
export PATH=`pwd`/coverity/bin:$PATH
cov-build --dir cov-int make check
- name: Submit results to Coverity Scan
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
run: |
tar czvf ${PROJECT_NAME}.tgz cov-int
curl \
--form token=$TOKEN \
--form email=${CONTACT_EMAIL} \
--form file=@${PROJECT_NAME}.tgz \
--form version=$(git rev-parse HEAD) \
--form description="${PROJECT_NAME} $(git rev-parse HEAD)" \
https://scan.coverity.com/builds?project=${PROJECT_NAME}
- name: Upload build.log
uses: actions/upload-artifact@v4
with:
name: coverity-build.log
path: cov-int/build-log.txt
-100
View File
@@ -1,100 +0,0 @@
name: Manny the Manager
on:
workflow_dispatch:
inputs:
checkout:
required: true
type: boolean
cleanup:
required: true
type: boolean
peek:
required: true
type: boolean
jobs:
inventory:
runs-on: ubuntu-latest
steps:
- name: Disk usage ...
run: |
cd
du -hs .[^.]*
- name: Disk inventory (1/2) ...
run: |
echo "df -h ========================================================================="
df -h
echo "mounts ========================================================================"
mount
- name: File inventory (1/2) ...
run: |
echo "Current directory: $(pwd)"
echo "Files in $HOME ================================================================"
ls $HOME
echo "Find $HOME ===================================================================="
find $HOME
- name: Container inventory ...
run: |
echo "Available container images: ==================================================="
docker images
echo "Available containers: ========================================================="
docker ps -a
checkout:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Restore Cache of dl/
uses: actions/cache@v4
with:
path: dl/
key: dl-netconf-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-netconf-
dl-
- name: Restore Cache of .ccache/
uses: actions/cache@v4
with:
path: .ccache/
key: ccache-x86_64-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-x86_64-
ccache-
- name: Disk inventory (2/2) ...
run: |
echo "df -h ========================================================================="
df -h
echo "mounts ========================================================================"
mount
- name: File inventory (2/2) ...
run: |
echo "Current directory: $(pwd)"
echo "Files in $HOME ================================================================"
ls $HOME
echo "Find $HOME ===================================================================="
find $HOME
peeky:
if: ${{ inputs.peek }}
runs-on: ubuntu-latest
steps:
- name: Peek & Poke ...
run: |
whoami
ls -l /mnt/
cat /mnt/DATALOSS_WARNING_README.txt
sudo mkdir /mnt/x-aarch64
sudo chown $(id -un):$(id -gn) /mnt/x-aarch64
ls -l /mnt/
cleanup:
if: ${{ inputs.cleanup }}
needs: [inventory, peeky]
runs-on: ubuntu-latest
steps:
- name: Cleaning up cruft ...
run: |
docker image prune -af
docker volume prune -f
docker container prune -f
-159
View File
@@ -1,159 +0,0 @@
# This job can be started by a git tag or using the workflow dispatch.
#
# The version string *must* be of the format: vYY.MM(-alphaN|-betaN|-rcN)
#
# In /etc/os-release this string is used for VERSION, VERSION_ID, and
# IMAGE_VERSION, with the 'v' prefix. In release artifact filenames,
# and zip file directory names, the 'v' is dropped per convention.
name: Release General
on:
push:
tags:
- 'v[0-9]*.*'
workflow_dispatch:
inputs:
version:
required: false
type: string
jobs:
build:
if: github.repository == 'kernelkit/infix' && startsWith(github.ref, 'refs/tags/')
name: Build Infix ${{ github.ref_name }} [${{ matrix.target }}]
runs-on: [ self-hosted, release ]
strategy:
matrix:
target: [aarch64, x86_64]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
clean: true
submodules: recursive
- name: Set Release Variables
id: vars
run: |
if [ -n "${{ inputs.version }}" ]; then
ver=${{ inputs.version }}
else
ver=${GITHUB_REF#refs/tags/}
fi
echo "ver=${ver}" >> $GITHUB_OUTPUT
fver=${ver#v}
target=${{ matrix.target }}-${fver}
echo "dir=infix-$target" >> $GITHUB_OUTPUT
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
- name: Restore Cache of dl/
uses: actions/cache@v4
with:
path: dl/
key: dl-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-
- name: Restore Cache of .ccache/
uses: actions/cache@v4
with:
path: .ccache/
key: ccache-${{ matrix.target }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-${{ matrix.target }}-
ccache-
- name: Configure & Build
env:
INFIX_RELEASE: ${{ steps.vars.outputs.ver }}
run: |
target=${{ matrix.target }}_defconfig
echo "Building $target ..."
make $target
make
- name: Generate SBOM from Build
run: |
make legal-info
- name: Prepare Artifacts
run: |
cd output/
mv images ${{ steps.vars.outputs.dir }}
ln -s ${{ steps.vars.outputs.dir }} images
tar chfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
mv legal-info legal-info-$target
tar chfz legal-info-$target.tar.gz legal-info-$target
- uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.target }}
path: output/*.tar.gz
release:
name: Release Infix ${{ github.ref_name }}
needs: build
runs-on: [ self-hosted, release ]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set Release Variables
id: rel
run: |
if [ -n "${{ inputs.version }}" ]; then
ver=${{ inputs.version }}
else
ver=${GITHUB_REF#refs/tags/}
fi
echo "ver=${ver}" >> $GITHUB_OUTPUT
if echo $ver | grep -qE 'v[0-9.]+(-alpha|-beta|-rc)[0-9]*'; then
echo "pre=true" >> $GITHUB_OUTPUT
echo "latest=false" >> $GITHUB_OUTPUT
elif echo $ver | grep -qE '^v[0-9.]+\.[0-9.]+(\.[0-9]+)?$'; then
echo "pre=false" >> $GITHUB_OUTPUT
echo "latest=true" >> $GITHUB_OUTPUT
else
echo "pre=false" >> $GITHUB_OUTPUT
echo "latest=false" >> $GITHUB_OUTPUT
fi
echo "pre=${{ steps.rel.outputs.pre }}"
echo "latest=${{ steps.rel.outputs.latest }}"
- uses: actions/download-artifact@v4
with:
pattern: "artifact-*"
merge-multiple: true
- name: Create checksums ...
run: |
for file in *.tar.gz; do
sha256sum $file > $file.sha256
done
- name: Extract ChangeLog entry ...
run: |
awk '/^-----*$/{if (x == 1) exit; x=1;next}x' doc/ChangeLog.md \
|head -n -1 > release.md
cat release.md
- uses: ncipollo/release-action@v1
with:
name: Infix ${{ github.ref_name }}
prerelease: ${{ steps.rel.outputs.pre }}
makeLatest: ${{ steps.rel.outputs.latest }}
bodyFile: release.md
artifacts: "*.tar.gz*"
- name: Summary
run: |
cat <<EOF >> $GITHUB_STEP_SUMMARY
# Infix ${{ github.ref_name }} Released! :rocket:
For the public download links of this release, please see:
<https://github.com/kernelkit/infix/releases/tag/${{ github.ref_name }}>
EOF
-28
View File
@@ -1,28 +0,0 @@
# To enable automatic sync of your Infix fork every day, or on dispatch,
# set the repoistory or organisation variable (not secret):
#
# SYNC_FORK = true
#
# You also need a GH_SYNC_REPO token allowed to update workflows. For
# more information on variables and secrets, see the GitHub docs.
# See https://docs.github.com/en/actions/learn-github-actions/variables
name: Synchronize your fork of Infix with upstream
on:
schedule:
- cron: 42 2 * * *
workflow_dispatch:
jobs:
sync_fork:
if: ${{github.repository_owner != 'kernelkit' && vars.SYNC_FORK == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: TobKed/github-forks-sync-action@master
with:
github_token: ${{ secrets.GH_SYNC_REPO }}
upstream_repository: KernelKit/infix
upstream_branch: main
target_branch: main
force: false
tags: true
-4
View File
@@ -1,10 +1,6 @@
*~
.gdb_history
/.backup
/.ccache
/dl
/output*
/x-*
/test/.venv
/test/.log
/local.mk
-6
View File
@@ -1,9 +1,3 @@
[submodule "buildroot"]
path = buildroot
url = ../buildroot.git
[submodule "9pm"]
path = test/9pm
url = ../9pm
[submodule "qeneth"]
path = test/qeneth
url = ../qeneth.git
+7 -111
View File
@@ -1,117 +1,13 @@
menu "Branding"
menu "Packages"
config INFIX_VENDOR
string "Vendor name"
default "KernelKit"
help
The name of the operating system vendor. This is the name of the
organization or company which produces the OS.
This name is intended to be exposed in "About this system" UIs or
software update UIs when needed to distinguish the OS vendor from
the OS itself. It is intended to be human readable.
Used for VENDOR_NAME in /etc/os-release and GNS3 appliance files.
config INFIX_VENDOR_HOME
string "Vendor URL"
help
The homepage of the OS vendor. The value should be in RFC3986
format, and should be "http:" or "https:" URLs. Only one URL shall
be listed in the setting.
Optional, used for VENDOR_HOME in /etc/os-release
config INFIX_NAME
string "Operating system name"
default "Infix"
help
Mandatory. Used for identifying the OS as NAME in /etc/os-release
and product_name in GNS3 appliance files.
config INFIX_ID
string "Operating system identifier"
default "infix"
help
A lower-case string (no spaces or other characters outside of 09,
az, '.', '_' and '-') identifying the operating system, excluding
any version information and suitable for processing by scripts or
usage in generated filenames.
Mandatory. Used for identifying the OS as ID in /etc/os-release and
in the generated image name: ID-ARCH-VERSION.img
config INFIX_IMAGE_ID
string "Operating system image name"
default "${INFIX_ID}-${BR2_ARCH}"
help
A lower-case string (no spaces or other characters outside of 09,
az, ".", "_" and "-"), for naming critical image files, directories
and archives containting the operating system.
Mandatory. When INFIX_RELEASE is set, this string is appended to
the IMAGE_ID with a '-' separator.
config INFIX_TAGLINE
string "Operating system tagline"
default "Infix -- a Network Operating System"
help
Mandatory. Used for identifying the OS, e.g. as PRETTY_NAME in
/etc/os-release and description in the GNS3 appliance.
This is also show at boot when the system init process starts.
config INFIX_DESC
string "Operating system description"
help
Optional. Used for long description texts about the OS. E.g.,
the GNS3 appliance file description field. Saved in the file
/etc/os-release as INFIX_DESC.
config INFIX_HOME
string "Operating system URL"
help
Used for identifying the OS, e.g. as HOME_URL in /etc/os-release
config INFIX_DOC
string "Operating system docs"
help
Optional. Main documentation URL, will be shown in /etc/os-release
as DOCUMENTATION_URL.
config INFIX_SUPPORT
string "Operating system support"
help
Main support page for the operating system, if there is any. This
is primarily intended for operating systems which vendors provide
support for. May be a http:, https:, or mailto: URI.
Optional. Shown, e.g., as SUPPORT_URL in /etc/os-release or
maintainer_email in .gns3a.
config INFIX_OEM_PATH
string "Path to OEM br2-external"
help
A br2-external using Infix will likely want to version the branded
OS using their own GIT tags. Set this variable to point to the base
directory (absolute path) and the Infix post-build.sh will call `git
describe -C $INFIX_OEM_PATH`.
Note: for release builds the global variable INFIX_RELEASE overrides
the version information derived from `git describe`. However, the
GIT version is always saved as the BUILD_ID in /etc/os-releases.
source "$BR2_EXTERNAL_INFIX_PATH/package/Config.in"
endmenu
# 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
menu "QEMU Virtualization"
source "$BR2_EXTERNAL_INFIX_PATH/qemu/Config.in"
endmenu
source "$BR2_EXTERNAL_INFIX_PATH/package/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/Config.in.host"
source "$BR2_EXTERNAL_INFIX_PATH/board/common/Config.in"
+4 -19
View File
@@ -1,13 +1,8 @@
export BR2_EXTERNAL ?= $(CURDIR)
export BR2_EXTERNAL := $(CURDIR)
export PATH := $(CURDIR)/bin:$(PATH)
ARCH ?= $(shell uname -m)
O ?= output
# If a relative output path is specified, we have to translate it to
# an absolute one before handing over control to Buildroot, which will
# otherwise treat it as relative to ./buildroot.
override O := $(if $(filter /%,$O),$O,$(CURDIR)/$O)
O ?= $(CURDIR)/output
config := $(O)/.config
bmake = $(MAKE) -C buildroot O=$(O) $1
@@ -16,10 +11,6 @@ bmake = $(MAKE) -C buildroot O=$(O) $1
all: $(config) buildroot/Makefile
@+$(call bmake,$@)
check dep:
@echo "Starting local check, stage $@ ..."
@make -C src $@
$(config):
@+$(call bmake,list-defconfigs)
@echo "\e[7mERROR: No configuration selected.\e[0m"
@@ -27,17 +18,11 @@ $(config):
@echo "'make <board>_defconfig' before building an image."
@exit 1
%: | buildroot/Makefile
@+$(call bmake,$@)
legal-info: | buildroot/Makefile
$(call bmake,legal-info LINUX_LICENSE_FILES=COPYING)
# Workaround, see board/x86_64/board.mk
test:
@+$(call bmake,$@)
buildroot/Makefile:
@git submodule update --init
.PHONY: all check test
.PHONY: all
+109 -109
View File
@@ -1,129 +1,129 @@
[![License Badge][]][License] [![GitHub Status][]][GitHub] [![Coverity Status][]][Coverity Scan] [![Discord][discord-badge]][discord-url]
<img align="right" src="doc/text3134.png" alt="Infix Linux Networking Made Easy">
<img align="right" src="doc/logo.png" alt="Infix - Linux <3 NETCONF" width=480 border=10>
* [Introduction](#introduction)
* [Hardware](#hardware)
* [Qemu](#qemu)
* [GNS3](#gns3)
* [Building](#building)
* [Origin & Licensing](origin--licensing)
Infix is a free, Linux based, immutable Network Operating System (NOS)
built on [Buildroot][1], and [sysrepo][2]. A powerful mix that ease
porting to different platforms, simplify long-term maintenance, and
provide made-easy management using NETCONF, RESTCONF[^2], or the
built-in command line interface (CLI) from a console or SSH login.
> Click the **▶ Example CLI Session** foldout below for an example, or
> head on over to the [Infix Documentation](doc/README.md) for more
> information on how to set up the system.
Introduction
------------
Although primarily focused on switches and routers, the core values
may be appealing for other use-cases as well:
Infix is an embedded Linux Network Operating System (NOS) based on
[Buildroot][1], [Finit][2], [ifupdown-ng][3], and [Clixon][6].
Providing an easy-to-maintain and easy-to-port Open Source base for
networked equipment.
- Runs from a squashfs image on a read-only partition
- Single configuration file on a separate partition
- Built around YANG with standard IETF models
- Linux switchdev provides open switch APIs
- Atomic upgrades to secondary partition
- Highly security focused
See the [GitHub Releases](https://github.com/kernelkit/infix/releases)
page for out pre-built images. The *Latest Build* has the bleeding edge
images, if possible we recommend using a versioned release.
An immutable[^1] operating system enhances security and inherently makes
it maintenance-free. Configuration and data, e.g, containers, is stored
on separate partitions to ensure complete separation from system files
and allow for seamless backup, restore, and provisioning.
> Login with user 'root', no password by default on plain builds. See
> the online `help` command for an introduction to the system.
In itself Infix is perfectly suited for dedicated networking tasks and
native support for Docker containers provides a versatile platform that
can easily be adapted to any customer need. Be it legacy applications,
network protocols, process monitoring, or edge data analysis, it can run
close to end equipment. Either directly connected on dedicated Ethernet
ports or indirectly using virtual network cables to exist on the same
LAN as other connected equipment.
The simple design of Infix provides complete control over both system
and data, minimal cognitive burden, and makes it incredibly easy to get
started.
Hardware
--------
<details><summary><b>Example CLI Session</b></summary>
### aarch64
The CLI configure context is automatically generated from the loaded
YANG models and their corresponding [sysrepo][2] plugins. The following
is brief example of how to set the IP address of an interface:
By default, Infix builds with support for the following boards (you
may enable additional boards in the config, of course):
```
admin@infix-12-34-56:/> configure
admin@infix-12-34-56:/config/> edit interface eth0
admin@infix-12-34-56:/config/interface/eth0/> set ipv4 <TAB>
address autoconf bind-ni-name enabled
forwarding mtu neighbor
admin@infix-12-34-56:/config/interface/eth0/> set ipv4 address 192.168.2.200 prefix-length 24
admin@infix-12-34-56:/config/interface/eth0/> show
type ethernet;
ipv4 {
address 192.168.2.200 {
prefix-length 24;
}
}
ipv6
admin@infix-12-34-56:/config/interface/eth0/> diff
interfaces {
interface eth0 {
+ ipv4 {
+ address 192.168.2.200 {
+ prefix-length 24;
+ }
+ }
}
}
admin@infix-12-34-56:/config/interface/eth0/> leave
admin@infix-12-34-56:/> show interfaces
INTERFACE PROTOCOL STATE DATA
eth0 ethernet UP 52:54:00:12:34:56
ipv4 192.168.2.200/24 (static)
ipv6 fe80::5054:ff:fe12:3456/64 (link-layer)
lo ethernet UP 00:00:00:00:00:00
ipv4 127.0.0.1/8 (static)
ipv6 ::1/128 (static)
admin@infix-12-34-56:/> copy running-config startup-config
```
- Marvell CN9130 CRB
- Marvell EspressoBIN
- Microchip SparX-5i PCB135 (eMMC)
[Click here][3] for more details.
</details>
See the aarch64 specific [documentation](board/aarch64/README.md) for more
information.
Infix can run on many different types of architectures and boards, much
thanks to Linux and Buildroot. Currently the focus is on 64-bit ARM
devices, optionally with switching fabric supported by Linux switchdev.
The [following boards](board/aarch64/README.md) are fully supported:
### amd64
- Marvell CN9130 CRB
- Marvell EspressoBIN
- Microchip SparX-5i PCB135 (eMMC)
- StarFive VisionFive2
- NanoPi R2S
Primarily intended to be run under [QEMU][] for development & test as
well as evaluation, demo and [training][] purposes, e.g. using [GNS3][]
or [Qeneth][7].
An x86_64 build is also available, primarily intended for development
and testing, but can also be used for evaluation and demo purposes. For
more information, see: [Infix in Virtual Environments](doc/virtual.md).
> See the [GitHub Releases](https://github.com/kernelkit/infix/releases)
> page for our pre-built images. The *[Latest Build][]* has bleeding
> edge images, if possible we recommend using a versioned release.
>
> For *customer specific builds* of Infix, see your product repository.
QEMU
----
[^1]: An immutable operating system is one with read-only file systems,
atomic updates, rollbacks, declarative configuration, and workload
isolation. All to improve reliability, scalability, and security.
For more information, see <https://ceur-ws.org/Vol-3386/paper9.pdf>
and <https://www.zdnet.com/article/what-is-immutable-linux-heres-why-youd-run-an-immutable-linux-distro/>.
A virtualized instance can easily be launched from a Linux system, with
Qemu installed, by issuing `make run`.
[^2]: Partial RESTCONF support, features like HTTP PATCH, OPTIONS, HEAD,
and copying between datastores are still missing.
Some settings, e.g. networking, can be configured via `make menuconfig`
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.
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
Online help is available:
make help
To see available defconfigs for supported targets, use:
make list-defconfigs
> **Note:** build dependencies (Debian/Ubuntu): <kbd>sudo apt install make libssl-dev</kbd>
Origin & Licensing
------------------
Infix is entirely built on Open Source components (packages). Most of
them, as well as the build system with its helper scripts and tools, is
from [Buiildroot][1], which is distributed under the terms of the GNU
General Public License (GPL). See the file COPYING for details.
Some files in Buildroot contain a different license statement. Those
files are licensed under the license contained in the file itself.
Buildroot and Infix also bundle patch files, which are applied to the
sources of the various packages. Those patches are not covered by the
license of Buildroot or Infix. Instead, they are covered by the license
of the software to which the patches are applied. When said software is
available under multiple licenses, the patches are only provided under
the publicly accessible licenses.
Infix releases include the license information covering all Open Source
packages. This is extracted automatically at build time using the tool
`make legal-info`. Any proprietary software built on top of Infix, or
Buildroot, would need separate auditing to ensure it does not link with
any GPL[^1] licensed library.
[^1]: Infix image builds use GNU libc (GLIBC) which is covered by the
[LGPL][4]. The LGPL *does allow* proprietary software, as long as
said software is linking dynamically, [not statically][5], to GLIBC.
[0]: https://github.com/kernelkit/infix/releases/tag/latest
[1]: https://buildroot.org/
[2]: https://www.sysrepo.org/
[3]: doc/cli/introduction.md
[Latest Build]: https://github.com/kernelkit/infix/releases/tag/latest
[License]: https://en.wikipedia.org/wiki/GPL_license
[License Badge]: https://img.shields.io/badge/License-GPL%20v2-blue.svg
[GitHub]: https://github.com/kernelkit/infix/actions/workflows/build.yml/
[GitHub Status]: https://github.com/kernelkit/infix/actions/workflows/build.yml/badge.svg
[Coverity Scan]: https://scan.coverity.com/projects/29393
[Coverity Status]: https://scan.coverity.com/projects/29393/badge.svg
[discord-badge]: https://img.shields.io/discord/1182652155618918411.svg?logo=discord
[discord-url]: https://discord.gg/6bHJWQNVxN
[2]: https://github.com/troglobit/finit
[3]: https://github.com/ifupdown-ng/ifupdown-ng
[4]: https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License
[5]: https://lwn.net/Articles/117972/
[6]: https://github.com/clicon/clixon
[7]: https://github.com/wkz/qeneth
[9]: https://docs.gns3.com/docs/using-gns3/beginners/import-gns3-appliance/
[QEMU]: https://www.qemu.org/
[GNS3]: https://gns3.com/
[training]: https://addiva-elektronik.github.io/
[manual]: https://buildroot.org/downloads/manual/manual.html
+1 -1
View File
@@ -1,7 +1,7 @@
* TODO doc: User Guide
- Feature set and scope, e.g.
- Device discovery: LLDP, mDNS-SD how do they work, interfacing with Windows/macOS/Linux
- Device discovery: SSDP, LLDP, mDNS-SD how do they work, interfacing with Windows/macOS/Linux
- Network redundancy protocols: STP/RSTP, MRP
- Configuring the system; using ifupdown2, enabling/disabling services
- Diagnosing the system; using rmon, port mirroring, debugging services, searching logs
+63 -5
View File
@@ -1,9 +1,67 @@
aarch64
=======
Board Specific Documentation
----------------------------
Microchip SparX-5i PCB135 (eMMC)
--------------------------------
- [Marvell CN9130-CRB](cn9130-crb/)
- [Microchip SparX-5i PCB135 (eMMC)](sparx5-pcb135/)
- [NanoPi R2S](r2s/)
At present, only FIT images are supported via the SparX-5i eval
board's U-Boot, which must contain a valid load address. If you are
using this board, after selecting your base configuration, run the
following command to supplement the existing config with the required
FIT options:
make board-enable-sparx-fit
### Unbricking
1. Don't load a corrupt bootloader to begin with
2. Done
If, for some reason, you didn't manage to follow step 1, you can use
the `FLASH_PROG`(`J4`) connector on the board to access the SPI flash
directly.
Using a [Bus Blaster][BB3] in combination with [dangerspi][dangerspi],
you can load a new bootloader. The schematic below details how to
connect the Bus Blaster to the board, but the concept should be
portable to any debugger/device based around an FTDI2232 chip.
```
Bus Blaster: FLASH_PROG (J4):
.---. .---.
VTG >o o| VTG SCK >o o| GND
TRST |o o| GND MISO |o o| #RESET_FLASH
TDI |o o| GND o o| 3V3
TMS |o o| GND #CS |o o| #SYSRESET
TCK o o| GND MOSI |o o| GND
RTCK o o| GND '---'
TDO |o o| GND
TSRST |o o| GND
DBGRQ |o o| GND
DBGACK |o o| GND
'---'
```
| Bus Blaster | FLASH_PROG |
|-------------|----------------|
| `VTG` | `3V3` |
| `GND` | `GND` |
| | |
| `VTG` | `#RESET_FLASH` |
| `GND` | `#SYSRESET` |
| | |
| `TDI` | `MOSI` |
| `TMS` | `#CS` |
| `TCK` | `SCK` |
| `TDO` | `MISO` |
With the cable in place, build U-Boot with the correct configuration:
make fireant_boot_defconfig && make
To flash it to the board, connect the cable to `J4` and run:
make board-sparx-flash-uboot
[BB3]: http://dangerousprototypes.com/docs/Bus_Blaster#Bus_Blaster_v3
[dangerspi]: https://github.com/wkz/dangerspi
-132
View File
@@ -1,132 +0,0 @@
Marvell CN9130-CRB
==================
## Build instructions
### Bootloader
Build the bootloader from the supplied `defconfig`. It might be useful
to build in a separate output directory if you want to build Infix
from the same working tree later:
make O=$(pwd)/x-cn9130-boot cn9130_crb_boot_defconfig
cd x-cn9130-boot
make
The artifact of interest is called `flash-image.bin`, which will be
located in the `images/` directory once the build completes.
### Infix
> If you do not want to build Infix from source, feel free to use a pre-built [release]
The standard `aarch64_defconfig` is compatible with this board:
make O=$(pwd)/x-aarch64 aarch64_defconfig
cd x-aarch64
make
Two artifacts from the `images/` directory of this build are required
to provision a new board:
- `rootfs.itb`: Netbootable image
- `infix-aarch64.pkg`: Standard upgrade bundle
## Provisioning
The overall provisioning flow, in which each step in described in
details in the following sections, is as follows:
- Strap board to boot from SPI FLASH
- Load `flash-image.bin` over UART
- Burn `flash-image.bin` to SPI FLASH
- Netboot `rootfs.itb`
- Run Infix's built-in provisioning script
- Reboot, now booting from the primary partition of the SD-card
#### Strap Board to Boot from SPI FLASH
By default, the board is strapped to boot from eMMC. However, Infix
assumes that the board will boot from SPI FLASH. Therefore we have to
ensure that the DIP switches of `SW2` on the board selects a
`BOOT_MODE` of `0x32`, meaning that the switches on positions 4, 3,
and 1 should be enabled (i.e. these need to be tied to ground):
```
.-----. .-----. .-----.
| | | | | PWR |
| SIM | | uSD | | |
| | | | '-----'
'-----' '-----'
|
v
.-----. .-----.
| SW1 | | SW2 |
'-----' '-----'
.--------------------------.
| |
| |
| CN9130 |
```
#### UART Boot U-Boot
Make sure that:
- [mvebu64boot] is installed and available in your shell's `$PATH`
- No other program is attached to `ttyUSB0`
- No power is applied to the board
1. Start `mvebu64boot`:
mvebu64boot -b /path/to/flash-image.bin /dev/ttyUSB0
2. Apply power
As soon as `mvebu64boot` completes, attach to the serial port,
e.g. using `screen(1)`, or `console(1)` and stop the normal boot
process by hitting any key.
#### Burn U-Boot to SPI FLASH
Make sure that:
- `eth1` is connected to a machine which serves `flash-image.bin` over
TFTP
- U-Boot can reach the TFTP server. If the neighboring machine is also
set up as a DHCP server, simply run the command `dhcp -`
To burn the bootloader to SPI FLASH, run the `bubt` command:
bubt flash-image.bin
Once the command completes, reset the board to verify that it can now
boot unassisted:
reset
#### Boot up `rootfs.itb`
U-Boot will automatically fallback to netboot since the SD-card is
still blank. Make sure that the PC provides the path to `rootfs.itb`
in DHCP option 67 ("bootfile").
#### Install Firmware
Login as `admin`/`admin`, setup networking to the PC, ensure that the date on
the device is reasonably correct, and run the provisioning script:
admin@infix:~$ sudo -i
root@infix:~$ udhcpc -i e28
root@infix:~$ date -us YYYY-MM-DD
root@infix:~$ /usr/libexec/infix/prod/provision tftp://<PC-IP>/infix-aarch64.pkg /dev/mmcblk0
After successful completion, the device is fully provisioned. On the
next boot, the device will boot of its own accord from the primary
SD-card partition.
> If possible, serve `infix-aarch64.pkg` over HTTP instead, as
> libcurl's TFTP implementation is quite slow.
[release]: https://github.com/kernelkit/infix/releases
[mvebu64boot]: https://github.com/addiva-elektronik/mvebu64boot
@@ -1,27 +0,0 @@
/ {
config {
environment {
/* After the MMC driver has enabled bus power,
* the controller seems to sometimes detect a
* card removal state , which causes it to
* disable power again. This hack re-enables the
* bus power in those cases.
*/
bootcmd = "
setexpr.b pwrctl *0xf2780029
setexpr pwrctl ${pwrctl} \"|\" 1
mw.b 0xf2780029 ${pwrctl}
run ixboot
";
boot_targets = "mmc1";
ethprime = "eth1";
/* This is a development platform, keep
* developer mode statically enabled.
*/
ixbtn-devmode = "setenv dev_mode yes; echo Enabled";
ixbtn-factory = "echo \"No button available, use bootmenu\"";
};
};
};
@@ -1,6 +0,0 @@
CONFIG_DEVICE_TREE_INCLUDES="infix-env.dtsi infix-key.dtsi cn9130-crb-env.dtsi"
CONFIG_SYS_PROMPT="(cn9130-crb) "
CONFIG_ENV_IS_NOWHERE=y
# CONFIG_ENV_IS_IN_MMC is not set
CONFIG_MVEBU_SPI_BOOT=y
-76
View File
@@ -1,76 +0,0 @@
#ifndef _ALDER_MPP_H
#define _ALDER_MPP_H
#define CP_SMI_MDIO(X) X( "mpp0", none, 0, 0)
#define CP_SMI_MDC(X) X( "mpp1", none, 0, 0)
#define CP_XSMI_MDIO(X) X( "mpp2", none, 0, 0)
#define CP_XSMI_MDC(X) X( "mpp3", none, 0, 0)
/* mpp4: Unused */
/* mpp5: Unused */
/* mpp6: Unused */
#define SFP9_TX_FAULT(X) X( "mpp7", cp0_gpio1, 7, GPIO_ACTIVE_HIGH)
#define SFP9_TX_DISABLE(X) X( "mpp8", cp0_gpio1, 8, GPIO_ACTIVE_HIGH)
#define SFP9_MOD_ABS(X) X( "mpp9", cp0_gpio1, 9, GPIO_ACTIVE_LOW)
#define SW_RESETn(X) X("mpp10", cp0_gpio1, 10, GPIO_ACTIVE_LOW)
#define SFP9_RS0(X) X("mpp11", cp0_gpio1, 11, GPIO_ACTIVE_HIGH)
/* mpp12: Unused */
#define CP_SPI1_MISO(X) X("mpp13", none, 0, 0)
#define CP_SPI1_CS0(X) X("mpp14", none, 0, 0)
#define CP_SPI1_MOSI(X) X("mpp15", none, 0, 0)
#define CP_SPI1_SCK(X) X("mpp16", none, 0, 0)
#define WDT_TICKLE(X) X("mpp17", cp0_gpio1, 17, GPIO_ACTIVE_HIGH)
/* mpp18: Unused */
/* mpp19: Unused */
/* mpp20: Unused */
/* mpp21: Unused */
/* mpp22: Unused */
/* mpp23: Unused */
#define DDR_TEN(X) X("mpp24", cp0_gpio1, 24, GPIO_ACTIVE_HIGH)
#define ETH9_RESETn(X) X("mpp25", cp0_gpio1, 25, GPIO_ACTIVE_LOW)
#define SW_INTn(X) X("mpp26", cp0_gpio1, 26, IRQ_TYPE_LEVEL_LOW)
#define SFP9_RS1(X) X("mpp27", cp0_gpio1, 27, GPIO_ACTIVE_HIGH)
#define SFP10_TX_FAULT(X) X("mpp28", cp0_gpio1, 28, GPIO_ACTIVE_HIGH)
#define CP_UA0_RXD(X) X("mpp29", none, 0, 0)
#define CP_UA0_TXD(X) X("mpp30", none, 0, 0)
#define SFP10_TX_DISABLE(X) X("mpp31", cp0_gpio1, 31, GPIO_ACTIVE_HIGH)
#define SFP10_MOD_ABS(X) X("mpp32", cp0_gpio2, 0, GPIO_ACTIVE_LOW)
#define I2C_IRQ(X) X("mpp33", cp0_gpio2, 1, IRQ_TYPE_LEVEL_LOW)
#define SFP10_RS0(X) X("mpp34", cp0_gpio2, 2, GPIO_ACTIVE_HIGH)
#define CP_I2C1_SDA(X) X("mpp35", none, 0, 0)
#define CP_I2C1_SCK(X) X("mpp36", none, 0, 0)
#define CP_I2C0_SCK(X) X("mpp37", none, 0, 0)
#define CP_I2C0_SDA(X) X("mpp38", none, 0, 0)
#define SFP10_RX_LOS(X) X("mpp39", cp0_gpio2, 7, GPIO_ACTIVE_HIGH)
#define SFP10_RS1(X) X("mpp40", cp0_gpio2, 8, GPIO_ACTIVE_HIGH)
#define CP_SD_CRD_PWR_OFF(X) X("mpp41", none, 0, 0)
#define CP_SD_HST_18_EN(X) X("mpp42", none, 0, 0)
#define CP_SD_CRD_DT(X) X("mpp43", none, 0, 0)
#define ETH9_INTn(X) X("mpp44", cp0_gpio2, 12, GPIO_ACTIVE_LOW)
/* mpp45: Unused */
#define ETH10_RESETn(X) X("mpp46", cp0_gpio2, 14, GPIO_ACTIVE_LOW)
#define I2C_RESETn(X) X("mpp47", cp0_gpio2, 15, GPIO_ACTIVE_LOW)
#define ETH10_INTn(X) X("mpp48", cp0_gpio2, 16, GPIO_ACTIVE_LOW)
#define DEV_MODEn(X) X("mpp49", cp0_gpio2, 17, GPIO_ACTIVE_LOW)
#define USB1_VBUS_ENABLE(X) X("mpp50", cp0_gpio2, 18, GPIO_ACTIVE_HIGH)
#define USB1_VBUS_ERROR_OC(X) X("mpp51", cp0_gpio2, 19, GPIO_ACTIVE_HIGH)
/* mpp52: Unused */
#define SFP9_RX_LOS(X) X("mpp53", cp0_gpio2, 21, GPIO_ACTIVE_HIGH)
/* mpp54: Unused */
#define CP_SD_LED(X) X("mpp55", none, 0, 0)
#define CP_SD_CLK(X) X("mpp56", none, 0, 0)
#define CP_SD_CMD(X) X("mpp57", none, 0, 0)
#define CP_SD_D0(X) X("mpp58", none, 0, 0)
#define CP_SD_D1(X) X("mpp59", none, 0, 0)
#define CP_SD_D2(X) X("mpp60", none, 0, 0)
#define CP_SD_D3(X) X("mpp61", none, 0, 0)
/* mpp62: Unused */
/* Macros to extract MPP info in different formats */
#define MPP_ID(_mpp, _chip, _no, _flags) _mpp
#define MPP_GPIO_CHIP(_mpp, _chip, _no, _flags) _chip
#define MPP_GPIO_REF(_mpp, _chip, _no, _flags) <&_chip _no _flags>
#define MPP_GPIO_REF_NO_CHIP(_mpp, _chip, _no, _flags) <_no _flags>
#define MPP_IRQ_REF(_mpp, _chip, _no, _flags) <&_chip _no _flags>
#endif /* _ALDER_MPP_H */
-9
View File
@@ -1,9 +0,0 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (C) 2021 Marvell International Ltd.
* Copyright (C) 2023 Addiva Elektronik AB
*
* Device tree for Alder board
*/
#include "alder.dtsi"
-719
View File
@@ -1,719 +0,0 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (C) 2021 Marvell International Ltd.
* Copyright (C) 2023 Addiva Elektronik AB
*
* Device tree for Alder board
*/
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include "../marvell/cn9130-patched.dtsi"
#include "alder-mpp.h"
/ {
model = "Alder";
compatible = "alder,alder",
"marvell,armada-ap807-quad",
"marvell,armada-ap807";
chosen {
stdout-path = "serial0:115200n8";
infix {
vpds = <&vpd_cpu &vpd_product &vpd_power>;
usb-ports = <&cp0_usb3_1>;
usb-port-names = "USB";
};
};
memory@0 {
device_type = "memory";
reg = <0x0 0x0 0x0 0x80000000>;
};
};
/* UART0 (Console) */
&cp0_pinctrl {
cp0_uart0_pins: cp0-uart0-pins {
marvell,pins = CP_UA0_RXD(MPP_ID), CP_UA0_TXD(MPP_ID);
marvell,function = "uart0";
};
};
&uart0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_uart0_pins>;
};
/* GPIO */
&cp0_gpio1 {
status = "okay";
};
&cp0_gpio2 {
status = "okay";
};
/* I2C0 (EEPROM) */
&cp0_pinctrl {
cp0_i2c0_pins: cp0-i2c0-pins {
marvell,pins = CP_I2C0_SCK(MPP_ID), CP_I2C0_SDA(MPP_ID);
marvell,function = "i2c0";
};
};
&cp0_i2c0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_i2c0_pins>;
vpd_cpu: eeprom@50 {
// AT24C256C-MAHL-T
compatible = "atmel,24c256";
reg = <0x50>;
infix,board = "cpu";
infix,trusted;
};
};
/* I2C1 (Mux) */
&cp0_pinctrl {
cp0_i2c1_pins: cp0-i2c1-pins {
marvell,pins = CP_I2C1_SCK(MPP_ID), CP_I2C1_SDA(MPP_ID);
marvell,function = "i2c1";
};
};
&cp0_i2c1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_i2c1_pins>;
i2cmux@70 {
compatible = "nxp,pca9548";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x70>;
reset-gpios = I2C_RESETn(MPP_GPIO_REF);
i2c_sysmgmt: i2c@0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
};
i2c_pwr: i2c@1 {
#address-cells = <1>;
#size-cells = <0>;
reg = <1>;
};
i2c_sw: i2c@2 {
#address-cells = <1>;
#size-cells = <0>;
reg = <2>;
};
i2c_sfp9: i2c@3 {
#address-cells = <1>;
#size-cells = <0>;
reg = <3>;
};
i2c_sfpa: i2c@4 {
#address-cells = <1>;
#size-cells = <0>;
reg = <4>;
};
i2c@5 {
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
reg = <5>;
};
i2c@6 {
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
reg = <6>;
};
i2c@7 {
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
reg = <7>;
};
};
};
/* System Management */
&i2c_sysmgmt {
vpd_product: eeprom@b {
label = "vpd";
reg = <0x0b>;
compatible = "atmel,24c02";
infix,board = "product";
nvmem-layout {
compatible = "onie,tlv-layout";
base_mac: mac-address {
#nvmem-cell-cells = <1>;
};
};
};
};
/* AP SDHCI (eMMC) */
&ap_sdhci0 {
status = "okay";
pinctrl-names = "default";
/* pinctrl-0 = <&ap_emmc_pins>; No pinctrl in Linux? */
bus-width = <8>;
mmc-ddr-1_8v;
mmc-hs400-1_8v;
};
/* SPI1 (Boot FLASH) */
&cp0_pinctrl {
cp0_spi1_pins: cp0-spi-pins-0 {
marvell,pins = \
CP_SPI1_MISO(MPP_ID), CP_SPI1_CS0(MPP_ID), \
CP_SPI1_MOSI(MPP_ID), CP_SPI1_SCK(MPP_ID);
marvell,function = "spi1";
};
};
&cp0_spi1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_spi1_pins>;
/* Boot flash */
spi-flash@0 {
#address-cells = <0x1>;
#size-cells = <0x1>;
compatible = "jedec,spi-nor", "spi-flash";
reg = <0x0>;
/* On-board MUX does not allow higher frequencies */
spi-max-frequency = <40000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot0@0 {
label = "boot0";
reg = <0x0 0x200000>;
};
boot1@200000 {
label = "boot1";
reg = <0x200000 0x200000>;
};
};
};
};
/* USB1 */
/ {
cp0_usb3_0_phy1: cp0_usb3_phy {
compatible = "usb-nop-xceiv";
vcc-supply = <&reg_cp0_usb3_vbus1>;
};
reg_cp0_usb3_vbus1: reg_cp0_usb3_vbus1 {
compatible = "regulator-fixed";
regulator-name = "cp0-xhci1-vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
enable-active-high;
gpio = USB1_VBUS_ENABLE(MPP_GPIO_REF);
};
};
&cp0_utmi {
status = "okay";
};
&cp0_utmi1 {
status = "okay";
dr_mode = "host";
};
&cp0_usb3_1 {
status = "okay";
usb-phy = <&cp0_usb3_0_phy1>;
phys = <&cp0_utmi1>, <&cp0_comphy3 1>;
phy-names = "usb", "usb3";
dr_mode = "host";
};
/* ETH0 (DSA connection to switch) */
&cp0_crypto {
status = "okay";
};
&cp0_ethernet {
status = "okay";
};
&cp0_eth0 {
status = "okay";
phy-mode = "10gbase-r";
phys = <&cp0_comphy4 0>;
managed = "in-band-status";
nvmem-cells = <&base_mac 0>;
nvmem-cell-names = "mac-address";
};
/* MDIO (Switch) */
&cp0_pinctrl {
cp0_mdio_pins: cp0-mdio-pins-0 {
marvell,pins = CP_SMI_MDIO(MPP_ID), CP_SMI_MDC(MPP_ID);
marvell,function = "ge";
};
};
&cp0_mdio {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_mdio_pins>;
sw: switch@0 {
compatible = "marvell,mv88e6190";
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
reset-gpios = SW_RESETn(MPP_GPIO_REF);
interrupts-extended = SW_INTn(MPP_IRQ_REF);
interrupt-controller;
dsa,member = <0 0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0x0>;
label = "cpu";
ethernet = <&cp0_eth0>;
phy-mode = "10gbase-r";
fixed-link {
speed = <10000>;
full-duplex;
};
};
#define SWP_COMMON(_n, _label, _mac_offs, _phymode, _phy) \
reg = <0x ## _n>; \
label = _label; \
phy-mode = _phymode; \
phy-handle = <&_phy>; \
\
nvmem-cells = <&base_mac _mac_offs>; \
nvmem-cell-names = "mac-address"
#define XSWP(_n, _label, _mac_offs, _phy) \
port@_n { \
SWP_COMMON(_n, _label, _mac_offs, "usxgmii", _phy); \
managed = "in-band-status"; \
}
#define GSWP(_n, _label, _mac_offs, _phy) \
port@_n { \
SWP_COMMON(_n, _label, _mac_offs, "gmii", _phy); \
\
leds { \
#address-cells = <1>; \
#size-cells = <0>; \
\
led@0 { \
reg = <0>; \
function = "tp"; \
color = <LED_COLOR_ID_GREEN>; \
default-state = "keep"; \
}; \
led@1 { \
reg = <1>; \
function = "tp"; \
color = <LED_COLOR_ID_YELLOW>; \
default-state = "off"; \
}; \
}; \
}
XSWP(9, "x1", 1, xphy9);
XSWP(a, "x2", 2, xphya);
GSWP(8, "x3", 3, swphy8);
GSWP(7, "x4", 4, swphy7);
GSWP(6, "x5", 5, swphy6);
GSWP(5, "x6", 6, swphy5);
GSWP(4, "x7", 7, swphy4);
GSWP(3, "x8", 8, swphy3);
GSWP(2, "x9", 9, swphy2);
GSWP(1, "x10", 10, swphy1);
#undef GSWP
#undef XSWP
#undef SWP_COMMON
};
mdio {
#address-cells = <1>;
#size-cells = <0>;
#define SWPHY(_n) \
ethernet-phy@_n { \
compatible = "ethernet-phy-ieee802.3-c22"; \
reg = <_n>; \
eee-broken-100tx; \
eee-broken-1000t; \
}
swphy1: SWPHY(1);
swphy2: SWPHY(2);
swphy3: SWPHY(3);
swphy4: SWPHY(4);
swphy5: SWPHY(5);
swphy6: SWPHY(6);
swphy7: SWPHY(7);
swphy8: SWPHY(8);
#undef SWPHY
};
};
};
/* XMDIO (88X3310P 10G PHYs) */
&cp0_pinctrl {
cp0_xmdio_pins: cp0-xmdio-pins-0 {
marvell,pins = CP_XSMI_MDIO(MPP_ID), CP_XSMI_MDC(MPP_ID);
marvell,function = "xg";
};
};
&ETH9_RESETn(MPP_GPIO_CHIP) {
xphy9-reset-hog {
gpio-hog;
gpios = ETH9_RESETn(MPP_GPIO_REF_NO_CHIP);
output-low;
line-name = "x1-phy-reset";
};
};
&ETH10_RESETn(MPP_GPIO_CHIP) {
xphya-reset-hog {
gpio-hog;
gpios = ETH10_RESETn(MPP_GPIO_REF_NO_CHIP);
output-low;
line-name = "x2-phy-reset";
};
};
&cp0_xmdio {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_xmdio_pins>;
/* 88X3310 specifices 35ns minimum MDC period (28.57 MHz). */
clock-frequency = <28571428>;
#define XPHY(_n, _sfp) \
ethernet-phy@_n { \
compatible = "ethernet-phy-ieee802.3-c45"; \
reg = <_n>; \
sfp = <&_sfp>; \
\
leds { \
#address-cells = <1>; \
#size-cells = <0>; \
\
led@0 { \
reg = <0>; \
function = "tp"; \
color = <LED_COLOR_ID_YELLOW>; \
default-state = "off"; \
\
marvell,media = "copper"; \
marvell,polarity = "active-high"; \
}; \
led@1 { \
reg = <1>; \
function = "tp"; \
color = <LED_COLOR_ID_GREEN>; \
default-state = "keep"; \
\
marvell,media = "copper"; \
marvell,polarity = "active-high"; \
}; \
\
led@2 { \
reg = <2>; \
function = "sfp"; \
color = <LED_COLOR_ID_YELLOW>; \
default-state = "off"; \
\
marvell,media = "fiber"; \
marvell,polarity = "active-high"; \
}; \
led@3 { \
reg = <3>; \
function = "sfp"; \
color = <LED_COLOR_ID_GREEN>; \
default-state = "keep"; \
\
marvell,media = "fiber"; \
marvell,polarity = "active-high"; \
}; \
}; \
}
xphy9: XPHY(4, sfp9);
xphya: XPHY(5, sfpa);
#undef XPHY
};
/ {
sfp9: sfp@9 {
compatible = "sff,sfp";
i2c-bus = <&i2c_sfp9>;
mod-def0-gpios = SFP9_MOD_ABS(MPP_GPIO_REF);
los-gpios = SFP9_RX_LOS(MPP_GPIO_REF);
tx-disable-gpios = SFP9_TX_DISABLE(MPP_GPIO_REF);
tx-fault-gpios = SFP9_TX_FAULT(MPP_GPIO_REF);
rate-select0-gpios = SFP9_RS0(MPP_GPIO_REF);
rate-select1-gpios = SFP9_RS1(MPP_GPIO_REF);
maximum-power-milliwatt = <3000>;
};
sfpa: sfp@a {
compatible = "sff,sfp";
i2c-bus = <&i2c_sfpa>;
mod-def0-gpios = SFP10_MOD_ABS(MPP_GPIO_REF);
los-gpios = SFP10_RX_LOS(MPP_GPIO_REF);
tx-disable-gpios = SFP10_TX_DISABLE(MPP_GPIO_REF);
tx-fault-gpios = SFP10_TX_FAULT(MPP_GPIO_REF);
rate-select0-gpios = SFP10_RS0(MPP_GPIO_REF);
rate-select1-gpios = SFP10_RS1(MPP_GPIO_REF);
maximum-power-milliwatt = <3000>;
};
};
/* Power Board */
&cp0_pinctrl {
cp0_pwr_gpio_pins: cp0-pwr-gpio-0 {
marvell,pins = I2C_IRQ(MPP_ID);
marvell,function = "gpio";
};
};
&i2c_pwr {
// Shared IRQ on I2C_IRQ
pinctrl-names = "default";
pinctrl-0 = <&cp0_pwr_gpio_pins>;
// 0x26 U13 PCF8574 GPIO I/O
gpio_pwr1: gpio@26 {
compatible = "nxp,pcf8574a";
#gpio-cells = <2>;
gpio-controller;
#interrupt-cells = <2>;
interrupt-controller;
interrupts-extended = I2C_IRQ(MPP_IRQ_REF);
reg = <0x26>;
#define GPIO_PWR1_UNUSED0 gpio_pwr1 0 GPIO_ACTIVE_HIGH
#define GPIO_PWR1_UNUSED1 gpio_pwr1 1 GPIO_ACTIVE_HIGH
#define GPIO_POE_PGOOD gpio_pwr1 2 GPIO_ACTIVE_HIGH
#define GPIO_RESET_BUTTON gpio_pwr1 3 GPIO_ACTIVE_LOW
#define GPIO_VIN1_PGOOD gpio_pwr1 4 GPIO_ACTIVE_LOW
#define GPIO_LED_VIN2_ALERT gpio_pwr1 5 GPIO_ACTIVE_LOW
#define GPIO_VIN2_PGOOD gpio_pwr1 6 GPIO_ACTIVE_LOW
#define GPIO_LED_VIN1_ALERT gpio_pwr1 7 GPIO_ACTIVE_LOW
};
//0x27 U3 PCF8574 GPIO LED
gpio_pwr2: gpio@27 {
compatible = "nxp,pcf8574a";
#gpio-cells = <2>;
gpio-controller;
#interrupt-cells = <2>;
interrupt-controller;
interrupts-extended = I2C_IRQ(MPP_IRQ_REF);
reg = <0x27>;
#define GPIO_LED2G gpio_pwr2 0 GPIO_ACTIVE_LOW
#define GPIO_LED2R gpio_pwr2 1 GPIO_ACTIVE_LOW
#define GPIO_LED1G gpio_pwr2 2 GPIO_ACTIVE_LOW
#define GPIO_LED1R gpio_pwr2 3 GPIO_ACTIVE_LOW
#define GPIO_LED4G gpio_pwr2 4 GPIO_ACTIVE_LOW
#define GPIO_LED4R gpio_pwr2 5 GPIO_ACTIVE_LOW
#define GPIO_LED3G gpio_pwr2 6 GPIO_ACTIVE_LOW
#define GPIO_LED3R gpio_pwr2 7 GPIO_ACTIVE_LOW
};
//0x28* U5 TPS23861PWR PoE Controller
//0x30 U5 TPS23861PWR PoE Controller broadcast
//0x50 U15 AT24C256C EEPROM
vpd_power: eeprom@50 {
// AT24C256C-MAHL-T
compatible = "atmel,24c256";
reg = <0x50>;
infix,board = "power";
};
};
/* Reset button */
/ {
gpio-keys {
compatible = "gpio-keys";
up {
label = "factory-reset";
linux,code = <KEY_RESTART>;
gpios = <&GPIO_RESET_BUTTON>;
};
};
};
/* System LEDs */
/ {
power-a {
compatible = "gpio-charger";
charger-type = "mains";
gpios = <&GPIO_VIN1_PGOOD>;
};
power-b {
compatible = "gpio-charger";
charger-type = "mains";
gpios = <&GPIO_VIN2_PGOOD>;
};
leds: leds {
compatible = "gpio-leds";
led-statg {
function = LED_FUNCTION_STATUS;
color = <LED_COLOR_ID_GREEN>;
gpios = <&GPIO_LED1G>;
};
led-statr {
function = LED_FUNCTION_STATUS;
color = <LED_COLOR_ID_RED>;
gpios = <&GPIO_LED1R>;
};
led-faultg {
function = LED_FUNCTION_FAULT;
color = <LED_COLOR_ID_GREEN>;
gpios = <&GPIO_LED2G>;
};
led-faultr {
function = LED_FUNCTION_FAULT;
color = <LED_COLOR_ID_RED>;
gpios = <&GPIO_LED2R>;
};
led-lang {
function = LED_FUNCTION_LAN;
color = <LED_COLOR_ID_GREEN>;
gpios = <&GPIO_LED3G>;
};
led-lanr {
function = LED_FUNCTION_LAN;
color = <LED_COLOR_ID_RED>;
gpios = <&GPIO_LED3R>;
};
led-bootg {
function = LED_FUNCTION_BOOT;
color = <LED_COLOR_ID_GREEN>;
gpios = <&GPIO_LED4G>;
};
led-bootr {
function = LED_FUNCTION_BOOT;
color = <LED_COLOR_ID_RED>;
gpios = <&GPIO_LED4R>;
default-state = "on";
linux,default-trigger = "timer";
};
led-vin1-alert {
function = "power-a";
color = <LED_COLOR_ID_RED>;
gpios = <&GPIO_LED_VIN1_ALERT>;
};
led-vin2-alert {
function = "power-b";
color = <LED_COLOR_ID_RED>;
gpios = <&GPIO_LED_VIN2_ALERT>;
};
};
};
/* Watchdog */
&cp0_pinctrl {
watchdog_pins: watchdog-pins {
marvell,pins = WDT_TICKLE(MPP_ID);
marvell,function = "gpio";
};
};
/ {
sysmgmt-watchdog {
pinctrl-names = "default";
pinctrl-0 = <&watchdog_pins>;
compatible = "linux,wdt-gpio";
gpios = WDT_TICKLE(MPP_GPIO_REF);
always-running;
hw_algo = "toggle";
hw_margin_ms = <20000>; /* toggle period must be below 1 minute */
};
};
@@ -1,69 +0,0 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2020 Marvell International Ltd.
*/
#include "cn9130-crb.dtsi"
/ {
model = "Marvell Armada CN9130-CRB-A";
chosen {
infix {
/* "admin" */
factory-password-hash = "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A";
usb-ports = <&cp0_usb3_1>;
usb-port-names = "USB";
};
};
};
&cp0_pcie0 {
status = "okay";
num-lanes = <4>;
num-viewport = <8>;
/* Generic PHY, providing serdes lanes */
phys = <&cp0_comphy0 0
&cp0_comphy1 0
&cp0_comphy2 0
&cp0_comphy3 0>;
iommu-map =
<0x0 &smmu 0x480 0x20>,
<0x100 &smmu 0x4a0 0x20>,
<0x200 &smmu 0x4c0 0x20>;
iommu-map-mask = <0x031f>;
};
&cp0_usb3_0 {
status = "okay";
usb-phy = <&cp0_usb3_0_phy0>;
phy-names = "usb";
};
&cp0_usb3_1 {
status = "okay";
usb-phy = <&cp0_usb3_0_phy1>;
phy-names = "usb";
};
&cp0_eth2 {
status = "okay";
phy-mode = "2500base-x";
};
&cp0_pinctrl {
cp0_expander0_pins: cp0-expander-pins-0 {
marvell,pins = "mpp39";
marvell,function = "gpio";
};
};
&expander0 {
pinctrl-names = "default";
pinctrl-0 = <&cp0_expander0_pins>;
interrupt-parent = <&cp0_gpio2>;
interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
interrupt-controller;
#interrupt-cells=<2>;
microchip,irq-mirror;
};
@@ -1,12 +0,0 @@
#include "cn9130.dtsi"
&cp0_syscon0 {
cp0_pinctrl: pinctrl {
/* For some reason, this is missing from cn9130.dtsi */
compatible = "marvell,cp115-standalone-pinctrl";
};
};
&cp0_xmdio {
clock-names = "gop_clk", "mg_clk", "mg_core_clk", "axi_clk";
};
@@ -5,7 +5,7 @@
*/
/dts-v1/;
#include "sparx5_pcb135_emmc.dts"
#include "microchip/sparx5_pcb135_emmc.dts"
&cpu0 {
enable-method = "spin-table";
-76
View File
@@ -1,76 +0,0 @@
#ifndef _STYX_MPP_H
#define _STYX_MPP_H
#define SFP0_TX_DISABLE(X) X( "mpp0", cp0_gpio1, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)
#define SFP1_TX_DISABLE(X) X( "mpp1", cp0_gpio1, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)
#define SFP2_TX_DISABLE(X) X( "mpp2", cp0_gpio1, 2, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)
#define SFP3_TX_DISABLE(X) X( "mpp3", cp0_gpio1, 3, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)
#define SFP0_RS0(X) X( "mpp4", cp0_gpio1, 4, GPIO_ACTIVE_HIGH)
#define SFP1_RS0(X) X( "mpp5", cp0_gpio1, 5, GPIO_ACTIVE_HIGH)
#define SFP2_RS0(X) X( "mpp6", cp0_gpio1, 6, GPIO_ACTIVE_HIGH)
#define SFP3_RS0(X) X( "mpp7", cp0_gpio1, 7, GPIO_ACTIVE_HIGH)
#define SFP0_RS1(X) X( "mpp8", cp0_gpio1, 8, GPIO_ACTIVE_HIGH)
#define SFP1_RS1(X) X( "mpp9", cp0_gpio1, 9, GPIO_ACTIVE_HIGH)
#define SFP2_RS1(X) X("mpp10", cp0_gpio1, 10, GPIO_ACTIVE_HIGH)
#define SFP3_RS1(X) X("mpp11", cp0_gpio1, 11, GPIO_ACTIVE_HIGH)
/* mpp12: Unused */
#define CP_SPI1_MISO(X) X("mpp13", none, 0, 0)
#define CP_SPI1_CS0(X) X("mpp14", none, 0, 0)
#define CP_SPI1_MOSI(X) X("mpp15", none, 0, 0)
#define CP_SPI1_SCK(X) X("mpp16", none, 0, 0)
/* mpp17: Unused */
/* mpp18: Unused */
/* mpp19: Unused */
/* mpp20: Unused */
/* mpp21: Unused */
/* mpp22: Unused */
/* mpp23: Unused */
/* mpp24: Unused */
/* mpp25: Unused */
/* mpp26: Unused */
#define SFP0_RX_LOS(X) X("mpp27", cp0_gpio1, 27, GPIO_ACTIVE_HIGH)
#define SFP1_RX_LOS(X) X("mpp28", cp0_gpio1, 28, GPIO_ACTIVE_HIGH)
#define SFP2_RX_LOS(X) X("mpp29", cp0_gpio1, 29, GPIO_ACTIVE_HIGH)
#define SFP3_RX_LOS(X) X("mpp30", cp0_gpio1, 30, GPIO_ACTIVE_HIGH)
#define SFP0_TX_FAULT(X) X("mpp31", cp0_gpio1, 31, GPIO_ACTIVE_HIGH)
#define SFP1_TX_FAULT(X) X("mpp32", cp0_gpio2, 0, GPIO_ACTIVE_HIGH)
#define SFP2_TX_FAULT(X) X("mpp33", cp0_gpio2, 1, GPIO_ACTIVE_HIGH)
#define SFP3_TX_FAULT(X) X("mpp34", cp0_gpio2, 2, GPIO_ACTIVE_HIGH)
#define CP_I2C1_SDA(X) X("mpp35", none, 0, 0)
#define CP_I2C1_SCK(X) X("mpp36", none, 0, 0)
#define CP_I2C0_SCK(X) X("mpp37", none, 0, 0)
#define CP_I2C0_SDA(X) X("mpp38", none, 0, 0)
/* mpp39: Unused */
#define CP_SMI_MDIO(X) X("mpp40", none, 0, 0)
#define CP_SMI_MDC(X) X("mpp41", none, 0, 0)
/* mpp42: Unused */
/* mpp43: Unused */
/* mpp44: Unused */
/* mpp45: Unused */
/* mpp46: Unused */
#define CP_UA1_TXD(X) X("mpp47", none, 0, 0)
/* mpp48: Unused */
#define SW1_RESETn(X) X("mpp49", cp0_gpio2, 17, GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)
#define SW2_RESETn(X) X("mpp50", cp0_gpio2, 18, GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)
#define SW3_RESETn(X) X("mpp51", cp0_gpio2, 19, GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)
/* mpp52: Unused */
#define CP_UA1_RXD(X) X("mpp53", none, 0, 0)
#define SFP0_MOD_ABS(X) X("mpp54", cp0_gpio2, 22, GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)
#define SFP1_MOD_ABS(X) X("mpp55", cp0_gpio2, 23, GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)
#define SFP2_MOD_ABS(X) X("mpp56", cp0_gpio2, 24, GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)
#define SFP3_MOD_ABS(X) X("mpp57", cp0_gpio2, 25, GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)
#define SW1_INTn(X) X("mpp58", cp0_gpio2, 26, IRQ_TYPE_LEVEL_LOW)
#define SW2_INTn(X) X("mpp59", cp0_gpio2, 27, IRQ_TYPE_LEVEL_LOW)
#define SW3_INTn(X) X("mpp60", cp0_gpio2, 28, IRQ_TYPE_LEVEL_LOW)
/* mpp61: Unused */
#define DDR_TEN(X) X("mpp62", cp0_gpio2, 30, GPIO_ACTIVE_HIGH)
/* Macros to extract MPP info in different formats */
#define MPP_ID(_mpp, _chip, _no, _flags) _mpp
#define MPP_GPIO_CHIP(_mpp, _chip, _no, _flags) _chip
#define MPP_GPIO_REF(_mpp, _chip, _no, _flags) <&_chip _no (_flags)>
#define MPP_GPIO_REF_NO_CHIP(_mpp, _chip, _no, _flags) <_no (_flags)>
#define MPP_IRQ_REF(_mpp, _chip, _no, _flags) <&_chip _no (_flags)>
#endif /* _STYX_MPP_H */
-9
View File
@@ -1,9 +0,0 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (C) 2021 Marvell International Ltd.
* Copyright (C) 2023 Addiva Elektronik AB
*
* Device tree for Styx board
*/
#include "styx.dtsi"
-566
View File
@@ -1,566 +0,0 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (C) 2021 Marvell International Ltd.
* Copyright (C) 2023 Addiva Elektronik AB
*
* Device tree for Styx board
*/
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include "../marvell/cn9130-patched.dtsi"
#include "styx-mpp.h"
/ {
model = "Styx";
compatible = "styx,styx",
"marvell,armada-ap807-quad",
"marvell,armada-ap807";
chosen {
stdout-path = "serial0:115200n8";
infix {
/* "admin" */
factory-password-hash = "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A";
vpds = <&vpd>;
};
};
memory@0 {
device_type = "memory";
reg = <0x0 0x0 0x0 0x80000000>;
};
};
/* UART0 (Console) */
&uart0 {
status = "okay";
};
/* UART1 (Auxiliary) */
&cp0_pinctrl {
cp0_uart1_pins: cp0-uart1-pins {
marvell,pins = CP_UA1_RXD(MPP_ID), CP_UA1_TXD(MPP_ID);
marvell,function = "uart1";
};
};
&cp0_uart1 {
/* TODO: Figure out how to enable this without affecting
* /chosen/stdout-path
*/
status = "disabled";
pinctrl-names = "default";
pinctrl-0 = <&cp0_uart1_pins>;
};
/* GPIO */
&cp0_gpio1 {
status = "okay";
};
&cp0_gpio2 {
status = "okay";
};
/* I2C0 (EEPROM) */
&cp0_pinctrl {
cp0_i2c0_pins: cp0-i2c0-pins {
marvell,pins = CP_I2C0_SCK(MPP_ID), CP_I2C0_SDA(MPP_ID);
marvell,function = "i2c0";
};
};
&cp0_i2c0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_i2c0_pins>;
vpd: eeprom@50 {
compatible = "atmel,24c256";
reg = <0x50>;
infix,board = "product";
infix,trusted;
nvmem-layout {
compatible = "onie,tlv-layout";
base_mac: mac-address {
#nvmem-cell-cells = <1>;
};
};
};
spd: eeprom@53 {
compatible = "spd";
reg = <0x53>;
};
eeprom@57 {
compatible = "atmel,24c256";
reg = <0x57>;
};
};
/* I2C1 (Mux) */
&cp0_pinctrl {
cp0_i2c1_pins: cp0-i2c1-pins {
marvell,pins = CP_I2C1_SCK(MPP_ID), CP_I2C1_SDA(MPP_ID);
marvell,function = "i2c1";
};
};
&cp0_i2c1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_i2c1_pins>;
i2cmux@77 {
compatible = "nxp,pca9548";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x77>;
i2c_sfp0: i2c@0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
};
i2c_sfp1: i2c@1 {
#address-cells = <1>;
#size-cells = <0>;
reg = <1>;
};
i2c_sfp2: i2c@2 {
#address-cells = <1>;
#size-cells = <0>;
reg = <2>;
};
i2c_sfp3: i2c@3 {
#address-cells = <1>;
#size-cells = <0>;
reg = <3>;
};
};
};
/* SPI1 (Boot FLASH) */
&cp0_pinctrl {
cp0_spi1_pins: cp0-spi-pins-0 {
marvell,pins = \
CP_SPI1_MISO(MPP_ID), CP_SPI1_CS0(MPP_ID), \
CP_SPI1_MOSI(MPP_ID), CP_SPI1_SCK(MPP_ID);
marvell,function = "spi1";
};
};
&cp0_spi1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_spi1_pins>;
/* Boot flash */
spi-flash@0 {
#address-cells = <0x1>;
#size-cells = <0x1>;
compatible = "jedec,spi-nor", "spi-flash";
reg = <0x0>;
spi-max-frequency = <90000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot0@0 {
label = "boot0";
reg = <0x0 0x200000>;
};
boot1@200000 {
label = "boot1";
reg = <0x200000 0x200000>;
};
};
};
};
/* AP SDHCI (eMMC) */
&ap_sdhci0 {
status = "okay";
bus-width = <8>;
mmc-ddr-1_8v;
mmc-hs400-1_8v;
};
&cp0_crypto {
status = "okay";
};
&cp0_ethernet {
status = "okay";
};
/* ETH1 (Connection to BMC) */
&cp0_eth2 {
status = "okay";
phy-mode = "sgmii";
phys = <&cp0_comphy5 2>;
managed = "in-band-status";
nvmem-cells = <&base_mac 0>;
nvmem-cell-names = "mac-address";
};
/* ETH0 (DSA connection to switch tree) */
&cp0_eth0 {
status = "okay";
phy-mode = "10gbase-r";
phys = <&cp0_comphy2 0>;
managed = "in-band-status";
nvmem-cells = <&base_mac 0>;
nvmem-cell-names = "mac-address";
};
/* MDIO (Switch Tree) */
&cp0_pinctrl {
cp0_mdio_pins: cp0-mdio-pins-0 {
marvell,pins = CP_SMI_MDIO(MPP_ID), CP_SMI_MDC(MPP_ID);
marvell,function = "ge";
};
};
#define SWP_LED(_func) \
leds { \
#address-cells = <1>; \
#size-cells = <0>; \
\
led@0 { \
reg = <0>; \
function = _func; \
color = <LED_COLOR_ID_GREEN>; \
default-state = "keep"; \
}; \
led@1 { \
reg = <1>; \
function = _func; \
color = <LED_COLOR_ID_YELLOW>; \
default-state = "off"; \
}; \
}
#define XSWP(_n, _label, _mac_offs, _sfp) \
port@_n { \
reg = <0x ## _n>; \
label = _label; \
nvmem-cells = <&base_mac _mac_offs>; \
nvmem-cell-names = "mac-address"; \
phy-mode = "10gbase-r"; \
managed = "in-band-status"; \
sfp = <&_sfp>; \
SWP_LED("sfp"); \
}
#define GSWP(_n, _label, _mac_offs, _phy) \
port@_n { \
reg = <0x ## _n>; \
label = _label; \
nvmem-cells = <&base_mac _mac_offs>; \
nvmem-cell-names = "mac-address"; \
phy-mode = "gmii"; \
phy-handle = <&_phy>; \
SWP_LED("tp"); \
}
#define GPHY(_n) \
ethernet-phy@_n { \
compatible = "ethernet-phy-ieee802.3-c22"; \
reg = <_n>; \
eee-broken-100tx; \
eee-broken-1000t; \
}
&cp0_mdio {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_mdio_pins>;
sw3: switch@6 {
compatible = "marvell,mv88e6190";
#address-cells = <1>;
#size-cells = <0>;
reg = <6>;
reset-gpios = SW3_RESETn(MPP_GPIO_REF);
interrupts-extended = SW3_INTn(MPP_IRQ_REF);
interrupt-controller;
dsa,member = <0 0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@9 {
reg = <0x9>;
label = "cpu";
ethernet = <&cp0_eth0>;
phy-mode = "10gbase-r";
fixed-link {
speed = <10000>;
full-duplex;
};
};
sw3p10: port@a {
reg = <0xa>;
link = <&sw2p10 &sw1p0>;
phy-mode = "10gbase-r";
fixed-link {
speed = <10000>;
full-duplex;
};
};
/* Can't use XSWP macro as port 0 does not have
* any LEDs attached to it. LEDs for port 10 seem
* to be wired to the corresponding SFP cage. Maybe
* we can apply a static workaround by binding port
* 10's green LED to "Special LED 1", so we can at
* least see link/act.
*/
port@0 {
reg = <0>;
label = "e16";
nvmem-cells = <&base_mac 16>;
nvmem-cell-names = "mac-address";
phy-mode = "10gbase-r";
managed = "in-band-status";
sfp = <&sfp3>;
};
GSWP(1, "e22", 22, sw3phy1);
GSWP(2, "e21", 21, sw3phy2);
GSWP(3, "e24", 24, sw3phy3);
GSWP(4, "e23", 23, sw3phy4);
GSWP(5, "e26", 26, sw3phy5);
GSWP(6, "e25", 25, sw3phy6);
GSWP(7, "e28", 28, sw3phy7);
GSWP(8, "e27", 27, sw3phy8);
};
mdio {
#address-cells = <1>;
#size-cells = <0>;
sw3phy1: GPHY(1);
sw3phy2: GPHY(2);
sw3phy3: GPHY(3);
sw3phy4: GPHY(4);
sw3phy5: GPHY(5);
sw3phy6: GPHY(6);
sw3phy7: GPHY(7);
sw3phy8: GPHY(8);
};
};
sw2: switch@4 {
compatible = "marvell,mv88e6190";
#address-cells = <1>;
#size-cells = <0>;
reg = <4>;
reset-gpios = SW2_RESETn(MPP_GPIO_REF);
interrupts-extended = SW2_INTn(MPP_IRQ_REF);
interrupt-controller;
dsa,member = <0 1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
sw2p0: port@0 {
reg = <0x0>;
link = <&sw1p0>;
phy-mode = "10gbase-r";
fixed-link {
speed = <10000>;
full-duplex;
};
};
sw2p10: port@a {
reg = <0xa>;
link = <&sw3p10>;
phy-mode = "10gbase-r";
fixed-link {
speed = <10000>;
full-duplex;
};
};
GSWP(1, "e10", 10, sw2phy1);
GSWP(2, "e9", 9, sw2phy2);
GSWP(3, "e12", 12, sw2phy3);
GSWP(4, "e11", 11, sw2phy4);
GSWP(5, "e18", 18, sw2phy5);
GSWP(6, "e17", 17, sw2phy6);
GSWP(7, "e20", 20, sw2phy7);
GSWP(8, "e19", 19, sw2phy8);
XSWP(9, "e15", 15, sfp2);
};
mdio {
#address-cells = <1>;
#size-cells = <0>;
sw2phy1: GPHY(1);
sw2phy2: GPHY(2);
sw2phy3: GPHY(3);
sw2phy4: GPHY(4);
sw2phy5: GPHY(5);
sw2phy6: GPHY(6);
sw2phy7: GPHY(7);
sw2phy8: GPHY(8);
};
};
sw1: switch@2 {
compatible = "marvell,mv88e6190";
#address-cells = <1>;
#size-cells = <0>;
reg = <2>;
reset-gpios = SW1_RESETn(MPP_GPIO_REF);
interrupts-extended = SW1_INTn(MPP_IRQ_REF);
interrupt-controller;
dsa,member = <0 2>;
ports {
#address-cells = <1>;
#size-cells = <0>;
sw1p0: port@0 {
reg = <0x0>;
link = <&sw2p0 &sw3p10>;
phy-mode = "10gbase-r";
fixed-link {
speed = <10000>;
full-duplex;
};
};
GSWP(1, "e2", 2, sw1phy1);
GSWP(2, "e1", 1, sw1phy2);
GSWP(3, "e4", 4, sw1phy3);
GSWP(4, "e3", 3, sw1phy4);
GSWP(5, "e6", 6, sw1phy5);
GSWP(6, "e5", 5, sw1phy6);
GSWP(7, "e8", 8, sw1phy7);
GSWP(8, "e7", 7, sw1phy8);
XSWP(9, "e14", 14, sfp1);
XSWP(a, "e13", 13, sfp0);
};
mdio {
#address-cells = <1>;
#size-cells = <0>;
sw1phy1: GPHY(1);
sw1phy2: GPHY(2);
sw1phy3: GPHY(3);
sw1phy4: GPHY(4);
sw1phy5: GPHY(5);
sw1phy6: GPHY(6);
sw1phy7: GPHY(7);
sw1phy8: GPHY(8);
};
};
};
/ {
sfp0: sfp@0 {
compatible = "sff,sfp";
i2c-bus = <&i2c_sfp0>;
mod-def0-gpios = SFP0_MOD_ABS(MPP_GPIO_REF);
los-gpios = SFP0_RX_LOS(MPP_GPIO_REF);
tx-disable-gpios = SFP0_TX_DISABLE(MPP_GPIO_REF);
tx-fault-gpios = SFP0_TX_FAULT(MPP_GPIO_REF);
rate-select0-gpios = SFP0_RS0(MPP_GPIO_REF);
rate-select1-gpios = SFP0_RS1(MPP_GPIO_REF);
maximum-power-milliwatt = <3000>;
};
sfp1: sfp@1 {
compatible = "sff,sfp";
i2c-bus = <&i2c_sfp1>;
mod-def0-gpios = SFP1_MOD_ABS(MPP_GPIO_REF);
los-gpios = SFP1_RX_LOS(MPP_GPIO_REF);
tx-disable-gpios = SFP1_TX_DISABLE(MPP_GPIO_REF);
tx-fault-gpios = SFP1_TX_FAULT(MPP_GPIO_REF);
rate-select0-gpios = SFP1_RS0(MPP_GPIO_REF);
rate-select1-gpios = SFP1_RS1(MPP_GPIO_REF);
maximum-power-milliwatt = <3000>;
};
sfp2: sfp@2 {
compatible = "sff,sfp";
i2c-bus = <&i2c_sfp2>;
mod-def0-gpios = SFP2_MOD_ABS(MPP_GPIO_REF);
los-gpios = SFP2_RX_LOS(MPP_GPIO_REF);
tx-disable-gpios = SFP2_TX_DISABLE(MPP_GPIO_REF);
tx-fault-gpios = SFP2_TX_FAULT(MPP_GPIO_REF);
rate-select0-gpios = SFP2_RS0(MPP_GPIO_REF);
rate-select1-gpios = SFP2_RS1(MPP_GPIO_REF);
maximum-power-milliwatt = <3000>;
};
sfp3: sfp@3 {
compatible = "sff,sfp";
i2c-bus = <&i2c_sfp3>;
mod-def0-gpios = SFP3_MOD_ABS(MPP_GPIO_REF);
los-gpios = SFP3_RX_LOS(MPP_GPIO_REF);
tx-disable-gpios = SFP3_TX_DISABLE(MPP_GPIO_REF);
tx-fault-gpios = SFP3_TX_FAULT(MPP_GPIO_REF);
rate-select0-gpios = SFP3_RS0(MPP_GPIO_REF);
rate-select1-gpios = SFP3_RS1(MPP_GPIO_REF);
maximum-power-milliwatt = <3000>;
};
};
+61 -149
View File
@@ -21,16 +21,17 @@ CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_BPF=y
CONFIG_USER_NS=y
CONFIG_SCHED_AUTOGROUP=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_KALLSYMS_ALL=y
CONFIG_PROFILING=y
CONFIG_SMP=y
CONFIG_ARCH_SPARX5=y
CONFIG_ARCH_MVEBU=y
CONFIG_ARCH_VEXPRESS=y
@@ -47,6 +48,12 @@ CONFIG_CPUFREQ_DT=y
CONFIG_ARM_ARMADA_37XX_CPUFREQ=y
CONFIG_ARM_ARMADA_8K_CPUFREQ=y
CONFIG_ACPI=y
CONFIG_ARM64_CRYPTO=y
CONFIG_CRYPTO_SHA1_ARM64_CE=y
CONFIG_CRYPTO_SHA2_ARM64_CE=y
CONFIG_CRYPTO_GHASH_ARM64_CE=y
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
# CONFIG_GCC_PLUGINS is not set
@@ -59,31 +66,29 @@ CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_CMA=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_XDP_SOCKETS=y
CONFIG_XDP_SOCKETS_DIAG=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_NET_IPIP=m
CONFIG_NET_IPGRE_DEMUX=m
CONFIG_NET_IPGRE=m
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_NET_IPIP=y
CONFIG_NET_IPGRE_DEMUX=y
CONFIG_NET_IPGRE=y
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IP_MROUTE=y
CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
CONFIG_SYN_COOKIES=y
CONFIG_NET_IPVTI=m
CONFIG_NET_FOU_IP_TUNNELS=y
CONFIG_IPV6_SIT=m
CONFIG_IPV6_GRE=m
CONFIG_NET_IPVTI=y
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
CONFIG_NETWORK_PHY_TIMESTAMPING=y
CONFIG_NETFILTER=y
CONFIG_BRIDGE_NETFILTER=y
CONFIG_NETFILTER_NETLINK_QUEUE=y
@@ -93,79 +98,17 @@ CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CONNTRACK_FTP=y
CONFIG_NF_TABLES=y
CONFIG_NF_TABLES_INET=y
CONFIG_NF_TABLES_NETDEV=y
CONFIG_NFT_CT=m
CONFIG_NFT_CONNLIMIT=m
CONFIG_NFT_LOG=m
CONFIG_NFT_LIMIT=m
CONFIG_NFT_MASQ=m
CONFIG_NFT_REDIR=m
CONFIG_NFT_NAT=m
CONFIG_NFT_TUNNEL=m
CONFIG_NFT_QUEUE=m
CONFIG_NFT_REJECT=m
CONFIG_NFT_COMPAT=m
CONFIG_NFT_HASH=m
CONFIG_NFT_XFRM=m
CONFIG_NFT_SOCKET=m
CONFIG_NFT_OSF=m
CONFIG_NFT_DUP_NETDEV=m
CONFIG_NFT_FWD_NETDEV=m
CONFIG_NFT_REJECT_NETDEV=m
CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
CONFIG_NETFILTER_XT_TARGET_LOG=m
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
CONFIG_NETFILTER_XT_MATCH_BPF=m
CONFIG_NETFILTER_XT_MATCH_CGROUP=m
CONFIG_NETFILTER_XT_MATCH_COMMENT=m
CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m
CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
CONFIG_NETFILTER_XT_MATCH_DSCP=m
CONFIG_NETFILTER_XT_MATCH_HELPER=m
CONFIG_NETFILTER_XT_MATCH_LIMIT=m
CONFIG_NETFILTER_XT_MATCH_MAC=m
CONFIG_NETFILTER_XT_MATCH_MARK=m
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IP_NF_NAT=m
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_MANGLE=m
CONFIG_IP6_NF_IPTABLES=m
CONFIG_IP6_NF_MATCH_AH=m
CONFIG_IP6_NF_MATCH_EUI64=m
CONFIG_IP6_NF_MATCH_IPV6HEADER=m
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_TARGET_REJECT=m
CONFIG_IP6_NF_RAW=m
CONFIG_IP6_NF_NAT=m
CONFIG_IP6_NF_TARGET_MASQUERADE=m
CONFIG_IP6_NF_TARGET_NPT=m
CONFIG_NF_TABLES_BRIDGE=m
CONFIG_NFT_BRIDGE_META=m
CONFIG_NF_CONNTRACK_BRIDGE=m
CONFIG_BRIDGE_NF_EBTABLES=m
CONFIG_BRIDGE_EBT_BROUTE=m
CONFIG_BRIDGE_EBT_T_FILTER=m
CONFIG_BRIDGE_EBT_T_NAT=m
CONFIG_BRIDGE_EBT_802_3=m
CONFIG_BRIDGE_EBT_ARP=m
CONFIG_BRIDGE_EBT_IP=m
CONFIG_BRIDGE_EBT_IP6=m
CONFIG_BRIDGE_EBT_LIMIT=m
CONFIG_BRIDGE_EBT_PKTTYPE=m
CONFIG_BRIDGE_EBT_STP=m
CONFIG_BRIDGE_EBT_VLAN=m
CONFIG_BRIDGE_EBT_ARPREPLY=m
CONFIG_BRIDGE_EBT_DNAT=m
CONFIG_BRIDGE_EBT_REDIRECT=m
CONFIG_BRIDGE_EBT_SNAT=m
CONFIG_BRIDGE_EBT_LOG=m
CONFIG_BRIDGE_EBT_NFLOG=m
CONFIG_BPFILTER=y
CONFIG_NF_LOG_IPV6=m
CONFIG_BRIDGE=y
CONFIG_BRIDGE_VLAN_FILTERING=y
CONFIG_BRIDGE_MRP=y
@@ -174,26 +117,9 @@ CONFIG_NET_DSA=y
CONFIG_VLAN_8021Q=y
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_NET_SCHED=y
CONFIG_NET_SCH_MQPRIO=y
CONFIG_NET_CLS_BASIC=y
CONFIG_NET_CLS_BPF=y
CONFIG_NET_CLS_FLOWER=y
CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_GACT=y
CONFIG_NET_ACT_MIRRED=y
CONFIG_NET_ACT_SKBEDIT=y
CONFIG_DCB=y
CONFIG_NETLINK_DIAG=y
CONFIG_MPLS=y
CONFIG_NET_MPLS_GSO=y
CONFIG_MPLS_ROUTING=m
CONFIG_MPLS_IPTUNNEL=m
CONFIG_NET_PKTGEN=y
# CONFIG_WIRELESS is not set
CONFIG_NET_L3_MASTER_DEV=y
CONFIG_NET_9P=y
CONFIG_NET_9P_VIRTIO=y
CONFIG_LWTUNNEL=y
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCI_IOV=y
@@ -215,6 +141,7 @@ CONFIG_MTD_SPI_NOR=y
CONFIG_OF_OVERLAY=y
CONFIG_BLK_DEV_NULL_BLK=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_NBD=y
CONFIG_BLK_DEV_RAM=y
CONFIG_VIRTIO_BLK=y
CONFIG_BLK_DEV_NVME=y
@@ -229,6 +156,7 @@ CONFIG_ATA=y
CONFIG_SATA_AHCI=y
CONFIG_SATA_AHCI_PLATFORM=y
CONFIG_AHCI_MVEBU=y
CONFIG_PATA_PLATFORM=y
CONFIG_PATA_OF_PLATFORM=y
CONFIG_MD=y
CONFIG_BLK_DEV_DM=y
@@ -236,25 +164,25 @@ CONFIG_DM_INIT=y
CONFIG_DM_VERITY=y
CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y
CONFIG_NETDEVICES=y
CONFIG_BONDING=m
CONFIG_DUMMY=m
CONFIG_NET_TEAM=m
CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m
CONFIG_NET_TEAM_MODE_LOADBALANCE=m
CONFIG_MACVLAN=m
CONFIG_MACVTAP=m
CONFIG_IPVLAN=m
CONFIG_IPVTAP=m
CONFIG_VXLAN=m
CONFIG_GENEVE=m
CONFIG_BAREUDP=m
CONFIG_MACSEC=m
CONFIG_TUN=m
CONFIG_VETH=m
CONFIG_BONDING=y
CONFIG_DUMMY=y
CONFIG_NET_TEAM=y
CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=y
CONFIG_NET_TEAM_MODE_LOADBALANCE=y
CONFIG_MACVLAN=y
CONFIG_MACVTAP=y
CONFIG_IPVLAN=y
CONFIG_IPVTAP=y
CONFIG_VXLAN=y
CONFIG_GENEVE=y
CONFIG_BAREUDP=y
CONFIG_MACSEC=y
CONFIG_TUN=y
CONFIG_VETH=y
CONFIG_VIRTIO_NET=y
CONFIG_NLMON=y
CONFIG_NET_VRF=y
CONFIG_NET_DSA_MV88E6XXX=m
CONFIG_NET_DSA_MV88E6XXX=y
CONFIG_NET_DSA_MV88E6XXX_PTP=y
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_NET_VENDOR_ADAPTEC is not set
@@ -279,8 +207,8 @@ CONFIG_NET_DSA_MV88E6XXX_PTP=y
# CONFIG_NET_VENDOR_GOOGLE is not set
# CONFIG_NET_VENDOR_HISILICON is not set
# CONFIG_NET_VENDOR_HUAWEI is not set
CONFIG_MVNETA=m
CONFIG_MVPP2=m
CONFIG_MVNETA=y
CONFIG_MVPP2=y
# CONFIG_NET_VENDOR_MELLANOX is not set
# CONFIG_NET_VENDOR_MICREL is not set
CONFIG_SPARX5_SWITCH=y
@@ -317,20 +245,18 @@ CONFIG_8139CP=y
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_NET_VENDOR_XILINX is not set
CONFIG_SFP=y
CONFIG_AX88796B_PHY=y
CONFIG_MARVELL_PHY=y
CONFIG_MARVELL_10G_PHY=m
CONFIG_MARVELL_10G_PHY=y
CONFIG_MICREL_PHY=y
CONFIG_MICROCHIP_PHY=y
CONFIG_MICROCHIP_T1_PHY=y
CONFIG_MICROSEMI_PHY=m
CONFIG_MICROSEMI_PHY=y
CONFIG_MDIO_BITBANG=y
CONFIG_MDIO_MVUSB=m
CONFIG_MDIO_MVUSB=y
CONFIG_MDIO_MSCC_MIIM=y
CONFIG_MDIO_BUS_MUX_MMIOREG=y
CONFIG_USB_RTL8152=m
CONFIG_USB_USBNET=m
CONFIG_USB_NET_CDC_EEM=m
CONFIG_USB_USBNET=y
CONFIG_USB_NET_CDC_EEM=y
# CONFIG_USB_NET_CDC_NCM is not set
# CONFIG_USB_NET_NET1080 is not set
# CONFIG_USB_NET_CDC_SUBSET is not set
@@ -364,7 +290,7 @@ CONFIG_I2C_MV64XXX=y
CONFIG_I2C_SLAVE=y
CONFIG_SPI=y
CONFIG_SPI_ARMADA_3700=y
CONFIG_SPI_ORION=y
CONFIG_SPI_NXP_FLEXSPI=y
CONFIG_SPI_PL022=y
CONFIG_SPI_MUX=y
CONFIG_SPI_SPIDEV=m
@@ -376,7 +302,6 @@ CONFIG_GPIO_PL061=y
CONFIG_GPIO_XGENE=y
CONFIG_GPIO_PCA953X=y
CONFIG_GPIO_PCA953X_IRQ=y
CONFIG_GPIO_PCF857X=y
CONFIG_GPIO_MAX77620=y
CONFIG_POWER_RESET_GPIO_RESTART=y
CONFIG_POWER_RESET_XGENE=y
@@ -387,13 +312,11 @@ CONFIG_SENSORS_SPARX5=y
CONFIG_SENSORS_JC42=y
CONFIG_SENSORS_LM90=m
CONFIG_SENSORS_INA2XX=m
CONFIG_CPU_THERMAL=y
CONFIG_THERMAL_EMULATION=y
CONFIG_ARMADA_THERMAL=y
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_SYSFS=y
CONFIG_SOFT_WATCHDOG=y
CONFIG_GPIO_WATCHDOG=y
CONFIG_ARMADA_37XX_WATCHDOG=y
CONFIG_I6300ESB_WDT=y
CONFIG_MFD_MAX77620=y
@@ -419,31 +342,30 @@ CONFIG_REGULATOR_S2MPS11=y
# CONFIG_HID_LOGITECH is not set
# CONFIG_HID_MICROSOFT is not set
# CONFIG_HID_MONTEREY is not set
CONFIG_USB_ULPI_BUS=y
CONFIG_USB=m
CONFIG_USB=y
CONFIG_USB_OTG=y
CONFIG_USB_XHCI_HCD=m
CONFIG_USB_XHCI_MVEBU=m
CONFIG_USB_EHCI_HCD=m
CONFIG_USB_EHCI_HCD_PLATFORM=m
CONFIG_USB_OHCI_HCD=m
CONFIG_USB_OHCI_HCD_PLATFORM=m
CONFIG_USB_STORAGE=m
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_MVEBU=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PLATFORM=y
CONFIG_USB_STORAGE=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC2=y
CONFIG_USB_CHIPIDEA=m
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_UDC=y
CONFIG_USB_CHIPIDEA_HOST=y
CONFIG_USB_ISP1760=y
CONFIG_USB_HSIC_USB3503=m
CONFIG_USB_HSIC_USB3503=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_ULPI=y
CONFIG_USB_GADGET=y
CONFIG_USB_SNP_UDC_PLAT=y
CONFIG_TYPEC=y
CONFIG_TYPEC_TCPM=m
CONFIG_TYPEC_TCPCI=m
CONFIG_TYPEC_RT1711H=m
CONFIG_TYPEC_TCPM=y
CONFIG_TYPEC_TCPCI=y
CONFIG_TYPEC_RT1711H=y
CONFIG_MMC=y
CONFIG_MMC_BLOCK_MINORS=32
CONFIG_MMC_ARMMMCI=y
@@ -463,10 +385,8 @@ CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_SYSCON=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_CPU=y
CONFIG_LEDS_TRIGGER_NETDEV=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_MAX77686=y
CONFIG_RTC_DRV_PCF8523=y
@@ -495,24 +415,21 @@ CONFIG_EXTCON_USB_GPIO=y
CONFIG_IIO=y
CONFIG_TI_ADC081C=y
CONFIG_PWM=y
CONFIG_PHY_XGENE=y
CONFIG_PHY_MVEBU_CP110_COMPHY=y
CONFIG_PHY_MVEBU_CP110_UTMI=y
CONFIG_PHY_SAMSUNG_USB2=y
CONFIG_NVMEM_LAYOUT_ONIE_TLV=y
CONFIG_MUX_MMIO=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_BTRFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_QUOTA=y
CONFIG_AUTOFS4_FS=y
CONFIG_FUSE_FS=y
CONFIG_VIRTIO_FS=y
CONFIG_OVERLAY_FS=y
CONFIG_VFAT_FS=y
CONFIG_EXFAT_FS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_SQUASHFS=y
@@ -526,21 +443,16 @@ CONFIG_SECURITY=y
CONFIG_CRYPTO_CCM=m
CONFIG_CRYPTO_ECHAINIV=y
CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_CRYPTO_GHASH_ARM64_CE=y
CONFIG_CRYPTO_SHA1_ARM64_CE=y
CONFIG_CRYPTO_SHA2_ARM64_CE=y
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
CONFIG_DMA_CMA=y
CONFIG_CMA_SIZE_MBYTES=0
CONFIG_IRQ_POLL=y
CONFIG_PRINTK_TIME=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_SCHED_DEBUG is not set
# CONFIG_DEBUG_PREEMPT is not set
# CONFIG_RCU_TRACE is not set
CONFIG_FUNCTION_TRACER=y
# CONFIG_STRICT_DEVMEM is not set
-165
View File
@@ -1,165 +0,0 @@
FriendlyELC NanoPi R2S
======================
The [NanoPi R2S][1] is a very low-cost 64-bit ARM min router, powered by
the Rockchip RK3328, quad-core Cortex-A53.
The R2S does not have any onboard eMMC, so the only way to boot Infix on
it is using and SD card.
LEDs
----
The front system LEDs work as follows in Infix:
| **Stage** | **SYS** | **LAN** | **WAN** |
|----------------|---------|---------|---------|
| Power-on | dimmed | off | off |
| Factory reset | on | on | on |
| Linux loading | on | off | off |
| System loading | 1 Hz | off | off |
| System up | off | on | off |
| WAN address | off | on | on |
| Locate | 1 Hz | 1 Hz | 1 Hz |
| Fail safe | 5 Hz | off | off |
| Panic | 5 Hz | 5 Hz | 5 Hz |
Powering on the device the SYS LED is turned on faintly (dimmed). It
remains dimmed while U-Boot loads the kernel, and turns bright red when
the kernel starts. It remains steady on until the system has started
the LED daemon, `iitod`, which sets it blinking at 1 Hz while the rest
of the system starts up. When the system has come up successfully, the
SYS LED is turned off and the green LAN LED turns on. The WAN LED will
turn on (green) when the WAN interface is up and has an IP address.
> Compared to the `x86_64` Qemu target, it takes a while to parse all
> YANG models and load `startup-config`, but the whole process should
> not take more than 60 seconds, and usually a lot less.
If a "find my device" function exists, it will blink all LEDs at 1 Hz.
If `startup-config` fails to load Ínfix reverts to `failure-config`,
putting the device in fail safe (or fail secure) mode. Indicated by
the SYS LED blinking at 5 Hz instead of turning off.
If Infix for some reason also fails to load `failure-config`, then all
LEDs will blink at 5 Hz to clearly indicate something is very wrong.
In all error cases the console shows the problem.
Factory Reset
-------------
The reset button on the side can be used not only to safely reboot the
device, but can also be used to trigger a factory reset at power on.
At power-on, keep the reset button pressed for 10 seconds. The system
LEDs (SYS, WAN, LAN) will all blink at 1 Hz, to help you count down the
seconds. When the 10 seconds have passed all LEDs are turned off before
loading Linux.
When Linux boots up it confirms the factory reset by lighting up the
LEDs again, no blinking this time. The LEDs stay on until all files and
directories on read/writable partitions (`/cfg` and `/var`) have been
safely erased.
The system then continues loading, turning off all LEDs except SYS,
which blinks calmly at 1 Hz as usual until the system has completed
loading, this time with a `startup-config` freshly restored from the
device's `factory-config`.
How to Build
------------
```
$ make r2s_defconfig
$ make
```
Once the build has finished you will have `output/images/sdcard.img`
which you can flash to an SD card.
```
$ sudo dd if=output/images/sdcard.img of=/dev/mmcblk0 bs=1M status=progress oflag=direct
```
> **WARNING:** ensure `/dev/mmcblk0` really is the correct device for
> your SD card, and not used by the system!
Booting the Board
-----------------
1. Connect a TTL cable to three UART pins, GND is closest to the edge
2. Insert the flashed SD card
3. Power-up the board using an USB-C cable (ensure good power source!)
Worth noting, unlike many other boards, the Rockchip family of chipsets
runs the UART at 1500000 bps (1.5 Mbps) 8N1.
Secure Boot
-----------
Like other Infix builds, the R2S enjoys secure boot. Please note,
however that the default signing keys are the public!
Also, default builds allow modifying and saving the U-Boot environment
(see below), which you may want to disable to secure the device. The
device also runs in *developer mode*, allowing full U-Boot shell access,
which you may also want to disable in a full production setting.
Caveat
------
Most (all?) of these boards do not have any Vital Product Data (VPD)
EEPROM mounted. This means they do not come with unique MAC addresses
allocated to the two Ethernet ports.
The bootloader (U-Boot) default environment for the board is usually
what provides a default, the same default MAC addresses to Linux:
- 4a:dc:d8:20:0d:84
- 4a:dc:d8:20:0d:85
This is important in case you want to run multiple R2S devices on the
same LAN. Meaning you either have to change the MAC address in the
U-Boot environment (below), or modify your `phys-address` setting in
Infix for the interface(s).
Break into U-Boot using Ctrl-C at power-on, preferably when the text
`Press Ctrl-C NOW to enter boot menu` is displayed. Exit the menu to
get to the prompt:
```
(r2s) printenv
...
eth1addr=4a:dc:d8:20:0d:84
ethact=ethernet@ff540000
ethaddr=4a:dc:d8:20:0d:85
ethprime=eth0
...
```
Here we change both addresses, using the *Locally Administered* bit:
```
(r2s) setenv eth1addr 02:00:c0:ff:ee:01
(r2s) setenv ethaddr 02:00:c0:ff:ee:00
(r2s) saveenv
```
Boot the system, log into Linux, and inspect the MAC addresses:
```
admin@infix-00-00-00:~$ ip -br l
lo UP 00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
eth0 UP 02:00:c0:ff:ee:00 <BROADCAST,MULTICAST,UP,LOWER_UP>
eth1 UP 02:00:c0:ff:ee:01 <BROADCAST,MULTICAST,UP,LOWER_UP>
```
[1]: https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R2S
-71
View File
@@ -1,71 +0,0 @@
image cfg.ext4 {
empty = true
temporary = true
size = 16M
ext4 {
label = "cfg"
}
}
image var.ext4 {
empty = true
temporary = true
size = 512M
ext4 {
label = "var"
use-mke2fs = true
}
}
image sdcard.img {
hdimage {
partition-table-type = "gpt"
}
partition u-boot-tpl-spl-dtb {
in-partition-table = "no"
offset = 32K
image = "idbloader.img"
}
partition u-boot-dtb {
in-partition-table = "no"
offset = 8M
image = "u-boot.itb"
}
partition aux {
partition-uuid = D4EF35A0-0652-45A1-B3DE-D63339C82035
offset = 16M
image = "aux.ext4"
}
partition primary {
partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4
bootable = true
size = 200M
image = "rootfs.squashfs"
}
partition secondary {
partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4
bootable = true
size = 200M
image = "rootfs.squashfs"
}
partition cfg {
partition-uuid = 7aa497f0-73b5-47e5-b2ab-8752d8a48105
image = "cfg.ext4"
}
partition var {
partition-uuid = 8046A06A-E45A-4A14-A6AD-6684704A393F
image = "var.ext4"
}
}
# Silence genimage warnings
config {}
-745
View File
@@ -1,745 +0,0 @@
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
CONFIG_AUDIT=y
CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_BPF_SYSCALL=y
CONFIG_BPF_JIT=y
CONFIG_PREEMPT=y
CONFIG_IRQ_TIME_ACCOUNTING=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_PSI=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=18
CONFIG_MEMCG=y
CONFIG_BLK_CGROUP=y
CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_BPF=y
CONFIG_NAMESPACES=y
CONFIG_USER_NS=y
CONFIG_SCHED_AUTOGROUP=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_EXPERT=y
CONFIG_KALLSYMS_ALL=y
CONFIG_PROFILING=y
CONFIG_KEXEC_FILE=y
CONFIG_ARCH_ROCKCHIP=y
CONFIG_ARM64_VA_BITS_48=y
CONFIG_SCHED_MC=y
CONFIG_SCHED_SMT=y
CONFIG_NR_CPUS=8
CONFIG_COMPAT=y
CONFIG_RANDOMIZE_BASE=y
# CONFIG_SUSPEND is not set
CONFIG_ARM_PSCI_CPUIDLE=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
CONFIG_CPUFREQ_DT=y
CONFIG_ARM_SCMI_CPUFREQ=y
CONFIG_ACPI_CPPC_CPUFREQ=m
CONFIG_ACPI=y
CONFIG_ACPI_APEI=y
CONFIG_ACPI_APEI_GHES=y
CONFIG_ACPI_APEI_MEMORY_FAILURE=y
CONFIG_ACPI_APEI_EINJ=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=y
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
# CONFIG_GCC_PLUGINS is not set
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_KSM=y
CONFIG_MEMORY_FAILURE=y
CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_CMA=y
CONFIG_CMA_AREAS=20
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_XDP_SOCKETS=y
CONFIG_XDP_SOCKETS_DIAG=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_NET_IPIP=m
CONFIG_NET_IPGRE_DEMUX=m
CONFIG_NET_IPGRE=m
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IP_MROUTE=y
CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
CONFIG_SYN_COOKIES=y
CONFIG_IPV6_SIT=m
CONFIG_IPV6_GRE=m
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
CONFIG_NETWORK_PHY_TIMESTAMPING=y
CONFIG_NETFILTER=y
CONFIG_BRIDGE_NETFILTER=y
CONFIG_NETFILTER_NETLINK_QUEUE=y
CONFIG_NETFILTER_NETLINK_LOG=y
CONFIG_NF_CONNTRACK=y
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CONNTRACK_FTP=y
CONFIG_NF_TABLES=y
CONFIG_NF_TABLES_INET=y
CONFIG_NF_TABLES_NETDEV=y
CONFIG_NFT_CT=m
CONFIG_NFT_CONNLIMIT=m
CONFIG_NFT_LOG=m
CONFIG_NFT_LIMIT=m
CONFIG_NFT_MASQ=m
CONFIG_NFT_REDIR=m
CONFIG_NFT_NAT=m
CONFIG_NFT_TUNNEL=m
CONFIG_NFT_QUEUE=m
CONFIG_NFT_REJECT=m
CONFIG_NFT_COMPAT=m
CONFIG_NFT_HASH=m
CONFIG_NFT_SOCKET=m
CONFIG_NFT_OSF=m
CONFIG_NFT_DUP_NETDEV=m
CONFIG_NFT_FWD_NETDEV=m
CONFIG_NFT_REJECT_NETDEV=m
CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
CONFIG_NETFILTER_XT_TARGET_LOG=m
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
CONFIG_NETFILTER_XT_MATCH_BPF=m
CONFIG_NETFILTER_XT_MATCH_CGROUP=m
CONFIG_NETFILTER_XT_MATCH_COMMENT=m
CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m
CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
CONFIG_NETFILTER_XT_MATCH_DSCP=m
CONFIG_NETFILTER_XT_MATCH_HELPER=m
CONFIG_NETFILTER_XT_MATCH_LIMIT=m
CONFIG_NETFILTER_XT_MATCH_MAC=m
CONFIG_NETFILTER_XT_MATCH_MARK=m
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IP_NF_NAT=m
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_MANGLE=m
CONFIG_IP6_NF_IPTABLES=m
CONFIG_IP6_NF_MATCH_AH=m
CONFIG_IP6_NF_MATCH_EUI64=m
CONFIG_IP6_NF_MATCH_IPV6HEADER=m
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_TARGET_REJECT=m
CONFIG_IP6_NF_MANGLE=m
CONFIG_IP6_NF_RAW=m
CONFIG_IP6_NF_NAT=m
CONFIG_IP6_NF_TARGET_MASQUERADE=m
CONFIG_IP6_NF_TARGET_NPT=m
CONFIG_NF_TABLES_BRIDGE=m
CONFIG_NFT_BRIDGE_META=m
CONFIG_NFT_BRIDGE_REJECT=m
CONFIG_NF_CONNTRACK_BRIDGE=y
CONFIG_BRIDGE_NF_EBTABLES=m
CONFIG_BRIDGE_EBT_BROUTE=m
CONFIG_BRIDGE_EBT_T_FILTER=m
CONFIG_BRIDGE_EBT_T_NAT=m
CONFIG_BRIDGE_EBT_802_3=m
CONFIG_BRIDGE_EBT_AMONG=m
CONFIG_BRIDGE_EBT_ARP=m
CONFIG_BRIDGE_EBT_IP=m
CONFIG_BRIDGE_EBT_IP6=m
CONFIG_BRIDGE_EBT_LIMIT=m
CONFIG_BRIDGE_EBT_MARK=m
CONFIG_BRIDGE_EBT_PKTTYPE=m
CONFIG_BRIDGE_EBT_STP=m
CONFIG_BRIDGE_EBT_VLAN=m
CONFIG_BRIDGE_EBT_ARPREPLY=m
CONFIG_BRIDGE_EBT_DNAT=m
CONFIG_BRIDGE_EBT_MARK_T=m
CONFIG_BRIDGE_EBT_REDIRECT=m
CONFIG_BRIDGE_EBT_SNAT=m
CONFIG_BRIDGE_EBT_LOG=m
CONFIG_BRIDGE_EBT_NFLOG=m
CONFIG_BRIDGE=y
CONFIG_BRIDGE_VLAN_FILTERING=y
CONFIG_BRIDGE_MRP=y
CONFIG_BRIDGE_CFM=y
CONFIG_VLAN_8021Q=y
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_NET_SCHED=y
CONFIG_NET_SCH_CBS=m
CONFIG_NET_SCH_ETF=m
CONFIG_NET_SCH_TAPRIO=m
CONFIG_NET_SCH_MQPRIO=m
CONFIG_NET_SCH_INGRESS=m
CONFIG_NET_CLS_BASIC=m
CONFIG_NET_CLS_BPF=m
CONFIG_NET_CLS_FLOWER=m
CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_GACT=y
CONFIG_NET_ACT_MIRRED=y
CONFIG_NET_ACT_NAT=y
CONFIG_NET_ACT_SKBEDIT=y
CONFIG_NET_ACT_VLAN=y
CONFIG_NET_ACT_BPF=y
CONFIG_DCB=y
CONFIG_NETLINK_DIAG=y
CONFIG_MPLS=y
CONFIG_NET_MPLS_GSO=y
CONFIG_MPLS_ROUTING=m
CONFIG_NET_PKTGEN=y
CONFIG_BT=m
# CONFIG_BT_LE is not set
CONFIG_BT_LEDS=y
# CONFIG_BT_DEBUGFS is not set
CONFIG_BT_HCIBTUSB=m
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIUART_BCM=y
CONFIG_BT_HCIUART_QCA=y
CONFIG_CFG80211=y
CONFIG_MAC80211=y
CONFIG_MAC80211_LEDS=y
CONFIG_RFKILL=y
CONFIG_NET_9P=y
CONFIG_NET_9P_VIRTIO=y
# CONFIG_ETHTOOL_NETLINK is not set
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCI_IOV=y
CONFIG_PCI_PASID=y
CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_ACPI=y
CONFIG_PCI_HOST_GENERIC=y
CONFIG_PCIE_ROCKCHIP_HOST=m
CONFIG_PCIE_ROCKCHIP_DW_HOST=y
CONFIG_PCI_ENDPOINT=y
CONFIG_PCI_ENDPOINT_CONFIGFS=y
CONFIG_PCI_EPF_TEST=m
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_FW_LOADER_USER_HELPER=y
CONFIG_VEXPRESS_CONFIG=y
CONFIG_ARM_SCMI_PROTOCOL=y
CONFIG_ARM_SCPI_PROTOCOL=y
CONFIG_EFI_CAPSULE_LOADER=y
CONFIG_MTD=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_CFI=y
CONFIG_MTD_CFI_ADV_OPTIONS=y
CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_CFI_STAA=y
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_DATAFLASH=y
CONFIG_MTD_SST25L=y
CONFIG_MTD_BLOCK2MTD=y
CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_NAND_DENALI_DT=y
CONFIG_MTD_SPI_NOR=y
CONFIG_OF_OVERLAY=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_NBD=m
CONFIG_VIRTIO_BLK=y
CONFIG_BLK_DEV_NVME=m
CONFIG_SRAM=y
CONFIG_PCI_ENDPOINT_TEST=m
CONFIG_EEPROM_AT24=m
CONFIG_EEPROM_AT25=m
CONFIG_UACCE=m
# CONFIG_SCSI_PROC_FS is not set
CONFIG_BLK_DEV_SD=y
CONFIG_SCSI_SAS_ATA=y
CONFIG_SCSI_HISI_SAS=y
CONFIG_SCSI_HISI_SAS_PCI=y
CONFIG_MEGARAID_SAS=y
CONFIG_SCSI_MPT3SAS=m
CONFIG_SCSI_VIRTIO=y
CONFIG_ATA=y
CONFIG_SATA_AHCI=y
CONFIG_SATA_AHCI_PLATFORM=y
CONFIG_AHCI_CEVA=y
CONFIG_SATA_SIL24=y
CONFIG_PATA_OF_PLATFORM=y
CONFIG_MD=y
# CONFIG_MD_BITMAP_FILE is not set
CONFIG_BLK_DEV_DM=y
CONFIG_DM_INIT=y
CONFIG_DM_VERITY=y
CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y
CONFIG_NETDEVICES=y
CONFIG_BONDING=m
CONFIG_DUMMY=m
CONFIG_WIREGUARD=m
CONFIG_MACVLAN=m
CONFIG_MACVTAP=m
CONFIG_IPVLAN=m
CONFIG_IPVTAP=m
CONFIG_VXLAN=m
CONFIG_GENEVE=m
CONFIG_BAREUDP=m
CONFIG_MACSEC=m
CONFIG_TUN=m
CONFIG_VETH=m
CONFIG_VIRTIO_NET=y
CONFIG_NLMON=y
CONFIG_NET_VRF=y
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_NET_VENDOR_ADAPTEC is not set
# CONFIG_NET_VENDOR_AGERE is not set
# CONFIG_NET_VENDOR_ALACRITECH is not set
# CONFIG_NET_VENDOR_ALTEON is not set
# CONFIG_NET_VENDOR_AMAZON is not set
# CONFIG_NET_VENDOR_AMD is not set
# CONFIG_NET_VENDOR_AQUANTIA is not set
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_VENDOR_ASIX is not set
CONFIG_ATL2=m
CONFIG_ALX=m
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CADENCE is not set
# CONFIG_NET_VENDOR_CAVIUM is not set
# CONFIG_NET_VENDOR_CHELSIO is not set
# CONFIG_NET_VENDOR_CISCO is not set
# CONFIG_NET_VENDOR_CORTINA is not set
# CONFIG_NET_VENDOR_DEC is not set
# CONFIG_NET_VENDOR_DLINK is not set
# CONFIG_NET_VENDOR_EMULEX is not set
# CONFIG_NET_VENDOR_EZCHIP is not set
# CONFIG_NET_VENDOR_GOOGLE is not set
# CONFIG_NET_VENDOR_HISILICON is not set
# CONFIG_NET_VENDOR_HUAWEI is not set
# CONFIG_NET_VENDOR_INTEL is not set
# CONFIG_NET_VENDOR_LITEX is not set
# CONFIG_NET_VENDOR_MARVELL is not set
# CONFIG_NET_VENDOR_MELLANOX is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MICROCHIP is not set
# CONFIG_NET_VENDOR_MICROSEMI is not set
# CONFIG_NET_VENDOR_MICROSOFT is not set
# CONFIG_NET_VENDOR_MYRI is not set
# CONFIG_NET_VENDOR_NI is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_NETERION is not set
# CONFIG_NET_VENDOR_NETRONOME is not set
# CONFIG_NET_VENDOR_NVIDIA is not set
# CONFIG_NET_VENDOR_OKI is not set
# CONFIG_NET_VENDOR_PACKET_ENGINES is not set
# CONFIG_NET_VENDOR_PENSANDO is not set
# CONFIG_NET_VENDOR_QLOGIC is not set
# CONFIG_NET_VENDOR_BROCADE is not set
# CONFIG_NET_VENDOR_QUALCOMM is not set
# CONFIG_NET_VENDOR_RDC is not set
CONFIG_8139CP=m
CONFIG_8139TOO=m
# CONFIG_8139TOO_PIO is not set
CONFIG_R8169=m
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SILAN is not set
# CONFIG_NET_VENDOR_SIS is not set
# CONFIG_NET_VENDOR_SOLARFLARE is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_SOCIONEXT is not set
CONFIG_STMMAC_ETH=y
# CONFIG_DWMAC_GENERIC is not set
# CONFIG_NET_VENDOR_SUN is not set
# CONFIG_NET_VENDOR_SYNOPSYS is not set
# CONFIG_NET_VENDOR_TEHUTI is not set
# CONFIG_NET_VENDOR_TI is not set
# CONFIG_NET_VENDOR_VIA is not set
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_NET_VENDOR_XILINX is not set
CONFIG_LED_TRIGGER_PHY=y
CONFIG_AX88796B_PHY=y
CONFIG_DAVICOM_PHY=m
CONFIG_REALTEK_PHY=y
CONFIG_ROCKCHIP_PHY=y
CONFIG_MDIO_BITBANG=y
CONFIG_MDIO_BUS_MUX_MULTIPLEXER=y
CONFIG_MDIO_BUS_MUX_MMIOREG=y
CONFIG_USB_RTL8150=m
CONFIG_USB_RTL8152=m
CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=m
CONFIG_USB_NET_AX88179_178A=m
CONFIG_USB_NET_CDC_NCM=m
CONFIG_USB_NET_DM9601=m
CONFIG_USB_NET_SMSC75XX=m
CONFIG_USB_NET_SMSC95XX=m
CONFIG_USB_NET_NET1080=m
CONFIG_USB_NET_PLUSB=m
CONFIG_USB_NET_MCS7830=m
CONFIG_USB_NET_CDC_SUBSET=m
# CONFIG_USB_NET_ZAURUS is not set
CONFIG_ATH10K=m
CONFIG_ATH10K_PCI=m
CONFIG_WCN36XX=m
# CONFIG_WLAN_VENDOR_ATMEL is not set
# CONFIG_WLAN_VENDOR_BROADCOM is not set
# CONFIG_WLAN_VENDOR_INTEL is not set
# CONFIG_WLAN_VENDOR_INTERSIL is not set
# CONFIG_WLAN_VENDOR_MARVELL is not set
# CONFIG_WLAN_VENDOR_MEDIATEK is not set
CONFIG_RTL8180=m
CONFIG_RTL8187=m
CONFIG_RTL_CARDS=m
CONFIG_RTL8192CE=m
CONFIG_RTL8192SE=m
CONFIG_RTL8192DE=m
CONFIG_RTL8723AE=m
CONFIG_RTL8723BE=m
CONFIG_RTL8188EE=m
CONFIG_RTL8192EE=m
CONFIG_RTL8821AE=m
CONFIG_RTL8192CU=m
CONFIG_RTL8XXXU=m
CONFIG_RTL8XXXU_UNTESTED=y
CONFIG_RTW88=m
CONFIG_RTW88_8822BE=m
CONFIG_RTW88_8822BS=m
CONFIG_RTW88_8822BU=m
CONFIG_RTW88_8822CE=m
CONFIG_RTW88_8822CS=m
CONFIG_RTW88_8822CU=m
CONFIG_RTW88_8723DE=m
CONFIG_RTW88_8723DS=m
CONFIG_RTW88_8723DU=m
CONFIG_RTW88_8821CE=m
CONFIG_RTW88_8821CS=m
CONFIG_RTW88_8821CU=m
CONFIG_RTW88_DEBUG=y
CONFIG_RTW89=m
CONFIG_RTW89_8851BE=m
CONFIG_RTW89_8852AE=m
CONFIG_RTW89_8852BE=m
CONFIG_RTW89_8852CE=m
CONFIG_RTW89_DEBUGMSG=y
# CONFIG_WLAN_VENDOR_RSI is not set
# CONFIG_WLAN_VENDOR_TI is not set
# CONFIG_WLAN_VENDOR_ZYDAS is not set
# CONFIG_WLAN_VENDOR_QUANTENNA is not set
CONFIG_INPUT_FF_MEMLESS=y
CONFIG_INPUT_EVDEV=y
CONFIG_INPUT_EVBUG=y
CONFIG_KEYBOARD_GPIO=y
CONFIG_KEYBOARD_GPIO_POLLED=y
# CONFIG_INPUT_MOUSE is not set
CONFIG_INPUT_MISC=y
CONFIG_INPUT_RK805_PWRKEY=y
# CONFIG_SERIO_SERPORT is not set
CONFIG_SERIO_AMBAKMI=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_LEGACY_PTY_COUNT=16
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DW=y
CONFIG_SERIAL_8250_RT288X=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SERIAL_AMBA_PL010=y
CONFIG_SERIAL_AMBA_PL010_CONSOLE=y
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
CONFIG_SERIAL_DEV_BUS=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_TCG_TPM=y
CONFIG_TCG_TIS_I2C_INFINEON=y
CONFIG_I2C=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX=y
CONFIG_I2C_MUX_PCA954x=y
CONFIG_I2C_DESIGNWARE_PLATFORM=y
CONFIG_I2C_GPIO=m
CONFIG_I2C_RK3X=y
CONFIG_I2C_SLAVE=y
CONFIG_SPI=y
CONFIG_SPI_BITBANG=m
CONFIG_SPI_CADENCE_QUADSPI=y
CONFIG_SPI_DESIGNWARE=m
CONFIG_SPI_DW_DMA=y
CONFIG_SPI_DW_MMIO=m
CONFIG_SPI_PL022=y
CONFIG_SPI_ROCKCHIP=y
CONFIG_SPI_SPIDEV=m
CONFIG_SPMI=y
CONFIG_PPS=y
# CONFIG_PTP_1588_CLOCK is not set
CONFIG_DEBUG_PINCTRL=y
CONFIG_PINCTRL_RK805=y
CONFIG_PINCTRL_SINGLE=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_GENERIC_PLATFORM=y
CONFIG_GPIO_MAX732X=y
CONFIG_GPIO_PCA953X=y
CONFIG_GPIO_PCA953X_IRQ=y
CONFIG_POWER_RESET_GPIO_RESTART=y
CONFIG_POWER_RESET_SYSCON=y
CONFIG_SYSCON_REBOOT_MODE=y
CONFIG_CHARGER_RK817=y
CONFIG_SENSORS_ARM_SCMI=y
CONFIG_SENSORS_ARM_SCPI=y
CONFIG_SENSORS_PWM_FAN=m
CONFIG_CPU_THERMAL=y
CONFIG_THERMAL_EMULATION=y
CONFIG_ROCKCHIP_THERMAL=m
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_SYSFS=y
CONFIG_SOFT_WATCHDOG=y
CONFIG_MFD_RK8XX_I2C=y
CONFIG_MFD_RK8XX_SPI=y
# CONFIG_MFD_VEXPRESS_SYSREG is not set
CONFIG_REGULATOR=y
CONFIG_REGULATOR_DEBUG=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_USERSPACE_CONSUMER=y
CONFIG_REGULATOR_NETLINK_EVENTS=y
CONFIG_REGULATOR_GPIO=y
CONFIG_REGULATOR_PWM=y
CONFIG_REGULATOR_RK808=y
CONFIG_REGULATOR_VCTRL=y
# CONFIG_HID_SUPPORT is not set
CONFIG_USB_ULPI_BUS=y
CONFIG_USB_CONN_GPIO=y
CONFIG_USB=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_DYNAMIC_MINORS=y
CONFIG_USB_OTG=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PLATFORM=y
CONFIG_USB_ACM=m
CONFIG_USB_STORAGE=y
CONFIG_USB_MUSB_HDRC=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC2=y
CONFIG_USB_SERIAL=m
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_SIMPLE=m
CONFIG_USB_SERIAL_CP210X=m
CONFIG_USB_SERIAL_FTDI_SIO=m
CONFIG_USB_SERIAL_PL2303=m
CONFIG_USB_SERIAL_OPTION=m
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_ULPI=y
CONFIG_USB_GADGET=y
CONFIG_USB_SNP_UDC_PLAT=y
CONFIG_USB_BDC_UDC=y
CONFIG_USB_CONFIGFS=m
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_OBEX=y
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_ECM_SUBSET=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_MMC=y
CONFIG_MMC_BLOCK_MINORS=32
CONFIG_MMC_ARMMMCI=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_ACPI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_OF_ARASAN=y
CONFIG_MMC_SDHCI_CADENCE=y
CONFIG_MMC_SDHCI_F_SDH30=y
CONFIG_MMC_SPI=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_HI3798CV200=y
CONFIG_MMC_DW_K3=y
CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_SCSI_UFSHCD=y
CONFIG_SCSI_UFSHCD_PLATFORM=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_CLASS_FLASH=y
CONFIG_LEDS_CLASS_MULTICOLOR=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_PWM=y
CONFIG_LEDS_SYSCON=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_DISK=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_CPU=y
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
CONFIG_LEDS_TRIGGER_PANIC=y
CONFIG_LEDS_TRIGGER_NETDEV=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_RK808=y
CONFIG_RTC_DRV_EFI=y
CONFIG_RTC_DRV_PL030=y
CONFIG_RTC_DRV_PL031=y
CONFIG_DMADEVICES=y
CONFIG_PL330_DMA=y
CONFIG_SYNC_FILE=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_INPUT=y
CONFIG_VIRTIO_MMIO=y
# CONFIG_VHOST_MENU is not set
CONFIG_STAGING=y
CONFIG_RTLLIB=m
CONFIG_RTL8192E=m
CONFIG_RTL8723BS=m
CONFIG_R8712U=m
CONFIG_RTS5208=m
# CONFIG_SURFACE_PLATFORMS is not set
CONFIG_COMMON_CLK_SCMI=y
CONFIG_COMMON_CLK_SCPI=y
CONFIG_COMMON_CLK_PWM=y
CONFIG_HWSPINLOCK=y
# CONFIG_FSL_ERRATUM_A008585 is not set
# CONFIG_HISILICON_ERRATUM_161010101 is not set
# CONFIG_ARM64_ERRATUM_858921 is not set
CONFIG_ARM_MHU=y
CONFIG_PLATFORM_MHU=y
CONFIG_IOMMU_IO_PGTABLE_ARMV7S=y
CONFIG_ROCKCHIP_IOMMU=y
CONFIG_ARM_SMMU=y
CONFIG_ARM_SMMU_V3=y
CONFIG_ROCKCHIP_IODOMAIN=y
CONFIG_ROCKCHIP_DTPM=m
CONFIG_ROCKCHIP_PM_DOMAINS=y
CONFIG_DEVFREQ_GOV_USERSPACE=m
CONFIG_EXTCON_USB_GPIO=y
CONFIG_MEMORY=y
CONFIG_IIO=y
CONFIG_MAX9611=m
CONFIG_ROCKCHIP_SARADC=m
CONFIG_IIO_ST_LSM6DSX=m
CONFIG_SENSORS_ISL29018=m
CONFIG_VCNL4000=m
CONFIG_IIO_ST_MAGN_3AXIS=m
CONFIG_MPL3115=m
CONFIG_PWM=y
CONFIG_PWM_ROCKCHIP=y
CONFIG_RESET_GPIO=y
CONFIG_PHY_ROCKCHIP_DPHY_RX0=m
CONFIG_PHY_ROCKCHIP_EMMC=y
CONFIG_PHY_ROCKCHIP_INNO_HDMI=m
CONFIG_PHY_ROCKCHIP_INNO_USB2=y
CONFIG_PHY_ROCKCHIP_INNO_CSIDPHY=m
CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=m
CONFIG_PHY_ROCKCHIP_PCIE=m
CONFIG_PHY_ROCKCHIP_TYPEC=y
CONFIG_PHY_ROCKCHIP_USB=m
CONFIG_POWERCAP=y
CONFIG_ARM_SCMI_POWERCAP=y
CONFIG_DTPM=y
CONFIG_ARM_SMMU_V3_PMU=m
CONFIG_NVMEM_RMEM=m
CONFIG_NVMEM_ROCKCHIP_EFUSE=m
CONFIG_NVMEM_ROCKCHIP_OTP=m
CONFIG_TEE=y
CONFIG_OPTEE=y
CONFIG_MUX_MMIO=y
CONFIG_INTERCONNECT=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_BTRFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_QUOTA=y
CONFIG_AUTOFS_FS=y
CONFIG_FUSE_FS=y
CONFIG_VIRTIO_FS=y
CONFIG_OVERLAY_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_UTF8=y
CONFIG_EXFAT_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_CHILDREN=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_HUGETLBFS=y
CONFIG_EFIVAR_FS=y
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_XATTR=y
CONFIG_SQUASHFS=y
CONFIG_SQUASHFS_LZO=y
CONFIG_SQUASHFS_XZ=y
CONFIG_SQUASHFS_ZSTD=y
CONFIG_NFS_FS=y
CONFIG_NFS_V4=y
CONFIG_NFS_V4_1=y
CONFIG_NFS_V4_2=y
CONFIG_ROOT_NFS=y
CONFIG_9P_FS=y
CONFIG_NLS_DEFAULT="iso8859-15"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_ISO8859_15=y
CONFIG_NLS_UTF8=y
CONFIG_SECURITY=y
CONFIG_CRYPTO_DH=m
CONFIG_CRYPTO_CURVE25519=m
CONFIG_CRYPTO_ECHAINIV=y
CONFIG_CRYPTO_LZO=y
CONFIG_CRYPTO_ZSTD=y
CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_CRYPTO_USER_API_RNG=m
CONFIG_CRYPTO_GHASH_ARM64_CE=y
CONFIG_CRYPTO_SHA1_ARM64_CE=y
CONFIG_CRYPTO_SHA2_ARM64_CE=y
CONFIG_CRYPTO_SHA512_ARM64_CE=m
CONFIG_CRYPTO_SHA3_ARM64=m
CONFIG_CRYPTO_SM3_ARM64_CE=m
CONFIG_CRYPTO_AES_ARM64_BS=m
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=m
CONFIG_CRYPTO_DEV_ROCKCHIP=y
CONFIG_CRYPTO_DEV_CCREE=m
CONFIG_PACKING=y
CONFIG_INDIRECT_PIO=y
CONFIG_CRC_CCITT=m
CONFIG_CRC8=y
CONFIG_DMA_CMA=y
CONFIG_CMA_SIZE_MBYTES=32
CONFIG_PRINTK_TIME=y
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_SCHED_DEBUG is not set
CONFIG_FUNCTION_TRACER=y
CONFIG_MEMTEST=y
-5
View File
@@ -1,5 +0,0 @@
#!/bin/sh
BOARD_DIR="$(dirname $0)"
install -m 0644 -D $BOARD_DIR/extlinux.conf $TARGET_DIR/boot/extlinux/extlinux.conf
@@ -1,14 +0,0 @@
--- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts 2023-11-08 14:09:07.000000000 +0100
+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts 2024-01-22 07:31:14.949550828 +0100
@@ -20,6 +20,11 @@
chosen {
stdout-path = "serial2:1500000n8";
+
+ infix {
+ /* Default admin user password: 'admin' */
+ factory-password-hash = "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A";
+ };
};
gmac_clk: gmac-clock {
@@ -1,189 +0,0 @@
{
"ieee802-dot1ab-lldp:lldp": {
"infix-lldp:enabled": true
},
"ietf-interfaces:interfaces": {
"interface": [
{
"name": "lo",
"type": "infix-if-type:loopback",
"ietf-ip:ipv4": {
"address": [
{
"ip": "127.0.0.1",
"prefix-length": 8
}
]
},
"ietf-ip:ipv6": {
"address": [
{
"ip": "::1",
"prefix-length": 128
}
]
}
},
{
"name": "lan",
"type": "infix-if-type:ethernet",
"ietf-ip:ipv4": {
"address": [
{
"ip": "192.168.2.1",
"prefix-length": 24
}
]
},
"ietf-ip:ipv6": {}
},
{
"name": "wan",
"type": "infix-if-type:ethernet"
}
]
},
"ietf-keystore:keystore": {
"asymmetric-keys": {
"asymmetric-key": [
{
"name": "genkey",
"public-key-format": "ietf-crypto-types:ssh-public-key-format",
"public-key": "",
"private-key-format": "ietf-crypto-types:rsa-private-key-format",
"cleartext-private-key": "",
"certificates": {}
}
]
}
},
"ietf-netconf-acm:nacm": {
"groups": {
"group": [
{
"name": "admin",
"user-name": [
"admin"
]
}
]
},
"rule-list": [
{
"name": "admin-acl",
"group": [
"admin"
],
"rule": [
{
"name": "permit-all",
"module-name": "*",
"access-operations": "*",
"action": "permit",
"comment": "Allow 'admin' group complete access to all operations and data."
}
]
}
]
},
"ietf-netconf-server:netconf-server": {
"listen": {
"endpoints": {
"endpoint": [
{
"name": "default-ssh",
"ssh": {
"tcp-server-parameters": {
"local-address": "::"
},
"ssh-server-parameters": {
"server-identity": {
"host-key": [
{
"name": "default-key",
"public-key": {
"central-keystore-reference": "genkey"
}
}
]
}
}
}
}
]
}
}
},
"ietf-system:system": {
"hostname": "r2s",
"ntp": {
"enabled": true,
"server": [
{
"name": "ntp.org",
"udp": {
"address": "pool.ntp.org"
}
}
]
},
"authentication": {
"user": [
{
"name": "admin",
"password": "$factory$",
"infix-system:shell": "bash"
}
]
},
"infix-system:motd-banner": "Li0tLS0tLS0uCnwgIC4gLiAgfCBJbmZpeCAtLSBhIE5ldHdvcmsgT3BlcmF0aW5nIFN5c3RlbQp8LS4gdiAuLXwgaHR0cHM6Ly9rZXJuZWxraXQuZ2l0aHViLmlvCictJy0tLSctJwo="
},
"infix-dhcp-client:dhcp-client": {
"client-if": [
{
"if-name": "wan",
"option": [
{
"name": "broadcast"
},
{
"name": "dns"
},
{
"name": "domain"
},
{
"name": "hostname"
},
{
"name": "ntpsrv"
},
{
"name": "router"
},
{
"name": "subnet"
}
]
}
]
},
"infix-meta:meta": {
"infix-meta:version": "1.0"
},
"infix-services:mdns": {
"enabled": true
},
"infix-services:web": {
"enabled": true,
"console": {
"enabled": true
},
"netbrowse": {
"enabled": true
},
"restconf": {
"enabled": true
}
}
}
@@ -1 +0,0 @@
../available/input-event-daemon.conf
@@ -1 +0,0 @@
service [12345789] log wan-monitor.sh -- WAN Health monitor
-91
View File
@@ -1,91 +0,0 @@
{
"input": {
"path": {
"locate": { "path": "/run/led/locate" },
"status-prime": { "path": "/run/led/status-prime" },
"status-ok": { "path": "/run/led/status-ok" },
"status-err": { "path": "/run/led/status-err" },
"status-crit": { "path": "/run/led/status-crit" },
"fault-prime": { "path": "/run/led/fault-prime" },
"fault-ok": { "path": "/run/led/fault-ok" },
"fault-err": { "path": "/run/led/fault-err" },
"fault-crit": { "path": "/run/led/fault-crit" },
"wan-up": { "path": "/run/led/wan-up" },
"startup": { "path": "/run/finit/cond/run/startup/success" },
"fail-safe": { "path": "/run/finit/cond/run/failure/success" },
"panic": { "path": "/run/finit/cond/run/failure/failure" }
},
"udev": {
"power-a": { "subsystem": "power_supply" },
"power-b": { "subsystem": "power_supply" }
}
},
"output": {
"led-group": {
"port-link-act": {
"match": ["*:green:tp", "*:green:sfp", "*:green:port" ],
"rules": [
{ "if": "true", "then": { "trigger": "netdev", "link": 1, "rx": 1, "tx": 1 } }
]
},
"port-alarm": {
"match": ["*:yellow:tp", "*:yellow:sfp", "*:yellow:port" ],
"rules": [
]
}
},
"led": {
"nanopi-r2s:red:sys": {
"rules": [
{ "if": "locate", "then": "@blink-1hz" },
{ "if": "panic", "then": "@blink-5hz" },
{ "if": "fail-safe", "then": "@blink-5hz" },
{ "if": "startup", "then": "@off" },
{ "if": "true", "then": "@blink-1hz" }
]
},
"nanopi-r2s:green:lan": {
"rules": [
{ "if": "locate", "then": "@blink-1hz" },
{ "if": "panic", "then": "@blink-5hz" },
{ "if": "startup", "then": "@on" }
]
},
"nanopi-r2s:green:wan": {
"rules": [
{ "if": "locate", "then": "@blink-1hz" },
{ "if": "panic", "then": "@blink-5hz" },
{ "if": "wan-up", "then": "@on" }
]
}
}
},
"aliases": {
"on": {
"brightness": true
},
"off": {
"brightness": false
},
"blink-1hz": {
"trigger": "timer",
"delay_on": 500,
"delay_off": 500
},
"blink-5hz": {
"trigger": "timer",
"delay_on": 100,
"delay_off": 100
}
}
}
@@ -1,5 +0,0 @@
[Global]
listen = /dev/input/event1
[Keys]
RESTART = reboot
@@ -1,2 +0,0 @@
ACTION=="add", SUBSYSTEM=="net", DEVPATH=="/devices/platform/ff540000.ethernet/net/eth0", NAME="wan"
ACTION=="add", SUBSYSTEM=="net", DEVPATH=="/devices/platform/ff600000.usb/xhci-hcd.0.auto/usb3/3-1/3-1:1.0/net/*", NAME="lan"
@@ -1,41 +0,0 @@
#!/bin/sh
# Background WAN interface monitor. Lights up WAN LED
# while the interface has a DHCP address.
LED_FILE="/run/led/wan-up"
PID_FILE="/run/$(basename "$0").pid"
check_wan()
{
ip_info=$(ip a show wan)
if echo "$ip_info" | grep -q "inet .* proto dhcp"; then
[ ! -f "$LED_FILE" ] && touch "$LED_FILE"
else
[ -f "$LED_FILE" ] && rm "$LED_FILE"
fi
}
cleanup()
{
rm -f "$LED_FILE"
rm -f "$PID_FILE"
exit 0
}
trap 'cleanup' TERM INT HUP QUIT
echo $$ > "$PID_FILE"
remaining_time=$((1800 - $(awk '{print int($1)}' /proc/uptime)))
[ "$remaining_time" -lt 0 ] && remaining_time=0
while [ "$remaining_time" -gt 0 ]; do
check_wan
sleep 1
remaining_time=$((remaining_time - 1))
done
while :; do
check_wan
sleep 5
done
-16
View File
@@ -1,16 +0,0 @@
CONFIG_BUTTON=y
CONFIG_BUTTON_GPIO=y
CONFIG_LED=y
CONFIG_LED_GPIO=y
# CONFIG_MMC_PCI is not set
CONFIG_DEVICE_TREE_INCLUDES="infix-env.dtsi infix-key.dtsi r2s-env.dtsi"
CONFIG_SYS_PROMPT="(r2s) "
CONFIG_ENV_OVERWRITE=y
# CONFIG_ENV_IS_NOWHERE is not set
CONFIG_ENV_IS_IN_EXT4=y
# CONFIG_ENV_IS_IN_MMC is not set
CONFIG_ENV_EXT4_INTERFACE="mmc"
CONFIG_ENV_EXT4_DEVICE_AND_PART="1:1"
-47
View File
@@ -1,47 +0,0 @@
/ {
config {
environment {
boot_targets = "mmc1";
ethprime = "eth0";
/* This is a development platform, hard code developer mode */
ixbtn-devmode = "setenv dev_mode yes; echo Enabled";
/* Override default definitiion to add LED feedback */
ixbtn-factory = "
if button factory-reset; then
echo \"Keep button pressed for 10 seconds to engage factory reset ...\"
for tick in . . . . . . . . . .; do
led nanopi-r2s:red:sys on
led nanopi-r2s:green:lan on
led nanopi-r2s:green:wan on
sleep 0.5
led nanopi-r2s:red:sys off
led nanopi-r2s:green:lan off
led nanopi-r2s:green:wan off
sleep 0.5
echo -n \"Checking button: \"
button factory-reset || exit
done
echo -n \"Final button check: \"
if button factory-reset; then
setenv factory_reset yes
echo \"FACTORY RESET ENGAGED\"
fi
fi
";
};
};
keys {
compatible = "gpio-keys";
factory-reset {
gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
linux,code = <KEY_POWER>;
label = "factory-reset";
};
};
};
@@ -1,4 +1,3 @@
label Infix (aarch64)
kernel /boot/Image
fdtdir /boot
append ${bootargs_root} ${bootargs_log} -- ${bootargs_user}
append ${bootargs_root} ${bootargs_rauc} ${bootargs_log}
+2 -3
View File
@@ -1,10 +1,9 @@
[system]
compatible=infix-aarch64
bootloader=uboot
statusfile=/mnt/aux/rauc.status
statusfile=/var/lib/rauc/status
mountprefix=/var/lib/rauc/mnt
bundle-formats=-plain
max-bundle-download-size=1073741824
[keyring]
directory=/etc/rauc/keys
@@ -18,5 +17,5 @@ device=/dev/disk/by-partlabel/secondary
bootname=secondary
[slot.net.0]
device=/dev/ram0
device=/dev/ram
bootname=net
@@ -1 +0,0 @@
x33x0fw_0_3_11_0_11832.hdr
-64
View File
@@ -1,64 +0,0 @@
Microchip SparX-5i PCB135 (eMMC)
================================
At present, only FIT images are supported via the SparX-5i eval
board's U-Boot, which must contain a valid load address. If you are
using this board, after selecting your base configuration, run the
following command to supplement the existing config with the required
FIT options:
make board-enable-sparx-fit
## Unbricking
1. Don't load a corrupt bootloader to begin with
2. Done
If, for some reason, you didn't manage to follow step 1, you can use
the `FLASH_PROG`(`J4`) connector on the board to access the SPI flash
directly.
Using a [Bus Blaster][BB3] in combination with [dangerspi][dangerspi],
you can load a new bootloader. The schematic below details how to
connect the Bus Blaster to the board, but the concept should be
portable to any debugger/device based around an FTDI2232 chip.
```
Bus Blaster: FLASH_PROG (J4):
.---. .---.
VTG >o o| VTG SCK >o o| GND
TRST |o o| GND MISO |o o| #RESET_FLASH
TDI |o o| GND o o| 3V3
TMS |o o| GND #CS |o o| #SYSRESET
TCK o o| GND MOSI |o o| GND
RTCK o o| GND '---'
TDO |o o| GND
TSRST |o o| GND
DBGRQ |o o| GND
DBGACK |o o| GND
'---'
```
| Bus Blaster | FLASH_PROG |
|-------------|----------------|
| `VTG` | `3V3` |
| `GND` | `GND` |
| | |
| `VTG` | `#RESET_FLASH` |
| `GND` | `#SYSRESET` |
| | |
| `TDI` | `MOSI` |
| `TMS` | `#CS` |
| `TCK` | `SCK` |
| `TDO` | `MISO` |
With the cable in place, build U-Boot with the correct configuration:
make fireant_boot_defconfig && make
To flash it to the board, connect the cable to `J4` and run:
make board-sparx-flash-uboot
[BB3]: http://dangerousprototypes.com/docs/Bus_Blaster#Bus_Blaster_v3
[dangerspi]: https://github.com/wkz/dangerspi
+1
View File
@@ -0,0 +1 @@
set prefix=(hd0,gpt2)/grub
+29
View File
@@ -0,0 +1,29 @@
set timeout="1"
set default="primary"
set log="loglevel=4"
load_env ORDER DEBUG
for slot in $ORDER; do
set default="$slot"
break
done
if [ "$DEBUG" ]; then
set log="debug"
fi
submenu "primary" "$log" {
set slot="$1"
set append="$2"
set root=(hd0,gpt3)
source /boot/grub/grub.cfg
}
submenu "secondary" "$log" {
set slot="$1"
set append="$2"
set root=(hd0,gpt4)
source /boot/grub/grub.cfg
}
+2 -4
View File
@@ -1,10 +1,8 @@
# GRUB Environment Block
# WARNING: Do not edit this file by tools other than grub-editenv!!!
ORDER=primary secondary net
ORDER=primary secondary
primary_OK=1
secondary_OK=1
net_OK=1
primary_TRY=0
secondary_TRY=0
net_TRY=0
#########################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
@@ -25,7 +25,6 @@ CONFIG_CPUSETS=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_BPF=y
CONFIG_USER_NS=y
CONFIG_SCHED_AUTOGROUP=y
CONFIG_BLK_DEV_INITRD=y
@@ -38,31 +37,26 @@ CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_XDP_SOCKETS=y
CONFIG_XDP_SOCKETS_DIAG=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_NET_IPIP=m
CONFIG_NET_IPGRE_DEMUX=m
CONFIG_NET_IPGRE=m
CONFIG_NET_IPIP=y
CONFIG_NET_IPGRE_DEMUX=y
CONFIG_NET_IPGRE=y
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IP_MROUTE=y
CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
CONFIG_SYN_COOKIES=y
CONFIG_NET_IPVTI=m
CONFIG_NET_FOU_IP_TUNNELS=y
CONFIG_IPV6_SIT=m
CONFIG_IPV6_GRE=m
CONFIG_NET_IPVTI=y
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
CONFIG_NETWORK_PHY_TIMESTAMPING=y
CONFIG_NETFILTER=y
CONFIG_BRIDGE_NETFILTER=y
CONFIG_NETFILTER_NETLINK_QUEUE=y
@@ -72,79 +66,17 @@ CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CONNTRACK_FTP=y
CONFIG_NF_TABLES=y
CONFIG_NF_TABLES_INET=y
CONFIG_NF_TABLES_NETDEV=y
CONFIG_NFT_CT=m
CONFIG_NFT_CONNLIMIT=m
CONFIG_NFT_LOG=m
CONFIG_NFT_LIMIT=m
CONFIG_NFT_MASQ=m
CONFIG_NFT_REDIR=m
CONFIG_NFT_NAT=m
CONFIG_NFT_TUNNEL=m
CONFIG_NFT_QUEUE=m
CONFIG_NFT_REJECT=m
CONFIG_NFT_COMPAT=m
CONFIG_NFT_HASH=m
CONFIG_NFT_XFRM=m
CONFIG_NFT_SOCKET=m
CONFIG_NFT_OSF=m
CONFIG_NFT_DUP_NETDEV=m
CONFIG_NFT_FWD_NETDEV=m
CONFIG_NFT_REJECT_NETDEV=m
CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
CONFIG_NETFILTER_XT_TARGET_LOG=m
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
CONFIG_NETFILTER_XT_MATCH_BPF=m
CONFIG_NETFILTER_XT_MATCH_CGROUP=m
CONFIG_NETFILTER_XT_MATCH_COMMENT=m
CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m
CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
CONFIG_NETFILTER_XT_MATCH_DSCP=m
CONFIG_NETFILTER_XT_MATCH_HELPER=m
CONFIG_NETFILTER_XT_MATCH_LIMIT=m
CONFIG_NETFILTER_XT_MATCH_MAC=m
CONFIG_NETFILTER_XT_MATCH_MARK=m
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IP_NF_NAT=m
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_MANGLE=m
CONFIG_IP6_NF_IPTABLES=m
CONFIG_IP6_NF_MATCH_AH=m
CONFIG_IP6_NF_MATCH_EUI64=m
CONFIG_IP6_NF_MATCH_IPV6HEADER=m
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_TARGET_REJECT=m
CONFIG_IP6_NF_RAW=m
CONFIG_IP6_NF_NAT=m
CONFIG_IP6_NF_TARGET_MASQUERADE=m
CONFIG_IP6_NF_TARGET_NPT=m
CONFIG_NF_TABLES_BRIDGE=m
CONFIG_NFT_BRIDGE_META=m
CONFIG_NF_CONNTRACK_BRIDGE=m
CONFIG_BRIDGE_NF_EBTABLES=m
CONFIG_BRIDGE_EBT_BROUTE=m
CONFIG_BRIDGE_EBT_T_FILTER=m
CONFIG_BRIDGE_EBT_T_NAT=m
CONFIG_BRIDGE_EBT_802_3=m
CONFIG_BRIDGE_EBT_ARP=m
CONFIG_BRIDGE_EBT_IP=m
CONFIG_BRIDGE_EBT_IP6=m
CONFIG_BRIDGE_EBT_LIMIT=m
CONFIG_BRIDGE_EBT_PKTTYPE=m
CONFIG_BRIDGE_EBT_STP=m
CONFIG_BRIDGE_EBT_VLAN=m
CONFIG_BRIDGE_EBT_ARPREPLY=m
CONFIG_BRIDGE_EBT_DNAT=m
CONFIG_BRIDGE_EBT_REDIRECT=m
CONFIG_BRIDGE_EBT_SNAT=m
CONFIG_BRIDGE_EBT_LOG=m
CONFIG_BRIDGE_EBT_NFLOG=m
CONFIG_BPFILTER=y
CONFIG_NF_LOG_IPV6=m
CONFIG_BRIDGE=y
CONFIG_BRIDGE_VLAN_FILTERING=y
CONFIG_BRIDGE_MRP=y
@@ -152,20 +84,8 @@ CONFIG_BRIDGE_CFM=y
CONFIG_VLAN_8021Q=y
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_NET_SCHED=y
CONFIG_NET_CLS_BASIC=y
CONFIG_NET_CLS_BPF=y
CONFIG_NET_CLS_FLOWER=y
CONFIG_NETLINK_DIAG=y
CONFIG_MPLS=y
CONFIG_NET_MPLS_GSO=y
CONFIG_MPLS_ROUTING=m
CONFIG_MPLS_IPTUNNEL=m
CONFIG_NET_PKTGEN=y
# CONFIG_WIRELESS is not set
CONFIG_NET_9P=y
CONFIG_NET_9P_VIRTIO=y
CONFIG_LWTUNNEL=y
CONFIG_PCI=y
CONFIG_UEVENT_HELPER=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
@@ -175,6 +95,7 @@ CONFIG_FW_CFG_SYSFS=y
CONFIG_FW_CFG_SYSFS_CMDLINE=y
CONFIG_BLK_DEV_NULL_BLK=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_NBD=y
CONFIG_BLK_DEV_RAM=y
CONFIG_VIRTIO_BLK=y
CONFIG_BLK_DEV_SD=y
@@ -187,21 +108,21 @@ CONFIG_BLK_DEV_DM=y
CONFIG_DM_VERITY=y
CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y
CONFIG_NETDEVICES=y
CONFIG_BONDING=m
CONFIG_DUMMY=m
CONFIG_NET_TEAM=m
CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m
CONFIG_NET_TEAM_MODE_LOADBALANCE=m
CONFIG_MACVLAN=m
CONFIG_MACVTAP=m
CONFIG_IPVLAN=m
CONFIG_IPVTAP=m
CONFIG_VXLAN=m
CONFIG_GENEVE=m
CONFIG_BAREUDP=m
CONFIG_MACSEC=m
CONFIG_TUN=m
CONFIG_VETH=m
CONFIG_BONDING=y
CONFIG_DUMMY=y
CONFIG_NET_TEAM=y
CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=y
CONFIG_NET_TEAM_MODE_LOADBALANCE=y
CONFIG_MACVLAN=y
CONFIG_MACVTAP=y
CONFIG_IPVLAN=y
CONFIG_IPVTAP=y
CONFIG_VXLAN=y
CONFIG_GENEVE=y
CONFIG_BAREUDP=y
CONFIG_MACSEC=y
CONFIG_TUN=y
CONFIG_VETH=y
CONFIG_VIRTIO_NET=y
CONFIG_NLMON=y
CONFIG_NET_VRF=y
@@ -214,38 +135,35 @@ CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_I2C=y
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_SYSFS=y
CONFIG_SOFT_WATCHDOG=y
CONFIG_I6300ESB_WDT=y
CONFIG_USB=m
CONFIG_USB_XHCI_HCD=m
CONFIG_USB_EHCI_HCD=m
CONFIG_USB_UHCI_HCD=m
CONFIG_USB_STORAGE=m
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_ACTIVITY=y
CONFIG_LEDS_TRIGGER_NETDEV=y
CONFIG_DRM=y
CONFIG_DRM_QXL=y
CONFIG_DRM_VIRTIO_GPU=y
CONFIG_DRM_BOCHS=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_HDA_INTEL=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_USB=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_UHCI_HCD=y
CONFIG_USB_STORAGE=y
CONFIG_RTC_CLASS=y
CONFIG_SYNC_FILE=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_INPUT=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
CONFIG_EXT4_FS=y
CONFIG_BTRFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_AUTOFS4_FS=y
CONFIG_FUSE_FS=y
CONFIG_VIRTIO_FS=y
CONFIG_OVERLAY_FS=y
CONFIG_VFAT_FS=y
CONFIG_EXFAT_FS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_SQUASHFS=y
@@ -255,8 +173,7 @@ CONFIG_SQUASHFS_ZSTD=y
CONFIG_9P_FS=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_GCM=y
CONFIG_CRYPTO_SHA256=y
CONFIG_DEBUG_KERNEL=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
+3
View File
@@ -0,0 +1,3 @@
menuentry "Infix" --id infix {
linux /boot/bzImage root=PARTLABEL=$slot rauc.slot=$slot console=ttyS0 $append nokaslr
}
@@ -2,10 +2,9 @@
compatible=infix-x86_64
bootloader=grub
grubenv=/mnt/aux/grub/grubenv
statusfile=/mnt/aux/rauc.status
statusfile=/var/lib/rauc/status
mountprefix=/var/lib/rauc/mnt
bundle-formats=-plain
max-bundle-download-size=1073741824
[keyring]
directory=/etc/rauc/keys
@@ -17,7 +16,3 @@ bootname=primary
[slot.rootfs.1]
device=/dev/disk/by-partlabel/secondary
bootname=secondary
[slot.net.0]
device=/dev/ram0
bootname=net
+17 -118
View File
@@ -1,10 +1,7 @@
menuconfig SIGN_ENABLED
bool "Image Signing"
default y
comment "Image Signing"
choice
prompt "Signing key source"
depends on SIGN_ENABLED
default SIGN_SRC_DIR
config SIGN_SRC_DIR
@@ -17,33 +14,23 @@ endchoice
config SIGN_KEY
string "Signing key"
depends on SIGN_ENABLED
default "${BR2_EXTERNAL_INFIX_PATH}/board/common/signing-keys/development" if SIGN_SRC_DIR
default "${BR2_EXTERNAL_INFIX_PATH}/board/common/dev-key" if SIGN_SRC_DIR
menuconfig TRUSTED_KEYS
bool "Trusted keys for image"
depends on SIGN_ENABLED
help
Keys that will be accepted for this image
comment "Additional Artifacts"
config TRUSTED_KEYS_DEVELOPMENT
bool "Development key"
depends on TRUSTED_KEYS
config TRUSTED_KEYS_DEVELOPMENT_PATH
# For /etc/os-release, uses CondtionArchitechture= from systemd.unit(5)
config INFIX_ARCH
string
depends on TRUSTED_KEYS_DEVELOPMENT
default "${BR2_EXTERNAL_INFIX_PATH}/board/common/signing-keys/development/infix.crt"
config TRUSTED_KEYS_EXTRA_PATH
string "Path to extra keys to include in image"
depends on TRUSTED_KEYS
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
Compose a full disk image with redundant Linux OS partitions,
Compose a full disk image with redundant firmware partitions,
configuration partition, etc.
This is useful when:
@@ -51,108 +38,25 @@ menuconfig DISK_IMAGE
- Creating a GNS3 appliance
- Developing/debugging issues in the boot process in QEMU
menuconfig DISK_IMAGE_SIZE
config DISK_IMAGE_SIZE
string "Image size"
depends on DISK_IMAGE
default "512M"
help
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.
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.
Minimum supported size is 512M.
choice
prompt "Bootloader"
depends on DISK_IMAGE
default DISK_IMAGE_BOOT_EFI if BR2_x86_64
default DISK_IMAGE_BOOT_NONE
config DISK_IMAGE_BOOT_NONE
bool "None"
help
Do not create any bootloader partition in the disk image.
config DISK_IMAGE_BOOT_EFI
bool "EFI"
help
Create a boot partition from a directory containing an EFI
boot application, e.g. GRUB.
config DISK_IMAGE_BOOT_BIN
bool "Binary"
help
Create a boot partition from a raw image containing the boot
application, e.g. U-Boot.
endchoice
config DISK_IMAGE_BOOT_DATA
string "Bootloader data"
depends on DISK_IMAGE
depends on DISK_IMAGE_BOOT_EFI || DISK_IMAGE_BOOT_BIN
default "${BINARIES_DIR}/efi-part/EFI" if BR2_x86_64
help
Path to the directory or file holding the bootloader data.
config DISK_IMAGE_BOOT_OFFSET
hex "Bootloader offset"
depends on DISK_IMAGE
depends on DISK_IMAGE_BOOT_EFI || DISK_IMAGE_BOOT_BIN
default 0x8000
help
Offset at which the bootloader partition is placed. Remember
to make sure that the GPT still fits at the start of the
image.
config DISK_IMAGE_TEST_MODE
bool "Enable Test Mode"
depends on DISK_IMAGE
default y
help
Enable the test mode option by default. This setting creates a test-mode flag
in the auxiliary partition of the disk image, initiating the system with the test-config
instead of regular startup-config. The primary purpose of running an image in this mode
is to ensure proper execution of all Infix tests. Additionally, it enables extra RPCs
related to system restart and configuration overrides, allowing tests to be run even on
systems where the factory configuration may potentially create L2 loops.
config DISK_IMAGE_RELEASE_URL
string "Infix URL"
depends on DISK_IMAGE
depends on !BR2_TARGET_ROOTFS_SQUASHFS
default "https://github.com/kernelkit/infix/releases/download/latest/infix-${BR2_ARCH}.tar.gz"
help
In situations where Infix itself is not being built, but a
disk image is, i.e. when building a bootloader: place this
Infix release in the primary and secondary partitions.
menuconfig GNS3_APPLIANCE
config GNS3_APPLIANCE
bool "GNS3 Appliance"
select DISK_IMAGE
default y
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
@@ -173,8 +77,3 @@ config FIT_KERNEL_LOAD_ADDR
string "Kernel load address"
depends on FIT_IMAGE
config SDCARD_AUX
bool "Create SD-card aux partition"
help
Create and populate aux.ext4 with rootfs.itbh and rauc.status
For use with a static genimage.cfg for, e.g., SD-cards.
+8 -19
View File
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Busybox version: 1.36.0
# Thu Feb 8 08:22:32 2024
# Busybox version: 1.35.0
# Mon Dec 12 13:47:01 2022
#
CONFIG_HAVE_DOT_CONFIG=y
@@ -93,9 +93,6 @@ CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
CONFIG_PASSWORD_MINLEN=6
CONFIG_MD5_SMALL=1
CONFIG_SHA1_SMALL=3
CONFIG_SHA1_HWACCEL=y
CONFIG_SHA256_HWACCEL=y
CONFIG_SHA3_SMALL=1
CONFIG_FEATURE_NON_POSIX_CP=y
# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set
@@ -126,9 +123,6 @@ CONFIG_LAST_SUPPORTED_WCHAR=0
# CONFIG_UNICODE_BIDI_SUPPORT is not set
# CONFIG_UNICODE_NEUTRAL_TABLE is not set
# CONFIG_UNICODE_PRESERVE_BROKEN is not set
# CONFIG_LOOP_CONFIGURE is not set
# CONFIG_NO_LOOP_CONFIGURE is not set
CONFIG_TRY_LOOP_CONFIGURE=y
#
# Applets
@@ -344,7 +338,6 @@ CONFIG_FEATURE_TR_CLASSES=y
CONFIG_FEATURE_TR_EQUIV=y
CONFIG_TRUE=y
CONFIG_TRUNCATE=y
CONFIG_TSORT=y
CONFIG_TTY=y
CONFIG_UNAME=y
CONFIG_UNAME_OSNAME="GNU/Linux"
@@ -533,13 +526,13 @@ CONFIG_USE_BB_CRYPT_SHA=y
CONFIG_ADDGROUP=y
CONFIG_FEATURE_ADDUSER_TO_GROUP=y
CONFIG_ADDUSER=y
CONFIG_FEATURE_CHECK_NAMES=y
# CONFIG_FEATURE_CHECK_NAMES is not set
CONFIG_LAST_ID=60000
CONFIG_FIRST_SYSTEM_ID=100
CONFIG_LAST_SYSTEM_ID=999
# CONFIG_CHPASSWD is not set
CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="sha512"
CONFIG_CRYPTPW=y
CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="md5"
# CONFIG_CRYPTPW is not set
CONFIG_MKPASSWD=y
CONFIG_DELUSER=y
CONFIG_DELGROUP=y
@@ -556,7 +549,7 @@ CONFIG_SU=y
CONFIG_FEATURE_SU_SYSLOG=y
CONFIG_FEATURE_SU_CHECKS_SHELLS=y
# CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set
# CONFIG_SULOGIN is not set
CONFIG_SULOGIN=y
CONFIG_VLOCK=y
#
@@ -838,12 +831,10 @@ CONFIG_READAHEAD=y
CONFIG_RFKILL=y
CONFIG_RUNLEVEL=y
CONFIG_RX=y
CONFIG_SEEDRNG=y
CONFIG_SETFATTR=y
CONFIG_SETSERIAL=y
CONFIG_STRINGS=y
CONFIG_TIME=y
CONFIG_TREE=y
CONFIG_TS=y
CONFIG_TTYSIZE=y
CONFIG_UBIATTACH=y
@@ -1016,7 +1007,6 @@ CONFIG_UDHCPC=y
CONFIG_FEATURE_UDHCPC_ARPING=y
CONFIG_FEATURE_UDHCPC_SANITIZEOPT=y
CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
CONFIG_UDHCPC6_DEFAULT_SCRIPT="/usr/share/udhcpc/default6.script"
CONFIG_UDHCPC6=y
CONFIG_FEATURE_UDHCPC6_RFC3646=y
CONFIG_FEATURE_UDHCPC6_RFC4704=y
@@ -1132,9 +1122,9 @@ CONFIG_SV_DEFAULT_SERVICE_DIR=""
CONFIG_SH_IS_ASH=y
# CONFIG_SH_IS_HUSH is not set
# CONFIG_SH_IS_NONE is not set
# CONFIG_BASH_IS_ASH is not set
CONFIG_BASH_IS_ASH=y
# CONFIG_BASH_IS_HUSH is not set
CONFIG_BASH_IS_NONE=y
# CONFIG_BASH_IS_NONE is not set
CONFIG_SHELL_ASH=y
CONFIG_ASH=y
CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
@@ -1151,7 +1141,6 @@ CONFIG_ASH_IDLE_TIMEOUT=y
CONFIG_ASH_ECHO=y
CONFIG_ASH_PRINTF=y
CONFIG_ASH_TEST=y
CONFIG_ASH_SLEEP=y
CONFIG_ASH_HELP=y
CONFIG_ASH_GETOPTS=y
CONFIG_ASH_CMDCMD=y
+1 -5
View File
@@ -1,13 +1,9 @@
ifeq ($(SIGN_ENABLED),y)
include $(BR2_EXTERNAL_INFIX_PATH)/board/common/uboot/uboot.mk
TRUSTED_KEYS=$(TRUSTED_KEYS_DEVELOPMENT_PATH) $(TRUSTED_KEYS_EXTRA_PATH)
define RAUC_POST_BUILD_INSTALL_CERT
@$(call IXMSG,"Installing signing cert for RAUC")
mkdir -p $(TARGET_DIR)/etc/rauc/keys
$(foreach crt,$(shell ls $(TRUSTED_KEYS)), \
$(foreach crt,$(shell ls $(SIGN_KEY)/*.crt), \
cp $(crt) $(TARGET_DIR)/etc/rauc/keys/$(shell openssl x509 -hash -noout <$(crt)).0;)
endef
RAUC_POST_BUILD_HOOKS += RAUC_POST_BUILD_INSTALL_CERT
endif
+65
View File
@@ -0,0 +1,65 @@
image aux.ext4 {
mountpoint = "/aux"
temporary = true
size = 2M
ext4 {
label = "aux"
}
}
image cfg.ext4 {
empty = true
temporary = true
size = 16M
ext4 {
label = "cfg"
}
}
image var.ext4 {
empty = true
temporary = true
# 44M - 24k (GPT backup)
size = 45032k
ext4 {
label = "var"
}
}
image mmc.img {
size = 512M
hdimage {
partition-table-type = "gpt"
}
partition aux {
offset = 2M
image = "aux.ext4"
}
partition primary {
image = "rootfs.squashfs"
size = 224M
}
partition secondary {
bootable = true
image = "rootfs.squashfs"
size = 224M
}
partition cfg {
image = "cfg.ext4"
}
partition var {
image = "var.ext4"
}
}
# Silence genimage warnings
config {}
+1 -7
View File
@@ -7,7 +7,6 @@ image aux.ext4 {
ext4 {
label = "aux"
use-mke2fs = true
}
}
@@ -18,7 +17,6 @@ image cfg.ext4 {
ext4 {
label = "cfg"
use-mke2fs = true
}
}
@@ -29,11 +27,10 @@ image var.ext4 {
ext4 {
label = "var"
use-mke2fs = true
}
}
image @DISKIMG@ {
image disk.img {
size = @TOTALSIZE@
hdimage {
partition-table-type = "gpt"
@@ -44,19 +41,16 @@ image @DISKIMG@ {
partition aux {
offset = @AUXOFFS@
image = "aux.ext4"
partition-uuid = @AUXUUID@
}
partition primary {
image = "rootfs.squashfs"
size = @IMGSIZE@
partition-uuid = @PRIMARYUUID@
}
partition secondary {
image = "rootfs.squashfs"
size = @IMGSIZE@
partition-uuid = @SECONDARYUUID@
}
partition cfg {
+4 -13
View File
@@ -9,20 +9,11 @@ die()
exit 1
}
# Find all matching key=value assignments in output/.config
# E.g., load_cfg DISK_IMAGE sets the following variables:
#
# DISK_IMAGE=y
# DISK_IMAGE_SIZE="512"
# etc.
#
# shellcheck disable=SC1090
load_cfg()
{
tmp=$(mktemp -p /tmp)
local tmp=$(mktemp -p /tmp)
grep -E "${1}.*=" "$BR2_CONFIG" >"$tmp"
. "$tmp"
rm "$tmp"
grep "$1" $BR2_CONFIG >$tmp
. $tmp
rm $tmp
}
-39
View File
@@ -1,39 +0,0 @@
#!/bin/sh
rootdir=$BUILD_DIR/genimage.root
tempdir=$BUILD_DIR/genimage.tmp
cat <<EOF > /tmp/mkaux.cfg
image aux.ext4 {
mountpoint = "/aux"
size = 16M
ext4 {
label = "aux"
use-mke2fs = true
features = "^metadata_csum,^metadata_csum_seed"
}
}
# Silence genimage warnings
config {}
EOF
rm -rf "$rootdir/aux"
mkdir -p "$rootdir/aux"
cp -f "$BINARIES_DIR/rootfs.itbh" "$rootdir/aux/primary.itbh"
cp -f "$BINARIES_DIR/rootfs.itbh" "$rootdir/aux/secondary.itbh"
cp -f "$BINARIES_DIR/rauc.status" "$rootdir/aux/rauc.status"
mkenvimage -s 0x4000 -o "$rootdir/aux/uboot.env" \
"$BR2_EXTERNAL_INFIX_PATH/board/common/uboot/aux-env.txt"
rm -rf "$BINARIES_DIR/aux.ext4"
rm -rf "$tempdir"
genimage \
--rootpath "$rootdir" \
--tmppath "$tempdir" \
--inputpath "$BINARIES_DIR" \
--outputpath "$BINARIES_DIR" \
--config "/tmp/mkaux.cfg"
+22 -62
View File
@@ -1,7 +1,6 @@
#!/bin/sh
set -e
. $BR2_EXTERNAL_INFIX_PATH/board/common/rootfs/etc/partition-uuid
set -e
K=10
M=20
@@ -18,6 +17,7 @@ size2int()
dimension()
{
if [ $total -ge $((4 << G)) ]; then
bootsize=$(( 8 << M))
auxsize=$(( 8 << M))
@@ -31,14 +31,14 @@ dimension()
cfgsize=$((256 << M))
# var is at least ~1.75G
elif [ $total -ge $((1 << G)) ]; then
bootsize=$(( 8 << M))
auxsize=$(( 8 << M))
bootsize=$(( 4 << M))
auxsize=$(( 4 << M))
imgsize=$((256 << M))
cfgsize=$(( 64 << M))
# var is at least ~0.5G
elif [ $total -ge $((512 << M)) ]; then
bootsize=$(( 8 << M))
auxsize=$(( 8 << M))
bootsize=$(( 4 << M))
auxsize=$(( 4 << M))
imgsize=$((192 << M))
cfgsize=$(( 16 << M))
# var is at least ~100M
@@ -81,7 +81,7 @@ probeboot()
genboot()
{
if [ -d "$bootdata" ]; then
if [ -d $BINARIES_DIR/efi-part/EFI ]; then
bootimg=$(cat <<EOF
image efi-part.vfat {
size = $bootsize
@@ -103,17 +103,6 @@ EOF
EOF
)
elif [ -f "$bootdata" ]; then
bootpart=$(cat <<EOF
partition boot {
offset = $bootoffs
partition-type-uuid = U
bootable = true
image = $bootdata
size = $bootsize
}
EOF
)
fi
}
@@ -122,32 +111,18 @@ root=$BUILD_DIR/genimage.root
tmp=$BUILD_DIR/genimage.tmp
total=$((512 << M))
bootoffs=$((32 << K))
bootdata=
diskimg=disk.img
bootoffs=
bootimg=
bootpart=
while getopts "a:b:B:n:s:t" opt; do
while getopts "a:s:" opt; do
case ${opt} in
a)
arch=$OPTARG
;;
b)
bootdata=$OPTARG
;;
B)
bootoffs=$(($OPTARG))
;;
n)
diskimg=${OPTARG}
;;
s)
total=$(size2int $OPTARG)
;;
t)
testmode=true
;;
esac
done
shift $((OPTIND - 1))
@@ -161,15 +136,11 @@ genboot
# Use awk over sed because replacement text may contain newlines,
# which sed does not approve of.
awk \
-vauxuuid=$AUX_UUID \
-vprimaryuuid=$PRIMARY_UUID \
-vsecondaryuuid=$SECONDARY_UUID \
-vtotal=$total \
-vauxsize=$auxsize -vauxoffs=$auxoffs \
-vimgsize=$imgsize \
-vcfgsize=$cfgsize \
-vvarsize=$varsize \
-vdiskimg=$diskimg \
-vbootimg="$bootimg" -vbootpart="$bootpart" \
'{
sub(/@TOTALSIZE@/, total);
@@ -178,47 +149,36 @@ awk \
sub(/@IMGSIZE@/, imgsize);
sub(/@CFGSIZE@/, cfgsize);
sub(/@VARSIZE@/, varsize);
sub(/@DISKIMG@/, diskimg);
sub(/@BOOTIMG@/, bootimg);
sub(/@BOOTPART@/, bootpart);
sub(/@AUXUUID@/, auxuuid);
sub(/@PRIMARYUUID@/, primaryuuid);
sub(/@SECONDARYUUID@/, secondaryuuid);
}1' \
< $common/genimage.cfg.in >$root/genimage.cfg
mkdir -p $root/aux
cp -f $BINARIES_DIR/rootfs.itbh $root/aux/primary.itbh
cp -f $BINARIES_DIR/rootfs.itbh $root/aux/secondary.itbh
cp -f $BINARIES_DIR/rauc.status $root/aux/rauc.status
if [ "$testmode" = true ]; then
touch "$root/aux/test-mode"
else
rm -f "$root/aux/test-mode"
fi
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/$arch/grub.cfg" \
"$BR2_EXTERNAL_INFIX_PATH/board/$arch/grubenv" \
"$root/aux/grub/"
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/
;;
*)
;;
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
+2 -12
View File
@@ -18,22 +18,12 @@ load_cfg()
load_cfg
[ "$FIT_IMAGE" = "y" ] || exit 0
work=$BUILD_DIR/fit-image-local
work=$(pwd)/build/fit-image-local
dtbs=$(find $BINARIES_DIR -name '*.dtb')
kernel=$(find $BINARIES_DIR -name '*Image' | head -n1)
squash=$BINARIES_DIR/rootfs.squashfs
mkdir -p $work
gzip <$kernel >$work/Image.gz
kernel=$work/Image.gz
rm -rf $work/rootfs
unsquashfs -f -d $work/rootfs $squash
rm -f $work/rootfs/boot/*Image
squash=$work/rootfs-no-kernel.squashfs
rm -f $squash
mksquashfs $work/rootfs $squash
# mkimage will only align images to 4 bytes, but U-Boot will leave
# both DTB and ramdisk in place when starting the kernel. So we pad
@@ -89,7 +79,7 @@ cat <<EOF >$work/infix.its
arch = "$FIT_ARCH";
os = "linux";
$(cat $work/kernel-load.itsi)
compression = "gzip";
compression = "none";
data = /incbin/("$kernel");
};
+21 -72
View File
@@ -1,92 +1,41 @@
#!/bin/sh
# shellcheck disable=SC1091
. "$TARGET_DIR/etc/os-release"
if [ -n "$INFIX_RELEASE" ]; then
rel="-${INFIX_RELEASE}"
fi
ARCH=$1
NM="${2:-custom}${rel}"
DISK=$3
RAM=${4:-512}
IFNUM=${5:-1}
# The aarch64 build currently has no "loader" but instead starts Linux
# directly, so we need to add a basic cmdline.
loader_args()
cat <<EOF >"$BINARIES_DIR/infix.gns3a"
{
if [ "$ARCH" = "aarch64" ]; then
cat <<EOF
"kernel_command_line": "console=ttyAMA0 root=PARTLABEL=primary quiet",
EOF
fi
}
loader_img()
{
if [ "$ARCH" = "x86_64" ]; then
cat <<EOF
"bios_image": "$loader",
EOF
else
cat <<EOF
"kernel_image": "$loader",
EOF
fi
}
if [ "$ARCH" = "x86_64" ]; then
loader=OVMF.fd
accel=allow
opts=
else
loader=Image
accel=disable
opts="-M virt -cpu cortex-a72"
fi
echo ">> Disk image MD5: $(md5sum "$BINARIES_DIR/$DISK" | awk '{print $1}')"
cat <<EOF >"$BINARIES_DIR/${NM}.gns3a"
{
"name": "$NM",
"name": "infix",
"category": "router",
"description": "$INFIX_DESC",
"vendor_name": "$VENDOR_NAME",
"vendor_url": "$VENDOR_HOME",
"product_name": "$NAME",
"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",
"vendor_url": "https://github.com/kernelkit/",
"product_name": "Infix",
"registry_version": 6,
"status": "stable",
"maintainer": "$VENDOR_NAME",
"maintainer_email": "${SUPPORT_URL#mailto:}",
"usage": "Default login, user/pass: admin/admin\n\nType 'cli' (and Enter) followed by 'help' for an overview of commands and relevant configuration files.",
"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/",
"port_name_format": "eth{0}",
"linked_clone": true,
"qemu": {
"adapter_type": "virtio-net-pci",
"adapters": ${IFNUM},
"ram": ${RAM},
"adapters": 10,
"ram": 512,
"cpus": 1,
"hda_disk_interface": "virtio",
"arch": "$ARCH",
"arch": "x86_64",
"console_type": "telnet",
$(loader_img)
$(loader_args)
"kvm": "$accel",
"options": "$opts"
"kvm": "allow"
},
"images": [
{
"filename": "$loader",
"filesize": $(stat --printf='%s' "$BINARIES_DIR/$loader"),
"md5sum": "$(md5sum "$BINARIES_DIR/$loader" | awk '{print $1}')",
"filename": "OVMF.fd",
"filesize": $(stat --printf='%s' "$BINARIES_DIR/OVMF.fd"),
"md5sum": "$(md5sum "$BINARIES_DIR/OVMF.fd" | awk '{print $1}')",
"version": "0.0"
},
{
"filename": "$DISK",
"filesize": $(stat --printf='%s' "$BINARIES_DIR/$DISK"),
"md5sum": "$(md5sum "$BINARIES_DIR/$DISK" | awk '{print $1}')",
"filename": "disk.img",
"filesize": $(stat --printf='%s' "$BINARIES_DIR/disk.img"),
"md5sum": "$(md5sum "$BINARIES_DIR/disk.img" | awk '{print $1}')",
"version": "0.0"
}
],
@@ -94,8 +43,8 @@ cat <<EOF >"$BINARIES_DIR/${NM}.gns3a"
{
"name": "0.0",
"images": {
$(loader_img)
"hda_disk_image": "$DISK"
"bios_image": "OVMF.fd",
"hda_disk_image": "disk.img"
}
}
]
-35
View File
@@ -1,35 +0,0 @@
#!/bin/sh
set -e
# Bootstrap a RAUC status file showing the newly created image
# installed to both the primary and secondary slots. This then bundled
# in the aux partition in mkdisk.sh, so that RAUC (on the target) can
# always report the installed versions.
rauc info --no-verify --output-format=shell $1 >/tmp/rauc-$$.info
. /tmp/rauc-$$.info
rm /tmp/rauc-$$.info
tstamp=$(date -u +%FT%TZ)
cat <<EOF
[slot.rootfs.0]
bundle.compatible=$RAUC_MF_COMPATIBLE
bundle.version=$RAUC_MF_VERSION
status=ok
sha256=$RAUC_IMAGE_DIGEST_0
size=$RAUC_IMAGE_SIZE_0
installed.timestamp=$tstamp
installed.count=1
activated.timestamp=$tstamp
activated.count=1
[slot.rootfs.1]
bundle.compatible=$RAUC_MF_COMPATIBLE
bundle.version=$RAUC_MF_VERSION
status=ok
sha256=$RAUC_IMAGE_DIGEST_0
size=$RAUC_IMAGE_SIZE_0
installed.timestamp=$tstamp
installed.count=1
activated.timestamp=$tstamp
activated.count=1
EOF
+13 -14
View File
@@ -2,30 +2,29 @@
set -e
GIT_VERSION=$(git -C "$BR2_EXTERNAL_INFIX_PATH" describe --always --dirty --tags)
GIT_VERSION=$(git -C $BR2_EXTERNAL_INFIX_PATH describe --always --dirty --tags)
name=$1
compat=$2
sign=$3
arch=$1
sign=$2
crt=$(ls $sign/*.crt)
key=$(ls $sign/*.key)
common=$(dirname "$(readlink -f "$0")")
common=$(dirname $(readlink -f "$0"))
work=$BUILD_DIR/mkrauc
mkdir -p "$work"
mkdir -p $work
cp -f "$common/rauc-hooks.sh" "$work/hooks.sh"
cp -f $common/rauc-hooks.sh $work/hooks.sh
# RAUC internally uses the file extension to find a suitable install
# handler, hence the name must be .img
cp -f "$BINARIES_DIR/rootfs.squashfs" "$work/rootfs.img"
cp -f "$BINARIES_DIR/rootfs.itbh" "$work/rootfs.itbh"
cp -f $BINARIES_DIR/rootfs.squashfs $work/rootfs.img
cp -f $BINARIES_DIR/rootfs.itbh $work/rootfs.itbh
cat >"$work/manifest.raucm" <<EOF
cat >$work/manifest.raucm <<EOF
[update]
compatible=${compat}
compatible=infix-${arch}
version=${GIT_VERSION}
[bundle]
@@ -39,7 +38,7 @@ filename=rootfs.img
hooks=post-install
EOF
rm -f "$BINARIES_DIR/$name.pkg"
rm -f $BINARIES_DIR/infix-$arch.pkg
rauc --cert="$crt" --key="$key" \
bundle "$work" "$BINARIES_DIR/$name.pkg"
rauc --cert=$crt --key=$key \
bundle $work $BINARIES_DIR/infix-$arch.pkg
+14 -121
View File
@@ -1,136 +1,29 @@
#!/bin/sh
# shellcheck disable=SC1090,SC1091
common=$(dirname "$(readlink -f "$0")")
. "$BR2_CONFIG" 2>/dev/null
. "$BR2_CONFIG"
. "$TARGET_DIR/usr/lib/os-release"
# Extract list of loaded YANG modules and their features for yangdoc.html
mkyangdoc()
{
cmd="yangdoc -o $1 -p $TARGET_DIR/usr/share/yang"
# shellcheck disable=SC2155
export SYSREPO_SHM_PREFIX="yangdoc"
while IFS= read -r line; do
if echo "$line" | grep -q '^[a-z]'; then
module=$(echo "$line" | awk '{print $1}')
cmd="$cmd -m $module"
feature=$(echo "$line" | awk -F'|' '{print $8}' | sed 's/^ *//;s/ *$//')
if [ -n "$feature" ]; then
feature_list=$(echo "$feature" | tr ' ' '\n')
for feat in $feature_list; do
cmd="$cmd -e $feat"
done
fi
fi
done <<EOF
$(sysrepoctl -l; rm -f /dev/shm/${SYSREPO_SHM_PREFIX}*)
EOF
# Ignore a few top-level oddballs not used by core Infix
cmd="$cmd -x supported-algorithms"
# Execute the command
echo "Calling: $cmd"
$cmd
}
if [ -n "${ID_LIKE}" ]; then
ID="${ID} ${ID_LIKE}"
fi
if [ -z "$GIT_VERSION" ]; then
infix_path="$BR2_EXTERNAL_INFIX_PATH"
if [ -n "$INFIX_OEM_PATH" ]; then
# Use version from br2-external OEM:ing Infix
infix_path="$INFIX_OEM_PATH"
fi
GIT_VERSION=$(git -C "$infix_path" describe --always --dirty --tags)
fi
# Override VERSION in /etc/os-release and filenames for release builds
if [ -n "$INFIX_RELEASE" ]; then
VERSION="$INFIX_RELEASE"
else
VERSION=$GIT_VERSION
fi
if [ -n "$INFIX_IMAGE_ID" ]; then
NAME="$INFIX_IMAGE_ID"
else
NAME="$INFIX_ID"-$(echo "$BR2_ARCH" | tr _ - | sed 's/x86-64/x86_64/')
fi
if [ -f "$TARGET_DIR/etc/rauc/system.conf" ]; then
sed -i "s/compatible=.*/compatible=$NAME/" "$TARGET_DIR/etc/rauc/system.conf"
fi
GIT_VERSION=$(git -C $BR2_EXTERNAL_INFIX_PATH describe --always --dirty --tags)
# This is a symlink to /usr/lib/os-release, so we remove this to keep
# original Buildroot information.
rm -f "$TARGET_DIR/etc/os-release"
rm "$TARGET_DIR/etc/os-release"
{
echo "NAME=\"$INFIX_NAME\""
echo "ID=$INFIX_ID"
echo "PRETTY_NAME=\"$INFIX_TAGLINE $VERSION\""
echo "ID_LIKE=\"${ID}\""
echo "DEFAULT_HOSTNAME=$BR2_TARGET_GENERIC_HOSTNAME"
echo "VERSION=\"${VERSION}\""
echo "VERSION_ID=${VERSION}"
echo "BUILD_ID=\"${GIT_VERSION}\""
if [ -n "$INFIX_IMAGE_ID" ]; then
echo "IMAGE_ID=\"$INFIX_IMAGE_ID\""
fi
if [ -n "$INFIX_RELEASE" ]; then
echo "IMAGE_VERSION=\"$INFIX_RELEASE\""
fi
echo "ARCHITECTURE=\"${INFIX_ARCH}\""
echo "HOME_URL=$INFIX_HOME"
if [ -n "$INFIX_VENDOR" ]; then
echo "VENDOR_NAME=\"$INFIX_VENDOR\""
fi
if [ -n "$INFIX_VENDOR_HOME" ]; then
echo "VENDOR_HOME=\"$INFIX_VENDOR_HOME\""
fi
if [ -n "$INFIX_DOC" ]; then
echo "DOCUMENTATION_URL=\"$INFIX_DOC\""
fi
if [ -n "$INFIX_SUPPORT" ]; then
echo "SUPPORT_URL=\"$INFIX_SUPPORT\""
fi
if [ -n "$INFIX_DESC" ]; then
echo "INFIX_DESC=\"$INFIX_DESC\""
fi
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"
} > "$TARGET_DIR/etc/os-release"
echo "$INFIX_TAGLINE $VERSION -- $(date +"%b %e %H:%M %Z %Y")" > "$TARGET_DIR/etc/version"
echo "Infix by KernelKit $GIT_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
# Drop Buildroot default pam_lastlog.so from login chain
sed -i '/^[^#]*pam_lastlog.so/s/^/# /' "$TARGET_DIR/etc/pam.d/login"
# 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
# beart means of disabling a user.
# Allow pdmenu (setup) to be a login shell
grep -qsE '^/usr/bin/pdmenu$$' "$TARGET_DIR/etc/shells" \
|| echo "/usr/bin/pdmenu" >> "$TARGET_DIR/etc/shells"
grep -qsE '^/bin/bash$$' "$TARGET_DIR/etc/shells" \
|| echo "/bin/bash" >> "$TARGET_DIR/etc/shells"
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"
# Create YANG documentation
if [ "$BR2_PACKAGE_HOST_PYTHON_YANGDOC" = "y" ]; then
mkyangdoc "$BINARIES_DIR/yangdoc.html"
fi
+10 -86
View File
@@ -1,85 +1,29 @@
#!/bin/sh
# shellcheck disable=SC2086
common=$(dirname "$(readlink -f "$0")")
. "$common/lib.sh"
. $common/lib.sh
# shellcheck disable=SC1091
. "$TARGET_DIR/etc/os-release"
load_cfg INFIX_ID
load_cfg BR2_ARCH
load_cfg BR2_DEFCONFIG
load_cfg BR2_EXTERNAL_INFIX_PATH
load_cfg BR2_TARGET_ROOTFS
# The default IMAGE_ID is infix-$BR2_ARCH but can be overridden
# for imaage names, and compat strings, like infix-r2s
if [ -n "$IMAGE_ID" ]; then
NAME="$IMAGE_ID"
else
NAME="$INFIX_ID"-$(echo "$BR2_ARCH" | tr _ - | sed 's/x86-64/x86_64/')
fi
diskimg=disk.img
load_cfg BR2_ARCH
load_cfg SIGN_KEY
ver()
{
if [ -n "$INFIX_RELEASE" ]; then
printf -- "-%s" "${INFIX_RELEASE#v}"
return
fi
}
ixmsg "Signing SquashFS Image"
$common/sign.sh $BR2_ARCH $SIGN_KEY
load_cfg SIGN_ENABLED
if [ "$SIGN_ENABLED" = "y" ]; then
load_cfg BR2_ARCH
load_cfg SIGN_KEY
ixmsg "Signing SquashFS Image"
$common/sign.sh $BR2_ARCH $SIGN_KEY
ixmsg "Creating RAUC Update Bundle"
$common/mkrauc.sh "$NAME$(ver)" $NAME $SIGN_KEY
fi
ixmsg "Creating RAUC Update Bundle"
$common/mkrauc.sh $BR2_ARCH $SIGN_KEY
load_cfg DISK_IMAGE
if [ "$DISK_IMAGE" = "y" ]; then
ixmsg "Creating Disk Image"
diskimg="${NAME}-disk$(ver).img"
bootcfg=
if [ "$DISK_IMAGE_BOOT_DATA" ]; then
bootcfg="-b $DISK_IMAGE_BOOT_DATA -B $DISK_IMAGE_BOOT_OFFSET"
fi
if [ "$BR2_TARGET_ROOTFS_SQUASHFS" != "y" ] && \
[ ! -f "$BINARIES_DIR/rootfs.squashfs" ]; then
ixmsg " Injecting $DISK_IMAGE_RELEASE_URL"
archive="$BINARIES_DIR/$(basename $DISK_IMAGE_RELEASE_URL)"
[ -f "$archive" ] || wget -O"$archive" "$DISK_IMAGE_RELEASE_URL"
tar -xa --strip-components=1 -C "$BINARIES_DIR" -f "$archive"
fi
testmode_flag=""
if [ "$DISK_IMAGE_TEST_MODE" = "y" ]; then
testmode_flag="-t"
fi
$common/mkrauc-status.sh "$BINARIES_DIR/${NAME}.pkg" >"$BINARIES_DIR/rauc.status"
$common/mkdisk.sh -a $BR2_ARCH -n $diskimg $testmode_flag -s $DISK_IMAGE_SIZE $bootcfg
fi
load_cfg SDCARD_AUX
if [ "$SDCARD_AUX" = "y" ]; then
ixmsg "Creating initial rauc.status"
$common/mkrauc-status.sh "$BINARIES_DIR/${NAME}.pkg" >"$BINARIES_DIR/rauc.status"
ixmsg "Creating aux.ext4 for sdcard.img"
$common/mkaux.sh
$common/mkdisk.sh -a $BR2_ARCH
fi
load_cfg GNS3_APPLIANCE
if [ "$GNS3_APPLIANCE" = "y" ]; then
ixmsg "Creating GNS3 Appliance, $GNS3_APPLIANCE_RAM MiB with $GNS3_APPLIANCE_IFNUM ports"
$common/mkgns3a.sh $BR2_ARCH $NAME $diskimg $GNS3_APPLIANCE_RAM $GNS3_APPLIANCE_IFNUM
ixmsg "Creating GNS3 Appliance"
$common/mkgns3a.sh
fi
load_cfg FIT_IMAGE
@@ -87,23 +31,3 @@ if [ "$FIT_IMAGE" = "y" ]; then
ixmsg "Creating Traditional FIT Image"
$common/mkfit.sh
fi
if [ "$BR2_TARGET_ROOTFS_SQUASHFS" = "y" ]; then
rel=$(ver)
ln -sf rootfs.squashfs "$BINARIES_DIR/${NAME}${rel}.img"
if [ -n "$rel" ]; then
ln -sf "$BINARIES_DIR/${NAME}${rel}.img" "$BINARIES_DIR/${NAME}.img"
fi
fi
# Menuconfig support for modifying Qemu args in release tarballs
cp "$BR2_EXTERNAL_INFIX_PATH/board/common/rootfs/usr/bin/onieprom" "$BINARIES_DIR/"
cp "$BR2_EXTERNAL_INFIX_PATH/board/common/qemu/qemu.sh" "$BINARIES_DIR/"
sed -e "s/@ARCH@/QEMU_$BR2_ARCH/" \
-e "s/@DISK_IMG@/$diskimg/" \
< "$BR2_EXTERNAL_INFIX_PATH/board/common/qemu/Config.in.in" \
> "$BINARIES_DIR/Config.in"
rm -f "$BINARIES_DIR/qemu.cfg"
CONFIG_="CONFIG_" BR2_CONFIG="$BINARIES_DIR/qemu.cfg" \
"$O/build/buildroot-config/conf" --olddefconfig "$BINARIES_DIR/Config.in"
rm -f "$BINARIES_DIR/qemu.cfg.old" "$BINARIES_DIR/.config.old"
-182
View File
@@ -1,182 +0,0 @@
mainmenu "QEMU Virtualization"
choice
prompt "Target Architecture"
default @ARCH@
config QEMU_riscv64
bool "risv64"
select QEMU_ARCH_IS_64
config QEMU_x86_64
bool "x86_64"
select QEMU_ARCH_IS_64
config QEMU_aarch64
bool "AArch64 (little endian)"
select QEMU_ARCH_IS_64
endchoice
choice
prompt "Loader"
default QEMU_LOADER_KERNEL
config QEMU_LOADER_KERNEL
bool "Kernel"
config QEMU_LOADER_UBOOT
bool "U-Boot"
depends on QEMU_aarch64
config QEMU_LOADER_OVMF
bool "OVMF (UEFI)"
depends on QEMU_x86_64
endchoice
choice
prompt "Rootfs type"
default QEMU_ROOTFS_INITRD
config QEMU_ROOTFS_MMC
bool "MMC"
depends on QEMU_aarch64
config QEMU_ROOTFS_INITRD
bool "Initrd"
depends on QEMU_LOADER_KERNEL
config QEMU_ROOTFS_VSCSI
bool "Virtio SCSI"
endchoice
choice
prompt "Console"
default QEMU_CONSOLE_VIRTIO
config QEMU_CONSOLE_VIRTIO
bool "Virtio (hvc0)"
config QEMU_CONSOLE_SERIAL
bool "Serial (ttyS0/ttyAMA0)"
depends on !QEMU_LOADER_OVMF
endchoice
config QEMU_MACHINE
string "Select emulated machine"
default "qemu-system-aarch64 -M virt,accel=kvm:tcg -cpu max" if QEMU_aarch64
default "qemu-system-x86_64 -M pc,accel=kvm:tcg -cpu max" if QEMU_x86_64
help
You should not have to change this setting, although you may
want to tweak it, or change the acceleration.
The default is based on the Buildroot architecture, selected by
the defconfig you started with. Currently Infix supports only
aarch64 (ARM64) and x86_64 (AMD64).
config QEMU_MACHINE_RAM
string "RAM size (k/M/G)"
default "384M"
help
The default, 384 MiB, works for most configurations. However,
if you get kernel panic with: "System is deadlocked on memory",
try increasing this one.
config QEMU_KERNEL
string
depends on QEMU_LOADER_KERNEL
default "Image" if QEMU_aarch64
default "bzImage" if QEMU_x86_64
config QEMU_BIOS
string
depends on !QEMU_LOADER_KERNEL
default "u-boot.bin" if QEMU_LOADER_UBOOT
default "OVMF.fd" if QEMU_LOADER_OVMF
config QEMU_ROOTFS
string
default "@DISK_IMG@" if !QEMU_ROOTFS_INITRD
default "rootfs.squashfs" if QEMU_ROOTFS_INITRD
config QEMU_DTB_EXTEND
bool
depends on QEMU_LOADER_UBOOT
default y if QEMU_aarch64
config QEMU_RW
string "Writable /cfg layer"
depends on QEMU_ROOTFS_INITRD
default "cfg.ext4"
config QEMU_RW_VAR_OPT
bool "Separate writable /var"
if QEMU_RW_VAR_OPT
config QEMU_RW_VAR_SIZE
string "Size of /var"
default "256M"
config QEMU_RW_VAR
string "Writable /var layer"
default "var.ext4"
endif
config QEMU_VPD
bool "Emulate a Vital Product Data (VPD) Memory"
config QEMU_HOST
string "Export host filesystem path"
default "/tmp"
config QEMU_APPEND
string "Extra kernel options"
depends on !QEMU_ROOTFS_MMC
config QEMU_EXTRA
string "Extra QEMU options"
comment "Networking"
choice
prompt "Mode"
default QEMU_NET_USER
config QEMU_NET_NONE
bool "None"
config QEMU_NET_BRIDGE
bool "Bridged"
config QEMU_NET_USER
bool "User"
config QEMU_NET_TAP
bool "TAP"
endchoice
config QEMU_NET_MODEL
string "Interface model"
default "virtio-net-pci"
help
The default, virtio-net-pci, NIC works for most use-cases, but
if you want to play with low-level stuff like ethtool, you
might want to test the Intel 82545EM driver, e1000.
config QEMU_NET_BRIDGE_DEV
string "Bridge device"
depends on QEMU_NET_BRIDGE
default "virbr0"
config QEMU_NET_USER_OPTS
string "User mode options"
depends on QEMU_NET_USER
help
Extra -nic user,<OPTIONS>
config QEMU_NET_TAP_N
int "Number of TAPs"
depends on QEMU_NET_TAP
default 1
-408
View File
@@ -1,408 +0,0 @@
#!/bin/sh
# This script can be used to start an Infix OS image in Qemu. It reads
# either a .config, generated from Config.in, or qemu.cfg from a release
# tarball, for the required configuration data.
#
# Debian/Ubuntu users can change the configuration post-release, install
# the kconfig-frontends package:
#
# sudo apt install kconfig-frontends
#
# and then call this script with:
#
# ./qemu.sh -c
#
# To bring up a menuconfig dialog. Select `Exit` and save the changes.
# For more help, see:_
#
# ./qemu.sh -h
#
# Local variables
imgdir=$(readlink -f $(dirname "$0"))
prognm=$(basename "$0")
usage()
{
echo "Usage:"
echo " $prognm [opts] [ARGS]"
echo
echo "Options:"
echo " -c Run menuconfig to change Qemu settings"
echo " -h This help text"
echo
echo "Arguments:"
echo " ARGS1 Args before the '--' separator are for kernel space"
echo " -- Separator"
echo " ARGS2 Args after the '--' separator are for the init process"
echo " Also, qemu.cfg has QEMU_APPEND which can affect this."
echo
echo "Example:"
echo " qemu.sh -- finit.debug"
echo "___________________________________________________________________"
echo "Note: 'kconfig-frontends' package (Debian/Ubuntu) must be installed"
echo " for -c to work: sudo apt install kconfig-frontents"
exit 1
}
die()
{
echo "$@" >&2
exit 1
}
load_qemucfg()
{
local tmp=$(mktemp -p /tmp)
grep ^CONFIG_QEMU_ $1 >$tmp
. $tmp
rm $tmp
[ "$CONFIG_QEMU_MACHINE" ] || die "Missing QEMU_MACHINE"
[ "$CONFIG_QEMU_ROOTFS" ] || die "Missing QEMU_ROOTFS"
[ "$CONFIG_QEMU_KERNEL" -a "$CONFIG_QEMU_BIOS" ] \
&& die "QEMU_KERNEL conflicts with QEMU_BIOS"
[ ! "$CONFIG_QEMU_KERNEL" -a ! "$CONFIG_QEMU_BIOS" ] \
&& die "QEMU_KERNEL or QEMU_BIOS must be set"
}
loader_args()
{
if [ "$CONFIG_QEMU_BIOS" ]; then
echo -n "-bios $CONFIG_QEMU_BIOS "
elif [ "$CONFIG_QEMU_KERNEL" ]; then
echo -n "-kernel $CONFIG_QEMU_KERNEL "
fi
}
append_args()
{
if [ "$CONFIG_QEMU_CONSOLE_VIRTIO" ]; then
echo -n "console=hvc0 "
elif [ "$CONFIG_QEMU_x86_64" ]; then
echo -n "console=ttyS0 "
elif [ "$CONFIG_QEMU_aarch64" ]; then
echo -n "console=ttyAMA0 "
else
die "Unknown console"
fi
if [ "$CONFIG_QEMU_ROOTFS_INITRD" = "y" ]; then
# Size of initrd, rounded up to nearest kb
local size=$((($(stat -c %s $CONFIG_QEMU_ROOTFS) + 1023) >> 10))
echo -n "root=/dev/ram0 ramdisk_size=${size} "
elif [ "$CONFIG_QEMU_ROOTFS_VSCSI" = "y" ]; then
echo -n "root=PARTLABEL=primary "
fi
if [ "$V" != "1" ]; then
echo -n "quiet "
else
echo -n "debug "
fi
echo -n "${QEMU_APPEND} ${QEMU_EXTRA_APPEND} "
}
rootfs_args()
{
if [ "$CONFIG_QEMU_ROOTFS_INITRD" = "y" ]; then
echo -n "-initrd $CONFIG_QEMU_ROOTFS "
elif [ "$CONFIG_QEMU_ROOTFS_MMC" = "y" ]; then
echo -n "-device sdhci-pci "
echo -n "-device sd-card,drive=mmc "
echo -n "-drive id=mmc,file=$CONFIG_QEMU_ROOTFS,if=none,format=raw "
elif [ "$CONFIG_QEMU_ROOTFS_VSCSI" = "y" ]; then
echo -n "-drive file=$CONFIG_QEMU_ROOTFS.qcow2,if=virtio,format=qcow2,bus=0,unit=0 "
fi
}
serial_args()
{
echo -n "-display none "
echo -n "-device virtio-serial "
echo -n "-chardev stdio,id=console0,mux=on "
echo -n "-mon chardev=console0 "
if [ "$CONFIG_QEMU_CONSOLE_VIRTIO" ]; then
echo -n "-device virtconsole,nr=0,name=console,chardev=console0 "
elif [ "$CONFIG_QEMU_CONSOLE_SERIAL" ]; then
echo -n "-serial chardev:console0 "
else
die "Unknown console"
fi
echo -n "-chardev socket,id=gdbserver,path=gdbserver.sock,server=on,wait=off "
echo -n "-device virtconsole,nr=1,name=gdbserver,chardev=gdbserver "
}
usb_args()
{
USBSTICK="usb.vfat"
if ! [ -f $USBSTICK ]; then
dd if=/dev/zero of=${USBSTICK} bs=8M count=1 >/dev/null 2>&1
if command -v mkfs.vfat >/dev/null; then
mkfs.vfat -n "log" $USBSTICK >/dev/null 2>&1
else
if command -v mkfs.exfat >/dev/null; then
mkfs.exfat -L "log" $USBSTICK >/dev/null 2>&1
fi
fi
fi
echo -n "-drive if=none,id=usbstick,format=raw,file=$USBSTICK "
echo -n "-usb "
echo -n "-device usb-ehci,id=ehci "
echo -n "-device usb-storage,bus=ehci.0,drive=usbstick "
}
rw_args()
{
[ "$CONFIG_QEMU_RW" ] || return
if ! [ -f "aux.ext4" ]; then
dd if=/dev/zero of="aux.ext4" bs=1M count=1 >/dev/null 2>&1
mkfs.ext4 -L aux "aux.ext4" >/dev/null 2>&1
fi
echo -n "-drive file=aux.ext4,if=virtio,format=raw,bus=0,unit=3 "
if ! [ -f "$CONFIG_QEMU_RW" ]; then
dd if=/dev/zero of="$CONFIG_QEMU_RW" bs=16M count=1 >/dev/null 2>&1
mkfs.ext4 -L cfg "$CONFIG_QEMU_RW" >/dev/null 2>&1
fi
echo -n "-drive file=$CONFIG_QEMU_RW,if=virtio,format=raw,bus=0,unit=1 "
if [ "$CONFIG_QEMU_RW_VAR_OPT" ]; then
if ! [ -f "$CONFIG_QEMU_RW_VAR" ]; then
dd if=/dev/zero of="$CONFIG_QEMU_RW_VAR" bs=$CONFIG_QEMU_RW_VAR_SIZE count=1 >/dev/null 2>&1
mkfs.ext4 -L var "$CONFIG_QEMU_RW_VAR" >/dev/null 2>&1
fi
echo -n "-drive file=$CONFIG_QEMU_RW_VAR,if=virtio,format=raw,bus=0,unit=2 "
fi
}
host_args()
{
[ "$CONFIG_QEMU_HOST" ] || return
echo -n "-virtfs local,path=$CONFIG_QEMU_HOST,security_model=none,writeout=immediate,mount_tag=hostfs "
}
net_dev_args()
{
local name="e$1"
local mac=$(printf "02:00:00:00:00:%02x" $1)
echo -n "-device $CONFIG_QEMU_NET_MODEL,netdev=$name,mac=$mac "
echo "$name $mac" >>"$mactab"
}
net_args()
{
# Infix will pick up this file via fwcfg and install it to /etc
mactab=${imgdir}/mactab
:> "$mactab"
echo -n "-fw_cfg name=opt/mactab,file=$mactab "
if [ "$CONFIG_QEMU_NET_BRIDGE" = "y" ]; then
echo -n "-netdev bridge,id=e1,br=$CONFIG_QEMU_NET_BRIDGE_DEV "
net_dev_args 1
elif [ "$CONFIG_QEMU_NET_TAP" = "y" ]; then
for i in $(seq 1 $(($CONFIG_QEMU_NET_TAP_N))); do
echo -n "-netdev tap,id=e$i,ifname=qtap$i "
net_dev_args $i
done
elif [ "$CONFIG_QEMU_NET_USER" = "y" ]; then
local useropts=
[ "$CONFIG_QEMU_NET_USER_OPTS" ] && useropts=",$CONFIG_QEMU_NET_USER_OPTS"
echo -n "-netdev user,id=e1${useropts} "
net_dev_args 1
else
echo -n "-nic none"
fi
}
# Vital Product data
vpd_args()
{
[ "$CONFIG_QEMU_VPD" = "y" ] || return
vpd_file="${imgdir}/vpd"
if ! [ -f "$vpd_file" ]; then
onieprom="${imgdir}/onieprom"
# This is you QEMU factory/default password:
pwhash=$(echo -n "admin" | mkpasswd -s -m sha256crypt)
cat <<EOF | "$onieprom" -e >"$vpd_file"
{
"manufacture-date": "$(date +"%m/%d/%Y %H:%M:%S")",
"vendor-extension": [
[
61046,
"{\"pwhash\":\"$pwhash\"}"
]
]
}
EOF
fi
echo -n "-fw_cfg name=opt/vpd,file=$vpd_file"
}
wdt_args()
{
echo -n "-device i6300esb -rtc clock=host"
}
gdb_args()
{
echo -n "-chardev socket,id=gdbqemu,path=gdbqemu.sock,server=on,wait=off "
echo -n "-gdb chardev:gdbqemu"
}
run_qemu()
{
if [ "$CONFIG_QEMU_ROOTFS_VSCSI" = "y" ]; then
qemu-img create -f qcow2 -o backing_file=$CONFIG_QEMU_ROOTFS -F raw $CONFIG_QEMU_ROOTFS.qcow2 > /dev/null
fi
local qemu
read qemu <<EOF
$CONFIG_QEMU_MACHINE -m $CONFIG_QEMU_MACHINE_RAM \
$(loader_args) \
$(rootfs_args) \
$(serial_args) \
$(rw_args) \
$(usb_args) \
$(host_args) \
$(net_args) \
$(wdt_args) \
$(vpd_args) \
$(gdb_args) \
$CONFIG_QEMU_EXTRA
EOF
if [ "$CONFIG_QEMU_KERNEL" ]; then
$qemu -append "$(append_args)" "$@"
else
$qemu "$@"
fi
}
dtb_args()
{
[ "$CONFIG_QEMU_LOADER_UBOOT" ] || return
if [ "$CONFIG_QEMU_DTB_EXTEND" ]; then
# On the current architecture, QEMU will generate an internal
# DT based on the system configuration.
# So we extract a copy of that
run_qemu -M dumpdtb=qemu.dtb >/dev/null 2>&1
# Extend it with the environment and signing information in
# u-boot.dtb.
echo "qemu.dtb u-boot.dtb" | \
xargs -n 1 dtc -I dtb -O dts | \
{ echo "/dts-v1/;"; sed -e 's:/dts-v[0-9]\+/;::'; } | \
dtc >qemu-extended.dtb 2>/dev/null
# And use the combined result to start the instance
echo -n "-dtb qemu-extended.dtb "
else
# Otherwise we just use the unmodified one
echo -n "-dtb u-boot.dtb "
fi
}
generate_dot()
{
[ "$CONFIG_QEMU_NET_TAP" = "y" ] || return
hostports="<qtap1> qtap1"
targetports="<e1> e1"
edges="host:qtap1 -- target:e1 [kind=mgmt];"
for tap in $(seq 2 $(($CONFIG_QEMU_NET_TAP_N - 1))); do
hostports="$hostports | <qtap$tap> qtap$tap "
targetports="$targetports | <e$tap> e$tap "
edges="$edges host:qtap$tap -- target:e$tap;"
done
cat >qemu.dot <<EOF
graph "qemu" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { $hostports }"
pos="0,0!",
kind="controller",
];
target [
label="{ $targetports } | target",
pos="10,0!",
kind="infix",
];
$edges
}
EOF
}
menuconfig()
{
grep -q QEMU_MACHINE Config.in || die "$prognm: must be run from the output/images directory"
command -v kconfig-mconf >/dev/null || die "$prognm: cannot find kconfig-mconf for menuconfig"
exec kconfig-mconf Config.in
}
cd $(dirname $(readlink -f "$0"))
while [ "$1" != "" ]; do
case $1 in
-c)
menuconfig
;;
-h)
usage
;;
*)
break
esac
shift
done
if [ -f .config ]; then
# Customized settings from 'qemu.sh -c'
load_qemucfg .config
else
# Shipped defaults from release tarball
load_qemucfg qemu.cfg
fi
if [ -z "$QEMU_EXTRA_APPEND" ]; then
QEMU_EXTRA_APPEND="$*"
fi
generate_dot
echo "Starting Qemu :: Ctrl-a x -- exit | Ctrl-a c -- toggle console/monitor"
line=$(stty -g)
stty raw
run_qemu $(dtb_args)
stty "$line"
+116
View File
@@ -0,0 +1,116 @@
#!/bin/sh
#set -x
mode=/mnt/cfg/infix/.use_etc
boot=/tmp/.boot_mode
if [ -f $boot ]; then
current=$(cat $boot)
else
current="unknown"
fi
m=on
n=off
p=off
select_mode()
{
if [ -f $mode ]; then
m=off
if grep -qi profinet $boot; then
n=off
p=on
else
n=on
p=off
fi
fi
exec 3>&1
selection=$(dialog --erase-on-exit --no-tags \
--hline "Arrow keys + space to select, enter to confirm" \
--backtitle "Select Operating Mode" \
--title "Select Operating Mode" \
--radiolist "System currently runs in: $current mode" 13 60 1 \
"1" "Managed NETCONF, XML datastore" "$m" \
"2" "Native Linux, /etc datastore" "$n" \
"3" "PROFINET, /etc variant" "$p" \
2>&1 1>&3)
exit_status=$?
exec 3>&-
case $exit_status in
1) # cancel
exit 0
;;
255) # escape
exit 1
;;
esac
}
usage()
{
cat <<EOF
usage:
chom [-h] [etc | netconf]
options:
-h Show this help text
arguments:
etc Change to Linux native mode, /etc
netconf Change to NETCONF mode, XML
profinet Change to PROFINET mode, /etc variant
EOF
}
case $1 in
-h)
usage
exit 0
;;
net* | xml)
selection=1
;;
nat* | etc*)
selection=2
;;
profinet)
selection=3
;;
*)
;;
esac
if [ -z "$selection" ]; then
use_dialog=1
select_mode
fi
case $selection in
1)
rm -f $mode 2>/dev/null
grep -qi netconf $boot 2>/dev/null && exit 0
result="Manageed NETCONF"
;;
2)
echo "native /etc" > $mode
grep -qi native $boot 2>/dev/null && exit 0
result="Native Linux, /etc"
;;
3)
echo "PROFINET" > $mode
grep -qi profinet $boot 2>/dev/null && exit 0
result="PROFINET"
;;
esac
if [ -n "$use_dialog" ]; then
dialog --erase-on-exit --cr-wrap --title "Activate Mode Change?" --yesno "\n Reboot to $result mode now?" 8 50
if [ $? -eq 0 ]; then
reboot
fi
fi
echo "Remember to reboot later to activate the change."
exit 0
+690
View File
@@ -0,0 +1,690 @@
#!/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.
Note: there are other mechanisms for device discovery. Microsoft have been
slow to adopt mDNS, having relied on their own SSDP protocol. For the
full experince Apple's "Bonjour" can be installed in Windows.
mDNS is supported in this product and should be enabled by default. To
verify it works, open the Windows File Explorer (Win+E) and scroll to
Network in the left-hand menu. An icon with a matching hostname can be
found there which, when clicked, opens up the device's Web Interface.
macOS users have mDNS fully integrated by default. Linux users can use
'mdns-scan' or Avahi, as shown above. The latter two can also just set
their web browsers to https://hostname-01-02-03.local
$(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
+16
View File
@@ -0,0 +1,16 @@
#!/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
View File
@@ -0,0 +1 @@
/sbin/ip
+327
View File
@@ -0,0 +1,327 @@
#!/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 Boot Mode : $(cat /tmp/.boot_mode)"
echo "System Description : $PRETTY_NAME"
echo "System Contact : $HOME_URL"
echo "System Timezone : $TZ"
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
+55
View File
@@ -0,0 +1,55 @@
#!/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 +0,0 @@
/usr/bin/mg
@@ -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 zeroconf ||:
;;
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
+2 -34
View File
@@ -1,43 +1,11 @@
# Hey Emacs, this is -*-sh-*-
# 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
log()
{
local fn="/var/log/syslog"
[ -n "$1" ] && fn="/var/log/$1"
less +G "$fn"
}
follow()
{
local fn="/var/log/syslog"
[ -n "$1" ] && fn="/var/log/$1"
tail -F "$fn"
}
_logfile_completions()
{
local cur=${COMP_WORDS[COMP_CWORD]}
local files=$(compgen -f -- "/var/log/$cur")
COMPREPLY=()
for file in $files; do
[ -f "$file" ] && COMPREPLY+=("$(basename "$file")")
done
}
complete -F _logfile_completions log
complete -F _logfile_completions follow
# Disble built-ins
enable -n help
@@ -1,27 +0,0 @@
# This file defines default behavior and a skeleton for including config
# snippets from both confd, i.e., ietf-system.yang, and DHCP clients.
# Default values taken from Debian /etc/chrony/chrony.conf
# *.conf when acting as an NTP server
confdir /etc/chrony/conf.d
# *.sources from DHCP clients, e.g., /run/chrony-dhcp/$ifname.sources:
# server 192.0.2.1 iburst
sourcedir /run/chrony/dhcp-sources.d
# *.sources for NTP servers generated by confd:ietf-system.c
sourcedir /etc/chrony/sources.d
# Where to store the system clock rate information across reboots.
driftfile /var/lib/chrony/chrony.drift
# Stop bad estimates upsetting machine clock.
maxupdateskew 100.0
# Enables kernel synchronisation (every 11 minutes) of the real-time
# clock. Note that it cant be used along with the 'rtcfile' directive.
rtcsync
# Step the system clock instead of slewing it if the adjustment is
# larger than one second, but only in the first three clock updates.
makestep 1 3
@@ -1,77 +0,0 @@
# For more information on this configuration file, see containers-registries.conf(5).
#
# NOTE: RISK OF USING UNQUALIFIED IMAGE NAMES
# We recommend always using fully qualified image names including the registry
# server (full dns name), namespace, image name, and tag
# (e.g., registry.redhat.io/ubi8/ubi:latest). Pulling by digest (i.e.,
# quay.io/repository/name@digest) further eliminates the ambiguity of tags.
# When using short names, there is always an inherent risk that the image being
# pulled could be spoofed. For example, a user wants to pull an image named
# `foobar` from a registry and expects it to come from myregistry.com. If
# myregistry.com is not first in the search list, an attacker could place a
# different `foobar` image at a registry earlier in the search list. The user
# would accidentally pull and run the attacker's image and code rather than the
# intended content. We recommend only adding registries which are completely
# trusted (i.e., registries which don't allow unknown or anonymous users to
# create accounts with arbitrary names). This will prevent an image from being
# spoofed, squatted or otherwise made insecure. If it is necessary to use one
# of these registries, it should be added at the end of the list.
#
# # An array of host[:port] registries to try when pulling an unqualified image, in order.
# unqualified-search-registries = ["example.com"]
#
# [[registry]]
# # The "prefix" field is used to choose the relevant [[registry]] TOML table;
# # (only) the TOML table with the longest match for the input image name
# # (taking into account namespace/repo/tag/digest separators) is used.
# #
# # The prefix can also be of the form: *.example.com for wildcard subdomain
# # matching.
# #
# # If the prefix field is missing, it defaults to be the same as the "location" field.
# prefix = "example.com/foo"
#
# # If true, unencrypted HTTP as well as TLS connections with untrusted
# # certificates are allowed.
# insecure = false
#
# # If true, pulling images with matching names is forbidden.
# blocked = false
#
# # The physical location of the "prefix"-rooted namespace.
# #
# # By default, this is equal to "prefix" (in which case "prefix" can be omitted
# # and the [[registry]] TOML table can only specify "location").
# #
# # Example: Given
# # prefix = "example.com/foo"
# # location = "internal-registry-for-example.net/bar"
# # requests for the image example.com/foo/myimage:latest will actually work with the
# # internal-registry-for-example.net/bar/myimage:latest image.
#
# # The location can be empty iff prefix is in a
# # wildcarded format: "*.example.com". In this case, the input reference will
# # be used as-is without any rewrite.
# location = internal-registry-for-example.com/bar"
#
# # (Possibly-partial) mirrors for the "prefix"-rooted namespace.
# #
# # The mirrors are attempted in the specified order; the first one that can be
# # contacted and contains the image will be used (and if none of the mirrors contains the image,
# # the primary location specified by the "registry.location" field, or using the unmodified
# # user-specified reference, is tried last).
# #
# # Each TOML table in the "mirror" array can contain the following fields, with the same semantics
# # as if specified in the [[registry]] TOML table directly:
# # - location
# # - insecure
# [[registry.mirror]]
# location = "example-mirror-0.local/mirror-for-foo"
# [[registry.mirror]]
# location = "example-mirror-1.local/mirrors/foo"
# insecure = true
# # Given the above, a pull of example.com/foo/image:latest will try:
# # 1. example-mirror-0.local/mirror-for-foo/image:latest
# # 2. example-mirror-1.local/mirrors/foo/image:latest
# # 3. internal-registry-for-example.net/bar/image:latest
# # in order, and use the first one that exists.
@@ -1,78 +0,0 @@
[aliases]
# almalinux
"almalinux" = "docker.io/library/almalinux"
"almalinux-minimal" = "docker.io/library/almalinux-minimal"
# centos
"centos" = "quay.io/centos/centos"
# containers
"skopeo" = "quay.io/skopeo/stable"
"buildah" = "quay.io/buildah/stable"
"podman" = "quay.io/podman/stable"
# docker
"alpine" = "docker.io/library/alpine"
"docker" = "docker.io/library/docker"
"registry" = "docker.io/library/registry"
"hello-world" = "docker.io/library/hello-world"
"swarm" = "docker.io/library/swarm"
# Fedora
"fedora-minimal" = "registry.fedoraproject.org/fedora-minimal"
"fedora" = "registry.fedoraproject.org/fedora"
# openSUSE
"opensuse/tumbleweed" = "registry.opensuse.org/opensuse/tumbleweed"
"opensuse/tumbleweed-dnf" = "registry.opensuse.org/opensuse/tumbleweed-dnf"
"opensuse/tumbleweed-microdnf" = "registry.opensuse.org/opensuse/tumbleweed-microdnf"
"opensuse/leap" = "registry.opensuse.org/opensuse/leap"
"opensuse/busybox" = "registry.opensuse.org/opensuse/busybox"
"tumbleweed" = "registry.opensuse.org/opensuse/tumbleweed"
"tumbleweed-dnf" = "registry.opensuse.org/opensuse/tumbleweed-dnf"
"tumbleweed-microdnf" = "registry.opensuse.org/opensuse/tumbleweed-microdnf"
"leap" = "registry.opensuse.org/opensuse/leap"
"leap-dnf" = "registry.opensuse.org/opensuse/leap-dnf"
"leap-microdnf" = "registry.opensuse.org/opensuse/leap-microdnf"
"tw-busybox" = "registry.opensuse.org/opensuse/busybox"
# SUSE
"suse/sle15" = "registry.suse.com/suse/sle15"
"suse/sles12sp5" = "registry.suse.com/suse/sles12sp5"
"suse/sles12sp4" = "registry.suse.com/suse/sles12sp4"
"suse/sles12sp3" = "registry.suse.com/suse/sles12sp3"
"sle15" = "registry.suse.com/suse/sle15"
"sles12sp5" = "registry.suse.com/suse/sles12sp5"
"sles12sp4" = "registry.suse.com/suse/sles12sp4"
"sles12sp3" = "registry.suse.com/suse/sles12sp3"
# Red Hat Enterprise Linux
"rhel" = "registry.access.redhat.com/rhel"
"rhel6" = "registry.access.redhat.com/rhel6"
"rhel7" = "registry.access.redhat.com/rhel7"
"ubi7" = "registry.access.redhat.com/ubi7"
"ubi7-init" = "registry.access.redhat.com/ubi7-init"
"ubi7-minimal" = "registry.access.redhat.com/ubi7-minimal"
"ubi8" = "registry.access.redhat.com/ubi8"
"ubi8-minimal" = "registry.access.redhat.com/ubi8-minimal"
"ubi8-init" = "registry.access.redhat.com/ubi8-init"
"ubi8-micro" = "registry.access.redhat.com/ubi8-micro"
"ubi8/ubi" = "registry.access.redhat.com/ubi8/ubi"
"ubi8/ubi-minimal" = "registry.access.redhat.com/ubi8-minimal"
"ubi8/ubi-init" = "registry.access.redhat.com/ubi8-init"
"ubi8/ubi-micro" = "registry.access.redhat.com/ubi8-micro"
# Rocky Linux
"rockylinux" = "docker.io/library/rockylinux"
# Debian
"debian" = "docker.io/library/debian"
# Kali Linux
"kali-bleeding-edge" = "docker.io/kalilinux/kali-bleeding-edge"
"kali-dev" = "docker.io/kalilinux/kali-dev"
"kali-experimental" = "docker.io/kalilinux/kali-experimental"
"kali-last-release" = "docker.io/kalilinux/kali-last-release"
"kali-rolling" = "docker.io/kalilinux/kali-rolling"
# Ubuntu
"ubuntu" = "docker.io/library/ubuntu"
# Oracle Linux
"oraclelinux" = "container-registry.oracle.com/os/oraclelinux"
# busybox
"busybox" = "docker.io/library/busybox"
# php
"php" = "docker.io/library/php"
# python
"python" = "docker.io/library/python"
# node
"node" = "docker.io/library/node"
-1
View File
@@ -1 +0,0 @@
CHRONY_ARGS="-f /etc/chrony/chrony.conf"
+51
View File
@@ -0,0 +1,51 @@
# 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
+144
View File
@@ -0,0 +1,144 @@
#
# 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
+2 -6
View File
@@ -2,12 +2,8 @@
# managed by openresolv. DHCP lease, VPN tunnel establishment,
# and similar events feed servers and configuration to dnsmasq.
domain-needed
# Only listen to loopback (local system)
interface=lo
bind-dynamic
#listen-address=127.0.0.1,::1
#interface=lo
listen-address=127.0.0.1
enable-dbus
# Generated by openresolv
-1
View File
@@ -1,2 +1 @@
set COLORTERM=yes
rlimit soft core infinity
@@ -1,3 +1,2 @@
task name:ixinit log:tag:ixinit [S] <pid/syslogd> \
/usr/libexec/finit/runparts -bp /usr/libexec/infix/init.d \
-- Probing system
run [S] /lib/infix/nameif -- Probing network interfaces
run if:<!boot/netconf> [S] /lib/infix/swup --
@@ -1,4 +0,0 @@
service :%i pid:!/run/k8s-logger-%i.pid <usr/container:%i> \
[2345] k8s-logger -cni %i -f local1 /run/containers/%i.fifo -- Logger for container %i
sysv :%i pid:!/run/container:%i.pid <pid/k8s-logger:%i> log kill:10 \
[2345] container -n %i -- container %i
@@ -1 +0,0 @@
task [S] <service/confd/ready> /usr/libexec/infix/mkcert -- Verifying self-signed https certificate
@@ -1,5 +0,0 @@
set G_MESSAGES_DEBUG=nocolor
service [2345] <service/dbus/running> \
env:-/etc/default/rauc log:prio:user.notice \
rauc service $RAUC_ARGS -- Software update service
@@ -1,3 +0,0 @@
service name:rousette notify:none log <pid/confd> \
[12345] rousette --syslog -t 60 \
-- RESTCONF server
@@ -0,0 +1,2 @@
task [S] /lib/infix/ssh-hostkeys --
service [2345789] <usr/ssh-hostkeys> /usr/sbin/sshd -D -- OpenSSH daemon
@@ -1 +0,0 @@
service [2345] <!> ttyd -i lo -p 8001 login -- Web terminal daemon (ttyd)

Some files were not shown because too many files have changed in this diff Show More