Compare commits
18 Commits
de8f190eaa
...
gatesgarth
Author | SHA1 | Date | |
---|---|---|---|
a003541cbe | |||
f4669ff409 | |||
59fb332512 | |||
500008e866 | |||
1bf85d4b06 | |||
2ca4554a48 | |||
a448d9a2e5 | |||
4f3bd729e6 | |||
faaf992e4e | |||
03dd24fbe6 | |||
7a8003e482 | |||
8a02910512 | |||
59f576a955 | |||
63bf0841e5 | |||
dd5a355dd5 | |||
573653228d | |||
a76caf5187 | |||
0570847e71 |
@@ -31,6 +31,8 @@ ENABLE_UART = "1"
|
|||||||
ENABLE_SPI_BUS = "1"
|
ENABLE_SPI_BUS = "1"
|
||||||
ENABLE_I2C = "1"
|
ENABLE_I2C = "1"
|
||||||
|
|
||||||
|
RPI_EXTRA_CONFIG = "dtoverlay=w1-gpio,gpiopin=4"
|
||||||
|
|
||||||
RPI_USE_U_BOOT = "1"
|
RPI_USE_U_BOOT = "1"
|
||||||
|
|
||||||
INHERIT += "rm_work"
|
INHERIT += "rm_work"
|
||||||
|
@@ -31,6 +31,8 @@ ENABLE_UART = "1"
|
|||||||
ENABLE_SPI_BUS = "1"
|
ENABLE_SPI_BUS = "1"
|
||||||
ENABLE_I2C = "1"
|
ENABLE_I2C = "1"
|
||||||
|
|
||||||
|
RPI_EXTRA_CONFIG = "dtoverlay=w1-gpio,gpiopin=4"
|
||||||
|
|
||||||
RPI_USE_U_BOOT = "1"
|
RPI_USE_U_BOOT = "1"
|
||||||
|
|
||||||
INHERIT += "rm_work"
|
INHERIT += "rm_work"
|
||||||
|
@@ -24,8 +24,15 @@ DISTRO_FEATURES = " \
|
|||||||
POKY_DEFAULT_EXTRA_RDEPENDS = "packagegroup-core-boot"
|
POKY_DEFAULT_EXTRA_RDEPENDS = "packagegroup-core-boot"
|
||||||
POKY_DEFAULT_EXTRA_RRECOMMENDS = "kernel-module-af-packet"
|
POKY_DEFAULT_EXTRA_RRECOMMENDS = "kernel-module-af-packet"
|
||||||
|
|
||||||
|
# INIT_MANAGER ?= "none"
|
||||||
|
# INIT_MANAGER ?= "sysvinit"
|
||||||
|
# INIT_MANAGER ?= "systemd"
|
||||||
INIT_MANAGER ?= "mdev-busybox"
|
INIT_MANAGER ?= "mdev-busybox"
|
||||||
TCLIBC = "musl"
|
|
||||||
|
TCLIBC = "glibc"
|
||||||
|
# TCLIBC = "newlib"
|
||||||
|
# TCLIBC = "musl"
|
||||||
|
# TLIBC = "baremetal"
|
||||||
|
|
||||||
# Disable wide char support for ncurses as we don't include it in
|
# Disable wide char support for ncurses as we don't include it in
|
||||||
# in the LIBC features below.
|
# in the LIBC features below.
|
||||||
@@ -33,6 +40,8 @@ TCLIBC = "musl"
|
|||||||
ENABLE_WIDEC = "false"
|
ENABLE_WIDEC = "false"
|
||||||
ENABLE_WIDEC_class-native = "true"
|
ENABLE_WIDEC_class-native = "true"
|
||||||
|
|
||||||
|
DEFAULT_TIMEZONE = "Europe/Berlin"
|
||||||
|
|
||||||
# Drop native language support. This removes the
|
# Drop native language support. This removes the
|
||||||
# eglibc->bash->gettext->libc-posix-clang-wchar dependency.
|
# eglibc->bash->gettext->libc-posix-clang-wchar dependency.
|
||||||
USE_NLS="no"
|
USE_NLS="no"
|
||||||
@@ -42,3 +51,6 @@ SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
|
|||||||
MAINTAINER = "rorodist "
|
MAINTAINER = "rorodist "
|
||||||
INHERIT += "buildhistory"
|
INHERIT += "buildhistory"
|
||||||
BUILDHISTORY_COMMIT = "1"
|
BUILDHISTORY_COMMIT = "1"
|
||||||
|
|
||||||
|
KERNEL_MODULE_AUTOLOAD += "w1-gpio"
|
||||||
|
KERNEL_MODULE_AUTOLOAD += "w1-therm"
|
||||||
|
3
recipes-app/greenhouse/files/run.sh
Normal file
3
recipes-app/greenhouse/files/run.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
gunicorn --bind 0.0.0.0:80 greenhouse:app
|
35
recipes-app/greenhouse/greenhouse.bb
Normal file
35
recipes-app/greenhouse/greenhouse.bb
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
SUMMARY = "Greenhouse control"
|
||||||
|
SECTION = "Applications"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||||
|
|
||||||
|
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
|
||||||
|
|
||||||
|
PR = "r0"
|
||||||
|
SRCREV = "${AUTOREV}"
|
||||||
|
SRC_URI = " \
|
||||||
|
git://git.blackfinn.de/python/greenhouse.git;protocol=https;branch=master \
|
||||||
|
file://run.sh \
|
||||||
|
"
|
||||||
|
|
||||||
|
S = "${WORKDIR}/git"
|
||||||
|
|
||||||
|
do_install_append () {
|
||||||
|
install -d ${D}/usr/
|
||||||
|
install -d ${D}/usr/bin/
|
||||||
|
install -m 0755 ${WORKDIR}/run.sh ${D}/usr/bin/
|
||||||
|
}
|
||||||
|
|
||||||
|
RDEPENDS_${PN} += " \
|
||||||
|
python3 \
|
||||||
|
python3-gunicorn \
|
||||||
|
python3-flask \
|
||||||
|
rpi.gpio \
|
||||||
|
w1thermsensor \
|
||||||
|
"
|
||||||
|
|
||||||
|
FILES_${PN} = " \
|
||||||
|
/usr/bin/run.sh \
|
||||||
|
"
|
||||||
|
|
||||||
|
inherit setuptools3
|
3
recipes-app/yardlight/files/run.sh
Normal file
3
recipes-app/yardlight/files/run.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
gunicorn --bind 0.0.0.0:80 weblight:app
|
34
recipes-app/yardlight/yardlight.bb
Normal file
34
recipes-app/yardlight/yardlight.bb
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
SUMMARY = "Yardlight switcher with web ui"
|
||||||
|
SECTION = "Applications"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||||
|
|
||||||
|
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
|
||||||
|
|
||||||
|
PR = "r0"
|
||||||
|
SRCREV = "${AUTOREV}"
|
||||||
|
SRC_URI = " \
|
||||||
|
git://git.blackfinn.de/python/weblight.git;protocol=https;branch=master \
|
||||||
|
file://run.sh \
|
||||||
|
"
|
||||||
|
|
||||||
|
S = "${WORKDIR}/git"
|
||||||
|
|
||||||
|
do_install_append () {
|
||||||
|
install -d ${D}/usr/
|
||||||
|
install -d ${D}/usr/bin/
|
||||||
|
install -m 0755 ${WORKDIR}/run.sh ${D}/usr/bin/
|
||||||
|
}
|
||||||
|
|
||||||
|
RDEPENDS_${PN} += "\
|
||||||
|
python3 \
|
||||||
|
python3-gunicorn \
|
||||||
|
python3-flask \
|
||||||
|
rpi.gpio \
|
||||||
|
"
|
||||||
|
|
||||||
|
FILES_${PN} = " \
|
||||||
|
/usr/bin/run.sh \
|
||||||
|
"
|
||||||
|
|
||||||
|
inherit setuptools3
|
@@ -5,6 +5,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
|
|||||||
|
|
||||||
SRC_URI += " \
|
SRC_URI += " \
|
||||||
file://S20load_modules.sh \
|
file://S20load_modules.sh \
|
||||||
|
file://S99firstboot.sh \
|
||||||
file://S49cgroups_mount.sh \
|
file://S49cgroups_mount.sh \
|
||||||
file://ntp.conf \
|
file://ntp.conf \
|
||||||
file://ntpd \
|
file://ntpd \
|
||||||
@@ -17,6 +18,7 @@ do_install_append () {
|
|||||||
install -m 0644 ${WORKDIR}/ntp.conf ${D}${sysconfdir}
|
install -m 0644 ${WORKDIR}/ntp.conf ${D}${sysconfdir}
|
||||||
install -m 0755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d/
|
install -m 0755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d/
|
||||||
install -m 0755 ${WORKDIR}/S20load_modules.sh ${D}${sysconfdir}/rcS.d/
|
install -m 0755 ${WORKDIR}/S20load_modules.sh ${D}${sysconfdir}/rcS.d/
|
||||||
|
install -m 0755 ${WORKDIR}/S99firstboot.sh ${D}${sysconfdir}/rcS.d/
|
||||||
install -m 0755 ${WORKDIR}/S49cgroups_mount.sh ${D}${sysconfdir}/rcS.d/
|
install -m 0755 ${WORKDIR}/S49cgroups_mount.sh ${D}${sysconfdir}/rcS.d/
|
||||||
|
|
||||||
cd ${D}${sysconfdir}/rcS.d/
|
cd ${D}${sysconfdir}/rcS.d/
|
||||||
|
110
recipes-core/busybox/files/S99firstboot.sh
Normal file
110
recipes-core/busybox/files/S99firstboot.sh
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
function generate_hostname() {
|
||||||
|
mac=$( ifconfig |grep eth0 | grep -io '[0-9a-f:]\{15\}[0-9a-f]\{2\}' )
|
||||||
|
mac=${mac//:}
|
||||||
|
nic=${mac:6}
|
||||||
|
nic=$(( 16#$nic ))
|
||||||
|
let length=32
|
||||||
|
|
||||||
|
for i in 4 3 2 1 0; do
|
||||||
|
let div=$length**$i
|
||||||
|
let idx=$nic/$div
|
||||||
|
let nic=$nic%$div
|
||||||
|
|
||||||
|
if [ $idx = 0 ] ; then
|
||||||
|
res=a
|
||||||
|
elif [ $idx = 1 ] ; then
|
||||||
|
res=b
|
||||||
|
elif [ $idx = 2 ] ; then
|
||||||
|
res=c
|
||||||
|
elif [ $idx = 3 ] ; then
|
||||||
|
res=d
|
||||||
|
elif [ $idx = 4 ] ; then
|
||||||
|
res=e
|
||||||
|
elif [ $idx = 5 ] ; then
|
||||||
|
res=f
|
||||||
|
elif [ $idx = 6 ] ; then
|
||||||
|
res=g
|
||||||
|
elif [ $idx = 7 ] ; then
|
||||||
|
res=h
|
||||||
|
elif [ $idx = 8 ] ; then
|
||||||
|
res=i
|
||||||
|
elif [ $idx = 9 ] ; then
|
||||||
|
res=j
|
||||||
|
elif [ $idx = 10 ] ; then
|
||||||
|
res=k
|
||||||
|
elif [ $idx = 11 ] ; then
|
||||||
|
res=m
|
||||||
|
elif [ $idx = 12 ] ; then
|
||||||
|
res=n
|
||||||
|
elif [ $idx = 13 ] ; then
|
||||||
|
res=p
|
||||||
|
elif [ $idx = 14 ] ; then
|
||||||
|
res=q
|
||||||
|
elif [ $idx = 15 ] ; then
|
||||||
|
res=r
|
||||||
|
elif [ $idx = 16 ] ; then
|
||||||
|
res=s
|
||||||
|
elif [ $idx = 17 ] ; then
|
||||||
|
res=t
|
||||||
|
elif [ $idx = 18 ] ; then
|
||||||
|
res=u
|
||||||
|
elif [ $idx = 19 ] ; then
|
||||||
|
res=v
|
||||||
|
elif [ $idx = 20 ] ; then
|
||||||
|
res=w
|
||||||
|
elif [ $idx = 21 ] ; then
|
||||||
|
res=x
|
||||||
|
elif [ $idx = 22 ] ; then
|
||||||
|
res=y
|
||||||
|
elif [ $idx = 23 ] ; then
|
||||||
|
res=z
|
||||||
|
elif [ $idx = 24 ] ; then
|
||||||
|
res=2
|
||||||
|
elif [ $idx = 25 ] ; then
|
||||||
|
res=3
|
||||||
|
elif [ $idx = 26 ] ; then
|
||||||
|
res=4
|
||||||
|
elif [ $idx = 27 ] ; then
|
||||||
|
res=5
|
||||||
|
elif [ $idx = 28 ] ; then
|
||||||
|
res=6
|
||||||
|
elif [ $idx = 29 ] ; then
|
||||||
|
res=7
|
||||||
|
elif [ $idx = 30 ] ; then
|
||||||
|
res=8
|
||||||
|
elif [ $idx = 31 ] ; then
|
||||||
|
res=8
|
||||||
|
fi
|
||||||
|
basex="$basex${res}"
|
||||||
|
done
|
||||||
|
|
||||||
|
old_hostname=$( cat /etc/hostname )
|
||||||
|
new_hostname=unknown-$basex
|
||||||
|
|
||||||
|
if [ $old_hostname = raspberrypi3-64 ]
|
||||||
|
then
|
||||||
|
new_hostname=rpi3-$basex
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $old_hostname = raspberrypi4-64 ]
|
||||||
|
then
|
||||||
|
new_hostname=rpi3-$basex
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $new_hostname > /etc/hostname
|
||||||
|
}
|
||||||
|
|
||||||
|
FLAG="/var/local/firstboot.log"
|
||||||
|
|
||||||
|
if [ ! -f $FLAG ]; then
|
||||||
|
echo "First boot"
|
||||||
|
touch $FLAG
|
||||||
|
|
||||||
|
generate_hostname
|
||||||
|
generate_avahi_service
|
||||||
|
|
||||||
|
|
||||||
|
reboot
|
||||||
|
fi
|
22
recipes-core/images/app-container-image.bb
Normal file
22
recipes-core/images/app-container-image.bb
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
SUMMARY = "A minimal container image"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
|
||||||
|
|
||||||
|
PREFERRED_PROVIDER_virtual/kernel = "linux-dummy"
|
||||||
|
|
||||||
|
IMAGE_FSTYPES = "container oci"
|
||||||
|
|
||||||
|
inherit image
|
||||||
|
inherit image-oci
|
||||||
|
|
||||||
|
IMAGE_FEATURES = ""
|
||||||
|
IMAGE_LINGUAS = ""
|
||||||
|
NO_RECOMMENDATIONS = "1"
|
||||||
|
|
||||||
|
IMAGE_CONTAINER_NO_DUMMY = "0"
|
||||||
|
|
||||||
|
IMAGE_INSTALL = " \
|
||||||
|
base-files \
|
||||||
|
base-passwd \
|
||||||
|
netbase \
|
||||||
|
"
|
6
recipes-core/images/dev-image.inc
Normal file
6
recipes-core/images/dev-image.inc
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
IMAGE_INSTALL_append = " \
|
||||||
|
git \
|
||||||
|
sudo \
|
||||||
|
vim \
|
||||||
|
"
|
@@ -3,11 +3,7 @@ HOMEPAGE = "https://blackfinn.de"
|
|||||||
LICENSE = "MIT"
|
LICENSE = "MIT"
|
||||||
|
|
||||||
require docker-host-image.bb
|
require docker-host-image.bb
|
||||||
|
require dev-image.inc
|
||||||
IMAGE_INSTALL_append = " \
|
|
||||||
git \
|
|
||||||
vim \
|
|
||||||
"
|
|
||||||
|
|
||||||
export IMAGE_BASENAME = "docker-host-dev-image"
|
export IMAGE_BASENAME = "docker-host-dev-image"
|
||||||
|
|
||||||
|
23
recipes-core/images/greenhouse-container-image.bb
Normal file
23
recipes-core/images/greenhouse-container-image.bb
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
SUMMARY = "Greenhouse container image"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
|
||||||
|
|
||||||
|
require app-container-image.bb
|
||||||
|
|
||||||
|
IMAGE_INSTALL += " \
|
||||||
|
busybox \
|
||||||
|
busybox-initcfg \
|
||||||
|
greenhouse \
|
||||||
|
tzdata \
|
||||||
|
"
|
||||||
|
|
||||||
|
# docker run
|
||||||
|
# --detach
|
||||||
|
# --restart always
|
||||||
|
# --cap-add SYS_RAWIO
|
||||||
|
# --device=/dev/mem:/dev/mem
|
||||||
|
# --device=/dev/gpiomem:/dev/gpiomem
|
||||||
|
# --publish 80:80
|
||||||
|
# --name greenhouse
|
||||||
|
# greenhouse
|
||||||
|
# run.sh
|
8
recipes-core/images/podman-host-dev-image.bb
Normal file
8
recipes-core/images/podman-host-dev-image.bb
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
SUMMARY = "A tiny image"
|
||||||
|
HOMEPAGE = "https://blackfinn.de"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
|
||||||
|
require podman-host-image.bb
|
||||||
|
require dev-image.inc
|
||||||
|
|
||||||
|
export IMAGE_BASENAME = "podman-host-dev-image"
|
@@ -31,16 +31,10 @@ IMAGE_INSTALL += " \
|
|||||||
|
|
||||||
IMAGE_INSTALL_append_beaglebone-yocto = " linux-firmware-rtl8192cu"
|
IMAGE_INSTALL_append_beaglebone-yocto = " linux-firmware-rtl8192cu"
|
||||||
|
|
||||||
set_local_timezone() {
|
|
||||||
ln -sf /usr/share/zoneinfo/Europe/Berlin ${IMAGE_ROOTFS}/etc/localtime
|
|
||||||
}
|
|
||||||
|
|
||||||
disable_bootlogd() {
|
disable_bootlogd() {
|
||||||
echo BOOTLOGD_ENABLE=no > ${IMAGE_ROOTFS}/etc/default/bootlogd
|
echo BOOTLOGD_ENABLE=no > ${IMAGE_ROOTFS}/etc/default/bootlogd
|
||||||
}
|
}
|
||||||
|
|
||||||
ROOTFS_POSTPROCESS_COMMAND += " \
|
ROOTFS_POSTPROCESS_COMMAND += " \
|
||||||
set_local_timezone ; \
|
|
||||||
disable_bootlogd ; \
|
disable_bootlogd ; \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
21
recipes-core/images/yardlight-container-image.bb
Normal file
21
recipes-core/images/yardlight-container-image.bb
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
SUMMARY = "Busybox container image"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
|
||||||
|
|
||||||
|
require app-container-image.bb
|
||||||
|
|
||||||
|
IMAGE_INSTALL += " \
|
||||||
|
busybox \
|
||||||
|
yardlight \
|
||||||
|
"
|
||||||
|
|
||||||
|
# docker run
|
||||||
|
# --detach
|
||||||
|
# --restart always
|
||||||
|
# --cap-add SYS_RAWIO
|
||||||
|
# --device=/dev/mem:/dev/mem
|
||||||
|
# --device=/dev/gpiomem:/dev/gpiomem
|
||||||
|
# --publish 80:80
|
||||||
|
# --name yardlight
|
||||||
|
# yardlight
|
||||||
|
# run.sh
|
18
recipes-devtools/rpi.gpio/rpi.gpio_0.7.0.bb
Normal file
18
recipes-devtools/rpi.gpio/rpi.gpio_0.7.0.bb
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
SUMMARY = "RPi.GPIO"
|
||||||
|
SECTION = "Devtools"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||||
|
|
||||||
|
PR = "r0"
|
||||||
|
|
||||||
|
SRC_URI[sha256sum] = "7424bc6c205466764f30f666c18187a0824077daf20b295c42f08aea2cb87d3f"
|
||||||
|
|
||||||
|
inherit pypi setuptools3
|
||||||
|
|
||||||
|
PYPI_PACKAGE = "RPi.GPIO"
|
||||||
|
|
||||||
|
TARGET_CFLAGS += "-fcommon"
|
||||||
|
|
||||||
|
RDEPENDS_${PN} = " \
|
||||||
|
python3 \
|
||||||
|
"
|
18
recipes-devtools/w1thermsensor/w1thermsensor_2.0.0.bb
Normal file
18
recipes-devtools/w1thermsensor/w1thermsensor_2.0.0.bb
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
SUMMARY = "RPi.GPIO"
|
||||||
|
SECTION = "Devtools"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||||
|
|
||||||
|
PR = "r0"
|
||||||
|
|
||||||
|
SRC_URI[sha256sum] = "11c684af807c89c6f066ed93cb7cfc00082095fef8899e412e92e748e642d9c1"
|
||||||
|
|
||||||
|
inherit pypi setuptools3
|
||||||
|
|
||||||
|
PYPI_PACKAGE = "w1thermsensor"
|
||||||
|
|
||||||
|
# TARGET_CFLAGS += "-fcommon"
|
||||||
|
|
||||||
|
RDEPENDS_${PN} = " \
|
||||||
|
python3 \
|
||||||
|
"
|
Reference in New Issue
Block a user