Merge branch 'develop/docker-image' of yocto/meta-blackfinn into zeus

This commit is contained in:
tkl 2020-01-30 21:09:37 +00:00
commit 3163a12dec
30 changed files with 401 additions and 21 deletions

View File

@ -1,6 +1,7 @@
Common targets are:
console-image
console-dev-image
tiny-image
core-image-minimal
core-image-sato
meta-toolchain

View File

@ -4,7 +4,7 @@ MACHINE ?= "bananapi-m3"
#SSTATE_DIR ?= "${TOPDIR}/../../sstate-cache"
#TMPDIR = "${TOPDIR}/tmp"
DISTRO ?= "poky"
DISTRO ?= "roro"
PACKAGE_CLASSES ?= "package_ipk"
#SDKMACHINE ?= "i686"

View File

@ -1,6 +1,6 @@
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
POKY_BBLAYERS_CONF_VERSION = "3"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
@ -9,8 +9,12 @@ BBLAYERS ?= " \
${TOPDIR}/../layers/poky/meta \
${TOPDIR}/../layers/poky/meta-poky \
${TOPDIR}/../layers/poky/meta-yocto-bsp \
${TOPDIR}/../layers/meta-openembedded/meta-filesystems \
${TOPDIR}/../layers/meta-openembedded/meta-oe \
${TOPDIR}/../layers/meta-openembedded/meta-networking \
${TOPDIR}/../layers/meta-openembedded/meta-python \
${TOPDIR}/../layers/meta-virtualization \
${TOPDIR}/../layers/meta-raspberrypi \
${TOPDIR}/../layers/meta-blackfinn \
"

View File

@ -1,6 +1,8 @@
Common targets are:
console-image
console-dev-image
docker-image
tiny-image
core-image-minimal
core-image-sato
meta-toolchain

View File

@ -4,7 +4,7 @@ MACHINE ?= "beaglebone-yocto"
#SSTATE_DIR ?= "${TOPDIR}/../../sstate-cache"
#TMPDIR = "${TOPDIR}/tmp"
DISTRO ?= "poky"
DISTRO ?= "roro"
PACKAGE_CLASSES ?= "package_ipk"
#SDKMACHINE ?= "i686"
@ -15,6 +15,8 @@ USER_CLASSES ?= "buildstats image-mklibs image-prelink"
IMAGE_BOOT_FILES_append = " uEnv.txt"
SERIAL_CONSOLES = "115200;ttyS0"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS = "\

View File

@ -1,6 +1,6 @@
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
POKY_BBLAYERS_CONF_VERSION = "3"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
@ -9,9 +9,11 @@ BBLAYERS ?= " \
${TOPDIR}/../layers/poky/meta \
${TOPDIR}/../layers/poky/meta-poky \
${TOPDIR}/../layers/poky/meta-yocto-bsp \
${TOPDIR}/../layers/meta-openembedded/meta-filesystems \
${TOPDIR}/../layers/meta-openembedded/meta-oe \
${TOPDIR}/../layers/meta-openembedded/meta-networking \
${TOPDIR}/../layers/meta-openembedded/meta-python \
${TOPDIR}/../layers/meta-raspberrypi \
${TOPDIR}/../layers/meta-virtualization \
${TOPDIR}/../layers/meta-blackfinn \
"

View File

@ -1,6 +1,8 @@
Common targets are:
console-image
console-dev-image
tiny-image
docker-image
core-image-minimal
core-image-sato
meta-toolchain

View File

@ -1,6 +1,6 @@
MACHINE ?= "raspberrypi3-64"
DISTRO ?= "poky"
DISTRO ?= "roro"
PACKAGE_CLASSES ?= "package_ipk"
#SDKMACHINE ?= "i686"
@ -27,6 +27,10 @@ BB_DISKMON_DIRS = "\
CONF_VERSION = "1"
ENABLE_UART = "1"
ENABLE_SPI = "1"
ENABLE_I2C = "1"
INHERIT += "rm_work"
INHERIT += "own-mirrors"

44
conf/distro/roro.conf Normal file
View File

@ -0,0 +1,44 @@
require conf/distro/poky.conf
# distro name
DISTRO = "roro"
DISTRO_NAME = "roro distribution"
DISTRO_VERSION = "1.0"
DISTRO_CODENAME = "roro"
#DISTRO_FEATURES_append = " alsa usbhost usbgadget keyboard bluetooth"
# Comment out any of the lines below to disable them in the build
# DISTRO_FEATURES options:
# alsa bluetooth ext2 pcmcia usbgadget usbhost wifi nfs zeroconf pci
DISTRO_FEATURES_TINY = "largefile zeroconf virtualization"
DISTRO_FEATURES_NET = "ipv4 ipv6"
DISTRO_FEATURES_USB = "usbhost"
DISTRO_FEATURES_WIFI = "wifi"
DISTRO_FEATURES = " \
${DISTRO_FEATURES_TINY} \
${DISTRO_FEATURES_NET} \
${DISTRO_FEATURES_USB} \
${DISTRO_FEATURES_WIFI} \
"
POKY_DEFAULT_EXTRA_RDEPENDS = "packagegroup-core-boot"
POKY_DEFAULT_EXTRA_RRECOMMENDS = "kernel-module-af-packet"
INIT_MANAGER ?= "mdev-busybox"
TCLIBC = "musl"
# Disable wide char support for ncurses as we don't include it in
# in the LIBC features below.
# Leave native enable to avoid build failures
ENABLE_WIDEC = "false"
ENABLE_WIDEC_class-native = "true"
# Drop native language support. This removes the
# eglibc->bash->gettext->libc-posix-clang-wchar dependency.
USE_NLS="no"
SDK_VENDOR = "-rorodistsdk"
SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
MAINTAINER = "rorodist "
INHERIT += "buildhistory"
BUILDHISTORY_COMMIT = "1"

View File

@ -1,15 +0,0 @@
require conf/distro/poky.conf
# distro name
DISTRO = "tkl"
DISTRO_NAME = "tkl distribution"
DISTRO_VERSION = "1.0"
DISTRO_CODENAME = "tkl"
#DISTRO_FEATURES_append = " alsa usbhost usbgadget keyboard bluetooth"
PREFERRED_VERSION_mypy = "0.4.2"
SDK_VENDOR = "-tkldistsdk"
SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
MAINTAINER = "tkldist "
INHERIT += "buildhistory"
BUILDHISTORY_COMMIT = "1"

View File

@ -0,0 +1,9 @@
do_install_append () {
install -d ${D}${sysconfdir}/
install -d ${D}${sysconfdir}/rcS.d/
cd ${D}${sysconfdir}/rcS.d/
ln -s ../init.d/sshd S47sshd.sh
}

View File

@ -0,0 +1,5 @@
LICENSE = "GPLv2"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += " file://docker.init"

View File

@ -0,0 +1,131 @@
#!/bin/sh
#
# /etc/rc.d/init.d/docker
#
# Daemon for docker.com
#
# chkconfig: 2345 95 95
# description: Daemon for docker.com
### BEGIN INIT INFO
# Provides: docker
# Required-Start: $network cgconfig
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop docker
# Description: Daemon for docker.com
### END INIT INFO
# Source function library.
. /etc/init.d/functions
prog="dockerd"
unshare=/usr/bin/unshare
exec="/usr/bin/$prog"
pidfile="/var/run/$prog.pid"
lockfile="/var/lock/subsys/$prog"
logfile="/var/log/$prog"
other_args="--pidfile $pidfile --registry-mirror=http://localhost:5000 --insecure-registry=http://localhost:5000 --raw-logs"
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
start() {
[ -x $exec ] || exit 5
check_for_cleanup
if ! [ -f $pidfile ]; then
printf "Starting $prog:\t"
echo -e "\n$(date)\n" >> $logfile
"$unshare" -m -- $exec $other_args & >> $logfile &
pid=$!
touch $lockfile
# wait up to 10 seconds for the pidfile to exist. see
# https://github.com/docker/docker/issues/5359
tries=0
while [ ! -f $pidfile -a $tries -lt 10 ]; do
sleep 1
tries=$((tries + 1))
done
success
echo
else
failure
echo
printf "$pidfile still exists...\n"
exit 7
fi
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
check_for_cleanup() {
if [ -f ${pidfile} ]; then
/bin/ps -fp $(cat ${pidfile}) > /dev/null || rm ${pidfile}
fi
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

View File

@ -0,0 +1,28 @@
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
#file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += " \
file://S20load_modules.sh \
file://S49cgroups_mount.sh \
file://ntp.conf \
file://ntpd \
"
do_install_append () {
install -d ${D}${sysconfdir}/
install -d ${D}${sysconfdir}/rcS.d/
install -d ${D}${sysconfdir}/init.d/
install -m 0644 ${WORKDIR}/ntp.conf ${D}${sysconfdir}
install -m 0755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d/
install -m 0755 ${WORKDIR}/S20load_modules.sh ${D}${sysconfdir}/rcS.d/
install -m 0755 ${WORKDIR}/S49cgroups_mount.sh ${D}${sysconfdir}/rcS.d/
cd ${D}${sysconfdir}/rcS.d/
ln -s ../init.d/networking S40networking.sh
ln -s ../init.d/ntpd S48ntpd.sh
ln -s ../init.d/docker.init S50docker.sh
}

View File

@ -0,0 +1,4 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += " file://fragments.cfg"

View File

@ -0,0 +1,26 @@
#!/bin/sh
LOAD_DIR="/etc/modules-load.d"
MODULES="$(ls $LOAD_DIR)"
case "${1}" in
start)
for MOD in $MODULES;
do
while read module args;
do
# Ignore comments and blank lines
case "$module" in
""|"#"*) continue;;
esac
modprobe ${module} ${args}
done < $LOAD_DIR/$MOD
done
;;
*)
echo "Usage: ${0} {start}"
exit 1
;;
esac

View File

@ -0,0 +1,12 @@
#!/bin/sh
case "${1}" in
start)
cgroups-mount
;;
*)
echo "Usage: ${0} {start}"
exit 1
;;
esac

View File

@ -0,0 +1,5 @@
CONFIG_NTPD=y
CONFIG_FEATURE_NTPD_SERVER=y
CONFIG_FEATURE_NTPD_CONF=y
CONFIG_FEATURE_NTP_AUTH=y

View File

@ -0,0 +1,5 @@
server 0.europe.pool.ntp.org
server 1.europe.pool.ntp.org
server 2.europe.pool.ntp.org
server 3.europe.pool.ntp.org

View File

@ -0,0 +1,12 @@
#!/bin/sh
case "${1}" in
start)
ntpd -q
;;
*)
echo "Usage: ${0} {start}"
exit 1
;;
esac

View File

@ -40,7 +40,6 @@ EXTRA_TOOLS_INSTALL = " \
e2fsprogs-mke2fs \
ethtool \
findutils \
htop \
i2c-tools \
less \
mc \

View File

@ -0,0 +1,14 @@
SUMMARY = "A tiny image"
HOMEPAGE = "https://blackfinn.de"
LICENSE = "MIT"
require tiny-image-base.inc
IMAGE_INSTALL_append = " initscripts init-ifupdown docker-ce"
EXTRA_USERS_PARAMS += " \
usermod -a -G docker tkl \
"
export IMAGE_BASENAME = "docker-image"

View File

@ -0,0 +1,49 @@
inherit core-image
require users.inc
IMAGE_FEATURES += "package-management"
CORE_OS = " \
busybox-initcfg \
openssh \
openssh-keygen \
openssh-sftp-server \
psplash \
tzdata \
"
KERNEL_EXTRA_INSTALL = " \
kernel-modules \
"
WIFI_SUPPORT = " \
wpa-supplicant \
"
EXTRA_TOOLS_INSTALL = " \
"
IMAGE_INSTALL += " \
${CORE_OS} \
${EXTRA_TOOLS_INSTALL} \
${KERNEL_EXTRA_INSTALL} \
${WIFI_SUPPORT} \
"
IMAGE_INSTALL_append_beaglebone-yocto = " linux-firmware-rtl8192cu"
IMAGE_INSTALL_append_bananapi-m3 += " linux-firmware-bcm43430"
set_local_timezone() {
ln -sf /usr/share/zoneinfo/Europe/Berlin ${IMAGE_ROOTFS}/etc/localtime
}
disable_bootlogd() {
echo BOOTLOGD_ENABLE=no > ${IMAGE_ROOTFS}/etc/default/bootlogd
}
ROOTFS_POSTPROCESS_COMMAND += " \
set_local_timezone ; \
disable_bootlogd ; \
"

View File

@ -0,0 +1,8 @@
SUMMARY = "A tiny image"
HOMEPAGE = "https://blackfinn.de"
LICENSE = "MIT"
require tiny-image-base.inc
export IMAGE_BASENAME = "tiny-image"

View File

@ -0,0 +1,8 @@
inherit extrausers
# Encrypt the password with: echo "<password>" | openssl passwd -1 -stdin
EXTRA_USERS_PARAMS = " \
usermod -p '\$1\$4h5Qdc3i\$Vke4J2Ci5z.D3TtFDmV9r/' root; \
useradd -p '\$1\$4h5Qdc3i\$Vke4J2Ci5z.D3TtFDmV9r/' tkl; \
"

View File

@ -0,0 +1,10 @@
KERNEL_MODULE_AUTOLOAD += " brcmfmac"
do_install_append () {
install -d ${D}/lib/
install -d ${D}/lib/firmware/
install -d ${D}/lib/firmware/brcm
cd ${D}/lib/firmware/brcm
ln -s brcmfmac43430-sdio.raspberrypi,3-model-b.txt brcmfmac43430-sdio.txt
}

View File

@ -0,0 +1,4 @@
CONFIG_DEBUG_BLK_CGROUP=y
CONFIG_CFS_BANDWIDTH=y
CONFIG_CGROUP_RDMA=y

View File

@ -0,0 +1,2 @@
KERNEL_MODULE_AUTOLOAD += " brcmfmac i2c-dev spi-bcm2835"

View File

@ -3,6 +3,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
KERNEL_MODULE_AUTOLOAD += " rtl8192cu"
SRC_URI += " \
file://rtl8192cu.cfg \
file://enable_onboard_leds.cfg \
@ -14,5 +16,6 @@ KERNEL_CONFIG_FRAGMENTS_append_ti33x = " \
${WORKDIR}/rtl8192cu.cfg \
${WORKDIR}/enable_onboard_leds.cfg \
${WORKDIR}/enable_hostap_wext.cfg \
${WORKDIR}/enable_cgroups.cfg \
"