Booting yocto system (and many other useful scripts)

This commit is contained in:
geens 2025-07-31 17:44:58 +02:00
parent 3fd35d723a
commit 40ae7a8412
14 changed files with 141 additions and 77 deletions

3
.gitmodules vendored
View File

@ -13,3 +13,6 @@
path = image/yocto/meta-rust-bin
url = https://github.com/rust-embedded/meta-rust-bin.git
branch = master
[submodule "image/yocto/meta-intel"]
path = image/yocto/meta-intel
url = git://git.yoctoproject.org/meta-intel

View File

@ -5,38 +5,39 @@ ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y \
gawk \
wget \
git \
diffstat \
unzip \
texinfo \
gcc \
build-essential \
chrpath \
socat \
cpio \
python3 \
python3-pip \
python3-pexpect \
xz-utils \
debianutils \
diffstat \
file \
gawk \
gcc \
git \
iputils-ping \
less \
libacl1 \
liblz4-tool \
locales \
ovmf \
python3 \
python3-git \
python3-jinja2 \
python3-pexpect \
python3-pip \
python3-subunit \
zstd \
liblz4-tool \
file \
locales \
libacl1 \
sudo \
vim \
less \
tree \
qemu-system-data \
qemu-system-x86 \
qemu-utils \
socat \
sudo \
texinfo \
tree \
unzip \
vim \
wget \
xz-utils \
zstd \
&& rm -rf /var/lib/apt/lists/*
# Set up locale

View File

@ -9,6 +9,7 @@ BBLAYERS ?= " \
/workspace/yocto/poky/meta \
/workspace/yocto/poky/meta-poky \
/workspace/yocto/poky/meta-yocto-bsp \
/workspace/yocto/meta-intel \
/workspace/yocto/meta-openembedded/meta-oe \
/workspace/yocto/meta-openembedded/meta-python \
/workspace/yocto/meta-openembedded/meta-multimedia \

View File

@ -1,46 +1,13 @@
MACHINE = "genericx86-64"
#MACHINE = "genericx86-64"
MACHINE = "intel-skylake-64"
DISTRO = "poky"
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
IMAGE_INSTALL:append = " openssh ssh-keys"
EXTRA_IMAGE_FEATURES += "ssh-server-openssh"
# Image formats for QEMU testing and deployment
IMAGE_FSTYPES += "ext4 tar.bz2"
# Root access configuration
EXTRA_IMAGE_FEATURES += "empty-root-password"
EXTRA_IMAGE_FEATURES += "allow-empty-password"
# SSH configuration
EXTRA_IMAGE_FEATURES += "ssh-server-openssh"
# Memory optimization settings
# Limit resource usage for builds
BB_NUMBER_THREADS = "2"
PARALLEL_MAKE = "-j 2"
# Limit memory usage for builds
BB_SCHEDULER = "completion"
INHERIT += "rm_work"
# Rust support
ENABLE_RUST = "1"
# GUI support
DISTRO_FEATURES:append = " wayland systemd pam usrmerge"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""
# Add GUI packages to image
CORE_IMAGE_EXTRA_INSTALL += "gui-app weston liberation-fonts"
# Needed to enable terminal on tty2
EXTRA_IMAGE_FEATURES += "debug-tweaks"
# WiFi support - Intel Centrino Advanced-N 6235 specific
DISTRO_FEATURES += "wifi opengl"
IMAGE_INSTALL:append = " wpa-supplicant iw linux-firmware packagegroup-base-wifi pciutils usbutils"
IMAGE_INSTALL:append = " linux-firmware-iwlwifi-6000g2b-6"
# Enable iwlwifi driver in kernel
KERNEL_FEATURES:append = " features/iwlwifi/iwlwifi.scc"
#VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
PREFERRED_PROVIDER_virtual/kernel = "linux-intel-rt"
IMAGE_FSTYPES += "wic.vdi"

View File

@ -19,7 +19,7 @@ services:
bash -c "
source /workspace/yocto/poky/oe-init-build-env /workspace/build &&
cp /workspace/conf/* /workspace/build/conf/ &&
bitbake fcb-looper-image &&
bitbake core-image-rt &&
echo 'Build complete. Image files available in output directory.'
"
@ -48,5 +48,6 @@ services:
echo 'VNC will be available on localhost:5901' &&
echo 'SSH will be available on localhost:2222' &&
echo 'QEMU monitor on localhost:4444' &&
qemu-system-x86_64 -accel kvm -cpu host -m 4096 -smp 4 -kernel /workspace/build/tmp/deploy/images/genericx86-64/bzImage -drive file=/workspace/build/tmp/deploy/images/genericx86-64/fcb-looper-image-genericx86-64.rootfs.ext4,if=virtio,format=raw,cache=writeback -netdev user,id=net0,hostfwd=tcp:127.0.0.1:2222-:22,hostfwd=tcp:127.0.0.1:8080-:8080 -device virtio-net-pci,netdev=net0 -device virtio-vga -vnc 127.0.0.1:1 -monitor telnet:127.0.0.1:4444,server,nowait -serial stdio -append 'root=/dev/vda rw console=ttyS0 console=tty0'
cp /usr/share/OVMF/OVMF_VARS.fd /tmp/OVMF_VARS.fd &&
qemu-system-x86_64 -accel kvm -cpu host -m 4096 -smp 4 -drive if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE.fd -drive if=pflash,format=raw,file=/tmp/OVMF_VARS.fd -drive file=/workspace/build/tmp/deploy/images/intel-skylake-64/core-image-rt-intel-skylake-64.rootfs.wic,if=virtio,format=raw,cache=writeback -netdev user,id=net0,hostfwd=tcp:127.0.0.1:2222-:22,hostfwd=tcp:127.0.0.1:8080-:8080 -device virtio-net-pci,netdev=net0 -device virtio-vga -vnc 127.0.0.1:1 -monitor telnet:127.0.0.1:4444,server,nowait -serial stdio
"

View File

@ -0,0 +1,19 @@
require conf/distro/poky.conf
DISTRO = "fcb-looper"
DISTRO_NAME = "FCB Looper Distribution"
DISTRO_VERSION = "1.0"
# Use busybox-mdev as device manager
VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
## Distro features for GUI, W^Fi, and systemd
#DISTRO_FEATURES:append = " wayland systemd pam usrmerge wifi opengl"
#DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
#
## Systemd configuration
#VIRTUAL-RUNTIME_init_manager = "systemd"
#VIRTUAL-RUNTIME_initscripts = ""
#
## Default target
#SYSTEMD_DEFAULT_TARGET = "graphical.target"

View File

@ -4,12 +4,12 @@ BBPATH .= ":${LAYERDIR}"
# Layer recipes
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "meta-fcb-looper"
BBFILE_PATTERN_meta-fcb-looper = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-fcb-looper = "10"
BBFILE_COLLECTIONS += "fcb-looper-layer"
BBFILE_PATTERN_fcb-looper-layer = "^${LAYERDIR}/"
BBFILE_PRIORITY_fcb-looper-layer = "10"
LAYERVERSION_meta-fcb-looper = "1"
LAYERSERIES_COMPAT_meta-fcb-looper = "scarthgap"
LAYERVERSION_fcb-looper-layer = "1"
LAYERSERIES_COMPAT_fcb-looper-layer = "scarthgap"
# Dependencies
LAYERDEPENDS_meta-fcb-looper = "core openembedded-layer rust-bin-layer"
LAYERDEPENDS_fcb-looper-layer = "core intel openembedded-layer rust-bin-layer"

View File

@ -1,11 +1,14 @@
SUMMARY = "FCB1010 Looper System Image"
DESCRIPTION = "Minimal embedded Linux system with GUI for audio looper"
require recipes-core/images/core-image-base.bb
require recipes-core/images/core-image-minimal.bb
# Distro features now configured in fcb-looper distribution
# gui-app
IMAGE_INSTALL += "\
packagegroup-core-boot \
gui-app \
weston \
weston-init \
liberation-fonts \
@ -13,12 +16,25 @@ IMAGE_INSTALL += "\
openssh \
ssh-keys \
wifi-config \
wpa-supplicant \
iw \
linux-firmware \
packagegroup-base-wifi \
pciutils \
usbutils \
linux-firmware-iwlwifi-6000g2b-6 \
kbd \
file \
util-linux \
keyboard-config \
${CORE_IMAGE_EXTRA_INSTALL} \
"
# Optimize for embedded use
IMAGE_FEATURES += "read-only-rootfs ssh-server-openssh"
SYSTEMD_DEFAULT_TARGET = "graphical.target"
# WiFi kernel features - ensure iwlwifi is built
KERNEL_FEATURES:append = " cfg/80211.scc features/iwlwifi/iwlwifi.scc"
# Image features for development and access - removed read-only for debugging
IMAGE_FEATURES += "ssh-server-openssh empty-root-password allow-empty-password debug-tweaks"
# Size optimization
IMAGE_ROOTFS_SIZE ?= "1048576"
@ -28,6 +44,4 @@ IMAGE_OVERHEAD_FACTOR = "1.1"
IMAGE_FSTYPES += "ext4 tar.bz2 wic"
# Custom WIC file without swap
WKS_FILE = "fcb-looper-noswap.wks"
LICENSE = "MIT"
WKS_FILE = "fcb-looper-noswap.wks"

View File

@ -0,0 +1,6 @@
# WiFi kernel configuration - built into kernel
CONFIG_CFG80211=y
CONFIG_MAC80211=y
CONFIG_IWLWIFI=y
CONFIG_IWLDVM=y
CONFIG_IWLMVM=y

View File

@ -0,0 +1,5 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += "file://wifi.cfg"
COMPATIBLE_MACHINE = "genericx86-64"

View File

@ -0,0 +1,5 @@
#!/bin/sh
# Set Belgian keyboard layout
loadkeys be
# Make it persistent for systemd
localectl set-keymap be

View File

@ -0,0 +1,41 @@
SUMMARY = "Belgian Keyboard Layout Configuration"
DESCRIPTION = "Sets up Belgian keyboard layout on boot"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://keyboard-setup.sh"
S = "${WORKDIR}"
do_install() {
# Install keyboard setup script
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/keyboard-setup.sh ${D}${bindir}/
# Create keyboard setup service
install -d ${D}${sysconfdir}/systemd/system
cat > ${D}${sysconfdir}/systemd/system/keyboard-setup.service << EOF
[Unit]
Description=Setup Belgian Keyboard Layout
DefaultDependencies=false
Before=sysinit.target
[Service]
Type=oneshot
ExecStart=${bindir}/keyboard-setup.sh
RemainAfterExit=yes
[Install]
WantedBy=sysinit.target
EOF
# Enable service
install -d ${D}${sysconfdir}/systemd/system/sysinit.target.wants
ln -sf ${sysconfdir}/systemd/system/keyboard-setup.service ${D}${sysconfdir}/systemd/system/sysinit.target.wants/keyboard-setup.service
}
FILES:${PN} = "${bindir}/keyboard-setup.sh \
${sysconfdir}/systemd/system/keyboard-setup.service \
${sysconfdir}/systemd/system/sysinit.target.wants/*"
RDEPENDS:${PN} = "systemd kbd"

View File

@ -3,4 +3,4 @@
part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024
part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=ttyS0,115200 console=tty0"
bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=ttyS0,115200 console=tty0 systemd.gpt_auto=0"

@ -0,0 +1 @@
Subproject commit 38e75c8c1059e5f37659c140c010eaa203238fd2