Compare commits
10 Commits
1bf85d4b06
...
master
Author | SHA1 | Date | |
---|---|---|---|
a68f3116c9 | |||
9b52abc57c | |||
fd67e20064 | |||
2b74b65415 | |||
1270ababde | |||
13967c048b | |||
a003541cbe | |||
f4669ff409 | |||
59fb332512 | |||
500008e866 |
@@ -14,6 +14,7 @@ BBLAYERS ?= " \
|
|||||||
${TOPDIR}/../layers/meta-openembedded/meta-networking \
|
${TOPDIR}/../layers/meta-openembedded/meta-networking \
|
||||||
${TOPDIR}/../layers/meta-openembedded/meta-perl \
|
${TOPDIR}/../layers/meta-openembedded/meta-perl \
|
||||||
${TOPDIR}/../layers/meta-openembedded/meta-python \
|
${TOPDIR}/../layers/meta-openembedded/meta-python \
|
||||||
|
${TOPDIR}/../layers/meta-openembedded/meta-webserver \
|
||||||
${TOPDIR}/../layers/meta-raspberrypi \
|
${TOPDIR}/../layers/meta-raspberrypi \
|
||||||
${TOPDIR}/../layers/meta-virtualization \
|
${TOPDIR}/../layers/meta-virtualization \
|
||||||
${TOPDIR}/../layers/meta-security \
|
${TOPDIR}/../layers/meta-security \
|
||||||
|
@@ -40,6 +40,8 @@ TCLIBC = "glibc"
|
|||||||
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"
|
||||||
|
@@ -11,5 +11,5 @@ BBFILE_COLLECTIONS += "meta-blackfinn"
|
|||||||
BBFILE_PATTERN_meta-blackfinn = "^${LAYERDIR}/"
|
BBFILE_PATTERN_meta-blackfinn = "^${LAYERDIR}/"
|
||||||
BBFILE_PRIORITY_meta-blackfinn = "12"
|
BBFILE_PRIORITY_meta-blackfinn = "12"
|
||||||
|
|
||||||
LAYERSERIES_COMPAT_meta-blackfinn = "gatesgarth dunfell zeus warrior thud sumo rocko"
|
LAYERSERIES_COMPAT_meta-blackfinn = "hardknott gatesgarth dunfell zeus warrior thud sumo rocko"
|
||||||
|
|
||||||
|
@@ -24,8 +24,8 @@ RDEPENDS_${PN} += " \
|
|||||||
python3 \
|
python3 \
|
||||||
python3-gunicorn \
|
python3-gunicorn \
|
||||||
python3-flask \
|
python3-flask \
|
||||||
rpi.gpio \
|
python3-rpi.gpio \
|
||||||
w1thermsensor \
|
python3-w1thermsensor \
|
||||||
"
|
"
|
||||||
|
|
||||||
FILES_${PN} = " \
|
FILES_${PN} = " \
|
||||||
|
@@ -24,7 +24,7 @@ RDEPENDS_${PN} += "\
|
|||||||
python3 \
|
python3 \
|
||||||
python3-gunicorn \
|
python3-gunicorn \
|
||||||
python3-flask \
|
python3-flask \
|
||||||
rpi.gpio \
|
python3-rpi.gpio \
|
||||||
"
|
"
|
||||||
|
|
||||||
FILES_${PN} = " \
|
FILES_${PN} = " \
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
LICENSE = "GPLv2"
|
LICENSE = "GPLv2"
|
||||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
|
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
|
||||||
|
|
||||||
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
|
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=9
|
||||||
|
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=rpi4-$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
|
@@ -7,8 +7,8 @@ require console-image-base.inc
|
|||||||
DEV_SDK_INSTALL += " \
|
DEV_SDK_INSTALL += " \
|
||||||
git \
|
git \
|
||||||
make \
|
make \
|
||||||
python-pip \
|
python3-pip \
|
||||||
python-dev \
|
python3-dev \
|
||||||
bash \
|
bash \
|
||||||
packagegroup-core-buildessential \
|
packagegroup-core-buildessential \
|
||||||
"
|
"
|
||||||
|
@@ -29,7 +29,7 @@ DEV_SDK_INSTALL = " \
|
|||||||
file \
|
file \
|
||||||
perl-modules \
|
perl-modules \
|
||||||
pkgconfig \
|
pkgconfig \
|
||||||
python-modules \
|
python3-modules \
|
||||||
"
|
"
|
||||||
|
|
||||||
EXTRA_TOOLS_INSTALL = " \
|
EXTRA_TOOLS_INSTALL = " \
|
||||||
@@ -42,7 +42,6 @@ EXTRA_TOOLS_INSTALL = " \
|
|||||||
findutils \
|
findutils \
|
||||||
i2c-tools \
|
i2c-tools \
|
||||||
less \
|
less \
|
||||||
mc \
|
|
||||||
procps \
|
procps \
|
||||||
rsync \
|
rsync \
|
||||||
sysfsutils \
|
sysfsutils \
|
||||||
@@ -57,7 +56,6 @@ EXTRA_TOOLS_INSTALL = " \
|
|||||||
"
|
"
|
||||||
|
|
||||||
MQTT = " \
|
MQTT = " \
|
||||||
python-paho-mqtt \
|
|
||||||
"
|
"
|
||||||
|
|
||||||
PYTHON_LIBS = " \
|
PYTHON_LIBS = " \
|
||||||
|
@@ -6,7 +6,9 @@ require app-container-image.bb
|
|||||||
|
|
||||||
IMAGE_INSTALL += " \
|
IMAGE_INSTALL += " \
|
||||||
busybox \
|
busybox \
|
||||||
|
busybox-initcfg \
|
||||||
greenhouse \
|
greenhouse \
|
||||||
|
tzdata \
|
||||||
"
|
"
|
||||||
|
|
||||||
# docker run
|
# docker run
|
||||||
|
14
recipes-core/images/homeserver-image.bb
Normal file
14
recipes-core/images/homeserver-image.bb
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
SUMMARY = "homeserver host system"
|
||||||
|
HOMEPAGE = "https://blackfinn.de"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
|
||||||
|
require docker-host-image.bb
|
||||||
|
require dev-image.inc
|
||||||
|
|
||||||
|
IMAGE_INSTALL_append = " \
|
||||||
|
nginx \
|
||||||
|
python3-docker-compose \
|
||||||
|
"
|
||||||
|
|
||||||
|
export IMAGE_BASENAME = "homeserver-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 ; \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
@@ -11,8 +11,6 @@ inherit pypi setuptools3
|
|||||||
|
|
||||||
PYPI_PACKAGE = "w1thermsensor"
|
PYPI_PACKAGE = "w1thermsensor"
|
||||||
|
|
||||||
# TARGET_CFLAGS += "-fcommon"
|
|
||||||
|
|
||||||
RDEPENDS_${PN} = " \
|
RDEPENDS_${PN} = " \
|
||||||
python3 \
|
python3 \
|
||||||
"
|
"
|
Reference in New Issue
Block a user