mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-07-21 05:27:02 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 56514201ad | |||
| 86f9419b9d | |||
| da57312334 | |||
| 70a9c4991e | |||
| 29cee51f84 |
-196
@@ -1,196 +0,0 @@
|
|||||||
image: ghcr.io/siemens/kas/kas
|
|
||||||
|
|
||||||
# First do a common bootstrap, and then build all the targets
|
|
||||||
stages:
|
|
||||||
- prep
|
|
||||||
- bootstrap
|
|
||||||
- build
|
|
||||||
|
|
||||||
# Common job fragment to get a worker ready
|
|
||||||
.setup:
|
|
||||||
stage: build
|
|
||||||
interruptible: true
|
|
||||||
variables:
|
|
||||||
KAS_WORK_DIR: $CI_PROJECT_DIR/work
|
|
||||||
KAS_REPO_REF_DIR: $CI_BUILDS_DIR/persist/repos
|
|
||||||
SSTATE_DIR: $CI_BUILDS_DIR/persist/sstate
|
|
||||||
DL_DIR: $CI_BUILDS_DIR/persist/downloads
|
|
||||||
BB_LOGCONFIG: $CI_PROJECT_DIR/ci/logging.yml
|
|
||||||
TOOLCHAIN_DIR: $CI_BUILDS_DIR/persist/toolchains
|
|
||||||
IMAGE_DIR: $CI_PROJECT_DIR/work/build/tmp/deploy/images
|
|
||||||
before_script:
|
|
||||||
- echo KAS_WORK_DIR = $KAS_WORK_DIR
|
|
||||||
- echo SSTATE_DIR = $SSTATE_DIR
|
|
||||||
- echo DL_DIR = $DL_DIR
|
|
||||||
- rm -rf $KAS_WORK_DIR
|
|
||||||
- mkdir --verbose --parents $KAS_WORK_DIR $KAS_REPO_REF_DIR $SSTATE_DIR $DL_DIR $TOOLCHAIN_DIR
|
|
||||||
|
|
||||||
# Generalised fragment to do a Kas build
|
|
||||||
.build:
|
|
||||||
extends: .setup
|
|
||||||
script:
|
|
||||||
- KASFILES=$(./ci/jobs-to-kas $CI_JOB_NAME)
|
|
||||||
- kas shell --update --force-checkout $KASFILES -c 'cat conf/*.conf'
|
|
||||||
- kas build $KASFILES
|
|
||||||
- ./ci/check-warnings $KAS_WORK_DIR/build/warnings.log
|
|
||||||
|
|
||||||
#
|
|
||||||
# Prep stage, update repositories once
|
|
||||||
#
|
|
||||||
update-repos:
|
|
||||||
extends: .setup
|
|
||||||
stage: prep
|
|
||||||
script:
|
|
||||||
- flock --verbose --timeout 60 $KAS_REPO_REF_DIR ./ci/update-repos
|
|
||||||
|
|
||||||
get-binary-toolchains:
|
|
||||||
extends: .setup
|
|
||||||
stage: prep
|
|
||||||
script:
|
|
||||||
- ./ci/get-binary-toolchains $DL_DIR $TOOLCHAIN_DIR
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Bootstrap stage, bootstrap and machine coverage
|
|
||||||
#
|
|
||||||
|
|
||||||
# Build a number of native tools first to ensure the other builders don't race
|
|
||||||
# over them
|
|
||||||
n1sdp/bootstrap:
|
|
||||||
extends: .build
|
|
||||||
stage: bootstrap
|
|
||||||
|
|
||||||
# What percentage of machines in the layer do we build
|
|
||||||
machine-coverage:
|
|
||||||
stage: bootstrap
|
|
||||||
interruptible: true
|
|
||||||
script:
|
|
||||||
- ./ci/check-machine-coverage
|
|
||||||
coverage: '/Coverage: \d+/'
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Build stage, the actual build jobs
|
|
||||||
#
|
|
||||||
|
|
||||||
a5ds:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
corstone700-fvp:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
corstone700-mps3:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
foundation-armv8:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
fvp-base:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
fvp-base-arm32:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
fvp-base-arm32/external-gccarm:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
gem5-arm64:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
juno:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
juno/clang:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
musca-b1:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
musca-s1:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
n1sdp:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
# This job currently fails when building gcc-runtime:
|
|
||||||
# cc1: error: switch '-mcpu=armv8.2-a' conflicts with '-march=armv8-a' switch [-Werror]
|
|
||||||
# Mark as manual so it doesn't get executed automatically
|
|
||||||
n1sdp/armgcc:
|
|
||||||
extends: .build
|
|
||||||
when: manual
|
|
||||||
|
|
||||||
qemuarm/testimage:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
qemuarm64-secureboot/testimage:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
qemuarm64-secureboot/clang/testimage:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
qemuarm64-secureboot/clang/musl/testimage:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
qemuarm64-secureboot/musl/testimage:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
qemuarmv5/testimage:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
sgi575:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
tc0:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Utility tasks, not executed automatically
|
|
||||||
#
|
|
||||||
|
|
||||||
delete-dl-dir:
|
|
||||||
extends: .setup
|
|
||||||
stage: prep
|
|
||||||
when: manual
|
|
||||||
script:
|
|
||||||
- rm -rf $DL_DIR/*
|
|
||||||
|
|
||||||
delete-repo-dir:
|
|
||||||
extends: .setup
|
|
||||||
stage: prep
|
|
||||||
when: manual
|
|
||||||
script:
|
|
||||||
- rm -rf $KAS_REPO_REF_DIR/*
|
|
||||||
|
|
||||||
# Delete all sstate
|
|
||||||
delete-sstate:
|
|
||||||
extends: .setup
|
|
||||||
stage: prep
|
|
||||||
when: manual
|
|
||||||
script:
|
|
||||||
- rm -rf $SSTATE_DIR/*
|
|
||||||
|
|
||||||
delete-toolchains:
|
|
||||||
extends: .setup
|
|
||||||
stage: prep
|
|
||||||
when: manual
|
|
||||||
script:
|
|
||||||
- rm -rf $TOOLCHAIN_DIR/*
|
|
||||||
|
|
||||||
# Wipe out old sstate
|
|
||||||
prune-sstate:
|
|
||||||
extends: .setup
|
|
||||||
stage: prep
|
|
||||||
when: manual
|
|
||||||
script:
|
|
||||||
- du -h -s $SSTATE_DIR
|
|
||||||
- find $SSTATE_DIR -type f -atime +30 -delete
|
|
||||||
- du -h -s $SSTATE_DIR
|
|
||||||
|
|
||||||
# Report on disk usage
|
|
||||||
usage:
|
|
||||||
extends: .setup
|
|
||||||
stage: prep
|
|
||||||
when: manual
|
|
||||||
script:
|
|
||||||
- du -h -s $DL_DIR $SSTATE_DIR $KAS_REPO_REF_DIR $TOOLCHAIN_DIR
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- base.yml
|
|
||||||
|
|
||||||
machine: a5ds
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
|
|
||||||
local_conf_header:
|
|
||||||
libc: |
|
|
||||||
GCCVERSION = "arm-9.2"
|
|
||||||
-45
@@ -1,45 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
|
|
||||||
distro: poky
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
repos:
|
|
||||||
refspec: gatesgarth
|
|
||||||
|
|
||||||
repos:
|
|
||||||
meta-arm:
|
|
||||||
layers:
|
|
||||||
meta-arm:
|
|
||||||
meta-arm-bsp:
|
|
||||||
meta-arm-toolchain:
|
|
||||||
|
|
||||||
poky:
|
|
||||||
url: https://git.yoctoproject.org/git/poky
|
|
||||||
layers:
|
|
||||||
meta:
|
|
||||||
meta-poky:
|
|
||||||
|
|
||||||
env:
|
|
||||||
BB_LOGCONFIG: ""
|
|
||||||
TOOLCHAIN_DIR: ""
|
|
||||||
|
|
||||||
local_conf_header:
|
|
||||||
base: |
|
|
||||||
CONF_VERSION = "1"
|
|
||||||
PACKAGE_CLASSES = "package_ipk"
|
|
||||||
LICENSE_FLAGS_WHITELIST += "armcompiler"
|
|
||||||
PACKAGECONFIG_remove_pn-qemu-system-native = "gtk+ sdl"
|
|
||||||
EXTRA_IMAGE_FEATURES_append = " debug-tweaks"
|
|
||||||
BB_NUMBER_THREADS = "16"
|
|
||||||
PARALLEL_MAKE = "-j16"
|
|
||||||
INHERIT += "rm_work"
|
|
||||||
PACKAGECONFIG_append_pn-perf = " coresight"
|
|
||||||
ptest: |
|
|
||||||
DISTRO_FEATURES_remove = "ptest"
|
|
||||||
|
|
||||||
machine: unset
|
|
||||||
|
|
||||||
target:
|
|
||||||
- core-image-base
|
|
||||||
- perf
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
|
|
||||||
target:
|
|
||||||
- binutils-cross-aarch64
|
|
||||||
- gcc-cross-aarch64
|
|
||||||
- python3-native
|
|
||||||
- opkg-native
|
|
||||||
- rpm-native
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
#! /usr/bin/env python3
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
import sys
|
|
||||||
|
|
||||||
metaarm = Path.cwd()
|
|
||||||
|
|
||||||
if metaarm.name != "meta-arm":
|
|
||||||
print("Not running inside meta-arm")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
# All machine configurations
|
|
||||||
machines = metaarm.glob("meta-*/conf/machine/*.conf")
|
|
||||||
machines = set(p.stem for p in machines)
|
|
||||||
|
|
||||||
# All ci files
|
|
||||||
ci = metaarm.glob("ci/*.yml")
|
|
||||||
ci = set(p.stem for p in ci)
|
|
||||||
|
|
||||||
missing = machines - ci
|
|
||||||
print(f"The following machines are missing: {', '.join(sorted(missing))}.")
|
|
||||||
|
|
||||||
covered = len(machines) - len(missing)
|
|
||||||
total = len(machines)
|
|
||||||
percent = int(covered / total * 100)
|
|
||||||
print(f"Coverage: {percent}%")
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
|
|
||||||
# Expects the path to a log file as $1, and if this file has any content
|
|
||||||
# then display the contents and exit with an error code.
|
|
||||||
|
|
||||||
set -e -u
|
|
||||||
|
|
||||||
LOGFILE=$1
|
|
||||||
|
|
||||||
LINES=$(grep --invert-match "attempting MIRRORS if available" $LOGFILE | wc -l)
|
|
||||||
if test "$LINES" -ne 0; then
|
|
||||||
echo ==============================
|
|
||||||
echo The build had warnings/errors:
|
|
||||||
echo ==============================
|
|
||||||
cat $LOGFILE
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
|
|
||||||
repos:
|
|
||||||
meta-clang:
|
|
||||||
url: https://github.com/kraj/meta-clang
|
|
||||||
refspec: gatesgarth
|
|
||||||
|
|
||||||
local_conf_header:
|
|
||||||
clang: |
|
|
||||||
TOOLCHAIN = "clang"
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- base.yml
|
|
||||||
|
|
||||||
machine: corstone700-fvp
|
|
||||||
|
|
||||||
local_conf_header:
|
|
||||||
image: |
|
|
||||||
CORE_IMAGE_EXTRA_INSTALL = "corstone700-test-app"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- corstone700-fvp.yml
|
|
||||||
|
|
||||||
machine: corstone700-mps3
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
|
|
||||||
local_conf_header:
|
|
||||||
cc: |
|
|
||||||
PNBLACKLIST[gcc-cross-arm] = "Using external toolchain"
|
|
||||||
TCMODE = "external-arm"
|
|
||||||
EXTERNAL_TOOLCHAIN = "${TOOLCHAIN_DIR}/${TARGET_ARCH}"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- base.yml
|
|
||||||
|
|
||||||
machine: foundation-armv8
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- base.yml
|
|
||||||
|
|
||||||
machine: fvp-base-arm32
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- base.yml
|
|
||||||
|
|
||||||
machine: fvp-base
|
|
||||||
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- base.yml
|
|
||||||
|
|
||||||
repos:
|
|
||||||
meta-arm:
|
|
||||||
layers:
|
|
||||||
meta-gem5:
|
|
||||||
|
|
||||||
meta-openembedded:
|
|
||||||
url: https://git.openembedded.org/meta-openembedded
|
|
||||||
layers:
|
|
||||||
meta-oe:
|
|
||||||
|
|
||||||
machine: gem5-arm64
|
|
||||||
|
|
||||||
target:
|
|
||||||
- core-image-minimal
|
|
||||||
- perf
|
|
||||||
- gem5-aarch64-native
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -u
|
|
||||||
|
|
||||||
HOST_ARCH=$(uname -m)
|
|
||||||
VER="10.2-2020.11"
|
|
||||||
|
|
||||||
DOWNLOAD_DIR=$1
|
|
||||||
TOOLCHAIN_DIR=$2
|
|
||||||
|
|
||||||
# These should be already created by .bitlab-ci.yml, but do here if run outside of that env
|
|
||||||
mkdir -p $DOWNLOAD_DIR $TOOLCHAIN_DIR
|
|
||||||
|
|
||||||
if [ $HOST_ARCH = "aarch64" ]; then
|
|
||||||
#AArch64 Linux hosted cross compilers
|
|
||||||
|
|
||||||
#AArch32 target with hard float (arm-none-linux-gnueabihf)
|
|
||||||
wget -P $DOWNLOAD_DIR -nc https://developer.arm.com/-/media/Files/downloads/gnu-a/$VER/binrel/gcc-arm-$VER-$HOST_ARCH-arm-none-linux-gnueabihf.tar.xz
|
|
||||||
elif [ $HOST_ARCH = "x86_64" ]; then
|
|
||||||
#x86_64 Linux hosted cross compilers
|
|
||||||
|
|
||||||
#AArch32 target with hard float (arm-linux-none-gnueabihf)
|
|
||||||
wget -P $DOWNLOAD_DIR -nc https://developer.arm.com/-/media/Files/downloads/gnu-a/$VER/binrel/gcc-arm-$VER-$HOST_ARCH-arm-none-linux-gnueabihf.tar.xz
|
|
||||||
|
|
||||||
#AArch64 GNU/Linux target (aarch64-none-linux-gnu)
|
|
||||||
wget -P $DOWNLOAD_DIR -nc https://developer.arm.com/-/media/Files/downloads/gnu-a/$VER/binrel/gcc-arm-$VER-$HOST_ARCH-aarch64-none-linux-gnu.tar.xz
|
|
||||||
|
|
||||||
#AArch64 GNU/Linux target (aarch64_be-none-linux-gnu)
|
|
||||||
wget -P $DOWNLOAD_DIR -nc https://developer.arm.com/-/media/Files/downloads/gnu-a/$VER/binrel/gcc-arm-$VER-$HOST_ARCH-aarch64_be-none-linux-gnu.tar.xz
|
|
||||||
else
|
|
||||||
echo "ERROR - Unknown build arch of $HOST_ARCH"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for i in arm aarch64 aarch64_be; do
|
|
||||||
if [ ! -f $DOWNLOAD_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu*.tar.xz ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d $TOOLCHAIN_DIR/$i ]; then
|
|
||||||
echo "$TOOLCHAIN_DIR/$i EXISTS!"
|
|
||||||
MANIFEST=$(ls $TOOLCHAIN_DIR/$i | grep txt)
|
|
||||||
if [[ $MANIFEST != $VER-$HOST_ARCH-$i-none-linux-gnu*.txt ]]; then
|
|
||||||
echo "Removing old $MANIFEST for $VER-$HOST_ARCH-$i-*.txt toolchain"
|
|
||||||
rm -rf $TOOLCHAIN_DIR/$i
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d $TOOLCHAIN_DIR/$i ]; then
|
|
||||||
tar -C $TOOLCHAIN_DIR -axvf $DOWNLOAD_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu*.tar.xz
|
|
||||||
mv $TOOLCHAIN_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu*/ $TOOLCHAIN_DIR/$i
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
|
|
||||||
# Read a GitLab CI job name on $1 and transform it to a
|
|
||||||
# list of Kas yaml files
|
|
||||||
|
|
||||||
set -e -u
|
|
||||||
|
|
||||||
# Read Job namne from $1 and split on /
|
|
||||||
IFS=/ read -r -a PARTS<<<$1
|
|
||||||
|
|
||||||
# Prefix each part with ci/
|
|
||||||
PARTS=("${PARTS[@]/#/ci/}")
|
|
||||||
|
|
||||||
# Suffix each part with .yml
|
|
||||||
PARTS=("${PARTS[@]/%/.yml}")
|
|
||||||
|
|
||||||
# Print colon-separated
|
|
||||||
IFS=":"
|
|
||||||
echo "${PARTS[*]}"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- base.yml
|
|
||||||
|
|
||||||
machine: juno
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
# Python logging configuration to write all warnings to a separate file
|
|
||||||
version: 1
|
|
||||||
|
|
||||||
handlers:
|
|
||||||
warnings:
|
|
||||||
class: logging.FileHandler
|
|
||||||
level: WARNING
|
|
||||||
filename: warnings.log
|
|
||||||
formatter: BitBake.logfileFormatter
|
|
||||||
|
|
||||||
loggers:
|
|
||||||
BitBake:
|
|
||||||
handlers: [warnings]
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
|
|
||||||
repos:
|
|
||||||
meta-openembedded:
|
|
||||||
url: https://git.openembedded.org/meta-openembedded
|
|
||||||
layers:
|
|
||||||
meta-oe:
|
|
||||||
meta-python:
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- meta-python.yml
|
|
||||||
|
|
||||||
repos:
|
|
||||||
meta-zephyr:
|
|
||||||
url: https://git.yoctoproject.org/git/meta-zephyr
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- base.yml
|
|
||||||
- meta-zephyr.yml
|
|
||||||
|
|
||||||
machine: musca-b1
|
|
||||||
|
|
||||||
target:
|
|
||||||
- trusted-firmware-m
|
|
||||||
- zephyr-philosophers
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- base.yml
|
|
||||||
- meta-python.yml
|
|
||||||
|
|
||||||
machine: musca-s1
|
|
||||||
|
|
||||||
target:
|
|
||||||
- trusted-firmware-m
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
|
|
||||||
local_conf_header:
|
|
||||||
libc: |
|
|
||||||
TCLIBC = "musl"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- base.yml
|
|
||||||
|
|
||||||
machine: n1sdp
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- base.yml
|
|
||||||
|
|
||||||
machine: qemuarm
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- base.yml
|
|
||||||
|
|
||||||
machine: qemuarm64-secureboot
|
|
||||||
|
|
||||||
local_conf_header:
|
|
||||||
bugs: |
|
|
||||||
# Only ping until errors can be resolved
|
|
||||||
TEST_SUITES = "ping"
|
|
||||||
|
|
||||||
target:
|
|
||||||
- core-image-base
|
|
||||||
- perf
|
|
||||||
- optee-examples
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- base.yml
|
|
||||||
|
|
||||||
machine: qemuarmv5
|
|
||||||
|
|
||||||
local_conf_header:
|
|
||||||
bugs: |
|
|
||||||
# Remove parselogs until errors can be resolved
|
|
||||||
TEST_SUITES_remove = "parselogs"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- base.yml
|
|
||||||
|
|
||||||
machine: sgi575
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
includes:
|
|
||||||
- base.yml
|
|
||||||
|
|
||||||
machine: tc0
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
|
|
||||||
local_conf_header:
|
|
||||||
testimage: |
|
|
||||||
IMAGE_CLASSES += "testimage"
|
|
||||||
TESTIMAGE_AUTO = "1"
|
|
||||||
slirp: |
|
|
||||||
TEST_RUNQEMUPARAMS = "slirp"
|
|
||||||
TEST_SERVER_IP = "127.0.0.1"
|
|
||||||
QEMU_USE_SLIRP = "1"
|
|
||||||
packages: |
|
|
||||||
IMAGE_FEATURES_append = " ssh-server-dropbear"
|
|
||||||
|
|
||||||
# Multiple targets are available, put it down to just one
|
|
||||||
target:
|
|
||||||
- core-image-base
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
#! /usr/bin/env python3
|
|
||||||
|
|
||||||
# Update clones of the repositories we need in KAS_REPO_REF_DIR to speed up fetches
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
import subprocess
|
|
||||||
import pathlib
|
|
||||||
|
|
||||||
def repo_shortname(url):
|
|
||||||
# Taken from Kas (Repo.__getattr__) to ensure the logic is right
|
|
||||||
from urllib.parse import urlparse
|
|
||||||
url = urlparse(url)
|
|
||||||
return ('{url.netloc}{url.path}'
|
|
||||||
.format(url=url)
|
|
||||||
.replace('@', '.')
|
|
||||||
.replace(':', '.')
|
|
||||||
.replace('/', '.')
|
|
||||||
.replace('*', '.'))
|
|
||||||
|
|
||||||
repositories = (
|
|
||||||
"https://git.yoctoproject.org/git/poky",
|
|
||||||
"https://git.openembedded.org/meta-openembedded",
|
|
||||||
"https://git.yoctoproject.org/git/meta-virtualization",
|
|
||||||
"https://git.yoctoproject.org/git/meta-zephyr",
|
|
||||||
"https://github.com/kraj/meta-clang",
|
|
||||||
)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
if "KAS_REPO_REF_DIR" not in os.environ:
|
|
||||||
print("KAS_REPO_REF_DIR needs to be set")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
base_repodir = pathlib.Path(os.environ["KAS_REPO_REF_DIR"])
|
|
||||||
|
|
||||||
for repo in repositories:
|
|
||||||
repodir = base_repodir / repo_shortname(repo)
|
|
||||||
if repodir.exists():
|
|
||||||
subprocess.run(["git", "-C", repodir, "fetch"], check=True)
|
|
||||||
else:
|
|
||||||
subprocess.run(["git", "clone", "--bare", repo, repodir], check=True)
|
|
||||||
@@ -62,7 +62,7 @@ XENGUEST_IMAGE_DISK_PARTITIONS ??= "1:${XENGUEST_IMAGE_DISK_SIZE}:ext4:rootfs.ta
|
|||||||
# The "bridge" type will share the physical eth interface from dom0 with the
|
# The "bridge" type will share the physical eth interface from dom0 with the
|
||||||
# domU. This will allow the domU to have access to the external network.
|
# domU. This will allow the domU to have access to the external network.
|
||||||
# The "nat" type will setup a virtual network between dom0 and domU and also
|
# The "nat" type will setup a virtual network between dom0 and domU and also
|
||||||
# configure and run the kea dhcp4 server on dom0 to serve the domU.
|
# configure and run the dhcpd on dom0 to serve the domU.
|
||||||
# The "none" type will not affect any networking setting between on dom0 and
|
# The "none" type will not affect any networking setting between on dom0 and
|
||||||
# domU.
|
# domU.
|
||||||
XENGUEST_IMAGE_NETWORK_TYPE ??= "bridge"
|
XENGUEST_IMAGE_NETWORK_TYPE ??= "bridge"
|
||||||
|
|||||||
@@ -9,6 +9,10 @@ DISTRO_FEATURES_NATIVE_append = " arm-autonomy-host"
|
|||||||
# a bbappend: RDEPENDS_${KERNEL_PACKAGE_NAME}-base = "${KERNEL_PACKAGE_NAME}-image"
|
# a bbappend: RDEPENDS_${KERNEL_PACKAGE_NAME}-base = "${KERNEL_PACKAGE_NAME}-image"
|
||||||
RDEPENDS_${KERNEL_PACKAGE_NAME}-base ?= ""
|
RDEPENDS_${KERNEL_PACKAGE_NAME}-base ?= ""
|
||||||
|
|
||||||
|
# Until we don't move to use the kea dhcp-server we build dhcp_4.4.2.bb recipe
|
||||||
|
# which depends on bind_9.11.22.bb recipe.
|
||||||
|
PREFERRED_VERSION_bind ?= "9.11%"
|
||||||
|
|
||||||
# Require extra machine specific settings from meta-arm-bsp dynamic-layers only
|
# Require extra machine specific settings from meta-arm-bsp dynamic-layers only
|
||||||
# if meta-arm-bsp is in the bblayers.conf
|
# if meta-arm-bsp is in the bblayers.conf
|
||||||
# Directory for meta-arm-autonomy/dynamic-layers/meta-arm-bsp machine extra settings
|
# Directory for meta-arm-autonomy/dynamic-layers/meta-arm-bsp machine extra settings
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ LAYERDEPENDS_meta-arm-autonomy = " \
|
|||||||
core \
|
core \
|
||||||
yocto \
|
yocto \
|
||||||
openembedded-layer \
|
openembedded-layer \
|
||||||
networking-layer \
|
|
||||||
virtualization-layer \
|
virtualization-layer \
|
||||||
"
|
"
|
||||||
LAYERSERIES_COMPAT_meta-arm-autonomy = "gatesgarth"
|
LAYERSERIES_COMPAT_meta-arm-autonomy = "gatesgarth"
|
||||||
|
|||||||
@@ -1,195 +0,0 @@
|
|||||||
arm-autonomy Multiconfig Build Environment Instructions
|
|
||||||
==================
|
|
||||||
|
|
||||||
This documentation explains how to simplify the process of building hosts
|
|
||||||
and guests in a single bitbake command, rather than in seperate build
|
|
||||||
folders. You can read more about multiconfig in the bitbake documentation:
|
|
||||||
|
|
||||||
- [bitbake user manual](https://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user-manual.html)
|
|
||||||
|
|
||||||
To achieve a multiconfig build, a number of different config files need to
|
|
||||||
be created in a single build directory.
|
|
||||||
|
|
||||||
Create a new project
|
|
||||||
----------------
|
|
||||||
|
|
||||||
Before you start, you will need to follow the instructions in
|
|
||||||
"Create a project" from the quickstart guide, to create a new project
|
|
||||||
directory with
|
|
||||||
```
|
|
||||||
oe-init-build-env my-mc-project
|
|
||||||
```
|
|
||||||
Ensure it has all the required layers in bblayers.conf as listed in
|
|
||||||
`arm-autonomy-quickstart.md`. The result should be a directory containing:
|
|
||||||
|
|
||||||
```
|
|
||||||
-- conf
|
|
||||||
| -- bblayers.conf
|
|
||||||
| -- local.conf
|
|
||||||
| -- templateconf.cfg
|
|
||||||
```
|
|
||||||
|
|
||||||
Add multiconfig
|
|
||||||
----------------
|
|
||||||
|
|
||||||
Here are the steps required to make the project build both the host and any
|
|
||||||
number of guests as required.
|
|
||||||
|
|
||||||
1. Create a new directory under `conf/` named `multiconfig/`
|
|
||||||
|
|
||||||
2. Create two new files in this directory:
|
|
||||||
`multiconfig/host.conf`
|
|
||||||
`multiconfig/guest.conf`
|
|
||||||
These files will contain any configurations that a specific to either the
|
|
||||||
host or the guest
|
|
||||||
|
|
||||||
```
|
|
||||||
-- conf
|
|
||||||
| -- bblayers.conf
|
|
||||||
| -- local.conf
|
|
||||||
| -- templateconf.cfg
|
|
||||||
| -- multiconfig
|
|
||||||
| -- host.conf
|
|
||||||
| -- guest.conf
|
|
||||||
```
|
|
||||||
|
|
||||||
3. In `local.conf` the following config variables must be added:
|
|
||||||
|
|
||||||
```
|
|
||||||
MACHINE ?= "fvp-base"
|
|
||||||
|
|
||||||
# ---Guest Config Start--- #
|
|
||||||
MC_GUEST = "guest"
|
|
||||||
|
|
||||||
MC_GUEST_NAME = "guest1"
|
|
||||||
|
|
||||||
MC_GUEST_IMAGERECIPE = "core-image-minimal"
|
|
||||||
MC_GUEST_MACHINE = "arm64-autonomy-guest"
|
|
||||||
|
|
||||||
MC_GUEST_INITRAMFS_IMAGE_BUNDLE ?= ""
|
|
||||||
MC_GUEST_INITRAMFS_IMAGE ?= ""
|
|
||||||
|
|
||||||
# Uncomment for initramfs
|
|
||||||
#MC_GUEST_INITRAMFS_IMAGE_BUNDLE = "1"
|
|
||||||
#MC_GUEST_INITRAMFS_IMAGE = "${MC_GUEST_IMAGERECIPE}"
|
|
||||||
|
|
||||||
# These variables are set automatically, don't edit them!
|
|
||||||
MC_GUEST_FILENAME_PREFIX = "${@ 'Image-initramfs' if d.getVar('MC_GUEST_INITRAMFS_IMAGE_BUNDLE',d) else '${MC_GUEST_IMAGERECIPE}' }"
|
|
||||||
|
|
||||||
MC_GUEST_FILENAME = "${MC_GUEST_FILENAME_PREFIX}-${MC_GUEST_MACHINE}.xenguest"
|
|
||||||
|
|
||||||
MC_GUEST_DEP = "${@ 'virtual/kernel:do_deploy' if d.getVar('MC_GUEST_INITRAMFS_IMAGE_BUNDLE',d) else '${MC_GUEST_IMAGERECIPE}:do_image_complete'}"
|
|
||||||
|
|
||||||
MC_DOIMAGE_MCDEPENDS += "mc:${MC_HOST}:${MC_GUEST}:${MC_GUEST_DEP} "
|
|
||||||
|
|
||||||
BBMULTICONFIG += "${MC_GUEST} "
|
|
||||||
|
|
||||||
ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS += "file://${TOPDIR}/${MC_GUEST}/deploy/images/${MC_GUEST_MACHINE}/${MC_GUEST_FILENAME};guestname=${MC_GUEST_NAME} "
|
|
||||||
# ---Guest Config End--- #
|
|
||||||
|
|
||||||
# ---Host Config Start--- #
|
|
||||||
MC_HOST = "host"
|
|
||||||
|
|
||||||
BBMULTICONFIG += "${MC_HOST} "
|
|
||||||
# ---Host Config End--- #
|
|
||||||
```
|
|
||||||
|
|
||||||
These variables will be used in both of the multiconf files. `MC_HOST` and
|
|
||||||
`MC_GUEST` should not be altered without renaming the conf files, but most
|
|
||||||
`MC_GUEST_*` variables can be customised if you desire.
|
|
||||||
|
|
||||||
4. Next set the contents of `multiconfig/guest.conf`:
|
|
||||||
|
|
||||||
```
|
|
||||||
TMPDIR = "${TOPDIR}/${MC_GUEST}"
|
|
||||||
|
|
||||||
MACHINE = "${MC_GUEST_MACHINE}"
|
|
||||||
DISTRO_FEATURES += " arm-autonomy-guest"
|
|
||||||
|
|
||||||
INITRAMFS_IMAGE_BUNDLE = "${MC_GUEST_INITRAMFS_IMAGE_BUNDLE}"
|
|
||||||
INITRAMFS_IMAGE = "${MC_GUEST_INITRAMFS_IMAGE}"
|
|
||||||
|
|
||||||
IMAGE_FSTYPES += "${@ 'cpio' if d.getVar('MC_GUEST_INITRAMFS_IMAGE_BUNDLE',d) else ''}"
|
|
||||||
|
|
||||||
# ANY OTHER GUEST CONFIG
|
|
||||||
```
|
|
||||||
|
|
||||||
This contents shouldn't be changed directly, rather change the equivalent
|
|
||||||
config in local.conf. You can append any other config desired for the
|
|
||||||
guest at this point, for example `XENGUEST_IMAGE_DISK_SIZE`
|
|
||||||
|
|
||||||
Make sure not to change `${DEPLOY_DIR_IMAGE}` to anything other than
|
|
||||||
`${TMPDIR}/deploy/images`, as this is assumed by local.conf.
|
|
||||||
|
|
||||||
5. Lastly set the contents of `multiconfig/host.conf`:
|
|
||||||
|
|
||||||
```
|
|
||||||
TMPDIR = "${TOPDIR}/${MC_HOST}"
|
|
||||||
|
|
||||||
DISTRO_FEATURES += " arm-autonomy-host"
|
|
||||||
```
|
|
||||||
|
|
||||||
Building the image
|
|
||||||
----------------
|
|
||||||
|
|
||||||
To build the multiconfig image the command is:
|
|
||||||
```
|
|
||||||
bitbake mc:host:arm-autonomy-host-image-minimal
|
|
||||||
```
|
|
||||||
|
|
||||||
You should see that this triggers guest tasks to be built in
|
|
||||||
parallel. Once the build completes the guest will already be in the
|
|
||||||
rootfs of the host thanks to `ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUEST`
|
|
||||||
|
|
||||||
The deployed image including the guest will be in `host/deploy/images/`
|
|
||||||
|
|
||||||
|
|
||||||
Multiple Guests
|
|
||||||
----------------
|
|
||||||
|
|
||||||
To have multiple guests with the same config the line which appends to
|
|
||||||
`ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUEST` just needs to be duplicated with
|
|
||||||
a different guestname.
|
|
||||||
|
|
||||||
To have different config for each guest, each will need its own config
|
|
||||||
file similar to guest.conf, ensuring TMPDIR is set to a different path,
|
|
||||||
and everything between `---Guest Config Start---` and
|
|
||||||
`---Guest Config End---` will need to be duplicated.
|
|
||||||
|
|
||||||
Any copies of variables that start `MC_GUEST` must be altered to avoid
|
|
||||||
collisions (e.g. `MC_GUEST_2_*`), and the name of the conf file must also
|
|
||||||
be added to BBMULTICONFIG.
|
|
||||||
|
|
||||||
|
|
||||||
Guest with provisioned disk
|
|
||||||
----------------
|
|
||||||
|
|
||||||
To add guest rootfs partition to host wic image,
|
|
||||||
set `AUTONOMY_HOST_EXTRA_PARTITION` with proper wks partition entry, e.g:
|
|
||||||
|
|
||||||
```
|
|
||||||
AUTONOMY_HOST_EXTRA_PARTITION = "part --label provisioned-guest --source rawcopy --fstype=ext4 --ondisk sda --align 1024 \
|
|
||||||
--sourceparams=file=${TOPDIR}/${MC_GUEST}/deploy/images/${MC_GUEST_MACHINE}/${MC_GUEST_FILENAME_PREFIX}-${MC_GUEST_MACHINE}.ext4"
|
|
||||||
```
|
|
||||||
|
|
||||||
inside host.conf file.
|
|
||||||
|
|
||||||
The rest of the configuration has to be appended to guest.conf file:
|
|
||||||
|
|
||||||
```
|
|
||||||
XENGUEST_IMAGE_DISK_SIZE = "0"
|
|
||||||
XENGUEST_IMAGE_SRC_URI_XEN_CONFIG = "file://\${TOPDIR}/path/to/rootdisk.cfg"
|
|
||||||
XENGUEST_IMAGE_DISK_DEVICE = "_GUEST_DISK_DEVICE_"
|
|
||||||
XENGUEST_IMAGE_ROOT = "/dev/xvda"
|
|
||||||
IMAGE_ROOTFS_SIZE = "102400"
|
|
||||||
IMAGE_FSTYPES = "ext4"
|
|
||||||
```
|
|
||||||
|
|
||||||
content of rootdisk.cfg"
|
|
||||||
|
|
||||||
```
|
|
||||||
disk = ["phy:_GUEST_DISK_DEVICE_,xvda,w"]
|
|
||||||
```
|
|
||||||
|
|
||||||
`_GUEST_DISK_DEVICE_` should be substituted with `/dev/sdaX`,
|
|
||||||
according to wks file.
|
|
||||||
@@ -26,6 +26,7 @@ First you must download the Yocto layers needed:
|
|||||||
- [poky](https://git.yoctoproject.org/poky)
|
- [poky](https://git.yoctoproject.org/poky)
|
||||||
- [meta-virtualization](https://git.yoctoproject.org/meta-virtualization)
|
- [meta-virtualization](https://git.yoctoproject.org/meta-virtualization)
|
||||||
- [meta-arm](https://git.yoctoproject.org/meta-arm)
|
- [meta-arm](https://git.yoctoproject.org/meta-arm)
|
||||||
|
- [meta-kernel](https://gitlab.com/openembedded/community/meta-kernel.git)
|
||||||
- all other layers you might want to use
|
- all other layers you might want to use
|
||||||
|
|
||||||
For each of the downloaded layer make sure you checkout the release of Yocto
|
For each of the downloaded layer make sure you checkout the release of Yocto
|
||||||
@@ -56,6 +57,7 @@ Here are the main steps to create an arm-autonomy project:
|
|||||||
bitbake-layers add-layer $LAYERDIR_BASE/meta-poky $LAYERDIR_BASE/meta-yocto-bsp \
|
bitbake-layers add-layer $LAYERDIR_BASE/meta-poky $LAYERDIR_BASE/meta-yocto-bsp \
|
||||||
$LAYERDIR_BASE/meta-openembedded/meta-oe $LAYERDIR_BASE/meta-openembedded/meta-python \
|
$LAYERDIR_BASE/meta-openembedded/meta-oe $LAYERDIR_BASE/meta-openembedded/meta-python \
|
||||||
$LAYERDIR_BASE/meta-openembedded/meta-filesystems $LAYERDIR_BASE/meta-openembedded/meta-networking \
|
$LAYERDIR_BASE/meta-openembedded/meta-filesystems $LAYERDIR_BASE/meta-openembedded/meta-networking \
|
||||||
|
$LAYERDIR_BASE/meta-virtualization $LAYERDIR_BASE/meta-kernel \
|
||||||
$LAYERDIR_BASE/meta-arm/meta-arm $LAYERDIR_BASE/meta-arm/meta-arm-toolchain \
|
$LAYERDIR_BASE/meta-arm/meta-arm $LAYERDIR_BASE/meta-arm/meta-arm-toolchain \
|
||||||
$LAYERDIR_BASE/meta-arm/meta-arm-bsp $LAYERDIR_BASE/meta-arm/meta-arm-autonomy \
|
$LAYERDIR_BASE/meta-arm/meta-arm-bsp $LAYERDIR_BASE/meta-arm/meta-arm-autonomy \
|
||||||
```
|
```
|
||||||
@@ -71,6 +73,7 @@ Here are the main steps to create an arm-autonomy project:
|
|||||||
/home/user/arm-autonomy/meta-openembedded/meta-filesystems \
|
/home/user/arm-autonomy/meta-openembedded/meta-filesystems \
|
||||||
/home/user/arm-autonomy/meta-openembedded/meta-networking \
|
/home/user/arm-autonomy/meta-openembedded/meta-networking \
|
||||||
/home/user/arm-autonomy/meta-virtualization \
|
/home/user/arm-autonomy/meta-virtualization \
|
||||||
|
/home/user/arm-autonomy/meta-kernel \
|
||||||
/home/user/arm-autonomy/meta-arm/meta-arm \
|
/home/user/arm-autonomy/meta-arm/meta-arm \
|
||||||
/home/user/arm-autonomy/meta-arm/meta-arm-toolchain \
|
/home/user/arm-autonomy/meta-arm/meta-arm-toolchain \
|
||||||
/home/user/arm-autonomy/meta-arm/meta-arm-bsp \
|
/home/user/arm-autonomy/meta-arm/meta-arm-bsp \
|
||||||
@@ -119,10 +122,6 @@ To boot the system using an u-boot base board you will need to:
|
|||||||
|
|
||||||
In this example the addresses might need to be adapted depending on your board.
|
In this example the addresses might need to be adapted depending on your board.
|
||||||
|
|
||||||
For arm-autonomy host on FVP-Base u-boot has been modified such that
|
|
||||||
`booti 0x84000000 - 0x83000000` is the default boot command. If FVP-Base is your
|
|
||||||
MACHINE target there should be no need to interfere with u-boot.
|
|
||||||
|
|
||||||
Guest project
|
Guest project
|
||||||
-------------
|
-------------
|
||||||
The guest projects are not target specific and will use a Yocto MACHINE defined
|
The guest projects are not target specific and will use a Yocto MACHINE defined
|
||||||
@@ -148,9 +147,6 @@ To create a guest project:
|
|||||||
The build will create a ".xenguest" image that can be use on an host project
|
The build will create a ".xenguest" image that can be use on an host project
|
||||||
with the xenguest-manager.
|
with the xenguest-manager.
|
||||||
|
|
||||||
The guest can also be built as a 'multiconfig' sub project of the host, see
|
|
||||||
`meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md` for more information
|
|
||||||
|
|
||||||
Include guests directly in the host image
|
Include guests directly in the host image
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
The layer provides a way to directly include in the host project one or several
|
The layer provides a way to directly include in the host project one or several
|
||||||
@@ -213,7 +209,7 @@ and is configuring it by default to use dhcp.
|
|||||||
If you need a different type of configuration you can set
|
If you need a different type of configuration you can set
|
||||||
XENGUEST_NETWORK_BRIDGE_CONFIG in a xenguest-network-bridge.bbappend to use
|
XENGUEST_NETWORK_BRIDGE_CONFIG in a xenguest-network-bridge.bbappend to use
|
||||||
a different file.
|
a different file.
|
||||||
The recipe will look for the file in ${WORKDIR} so you will need to add it to
|
The recipe will look for the file in ${WORKDIR} so you will need to add it to
|
||||||
SRC_URI in your bbappend.
|
SRC_URI in your bbappend.
|
||||||
The recipe will also substitute `###BRIDGE_NAME###` with the bridge name
|
The recipe will also substitute `###BRIDGE_NAME###` with the bridge name
|
||||||
configured in ${XENGUEST_NETWORK_BRIDGE_NAME}.
|
configured in ${XENGUEST_NETWORK_BRIDGE_NAME}.
|
||||||
|
|||||||
@@ -48,16 +48,16 @@ project compilation (those can be set in your project local.conf, for example).
|
|||||||
|
|
||||||
The following parameters are available:
|
The following parameters are available:
|
||||||
|
|
||||||
- XENGUEST_MANAGER_VOLUME_DEVICE: This is the device path used by the
|
- XENGUEST_MANAGER_VOLUME_DEVICE: This is the device path used by the
|
||||||
xenguest-manager on the device to create LVM disks when guests have a disk
|
xenguest-manager on the device to create LVM disks when guests have a disk
|
||||||
configuration.
|
configuration.
|
||||||
This is set by default to "/dev/sda2".
|
This is set by default to "/dev/sda2".
|
||||||
|
|
||||||
- XENGUEST_MANAGER_VOLUME_NAME: This is the LVM volume name that the
|
- XENGUEST_MANAGER_VOLUME_NAME: This is the LVM volume name that the
|
||||||
xenguest-manager will create and use to create guest LVM disks.
|
xenguest-manager will create and use to create guest LVM disks.
|
||||||
This is set by default to "vg-xen".
|
This is set by default to "vg-xen".
|
||||||
|
|
||||||
- XENGUEST_MANAGER_GUEST_DIR: This is the directory on Dom0 where the
|
- XENGUEST_MANAGER_GUEST_DIR: This is the directory on Dom0 where the
|
||||||
xenguest-manager will look for xenguest images to create during init. That's
|
xenguest-manager will look for xenguest images to create during init. That's
|
||||||
the place where xenguest images can be added to have them automatically
|
the place where xenguest images can be added to have them automatically
|
||||||
created during next Dom0 boot. The xenguests found there will only be created
|
created during next Dom0 boot. The xenguests found there will only be created
|
||||||
@@ -65,37 +65,3 @@ The following parameters are available:
|
|||||||
name).
|
name).
|
||||||
This is set by default to "/usr/share/guests".
|
This is set by default to "/usr/share/guests".
|
||||||
|
|
||||||
Init scripts
|
|
||||||
------------
|
|
||||||
|
|
||||||
Shell scripts can be executed on the host when a guest is started. Depending on
|
|
||||||
when the script should be executed it should be installed in a different
|
|
||||||
directory on the target:
|
|
||||||
|
|
||||||
- /etc/xenguest/init.pre : Executed first, prior to guest creation
|
|
||||||
|
|
||||||
- /etc/xenguest/init.d : Executed after guest creation, but before it is started
|
|
||||||
|
|
||||||
- /etc/xenguest/init.post : Executed after starting the guest
|
|
||||||
|
|
||||||
Inside the directory, scripts will be executed in alphabetical order.
|
|
||||||
|
|
||||||
Since these scripts are sourced by xenguest-manager they can acccess functions
|
|
||||||
and variables from the parent file's scope, including:
|
|
||||||
|
|
||||||
- ${guestname} : The name of the guest being created
|
|
||||||
|
|
||||||
- ${guestdir} : The path to the guest directory
|
|
||||||
|
|
||||||
- ${guestcfgfile} : The name of the config file for the starting guest
|
|
||||||
|
|
||||||
- ${LOGFILE} : The file to append any logging to, e.g.
|
|
||||||
echo "Hello, World" >> ${LOGFILE}
|
|
||||||
|
|
||||||
Sourcing also allows the script to access params.cfg.
|
|
||||||
|
|
||||||
|
|
||||||
An example of how to create the directory and install an init shell script can
|
|
||||||
be found in:
|
|
||||||
recipes-extended/xenguest/xenguest-network.bb
|
|
||||||
Where network-bridge.sh is installed from network-bridge.sh.in
|
|
||||||
|
|||||||
@@ -12,10 +12,9 @@ At the moment 3 types of network arrangements are provided:
|
|||||||
|
|
||||||
- Bridge: where the guest vif is added to the created bridge interface;
|
- Bridge: where the guest vif is added to the created bridge interface;
|
||||||
|
|
||||||
- NAT: where a private subnet is created for the guest,
|
- NAT: where a private subnet is created for the guest, a dhcpd is started on
|
||||||
a kea dhcp4 server is started on the host to serve the guest
|
the host to serve the guest and the proper iptables rules are created to
|
||||||
and the proper iptables rules are created
|
allow the guest to access the external network;
|
||||||
to allow the guest to access the external network;
|
|
||||||
|
|
||||||
- None: the guest vif is not connected to the bridge.
|
- None: the guest vif is not connected to the bridge.
|
||||||
|
|
||||||
@@ -56,20 +55,17 @@ The following parameters are available:
|
|||||||
contains the dom0 physical interface giving the guest direct access to the
|
contains the dom0 physical interface giving the guest direct access to the
|
||||||
external network.
|
external network.
|
||||||
The **nat** type will setup a private network between dom0 and domU, setup
|
The **nat** type will setup a private network between dom0 and domU, setup
|
||||||
the appropriate routing table, configure and run the kea dhcp4 server
|
the appropriate routing table, configure and run the dhcpd on dom0 to serve
|
||||||
on dom0 to serve the domU and apply the iptables rules to allow the guest
|
the domU and apply the iptables rules to allow the guest to acess the
|
||||||
to acess the external network. The kea dhcp4 server configuration for
|
external network. The dhcpd configuration for the guest can be customised by
|
||||||
the guest can be customised by replacing the
|
replacing the
|
||||||
"meta-arm-autonomy/recipes-extended/xenguest/files/kea-subnet4.json" file
|
"meta-arm-autonomy/recipes-extended/xenguest/files/dhcpd-params.cfg" file
|
||||||
in a xenguest-network.bbappend. The kea-subnet4.json file is installed in
|
in a xenguest-network.bbappend. The dhcpd-params.cfg file is installed in
|
||||||
the xenguest image and copied to
|
the xenguest image and copied to
|
||||||
"/etc/xenguest/guests/${guestname}/files/kea-subnet4.json" when the guest
|
"/etc/xenguest/guests/${guestname}/files/dhcpd-params.cfg" when the guest
|
||||||
image is created. It will be consumed by the
|
image is created. It will be consumed by the
|
||||||
"/etc/xen/scripts/vif-post.d/00-vif-xenguest.hook" script which is called by
|
"/etc/xen/scripts/vif-post.d/00-vif-xenguest.hook" script which is called by
|
||||||
"/etc/xen/scripts/vif-nat" script when starting/stopping the xenguest.
|
"/etc/xen/scripts/vif-nat" script when starting/stopping the xenguest.
|
||||||
After guest start, "/etc/xenguest/init.post/xenguest-network-init-post.sh"
|
|
||||||
script is called to reload kea dhcp4 server with updated configuration,
|
|
||||||
after virtual network interface is ready.
|
|
||||||
In the guest project, the NAT port forward can be customised by changing
|
In the guest project, the NAT port forward can be customised by changing
|
||||||
the XENGUEST_IMAGE_HOST_PORT (default: "1000 + ${domid}") and
|
the XENGUEST_IMAGE_HOST_PORT (default: "1000 + ${domid}") and
|
||||||
XENGUEST_IMAGE_GUEST_PORT (default: "22") variables in local.conf or
|
XENGUEST_IMAGE_GUEST_PORT (default: "22") variables in local.conf or
|
||||||
|
|||||||
@@ -1,26 +1,4 @@
|
|||||||
# Extra machine settings for juno
|
# Extra machine settings for juno
|
||||||
KERNEL_ALT_IMAGETYPE = "Image.lzma"
|
|
||||||
|
|
||||||
# Juno board has 2 network interfaces, add both of them to the bridge
|
# Juno board has 2 network interfaces, add both of them to the bridge
|
||||||
XENGUEST_NETWORK_BRIDGE_MEMBERS ?= "eth0 eth1"
|
XENGUEST_NETWORK_BRIDGE_MEMBERS ?= "eth0 eth1"
|
||||||
XEN_DEVICETREE_DOM0_SIZE ?= "0x02400000"
|
|
||||||
|
|
||||||
# We need to extend the wks search path to be able to find the wks file set in
|
|
||||||
# ARM_AUTONOMY_WKS_FILE.
|
|
||||||
WKS_SEARCH_PATH_prepend := "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic:"
|
|
||||||
|
|
||||||
ARM_AUTONOMY_WKS_FILE ?= "arm-autonomy-juno-disk.wks.in"
|
|
||||||
# set wks file only if INITRAMFS_IMAGE_BUNDLE is not set
|
|
||||||
WKS_FILE = "${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', '',\
|
|
||||||
'${ARM_AUTONOMY_WKS_FILE}', d)}"
|
|
||||||
|
|
||||||
# Set the wks guest partition size and unit. It must be aligned with the sum of
|
|
||||||
# all XENGUEST_IMAGE_DISK_SIZE set for the guests. By default, LVM2 metadata is
|
|
||||||
# 1 MiB per physical volume, hence it needs to be taken into account when
|
|
||||||
# setting GUEST_PART_SIZE. The XENGUEST_IMAGE_DISK_SIZE default value is 4GiB.
|
|
||||||
GUEST_PART_SIZE ?= "4097"
|
|
||||||
GUEST_PART_SIZE_UNIT ?= "M"
|
|
||||||
|
|
||||||
# set wic image type only if INITRAMFS_IMAGE_BUNDLE is not set
|
|
||||||
IMAGE_FSTYPES += "${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', '',\
|
|
||||||
'wic wic.gz wic.bmap', d)}"
|
|
||||||
|
|||||||
+4
-33
@@ -4,19 +4,6 @@ OVERRIDES_append = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ':xen', '', d
|
|||||||
|
|
||||||
FILESEXTRAPATHS_prepend_xen := "${THISDIR}/${PN}:"
|
FILESEXTRAPATHS_prepend_xen := "${THISDIR}/${PN}:"
|
||||||
|
|
||||||
DEPENDS_append_xen = " dos2unix-native"
|
|
||||||
|
|
||||||
SRC_URI_append_xen = " file://add-xen-support.patch;patchdir=../"
|
|
||||||
|
|
||||||
do_install_append_xen() {
|
|
||||||
mv -v ${D}/${UNPACK_DIR}/SOFTWARE/uEnv.txt \
|
|
||||||
${D}/${UNPACK_DIR}/SOFTWARE/uenvfile
|
|
||||||
for dir in $(ls ${D}/${UNPACK_DIR}/SITE1/)
|
|
||||||
do
|
|
||||||
unix2dos ${D}/${UNPACK_DIR}/SITE1/${dir}/images.txt
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
DEPLOY_EXTRA_DEPS ??= ""
|
DEPLOY_EXTRA_DEPS ??= ""
|
||||||
DEPLOY_EXTRA_DEPS_xen = "xen:do_deploy xen-devicetree:do_deploy"
|
DEPLOY_EXTRA_DEPS_xen = "xen:do_deploy xen-devicetree:do_deploy"
|
||||||
|
|
||||||
@@ -27,24 +14,8 @@ do_deploy_prepend_xen() {
|
|||||||
# xen:do_deploy and xen-devicetree:do_deploy when
|
# xen:do_deploy and xen-devicetree:do_deploy when
|
||||||
# INITRAMFS_IMAGE_BUNDLE = "1", we need to handle the xen and
|
# INITRAMFS_IMAGE_BUNDLE = "1", we need to handle the xen and
|
||||||
# xen-devicetree binaries copying in the do_deploy task.
|
# xen-devicetree binaries copying in the do_deploy task.
|
||||||
|
cp ${DEPLOY_DIR_IMAGE}/xen-${COMPATIBLE_MACHINE}.efi \
|
||||||
mkdir -p ${D}/${UNPACK_DIR}/SOFTWARE/XEN
|
${D}/${UNPACK_DIR}/SOFTWARE/xen
|
||||||
cp -v ${DEPLOY_DIR_IMAGE}/xen-${COMPATIBLE_MACHINE}.efi \
|
cp ${DEPLOY_DIR_IMAGE}/*xen.dtb \
|
||||||
${D}/${UNPACK_DIR}/SOFTWARE/XEN/xen
|
${D}/${UNPACK_DIR}/SOFTWARE/
|
||||||
|
|
||||||
for dtb in $(basename -s .dtb ${KERNEL_DEVICETREE})
|
|
||||||
do
|
|
||||||
cp -v ${DEPLOY_DIR_IMAGE}/${dtb}-xen.dtb \
|
|
||||||
${D}/${UNPACK_DIR}/SOFTWARE/XEN/${dtb}.dtb
|
|
||||||
done
|
|
||||||
|
|
||||||
bbnote "Xen binaries added under SOFTWARE/XEN directory"
|
|
||||||
|
|
||||||
if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" -a "${KERNEL_ALT_IMAGETYPE}" = "Image.lzma" ]; then
|
|
||||||
# KERNEL_ALT_IMAGETYPE is expected to be Image.lzma,
|
|
||||||
# however NOR flash filesystem is DOS compatible with 8.3 naming,
|
|
||||||
# so we need to replace ".lzma" with ".lzm"
|
|
||||||
cp -L -f ${DEPLOY_DIR_IMAGE}/${KERNEL_ALT_IMAGETYPE} \
|
|
||||||
${D}/${UNPACK_DIR}/SOFTWARE/Image.lzm
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|||||||
-173
@@ -1,173 +0,0 @@
|
|||||||
arm-bsp/firmware-image-juno: add xen support
|
|
||||||
|
|
||||||
This patch adds xen and dtbs binaries entries to images-r[012].txt files.
|
|
||||||
These images-r[012].txt files contain NOR filesystem entries details,
|
|
||||||
like file offset, name, path etc.
|
|
||||||
|
|
||||||
It also adds customization for uEnv.txt file, that allows to autoboot xen.
|
|
||||||
|
|
||||||
Upstream-Status: Inappropriate [configuration]
|
|
||||||
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
|
|
||||||
|
|
||||||
diff -u a/images-r0.txt b/images-r0.txt
|
|
||||||
--- a/images-r0.txt 2020-11-25 20:25:38.677687712 +0100
|
|
||||||
+++ b/images-r0.txt 2020-11-25 20:36:55.482194294 +0100
|
|
||||||
@@ -1,7 +1,7 @@
|
|
||||||
TITLE: Versatile Express Images Configuration File
|
|
||||||
|
|
||||||
[IMAGES]
|
|
||||||
-TOTALIMAGES: 10 ;Number of Images (Max: 32)
|
|
||||||
+TOTALIMAGES: 11 ;Number of Images (Max: 32)
|
|
||||||
|
|
||||||
NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
|
||||||
NOR0ADDRESS: 0x00000000 ;Image Flash Address
|
|
||||||
@@ -17,14 +17,14 @@
|
|
||||||
|
|
||||||
NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
|
||||||
NOR2ADDRESS: 0x00500000 ;Image Flash Address
|
|
||||||
-NOR2FILE: \SOFTWARE\Image ;Image File Name
|
|
||||||
-NOR2NAME: norkern ;Rename kernel to norkern
|
|
||||||
+NOR2FILE: \SOFTWARE\Image.lzm ;Image File Name
|
|
||||||
+NOR2NAME: norkern.lzm ;Rename kernel to norkern.lzm
|
|
||||||
NOR2LOAD: 00000000 ;Image Load Address
|
|
||||||
NOR2ENTRY: 00000000 ;Image Entry Point
|
|
||||||
|
|
||||||
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
|
||||||
NOR3ADDRESS: 0x02900000 ;Image Flash Address
|
|
||||||
-NOR3FILE: \SOFTWARE\juno.dtb ;Image File Name
|
|
||||||
+NOR3FILE: \SOFTWARE\XEN\juno.dtb ;Image File Name
|
|
||||||
NOR3NAME: board.dtb ;Specify target filename to preserve file extension
|
|
||||||
NOR3LOAD: 00000000 ;Image Load Address
|
|
||||||
NOR3ENTRY: 00000000 ;Image Entry Point
|
|
||||||
@@ -64,8 +64,13 @@
|
|
||||||
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
|
||||||
NOR9ADDRESS: 0x02A80000 ;Image Flash Address
|
|
||||||
NOR9NAME: uEnv.txt
|
|
||||||
-NOR9FILE: \SOFTWARE\uEnv.txt ;Image File Name
|
|
||||||
+NOR9FILE: \SOFTWARE\uenvfile ;Image File Name
|
|
||||||
NOR9LOAD: 00000000 ;Image Load Address
|
|
||||||
NOR9ENTRY: 00000000 ;Image Entry Point
|
|
||||||
|
|
||||||
-
|
|
||||||
+NOR10UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
|
||||||
+NOR10ADDRESS: 0x03000000 ;Image Flash Address
|
|
||||||
+NOR10FILE: \SOFTWARE\XEN\xen ;Image File Name
|
|
||||||
+NOR10NAME: xen
|
|
||||||
+NOR10LOAD: 00000000 ;Image Load Address
|
|
||||||
+NOR10ENTRY: 00000000 ;Image Entry Point
|
|
||||||
diff -u a/images-r1.txt b/images-r1.txt
|
|
||||||
--- a/images-r1.txt 2020-11-25 20:40:19.005177152 +0100
|
|
||||||
+++ b/images-r1.txt 2020-11-25 20:41:17.500886263 +0100
|
|
||||||
@@ -1,7 +1,7 @@
|
|
||||||
TITLE: Versatile Express Images Configuration File
|
|
||||||
|
|
||||||
[IMAGES]
|
|
||||||
-TOTALIMAGES: 10 ;Number of Images (Max: 32)
|
|
||||||
+TOTALIMAGES: 11 ;Number of Images (Max: 32)
|
|
||||||
|
|
||||||
NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
|
||||||
NOR0ADDRESS: 0x00000000 ;Image Flash Address
|
|
||||||
@@ -17,14 +17,14 @@
|
|
||||||
|
|
||||||
NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
|
||||||
NOR2ADDRESS: 0x00500000 ;Image Flash Address
|
|
||||||
-NOR2FILE: \SOFTWARE\Image ;Image File Name
|
|
||||||
-NOR2NAME: norkern ;Rename kernel to norkern
|
|
||||||
+NOR2FILE: \SOFTWARE\Image.lzm ;Image File Name
|
|
||||||
+NOR2NAME: norkern.lzm ;Rename kernel to norkern.lzm
|
|
||||||
NOR2LOAD: 00000000 ;Image Load Address
|
|
||||||
NOR2ENTRY: 00000000 ;Image Entry Point
|
|
||||||
|
|
||||||
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
|
||||||
NOR3ADDRESS: 0x02900000 ;Image Flash Address
|
|
||||||
-NOR3FILE: \SOFTWARE\juno-r1.dtb ;Image File Name
|
|
||||||
+NOR3FILE: \SOFTWARE\XEN\juno-r1.dtb ;Image File Name
|
|
||||||
NOR3NAME: board.dtb ;Specify target filename to preserve file extension
|
|
||||||
NOR3LOAD: 00000000 ;Image Load Address
|
|
||||||
NOR3ENTRY: 00000000 ;Image Entry Point
|
|
||||||
@@ -64,8 +64,13 @@
|
|
||||||
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
|
||||||
NOR9ADDRESS: 0x02A80000 ;Image Flash Address
|
|
||||||
NOR9NAME: uEnv.txt
|
|
||||||
-NOR9FILE: \SOFTWARE\uEnv.txt ;Image File Name
|
|
||||||
+NOR9FILE: \SOFTWARE\uenvfile ;Image File Name
|
|
||||||
NOR9LOAD: 00000000 ;Image Load Address
|
|
||||||
NOR9ENTRY: 00000000 ;Image Entry Point
|
|
||||||
|
|
||||||
-
|
|
||||||
+NOR10UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
|
||||||
+NOR10ADDRESS: 0x03000000 ;Image Flash Address
|
|
||||||
+NOR10FILE: \SOFTWARE\XEN\xen ;Image File Name
|
|
||||||
+NOR10NAME: xen
|
|
||||||
+NOR10LOAD: 00000000 ;Image Load Address
|
|
||||||
+NOR10ENTRY: 00000000 ;Image Entry Point
|
|
||||||
diff -u a/images-r2.txt b/images-r2.txt
|
|
||||||
--- a/images-r2.txt 2020-11-25 20:40:30.625119321 +0100
|
|
||||||
+++ b/images-r2.txt 2020-11-25 20:41:30.720820597 +0100
|
|
||||||
@@ -1,7 +1,7 @@
|
|
||||||
TITLE: Versatile Express Images Configuration File
|
|
||||||
|
|
||||||
[IMAGES]
|
|
||||||
-TOTALIMAGES: 10 ;Number of Images (Max: 32)
|
|
||||||
+TOTALIMAGES: 11 ;Number of Images (Max: 32)
|
|
||||||
|
|
||||||
NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
|
||||||
NOR0ADDRESS: 0x00000000 ;Image Flash Address
|
|
||||||
@@ -17,14 +17,14 @@
|
|
||||||
|
|
||||||
NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
|
||||||
NOR2ADDRESS: 0x00500000 ;Image Flash Address
|
|
||||||
-NOR2FILE: \SOFTWARE\Image ;Image File Name
|
|
||||||
-NOR2NAME: norkern ;Rename kernel to norkern
|
|
||||||
+NOR2FILE: \SOFTWARE\Image.lzm ;Image File Name
|
|
||||||
+NOR2NAME: norkern.lzm ;Rename kernel to norkern.lzm
|
|
||||||
NOR2LOAD: 00000000 ;Image Load Address
|
|
||||||
NOR2ENTRY: 00000000 ;Image Entry Point
|
|
||||||
|
|
||||||
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
|
||||||
NOR3ADDRESS: 0x02900000 ;Image Flash Address
|
|
||||||
-NOR3FILE: \SOFTWARE\juno-r2.dtb ;Image File Name
|
|
||||||
+NOR3FILE: \SOFTWARE\XEN\juno-r2.dtb ;Image File Name
|
|
||||||
NOR3NAME: board.dtb ;Specify target filename to preserve file extension
|
|
||||||
NOR3LOAD: 00000000 ;Image Load Address
|
|
||||||
NOR3ENTRY: 00000000 ;Image Entry Point
|
|
||||||
@@ -64,8 +64,13 @@
|
|
||||||
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
|
||||||
NOR9ADDRESS: 0x02A80000 ;Image Flash Address
|
|
||||||
NOR9NAME: uEnv.txt
|
|
||||||
-NOR9FILE: \SOFTWARE\uEnv.txt ;Image File Name
|
|
||||||
+NOR9FILE: \SOFTWARE\uenvfile ;Image File Name
|
|
||||||
NOR9LOAD: 00000000 ;Image Load Address
|
|
||||||
NOR9ENTRY: 00000000 ;Image Entry Point
|
|
||||||
|
|
||||||
-
|
|
||||||
+NOR10UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
|
||||||
+NOR10ADDRESS: 0x03000000 ;Image Flash Address
|
|
||||||
+NOR10FILE: \SOFTWARE\XEN\xen ;Image File Name
|
|
||||||
+NOR10NAME: xen
|
|
||||||
+NOR10LOAD: 00000000 ;Image Load Address
|
|
||||||
+NOR10ENTRY: 00000000 ;Image Entry Point
|
|
||||||
diff -u a/uEnv.txt b/uEnv.txt
|
|
||||||
--- a/uEnv.txt 2020-11-20 13:48:31.845078690 +0100
|
|
||||||
+++ b/uEnv.txt 2020-11-25 20:30:00.572306675 +0100
|
|
||||||
@@ -1,11 +1,16 @@
|
|
||||||
+xen_name=xen
|
|
||||||
+xen_addr=0x84000000
|
|
||||||
uenvcmd=run mybootcmd
|
|
||||||
+kernel_alt_name=norkern.lzm
|
|
||||||
+kernel_comp_addr_r=0x88080000
|
|
||||||
mybootcmd=echo Loading custom boot command; \
|
|
||||||
echo Loading kernel; \
|
|
||||||
afs load ${kernel_name} ${kernel_addr_r} ; \
|
|
||||||
-if test $? -eq 1; then echo Loading ${kernel_alt_name} instead of ${kernel_name}; afs load ${kernel_alt_name} ${kernel_addr_r}; fi; \
|
|
||||||
+if test $? -eq 1; then echo Loading ${kernel_alt_name} instead of ${kernel_name}; afs load ${kernel_alt_name} ${kernel_comp_addr_r}; lzmadec ${kernel_comp_addr_r} ${kernel_addr_r}; fi; \
|
|
||||||
echo Loading device tree; \
|
|
||||||
afs load ${fdtfile} ${fdt_addr_r}; \
|
|
||||||
if test $? -eq 1; then echo Loading ${fdt_alt_name} instead of ${fdtfile}; \
|
|
||||||
afs load ${fdt_alt_name} ${fdt_addr_r}; fi; fdt addr ${fdt_addr_r}; fdt resize; \
|
|
||||||
-booti ${kernel_addr_r} - ${fdt_addr_r};
|
|
||||||
-
|
|
||||||
+echo Loading Xen; \
|
|
||||||
+afs load ${xen_name} ${xen_addr}; \
|
|
||||||
+if test $? -eq 0; then echo Booting Xen; bootefi ${xen_addr} ${fdt_addr_r}; fi;
|
|
||||||
|
|
||||||
+78
@@ -0,0 +1,78 @@
|
|||||||
|
TITLE: Versatile Express Images Configuration File
|
||||||
|
|
||||||
|
[IMAGES]
|
||||||
|
TOTALIMAGES: 11 ;Number of Images (Max: 32)
|
||||||
|
|
||||||
|
NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR0ADDRESS: 0x00000000 ;Image Flash Address
|
||||||
|
NOR0FILE: \SOFTWARE\fip.bin ;Image File Name
|
||||||
|
NOR0LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR0ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR1UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR1ADDRESS: 0x03EC0000 ;Image Flash Address
|
||||||
|
NOR1FILE: \SOFTWARE\bl1.bin ;Image File Name
|
||||||
|
NOR1LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR1ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR2ADDRESS: 0x00500000 ;Image Flash Address
|
||||||
|
NOR2FILE: \SOFTWARE\Image ;Image File Name
|
||||||
|
NOR2NAME: norkern ;Rename kernel to norkern
|
||||||
|
NOR2LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR2ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR3ADDRESS: 0x02700000 ;Image Flash Address
|
||||||
|
NOR3FILE: \SOFTWARE\juno-xen.dtb ;Image File Name
|
||||||
|
NOR3NAME: board.dtb ;Specify target filename to preserve file extension
|
||||||
|
NOR3LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR3ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR4UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR4ADDRESS: 0x01D00000 ;Image Flash Address
|
||||||
|
NOR4FILE: \SOFTWARE\xen ;Image File Name
|
||||||
|
NOR4NAME: xen
|
||||||
|
NOR4LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR4ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR5UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR5ADDRESS: 0x025C0000 ;Image Flash Address
|
||||||
|
NOR5FILE: \SOFTWARE\hdlcdclk.dat ;Image File Name
|
||||||
|
NOR5LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR5ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR6UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR6ADDRESS: 0x03E40000 ;Image Flash Address
|
||||||
|
NOR6FILE: \SOFTWARE\scp_bl1.bin ;Image File Name
|
||||||
|
NOR6LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR6ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR7UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR7ADDRESS: 0x0BF00000 ;Image Flash Address
|
||||||
|
NOR7FILE: \SOFTWARE\startup.nsh ;Image File Name
|
||||||
|
NOR7NAME: startup.nsh
|
||||||
|
NOR7LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR7ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR8UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR8ADDRESS: 0x0BFC0000 ;Image Flash Address
|
||||||
|
NOR8FILE: \SOFTWARE\blank.img ;Image File Name
|
||||||
|
NOR8NAME: BOOTENV
|
||||||
|
NOR8LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR8ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR9ADDRESS: 0x02600000 ;Image Flash Address
|
||||||
|
NOR9FILE: \SOFTWARE\selftest ;Image File Name
|
||||||
|
NOR9LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR9ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR10UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR10ADDRESS: 0x02780000 ;Image Flash Address
|
||||||
|
NOR10NAME: uEnv.txt
|
||||||
|
NOR10FILE: \SOFTWARE\uEnv.txt ;Image File Name
|
||||||
|
NOR10LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR10ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
|
||||||
+78
@@ -0,0 +1,78 @@
|
|||||||
|
TITLE: Versatile Express Images Configuration File
|
||||||
|
|
||||||
|
[IMAGES]
|
||||||
|
TOTALIMAGES: 11 ;Number of Images (Max: 32)
|
||||||
|
|
||||||
|
NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR0ADDRESS: 0x00000000 ;Image Flash Address
|
||||||
|
NOR0FILE: \SOFTWARE\fip.bin ;Image File Name
|
||||||
|
NOR0LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR0ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR1UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR1ADDRESS: 0x03EC0000 ;Image Flash Address
|
||||||
|
NOR1FILE: \SOFTWARE\bl1.bin ;Image File Name
|
||||||
|
NOR1LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR1ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR2ADDRESS: 0x00500000 ;Image Flash Address
|
||||||
|
NOR2FILE: \SOFTWARE\Image ;Image File Name
|
||||||
|
NOR2NAME: norkern ;Rename kernel to norkern
|
||||||
|
NOR2LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR2ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR3ADDRESS: 0x02700000 ;Image Flash Address
|
||||||
|
NOR3FILE: \SOFTWARE\juno-r1-xen.dtb ;Image File Name
|
||||||
|
NOR3NAME: board.dtb ;Specify target filename to preserve file extension
|
||||||
|
NOR3LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR3ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR4UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR4ADDRESS: 0x01D00000 ;Image Flash Address
|
||||||
|
NOR4FILE: \SOFTWARE\xen ;Image File Name
|
||||||
|
NOR4NAME: xen
|
||||||
|
NOR4LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR4ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR5UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR5ADDRESS: 0x025C0000 ;Image Flash Address
|
||||||
|
NOR5FILE: \SOFTWARE\hdlcdclk.dat ;Image File Name
|
||||||
|
NOR5LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR5ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR6UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR6ADDRESS: 0x03E40000 ;Image Flash Address
|
||||||
|
NOR6FILE: \SOFTWARE\scp_bl1.bin ;Image File Name
|
||||||
|
NOR6LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR6ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR7UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR7ADDRESS: 0x0BF00000 ;Image Flash Address
|
||||||
|
NOR7FILE: \SOFTWARE\startup.nsh ;Image File Name
|
||||||
|
NOR7NAME: startup.nsh
|
||||||
|
NOR7LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR7ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR8UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR8ADDRESS: 0x0BFC0000 ;Image Flash Address
|
||||||
|
NOR8FILE: \SOFTWARE\blank.img ;Image File Name
|
||||||
|
NOR8NAME: BOOTENV
|
||||||
|
NOR8LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR8ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR9ADDRESS: 0x02600000 ;Image Flash Address
|
||||||
|
NOR9FILE: \SOFTWARE\selftest ;Image File Name
|
||||||
|
NOR9LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR9ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR10UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR10ADDRESS: 0x02780000 ;Image Flash Address
|
||||||
|
NOR10NAME: uEnv.txt
|
||||||
|
NOR10FILE: \SOFTWARE\uEnv.txt ;Image File Name
|
||||||
|
NOR10LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR10ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
|
||||||
+78
@@ -0,0 +1,78 @@
|
|||||||
|
TITLE: Versatile Express Images Configuration File
|
||||||
|
|
||||||
|
[IMAGES]
|
||||||
|
TOTALIMAGES: 11 ;Number of Images (Max: 32)
|
||||||
|
|
||||||
|
NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR0ADDRESS: 0x00000000 ;Image Flash Address
|
||||||
|
NOR0FILE: \SOFTWARE\fip.bin ;Image File Name
|
||||||
|
NOR0LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR0ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR1UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR1ADDRESS: 0x03EC0000 ;Image Flash Address
|
||||||
|
NOR1FILE: \SOFTWARE\bl1.bin ;Image File Name
|
||||||
|
NOR1LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR1ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR2ADDRESS: 0x00500000 ;Image Flash Address
|
||||||
|
NOR2FILE: \SOFTWARE\Image ;Image File Name
|
||||||
|
NOR2NAME: norkern ;Rename kernel to norkern
|
||||||
|
NOR2LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR2ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR3ADDRESS: 0x02700000 ;Image Flash Address
|
||||||
|
NOR3FILE: \SOFTWARE\juno-r2-xen.dtb ;Image File Name
|
||||||
|
NOR3NAME: board.dtb ;Specify target filename to preserve file extension
|
||||||
|
NOR3LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR3ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR4UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR4ADDRESS: 0x01D00000 ;Image Flash Address
|
||||||
|
NOR4FILE: \SOFTWARE\xen ;Image File Name
|
||||||
|
NOR4NAME: xen
|
||||||
|
NOR4LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR4ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR5UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR5ADDRESS: 0x025C0000 ;Image Flash Address
|
||||||
|
NOR5FILE: \SOFTWARE\hdlcdclk.dat ;Image File Name
|
||||||
|
NOR5LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR5ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR6UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR6ADDRESS: 0x03E40000 ;Image Flash Address
|
||||||
|
NOR6FILE: \SOFTWARE\scp_bl1.bin ;Image File Name
|
||||||
|
NOR6LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR6ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR7UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR7ADDRESS: 0x0BF00000 ;Image Flash Address
|
||||||
|
NOR7FILE: \SOFTWARE\startup.nsh ;Image File Name
|
||||||
|
NOR7NAME: startup.nsh
|
||||||
|
NOR7LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR7ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR8UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR8ADDRESS: 0x0BFC0000 ;Image Flash Address
|
||||||
|
NOR8FILE: \SOFTWARE\blank.img ;Image File Name
|
||||||
|
NOR8NAME: BOOTENV
|
||||||
|
NOR8LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR8ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR9ADDRESS: 0x02600000 ;Image Flash Address
|
||||||
|
NOR9FILE: \SOFTWARE\selftest ;Image File Name
|
||||||
|
NOR9LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR9ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
NOR10UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||||
|
NOR10ADDRESS: 0x02780000 ;Image Flash Address
|
||||||
|
NOR10NAME: uEnv.txt
|
||||||
|
NOR10FILE: \SOFTWARE\uEnv.txt ;Image File Name
|
||||||
|
NOR10LOAD: 00000000 ;Image Load Address
|
||||||
|
NOR10ENTRY: 00000000 ;Image Entry Point
|
||||||
|
|
||||||
|
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
xen_name=xen
|
||||||
|
xen_addr=0x84000000
|
||||||
|
uenvcmd=run mybootcmd
|
||||||
|
mybootcmd=echo Loading custom boot command; \
|
||||||
|
echo Loading kernel; \
|
||||||
|
afs load ${kernel_name} ${kernel_addr} ; \
|
||||||
|
if test $? -eq 1; then echo Loading ${kernel_alt_name} instead of ${kernel_name}; afs load ${kernel_alt_name} ${kernel_addr}; fi; \
|
||||||
|
echo Loading device tree; \
|
||||||
|
afs load ${fdtfile} ${fdt_addr}; \
|
||||||
|
if test $? -eq 1; then echo Loading ${fdt_alt_name} instead of ${fdtfile}; \
|
||||||
|
afs load ${fdt_alt_name} ${fdt_addr}; fi; fdt addr ${fdt_addr}; fdt resize; \
|
||||||
|
echo Loading Xen; \
|
||||||
|
afs load ${xen_name} ${xen_addr}; \
|
||||||
|
if test $? -eq 0; then echo Booting Xen; bootefi ${xen_addr} ${fdt_addr}; fi;
|
||||||
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# short-description: Create a disk image
|
|
||||||
# long-description: Creates a partitioned disk image that the user
|
|
||||||
# can directly dd to boot media.
|
|
||||||
|
|
||||||
# For Juno first partition is rootfs normally populated as /dev/sda1
|
|
||||||
part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024
|
|
||||||
|
|
||||||
# Second partition to accomodate guests images normally populated as /dev/sda2 (used by XENGUEST_MANAGER_VOLUME_DEVICE)
|
|
||||||
part --label guests --source empty --ondisk sda --size="${GUEST_PART_SIZE}${GUEST_PART_SIZE_UNIT}" --system-id 8e --align 1024
|
|
||||||
|
|
||||||
# Third partition is user defined entry normally populated as /dev/sda3
|
|
||||||
${AUTONOMY_HOST_EXTRA_PARTITION}
|
|
||||||
|
|
||||||
bootloader --ptable msdos
|
|
||||||
@@ -11,7 +11,4 @@ part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024
|
|||||||
# Third partition to accomodate guests images normally populated as /dev/sda3 (used by XENGUEST_MANAGER_VOLUME_DEVICE)
|
# Third partition to accomodate guests images normally populated as /dev/sda3 (used by XENGUEST_MANAGER_VOLUME_DEVICE)
|
||||||
part --label guests --source empty --ondisk sda --size="${GUEST_PART_SIZE}${GUEST_PART_SIZE_UNIT}" --system-id 8e --align 1024
|
part --label guests --source empty --ondisk sda --size="${GUEST_PART_SIZE}${GUEST_PART_SIZE_UNIT}" --system-id 8e --align 1024
|
||||||
|
|
||||||
# Fourth partition is user defined entry normally populated as /dev/sda4
|
|
||||||
${AUTONOMY_HOST_EXTRA_PARTITION}
|
|
||||||
|
|
||||||
bootloader --ptable msdos --configfile="${GRUB_CFG_FILE}"
|
bootloader --ptable msdos --configfile="${GRUB_CFG_FILE}"
|
||||||
|
|||||||
-16
@@ -1,16 +0,0 @@
|
|||||||
Upstream Status: Inappropriate [meta-arm-autonomy specifc u-boot config]
|
|
||||||
Signed-off-by: Nathan Dunne <nathan.dunne@arm.com>
|
|
||||||
|
|
||||||
diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h
|
|
||||||
index e63c335f85..9ee050a4a6 100644
|
|
||||||
--- a/include/configs/vexpress_aemv8a.h
|
|
||||||
+++ b/include/configs/vexpress_aemv8a.h
|
|
||||||
@@ -162,7 +162,7 @@
|
|
||||||
#elif CONFIG_TARGET_VEXPRESS64_BASE_FVP
|
|
||||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
|
||||||
"kernel_name=Image\0" \
|
|
||||||
- "kernel_addr=0x80080000\0" \
|
|
||||||
+ "kernel_addr=0x84000000\0" \
|
|
||||||
"initrd_name=ramdisk.img\0" \
|
|
||||||
"initrd_addr=0x88000000\0" \
|
|
||||||
"fdtfile=devtree.dtb\0" \
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# Machine specific u-boot
|
|
||||||
|
|
||||||
FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:"
|
|
||||||
|
|
||||||
#
|
|
||||||
# FVP BASE
|
|
||||||
#
|
|
||||||
|
|
||||||
SRC_URI_append_fvp-base = "${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', ' file://xen_u-boot_kernel_addr.patch', '', d)}"
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
For now, arm-autonomy-host-image-minimal installs the dhcp-server package and
|
||||||
|
the dchp-4.4.2 depends on bind 9.11 which recipe was copied from oe-core tree
|
||||||
|
https://git.openembedded.org/openembedded-core/tree/meta/recipes-connectivity/bind?id=087e4fafeef82cfd3d71402d6b200fe831f48697
|
||||||
|
since it got removed in the https://git.openembedded.org/openembedded-core/commit/meta/recipes-connectivity?id=29949cd7cf3a660fb3bcf251f5127a4cdb2804ec patch.
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
From 31dde3562f287429eea94b77250d184818b49063 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chen Qi <Qi.Chen@windriver.com>
|
||||||
|
Date: Mon, 15 Oct 2018 16:55:09 +0800
|
||||||
|
Subject: [PATCH] avoid start failure with bind user
|
||||||
|
|
||||||
|
Upstream-Status: Pending
|
||||||
|
|
||||||
|
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||||
|
---
|
||||||
|
init.d | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/init.d b/init.d
|
||||||
|
index b2eec60..6e03936 100644
|
||||||
|
--- a/init.d
|
||||||
|
+++ b/init.d
|
||||||
|
@@ -57,6 +57,7 @@ case "$1" in
|
||||||
|
modprobe capability >/dev/null 2>&1 || true
|
||||||
|
if [ ! -f /etc/bind/rndc.key ]; then
|
||||||
|
/usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom
|
||||||
|
+ chown root:bind /etc/bind/rndc.key >/dev/null 2>&1 || true
|
||||||
|
chmod 0640 /etc/bind/rndc.key
|
||||||
|
fi
|
||||||
|
if [ -f /var/run/named/named.pid ]; then
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
From 2325a92f1896a2a7f586611686801b41fbc91b50 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
Date: Mon, 27 Aug 2018 15:00:51 +0800
|
||||||
|
Subject: [PATCH] configure.in: remove useless `-L$use_openssl/lib'
|
||||||
|
|
||||||
|
Since `--with-openssl=${STAGING_DIR_HOST}${prefix}' is used in bind recipe,
|
||||||
|
the `-L$use_openssl/lib' has a hardcoded suffix, removing it is harmless
|
||||||
|
and helpful for clean up host build path in isc-config.sh
|
||||||
|
|
||||||
|
Upstream-Status: Inappropriate [oe-core specific]
|
||||||
|
|
||||||
|
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
|
||||||
|
---
|
||||||
|
configure.ac | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/configure.ac b/configure.ac
|
||||||
|
index e85a5c6..2bbfc58 100644
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -1631,7 +1631,7 @@ If you don't want OpenSSL, use --without-openssl])
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
- DST_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
|
||||||
|
+ DST_OPENSSL_LIBS="-lcrypto"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
From a3af4a405baf5ff582e82aaba392dd9667d94bdc Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
Date: Mon, 27 Aug 2018 21:24:20 +0800
|
||||||
|
Subject: [PATCH] `named/lwresd -V' and start log hide build options
|
||||||
|
|
||||||
|
The build options expose build path directories, so hide them.
|
||||||
|
[snip]
|
||||||
|
$ named -V
|
||||||
|
|built by make with *** (options are hidden)
|
||||||
|
[snip]
|
||||||
|
|
||||||
|
Upstream-Status: Inappropriate [oe-core specific]
|
||||||
|
|
||||||
|
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
---
|
||||||
|
bin/named/include/named/globals.h | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/bin/named/include/named/globals.h b/bin/named/include/named/globals.h
|
||||||
|
index ba3457e..7741da7 100644
|
||||||
|
--- a/bin/named/include/named/globals.h
|
||||||
|
+++ b/bin/named/include/named/globals.h
|
||||||
|
@@ -68,7 +68,7 @@ EXTERN const char * ns_g_version INIT(VERSION);
|
||||||
|
EXTERN const char * ns_g_product INIT(PRODUCT);
|
||||||
|
EXTERN const char * ns_g_description INIT(DESCRIPTION);
|
||||||
|
EXTERN const char * ns_g_srcid INIT(SRCID);
|
||||||
|
-EXTERN const char * ns_g_configargs INIT(CONFIGARGS);
|
||||||
|
+EXTERN const char * ns_g_configargs INIT("*** (options are hidden)");
|
||||||
|
EXTERN const char * ns_g_builder INIT(BUILDER);
|
||||||
|
EXTERN in_port_t ns_g_port INIT(0);
|
||||||
|
EXTERN isc_dscp_t ns_g_dscp INIT(-1);
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
||||||
+47
@@ -0,0 +1,47 @@
|
|||||||
|
From edda20fb5a6e88548f85e39d34d6c074306e15bc Mon Sep 17 00:00:00 2001
|
||||||
|
From: Paul Gortmaker <paul.gortmaker@windriver.com>
|
||||||
|
Date: Tue, 9 Jun 2015 11:22:00 -0400
|
||||||
|
Subject: [PATCH] bind: ensure searching for json headers searches sysroot
|
||||||
|
|
||||||
|
Bind can fail configure by detecting headers w/o libs[1], or
|
||||||
|
it can fail the host contamination check as per below:
|
||||||
|
|
||||||
|
ERROR: This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities.
|
||||||
|
Rerun configure task after fixing this. The path was 'build/tmp/work/core2-64-poky-linux/bind/9.10.2-r1/build'
|
||||||
|
ERROR: Function failed: do_qa_configure
|
||||||
|
ERROR: Logfile of failure stored in: build/tmp/work/core2-64-poky-linux/bind/9.10.2-r1/temp/log.do_configure.5242
|
||||||
|
ERROR: Task 5 (meta/recipes-connectivity/bind/bind_9.10.2.bb, do_configure) failed with exit code '1'
|
||||||
|
NOTE: Tasks Summary: Attempted 773 tasks of which 768 didn't need to be rerun and 1 failed.
|
||||||
|
No currently running tasks (773 of 781)
|
||||||
|
|
||||||
|
Summary: 1 task failed:
|
||||||
|
/meta/recipes-connectivity/bind/bind_9.10.2.bb, do_configure
|
||||||
|
|
||||||
|
One way to fix it would be to unconditionally disable json in bind
|
||||||
|
configure[2] but here we fix it by using the path to where we would
|
||||||
|
put the header if we had json in the sysroot, in case someone wants
|
||||||
|
to make use of the combination some day.
|
||||||
|
|
||||||
|
[1] https://trac.macports.org/ticket/45305
|
||||||
|
[2] https://trac.macports.org/changeset/126406
|
||||||
|
|
||||||
|
Upstream-Status: Inappropriate [OE Specific]
|
||||||
|
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
|
||||||
|
|
||||||
|
---
|
||||||
|
configure.ac | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/configure.ac b/configure.ac
|
||||||
|
index 17392fd..e85a5c6 100644
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -2449,7 +2449,7 @@ case "$use_libjson" in
|
||||||
|
libjson_libs=""
|
||||||
|
;;
|
||||||
|
auto|yes)
|
||||||
|
- for d in /usr /usr/local /opt/local
|
||||||
|
+ for d in "${STAGING_INCDIR}"
|
||||||
|
do
|
||||||
|
if test -f "${d}/include/json/json.h"
|
||||||
|
then
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
# startup options for the server
|
||||||
|
OPTIONS="-u bind"
|
||||||
@@ -0,0 +1,330 @@
|
|||||||
|
Upstream-Status: Inappropriate [configuration]
|
||||||
|
|
||||||
|
the patch is imported from openembedded project
|
||||||
|
|
||||||
|
11/30/2010 - Qing He <qing.he@intel.com>
|
||||||
|
|
||||||
|
diff -urN bind-9.3.1.orig/conf/db.0 bind-9.3.1/conf/db.0
|
||||||
|
--- bind-9.3.1.orig/conf/db.0 1970-01-01 01:00:00.000000000 +0100
|
||||||
|
+++ bind-9.3.1/conf/db.0 2005-07-10 22:14:00.000000000 +0200
|
||||||
|
@@ -0,0 +1,12 @@
|
||||||
|
+;
|
||||||
|
+; BIND reverse data file for broadcast zone
|
||||||
|
+;
|
||||||
|
+$TTL 604800
|
||||||
|
+@ IN SOA localhost. root.localhost. (
|
||||||
|
+ 1 ; Serial
|
||||||
|
+ 604800 ; Refresh
|
||||||
|
+ 86400 ; Retry
|
||||||
|
+ 2419200 ; Expire
|
||||||
|
+ 604800 ) ; Negative Cache TTL
|
||||||
|
+;
|
||||||
|
+@ IN NS localhost.
|
||||||
|
diff -urN bind-9.3.1.orig/conf/db.127 bind-9.3.1/conf/db.127
|
||||||
|
--- bind-9.3.1.orig/conf/db.127 1970-01-01 01:00:00.000000000 +0100
|
||||||
|
+++ bind-9.3.1/conf/db.127 2005-07-10 22:14:00.000000000 +0200
|
||||||
|
@@ -0,0 +1,13 @@
|
||||||
|
+;
|
||||||
|
+; BIND reverse data file for local loopback interface
|
||||||
|
+;
|
||||||
|
+$TTL 604800
|
||||||
|
+@ IN SOA localhost. root.localhost. (
|
||||||
|
+ 1 ; Serial
|
||||||
|
+ 604800 ; Refresh
|
||||||
|
+ 86400 ; Retry
|
||||||
|
+ 2419200 ; Expire
|
||||||
|
+ 604800 ) ; Negative Cache TTL
|
||||||
|
+;
|
||||||
|
+@ IN NS localhost.
|
||||||
|
+1.0.0 IN PTR localhost.
|
||||||
|
diff -urN bind-9.3.1.orig/conf/db.empty bind-9.3.1/conf/db.empty
|
||||||
|
--- bind-9.3.1.orig/conf/db.empty 1970-01-01 01:00:00.000000000 +0100
|
||||||
|
+++ bind-9.3.1/conf/db.empty 2005-07-10 22:14:00.000000000 +0200
|
||||||
|
@@ -0,0 +1,14 @@
|
||||||
|
+; BIND reverse data file for empty rfc1918 zone
|
||||||
|
+;
|
||||||
|
+; DO NOT EDIT THIS FILE - it is used for multiple zones.
|
||||||
|
+; Instead, copy it, edit named.conf, and use that copy.
|
||||||
|
+;
|
||||||
|
+$TTL 86400
|
||||||
|
+@ IN SOA localhost. root.localhost. (
|
||||||
|
+ 1 ; Serial
|
||||||
|
+ 604800 ; Refresh
|
||||||
|
+ 86400 ; Retry
|
||||||
|
+ 2419200 ; Expire
|
||||||
|
+ 86400 ) ; Negative Cache TTL
|
||||||
|
+;
|
||||||
|
+@ IN NS localhost.
|
||||||
|
diff -urN bind-9.3.1.orig/conf/db.255 bind-9.3.1/conf/db.255
|
||||||
|
--- bind-9.3.1.orig/conf/db.255 1970-01-01 01:00:00.000000000 +0100
|
||||||
|
+++ bind-9.3.1/conf/db.255 2005-07-10 22:14:00.000000000 +0200
|
||||||
|
@@ -0,0 +1,12 @@
|
||||||
|
+;
|
||||||
|
+; BIND reserve data file for broadcast zone
|
||||||
|
+;
|
||||||
|
+$TTL 604800
|
||||||
|
+@ IN SOA localhost. root.localhost. (
|
||||||
|
+ 1 ; Serial
|
||||||
|
+ 604800 ; Refresh
|
||||||
|
+ 86400 ; Retry
|
||||||
|
+ 2419200 ; Expire
|
||||||
|
+ 604800 ) ; Negative Cache TTL
|
||||||
|
+;
|
||||||
|
+@ IN NS localhost.
|
||||||
|
diff -urN bind-9.3.1.orig/conf/db.local bind-9.3.1/conf/db.local
|
||||||
|
--- bind-9.3.1.orig/conf/db.local 1970-01-01 01:00:00.000000000 +0100
|
||||||
|
+++ bind-9.3.1/conf/db.local 2005-07-10 22:14:00.000000000 +0200
|
||||||
|
@@ -0,0 +1,13 @@
|
||||||
|
+;
|
||||||
|
+; BIND data file for local loopback interface
|
||||||
|
+;
|
||||||
|
+$TTL 604800
|
||||||
|
+@ IN SOA localhost. root.localhost. (
|
||||||
|
+ 1 ; Serial
|
||||||
|
+ 604800 ; Refresh
|
||||||
|
+ 86400 ; Retry
|
||||||
|
+ 2419200 ; Expire
|
||||||
|
+ 604800 ) ; Negative Cache TTL
|
||||||
|
+;
|
||||||
|
+@ IN NS localhost.
|
||||||
|
+@ IN A 127.0.0.1
|
||||||
|
diff -urN bind-9.3.1.orig/conf/db.root bind-9.3.1/conf/db.root
|
||||||
|
--- bind-9.3.1.orig/conf/db.root 1970-01-01 01:00:00.000000000 +0100
|
||||||
|
+++ bind-9.3.1/conf/db.root 2005-07-10 22:14:00.000000000 +0200
|
||||||
|
@@ -0,0 +1,45 @@
|
||||||
|
+
|
||||||
|
+; <<>> DiG 9.2.3 <<>> ns . @a.root-servers.net.
|
||||||
|
+;; global options: printcmd
|
||||||
|
+;; Got answer:
|
||||||
|
+;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18944
|
||||||
|
+;; flags: qr aa rd; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13
|
||||||
|
+
|
||||||
|
+;; QUESTION SECTION:
|
||||||
|
+;. IN NS
|
||||||
|
+
|
||||||
|
+;; ANSWER SECTION:
|
||||||
|
+. 518400 IN NS A.ROOT-SERVERS.NET.
|
||||||
|
+. 518400 IN NS B.ROOT-SERVERS.NET.
|
||||||
|
+. 518400 IN NS C.ROOT-SERVERS.NET.
|
||||||
|
+. 518400 IN NS D.ROOT-SERVERS.NET.
|
||||||
|
+. 518400 IN NS E.ROOT-SERVERS.NET.
|
||||||
|
+. 518400 IN NS F.ROOT-SERVERS.NET.
|
||||||
|
+. 518400 IN NS G.ROOT-SERVERS.NET.
|
||||||
|
+. 518400 IN NS H.ROOT-SERVERS.NET.
|
||||||
|
+. 518400 IN NS I.ROOT-SERVERS.NET.
|
||||||
|
+. 518400 IN NS J.ROOT-SERVERS.NET.
|
||||||
|
+. 518400 IN NS K.ROOT-SERVERS.NET.
|
||||||
|
+. 518400 IN NS L.ROOT-SERVERS.NET.
|
||||||
|
+. 518400 IN NS M.ROOT-SERVERS.NET.
|
||||||
|
+
|
||||||
|
+;; ADDITIONAL SECTION:
|
||||||
|
+A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.4
|
||||||
|
+B.ROOT-SERVERS.NET. 3600000 IN A 192.228.79.201
|
||||||
|
+C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.12
|
||||||
|
+D.ROOT-SERVERS.NET. 3600000 IN A 128.8.10.90
|
||||||
|
+E.ROOT-SERVERS.NET. 3600000 IN A 192.203.230.10
|
||||||
|
+F.ROOT-SERVERS.NET. 3600000 IN A 192.5.5.241
|
||||||
|
+G.ROOT-SERVERS.NET. 3600000 IN A 192.112.36.4
|
||||||
|
+H.ROOT-SERVERS.NET. 3600000 IN A 128.63.2.53
|
||||||
|
+I.ROOT-SERVERS.NET. 3600000 IN A 192.36.148.17
|
||||||
|
+J.ROOT-SERVERS.NET. 3600000 IN A 192.58.128.30
|
||||||
|
+K.ROOT-SERVERS.NET. 3600000 IN A 193.0.14.129
|
||||||
|
+L.ROOT-SERVERS.NET. 3600000 IN A 198.32.64.12
|
||||||
|
+M.ROOT-SERVERS.NET. 3600000 IN A 202.12.27.33
|
||||||
|
+
|
||||||
|
+;; Query time: 81 msec
|
||||||
|
+;; SERVER: 198.41.0.4#53(a.root-servers.net.)
|
||||||
|
+;; WHEN: Sun Feb 1 11:27:14 2004
|
||||||
|
+;; MSG SIZE rcvd: 436
|
||||||
|
+
|
||||||
|
diff -urN bind-9.3.1.orig/conf/named.conf bind-9.3.1/conf/named.conf
|
||||||
|
--- bind-9.3.1.orig/conf/named.conf 1970-01-01 01:00:00.000000000 +0100
|
||||||
|
+++ bind-9.3.1/conf/named.conf 2005-07-10 22:33:46.000000000 +0200
|
||||||
|
@@ -0,0 +1,49 @@
|
||||||
|
+// This is the primary configuration file for the BIND DNS server named.
|
||||||
|
+//
|
||||||
|
+// If you are just adding zones, please do that in /etc/bind/named.conf.local
|
||||||
|
+
|
||||||
|
+include "/etc/bind/named.conf.options";
|
||||||
|
+
|
||||||
|
+// prime the server with knowledge of the root servers
|
||||||
|
+zone "." {
|
||||||
|
+ type hint;
|
||||||
|
+ file "/etc/bind/db.root";
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+// be authoritative for the localhost forward and reverse zones, and for
|
||||||
|
+// broadcast zones as per RFC 1912
|
||||||
|
+
|
||||||
|
+zone "localhost" {
|
||||||
|
+ type master;
|
||||||
|
+ file "/etc/bind/db.local";
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+zone "127.in-addr.arpa" {
|
||||||
|
+ type master;
|
||||||
|
+ file "/etc/bind/db.127";
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+zone "0.in-addr.arpa" {
|
||||||
|
+ type master;
|
||||||
|
+ file "/etc/bind/db.0";
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+zone "255.in-addr.arpa" {
|
||||||
|
+ type master;
|
||||||
|
+ file "/etc/bind/db.255";
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+// zone "com" { type delegation-only; };
|
||||||
|
+// zone "net" { type delegation-only; };
|
||||||
|
+
|
||||||
|
+// From the release notes:
|
||||||
|
+// Because many of our users are uncomfortable receiving undelegated answers
|
||||||
|
+// from root or top level domains, other than a few for whom that behaviour
|
||||||
|
+// has been trusted and expected for quite some length of time, we have now
|
||||||
|
+// introduced the "root-delegations-only" feature which applies delegation-only
|
||||||
|
+// logic to all top level domains, and to the root domain. An exception list
|
||||||
|
+// should be specified, including "MUSEUM" and "DE", and any other top level
|
||||||
|
+// domains from whom undelegated responses are expected and trusted.
|
||||||
|
+// root-delegation-only exclude { "DE"; "MUSEUM"; };
|
||||||
|
+
|
||||||
|
+include "/etc/bind/named.conf.local";
|
||||||
|
diff -urN bind-9.3.1.orig/conf/named.conf.local bind-9.3.1/conf/named.conf.local
|
||||||
|
--- bind-9.3.1.orig/conf/named.conf.local 1970-01-01 01:00:00.000000000 +0100
|
||||||
|
+++ bind-9.3.1/conf/named.conf.local 2005-07-10 22:14:06.000000000 +0200
|
||||||
|
@@ -0,0 +1,8 @@
|
||||||
|
+//
|
||||||
|
+// Do any local configuration here
|
||||||
|
+//
|
||||||
|
+
|
||||||
|
+// Consider adding the 1918 zones here, if they are not used in your
|
||||||
|
+// organization
|
||||||
|
+//include "/etc/bind/zones.rfc1918";
|
||||||
|
+
|
||||||
|
diff -urN bind-9.3.1.orig/conf/named.conf.options bind-9.3.1/conf/named.conf.options
|
||||||
|
--- bind-9.3.1.orig/conf/named.conf.options 1970-01-01 01:00:00.000000000 +0100
|
||||||
|
+++ bind-9.3.1/conf/named.conf.options 2005-07-10 22:14:06.000000000 +0200
|
||||||
|
@@ -0,0 +1,24 @@
|
||||||
|
+options {
|
||||||
|
+ directory "/var/cache/bind";
|
||||||
|
+
|
||||||
|
+ // If there is a firewall between you and nameservers you want
|
||||||
|
+ // to talk to, you might need to uncomment the query-source
|
||||||
|
+ // directive below. Previous versions of BIND always asked
|
||||||
|
+ // questions using port 53, but BIND 8.1 and later use an unprivileged
|
||||||
|
+ // port by default.
|
||||||
|
+
|
||||||
|
+ // query-source address * port 53;
|
||||||
|
+
|
||||||
|
+ // If your ISP provided one or more IP addresses for stable
|
||||||
|
+ // nameservers, you probably want to use them as forwarders.
|
||||||
|
+ // Uncomment the following block, and insert the addresses replacing
|
||||||
|
+ // the all-0's placeholder.
|
||||||
|
+
|
||||||
|
+ // forwarders {
|
||||||
|
+ // 0.0.0.0;
|
||||||
|
+ // };
|
||||||
|
+
|
||||||
|
+ auth-nxdomain no; # conform to RFC1035
|
||||||
|
+
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
diff -urN bind-9.3.1.orig/conf/zones.rfc1918 bind-9.3.1/conf/zones.rfc1918
|
||||||
|
--- bind-9.3.1.orig/conf/zones.rfc1918 1970-01-01 01:00:00.000000000 +0100
|
||||||
|
+++ bind-9.3.1/conf/zones.rfc1918 2005-07-10 22:14:10.000000000 +0200
|
||||||
|
@@ -0,0 +1,20 @@
|
||||||
|
+zone "10.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+
|
||||||
|
+zone "16.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+zone "17.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+zone "18.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+zone "19.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+zone "20.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+zone "21.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+zone "22.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+zone "23.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+zone "24.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+zone "25.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+zone "26.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+zone "27.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+zone "28.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+zone "29.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+zone "30.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+zone "31.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
+
|
||||||
|
+zone "168.192.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
|
||||||
|
diff -urN bind-9.3.1.orig/init.d bind-9.3.1/init.d
|
||||||
|
--- bind-9.3.1.orig/init.d 1970-01-01 01:00:00.000000000 +0100
|
||||||
|
+++ bind-9.3.1/init.d 2005-07-10 23:09:58.000000000 +0200
|
||||||
|
@@ -0,0 +1,70 @@
|
||||||
|
+#!/bin/sh
|
||||||
|
+
|
||||||
|
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
|
+
|
||||||
|
+# for a chrooted server: "-u bind -t /var/lib/named"
|
||||||
|
+# Don't modify this line, change or create /etc/default/bind9.
|
||||||
|
+OPTIONS=""
|
||||||
|
+
|
||||||
|
+test -f /etc/default/bind9 && . /etc/default/bind9
|
||||||
|
+
|
||||||
|
+test -x /usr/sbin/rndc || exit 0
|
||||||
|
+
|
||||||
|
+case "$1" in
|
||||||
|
+ start)
|
||||||
|
+ echo -n "Starting domain name service: named"
|
||||||
|
+
|
||||||
|
+ modprobe capability >/dev/null 2>&1 || true
|
||||||
|
+ if [ ! -f /etc/bind/rndc.key ]; then
|
||||||
|
+ /usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom
|
||||||
|
+ chmod 0640 /etc/bind/rndc.key
|
||||||
|
+ fi
|
||||||
|
+ if [ -f /var/run/named/named.pid ]; then
|
||||||
|
+ ps `cat /var/run/named/named.pid` > /dev/null && exit 1
|
||||||
|
+ fi
|
||||||
|
+
|
||||||
|
+ # dirs under /var/run can go away on reboots.
|
||||||
|
+ mkdir -p /var/run/named
|
||||||
|
+ mkdir -p /var/cache/bind
|
||||||
|
+ chmod 775 /var/run/named
|
||||||
|
+ chown root:bind /var/run/named >/dev/null 2>&1 || true
|
||||||
|
+
|
||||||
|
+ if [ ! -x /usr/sbin/named ]; then
|
||||||
|
+ echo "named binary missing - not starting"
|
||||||
|
+ exit 1
|
||||||
|
+ fi
|
||||||
|
+ if start-stop-daemon --start --quiet --exec /usr/sbin/named \
|
||||||
|
+ --pidfile /var/run/named/named.pid -- $OPTIONS; then
|
||||||
|
+ if [ -x /sbin/resolvconf ] ; then
|
||||||
|
+ echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo
|
||||||
|
+ fi
|
||||||
|
+ fi
|
||||||
|
+ echo "."
|
||||||
|
+ ;;
|
||||||
|
+
|
||||||
|
+ stop)
|
||||||
|
+ echo -n "Stopping domain name service: named"
|
||||||
|
+ if [ -x /sbin/resolvconf ]; then
|
||||||
|
+ /sbin/resolvconf -d lo
|
||||||
|
+ fi
|
||||||
|
+ /usr/sbin/rndc stop >/dev/null 2>&1
|
||||||
|
+ echo "."
|
||||||
|
+ ;;
|
||||||
|
+
|
||||||
|
+ reload)
|
||||||
|
+ /usr/sbin/rndc reload
|
||||||
|
+ ;;
|
||||||
|
+
|
||||||
|
+ restart|force-reload)
|
||||||
|
+ $0 stop
|
||||||
|
+ sleep 2
|
||||||
|
+ $0 start
|
||||||
|
+ ;;
|
||||||
|
+
|
||||||
|
+ *)
|
||||||
|
+ echo "Usage: /etc/init.d/bind {start|stop|reload|restart|force-reload}" >&2
|
||||||
|
+ exit 1
|
||||||
|
+ ;;
|
||||||
|
+esac
|
||||||
|
+
|
||||||
|
+exit 0
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ ! -s /etc/bind/rndc.key ]; then
|
||||||
|
echo -n "Generating /etc/bind/rndc.key:"
|
||||||
|
/usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom
|
||||||
|
chown root:bind /etc/bind/rndc.key
|
||||||
|
chmod 0640 /etc/bind/rndc.key
|
||||||
|
fi
|
||||||
+65
@@ -0,0 +1,65 @@
|
|||||||
|
Subject: init.d: add support for read-only rootfs
|
||||||
|
|
||||||
|
Upstream-Status: Inappropriate [oe specific]
|
||||||
|
|
||||||
|
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||||
|
---
|
||||||
|
init.d | 40 ++++++++++++++++++++++++++++++++++++++++
|
||||||
|
1 file changed, 40 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/init.d b/init.d
|
||||||
|
index 0111ed4..24677c8 100644
|
||||||
|
--- a/init.d
|
||||||
|
+++ b/init.d
|
||||||
|
@@ -6,8 +6,48 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
|
# Don't modify this line, change or create /etc/default/bind9.
|
||||||
|
OPTIONS=""
|
||||||
|
|
||||||
|
+test -f /etc/default/rcS && . /etc/default/rcS
|
||||||
|
test -f /etc/default/bind9 && . /etc/default/bind9
|
||||||
|
|
||||||
|
+# This function is here because it's possible that /var and / are on different partitions.
|
||||||
|
+is_on_read_only_partition () {
|
||||||
|
+ DIRECTORY=$1
|
||||||
|
+ dir=`readlink -f $DIRECTORY`
|
||||||
|
+ while true; do
|
||||||
|
+ if [ ! -d "$dir" ]; then
|
||||||
|
+ echo "ERROR: $dir is not a directory"
|
||||||
|
+ exit 1
|
||||||
|
+ else
|
||||||
|
+ for flag in `awk -v dir=$dir '{ if ($2 == dir) { print "FOUND"; split($4,FLAGS,",") } }; \
|
||||||
|
+ END { for (f in FLAGS) print FLAGS[f] }' < /proc/mounts`; do
|
||||||
|
+ [ "$flag" = "FOUND" ] && partition="read-write"
|
||||||
|
+ [ "$flag" = "ro" ] && { partition="read-only"; break; }
|
||||||
|
+ done
|
||||||
|
+ if [ "$dir" = "/" -o -n "$partition" ]; then
|
||||||
|
+ break
|
||||||
|
+ else
|
||||||
|
+ dir=`dirname $dir`
|
||||||
|
+ fi
|
||||||
|
+ fi
|
||||||
|
+ done
|
||||||
|
+ [ "$partition" = "read-only" ] && echo "yes" || echo "no"
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+bind_mount () {
|
||||||
|
+ olddir=$1
|
||||||
|
+ newdir=$2
|
||||||
|
+ mkdir -p $olddir
|
||||||
|
+ cp -a $newdir/* $olddir
|
||||||
|
+ mount --bind $olddir $newdir
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+# Deal with read-only rootfs
|
||||||
|
+if [ "$ROOTFS_READ_ONLY" = "yes" ]; then
|
||||||
|
+ [ "$VERBOSE" != "no" ] && echo "WARN: start bind service in read-only rootfs"
|
||||||
|
+ [ `is_on_read_only_partition /etc/bind` = "yes" ] && bind_mount /var/volatile/bind/etc /etc/bind
|
||||||
|
+ [ `is_on_read_only_partition /var/named` = "yes" ] && bind_mount /var/volatile/bind/named /var/named
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
test -x /usr/sbin/rndc || exit 0
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
--
|
||||||
|
1.7.9.5
|
||||||
|
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
bind: make "/etc/init.d/bind stop" work
|
||||||
|
|
||||||
|
Upstream-Status: Inappropriate [configuration]
|
||||||
|
|
||||||
|
Add some configurations, make rndc command be able to controls
|
||||||
|
the named daemon.
|
||||||
|
|
||||||
|
Signed-off-by: Roy Li <rongqing.li@windriver.com>
|
||||||
|
---
|
||||||
|
conf/named.conf | 5 +++++
|
||||||
|
conf/rndc.conf | 5 +++++
|
||||||
|
2 files changed, 10 insertions(+), 0 deletions(-)
|
||||||
|
create mode 100644 conf/rndc.conf
|
||||||
|
|
||||||
|
diff --git a/conf/named.conf b/conf/named.conf
|
||||||
|
index 95829cf..c8899e7 100644
|
||||||
|
--- a/conf/named.conf
|
||||||
|
+++ b/conf/named.conf
|
||||||
|
@@ -47,3 +47,8 @@ zone "255.in-addr.arpa" {
|
||||||
|
// root-delegation-only exclude { "DE"; "MUSEUM"; };
|
||||||
|
|
||||||
|
include "/etc/bind/named.conf.local";
|
||||||
|
+include "/etc/bind/rndc.key" ;
|
||||||
|
+controls {
|
||||||
|
+ inet 127.0.0.1 allow { localhost; }
|
||||||
|
+ keys { rndc-key; };
|
||||||
|
+};
|
||||||
|
diff --git a/conf/rndc.conf b/conf/rndc.conf
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..a0b481d
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/conf/rndc.conf
|
||||||
|
@@ -0,0 +1,5 @@
|
||||||
|
+include "/etc/bind/rndc.key";
|
||||||
|
+options {
|
||||||
|
+ default-server localhost;
|
||||||
|
+ default-key rndc-key;
|
||||||
|
+};
|
||||||
|
|
||||||
|
--
|
||||||
|
1.7.5.4
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Berkeley Internet Name Domain (DNS)
|
||||||
|
Wants=nss-lookup.target
|
||||||
|
Before=nss-lookup.target
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
EnvironmentFile=-/etc/default/bind9
|
||||||
|
PIDFile=/run/named/named.pid
|
||||||
|
|
||||||
|
ExecStartPre=@SBINDIR@/generate-rndc-key.sh
|
||||||
|
ExecStart=@SBINDIR@/named $OPTIONS
|
||||||
|
|
||||||
|
ExecReload=@BASE_BINDIR@/sh -c '@SBINDIR@/rndc reload > /dev/null 2>&1 || @BASE_BINDIR@/kill -HUP $MAINPID'
|
||||||
|
|
||||||
|
ExecStop=@BASE_BINDIR@/sh -c '@SBINDIR@/rndc stop > /dev/null 2>&1 || @BASE_BINDIR@/kill -TERM $MAINPID'
|
||||||
|
|
||||||
|
PrivateTmp=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -0,0 +1,140 @@
|
|||||||
|
SUMMARY = "ISC Internet Domain Name Server"
|
||||||
|
HOMEPAGE = "http://www.isc.org/sw/bind/"
|
||||||
|
SECTION = "console/network"
|
||||||
|
|
||||||
|
LICENSE = "ISC & BSD"
|
||||||
|
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=bf39058a7f64b2a934ce14dc9ec1dd45"
|
||||||
|
|
||||||
|
DEPENDS = "openssl libcap zlib"
|
||||||
|
|
||||||
|
SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
|
||||||
|
file://conf.patch \
|
||||||
|
file://named.service \
|
||||||
|
file://bind9 \
|
||||||
|
file://generate-rndc-key.sh \
|
||||||
|
file://make-etc-initd-bind-stop-work.patch \
|
||||||
|
file://init.d-add-support-for-read-only-rootfs.patch \
|
||||||
|
file://bind-ensure-searching-for-json-headers-searches-sysr.patch \
|
||||||
|
file://0001-configure.in-remove-useless-L-use_openssl-lib.patch \
|
||||||
|
file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \
|
||||||
|
file://0001-avoid-start-failure-with-bind-user.patch \
|
||||||
|
"
|
||||||
|
|
||||||
|
SRC_URI[sha256sum] = "afc6d8015006f1cabf699ff19f517bb8fd9c1811e5231f26baf51c3550262ac9"
|
||||||
|
|
||||||
|
UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/"
|
||||||
|
# stay at 9.11 until 9.16, from 9.16 follow the ESV versions divisible by 4
|
||||||
|
UPSTREAM_CHECK_REGEX = "(?P<pver>9.(11|16|20|24|28)(\.\d+)+(-P\d+)*)/"
|
||||||
|
|
||||||
|
# BIND >= 9.11.2 need dhcpd >= 4.4.0,
|
||||||
|
# don't report it here since dhcpd is already recent enough.
|
||||||
|
CVE_CHECK_WHITELIST += "CVE-2019-6470"
|
||||||
|
|
||||||
|
inherit autotools update-rc.d systemd useradd pkgconfig multilib_script multilib_header
|
||||||
|
|
||||||
|
MULTILIB_SCRIPTS = "${PN}:${bindir}/bind9-config ${PN}:${bindir}/isc-config.sh"
|
||||||
|
|
||||||
|
# PACKAGECONFIGs readline and libedit should NOT be set at same time
|
||||||
|
PACKAGECONFIG ?= "readline"
|
||||||
|
PACKAGECONFIG[httpstats] = "--with-libxml2=${STAGING_DIR_HOST}${prefix},--without-libxml2,libxml2"
|
||||||
|
PACKAGECONFIG[readline] = "--with-readline=-lreadline,,readline"
|
||||||
|
PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit"
|
||||||
|
PACKAGECONFIG[urandom] = "--with-randomdev=/dev/urandom,--with-randomdev=/dev/random,,"
|
||||||
|
PACKAGECONFIG[python3] = "--with-python=yes --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} , --without-python, python3-ply-native,"
|
||||||
|
|
||||||
|
ENABLE_IPV6 = "--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)}"
|
||||||
|
EXTRA_OECONF = " ${ENABLE_IPV6} --with-libtool --enable-threads \
|
||||||
|
--disable-devpoll --enable-epoll --with-gost=no \
|
||||||
|
--with-gssapi=no --with-ecdsa=yes --with-eddsa=no \
|
||||||
|
--with-lmdb=no \
|
||||||
|
--sysconfdir=${sysconfdir}/bind \
|
||||||
|
--with-openssl=${STAGING_DIR_HOST}${prefix} \
|
||||||
|
"
|
||||||
|
|
||||||
|
inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native distutils3-base', '', d)}
|
||||||
|
|
||||||
|
# dhcp needs .la so keep them
|
||||||
|
REMOVE_LIBTOOL_LA = "0"
|
||||||
|
|
||||||
|
USERADD_PACKAGES = "${PN}"
|
||||||
|
USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \
|
||||||
|
--user-group bind"
|
||||||
|
|
||||||
|
INITSCRIPT_NAME = "bind"
|
||||||
|
INITSCRIPT_PARAMS = "defaults"
|
||||||
|
|
||||||
|
SYSTEMD_SERVICE_${PN} = "named.service"
|
||||||
|
|
||||||
|
do_install_prepend() {
|
||||||
|
# clean host path in isc-config.sh before the hardlink created
|
||||||
|
# by "make install":
|
||||||
|
# bind9-config -> isc-config.sh
|
||||||
|
sed -i -e "s,${STAGING_LIBDIR},${libdir}," ${B}/isc-config.sh
|
||||||
|
}
|
||||||
|
|
||||||
|
do_install_append() {
|
||||||
|
|
||||||
|
rmdir "${D}${localstatedir}/run"
|
||||||
|
rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
|
||||||
|
install -d -o bind "${D}${localstatedir}/cache/bind"
|
||||||
|
install -d "${D}${sysconfdir}/bind"
|
||||||
|
install -d "${D}${sysconfdir}/init.d"
|
||||||
|
install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/"
|
||||||
|
install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind"
|
||||||
|
if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then
|
||||||
|
sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' \
|
||||||
|
${D}${sbindir}/dnssec-coverage \
|
||||||
|
${D}${sbindir}/dnssec-checkds \
|
||||||
|
${D}${sbindir}/dnssec-keymgr
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Install systemd related files
|
||||||
|
install -d ${D}${sbindir}
|
||||||
|
install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir}
|
||||||
|
install -d ${D}${systemd_unitdir}/system
|
||||||
|
install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system
|
||||||
|
sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
|
||||||
|
-e 's,@SBINDIR@,${sbindir},g' \
|
||||||
|
${D}${systemd_unitdir}/system/named.service
|
||||||
|
|
||||||
|
install -d ${D}${sysconfdir}/default
|
||||||
|
install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default
|
||||||
|
|
||||||
|
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
|
||||||
|
install -d ${D}${sysconfdir}/tmpfiles.d
|
||||||
|
echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
oe_multilib_header isc/platform.h
|
||||||
|
}
|
||||||
|
|
||||||
|
CONFFILES_${PN} = " \
|
||||||
|
${sysconfdir}/bind/named.conf \
|
||||||
|
${sysconfdir}/bind/named.conf.local \
|
||||||
|
${sysconfdir}/bind/named.conf.options \
|
||||||
|
${sysconfdir}/bind/db.0 \
|
||||||
|
${sysconfdir}/bind/db.127 \
|
||||||
|
${sysconfdir}/bind/db.empty \
|
||||||
|
${sysconfdir}/bind/db.local \
|
||||||
|
${sysconfdir}/bind/db.root \
|
||||||
|
"
|
||||||
|
|
||||||
|
ALTERNATIVE_${PN}-utils = "nslookup"
|
||||||
|
ALTERNATIVE_LINK_NAME[nslookup] = "${bindir}/nslookup"
|
||||||
|
ALTERNATIVE_PRIORITY = "100"
|
||||||
|
|
||||||
|
PACKAGE_BEFORE_PN += "${PN}-utils"
|
||||||
|
FILES_${PN}-utils = "${bindir}/host ${bindir}/dig ${bindir}/mdig ${bindir}/nslookup ${bindir}/nsupdate"
|
||||||
|
FILES_${PN}-dev += "${bindir}/isc-config.h"
|
||||||
|
FILES_${PN} += "${sbindir}/generate-rndc-key.sh"
|
||||||
|
|
||||||
|
PACKAGE_BEFORE_PN += "${PN}-libs"
|
||||||
|
FILES_${PN}-libs = "${libdir}/*.so*"
|
||||||
|
FILES_${PN}-staticdev += "${libdir}/*.la"
|
||||||
|
|
||||||
|
PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}"
|
||||||
|
FILES_python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \
|
||||||
|
${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}"
|
||||||
|
|
||||||
|
RDEPENDS_${PN}-dev = ""
|
||||||
|
RDEPENDS_python3-bind = "python3-core python3-ply"
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
For now, arm-autonomy-host-image-minimal installs the dhcp-server package and
|
||||||
|
the dchp recipe was copied from oe-core tree https://git.openembedded.org/openembedded-core/tree/meta/recipes-connectivity/dhcp?id=087e4fafeef82cfd3d71402d6b200fe831f48697
|
||||||
|
since it got removed in the https://git.openembedded.org/openembedded-core/commit/meta/recipes-connectivity?id=7e3357892f204788162747e907d68f857118cf42 patch.
|
||||||
@@ -0,0 +1,149 @@
|
|||||||
|
SECTION = "console/network"
|
||||||
|
SUMMARY = "Internet Software Consortium DHCP package"
|
||||||
|
DESCRIPTION = "DHCP (Dynamic Host Configuration Protocol) is a protocol \
|
||||||
|
which allows individual devices on an IP network to get their own \
|
||||||
|
network configuration information from a server. DHCP helps make it \
|
||||||
|
easier to administer devices."
|
||||||
|
|
||||||
|
HOMEPAGE = "http://www.isc.org/"
|
||||||
|
|
||||||
|
LICENSE = "ISC"
|
||||||
|
LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;md5=004a4db50a1e20972e924a8618747c01"
|
||||||
|
|
||||||
|
DEPENDS = "openssl bind"
|
||||||
|
|
||||||
|
SRC_URI = "http://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \
|
||||||
|
file://init-relay file://default-relay \
|
||||||
|
file://init-server file://default-server \
|
||||||
|
file://dhclient.conf file://dhcpd.conf \
|
||||||
|
file://dhclient-systemd-wrapper \
|
||||||
|
file://dhclient.service \
|
||||||
|
file://dhcpd.service file://dhcrelay.service \
|
||||||
|
file://dhcpd6.service \
|
||||||
|
"
|
||||||
|
UPSTREAM_CHECK_URI = "http://ftp.isc.org/isc/dhcp/"
|
||||||
|
UPSTREAM_CHECK_REGEX = "(?P<pver>\d+\.\d+\.(\d+?))/"
|
||||||
|
|
||||||
|
inherit autotools-brokensep systemd useradd update-rc.d
|
||||||
|
|
||||||
|
USERADD_PACKAGES = "${PN}-server"
|
||||||
|
USERADD_PARAM_${PN}-server = "--system --no-create-home --home-dir /var/run/${BPN} --shell /bin/false --user-group ${BPN}"
|
||||||
|
|
||||||
|
SYSTEMD_PACKAGES = "${PN}-server ${PN}-relay ${PN}-client"
|
||||||
|
SYSTEMD_SERVICE_${PN}-server = "dhcpd.service dhcpd6.service"
|
||||||
|
SYSTEMD_AUTO_ENABLE_${PN}-server = "disable"
|
||||||
|
|
||||||
|
SYSTEMD_SERVICE_${PN}-relay = "dhcrelay.service"
|
||||||
|
SYSTEMD_AUTO_ENABLE_${PN}-relay = "disable"
|
||||||
|
|
||||||
|
SYSTEMD_SERVICE_${PN}-client = "dhclient.service"
|
||||||
|
SYSTEMD_AUTO_ENABLE_${PN}-client = "disable"
|
||||||
|
|
||||||
|
INITSCRIPT_PACKAGES = "dhcp-server"
|
||||||
|
INITSCRIPT_NAME_dhcp-server = "dhcp-server"
|
||||||
|
INITSCRIPT_PARAMS_dhcp-server = "defaults"
|
||||||
|
|
||||||
|
CFLAGS += "-D_GNU_SOURCE"
|
||||||
|
EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \
|
||||||
|
--with-srv6-lease-file=${localstatedir}/lib/dhcp/dhcpd6.leases \
|
||||||
|
--with-cli-lease-file=${localstatedir}/lib/dhcp/dhclient.leases \
|
||||||
|
--with-cli6-lease-file=${localstatedir}/lib/dhcp/dhclient6.leases \
|
||||||
|
--enable-paranoia --disable-static \
|
||||||
|
--with-randomdev=/dev/random \
|
||||||
|
--with-libbind=${STAGING_DIR_HOST} \
|
||||||
|
--enable-libtool \
|
||||||
|
"
|
||||||
|
|
||||||
|
#Enable shared libs per dhcp README
|
||||||
|
do_configure_prepend () {
|
||||||
|
cp configure.ac+lt configure.ac
|
||||||
|
}
|
||||||
|
|
||||||
|
do_install_append () {
|
||||||
|
install -d ${D}${sysconfdir}/init.d
|
||||||
|
install -d ${D}${sysconfdir}/default
|
||||||
|
install -d ${D}${sysconfdir}/dhcp
|
||||||
|
install -m 0755 ${WORKDIR}/init-relay ${D}${sysconfdir}/init.d/dhcp-relay
|
||||||
|
install -m 0644 ${WORKDIR}/default-relay ${D}${sysconfdir}/default/dhcp-relay
|
||||||
|
install -m 0755 ${WORKDIR}/init-server ${D}${sysconfdir}/init.d/dhcp-server
|
||||||
|
install -m 0644 ${WORKDIR}/default-server ${D}${sysconfdir}/default/dhcp-server
|
||||||
|
|
||||||
|
rm -f ${D}${sysconfdir}/dhclient.conf*
|
||||||
|
rm -f ${D}${sysconfdir}/dhcpd.conf*
|
||||||
|
install -m 0644 ${WORKDIR}/dhclient.conf ${D}${sysconfdir}/dhcp/dhclient.conf
|
||||||
|
install -m 0644 ${WORKDIR}/dhcpd.conf ${D}${sysconfdir}/dhcp/dhcpd.conf
|
||||||
|
|
||||||
|
install -d ${D}${base_sbindir}/
|
||||||
|
if [ "${sbindir}" != "${base_sbindir}" ]; then
|
||||||
|
mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/
|
||||||
|
fi
|
||||||
|
install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script
|
||||||
|
|
||||||
|
# Install systemd unit files
|
||||||
|
install -d ${D}${systemd_unitdir}/system
|
||||||
|
install -m 0644 ${WORKDIR}/dhcpd.service ${D}${systemd_unitdir}/system
|
||||||
|
install -m 0644 ${WORKDIR}/dhcpd6.service ${D}${systemd_unitdir}/system
|
||||||
|
install -m 0644 ${WORKDIR}/dhcrelay.service ${D}${systemd_unitdir}/system
|
||||||
|
sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcpd*.service ${D}${systemd_unitdir}/system/dhcrelay.service
|
||||||
|
sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcpd*.service
|
||||||
|
sed -i -e 's,@base_bindir@,${base_bindir},g' ${D}${systemd_unitdir}/system/dhcpd*.service
|
||||||
|
sed -i -e 's,@localstatedir@,${localstatedir},g' ${D}${systemd_unitdir}/system/dhcpd*.service
|
||||||
|
sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcrelay.service
|
||||||
|
|
||||||
|
install -d ${D}${base_sbindir}
|
||||||
|
install -m 0755 ${WORKDIR}/dhclient-systemd-wrapper ${D}${base_sbindir}/dhclient-systemd-wrapper
|
||||||
|
install -m 0644 ${WORKDIR}/dhclient.service ${D}${systemd_unitdir}/system
|
||||||
|
sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhclient.service
|
||||||
|
sed -i -e 's,@BASE_SBINDIR@,${base_sbindir},g' ${D}${systemd_unitdir}/system/dhclient.service
|
||||||
|
}
|
||||||
|
|
||||||
|
PACKAGES += "dhcp-libs dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell"
|
||||||
|
|
||||||
|
PACKAGES_remove = "${PN}"
|
||||||
|
RDEPENDS_${PN}-client += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'iproute2', '', d)}"
|
||||||
|
RDEPENDS_${PN}-dev = ""
|
||||||
|
RDEPENDS_${PN}-staticdev = ""
|
||||||
|
FILES_${PN}-libs = "${libdir}/libdhcpctl.so.0* ${libdir}/libomapi.so.0* ${libdir}/libdhcp.so.0*"
|
||||||
|
|
||||||
|
FILES_${PN}-server = "${sbindir}/dhcpd ${sysconfdir}/init.d/dhcp-server"
|
||||||
|
RRECOMMENDS_${PN}-server = "dhcp-server-config"
|
||||||
|
|
||||||
|
FILES_${PN}-server-config = "${sysconfdir}/default/dhcp-server ${sysconfdir}/dhcp/dhcpd.conf"
|
||||||
|
|
||||||
|
FILES_${PN}-relay = "${sbindir}/dhcrelay ${sysconfdir}/init.d/dhcp-relay ${sysconfdir}/default/dhcp-relay"
|
||||||
|
|
||||||
|
FILES_${PN}-client = "${base_sbindir}/dhclient \
|
||||||
|
${base_sbindir}/dhclient-script \
|
||||||
|
${sysconfdir}/dhcp/dhclient.conf \
|
||||||
|
${base_sbindir}/dhclient-systemd-wrapper \
|
||||||
|
"
|
||||||
|
|
||||||
|
FILES_${PN}-omshell = "${bindir}/omshell"
|
||||||
|
|
||||||
|
pkg_postinst_dhcp-server() {
|
||||||
|
mkdir -p $D/${localstatedir}/lib/dhcp
|
||||||
|
touch $D/${localstatedir}/lib/dhcp/dhcpd.leases
|
||||||
|
touch $D/${localstatedir}/lib/dhcp/dhcpd6.leases
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst_dhcp-client() {
|
||||||
|
mkdir -p $D/${localstatedir}/lib/dhcp
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postrm_dhcp-server() {
|
||||||
|
rm -f $D/${localstatedir}/lib/dhcp/dhcpd.leases
|
||||||
|
rm -f $D/${localstatedir}/lib/dhcp/dhcpd6.leases
|
||||||
|
|
||||||
|
if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then
|
||||||
|
echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postrm_dhcp-client() {
|
||||||
|
rm -f $D/${localstatedir}/lib/dhcp/dhclient.leases
|
||||||
|
rm -f $D/${localstatedir}/lib/dhcp/dhclient6.leases
|
||||||
|
|
||||||
|
if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then
|
||||||
|
echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty."
|
||||||
|
fi
|
||||||
|
}
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
From 7cc29144535a622fc671dc86eb1da65b0473a7c4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
Date: Tue, 15 Aug 2017 16:14:22 +0800
|
||||||
|
Subject: [PATCH 01/11] define macro _PATH_DHCPD_CONF and _PATH_DHCLIENT_CONF
|
||||||
|
|
||||||
|
Upstream-Status: Inappropriate [OE specific]
|
||||||
|
|
||||||
|
Rebase to 4.3.6
|
||||||
|
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
---
|
||||||
|
includes/site.h | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
Index: dhcp-4.4.1/includes/site.h
|
||||||
|
===================================================================
|
||||||
|
--- dhcp-4.4.1.orig/includes/site.h
|
||||||
|
+++ dhcp-4.4.1/includes/site.h
|
||||||
|
@@ -148,7 +148,8 @@
|
||||||
|
/* Define this if you want the dhcpd.conf file to go somewhere other than
|
||||||
|
the default location. By default, it goes in /etc/dhcpd.conf. */
|
||||||
|
|
||||||
|
-/* #define _PATH_DHCPD_CONF "/etc/dhcpd.conf" */
|
||||||
|
+#define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf"
|
||||||
|
+#define _PATH_DHCLIENT_CONF "/etc/dhcp/dhclient.conf"
|
||||||
|
|
||||||
|
/* Network API definitions. You do not need to choose one of these - if
|
||||||
|
you don't choose, one will be chosen for you in your system's config
|
||||||
+65
@@ -0,0 +1,65 @@
|
|||||||
|
From eec0503cfc36f63d777f5cb3f2719cecedcb8468 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Haris Okanovic <haris.okanovic@ni.com>
|
||||||
|
Date: Mon, 7 Jan 2019 13:22:09 -0600
|
||||||
|
Subject: [PATCH] Workaround busybox limitation in Linux dhclient-script
|
||||||
|
|
||||||
|
Busybox is a lightweight implementation of coreutils commonly used on
|
||||||
|
space-constrained embedded Linux distributions. It's implementation of
|
||||||
|
chown and chmod doesn't provide a "--reference" option added to
|
||||||
|
client/scripts/linux as of commit 9261cb14. This change works around
|
||||||
|
that limitation by using stat to read ownership and permissions flags
|
||||||
|
and simple chown/chmod calls supported in both coreutils and busybox.
|
||||||
|
|
||||||
|
modified: client/scripts/linux
|
||||||
|
|
||||||
|
Signed-off-by: Haris Okanovic <haris.okanovic@ni.com>
|
||||||
|
Upstream-Status: Pending [ISC-Bugs #48771]
|
||||||
|
---
|
||||||
|
client/scripts/linux | 17 +++++++++++++----
|
||||||
|
1 file changed, 13 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/client/scripts/linux b/client/scripts/linux
|
||||||
|
index 0c429697..2435a44b 100755
|
||||||
|
--- a/client/scripts/linux
|
||||||
|
+++ b/client/scripts/linux
|
||||||
|
@@ -32,6 +32,17 @@
|
||||||
|
# if your system holds ip tool in a non-standard location.
|
||||||
|
ip=/sbin/ip
|
||||||
|
|
||||||
|
+chown_chmod_by_reference() {
|
||||||
|
+ local reference_file="$1"
|
||||||
|
+ local target_file="$2"
|
||||||
|
+
|
||||||
|
+ local owner=$(stat -c "%u:%g" "$reference_file")
|
||||||
|
+ local perm=$(stat -c "%a" "$reference_file")
|
||||||
|
+
|
||||||
|
+ chown "$owner" "$target_file"
|
||||||
|
+ chmod "$perm" "$target_file"
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
# update /etc/resolv.conf based on received values
|
||||||
|
# This updated version mostly follows Debian script by Andrew Pollock et al.
|
||||||
|
make_resolv_conf() {
|
||||||
|
@@ -74,8 +85,7 @@ make_resolv_conf() {
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f /etc/resolv.conf ]; then
|
||||||
|
- chown --reference=/etc/resolv.conf $new_resolv_conf
|
||||||
|
- chmod --reference=/etc/resolv.conf $new_resolv_conf
|
||||||
|
+ chown_chmod_by_reference /etc/resolv.conf $new_resolv_conf
|
||||||
|
fi
|
||||||
|
mv -f $new_resolv_conf /etc/resolv.conf
|
||||||
|
# DHCPv6
|
||||||
|
@@ -101,8 +111,7 @@ make_resolv_conf() {
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f /etc/resolv.conf ]; then
|
||||||
|
- chown --reference=/etc/resolv.conf $new_resolv_conf
|
||||||
|
- chmod --reference=/etc/resolv.conf $new_resolv_conf
|
||||||
|
+ chown_chmod_by_reference /etc/resolv.conf $new_resolv_conf
|
||||||
|
fi
|
||||||
|
mv -f $new_resolv_conf /etc/resolv.conf
|
||||||
|
fi
|
||||||
|
--
|
||||||
|
2.20.0
|
||||||
|
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
From be7540d31c356e80ee02e90e8bf162b7ac6e5ba5 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
Date: Tue, 15 Aug 2017 14:56:56 +0800
|
||||||
|
Subject: [PATCH 02/11] dhclient dbus
|
||||||
|
|
||||||
|
Upstream-Status: Inappropriate [distribution]
|
||||||
|
|
||||||
|
Rebase to 4.3.6
|
||||||
|
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
---
|
||||||
|
client/scripts/bsdos | 5 +++++
|
||||||
|
client/scripts/freebsd | 5 +++++
|
||||||
|
client/scripts/linux | 5 +++++
|
||||||
|
client/scripts/netbsd | 5 +++++
|
||||||
|
client/scripts/openbsd | 5 +++++
|
||||||
|
client/scripts/solaris | 5 +++++
|
||||||
|
6 files changed, 30 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/client/scripts/bsdos b/client/scripts/bsdos
|
||||||
|
index d69d0d8..095b143 100755
|
||||||
|
--- a/client/scripts/bsdos
|
||||||
|
+++ b/client/scripts/bsdos
|
||||||
|
@@ -45,6 +45,11 @@ exit_with_hooks() {
|
||||||
|
. /etc/dhclient-exit-hooks
|
||||||
|
fi
|
||||||
|
# probably should do something with exit status of the local script
|
||||||
|
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
|
||||||
|
+ dbus-send --system --dest=com.redhat.dhcp \
|
||||||
|
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
|
||||||
|
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
|
||||||
|
+ fi
|
||||||
|
exit $exit_status
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/client/scripts/freebsd b/client/scripts/freebsd
|
||||||
|
index 8f3e2a2..ad7fb44 100755
|
||||||
|
--- a/client/scripts/freebsd
|
||||||
|
+++ b/client/scripts/freebsd
|
||||||
|
@@ -89,6 +89,11 @@ exit_with_hooks() {
|
||||||
|
. /etc/dhclient-exit-hooks
|
||||||
|
fi
|
||||||
|
# probably should do something with exit status of the local script
|
||||||
|
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
|
||||||
|
+ dbus-send --system --dest=com.redhat.dhcp \
|
||||||
|
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
|
||||||
|
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
|
||||||
|
+ fi
|
||||||
|
exit $exit_status
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/client/scripts/linux b/client/scripts/linux
|
||||||
|
index 5fb1612..3d447b6 100755
|
||||||
|
--- a/client/scripts/linux
|
||||||
|
+++ b/client/scripts/linux
|
||||||
|
@@ -174,6 +174,11 @@ exit_with_hooks() {
|
||||||
|
exit_status=$?
|
||||||
|
fi
|
||||||
|
|
||||||
|
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
|
||||||
|
+ dbus-send --system --dest=com.redhat.dhcp \
|
||||||
|
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
|
||||||
|
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
|
||||||
|
+ fi
|
||||||
|
exit $exit_status
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/client/scripts/netbsd b/client/scripts/netbsd
|
||||||
|
index 07383b7..aaba8e8 100755
|
||||||
|
--- a/client/scripts/netbsd
|
||||||
|
+++ b/client/scripts/netbsd
|
||||||
|
@@ -45,6 +45,11 @@ exit_with_hooks() {
|
||||||
|
. /etc/dhclient-exit-hooks
|
||||||
|
fi
|
||||||
|
# probably should do something with exit status of the local script
|
||||||
|
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
|
||||||
|
+ dbus-send --system --dest=com.redhat.dhcp \
|
||||||
|
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
|
||||||
|
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
|
||||||
|
+ fi
|
||||||
|
exit $exit_status
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/client/scripts/openbsd b/client/scripts/openbsd
|
||||||
|
index e7f4746..56b980c 100644
|
||||||
|
--- a/client/scripts/openbsd
|
||||||
|
+++ b/client/scripts/openbsd
|
||||||
|
@@ -45,6 +45,11 @@ exit_with_hooks() {
|
||||||
|
. /etc/dhclient-exit-hooks
|
||||||
|
fi
|
||||||
|
# probably should do something with exit status of the local script
|
||||||
|
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
|
||||||
|
+ dbus-send --system --dest=com.redhat.dhcp \
|
||||||
|
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
|
||||||
|
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
|
||||||
|
+ fi
|
||||||
|
exit $exit_status
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/client/scripts/solaris b/client/scripts/solaris
|
||||||
|
index af553b9..4a2aa69 100755
|
||||||
|
--- a/client/scripts/solaris
|
||||||
|
+++ b/client/scripts/solaris
|
||||||
|
@@ -26,6 +26,11 @@ exit_with_hooks() {
|
||||||
|
. /etc/dhclient-exit-hooks
|
||||||
|
fi
|
||||||
|
# probably should do something with exit status of the local script
|
||||||
|
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
|
||||||
|
+ dbus-send --system --dest=com.redhat.dhcp \
|
||||||
|
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
|
||||||
|
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
|
||||||
|
+ fi
|
||||||
|
exit $exit_status
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
From d80bd792323dbd56269309f85b4506eb6b1b60e9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andrei Gherzan <andrei@gherzan.ro>
|
||||||
|
Date: Tue, 15 Aug 2017 15:05:47 +0800
|
||||||
|
Subject: [PATCH 03/11] link with lcrypto
|
||||||
|
|
||||||
|
From 4.2.0 final release, -lcrypto check was removed and we compile
|
||||||
|
static libraries
|
||||||
|
from bind that are linked to libcrypto. This is why i added a patch in
|
||||||
|
order to add
|
||||||
|
-lcrypto to LIBS.
|
||||||
|
|
||||||
|
Upstream-Status: Pending
|
||||||
|
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
|
||||||
|
|
||||||
|
Rebase to 4.3.6
|
||||||
|
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
---
|
||||||
|
configure.ac | 4 ++++
|
||||||
|
1 file changed, 4 insertions(+)
|
||||||
|
|
||||||
|
Index: dhcp-4.4.1/configure.ac
|
||||||
|
===================================================================
|
||||||
|
--- dhcp-4.4.1.orig/configure.ac
|
||||||
|
+++ dhcp-4.4.1/configure.ac
|
||||||
|
@@ -612,6 +612,10 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
|
||||||
|
# Look for optional headers.
|
||||||
|
AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h)
|
||||||
|
|
||||||
|
+# find an MD5 library
|
||||||
|
+AC_SEARCH_LIBS(MD5_Init, [crypto])
|
||||||
|
+AC_SEARCH_LIBS(MD5Init, [crypto])
|
||||||
|
+
|
||||||
|
# Solaris needs some libraries for functions
|
||||||
|
AC_SEARCH_LIBS(socket, [socket])
|
||||||
|
AC_SEARCH_LIBS(inet_ntoa, [nsl])
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
From cccec0344d68dac4100b6f260ee24e7c2da9dfda Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
Date: Tue, 15 Aug 2017 15:08:22 +0800
|
||||||
|
Subject: [PATCH 04/11] Fix out of tree builds
|
||||||
|
|
||||||
|
Upstream-Status: Pending
|
||||||
|
|
||||||
|
RP 2013/03/21
|
||||||
|
|
||||||
|
Rebase to 4.3.6
|
||||||
|
|
||||||
|
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
---
|
||||||
|
client/Makefile.am | 4 ++--
|
||||||
|
common/Makefile.am | 3 ++-
|
||||||
|
dhcpctl/Makefile.am | 2 ++
|
||||||
|
omapip/Makefile.am | 1 +
|
||||||
|
relay/Makefile.am | 2 +-
|
||||||
|
server/Makefile.am | 2 +-
|
||||||
|
6 files changed, 9 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
Index: dhcp-4.4.1/common/Makefile.am
|
||||||
|
===================================================================
|
||||||
|
--- dhcp-4.4.1.orig/common/Makefile.am
|
||||||
|
+++ dhcp-4.4.1/common/Makefile.am
|
||||||
|
@@ -1,4 +1,5 @@
|
||||||
|
-AM_CPPFLAGS = -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"'
|
||||||
|
+AM_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"'
|
||||||
|
+
|
||||||
|
AM_CFLAGS = $(LDAP_CFLAGS)
|
||||||
|
|
||||||
|
lib_LIBRARIES = libdhcp.a
|
||||||
|
Index: dhcp-4.4.1/dhcpctl/Makefile.am
|
||||||
|
===================================================================
|
||||||
|
--- dhcp-4.4.1.orig/dhcpctl/Makefile.am
|
||||||
|
+++ dhcp-4.4.1/dhcpctl/Makefile.am
|
||||||
|
@@ -3,6 +3,8 @@ BINDLIBDNSDIR=@BINDLIBDNSDIR@
|
||||||
|
BINDLIBISCCFGDIR=@BINDLIBISCCFGDIR@
|
||||||
|
BINDLIBISCDIR=@BINDLIBISCDIR@
|
||||||
|
|
||||||
|
+AM_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_srcdir)
|
||||||
|
+
|
||||||
|
bin_PROGRAMS = omshell
|
||||||
|
lib_LIBRARIES = libdhcpctl.a
|
||||||
|
noinst_PROGRAMS = cltest
|
||||||
|
Index: dhcp-4.4.1/server/Makefile.am
|
||||||
|
===================================================================
|
||||||
|
--- dhcp-4.4.1.orig/server/Makefile.am
|
||||||
|
+++ dhcp-4.4.1/server/Makefile.am
|
||||||
|
@@ -4,7 +4,7 @@
|
||||||
|
# production code. Sadly, we are not there yet.
|
||||||
|
SUBDIRS = . tests
|
||||||
|
|
||||||
|
-AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"'
|
||||||
|
+AM_CPPFLAGS = -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes
|
||||||
|
|
||||||
|
dist_sysconf_DATA = dhcpd.conf.example
|
||||||
|
sbin_PROGRAMS = dhcpd
|
||||||
|
Index: dhcp-4.4.1/client/Makefile.am
|
||||||
|
===================================================================
|
||||||
|
--- dhcp-4.4.1.orig/client/Makefile.am
|
||||||
|
+++ dhcp-4.4.1/client/Makefile.am
|
||||||
|
@@ -5,7 +5,7 @@
|
||||||
|
SUBDIRS = . tests
|
||||||
|
|
||||||
|
AM_CPPFLAGS = -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"'
|
||||||
|
-AM_CPPFLAGS += -DLOCALSTATEDIR='"$(localstatedir)"'
|
||||||
|
+AM_CPPFLAGS += -DLOCALSTATEDIR='"$(localstatedir)"' -I$(top_srcdir)/includes
|
||||||
|
|
||||||
|
dist_sysconf_DATA = dhclient.conf.example
|
||||||
|
sbin_PROGRAMS = dhclient
|
||||||
|
Index: dhcp-4.4.1/omapip/Makefile.am
|
||||||
|
===================================================================
|
||||||
|
--- dhcp-4.4.1.orig/omapip/Makefile.am
|
||||||
|
+++ dhcp-4.4.1/omapip/Makefile.am
|
||||||
|
@@ -2,6 +2,7 @@ BINDLIBIRSDIR=@BINDLIBIRSDIR@
|
||||||
|
BINDLIBDNSDIR=@BINDLIBDNSDIR@
|
||||||
|
BINDLIBISCCFGDIR=@BINDLIBISCCFGDIR@
|
||||||
|
BINDLIBISCDIR=@BINDLIBISCDIR@
|
||||||
|
+AM_CPPFLAGS = -I$(top_srcdir)/includes
|
||||||
|
|
||||||
|
lib_LIBRARIES = libomapi.a
|
||||||
|
noinst_PROGRAMS = svtest
|
||||||
|
Index: dhcp-4.4.1/relay/Makefile.am
|
||||||
|
===================================================================
|
||||||
|
--- dhcp-4.4.1.orig/relay/Makefile.am
|
||||||
|
+++ dhcp-4.4.1/relay/Makefile.am
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
SUBDIRS = . tests
|
||||||
|
|
||||||
|
-AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"'
|
||||||
|
+AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes
|
||||||
|
|
||||||
|
sbin_PROGRAMS = dhcrelay
|
||||||
|
dhcrelay_SOURCES = dhcrelay.c
|
||||||
+36
@@ -0,0 +1,36 @@
|
|||||||
|
From 2e8ff0e4f6d39e346ea86b8c514ab4ccc78fa359 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
Date: Tue, 15 Aug 2017 15:24:14 +0800
|
||||||
|
Subject: [PATCH 05/11] dhcp-client: fix invoke dhclient-script failed on
|
||||||
|
Read-only file system
|
||||||
|
|
||||||
|
In read-only file system, '/etc' is on the readonly partition,
|
||||||
|
and '/etc/resolv.conf' is symlinked to a separate writable
|
||||||
|
partition.
|
||||||
|
|
||||||
|
In this situation, we create temp files 'resolv.conf.dhclient-new'
|
||||||
|
in /tmp dir.
|
||||||
|
|
||||||
|
Upstream-Status: Pending
|
||||||
|
|
||||||
|
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
---
|
||||||
|
client/scripts/linux | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/client/scripts/linux b/client/scripts/linux
|
||||||
|
index 3d447b6..3122a75 100755
|
||||||
|
--- a/client/scripts/linux
|
||||||
|
+++ b/client/scripts/linux
|
||||||
|
@@ -40,7 +40,7 @@ make_resolv_conf() {
|
||||||
|
# DHCPv4
|
||||||
|
if [ -n "$new_domain_search" ] || [ -n "$new_domain_name" ] ||
|
||||||
|
[ -n "$new_domain_name_servers" ]; then
|
||||||
|
- new_resolv_conf=/etc/resolv.conf.dhclient-new
|
||||||
|
+ new_resolv_conf=/tmp/resolv.conf.dhclient-new
|
||||||
|
rm -f $new_resolv_conf
|
||||||
|
|
||||||
|
if [ -n "$new_domain_name" ]; then
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
||||||
+62
@@ -0,0 +1,62 @@
|
|||||||
|
From 7107511fd209f08f9a96f8938041ae48f3295895 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Christopher Larson <chris_larson@mentor.com>
|
||||||
|
Date: Tue, 15 Aug 2017 16:17:49 +0800
|
||||||
|
Subject: [PATCH 07/11] Add configure argument to make the libxml2 dependency
|
||||||
|
explicit and determinisitic.
|
||||||
|
|
||||||
|
Upstream-Status: Pending
|
||||||
|
|
||||||
|
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
|
||||||
|
|
||||||
|
Rebase to 4.3.6
|
||||||
|
|
||||||
|
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
---
|
||||||
|
configure.ac | 11 +++++++++++
|
||||||
|
1 file changed, 11 insertions(+)
|
||||||
|
|
||||||
|
Index: dhcp-4.4.1/configure.ac
|
||||||
|
===================================================================
|
||||||
|
--- dhcp-4.4.1.orig/configure.ac
|
||||||
|
+++ dhcp-4.4.1/configure.ac
|
||||||
|
@@ -642,6 +642,17 @@ if test "$have_nanosleep" = "rt"; then
|
||||||
|
LIBS="-lrt $LIBS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
+AC_ARG_WITH(libxml2,
|
||||||
|
+ AS_HELP_STRING([--with-libxml2], [link against libxml2. this is needed if bind was built with xml2 support enabled]),
|
||||||
|
+ with_libxml2="$withval", with_libxml2="no")
|
||||||
|
+
|
||||||
|
+if test x$with_libxml2 != xno; then
|
||||||
|
+ AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],
|
||||||
|
+ [if test x$with_libxml2 != xauto; then
|
||||||
|
+ AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested])
|
||||||
|
+ fi])
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
# check for /dev/random (declares HAVE_DEV_RANDOM)
|
||||||
|
AC_MSG_CHECKING(for random device)
|
||||||
|
AC_ARG_WITH(randomdev,
|
||||||
|
Index: dhcp-4.4.1/configure.ac+lt
|
||||||
|
===================================================================
|
||||||
|
--- dhcp-4.4.1.orig/configure.ac+lt
|
||||||
|
+++ dhcp-4.4.1/configure.ac+lt
|
||||||
|
@@ -909,6 +909,18 @@ elif test "$want_libtool" = "yes" -a "$u
|
||||||
|
fi
|
||||||
|
AM_CONDITIONAL(INSTALL_BIND, test "$want_install_bind" = "yes")
|
||||||
|
|
||||||
|
+AC_ARG_WITH(libxml2,
|
||||||
|
+ AS_HELP_STRING([--with-libxml2], [link against libxml2. this is needed if bind was built with xml2 support enabled]),
|
||||||
|
+ with_libxml2="$withval", with_libxml2="no")
|
||||||
|
+
|
||||||
|
+if test x$with_libxml2 != xno; then
|
||||||
|
+ AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],,
|
||||||
|
+ [if test x$with_libxml2 != xauto; then
|
||||||
|
+ AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested])
|
||||||
|
+ fi])
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+
|
||||||
|
# OpenLDAP support.
|
||||||
|
AC_ARG_WITH(ldap,
|
||||||
|
AS_HELP_STRING([--with-ldap],[enable OpenLDAP support in dhcpd (default is no)]),
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
From f3f8b7726e50e24ef3edf5fa5a17e31d39118d7e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andre McCurdy <armccurdy@gmail.com>
|
||||||
|
Date: Tue, 15 Aug 2017 15:49:31 +0800
|
||||||
|
Subject: [PATCH 09/11] remove dhclient-script bash dependency
|
||||||
|
|
||||||
|
Upstream-Status: Inappropriate [OE specific]
|
||||||
|
|
||||||
|
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
|
||||||
|
|
||||||
|
Rebase to 4.3.6
|
||||||
|
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
---
|
||||||
|
client/scripts/linux | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/client/scripts/linux b/client/scripts/linux
|
||||||
|
index 3122a75..1712d7d 100755
|
||||||
|
--- a/client/scripts/linux
|
||||||
|
+++ b/client/scripts/linux
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-#!/bin/bash
|
||||||
|
+#!/bin/sh
|
||||||
|
# dhclient-script for Linux. Dan Halbert, March, 1997.
|
||||||
|
# Updated for Linux 2.[12] by Brian J. Murrell, January 1999.
|
||||||
|
# No guarantees about this. I'm a novice at the details of Linux
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
From 501543b3ef715488a142e3d301ff2733aa33eec7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Awais Belal <awais_belal@mentor.com>
|
||||||
|
Date: Wed, 25 Oct 2017 21:00:05 +0500
|
||||||
|
Subject: [PATCH] dhcp: correct the intention for xml2 lib search
|
||||||
|
|
||||||
|
A missing case breaks the build when libxml2 is
|
||||||
|
required and found appropriately. The third argument
|
||||||
|
to the function AC_SEARCH_LIB is action-if-found which
|
||||||
|
was mistakenly been used for the case where the library
|
||||||
|
is not found and hence breaks the configure phase
|
||||||
|
where it shoud actually pass.
|
||||||
|
We now pass on silently when action-if-found is
|
||||||
|
executed.
|
||||||
|
|
||||||
|
Upstream-Status: Pending
|
||||||
|
|
||||||
|
Signed-off-by: Awais Belal <awais_belal@mentor.com>
|
||||||
|
---
|
||||||
|
configure.ac | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
Index: dhcp-4.4.1/configure.ac
|
||||||
|
===================================================================
|
||||||
|
--- dhcp-4.4.1.orig/configure.ac
|
||||||
|
+++ dhcp-4.4.1/configure.ac
|
||||||
|
@@ -647,7 +647,7 @@ AC_ARG_WITH(libxml2,
|
||||||
|
with_libxml2="$withval", with_libxml2="no")
|
||||||
|
|
||||||
|
if test x$with_libxml2 != xno; then
|
||||||
|
- AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],
|
||||||
|
+ AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],,
|
||||||
|
[if test x$with_libxml2 != xauto; then
|
||||||
|
AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested])
|
||||||
|
fi])
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
lib and include path is hardcoded for use_libbind
|
||||||
|
|
||||||
|
use libdir and includedir vars
|
||||||
|
|
||||||
|
Upstream-Status: Pending
|
||||||
|
Signed-off-by: Armin Kuster <akuster808@gmail.com>
|
||||||
|
|
||||||
|
Index: dhcp-4.4.1/configure.ac+lt
|
||||||
|
===================================================================
|
||||||
|
--- dhcp-4.4.1.orig/configure.ac+lt
|
||||||
|
+++ dhcp-4.4.1/configure.ac+lt
|
||||||
|
@@ -801,22 +801,22 @@ no)
|
||||||
|
if test ! -d "$use_libbind"; then
|
||||||
|
AC_MSG_ERROR([Cannot find bind directory at $use_libbind])
|
||||||
|
fi
|
||||||
|
- if test ! -d "$use_libbind/include" -o \
|
||||||
|
- ! -f "$use_libbind/include/isc/buffer.h"
|
||||||
|
+ if test ! -d "$use_libbind/$includedir" -o \
|
||||||
|
+ ! -f "$use_libbind/$includedir/isc/buffer.h"
|
||||||
|
then
|
||||||
|
- AC_MSG_ERROR([Cannot find bind includes at $use_libbind/include])
|
||||||
|
+ AC_MSG_ERROR([Cannot find bind includes at $use_libbind/$includedir])
|
||||||
|
fi
|
||||||
|
- if test ! -d "$use_libbind/lib" -o \
|
||||||
|
- \( ! -f "$use_libbind/lib/libisc.a" -a \
|
||||||
|
- ! -f "$use_libbind/lib/libisc.la" \)
|
||||||
|
+ if test ! -d "$use_libbind/$libdir" -o \
|
||||||
|
+ \( ! -f "$use_libbind/$libdir/libisc.a" -a \
|
||||||
|
+ ! -f "$use_libbind/$libdir/libisc.la" \)
|
||||||
|
then
|
||||||
|
- AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/lib])
|
||||||
|
+ AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/$libdir])
|
||||||
|
fi
|
||||||
|
BINDDIR="$use_libbind"
|
||||||
|
- BINDLIBIRSDIR="$BINDDIR/lib"
|
||||||
|
- BINDLIBDNSDIR="$BINDDIR/lib"
|
||||||
|
- BINDLIBISCCFGDIR="$BINDDIR/lib"
|
||||||
|
- BINDLIBISCDIR="$BINDDIR/lib"
|
||||||
|
+ BINDLIBIRSDIR="$BINDDIR/$libdir"
|
||||||
|
+ BINDLIBDNSDIR="$BINDDIR/$libdir"
|
||||||
|
+ BINDLIBISCCFGDIR="$BINDDIR/$libdir"
|
||||||
|
+ BINDLIBISCDIR="$BINDDIR/$libdir"
|
||||||
|
DISTCHECK_LIBBIND_CONFIGURE_FLAG="--with-libbind=$use_libbind"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
@@ -856,14 +856,14 @@ AC_ARG_ENABLE(libtool,
|
||||||
|
|
||||||
|
if test "$use_libbind" != "no"; then
|
||||||
|
if test "$want_libtool" = "yes" -a \
|
||||||
|
- ! -f "$use_libbind/lib/libisc.la"
|
||||||
|
+ ! -f "$use_libbind/$libdir/libisc.la"
|
||||||
|
then
|
||||||
|
- AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/lib])
|
||||||
|
+ AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/$libdir])
|
||||||
|
fi
|
||||||
|
if test "$want_libtool" = "no" -a \
|
||||||
|
- ! -f "$use_libbind/lib/libisc.a"
|
||||||
|
+ ! -f "$use_libbind/$libdir/libisc.a"
|
||||||
|
then
|
||||||
|
- AC_MSG_ERROR([Cannot find static libraries at $use_libbind/lib])
|
||||||
|
+ AC_MSG_ERROR([Cannot find static libraries at $use_libbind/$libdir])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
require dhcp.inc
|
||||||
|
|
||||||
|
SRC_URI += "file://0001-define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch \
|
||||||
|
file://0002-dhclient-dbus.patch \
|
||||||
|
file://0003-link-with-lcrypto.patch \
|
||||||
|
file://0004-Fix-out-of-tree-builds.patch \
|
||||||
|
file://0005-dhcp-client-fix-invoke-dhclient-script-failed-on-Rea.patch \
|
||||||
|
file://0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch \
|
||||||
|
file://0009-remove-dhclient-script-bash-dependency.patch \
|
||||||
|
file://0012-dhcp-correct-the-intention-for-xml2-lib-search.patch \
|
||||||
|
file://0013-fixup_use_libbind.patch \
|
||||||
|
file://0001-workaround-busybox-limitation-in-linux-dhclient-script.patch \
|
||||||
|
"
|
||||||
|
|
||||||
|
SRC_URI[md5sum] = "2afdaf8498dc1edaf3012efdd589b3e1"
|
||||||
|
SRC_URI[sha256sum] = "1a7ccd64a16e5e68f7b5e0f527fd07240a2892ea53fe245620f4f5f607004521"
|
||||||
|
|
||||||
|
LDFLAGS_append = " -pthread"
|
||||||
|
|
||||||
|
PACKAGECONFIG ?= ""
|
||||||
|
PACKAGECONFIG[bind-httpstats] = "--with-libxml2,--without-libxml2,libxml2"
|
||||||
|
|
||||||
|
CFLAGS += "-fcommon"
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# Defaults for dhcp-relay initscript
|
||||||
|
# sourced by /etc/init.d/dhcp-relay
|
||||||
|
|
||||||
|
# What servers should the DHCP relay forward requests to?
|
||||||
|
# e.g: SERVERS="192.168.0.1"
|
||||||
|
SERVERS=""
|
||||||
|
|
||||||
|
# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
|
||||||
|
INTERFACES=""
|
||||||
|
|
||||||
|
# Additional options that are passed to the DHCP relay daemon?
|
||||||
|
OPTIONS=""
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# Defaults for dhcp initscript
|
||||||
|
# sourced by /etc/init.d/dhcp-server
|
||||||
|
# installed at /etc/default/dhcp-server by the maintainer scripts
|
||||||
|
|
||||||
|
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
|
||||||
|
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
|
||||||
|
INTERFACES=""
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# In case the interface is used for nfs, skip it.
|
||||||
|
nfsroot=0
|
||||||
|
interfaces=""
|
||||||
|
exec 9<&0 < /proc/mounts
|
||||||
|
while read dev mtpt fstype rest; do
|
||||||
|
if test $mtpt = "/" ; then
|
||||||
|
case $fstype in
|
||||||
|
nfs | nfs4)
|
||||||
|
nfsroot=1
|
||||||
|
nfs_addr=`echo $rest | sed -e 's/^.*addr=\([0-9.]*\).*$/\1/'`
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
exec 0<&9 9<&-
|
||||||
|
|
||||||
|
if [ $nfsroot -eq 0 ]; then
|
||||||
|
interfaces="$INTERFACES"
|
||||||
|
else
|
||||||
|
if [ -x /bin/ip -o -x /sbin/ip ] ; then
|
||||||
|
nfs_iface=`ip route get $nfs_addr | grep dev | sed -e 's/^.*dev \([-a-z0-9.]*\).*$/\1/'`
|
||||||
|
fi
|
||||||
|
for i in $INTERFACES; do
|
||||||
|
if test "x$i" = "x$nfs_iface"; then
|
||||||
|
echo "dhclient skipping nfsroot interface $i"
|
||||||
|
else
|
||||||
|
interfaces="$interfaces $i"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "x$interfaces" != "x"; then
|
||||||
|
/sbin/dhclient -d -cf /etc/dhcp/dhclient.conf -q -lf /var/lib/dhcp/dhclient.leases $interfaces
|
||||||
|
fi
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
# Configuration file for /sbin/dhclient, which is included in Debian's
|
||||||
|
# dhcp3-client package.
|
||||||
|
#
|
||||||
|
# This is a sample configuration file for dhclient. See dhclient.conf's
|
||||||
|
# man page for more information about the syntax of this file
|
||||||
|
# and a more comprehensive list of the parameters understood by
|
||||||
|
# dhclient.
|
||||||
|
#
|
||||||
|
# Normally, if the DHCP server provides reasonable information and does
|
||||||
|
# not leave anything out (like the domain name, for example), then
|
||||||
|
# few changes must be made to this file, if any.
|
||||||
|
#
|
||||||
|
|
||||||
|
#send host-name "andare.fugue.com";
|
||||||
|
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
|
||||||
|
#send dhcp-lease-time 3600;
|
||||||
|
#supersede domain-name "fugue.com home.vix.com";
|
||||||
|
#prepend domain-name-servers 127.0.0.1;
|
||||||
|
request subnet-mask, broadcast-address, time-offset, routers,
|
||||||
|
domain-name, domain-name-servers, host-name,
|
||||||
|
netbios-name-servers, netbios-scope;
|
||||||
|
#require subnet-mask, domain-name-servers;
|
||||||
|
#timeout 60;
|
||||||
|
#retry 60;
|
||||||
|
#reboot 10;
|
||||||
|
#select-timeout 5;
|
||||||
|
#initial-interval 2;
|
||||||
|
#script "/etc/dhcp3/dhclient-script";
|
||||||
|
#media "-link0 -link1 -link2", "link0 link1";
|
||||||
|
#reject 192.33.137.209;
|
||||||
|
|
||||||
|
#alias {
|
||||||
|
# interface "eth0";
|
||||||
|
# fixed-address 192.5.5.213;
|
||||||
|
# option subnet-mask 255.255.255.255;
|
||||||
|
#}
|
||||||
|
|
||||||
|
#lease {
|
||||||
|
# interface "eth0";
|
||||||
|
# fixed-address 192.33.137.200;
|
||||||
|
# medium "link0 link1";
|
||||||
|
# option host-name "andare.swiftmedia.com";
|
||||||
|
# option subnet-mask 255.255.255.0;
|
||||||
|
# option broadcast-address 192.33.137.255;
|
||||||
|
# option routers 192.33.137.250;
|
||||||
|
# option domain-name-servers 127.0.0.1;
|
||||||
|
# renew 2 2000/1/12 00:00:01;
|
||||||
|
# rebind 2 2000/1/12 00:00:01;
|
||||||
|
# expire 2 2000/1/12 00:00:01;
|
||||||
|
#}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Dynamic Host Configuration Protocol (DHCP)
|
||||||
|
Wants=network.target
|
||||||
|
Before=network.target
|
||||||
|
After=systemd-udevd.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
EnvironmentFile=-@SYSCONFDIR@/default/dhcp-client
|
||||||
|
ExecStart=@BASE_SBINDIR@/dhclient-systemd-wrapper
|
||||||
|
RemainAfterExit=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
#
|
||||||
|
# Sample configuration file for ISC dhcpd for Debian
|
||||||
|
#
|
||||||
|
# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
|
||||||
|
#
|
||||||
|
|
||||||
|
# The ddns-updates-style parameter controls whether or not the server will
|
||||||
|
# attempt to do a DNS update when a lease is confirmed. We default to the
|
||||||
|
# behavior of the version 2 packages ('none', since DHCP v2 didn't
|
||||||
|
# have support for DDNS.)
|
||||||
|
ddns-update-style none;
|
||||||
|
|
||||||
|
# option definitions common to all supported networks...
|
||||||
|
option domain-name "example.org";
|
||||||
|
option domain-name-servers ns1.example.org, ns2.example.org;
|
||||||
|
|
||||||
|
default-lease-time 600;
|
||||||
|
max-lease-time 7200;
|
||||||
|
|
||||||
|
# If this DHCP server is the official DHCP server for the local
|
||||||
|
# network, the authoritative directive should be uncommented.
|
||||||
|
#authoritative;
|
||||||
|
|
||||||
|
# Use this to send dhcp log messages to a different log file (you also
|
||||||
|
# have to hack syslog.conf to complete the redirection).
|
||||||
|
log-facility local7;
|
||||||
|
|
||||||
|
# No service will be given on this subnet, but declaring it helps the
|
||||||
|
# DHCP server to understand the network topology.
|
||||||
|
|
||||||
|
#subnet 10.152.187.0 netmask 255.255.255.0 {
|
||||||
|
#}
|
||||||
|
|
||||||
|
# This is a very basic subnet declaration.
|
||||||
|
|
||||||
|
#subnet 10.254.239.0 netmask 255.255.255.224 {
|
||||||
|
# range 10.254.239.10 10.254.239.20;
|
||||||
|
# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# This declaration allows BOOTP clients to get dynamic addresses,
|
||||||
|
# which we don't really recommend.
|
||||||
|
|
||||||
|
#subnet 10.254.239.32 netmask 255.255.255.224 {
|
||||||
|
# range dynamic-bootp 10.254.239.40 10.254.239.60;
|
||||||
|
# option broadcast-address 10.254.239.31;
|
||||||
|
# option routers rtr-239-32-1.example.org;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# A slightly different configuration for an internal subnet.
|
||||||
|
#subnet 10.5.5.0 netmask 255.255.255.224 {
|
||||||
|
# range 10.5.5.26 10.5.5.30;
|
||||||
|
# option domain-name-servers ns1.internal.example.org;
|
||||||
|
# option domain-name "internal.example.org";
|
||||||
|
# option routers 10.5.5.1;
|
||||||
|
# option broadcast-address 10.5.5.31;
|
||||||
|
# default-lease-time 600;
|
||||||
|
# max-lease-time 7200;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Hosts which require special configuration options can be listed in
|
||||||
|
# host statements. If no address is specified, the address will be
|
||||||
|
# allocated dynamically (if possible), but the host-specific information
|
||||||
|
# will still come from the host declaration.
|
||||||
|
|
||||||
|
#host passacaglia {
|
||||||
|
# hardware ethernet 0:0:c0:5d:bd:95;
|
||||||
|
# filename "vmunix.passacaglia";
|
||||||
|
# server-name "toccata.fugue.com";
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Fixed IP addresses can also be specified for hosts. These addresses
|
||||||
|
# should not also be listed as being available for dynamic assignment.
|
||||||
|
# Hosts for which fixed IP addresses have been specified can boot using
|
||||||
|
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
|
||||||
|
# be booted with DHCP, unless there is an address range on the subnet
|
||||||
|
# to which a BOOTP client is connected which has the dynamic-bootp flag
|
||||||
|
# set.
|
||||||
|
#host fantasia {
|
||||||
|
# hardware ethernet 08:00:07:26:c0:a5;
|
||||||
|
# fixed-address fantasia.fugue.com;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# You can declare a class of clients and then do address allocation
|
||||||
|
# based on that. The example below shows a case where all clients
|
||||||
|
# in a certain class get addresses on the 10.17.224/24 subnet, and all
|
||||||
|
# other clients get addresses on the 10.0.29/24 subnet.
|
||||||
|
|
||||||
|
#class "foo" {
|
||||||
|
# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
|
||||||
|
#}
|
||||||
|
|
||||||
|
#shared-network 224-29 {
|
||||||
|
# subnet 10.17.224.0 netmask 255.255.255.0 {
|
||||||
|
# option routers rtr-224.example.org;
|
||||||
|
# }
|
||||||
|
# subnet 10.0.29.0 netmask 255.255.255.0 {
|
||||||
|
# option routers rtr-29.example.org;
|
||||||
|
# }
|
||||||
|
# pool {
|
||||||
|
# allow members of "foo";
|
||||||
|
# range 10.17.224.10 10.17.224.250;
|
||||||
|
# }
|
||||||
|
# pool {
|
||||||
|
# deny members of "foo";
|
||||||
|
# range 10.0.29.10 10.0.29.230;
|
||||||
|
# }
|
||||||
|
#}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=DHCPv4 Server Daemon
|
||||||
|
Documentation=man:dhcpd(8) man:dhcpd.conf(5)
|
||||||
|
After=network.target
|
||||||
|
After=time-sync.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
PIDFile=@localstatedir@/run/dhcpd.pid
|
||||||
|
EnvironmentFile=@SYSCONFDIR@/default/dhcp-server
|
||||||
|
EnvironmentFile=-@SYSCONFDIR@/sysconfig/dhcp-server
|
||||||
|
ExecStartPre=@base_bindir@/touch @localstatedir@/lib/dhcp/dhcpd.leases
|
||||||
|
ExecStart=@SBINDIR@/dhcpd -f -cf @SYSCONFDIR@/dhcp/dhcpd.conf -pf @localstatedir@/run/dhcpd.pid $DHCPDARGS -q $INTERFACES
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=DHCPv6 Server Daemon
|
||||||
|
Documentation=man:dhcpd(8) man:dhcpd.conf(5)
|
||||||
|
After=network.target
|
||||||
|
After=time-sync.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
PIDFile=@localstatedir@/run/dhcpd6.pid
|
||||||
|
EnvironmentFile=@SYSCONFDIR@/default/dhcp-server
|
||||||
|
EnvironmentFile=-@SYSCONFDIR@/sysconfig/dhcpd6
|
||||||
|
ExecStartPre=@base_bindir@/touch @localstatedir@/lib/dhcp/dhcpd6.leases
|
||||||
|
ExecStart=@SBINDIR@/dhcpd -f -6 -cf @SYSCONFDIR@/dhcp/dhcpd6.conf -pf @localstatedir@/run/dhcpd6.pid $DHCPDARGS -q $INTERFACES
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=DHCP Relay Agent Daemon
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
EnvironmentFile=@SYSCONFDIR@/default/dhcp-relay
|
||||||
|
ExecStart=@SBINDIR@/dhcrelay -d --no-pid -q $SERVERS
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# $Id: dhcp3-relay,v 1.1 2004/04/16 15:41:08 ml Exp $
|
||||||
|
#
|
||||||
|
|
||||||
|
# It is not safe to start if we don't have a default configuration...
|
||||||
|
if [ ! -f /etc/default/dhcp-relay ]; then
|
||||||
|
echo "/etc/default/dhcp-relay does not exist! - Aborting..."
|
||||||
|
echo "create this file to fix the problem."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Read init script configuration (interfaces the daemon should listen on
|
||||||
|
# and the DHCP server we should forward requests to.)
|
||||||
|
. /etc/default/dhcp-relay
|
||||||
|
|
||||||
|
# Build command line for interfaces (will be passed to dhrelay below.)
|
||||||
|
IFCMD=""
|
||||||
|
if test "$INTERFACES" != ""; then
|
||||||
|
for I in $INTERFACES; do
|
||||||
|
IFCMD=${IFCMD}"-i "${I}" "
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
DHCRELAYPID=/var/run/dhcrelay.pid
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
start-stop-daemon -S -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
start-stop-daemon -K -x /usr/sbin/dhcrelay
|
||||||
|
;;
|
||||||
|
restart | force-reload)
|
||||||
|
$0 stop
|
||||||
|
sleep 2
|
||||||
|
$0 start
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: /etc/init.d/dhcp-relay {start|stop|restart|force-reload}"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# $Id: dhcp3-server.init.d,v 1.4 2003/07/13 19:12:41 mdz Exp $
|
||||||
|
#
|
||||||
|
|
||||||
|
test -f /usr/sbin/dhcpd || exit 0
|
||||||
|
|
||||||
|
# It is not safe to start if we don't have a default configuration...
|
||||||
|
if [ ! -f /etc/default/dhcp-server ]; then
|
||||||
|
echo "/etc/default/dhcp-server does not exist! - Aborting..."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Read init script configuration (so far only interfaces the daemon
|
||||||
|
# should listen on.)
|
||||||
|
. /etc/default/dhcp-server
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
echo -n "Starting DHCP server: "
|
||||||
|
test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/
|
||||||
|
test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases
|
||||||
|
start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $INTERFACES -user dhcp -group dhcp
|
||||||
|
echo "."
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
echo -n "Stopping DHCP server: dhcpd3"
|
||||||
|
start-stop-daemon -K -x /usr/sbin/dhcpd
|
||||||
|
echo "."
|
||||||
|
;;
|
||||||
|
restart | force-reload)
|
||||||
|
$0 stop
|
||||||
|
sleep 2
|
||||||
|
$0 start
|
||||||
|
if [ "$?" != "0" ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: /etc/init.d/dhcp-server {start|stop|restart|force-reload}"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
@@ -50,24 +50,6 @@ EXTRA_IMAGEDEPENDS += "xen"
|
|||||||
# Build xen-devicetree to produce a xen ready devicetree
|
# Build xen-devicetree to produce a xen ready devicetree
|
||||||
EXTRA_IMAGEDEPENDS += "xen-devicetree"
|
EXTRA_IMAGEDEPENDS += "xen-devicetree"
|
||||||
|
|
||||||
# Documentation for setting up a multiconfig build can be found in:
|
|
||||||
# meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md
|
|
||||||
|
|
||||||
# In a multiconfig build this variable will hold a dependency string, which differs based
|
|
||||||
# on whether the guest has initramfs or not.
|
|
||||||
# It may have a space seperated list of dependency strings if mulitple guest types are
|
|
||||||
# configured
|
|
||||||
MC_DOIMAGE_MCDEPENDS ?= ""
|
|
||||||
# Example value: mc:host:guest:core-image-minimal:do_image_complete
|
|
||||||
|
|
||||||
# In a multiconfig build the host task 'do_image' has a dependency on multiconfig guest.
|
|
||||||
# This ensures that the guest image file already exists when it is needed by the host
|
|
||||||
DO_IMAGE_MCDEPENDS := "${@ '${MC_DOIMAGE_MCDEPENDS}' if d.getVar('BBMULTICONFIG') else ''}"
|
|
||||||
|
|
||||||
# Apply mc dependency. Empty string if multiconfig not enabled
|
|
||||||
do_image[mcdepends] += "${DO_IMAGE_MCDEPENDS}"
|
|
||||||
|
|
||||||
|
|
||||||
python __anonymous() {
|
python __anonymous() {
|
||||||
if bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', False, True, d):
|
if bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', False, True, d):
|
||||||
raise bb.parse.SkipRecipe("DISTRO_FEATURES does not contain 'arm-autonomy-host'")
|
raise bb.parse.SkipRecipe("DISTRO_FEATURES does not contain 'arm-autonomy-host'")
|
||||||
@@ -124,14 +106,7 @@ python add_extern_guests () {
|
|||||||
_, _, path, _, _, parm = bb.fetch.decodeurl(entry)
|
_, _, path, _, _, parm = bb.fetch.decodeurl(entry)
|
||||||
if 'guestname' in parm:
|
if 'guestname' in parm:
|
||||||
if os.path.islink(path):
|
if os.path.islink(path):
|
||||||
realpath = os.path.realpath(path)
|
bb.fatal("Guest file is a symlink: " + path)
|
||||||
|
|
||||||
if not os.path.exists(realpath):
|
|
||||||
bb.fatal("ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS link does not resolve: " + path)
|
|
||||||
|
|
||||||
bb.note("Guest file is a symlink:\n " + path + "\nResolved to:\n " + realpath)
|
|
||||||
path = realpath
|
|
||||||
|
|
||||||
bb.utils.mkdirhier(guestdir)
|
bb.utils.mkdirhier(guestdir)
|
||||||
dstname = parm['guestname']
|
dstname = parm['guestname']
|
||||||
# Add file extension if not there
|
# Add file extension if not there
|
||||||
|
|||||||
@@ -14,9 +14,7 @@ DESCRIPTION = "Add entries in DTB for Xen and Dom0"
|
|||||||
|
|
||||||
# Please refer to documentation/xen-devicetree.md for documentation on those
|
# Please refer to documentation/xen-devicetree.md for documentation on those
|
||||||
# parameters
|
# parameters
|
||||||
# kernel size is passed to xen via xen.dtb so wee need to add
|
XEN_DEVICETREE_DEPEND ?= "virtual/kernel:do_deploy"
|
||||||
# 'virtual/kernel:do_deploy' as a dependency
|
|
||||||
XEN_DEVICETREE_DEPEND_append = " virtual/kernel:do_deploy"
|
|
||||||
XEN_DEVICETREE_DTBS ?= "${KERNEL_DEVICETREE}"
|
XEN_DEVICETREE_DTBS ?= "${KERNEL_DEVICETREE}"
|
||||||
XEN_DEVICETREE_XEN_BOOTARGS ?= "noreboot dom0_mem=${XEN_DEVICETREE_DOM0_MEM}"
|
XEN_DEVICETREE_XEN_BOOTARGS ?= "noreboot dom0_mem=${XEN_DEVICETREE_DOM0_MEM}"
|
||||||
XEN_DEVICETREE_DOM0_MEM ?= "1024M"
|
XEN_DEVICETREE_DOM0_MEM ?= "1024M"
|
||||||
@@ -69,33 +67,6 @@ do_deploy() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
do_deploy[depends] += "${XEN_DEVICETREE_DEPEND}"
|
do_deploy[depends] += "${XEN_DEVICETREE_DEPEND}"
|
||||||
do_deploy[prefuncs] += "calc_xen_dtb_dom0_size"
|
|
||||||
|
|
||||||
addtask deploy after do_install
|
addtask deploy after do_install
|
||||||
|
|
||||||
python calc_xen_dtb_dom0_size() {
|
|
||||||
from math import ceil
|
|
||||||
size = 0
|
|
||||||
if d.getVar('KERNEL_IMAGE_MAXSIZE'):
|
|
||||||
bb.note('size calculation based on KERNEL_IMAGE_MAXSIZE')
|
|
||||||
size = int(d.getVar('KERNEL_IMAGE_MAXSIZE')) * 1024
|
|
||||||
else:
|
|
||||||
kernel = os.path.realpath(d.getVar('DEPLOY_DIR_IMAGE') + '/' +\
|
|
||||||
d.getVar('KERNEL_IMAGETYPE'))
|
|
||||||
size = os.stat(kernel).st_size
|
|
||||||
bb.note('size calculation based on kernel Image file: %s' % kernel)
|
|
||||||
|
|
||||||
bb.note('size in bytes: %d' % size)
|
|
||||||
# Ceil to MiB
|
|
||||||
size_required = ceil(size / (2 ** 20)) * (2 ** 20)
|
|
||||||
size_defined = int(d.getVar('XEN_DEVICETREE_DOM0_SIZE'), 16)
|
|
||||||
|
|
||||||
if size_required > size_defined:
|
|
||||||
bb.warn ("Wrong kernel size setting inside xen dtb!\n"\
|
|
||||||
"Required:\t%(req)d (%(req)#010X)\n"\
|
|
||||||
"Requested:\t%(def)d (%(def)#010X)"\
|
|
||||||
% {"req": size_required, "def": size_defined})
|
|
||||||
bb.warn ("Overriding XEN_DEVICETREE_DOM0_SIZE with "\
|
|
||||||
"%(req)d (%(req)#010X)" % {"req": size_required})
|
|
||||||
d.setVar('XEN_DEVICETREE_DOM0_SIZE', hex(size_required))
|
|
||||||
}
|
|
||||||
|
|||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
From 3b418b33265402aab0cb1bf2b745a25724bae2d8 Mon Sep 17 00:00:00 2001
|
||||||
|
Message-Id: <3b418b33265402aab0cb1bf2b745a25724bae2d8.1602684880.git.diego.sueiro@arm.com>
|
||||||
|
From: Bertrand Marquis <bertrand.marquis@arm.com>
|
||||||
|
Date: Tue, 18 Aug 2020 14:47:38 +0100
|
||||||
|
Subject: [PATCH] arm: Add Neoverse N1 processor identification
|
||||||
|
|
||||||
|
Add MIDR and CPU part numbers for Neoverse N1
|
||||||
|
|
||||||
|
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
|
||||||
|
Acked-by: Julien Grall <jgrall@amazon.com>
|
||||||
|
|
||||||
|
Upstream-Status: Backport
|
||||||
|
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
||||||
|
---
|
||||||
|
xen/include/asm-arm/processor.h | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
|
||||||
|
index aa642e3..3ca67f8 100644
|
||||||
|
--- a/xen/include/asm-arm/processor.h
|
||||||
|
+++ b/xen/include/asm-arm/processor.h
|
||||||
|
@@ -58,6 +58,7 @@
|
||||||
|
#define ARM_CPU_PART_CORTEX_A73 0xD09
|
||||||
|
#define ARM_CPU_PART_CORTEX_A75 0xD0A
|
||||||
|
#define ARM_CPU_PART_CORTEX_A76 0xD0B
|
||||||
|
+#define ARM_CPU_PART_NEOVERSE_N1 0xD0C
|
||||||
|
|
||||||
|
#define MIDR_CORTEX_A12 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A12)
|
||||||
|
#define MIDR_CORTEX_A17 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A17)
|
||||||
|
@@ -68,6 +69,7 @@
|
||||||
|
#define MIDR_CORTEX_A73 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A73)
|
||||||
|
#define MIDR_CORTEX_A75 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A75)
|
||||||
|
#define MIDR_CORTEX_A76 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A76)
|
||||||
|
+#define MIDR_NEOVERSE_N1 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N1)
|
||||||
|
|
||||||
|
/* MPIDR Multiprocessor Affinity Register */
|
||||||
|
#define _MPIDR_UP (30)
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
From 858c0be8c2fa4125a0fa0acaa03ae730e5c7cb3c Mon Sep 17 00:00:00 2001
|
||||||
|
Message-Id: <858c0be8c2fa4125a0fa0acaa03ae730e5c7cb3c.1602684183.git.diego.sueiro@arm.com>
|
||||||
|
From: Bertrand Marquis <bertrand.marquis@arm.com>
|
||||||
|
Date: Tue, 18 Aug 2020 14:47:39 +0100
|
||||||
|
Subject: [PATCH] xen/arm: Enable CPU Erratum 1165522 for Neoverse
|
||||||
|
|
||||||
|
Enable CPU erratum of Speculative AT on the Neoverse N1 processor
|
||||||
|
versions r0p0 to r2p0.
|
||||||
|
Also Fix Cortex A76 Erratum string which had a wrong errata number.
|
||||||
|
|
||||||
|
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
|
||||||
|
Acked-by: Julien Grall <jgrall@amazon.com>
|
||||||
|
|
||||||
|
Upstream-Status: Backport
|
||||||
|
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
||||||
|
---
|
||||||
|
xen/arch/arm/cpuerrata.c | 8 +++++++-
|
||||||
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
|
||||||
|
index 0248893..6c09017 100644
|
||||||
|
--- a/xen/arch/arm/cpuerrata.c
|
||||||
|
+++ b/xen/arch/arm/cpuerrata.c
|
||||||
|
@@ -477,8 +477,14 @@ static const struct arm_cpu_capabilities arm_errata[] = {
|
||||||
|
},
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
+ /* Neoverse r0p0 - r2p0 */
|
||||||
|
+ .desc = "ARM erratum 1165522",
|
||||||
|
+ .capability = ARM64_WORKAROUND_AT_SPECULATE,
|
||||||
|
+ MIDR_RANGE(MIDR_NEOVERSE_N1, 0, 2 << MIDR_VARIANT_SHIFT),
|
||||||
|
+ },
|
||||||
|
+ {
|
||||||
|
/* Cortex-A76 r0p0 - r2p0 */
|
||||||
|
- .desc = "ARM erratum 116522",
|
||||||
|
+ .desc = "ARM erratum 1165522",
|
||||||
|
.capability = ARM64_WORKAROUND_AT_SPECULATE,
|
||||||
|
MIDR_RANGE(MIDR_CORTEX_A76, 0, 2 << MIDR_VARIANT_SHIFT),
|
||||||
|
},
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
||||||
+35
@@ -0,0 +1,35 @@
|
|||||||
|
From 1814a626fb5811184eda64fe22f0055df4600211 Mon Sep 17 00:00:00 2001
|
||||||
|
Message-Id: <1814a626fb5811184eda64fe22f0055df4600211.1602684203.git.diego.sueiro@arm.com>
|
||||||
|
From: Julien Grall <jgrall@amazon.com>
|
||||||
|
Date: Tue, 25 Aug 2020 18:38:10 +0100
|
||||||
|
Subject: [PATCH] xen/arm: Update silicon-errata.txt with the Neovers AT
|
||||||
|
erratum
|
||||||
|
|
||||||
|
Commit 858c0be8c2fa "xen/arm: Enable CPU Erratum 1165522 for Neoverse"
|
||||||
|
added a new erratum but forgot to update silicon-errata.txt.
|
||||||
|
|
||||||
|
Update the file accordingly to keep track of errata workaround in Xen.
|
||||||
|
|
||||||
|
Signed-off-by: Julien Grall <jgrall@amazon.com>
|
||||||
|
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
|
||||||
|
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
|
||||||
|
|
||||||
|
Upstream-Status: Backport
|
||||||
|
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
||||||
|
---
|
||||||
|
docs/misc/arm/silicon-errata.txt | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
|
||||||
|
index 11e5a9d..e15d092 100644
|
||||||
|
--- a/docs/misc/arm/silicon-errata.txt
|
||||||
|
+++ b/docs/misc/arm/silicon-errata.txt
|
||||||
|
@@ -51,4 +51,5 @@ stable hypervisors.
|
||||||
|
| ARM | Cortex-A57 | #1319537 | N/A |
|
||||||
|
| ARM | Cortex-A72 | #1319367 | N/A |
|
||||||
|
| ARM | Cortex-A76 | #1165522 | N/A |
|
||||||
|
+| ARM | Neoverse-N1 | #1165522 | N/A
|
||||||
|
| ARM | MMU-500 | #842869 | N/A |
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
||||||
+51
@@ -0,0 +1,51 @@
|
|||||||
|
From 968bb86d04913f52d7678a842474f2a674a8b23e Mon Sep 17 00:00:00 2001
|
||||||
|
Message-Id: <968bb86d04913f52d7678a842474f2a674a8b23e.1602683678.git.diego.sueiro@arm.com>
|
||||||
|
From: Wei Chen <wei.chen@arm.com>
|
||||||
|
Date: Fri, 28 Aug 2020 02:34:03 +0000
|
||||||
|
Subject: [PATCH] xen/arm: Missing N1/A76/A75 FP registers in vCPU context
|
||||||
|
switch
|
||||||
|
|
||||||
|
Xen has cpu_has_fp/cpu_has_simd to detect whether the CPU supports
|
||||||
|
FP/SIMD or not. But currently, these two MACROs only consider value 0
|
||||||
|
of ID_AA64PFR0_EL1.FP/SIMD as FP/SIMD features enabled. But for CPUs
|
||||||
|
that support FP/SIMD and half-precision floating-point arithmetic, the
|
||||||
|
ID_AA64PFR0_EL1.FP/SIMD are 1 (see Arm ARM DDI0487F.b, D13.2.64).
|
||||||
|
For these CPUs, xen will treat them as no FP/SIMD support, the
|
||||||
|
vfp_save/restore_state will not take effect.
|
||||||
|
|
||||||
|
From the TRM documents of Cortex-A75/A76/N1, we know these CPUs support
|
||||||
|
basic Advanced SIMD/FP and half-precision floating-point arithmetic. In
|
||||||
|
this case, on N1/A76/A75 platforms, Xen will always miss the floating
|
||||||
|
pointer registers save/restore. If different vCPUs are running on the
|
||||||
|
same pCPU, the floating pointer registers will be corrupted randomly.
|
||||||
|
|
||||||
|
This patch fixes Xen on these new cores.
|
||||||
|
|
||||||
|
Signed-off-by: Wei Chen <wei.chen@arm.com>
|
||||||
|
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
|
||||||
|
Reviewed-by: Julien Grall <jgrall@amazon.com>
|
||||||
|
|
||||||
|
Upstream-Status: Backport
|
||||||
|
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
||||||
|
---
|
||||||
|
xen/include/asm-arm/cpufeature.h | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h
|
||||||
|
index 674beb0..10878ea 100644
|
||||||
|
--- a/xen/include/asm-arm/cpufeature.h
|
||||||
|
+++ b/xen/include/asm-arm/cpufeature.h
|
||||||
|
@@ -13,8 +13,8 @@
|
||||||
|
#define cpu_has_el2_64 (boot_cpu_feature64(el2) >= 1)
|
||||||
|
#define cpu_has_el3_32 (boot_cpu_feature64(el3) == 2)
|
||||||
|
#define cpu_has_el3_64 (boot_cpu_feature64(el3) >= 1)
|
||||||
|
-#define cpu_has_fp (boot_cpu_feature64(fp) == 0)
|
||||||
|
-#define cpu_has_simd (boot_cpu_feature64(simd) == 0)
|
||||||
|
+#define cpu_has_fp (boot_cpu_feature64(fp) < 8)
|
||||||
|
+#define cpu_has_simd (boot_cpu_feature64(simd) < 8)
|
||||||
|
#define cpu_has_gicv3 (boot_cpu_feature64(gic) == 1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
||||||
@@ -1,34 +1,18 @@
|
|||||||
Upstream-Status: Backport
|
Upstream-Status: Pending
|
||||||
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
||||||
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
|
|
||||||
|
|
||||||
From 5499e0fc8082024bf7e2d0facd5c976e82105070 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Diego Sueiro <diego.sueiro@arm.com>
|
|
||||||
Date: Thu, 20 Aug 2020 11:58:20 +0100
|
|
||||||
Subject: [PATCH] tools/hotplug: Fix hostname setting in vif-nat
|
|
||||||
|
|
||||||
Setting the hostname is failing because the "$XENBUS_PATH/domain"
|
Setting the hostname is failing because the "$XENBUS_PATH/domain"
|
||||||
doesn't exist anymore. To fix this we set it to dom$domid
|
doesn't exist anymore. To fix this we set it to dom$domid
|
||||||
|
|
||||||
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
Index: git/tools/hotplug/Linux/vif-nat
|
||||||
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
|
===================================================================
|
||||||
Acked-by: Wei Liu <wl@xen.org>
|
--- git.orig/tools/hotplug/Linux/vif-nat
|
||||||
---
|
+++ git/tools/hotplug/Linux/vif-nat
|
||||||
tools/hotplug/Linux/vif-nat | 2 +-
|
@@ -86,6 +86,7 @@ router_ip=$(routing_ip "$ip")
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/tools/hotplug/Linux/vif-nat b/tools/hotplug/Linux/vif-nat
|
|
||||||
index a76d9c784b..26144350b3 100644
|
|
||||||
--- a/tools/hotplug/Linux/vif-nat
|
|
||||||
+++ b/tools/hotplug/Linux/vif-nat
|
|
||||||
@@ -85,7 +85,7 @@ router_ip=$(routing_ip "$ip")
|
|
||||||
# Split the given IP/bits pair.
|
|
||||||
vif_ip=`echo ${ip} | awk -F/ '{print $1}'`
|
vif_ip=`echo ${ip} | awk -F/ '{print $1}'`
|
||||||
|
|
||||||
-hostname=$(xenstore_read "$XENBUS_PATH/domain" | tr -- '_.:/+' '-----')
|
hostname=$(xenstore_read "$XENBUS_PATH/domain" | tr -- '_.:/+' '-----')
|
||||||
+hostname=dom$domid
|
+[ -z "${hostname}" ] && hostname=dom$domid
|
||||||
if [ "$vifid" != "1" ]
|
if [ "$vifid" != "1" ]
|
||||||
then
|
then
|
||||||
hostname="$hostname-$vifid"
|
hostname="$hostname-$vifid"
|
||||||
--
|
|
||||||
2.17.1
|
|
||||||
|
|||||||
+45
@@ -0,0 +1,45 @@
|
|||||||
|
Upstream-Status: Pending
|
||||||
|
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
||||||
|
|
||||||
|
Copy temp files used to add/remove dhcpd configurations to avoid
|
||||||
|
replacing potential symlinks.
|
||||||
|
|
||||||
|
Index: git/tools/hotplug/Linux/vif-nat
|
||||||
|
===================================================================
|
||||||
|
--- git.orig/tools/hotplug/Linux/vif-nat
|
||||||
|
+++ git/tools/hotplug/Linux/vif-nat
|
||||||
|
@@ -99,7 +100,8 @@ dhcparg_remove_entry()
|
||||||
|
then
|
||||||
|
rm "$tmpfile"
|
||||||
|
else
|
||||||
|
- mv "$tmpfile" "$dhcpd_arg_file"
|
||||||
|
+ cp "$tmpfile" "$dhcpd_arg_file"
|
||||||
|
+ rm "$tmpfile"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -109,11 +111,11 @@ dhcparg_add_entry()
|
||||||
|
local tmpfile=$(mktemp)
|
||||||
|
# handle Red Hat, SUSE, and Debian styles, with or without quotes
|
||||||
|
sed -e 's/^DHCPDARGS="*\([^"]*\)"*/DHCPDARGS="\1'"${dev} "'"/' \
|
||||||
|
- "$dhcpd_arg_file" >"$tmpfile" && mv "$tmpfile" "$dhcpd_arg_file"
|
||||||
|
+ "$dhcpd_arg_file" >"$tmpfile" && cp "$tmpfile" "$dhcpd_arg_file"
|
||||||
|
sed -e 's/^DHCPD_INTERFACE="*\([^"]*\)"*/DHCPD_INTERFACE="\1'"${dev} "'"/' \
|
||||||
|
- "$dhcpd_arg_file" >"$tmpfile" && mv "$tmpfile" "$dhcpd_arg_file"
|
||||||
|
+ "$dhcpd_arg_file" >"$tmpfile" && cp "$tmpfile" "$dhcpd_arg_file"
|
||||||
|
sed -e 's/^INTERFACES="*\([^"]*\)"*/INTERFACES="\1'"${dev} "'"/' \
|
||||||
|
- "$dhcpd_arg_file" >"$tmpfile" && mv "$tmpfile" "$dhcpd_arg_file"
|
||||||
|
+ "$dhcpd_arg_file" >"$tmpfile" && cp "$tmpfile" "$dhcpd_arg_file"
|
||||||
|
rm -f "$tmpfile"
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -125,7 +127,8 @@ dhcp_remove_entry()
|
||||||
|
then
|
||||||
|
rm "$tmpfile"
|
||||||
|
else
|
||||||
|
- mv "$tmpfile" "$dhcpd_conf_file"
|
||||||
|
+ cp "$tmpfile" "$dhcpd_conf_file"
|
||||||
|
+ rm "$tmpfile"
|
||||||
|
fi
|
||||||
|
dhcparg_remove_entry
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
||||||
|
|
||||||
SRC_URI += "file://0001-vif-nat-fix-hostname.patch \
|
SRC_URI += "file://0001-vif-nat-fix-hostname.patch \
|
||||||
|
file://0002-vif-nat-fix-symlink-removal.patch \
|
||||||
"
|
"
|
||||||
|
|
||||||
PACKAGECONFIG_remove = "\
|
PACKAGECONFIG_remove = "\
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-4.14:"
|
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-4.14:"
|
||||||
|
|
||||||
SRC_URI += " \
|
SRC_URI += " \
|
||||||
file://0001-xen-arm-Throw-messages-for-unknown-FP-SIMD-implement.patch \
|
file://0001-arm-Add-Neoverse-N1-processor-identification.patch \
|
||||||
|
file://0002-xen-arm-Enable-CPU-Erratum-1165522-for-Neoverse.patch \
|
||||||
|
file://0003-xen-arm-Update-silicon-errata.txt-with-the-Neovers-A.patch \
|
||||||
|
file://0004-xen-arm-Missing-N1-A76-A75-FP-registers-in-vCPU-cont.patch \
|
||||||
|
file://0005-xen-arm-Throw-messages-for-unknown-FP-SIMD-implement.patch \
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -18,8 +18,6 @@
|
|||||||
domid=$(xenstore_read "${XENBUS_PATH}/frontend-id")
|
domid=$(xenstore_read "${XENBUS_PATH}/frontend-id")
|
||||||
guestname=$(xenstore_read "/local/domain/${domid}/name")
|
guestname=$(xenstore_read "/local/domain/${domid}/name")
|
||||||
bridge=$(xenstore_read "${XENBUS_PATH}/bridge")
|
bridge=$(xenstore_read "${XENBUS_PATH}/bridge")
|
||||||
mac=$(xenstore_read "$XENBUS_PATH/mac")
|
|
||||||
kea_conf_file="/etc/kea/kea-dhcp4.conf"
|
|
||||||
|
|
||||||
if [ ! -f /etc/xenguest/guests/${guestname}/params.cfg ]; then
|
if [ ! -f /etc/xenguest/guests/${guestname}/params.cfg ]; then
|
||||||
log debug "No /etc/xenguest/guests/${guestname}/params.cfg. Exiting."
|
log debug "No /etc/xenguest/guests/${guestname}/params.cfg. Exiting."
|
||||||
@@ -38,48 +36,63 @@ get_subnet_prefix() {
|
|||||||
|
|
||||||
subnetprefix=$(get_subnet_prefix)
|
subnetprefix=$(get_subnet_prefix)
|
||||||
|
|
||||||
kea_remove_conf_entry()
|
dhcpd_remove_conf_entry()
|
||||||
{
|
{
|
||||||
log debug "kea_remove_conf_entry"
|
local tmpfile=$(mktemp)
|
||||||
claim_lock "vif-nat-kea"
|
|
||||||
|
|
||||||
# Remove the the xenguest kea config file inclusion in the kea main config
|
# Remove the the xenguest dhcpd config file inclusion in the dhcpd
|
||||||
sed -i "/${kea_guest_config//'/'/'\/'}/d" "${kea_conf_file}"
|
# main config
|
||||||
|
grep -v "include \"${XENGUEST_DHCPD_CONF_FILE}\";" \
|
||||||
|
"${dhcpd_conf_file}" >"${tmpfile}"
|
||||||
|
if ! diff "${tmpfile}" "${dhcpd_conf_file}" >/dev/null
|
||||||
|
then
|
||||||
|
cp "${tmpfile}" "${dhcpd_conf_file}"
|
||||||
|
fi
|
||||||
|
rm ${tmpfile}
|
||||||
|
|
||||||
# Remove interface entry 1st case: [ "dev1", "dev_to_remove" ]
|
# Remove the generated the xenguest dhcpd file
|
||||||
sed -i "s/,\ \"$dev\"//" "${kea_conf_file}"
|
rm ${XENGUEST_DHCPD_CONF_FILE}
|
||||||
# Remove interface entry 2nd case: [ "dev_to_remove", "dev1" ]
|
|
||||||
sed -i "s/\"$dev\",\ //" "${kea_conf_file}"
|
|
||||||
# Remove interface entry 3rd case: [ "dev_to_remove" ]
|
|
||||||
sed -i "s/\[\ \"$dev\"\ \]/\[\ \]/" "${kea_conf_file}"
|
|
||||||
|
|
||||||
# Remove the generated the xenguest kea subnet conf file
|
|
||||||
rm ${XENGUEST_KEA_SUBNET_CONFIG}
|
|
||||||
|
|
||||||
keactrl reload
|
|
||||||
|
|
||||||
release_lock "vif-nat-kea"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
kea_add_conf_entries()
|
# This function removes the dhcpd options added by the vif-nat script and
|
||||||
|
# adds the user provided options under the ${XENGUEST_DHCPD_HOST_OPTIONS}
|
||||||
|
# variable set in "/etc/xenguest/guests/${guestname}/files/dhcpd-params.cfg"
|
||||||
|
# file.
|
||||||
|
dhcpd_add_conf_entries()
|
||||||
{
|
{
|
||||||
log debug "kea_add_conf_entries"
|
# We need to remove the previous added entry from vif-nat script
|
||||||
claim_lock "vif-nat-kea"
|
dhcp_remove_entry
|
||||||
|
|
||||||
# Include vif in the interfaces 1st case - no other entries:
|
# Include the xenguest dhcpd config file in the dhcpd main config
|
||||||
search_for='\"interfaces\": \[ '
|
echo >>"${dhcpd_conf_file}" "include \"${XENGUEST_DHCPD_CONF_FILE}\";"
|
||||||
sed -i "/${search_for}\"*\"\ */ s/\ \]/,\ \"${dev}\"\ \]/g" "${kea_conf_file}"
|
|
||||||
sed -i "s/${search_for}]/${search_for}\"${dev}\"\ \]/g" "${kea_conf_file}"
|
|
||||||
|
|
||||||
# Include the xenguest kea subnet conf file in the kea main config
|
# Generate the xenguest dhcpd file
|
||||||
search_for='\"subnet4\": \['
|
echo -e "$(eval "echo -e \"$(cat ${XENGUEST_DHCPD_PARAMS_FILE})\"")" \
|
||||||
sed -i "/$search_for/a $kea_guest_config" "${kea_conf_file}"
|
>> "${XENGUEST_DHCPD_CONF_FILE}"
|
||||||
|
|
||||||
# Generate the xenguest kea subnet conf file
|
# Re-add the dhcpargs entries removed by dhcp_remove_entry call
|
||||||
echo -e "$(eval "echo -e \"$(cat ${XENGUEST_KEA_SUBNET_TEMPLATE})\"")" \
|
dhcparg_add_entry
|
||||||
> "${XENGUEST_KEA_SUBNET_CONFIG}"
|
}
|
||||||
|
|
||||||
release_lock "vif-nat-kea"
|
dhcpd_online(){
|
||||||
|
log debug "dhcpd_online"
|
||||||
|
claim_lock "vif-nat-dhcp"
|
||||||
|
dhcpd_add_conf_entries
|
||||||
|
release_lock "vif-nat-dhcp"
|
||||||
|
"$dhcpd_init_file" restart || true
|
||||||
|
}
|
||||||
|
|
||||||
|
dhcpd_offline(){
|
||||||
|
log debug "dhcpd_offline"
|
||||||
|
claim_lock "vif-nat-dhcp"
|
||||||
|
dhcpd_remove_conf_entry
|
||||||
|
release_lock "vif-nat-dhcp"
|
||||||
|
"$dhcpd_init_file" restart || true # We need to ignore failure because
|
||||||
|
# ISC dhcpd 3 borks if there is nothing
|
||||||
|
# for it to do, which is the case if
|
||||||
|
# the outgoing interface is not
|
||||||
|
# configured to offer leases and there
|
||||||
|
# are no vifs.
|
||||||
}
|
}
|
||||||
|
|
||||||
call_extra_hooks() {
|
call_extra_hooks() {
|
||||||
@@ -98,29 +111,24 @@ call_extra_hooks() {
|
|||||||
|
|
||||||
case "${XENGUEST_NETWORK_TYPE}" in
|
case "${XENGUEST_NETWORK_TYPE}" in
|
||||||
nat)
|
nat)
|
||||||
XENGUEST_KEA_SUBNET_TEMPLATE=${XENGUEST_KEA_SUBNET_TEMPLATE:-"/etc/xenguest/guests/${guestname}/files/kea-subnet4.json"}
|
XENGUEST_DHCPD_PARAMS_FILE=${XENGUEST_DHCPD_PARAMS_FILE:-"/etc/xenguest/guests/${guestname}/files/dhcpd-params.cfg"}
|
||||||
if [ ! -f ${XENGUEST_KEA_SUBNET_TEMPLATE} ]; then
|
if [ ! -f ${XENGUEST_DHCPD_PARAMS_FILE} ]; then
|
||||||
log debug "No ${XENGUEST_KEA_SUBNET_TEMPLATE} file. Aborting"
|
log debug "No ${XENGUEST_DHCPD_PARAMS_FILE} file. Aborting"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
XENGUEST_KEA_SUBNET_CONFIG="/etc/kea/kea-subnet4.dom$domid.json"
|
XENGUEST_DHCPD_CONF_FILE="/etc/dhcp/dhcpd.dom$domid.conf"
|
||||||
if [ ! -d "$(dirname ${XENGUEST_KEA_SUBNET_CONFIG})" ]; then
|
|
||||||
log debug "No kea configuration directory. Aborting"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
kea_guest_config="\ \ \ \ <?include \"${XENGUEST_KEA_SUBNET_CONFIG}\"?>"
|
|
||||||
|
|
||||||
case "$command" in
|
case "$command" in
|
||||||
online)
|
online)
|
||||||
kea_add_conf_entries
|
dhcpd_online
|
||||||
|
|
||||||
# Enable ip forwarding and NAT for the ${bridge} interface
|
# Enable ip forwarding and NAT for the ${bridge} interface
|
||||||
sysctl -w net.ipv4.ip_forward=1
|
sysctl -w net.ipv4.ip_forward=1
|
||||||
iptables_w -t nat -A POSTROUTING -o ${bridge} -j MASQUERADE -m comment --comment "dom${domid}"
|
iptables_w -t nat -A POSTROUTING -o ${bridge} -j MASQUERADE -m comment --comment "dom${domid}"
|
||||||
;;
|
;;
|
||||||
offline)
|
offline)
|
||||||
kea_remove_conf_entry
|
dhcpd_offline
|
||||||
|
|
||||||
# Remove the NAT iptables rules created for the dom${domid}
|
# Remove the NAT iptables rules created for the dom${domid}
|
||||||
guest_ipt_rule=$(iptables_w -t nat -vL POSTROUTING -n --line-number | grep -w dom${domid} | awk '{print $1}' | tac)
|
guest_ipt_rule=$(iptables_w -t nat -vL POSTROUTING -n --line-number | grep -w dom${domid} | awk '{print $1}' | tac)
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
# This file holds the guest dhcpd options running on Dom0.
|
||||||
|
# The "/etc/xen/scripts/vif-post.d/00-vif-xenguest.hook" called in the end of
|
||||||
|
# the vif-nat script will use this file to generate the final dhcpd
|
||||||
|
# configuration.
|
||||||
|
|
||||||
|
# This file is added in the xenguest image and installed in dom0 under
|
||||||
|
# /etc/xenguest/guests/${guestname}/files/dhcpd-params.cfg when the guest
|
||||||
|
# image is created.
|
||||||
|
# Any customizations to it should be performed by replacing it via a bbappend.
|
||||||
|
|
||||||
|
# The \${hostname}, \${mac}, \${vif_ip} and \${router_ip} variables are set in
|
||||||
|
# the vif-nat script context. The \${subnetprefix} variable is set in the
|
||||||
|
# 00-vif-xenguest.hook script context.
|
||||||
|
|
||||||
|
# The "subnet" configuration node is mandatory in order to have the dhcpd
|
||||||
|
# properly running.
|
||||||
|
|
||||||
|
host ${hostname} {
|
||||||
|
hardware ethernet ${mac};
|
||||||
|
fixed-address ${vif_ip};
|
||||||
|
option routers ${router_ip};
|
||||||
|
option subnet-mask 255.255.255.0;
|
||||||
|
option broadcast-address ${subnetprefix}.255;
|
||||||
|
option domain-name-servers 8.8.8.8;
|
||||||
|
option host-name \"${hostname}\";
|
||||||
|
option domain-name \"example.com\";
|
||||||
|
}
|
||||||
|
|
||||||
|
subnet ${subnetprefix}.0 netmask 255.255.255.0 {
|
||||||
|
}
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
# This file holds the minimal kea dhcp4 server configuration.
|
|
||||||
# It replaces existing kea dhcp configuration file via
|
|
||||||
# "/etc/init.d/kea-restore-default-config" on every system boot.
|
|
||||||
# The "/etc/xen/scripts/vif-post.d/00-vif-xenguest.hook" called in the end of
|
|
||||||
# the vif-nat script will append each xenguest configuration to this file,
|
|
||||||
# to generate the final dhcp configuration.
|
|
||||||
# This file can be replaced with xenguest-network.bbappend.
|
|
||||||
{
|
|
||||||
"Dhcp4": {
|
|
||||||
"interfaces-config": {
|
|
||||||
"interfaces": [ ]
|
|
||||||
},
|
|
||||||
"lease-database": {
|
|
||||||
"type": "memfile",
|
|
||||||
"persist": false
|
|
||||||
},
|
|
||||||
"subnet4": [
|
|
||||||
{
|
|
||||||
"subnet": "192.0.2.0/24"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"loggers": [
|
|
||||||
{
|
|
||||||
"name": "kea-dhcp4",
|
|
||||||
"output_options": [ { "output": "/var/log/kea-dhcp4.log" } ],
|
|
||||||
"severity": "INFO"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user