This commit is contained in:
fabian 2024-03-07 00:57:27 +01:00
parent 0d7c4d138f
commit 66faf010bc
23 changed files with 227 additions and 93 deletions

View File

@ -28,12 +28,18 @@ clean-all:
clean-flutter-elinux:
./run_crops.sh bitbake -c clean flutter-elinux
clean-flutter-service:
./run_crops.sh bitbake -c clean flutter-service
clean-flutter-pi-service:
./run_crops.sh bitbake -c clean flutter-pi-service
clean-flutter-auto-service:
./run_crops.sh bitbake -c clean flutter-auto-service
clean-flutter-pi:
./run_crops.sh bitbake -c clean flutter-pi
clean-flutter-user:
./run_crops.sh bitbake -c clean flutter-user
clean-flutter-sdk:
./run_crops.sh bitbake flutter-sdk-native -cdo_cleanall

View File

@ -11,94 +11,54 @@
# default values are provided as comments to show people example syntax. Enabling
# the option is a question of removing the # character and making any change to the
# variable as required.
# TOOLCHAIN_HOST_TASK:append = " nativesdk-flutter-sdk"
ENABLE_UART = "1"
# manually set how many cores should be used to build
# by default bitbake will use as many threads as available on the system
#BB_NUMBER_THREADS = "16"
#PARALLEL_MAKE = "-j 16"
# INHERIT:remove = "uninative"
# INHERIT += "mender-full"
# flutter-service
#
# Machine Selection
#
# You need to select a specific machine to target the build with. There are a selection
# of emulated machines available which can boot and run in the QEMU emulator:
#
#MACHINE ?= "qemuarm"
#MACHINE ?= "qemuarm64"
#MACHINE ?= "qemumips"
#MACHINE ?= "qemumips64"
#MACHINE ?= "qemuppc"
#MACHINE ?= "qemux86"
#MACHINE ?= "qemux86-64"
#
# There are also the following hardware board target machines included for
# demonstration purposes:
#
#MACHINE ?= "beaglebone-yocto"
#MACHINE ?= "genericx86"
#MACHINE ?= "genericx86-64"
#MACHINE ?= "edgerouter"
#
# This sets the default machine to be qemux86-64 if no other machine is selected:
MACHINE ??= "raspberrypi4-64"
#MACHINE ??= "raspberrypi0-2w-64"
# MACHINE ??= "raspberrypi3-64"
# pi4
IMAGE_INSTALL:append = " flutter-pi flutter-auto flutter-elinux flutter-service flutter-libraries linux-firmware-rpidistro-bcm43430 linux-firmware-bcm43455 kernel-image kernel-devicetree liberation-fonts networkmanager dhcpcd iptables iw linux-firmware ca-certificates gstreamer1.0-rtsp-server gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libinput libxkbcommon tzdata alsa-utils alsa-lib bcm2835-dev"
CORE_IMAGE_EXTRA_INSTALL += "wayland weston cage"
##!! use flutter-pi-service or flutter-auto-service
# pi 0 w2
#IMAGE_INSTALL:append = " flutter-pi flutter-elinux flutter-service flutter-libraries linux-firmware-rpidistro-bcm43436s linux-firmware-bcm43455 kernel-image kernel-devicetree liberation-fonts networkmanager dhcpcd iptables iw linux-firmware ca-certificates gstreamer1.0-rtsp-server gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libinput libxkbcommon tzdata"
# IMAGE-INSTALL:append = " network-manager dhcp-server wireless-tools dhcp-client"
# pi4:
IMAGE_INSTALL:append = " flutter-auto flutter-auto-launch flutter-pi flutter-elinux flutter-auto-service my-rules flutter-libraries sudo linux-firmware-rpidistro-bcm43430 linux-firmware-bcm43455 kernel-image kernel-devicetree liberation-fonts networkmanager dhcpcd iptables iw linux-firmware ca-certificates gstreamer1.0-rtsp-server gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libinput libxkbcommon tzdata alsa-utils alsa-lib bcm2835-dev flutter-user"
#alsa-dev alsa-lib alsa-utils bcm2835-dev tmux chrony tzdata
# pi 0 w2:
#IMAGE_INSTALL:append = " flutter-auto flutter-auto-launch flutter-pi flutter-elinux flutter-auto-service flutter-libraries sudo linux-firmware-rpidistro-bcm43436s linux-firmware-bcm43455 kernel-image kernel-devicetree liberation-fonts networkmanager dhcpcd iptables iw linux-firmware ca-certificates gstreamer1.0-rtsp-server gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libinput libxkbcommon tzdata alsa-utils alsa-lib bcm2835-dev"
# needed only for flutter-auto:
CORE_IMAGE_EXTRA_INSTALL += "wayland cage"
# needed for gstreamer-plugins-ugly
LICENSE_FLAGS_ACCEPTED = "commercial"
# set the default timezone, will be synced by systemd
DEFAULT_TIMEZONE = "Europe/Berlin"
#MACHINE_EXTRA_RRECOMMENDS:append = " dhcp-server iptables iw wireless-tools dhcp-client linux-firmware linux-firmware-bcm43455 kernel-image kernel-devicetree liberation-fonts"
INIT_MANAGER = "systemd"
# MENDER_SERVER_URL = "https://mender.io"
#MENDER_TENANT_TOKEN = "<copy token here>"
# RPI_USE_U_BOOT = "1"
# MENDER_EFI_LOADER = "u-boot"
# MENDER_PARTITION_ALIGNMENT_KB = "4096"
# MENDER_BOOT_PART_SIZE_MB = "40"
# VIRTUAL-RUNTIME_init_manager = "systemd"
# DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
# MENDER_SERVER_URL = "https://hosted.mender.io"
# MENDER_TENANT_TOKEN = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzNGQwNjgzYy01NDM4LTQwNTUtYTgwNy1mYTVmMTNjMDI5ZTYiLCJzdWIiOiI1ZjkwZTY1Yi01N2YyLTQ5NDYtOGU2ZC1hN2NhZGIwNjg4YzAiLCJleHAiOjE2OTg1OTUyNjIsImlhdCI6MTY5ODUwODg2MiwibWVuZGVyLnRlbmFudCI6IjY1MzQzYWQ4ZDdjOTNlZTM3NTFhMmUyNCIsIm1lbmRlci51c2VyIjp0cnVlLCJpc3MiOiJNZW5kZXIgVXNlcnMiLCJzY3AiOiJtZW5kZXIuKiIsIm1lbmRlci5wbGFuIjoiZW50ZXJwcmlzZSIsIm1lbmRlci50cmlhbCI6dHJ1ZSwibWVuZGVyLmFkZG9ucyI6W3sibmFtZSI6ImNvbmZpZ3VyZSIsImVuYWJsZWQiOnRydWV9LHsibmFtZSI6InRyb3VibGVzaG9vdCIsImVuYWJsZWQiOnRydWV9LHsibmFtZSI6Im1vbml0b3IiLCJlbmFibGVkIjp0cnVlfV0sIm5iZiI6MTY5ODUwODg2Mn0.dABkcij0pm7d4o4RqYsWWparQbZQ4J-uL0iaQuaoYzPnObdPemoB61JyzNcBnA0rYzBsaa5yu177rFnwNGzuxN-tdxID1BMpADo_EwrXRxuQlRx287XJQTZRa9Ilj-nUpDq-XWOePKccm2_6SmMP6cCvoyB3aHADIQ9bl99iM0txduj2uVA8KDh2vKa5zq_Cjci1DHomweY_k9wXlC9jDXQ_cLdfPrVK9gapemLVBMN0lw8RbdUWwYVUipCIOJVlN0jObpDIyEx5p4zRAqKEMJIEPrNvl32IdtWZS9H2QsfZQXLc3AflfpIhzvh3Wovs7y4iAO14o0Vb5PRPPj5e0nI7MQoyjQnv1VG_Lhd1gJoYB3bNcv1lMJC24B9lnEF3c68z2SAeOGgq17KZJb2NZRzw5qdoRXUWsbt5BhSbNqzCReL5xuCZxXkH2E4J4t2aSXhlEJsGOX9AEVetqnSe4oViTygAGmy6A_Q76EQLNjovA20YZjDC7nsJS428rDVw"
# KERNEL_FEATURES:remove = "cfg/fs/vfat.scc"
# wayland is only needed for flutter-auto
DISTRO_FEATURES:append = " systemd opengl wifi wayland pam"
# meta-raspberry specific configuration for raspberry pi devices
DISABLE_OVERSCAN = "1"
DISABLE_SPLASH = "1"
GPU_MEM = "64"
DISABLE_RPI_BOOT_LOGO = "1"
ENABLE_SPI_BUS = "1"
# ENABLE_I2C = "1"
# KERNEL_MODULE_AUTOLOAD:rpi += "i2c-dev i2c-bcm2708"
ENABLE_UART = "1"
# extra boot configuration for raspberry pi
RPI_EXTRA_CONFIG = ' \n \
dtparam=spi=on \n \
dtparam=audio=on \n \
'
#
# Where to place downloads
#
@ -338,5 +298,6 @@ PACKAGECONFIG:append:pn-qemu-system-native = " sdl"
# this doesn't mean anything to you.
CONF_VERSION = "2"
# set output file format
IMAGE_FSTYPES = "ext4 rpi-sdimg"
SDIMG_ROOTFS_TYPE = "ext4"

View File

View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
/usr/bin/flutter-auto --b=/flutter/flutter_elinux/3.19.2/release --c --f

View File

@ -0,0 +1,9 @@
LICENSE = "CLOSED"
SRC_URI:append = " file://flutter-auto-launch "
FILES:${PN} += "/usr/local/bin/flutter-auto-launch"
do_install:append() {
install -d ${D}/usr/local/bin
install -m 0777 ${WORKDIR}/flutter-auto-launch ${D}/usr/local/bin
}

View File

@ -0,0 +1,9 @@
LICENSE = "CLOSED"
IMAGE_INSTALL:append = " flutter-auto flutter-elinux flutter-auto-launch flutter-libraries kernel-image kernel-devicetree liberation-fonts networkmanager dhcpcd iptables iw linux-firmware ca-certificates gstreamer1.0-rtsp-server gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libinput libxkbcommon tzdata alsa-utils alsa-lib bcm2835-dev"
# needed for gstreamer-plugins-ugly:
LICENSE_FLAGS_ACCEPTED = "commercial"
CORE_IMAGE_EXTRA_INSTALL += "wayland cage"
DISTRO_FEATURES:append = " wayland"

View File

@ -0,0 +1,6 @@
LICENSE = "CLOSED"
IMAGE_INSTALL:append = " flutter-pi flutter-elinux flutter-auto-launch flutter-libraries kernel-image kernel-devicetree liberation-fonts networkmanager dhcpcd iptables iw linux-firmware ca-certificates gstreamer1.0-rtsp-server gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libinput libxkbcommon tzdata alsa-utils alsa-lib"
# needed for gstreamer-plugins-ugly:
LICENSE_FLAGS_ACCEPTED = "commercial"

View File

@ -0,0 +1,15 @@
LICENSE = "CLOSED"
IMAGE_INSTALL:append = " linux-firmware-rpidistro-bcm43436s linux-firmware-bcm43455 bcm2835-dev"
# meta-raspberry specific configuration for raspberry pi devices
DISABLE_OVERSCAN = "1"
DISABLE_SPLASH = "1"
GPU_MEM = "64"
DISABLE_RPI_BOOT_LOGO = "1"
ENABLE_SPI_BUS = "1"
RPI_EXTRA_CONFIG = ' \n \
dtparam=spi=on \n \
dtparam=audio=on \n \
'

View File

@ -0,0 +1,15 @@
LICENSE = "CLOSED"
IMAGE_INSTALL:append = " linux-firmware-rpidistro-bcm43430 linux-firmware-bcm43455 bcm2835-dev"
# meta-raspberry specific configuration for raspberry pi devices
DISABLE_OVERSCAN = "1"
DISABLE_SPLASH = "1"
GPU_MEM = "64"
DISABLE_RPI_BOOT_LOGO = "1"
ENABLE_SPI_BUS = "1"
RPI_EXTRA_CONFIG = ' \n \
dtparam=spi=on \n \
dtparam=audio=on \n \
'

View File

@ -0,0 +1,34 @@
SUMMARY = "Example recipe for using inherit useradd"
DESCRIPTION = "This recipe serves as an example for using features from useradd.bbclass"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
S = "${WORKDIR}"
EXCLUDE_FROM_WORLD = "1"
inherit useradd
USERADD_PACKAGES = "${PN}"
GROUPADD_PARAM:${PN} = "gpio; spi"
USERADD_PARAM:${PN} = "-d /home/user1 -G input,video,gpio,spi -r -s /bin/bash user1;"
do_install () {
install -d -m 755 ${D}${datadir}/user1
chown -R user1 ${D}${datadir}/user1
install -d -m 711 ${D}/home/user1
chown -R user1 ${D}/home/user1
chgrp -R user1 ${D}/home/user1
}
FILES:${PN} = "${datadir}/user1/ /home/user1"
# Prevents do_package failures with:
# debugsources.list: No such file or directory:
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"

View File

@ -0,0 +1,12 @@
SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770
/sys/devices/virtual/gpio;\
chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
'"

View File

@ -0,0 +1,11 @@
LICENSE = "CLOSED"
SRC_URI:append = " file://90-interfaces.rules"
FILES:${PN} += " /etc/udev/rules.d/90-interfaces.rules"
do_install:append() {
install -d ${D}${sysconfdir}/udev/rules.d
install -m 0666 ${WORKDIR}/90-interfaces.rules ${D}/etc/udev/rules.d/90-interfaces.rules
}
PROVIDES = "my-rules"

View File

@ -0,0 +1,44 @@
[Unit]
Description=Flutter App Service
After=network.target
StartLimitIntervalSec=0
Requires=systemd-user-sessions.service
After=systemd-user-sessions.service
After=plymouth-quit-wait.service
Wants=dbus.socket
After=dbus.socket
Before=graphical.target
ConditionPathExists=/dev/tty0
[Service]
Type=simple
Restart=always
RestartSec=1
ExecStart=/usr/bin/cage /usr/local/bin/flutter-auto-launch
User=user1
Group=user1
WorkingDirectory=/home/user1
PAMName=login
TTYPath=/dev/tty7
TTYReset=yes
TTYVHangup=yes
TTYTDisallocate=yes
StandardInput=tty-fail
StandardOutput=journal
StandardError=journal
UtmpIdentifier=tty7
UtmpMode=user
[Install]
WantedBy=multi-user.target

View File

@ -19,15 +19,14 @@ ConditionPathExists=/dev/tty0
Type=simple
Restart=always
RestartSec=1
#ExecStart=/usr/bin/cage /usr/bin/flutter-auto-launch
ExecStart=/usr/bin/flutter-pi --release /flutter/flutter_elinux/3.19.2/release
User=root
Group=root
User=user1
Group=user1
WorkingDirectory=/home/root
WorkingDirectory=/home/user1
PAMName=weston-autologin
PAMName=login
TTYPath=/dev/tty7
TTYReset=yes

View File

@ -0,0 +1,13 @@
LICENSE = "CLOSED"
inherit systemd
SYSTEMD_AUTO_ENABLE = "enable"
SYSTEMD_SERVICE:${PN} = "flutter-auto.service"
SRC_URI:append = " file://flutter-auto.service "
FILES:${PN} += "${systemd_unitdir}/system/flutter-auto.service"
do_install:append() {
install -d ${D}/${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/flutter-auto.service ${D}/${systemd_unitdir}/system
}

View File

@ -0,0 +1,13 @@
LICENSE = "CLOSED"
inherit systemd
SYSTEMD_AUTO_ENABLE = "enable"
SYSTEMD_SERVICE:${PN} = "flutter-pi.service"
SRC_URI:append = " file://flutter-pi.service "
FILES:${PN} += "${systemd_unitdir}/system/flutter-pi.service"
do_install:append() {
install -d ${D}/${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/flutter-pi.service ${D}/${systemd_unitdir}/system
}

View File

@ -1,13 +0,0 @@
LICENSE = "CLOSED"
inherit systemd
SYSTEMD_AUTO_ENABLE = "enable"
SYSTEMD_SERVICE:${PN} = "flutter.service"
SRC_URI:append = " file://flutter.service "
FILES:${PN} += "${systemd_unitdir}/system/flutter.service"
do_install:append() {
install -d ${D}/${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/flutter.service ${D}/${systemd_unitdir}/system
}

View File

@ -1,13 +0,0 @@
SUMMARY = "bitbake-layers recipe"
DESCRIPTION = "Recipe created by bitbake-layers"
LICENSE = "MIT"
python do_display_banner() {
bb.plain("***********************************************");
bb.plain("* *");
bb.plain("* Example recipe created by bitbake-layers *");
bb.plain("* *");
bb.plain("***********************************************");
}
addtask display_banner before do_build

View File

@ -0,0 +1,11 @@
AUTHORIZED_USER_NAME ?= "user1"
do_install_append () {
# Add sudo accesses for user.
install -d -m 0710 "${D}/etc/sudoers.d"
echo "${AUTHORIZED_USER_NAME} ALL=(ALL) NOPASSWD: /sbin/shutdown" > "${D}/etc/sudoers.d/0001_${AUTHORIZED_USER_NAME}"
chmod 0644 "${D}/etc/sudoers.d/0001_${AUTHORIZED_USER_NAME}"
}
FILES_${PN} += "/etc/sudoers.d \
/etc/sudoers.d/0001_${AUTHORIZED_USER_NAME}"