diff --git a/conf/layer.conf b/conf/layer.conf new file mode 100644 index 0000000..754ac49 --- /dev/null +++ b/conf/layer.conf @@ -0,0 +1,30 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "meta-diya" +BBFILE_PATTERN_meta-diya = "^${LAYERDIR}/" +BBFILE_PRIORITY_meta-diya = "11" + +LAYERDEPENDS_meta-diya = " core " +LAYERSERIES_COMPAT_meta-diya = "scarthgap" + +PACKAGE_CLASSES = "package_ipk" + +INITRAMFS_IMAGE="core-image-recovery" +INITRAMFS_IMAGE_BUNDLE="0" +INITRAMFS_MAXSIZE="200000" +INHERIT += "rm_work" + +EXTRA_IMAGE_FEATURES ?= " ssh-server-dropbear read-only-rootfs " +# ssh-server-dropbear +DISTRO_FEATURES:append := " opengl " +DISTRO_FEATURES:remove = " x11 vulkan ptest" +TOOLCHAIN_TARGET_TASK:append = " libgles3-mesa-dev " +# DISTRO_FEATURES:append := " vc4-gfx opengl directfb " + +WKS_FILE="image.wks.in" +ROOT_HOME = "/root" diff --git a/recipes-core/base-files/base-files_%.bbappend b/recipes-core/base-files/base-files_%.bbappend new file mode 100644 index 0000000..1d9980f --- /dev/null +++ b/recipes-core/base-files/base-files_%.bbappend @@ -0,0 +1,22 @@ +hostname = "diya" + +do_install:append () { + cat << 'EOF' >> "${D}${sysconfdir}/profile" +export GDK_BACKEND=wayland +export XDG_RUNTIME_DIR=/home/$USER/.xdg +export XDG_CONFIG_HOME=/home/$USER/.config +export PATH=$PATH:/home/$USER/bin:/home/$USER/.local/bin +export LD_LIBRARY_PATH=/home/$USER/lib:/home/$USER/.local/lib +if [ ! -e "$XDG_RUNTIME_DIR" ]; then + mkdir -p "$XDG_RUNTIME_DIR" +fi +export TERM=xterm-256color +if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then + eval $(dbus-launch --auto-syntax) +fi +EOF + +cat << EOF >> "${D}${sysconfdir}/profile" +export MACHINE=${MACHINE} +EOF +} diff --git a/recipes-core/dropbear/dropbear_%.bbappend b/recipes-core/dropbear/dropbear_%.bbappend new file mode 100644 index 0000000..ef85ee1 --- /dev/null +++ b/recipes-core/dropbear/dropbear_%.bbappend @@ -0,0 +1,7 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" +SRC_URI += "file://default" + +do_install:append () { + rm -rf ${D}/etc/dropbear + install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/dropbear +} \ No newline at end of file diff --git a/recipes-core/dropbear/files/default b/recipes-core/dropbear/files/default new file mode 100644 index 0000000..36af6d9 --- /dev/null +++ b/recipes-core/dropbear/files/default @@ -0,0 +1,2 @@ +DROPBEAR_EXTRA_ARGS="-w" +DROPBEAR_RSAKEY_DIR=/etc/dropbear \ No newline at end of file diff --git a/recipes-core/images/README.md b/recipes-core/images/README.md new file mode 100644 index 0000000..8623ba8 --- /dev/null +++ b/recipes-core/images/README.md @@ -0,0 +1,40 @@ +#webrtc-audio-processing \ +pulseaudio \ +pulseaudio-server \ +alsa-utils \ +pulseaudio-module-alsa-card \ +pulseaudio-module-alsa-source \ +pulseaudio-module-alsa-sink \ +pulseaudio-module-cli \ +pulseaudio-module-echo-cancel \ +pulseaudio-misc \ +i2c-tools \ +mpg123 +libsdl2-mixer \ +#tslib +#tslib-tests +#tslib-calibrate +#tslib-uinput + +libsdl2 \ + libsdl2-ttf \ + libsdl2-image \ + libsdl2-mixer \ + libsdl2-net \ +# v4l-utils +evtest + +# openvt -v -c 5 -- /usr/bin/weston --tty=/dev/tty5 + +mesa \ + mesa-demos \ + libgbm \ + + +dtdebug=1 +dtoverlay=vc4-kms-v3d +dtoverlay=vc4-kms-dpi-generic,hactive=480,hfp=26,hsync=16,hbp=10 +dtparam=vactive=640,vfp=25,vsync=10,vbp=16 +dtparam=clock-frequency=32000000,rgb666-padhi + +Diyas symbolise goodness and purity, and lighting them denotes dispelling darkness and going into light. \ No newline at end of file diff --git a/recipes-core/images/base-image.inc b/recipes-core/images/base-image.inc new file mode 100644 index 0000000..06d97c8 --- /dev/null +++ b/recipes-core/images/base-image.inc @@ -0,0 +1,49 @@ +inherit extrausers + +EXTRA_USERS_PARAMS = "usermod -p 2Pe/4xyFxsokE diya; \ + usermod -a -G video diya; \ + usermod -a -G tty diya; \ + usermod -a -G input diya; \ + usermod -a -G dialout diya; \ + usermod -a -G audio diya; \ + usermod -a -G sudo diya; \ + " +IMAGE_BOOT_FILES:append = "fs_resize config.txt recovery-${MACHINE}.cpio.gz Image " + +IMAGE_INSTALL:append = "kernel-modules \ + e2fsprogs \ + libcurl \ + libdrm \ + libgbm \ + libgles2 \ + libegl-mesa \ + libglapi \ + libudev \ + libinput \ + diya-overlay \ + seatd \ + libxkbcommon \ + xkeyboard-config \ + udev \ + glew \ + mesa \ + sudo \ + htop \ + i2c-tools \ + bash \ + nano \ + wpa-supplicant \ + evtest \ + rsync \ + coreutils \ + glmark2 \ + " + +# TOOLCHAIN_HOST_TASK:append = " libxkbcommon " + +IMAGE_PREPROCESS_COMMAND += "image_patch;" + +image_patch () { + # delete unused kernel image + rm -rf ${IMAGE_ROOTFS}/boot/* +} \ No newline at end of file diff --git a/recipes-core/images/core-image-base.bbappend b/recipes-core/images/core-image-base.bbappend new file mode 100644 index 0000000..66190dc --- /dev/null +++ b/recipes-core/images/core-image-base.bbappend @@ -0,0 +1,27 @@ +DISTRO_FEATURES:append = " wayland " + +require base-image.inc + +EXTRA_USERS_PARAMS:append = "usermod -a -G avahi diya" +IMAGE_INSTALL:append = "pango \ + seatd \ + pixman \ + cairo \ + glib-2.0 \ + freetype \ + fontconfig \ + librsvg librsvg-gtk \ + gdk-pixbuf \ + gtk4 \ + gtk4-layer-shell \ + gobject-introspection \ + wayland wayland-protocols \ + foot swaybg swayidle swaylock tofi wtype \ + mc \ + gdbserver gdb \ + labwc \ + wlr-randr \ + " +PACKAGE_EXCLUDE = " gtk+ gtk+3 adwaita-icon-theme " +IMAGE_INSTALL:remove = " gtk+ gtk+3 adwaita-icon-theme " +# wlr-randr l3afpad wlopm cairo-egl \ No newline at end of file diff --git a/recipes-core/images/core-image-minimal.bbappend b/recipes-core/images/core-image-minimal.bbappend new file mode 100644 index 0000000..28bc2d6 --- /dev/null +++ b/recipes-core/images/core-image-minimal.bbappend @@ -0,0 +1,2 @@ +DISTRO_FEATURES:remove = " wayland gobject-introspection-data " +require base-image.inc diff --git a/recipes-core/images/core-image-recovery.bb b/recipes-core/images/core-image-recovery.bb new file mode 100644 index 0000000..dd8844a --- /dev/null +++ b/recipes-core/images/core-image-recovery.bb @@ -0,0 +1,53 @@ + +DESCRIPTION = "Recovery initramfs image." + + +PACKAGE_INSTALL = "recovery-boot \ + dosfstools \ + e2fsprogs \ + util-linux-fsck \ + kernel-modules \ + busybox \ + sysvinit \ + sysvinit-inittab \ + ${VIRTUAL-RUNTIME_base-utils} \ + udev \ + initscripts \ + base-passwd \ + ${ROOTFS_BOOTSTRAP_INSTALL}" + +# Do not pollute the initrd image with rootfs features +IMAGE_FEATURES = "" + +export IMAGE_BASENAME = "${MLPREFIX}recovery" +IMAGE_NAME_SUFFIX ?= "" +IMAGE_LINGUAS = "" + +LICENSE = "MIT" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" +inherit core-image extrausers + +IMAGE_ROOTFS_SIZE = "8192" +IMAGE_ROOTFS_EXTRA_SPACE = "0" + +EXTRA_USERS_PARAMS = "usermod -p 2Pe/4xyFxsokE root " + +# Use the same restriction as initramfs-module-install +COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)' + +IMAGE_PREPROCESS_COMMAND += "image_patch;" + +image_patch () { + # delete unused image + rm -rf ${IMAGE_ROOTFS}/boot/* + # create /etc/fstab + cat << EOF > ${IMAGE_ROOTFS}/etc/fstab +/dev/mmcblk1p1 /boot auto defaults 0 0 +/dev/mmcblk1p4 /home auto defaults 0 0 + +EOF + cat << EOF > ${IMAGE_ROOTFS}/etc/hostname +diya-recovery +EOF +} \ No newline at end of file diff --git a/recipes-core/init-ifupdown/files/itf_diya b/recipes-core/init-ifupdown/files/itf_diya new file mode 100644 index 0000000..75f8100 --- /dev/null +++ b/recipes-core/init-ifupdown/files/itf_diya @@ -0,0 +1,24 @@ +# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) + +# The loopback interface +auto lo +iface lo inet loopback + +# Wireless interfaces +auto wlan0 +iface wlan0 inet dhcp +# wireless_mode managed +# wireless_essid any +# wpa-driver wext +wpa-conf /etc/network/wpa_supplicant.conf + +# Ethernet/RNDIS gadget (g_ether) +# ... or on host side, usbnet and random hwaddr +iface usb0 inet static + address 192.168.7.2 + netmask 255.255.255.0 + network 192.168.7.0 + gateway 192.168.7.1 + +# Bluetooth networking +# iface bnep0 inet dhcp diff --git a/recipes-core/init-ifupdown/init-ifupdown_%.bbappend b/recipes-core/init-ifupdown/init-ifupdown_%.bbappend new file mode 100644 index 0000000..9617860 --- /dev/null +++ b/recipes-core/init-ifupdown/init-ifupdown_%.bbappend @@ -0,0 +1,7 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" +SRC_URI += " file://itf_diya " + +do_install:append () { + rm ${D}/etc/network/interfaces + install -m 0644 ${WORKDIR}/itf_diya ${D}/etc/network/interfaces +} \ No newline at end of file diff --git a/recipes-diya/diya-overlay/diya-overlay.bb b/recipes-diya/diya-overlay/diya-overlay.bb new file mode 100644 index 0000000..5ec8448 --- /dev/null +++ b/recipes-diya/diya-overlay/diya-overlay.bb @@ -0,0 +1,44 @@ +DESCRIPTION = "Auto configuration deployment from media" +DEPENDS = "" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI += "file://confd \ + file://expandfs.sh \ + file://80_diya \ + file://fs_resize \ + file://boot-to-recovery" + + +inherit update-rc.d useradd + +USERADD_PACKAGES = "${PN}" +GROUPADD_PACKAGES = "${PN}" + +USERADD_PARAM:${PN} = "-u 1000 -d /home/diya -r -s /bin/sh diya" + +INITSCRIPT_NAME = "confd" +INITSCRIPT_PARAMS = "start 30 S ." + +do_install() { + install -d ${D}/${sysconfdir}/init.d/ + install -d ${DEPLOY_DIR_IMAGE} + install -m 0755 ${WORKDIR}/confd ${D}/${sysconfdir}/init.d/confd + install -d ${D}/sbin/ + install -d ${D}/etc/default/volatiles + # install -m 0644 ${WORKDIR}/80_diya ${D}${sysconfdir}/default/volatiles + install -m 0755 ${WORKDIR}/expandfs.sh ${D}/sbin/expandfs.sh + install -m 0755 ${WORKDIR}/boot-to-recovery ${D}/sbin/boot-to-recovery + install -m 0755 ${WORKDIR}/fs_resize ${DEPLOY_DIR_IMAGE}/ + + cat << EOF > ${DEPLOY_DIR_IMAGE}/config.txt +recovery=false +recovery_image=recovery-${MACHINE}.cpio.gz +console=both +bootlogo=false +EOF + + install -d ${D}/var/etc + install -d ${D}/var/etc/upper + install -d ${D}/var/etc/work +} diff --git a/recipes-diya/diya-overlay/files/80_diya b/recipes-diya/diya-overlay/files/80_diya new file mode 100644 index 0000000..19504cd --- /dev/null +++ b/recipes-diya/diya-overlay/files/80_diya @@ -0,0 +1,3 @@ +# d root root 0755 /var/etc/upper none +# d root root 0755 /var/etc/work none +# l root root 0644 /etc/dropbear /var/etc/dropbear diff --git a/recipes-diya/diya-overlay/files/boot-to-recovery b/recipes-diya/diya-overlay/files/boot-to-recovery new file mode 100755 index 0000000..2f6f9b1 --- /dev/null +++ b/recipes-diya/diya-overlay/files/boot-to-recovery @@ -0,0 +1,21 @@ +#! /bin/sh + +if [[ $(/usr/bin/id -u) -ne 0 ]]; then + echo "$0 shall be run as root" + exit 1 +fi + +. /etc/profile + +if [ ! -e /boot/config.txt ]; then + # prepare env for recovery boot + cat << EOF > /boot/config.txt +recovery=true +recovery_image=recovery-${MACHINE}.cpio.gz +EOF +else + sed -i 's/^.*recovery.*/recovery=true/g' /boot/config.txt || \ + echo "recovery=true" >> /boot/config.txt +fi +echo "Rebooting to recovery mode" +reboot \ No newline at end of file diff --git a/recipes-diya/diya-overlay/files/confd b/recipes-diya/diya-overlay/files/confd new file mode 100644 index 0000000..08d72f8 --- /dev/null +++ b/recipes-diya/diya-overlay/files/confd @@ -0,0 +1,48 @@ +#!/bin/sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DESC="Auto deployment configuration from media" + +if [ -z "$DISK" ]; then + DISK="mmcblk1" +fi + +case "$1" in + start) + echo -n "Start $DESC: " + # mount the overlay which is not auto mount by fstab + # this make /etc editable + mount -t overlay -o lowerdir=/etc,upperdir=/var/etc/upper,workdir=/var/etc/work overlay /etc + # for some reason the LCD backlight is turned off + # need to turn it on manually + if [ -f "/boot/fs_resize" ]; then + /sbin/expandfs.sh + touch /boot/home_partition_should_be_formated + rm /boot/fs_resize + reboot + fi + if [ -f "/boot/home_partition_should_be_formated" ]; then + echo "Trying to format the home partition" + umount /dev/${DISK}p4 + yes | mkfs.ext4 /dev/${DISK}p4 + mount /dev/${DISK}p4 /home + mkdir -p /home/diya + chown -R diya:diya /home/diya + rm /boot/home_partition_should_be_formated + fi + if [ -e "/boot/wpa_supplicant.conf" ];then + mv /boot/wpa_supplicant.conf /etc/network/ + reboot + fi + # display information + # disable wifi power save + # /usr/sbin/iw wlan0 set power_save off + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start}" >&2 + exit 1 + ;; +esac + +exit 0 \ No newline at end of file diff --git a/recipes-diya/diya-overlay/files/expandfs.sh b/recipes-diya/diya-overlay/files/expandfs.sh new file mode 100644 index 0000000..791a870 --- /dev/null +++ b/recipes-diya/diya-overlay/files/expandfs.sh @@ -0,0 +1,32 @@ +#! /bin/sh + +if [ -z "$DISK" ]; then + DISK="mmcblk1" +fi + +if [ "$(/usr/bin/id -u)" -ne 0 ]; then + echo "$0 shall be run as root" + exit 1 +fi + +start_sector=$(cat /sys/block/$DISK/${DISK}p4/start) +echo "Start sector is: $start_sector" + +if [ -z "$start_sector" ]; then + echo "Cannot find the start sector" + exit 1 +fi + +echo "Expanding the partition" +sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk /dev/$DISK +d # delete partition +4 # number 4 +n # new partition +p # primary partition +4 # partition number 4 +$start_sector + # default - end of disk +p # print the in-memory partition table +w # write the partition table +q # and we're done +EOF \ No newline at end of file diff --git a/recipes-diya/diya-overlay/files/fs_resize b/recipes-diya/diya-overlay/files/fs_resize new file mode 100644 index 0000000..18096d4 --- /dev/null +++ b/recipes-diya/diya-overlay/files/fs_resize @@ -0,0 +1 @@ +resize the partition \ No newline at end of file diff --git a/recipes-diya/initramfs/files/confd b/recipes-diya/initramfs/files/confd new file mode 100644 index 0000000..ac65de7 --- /dev/null +++ b/recipes-diya/initramfs/files/confd @@ -0,0 +1,21 @@ +#!/bin/sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DESC="Custom configuration" +. /etc/profile + +case "$1" in + start) + echo -n "Start $DESC: " + sed -i 's/^.*recovery.*/recovery=false/g' /boot/config.txt || \ + echo "recovery=false" >> /boot/config.txt + ;; + + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start}" >&2 + exit 1 + ;; +esac + +exit 0 \ No newline at end of file diff --git a/recipes-diya/initramfs/files/diya-update b/recipes-diya/initramfs/files/diya-update new file mode 100755 index 0000000..8d7615a --- /dev/null +++ b/recipes-diya/initramfs/files/diya-update @@ -0,0 +1,147 @@ +#! /bin/sh + +. /etc/profile + +DEFAULT_ROOTFS_NAME="rootfs-$MACHINE.tar.bz2" +DEFAULT_KERNEL_NAME="Image-$MACHINE.bin" +DEFAULT_INITRAMFS_NAME="recovery-$MACHINE.cpio.gz" +UPDATE_SRC_PATH="/home/diya/.update" +ROOTFS_DEV="/dev/mmcblk1p2" +SUPPORTED_COMMAND="rootfs kernel initramfs all" +TMP_MOUNT="/tmp/rootfs" + + +rootfs() +{ + filename=$1 + if [ -z "$filename" ]; then + filename="$DEFAULT_ROOTFS_NAME" + fi + path="$UPDATE_SRC_PATH/$filename" + backup_file="$UPDATE_SRC_PATH/rootfs-backup.img" + echo "Checking rootfs at: $path" + if [ ! -e "$path" ]; then + echo "Error: rootfs file not found" + return 1 + fi + # backup the rootfs file + echo "Backing up the current rootfs" + if ! dd if=$ROOTFS_DEV of=$backup_file; then + echo "Error: unable to backup current rootfs" + return 1 + fi + + echo "Format rootfs partition" + if ! mkfs.ext4 -F $ROOTFS_DEV; then + echo "Error: Unable to format rootfs partition. Restore and quit" + dd if=$backup_file of=$ROOTFS_DEV + return 1 + fi + mkdir -p $TMP_MOUNT + echo "Mount rootfs partition to $TMP_MOUNT" + if ! mount $ROOTFS_DEV $TMP_MOUNT; then + echo "Error: Unable to mount rootfs partition. Restore and quit" + dd if=$backup_file of=$ROOTFS_DEV + return 1 + fi + echo "Installing new rootfs" + if ! tar -xpvf "$path" -C $TMP_MOUNT; then + echo "Error: unable to install new rootfs. Restore and quit" + umount $TMP_MOUNT + dd if=$backup_file of=$ROOTFS_DEV + return 1 + fi + echo "Patch /etc/fstab" + cat << EOF >> $TMP_MOUNT/etc/fstab + +/dev/mmcblk1p1 /boot vfat defaults 0 0 +/dev/mmcblk1p3 /var/etc ext4 defaults 0 0 +/dev/mmcblk1p4 /home ext4 defaults 0 0 + +EOF + sync + echo "Unmount the rootfs partition" + umount $TMP_MOUNT + echo "Done" + return 0 +} + +kernel() +{ + filename=$1 + if [ -z "$filename" ]; then + filename="$DEFAULT_KERNEL_NAME" + fi + path="$UPDATE_SRC_PATH/$filename" + echo "Checking kernel at: $path" + if [ ! -e "$path" ]; then + echo "Error: kernel file not found" + return 1 + fi + echo "Update kernel" + cp -v "$path" /boot/kernel8.img + cd /boot + sync + echo "Done" + return 0 +} + +initramfs() +{ + filename=$1 + if [ -z "$filename" ]; then + filename="$DEFAULT_INITRAMFS_NAME" + fi + path="$UPDATE_SRC_PATH/$filename" + echo "Checking initramfs at: $path" + if [ ! -e "$path" ]; then + echo "Error: initramfs file not found" + return 1 + fi + echo "Update recovery intramfs" + cp -v "$path" /boot/$DEFAULT_INITRAMFS_NAME + cd /boot + sync + echo "Done" + return 0 +} + +command_valid() { + VALUE=$1 + echo $SUPPORTED_COMMAND | tr " " '\n' | grep -F -q -x "$VALUE" +} + + +name=$(basename $0) +cmd=${name#diya-update-} +file="$1" + +if ! command_valid "$cmd"; then + cmd="$1" + file="$2" +fi + +case "$cmd" in + rootfs) + rootfs $file + ;; + kernel) + kernel $file + ;; + initramfs) + initramfs $file + ;; + all) + rootfs && kernel && initramfs + ;; + *) +cat << EOF +Usage: $name [file] + commands: + - rootfs: update rootfs + - kernel: update kernel image + - initramfs: update recovery initramfs +EOF + exit 1 + ;; +esac diff --git a/recipes-diya/initramfs/files/init b/recipes-diya/initramfs/files/init new file mode 100755 index 0000000..b85c4d1 --- /dev/null +++ b/recipes-diya/initramfs/files/init @@ -0,0 +1,107 @@ +#!/bin/sh +# Copyright (C) 2011 O.S. Systems Software LTDA. +# Licensed on MIT +# +# Provides the API to be used by the initramfs modules +# +# Modules need to provide the following functions: +# +# _enabled : check if the module ought to run (return 1 to skip) +# _run : do what is need +# +# Boot parameters are available on environment in the as: +# +# 'foo=value' as 'bootparam_foo=value' +# 'foo' as 'bootparam_foo=true' +# 'foo.bar[=value] as 'foo_bar=[value|true]' + + +# Load kernel module +load_kernel_module() { + if modprobe $1 >/dev/null 2>&1; then + info "Loaded module $1" + else + debug "Failed to load module $1" + fi +} + +# Prints information +msg() { + echo "$@" >/dev/console +} + +# Prints information if verbose bootparam is used +info() { + [ -n "$bootparam_verbose" ] && echo "$@" >/dev/console +} + +# Prints information if debug bootparam is used +debug() { + [ -n "$bootparam_debug" ] && echo "DEBUG: $@" >/dev/console +} + +# Prints a message and start a endless loop +fatal() { + echo $1 >/dev/console + echo >/dev/console + + if [ -n "$bootparam_init_fatal_sh" ]; then + sh + else + while [ "true" ]; do + sleep 3600 + done + fi +} + +# Variables shared amoung modules +EFI_DIR=/sys/firmware/efi # place to store device firmware information + +# initialize /proc, /sys, /run/lock and /var/lock +mkdir -p /proc /sys /run/lock /var/lock /var/run /home +mount -t proc proc /proc +mount -t sysfs sysfs /sys + +if [ -d $EFI_DIR ];then + mount -t efivarfs none /sys/firmware/efi/efivars +fi + +# populate bootparam environment +for p in `cat /proc/cmdline`; do + if [ -n "$quoted" ]; then + value="$value $p" + if [ "`echo $p | sed -e 's/\"$//'`" != "$p" ]; then + eval "bootparam_${quoted}=${value}" + unset quoted + fi + continue + fi + + opt=`echo $p | cut -d'=' -f1` + opt=`echo $opt | sed -e 'y/.-/__/'` + if [ "`echo $p | cut -d'=' -f1`" = "$p" ]; then + eval "bootparam_${opt}=true" + else + value="`echo $p | cut -d'=' -f2-`" + if [ "`echo $value | sed -e 's/^\"//'`" != "$value" ]; then + quoted=${opt} + continue + fi + eval "bootparam_${opt}=\"${value}\"" + fi +done + +# use /dev with devtmpfs +if grep -q devtmpfs /proc/filesystems; then + mkdir -p /dev + mount -t devtmpfs devtmpfs /dev +else + if [ ! -d /dev ]; then + fatal "ERROR: /dev doesn't exist and kernel doesn't has devtmpfs enabled." + fi +fi +# run init +exec /sbin/init + +# Catch all +fatal "ERROR: Initramfs failed to initialize the system." diff --git a/recipes-diya/initramfs/recovery-boot_0.1.bb b/recipes-diya/initramfs/recovery-boot_0.1.bb new file mode 100644 index 0000000..33a0552 --- /dev/null +++ b/recipes-diya/initramfs/recovery-boot_0.1.bb @@ -0,0 +1,47 @@ +SUMMARY = "Modular initramfs system" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +RDEPENDS:${PN} += "${VIRTUAL-RUNTIME_base-utils} sysvinit" +RRECOMMENDS:${PN} = "${VIRTUAL-RUNTIME_base-utils-syslog}" + +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +PR = "r4" + +inherit allarch update-rc.d + +SRC_URI = "file://init \ + file://confd \ + file://diya-update \ + " + +S = "${WORKDIR}" + +INITSCRIPT_NAME = "confd" +INITSCRIPT_PARAMS = "start 30 S ." + +do_install() { + install -d ${D}/etc/init.d + install -d ${D}/sbin + # base + install -m 0755 ${WORKDIR}/init ${D}/init + install -m 0755 ${WORKDIR}/confd ${D}/etc/init.d/confd +cat << EOF >> ${D}/etc/profile +export MACHINE=${MACHINE} +EOF + install -m 0755 ${WORKDIR}/diya-update ${D}/sbin/ + + # create symlink + ln -sf /sbin/diya-update ${D}/sbin/diya-update-rootfs + ln -sf /sbin/diya-update ${D}/sbin/diya-update-kernel + ln -sf /sbin/diya-update ${D}/sbin/diya-update-initramfs + ln -sf /sbin/diya-update ${D}/sbin/diya-update-all + + # Create device nodes expected by some kernels in initramfs + # before even executing /init. + install -d ${D}/dev + mknod -m 622 ${D}/dev/console c 5 1 +} + + +FILES:${PN} = "/etc /init /dev /sbin" \ No newline at end of file diff --git a/recipes-extended/sudo/sudo_%.bbappend b/recipes-extended/sudo/sudo_%.bbappend new file mode 100644 index 0000000..f63db11 --- /dev/null +++ b/recipes-extended/sudo/sudo_%.bbappend @@ -0,0 +1,9 @@ +do_install:append() { + # grant all permission to sudo group + sed -i 's/^#\s*\(%sudo\s*ALL=(ALL:ALL)\s*ALL\)/\1/' ${D}/${sysconfdir}/sudoers + # allow sudo group to power off/reboot system without password + cat << EOF >> ${D}/${sysconfdir}/sudoers +## sudo user group is allowed to execute halt and reboot +%sudo ALL=NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/poweroff, /usr/bin/swaylock +EOF +} \ No newline at end of file diff --git a/recipes-gnome/gtk+/gtk4_%.bbappend b/recipes-gnome/gtk+/gtk4_%.bbappend new file mode 100644 index 0000000..fb387e6 --- /dev/null +++ b/recipes-gnome/gtk+/gtk4_%.bbappend @@ -0,0 +1 @@ +GTKBASE_RRECOMMENDS:remove = "adwaita-icon-theme-symbolic" diff --git a/recipes-graphics/libsdl2/libsdl2_%.bbappend b/recipes-graphics/libsdl2/libsdl2_%.bbappend new file mode 100644 index 0000000..1990f0c --- /dev/null +++ b/recipes-graphics/libsdl2/libsdl2_%.bbappend @@ -0,0 +1,4 @@ +DEPENS += " mesa libdrm alsa virtual/libgbm virtual/libgles2 virtual/libgl udev libudev " + +PACKAGECONFIG = " kmsdrm opengl gles2 alsa libusb " +# PACKAGECONFIG:remove = "x11 wayland" \ No newline at end of file diff --git a/recipes-graphics/wayland/weston-init.bbappend b/recipes-graphics/wayland/weston-init.bbappend new file mode 100644 index 0000000..9aa2987 --- /dev/null +++ b/recipes-graphics/wayland/weston-init.bbappend @@ -0,0 +1,7 @@ + +# change default weston user to diya +do_install:append() { + if [ -e ${D}/${sysconfdir}/init.d/weston ]; then + sed -i 's#WESTON_USER=weston#WESTON_USER=diya WESTON_GROUP=weston#' ${D}/${sysconfdir}/init.d/weston + fi +} diff --git a/recipes-gtk/gtk-layer-shell/gtk4-layer-shell_git.bbappend b/recipes-gtk/gtk-layer-shell/gtk4-layer-shell_git.bbappend new file mode 100644 index 0000000..860f492 --- /dev/null +++ b/recipes-gtk/gtk-layer-shell/gtk4-layer-shell_git.bbappend @@ -0,0 +1,4 @@ +PV = "1.1.0" +SRCREV = "v1.1.0" + +INSANE_SKIP:${PN}-dev += "dev-elf" \ No newline at end of file diff --git a/recipes-support/l3afpad/files/l3afpad-0.8.18.1.11.tar.gz b/recipes-support/l3afpad/files/l3afpad-0.8.18.1.11.tar.gz new file mode 100644 index 0000000..bb285a8 Binary files /dev/null and b/recipes-support/l3afpad/files/l3afpad-0.8.18.1.11.tar.gz differ diff --git a/recipes-support/l3afpad/l3afpad_0.8.18.bb b/recipes-support/l3afpad/l3afpad_0.8.18.bb new file mode 100644 index 0000000..ba5cf11 --- /dev/null +++ b/recipes-support/l3afpad/l3afpad_0.8.18.bb @@ -0,0 +1,30 @@ +DESCRIPTION = "leafpad for GTK3" + +LICENSE = "GPL-3.0-only" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-3.0-only;md5=c79ff39f19dfec6d293b95dea7b07891" + +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +S="${WORKDIR}" + +DEPENDS = "gtk+3 pango cairo harfbuzz gdk-pixbuf intltool-native" + +inherit pkgconfig + + +SRC_URI = "file://l3afpad-0.8.18.1.11.tar.gz" +SRC_URI[sha256sum] = "005457fa35a7e37024e403852a21a5c7362a0314a8de9b7fff73b1e7802d8959" + +do_configure () { + ./configure --host=x86_64-unknown-linux --target=aarch64-poky-linux +} + +do_compile () { + make +} + +do_install () { + DESTDIR=${D} make install +} + +FILES:${PN} += "/usr/local/*" \ No newline at end of file diff --git a/recipes-support/sfwbar/files/sfwbar.config b/recipes-support/sfwbar/files/sfwbar.config new file mode 100644 index 0000000..b7f7618 --- /dev/null +++ b/recipes-support/sfwbar/files/sfwbar.config @@ -0,0 +1,334 @@ +Set Term = "foot" + +# Task Switcher +switcher { + interval = 700 + icons = true + labels = false + cols = 5 +} + +function("SfwbarInit") { + SetBarId "bar-0" + SetLayer "bottom" +} + +function("ToggleMinimize") { + [!Minimized] Minimize + [Minimized] UnMinimize +} + +function("ToggleMaximize") { + [!Maximized] Maximize + [Maximized] UnMaximize +} + + +function("ShowDesktopSaveFocus") { + [Focused] UserState "2:on" + [!Focused] UserState "2:off" +} + +function("ShowdesktopMinimize") { + [!Minimized] UserState "on" + [Minimized] UserState "off" + [!Minimized] Minimize +} + +function("ShowDesktopRestore") { + [UserState] UnMinimize +} + +function("ShowDesktopRestoreFocus") { + [UserState2] Focus +} + +function("ShowDesktopCheckWindow") { + [!Minimized] UserState "target","2:on" +} + +function("ShowDesktopReminimize") +{ + [!Minimized] UserState "on" + [!Minimized] Minimize +} + +function("ShowDesktopUnminimized") { + [UserState2 | Children] Function "ShowDesktopSaveFocus" + [UserState2 | Children] Function "ShowDesktopReminimize" + [!UserState2 | Children] Function "ShowDesktopRestore" + [!UserState2 | Children] Function "ShowDesktopRestoreFocus" + [!UserState2] UserState "off" + [UserState2] UserState "on" +} + +function("ShowDesktop") { + [!UserState | Children] Function "ShowDesktopSaveFocus" + [!UserState | Children] Function "ShowDesktopMinimize" + [UserState] UserState "2:off" + [UserState| Children ] Function "ShowDesktopCheckWindow" + [UserState] Function "target","ShowDesktopUnminimized" + [!UserState] UserState "on" +} + +menu("winops") { + item("Focus", Focus ); + item("Close", Close ); + item("Toggle minimize", Function "ToggleMinimize" ); + item("Toggle maximize", Function "ToggleMaximize" ); +} + +# Panel layout + +layout { + button { + style = "launcher" + value = "/usr/share/icons/Adwaita/scalable/actions/view-app-grid-symbolic.svg" + action = Exec "wtype -M alt ' ' -m alt" + } + button { + style = "launcher" + value = "/usr/share/icons/Adwaita/scalable/actions/system-run-symbolic.svg" + tooltip = "Quick run" + action = Exec "bash -c \"`drun`\"" + } + button { + value = "/usr/share/icons/Adwaita/scalable/devices/tv-symbolic.svg" + style = "launcher" + tooltip = "Show Desktop" + action = Function "target", "ShowDesktop" + } + button { + style = "launcher" + value = $Term + tooltip = "Terminal" + action = Exec $Term + } + taskbar "target" { + rows = 1 + css = "* { -GtkWidget-hexpand:false; }" # stretch horizontally + icons = true + group = false + sort = false + labels = true + action[3] = Menu "winops" + action[2] = Close + } + label { + css = "* { -GtkWidget-hexpand: true; }" + } + tray { + rows = 1 + } + include("network-module.widget") + include("cpu.widget") + include("memory.widget") +} + +#CSS +button#launcher, button#module{ + padding: 0px 2px 0px 2px; + /*background: none; + background-color: #5F548E;*/ + border-style:none; + box-shadow: none; + border-radius: 0; +} + +window { + -GtkWidget-direction: top; + /*background-color: rgba(0,0,0,0.6);*/ + border-color: rgba(0,0,0,0.3); +} + +#hidden { + -GtkWidget-visible: false; +} + +button#taskbar_normal grid { + -GtkWidget-hexpand: false; + padding-right: 0px; + margin-right: 0px; +} +button#launcher image, button#taskbar_normal image, button#taskbar_active image, button#taskbar_normal:hover image { + -GtkWidget-vexpand: true; + box-shadow: none; + border: none; + border-image: none; + background-image: none; + background: none; + min-width: 24px; + min-height: 24px; + -gtk-icon-shadow: none; +} + +button#taskbar_normal label, button#taskbar_active label, button#taskbar_normal:hover label { + -GtkWidget-vexpand: true; + -GtkWidget-hexpand: false; + padding-left: 0.75mm; + padding-top: 0px; + padding-bottom: 0px; + font: 0.3cm Sans; +} + +button#taskbar_normal , button#taskbar_active , button#taskbar_normal:hover { + padding-left: 0.75mm; + padding-top: 0.5mm; + padding-bottom: 0.5mm; + background-image: none; + border-radius: 0; + border-image: none; + -GtkWidget-hexpand: false; + -GtkWidget-vexpand: true; + background-color: rgba(119,119,119,0.2); + border: none; + /*border-color: rgba(119,119,119,0.3);*/ + box-shadow: none; +} + +button#taskbar_normal label { + color: black; +} + +button#taskbar_active { + /* background-color: rgba(255,255,255,0.2); + border-color: rgba(255,255,255,0.4); */ + border-bottom:3px solid #5F548E; +} +button#taskbar_active label, button#taskbar_normal:hover label { + color: #5F548E; +} +/* button#taskbar_active:hover*/ +button#taskbar_normal:hover { + background-color: #d2d2d2; + border-color: rgba(234,234,234,0.44); +} + +grid#switcher_active image, +grid#switcher_active { + min-width: 1.25cm; + min-height: 1.25cm; + border-image: none; + padding: 1.25mm; + background-color: #777777; + border: 0px; + box-shadow: none; + border-radius: 1.25mm; + -GtkWidget-hexpand: true; +} + +grid#switcher_normal image, +grid#switcher_normal { + min-width: 1.25cm; + min-height: 1.25cm; + border-image: none; + padding: 1.25mm; + -GtkWidget-direction: right; + -GtkWidget-hexpand: true; +} + +window#switcher { + border-style: solid; + border-width: 0.25mm; + border-color: #000000; + border-radius: 1.25mm; + padding: 1.25mm; + -GtkWidget-hexpand: true; +} + +grid#switcher { + border-radius: 1.25mm; + padding: 1.25mm; + background-color: rgba(0,0,0,0.8); + border-color: rgba(119,119,119,0.8); + box-shadow: none; + -GtkWidget-hexpand: true; +} + +button#tray_active, +button#tray_passive, +button#tray_attention { + background-image: none; + border: 0px; + padding: 0px 1px; + margin: 0px; + border-image: none; + border-radius: 0px; + outline-style: none; + box-shadow: none; + -GtkWidget-hexpand: true; + -GtkWidget-vexpand: true; +} + +button#tray_active image, +button#tray_passive image, +button#tray_attention image { + min-width: 26px; +} + +grid#layout { + padding: 0.25mm; + -GtkWidget-direction: right; + min-height: 30px; +} + +menu { + background-color: rgba(0,0,0,0.8); + border-color: rgba(119,119,119,0.3); + box-shadow: none; +} + +menuitem { +color: #ffffff; +} + +menu image { + min-width: 24px; + min-height: 24px; + padding-right: 5px; +} + +chart#cpu_chart { + background: rgba(127,127,127,0.3); + min-width: 9px; + -GtkWidget-vexpand: true; + margin: 2px; + border: 1px solid @theme_fg_color; + color: red; +} + +progressbar#memory { + -GtkWidget-direction: top; + -GtkWidget-vexpand: true; + min-width: 9px; + border: 1px solid @theme_fg_color; + margin: 2px; +} + +progressbar#memory trough { + min-height: 2px; + min-width: 9px; + border: none; + border-radius: 0px; + background: rgba(127,127,127,0.3); +} + +progressbar#memory progress { + -GtkWidget-hexpand: true; + min-width: 9px; + border-radius: 0px; + border: none; + margin: 0px; + background-color: alpha(green,0.9); +} + + +label { + font: 0.27cm Sans; + color: #ffffff; + text-shadow: none; +} + +* { + -GtkWidget-vexpand: true; +} diff --git a/recipes-support/sfwbar/sfwbar_git.bb b/recipes-support/sfwbar/sfwbar_git.bb new file mode 100644 index 0000000..fbf7d72 --- /dev/null +++ b/recipes-support/sfwbar/sfwbar_git.bb @@ -0,0 +1,27 @@ +DESCRIPTION = "sfwbar pannel for wayland" + +LICENSE = "GPL-3.0-only" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-3.0-only;md5=c79ff39f19dfec6d293b95dea7b07891" + +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +DEPENDS = "gtk+3 gtk-layer-shell json-c wayland-native" + +SRCREV = "${AUTOREV}" + +SRC_URI = "git://github.com/LBCrion/sfwbar.git;protocol=https;branch=main" +SRC_URI += " file://sfwbar.config " + +S="${WORKDIR}/git" + +inherit meson pkgconfig + +EXTRA_OEMESON += "--buildtype release" + +do_install:append () { + install -d ${D}/${sysconfdir}/xdg/ + install -d ${D}/${sysconfdir}/xdg/sfwbar/ + install -m 0755 ${WORKDIR}/sfwbar.config ${D}/${sysconfdir}/xdg/sfwbar/ +} + +FILES:${PN} += "/usr/share/icons/*" diff --git a/recipes-support/swayidle/swayidle_%.bbappend b/recipes-support/swayidle/swayidle_%.bbappend new file mode 100644 index 0000000..ed81400 --- /dev/null +++ b/recipes-support/swayidle/swayidle_%.bbappend @@ -0,0 +1 @@ +PACKAGECONFIG:remove = " systemd sysvinit man-pages " \ No newline at end of file diff --git a/recipes-support/swaylock/swaylock_%.bbappend b/recipes-support/swaylock/swaylock_%.bbappend new file mode 100644 index 0000000..36fdf59 --- /dev/null +++ b/recipes-support/swaylock/swaylock_%.bbappend @@ -0,0 +1 @@ +PACKAGECONFIG:remove = " man-pages pam " diff --git a/recipes-support/tofi/files/config b/recipes-support/tofi/files/config new file mode 100644 index 0000000..3074b41 --- /dev/null +++ b/recipes-support/tofi/files/config @@ -0,0 +1,320 @@ +# Default config for tofi +# +# Copy this file to ~/.config/tofi/config and get customising! +# +# A complete reference of available options can be found in `man 5 tofi`. + +# +### Fonts +# + # Font to use, either a path to a font file or a name. + # + # If a path is given, tofi will startup much quicker, but any + # characters not in the chosen font will fail to render. + # + # Otherwise, fonts are interpreted in Pango format. + font = "Sans" + + # Point size of text. + font-size = 24 + + # Comma separated list of OpenType font feature settings to apply, + # if supported by the chosen font. The format is similar to the CSS + # "font-feature-settings" property. + # + # Examples: + # + # font-features = "smcp, c2sc" (all small caps) + # font-features = "liga 0" (disable ligatures) + font-features = "" + + # Comma separated list of OpenType font variation settings to apply + # to variable fonts. The format is similar to the CSS + # "font-variation-settings" property. + # + # Examples: + # + # font-variations = "wght 900" (Extra bold) + # font-variations = "wdth 25, slnt -10" (Narrow and slanted) + font-variations = "" + + # Perform font hinting. Only applies when a path to a font has been + # specified via `font`. Disabling font hinting speeds up text + # rendering appreciably, but will likely look poor at small font pixel + # sizes. + hint-font = true + +# +### Text theming +# + # Default text color + # + # All text defaults to this color if not otherwise specified. + text-color = #FFFFFF + + # All pieces of text have the same theming attributes available: + # + # *-color + # Foreground color + # + # *-background + # Background color + # + # *-background-padding + # Background padding in pixels (comma-delimited, CSS-style list). + # See "DIRECTIONAL VALUES" under `man 5 tofi` for more info. + # + # *-background-corner-radius + # Radius of background box corners in pixels + + # Prompt text theme + # prompt-color = #FFFFFF + prompt-background = #00000000 + prompt-background-padding = 0 + prompt-background-corner-radius = 0 + + # Placeholder text theme + placeholder-color = #FFFFFFA8 + placeholder-background = #00000000 + placeholder-background-padding = 0 + placeholder-background-corner-radius = 0 + + # Input text theme + # input-color = #FFFFFF + input-background = #00000000 + input-background-padding = 0 + input-background-corner-radius = 0 + + # Default result text theme + # default-result-color = #FFFFFF + default-result-background = #00000000 + default-result-background-padding = 0 + default-result-background-corner-radius = 0 + + # Alternate (even-numbered) result text theme + # + # If unspecified, these all default to the corresponding + # default-result-* attribute. + # + # alternate-result-color = #FFFFFF + # alternate-result-background = #00000000 + # alternate-result-background-padding = 0 + # alternate-result-background-corner-radius = 0 + + # Selection text + selection-color = #F92672 + selection-background = #00000000 + selection-background-padding = 0 + selection-background-corner-radius = 0 + + # Matching portion of selection text + selection-match-color = #00000000 + + +# +### Text cursor theme +# + # Style of the optional text cursor. + # + # Supported values: bar, block, underscore + text-cursor-style = bar + + # Color of the text cursor + # + # If unspecified, defaults to the same as input-color + # text-cursor-color = #FFFFFF + + # Color of text behind the text cursor when text-cursor-style = block + # + # If unspecified, defaults to the same as background-color + # text-cursor-background = #000000 + + # Corner radius of the text cursor + text-cursor-corner-radius = 0 + + # Thickness of the bar and underscore text cursors. + # + # If unspecified, defaults to a font-dependent value when + # text-cursor-style = underscore, or to 2 otherwise. + # text-cursor-thickness = 2 + +# +### Text layout +# + # Prompt to display. + prompt-text = "run: " + + # Extra horizontal padding between prompt and input. + prompt-padding = 0 + + # Placeholder input text. + placeholder-text = "" + + # Maximum number of results to display. + # If 0, tofi will draw as many results as it can fit in the window. + num-results = 0 + + # Spacing between results in pixels. Can be negative. + result-spacing = 0 + + # List results horizontally. + horizontal = false + + # Minimum width of input in horizontal mode. + min-input-width = 0 + +# +### Window theming +# + # Width and height of the window. Can be pixels or a percentage. + width = 640 + height = 480 + + # Window background color + background-color = #1B1D1E + + # Width of the border outlines in pixels. + outline-width = 4 + + # Border outline color + outline-color = #080800 + + # Width of the border in pixels. + border-width = 12 + + # Border color + border-color = #F92672 + + # Radius of window corners in pixels. + corner-radius = 0 + + # Padding between borders and text. Can be pixels or a percentage. + padding-top = 8 + padding-bottom = 8 + padding-left = 8 + padding-right = 8 + + # Whether to clip text drawing to be within the specified padding. This + # is mostly important for allowing text to be inset from the border, + # while still allowing text backgrounds to reach right to the edge. + clip-to-padding = true + + # Whether to scale the window by the output's scale factor. + scale = true + +# +### Window positioning +# + # The name of the output to appear on. An empty string will use the + # default output chosen by the compositor. + output = "" + + # Location on screen to anchor the window to. + # + # Supported values: top-left, top, top-right, right, bottom-right, + # bottom, bottom-left, left, center. + anchor = center + + # Set the size of the exclusive zone. + # + # A value of -1 means ignore exclusive zones completely. + # A value of 0 will move tofi out of the way of other windows' zones. + # A value greater than 0 will set that much space as an exclusive zone. + # + # Values greater than 0 are only meaningful when tofi is anchored to a + # single edge. + exclusive-zone = -1 + + # Window offset from edge of screen. Only has an effect when anchored + # to the relevant edge. Can be pixels or a percentage. + margin-top = 0 + margin-bottom = 0 + margin-left = 0 + margin-right = 0 + +# +### Behaviour +# + # Hide the mouse cursor. + hide-cursor = true + + # Show a text cursor in the input field. + text-cursor = true + + # Sort results by number of usages in run and drun modes. + history = true + + # Specify an alternate file to read and store history information + # from / to. This shouldn't normally be needed, and is intended to + # facilitate the creation of custom modes. + # history-file = /path/to/histfile + + # Select the matching algorithm used. If normal, substring matching is + # used, weighted to favour matches closer to the beginning of the + # string. If prefix, only substrings at the beginning of the string are + # matched. If fuzzy, searching is performed via a simple fuzzy matching + # algorithm. + # + # Supported values: normal, prefix, fuzzy + matching-algorithm = normal + + # If true, require a match to allow a selection to be made. If false, + # making a selection with no matches will print input to stdout. + # In drun mode, this is always true. + require-match = true + + # If true, automatically accept a result if it is the only one + # remaining. If there's only one result on startup, window creation is + # skipped altogether. + auto-accept-single = false + + # If true, typed input will be hidden, and what is displayed (if + # anything) is determined by the hidden-character option. + hide-input = false + + # Replace displayed input characters with a character. If the empty + # string is given, input will be completely hidden. + # This option only has an effect when hide-input is set to true. + hidden-character = "*" + + # If true, use physical keys for shortcuts, regardless of the current + # keyboard layout. If false, use the current layout's keys. + physical-keybindings = true + + # Instead of printing the selected entry, print the 1-based index of + # the selection. This option has no effect in run or drun mode. If + # require-match is set to false, non-matching input will still result + # in the input being printed. + print-index = false + + # If true, directly launch applications on selection when in drun mode. + # Otherwise, just print the command line to stdout. + drun-launch = false + + # The terminal to run terminal programs in when in drun mode. + # This option has no effect if drun-launch is set to true. + # Defaults to the value of the TERMINAL environment variable. + terminal = foot + + # Delay keyboard initialisation until after the first draw to screen. + # This option is experimental, and will cause tofi to miss keypresses + # for a short time after launch. The only reason to use this option is + # performance on slow systems. + late-keyboard-init = false + + # If true, allow multiple simultaneous processes. + # If false, create a lock file on startup to prevent multiple instances + # from running simultaneously. + multi-instance = false + + # Assume input is plain ASCII, and disable some Unicode handling + # functions. This is faster, but means e.g. a search for "e" will not + # match "é". + ascii-input = false + +# +### Inclusion +# + # Configs can be split between multiple files, and then included + # within each other. + # include = /path/to/config diff --git a/recipes-support/tofi/files/drun b/recipes-support/tofi/files/drun new file mode 100755 index 0000000..2554145 --- /dev/null +++ b/recipes-support/tofi/files/drun @@ -0,0 +1,9 @@ +#! /bin/sh + +config="/etc/xdg/tofi/config" + +if [ -e "$HOME/.config/tofi/config" ]; then + config="$HOME/.config/tofi/config" +fi + +tofi-drun -c "$config" \ No newline at end of file diff --git a/recipes-support/tofi/tofi_git.bb b/recipes-support/tofi/tofi_git.bb new file mode 100644 index 0000000..8fe5315 --- /dev/null +++ b/recipes-support/tofi/tofi_git.bb @@ -0,0 +1,27 @@ +DESCRIPTION = "tofi menu for wayland" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +DEPENDS = "wayland freetype wayland-native wayland-protocols-native wayland-protocols harfbuzz pango libxkbcommon" + +SRCREV = "${AUTOREV}" + +SRC_URI = "git://github.com/philj56/tofi.git;protocol=https;branch=master" +SRC_URI += " file://config file://drun " + +S="${WORKDIR}/git" + +inherit meson pkgconfig + +EXTRA_OEMESON += "--buildtype release" + +do_install:append () { + # replace the default config + install -m 0755 ${WORKDIR}/drun ${D}/usr/bin/ + install -m 0755 ${WORKDIR}/config ${D}/${sysconfdir}/xdg/tofi/ +} + +FILES:${PN} += "/usr/share/*" diff --git a/recipes-support/wlopm/wlopm_git.bb b/recipes-support/wlopm/wlopm_git.bb new file mode 100644 index 0000000..cd09208 --- /dev/null +++ b/recipes-support/wlopm/wlopm_git.bb @@ -0,0 +1,23 @@ +DESCRIPTION = "wlopm" + +LICENSE = "GPL-3.0-only" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-3.0-only;md5=c79ff39f19dfec6d293b95dea7b07891" + + +DEPENDS = "wayland wayland-native wayland-protocols" + +SRCREV = "${AUTOREV}" + +SRC_URI = "git://git.iohub.dev/dany/wlopm.git;protocol=https;branch=master" + +S="${WORKDIR}/git" + +do_compile () { + oe_runmake +} + +do_install() { + oe_runmake install DESTDIR='${D}' +} + +FILES:${PN} += "/usr/local/*" \ No newline at end of file diff --git a/recipes-support/wtype/wtype_git.bb b/recipes-support/wtype/wtype_git.bb new file mode 100644 index 0000000..ef5d28b --- /dev/null +++ b/recipes-support/wtype/wtype_git.bb @@ -0,0 +1,17 @@ +DESCRIPTION = "virtual key event for wayland" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + + +DEPENDS = "wayland wayland-native wayland-protocols-native wayland-protocols libxkbcommon" + +SRCREV = "${AUTOREV}" + +SRC_URI = "git://github.com/atx/wtype.git;protocol=https;branch=master" + +S="${WORKDIR}/git" + +inherit meson pkgconfig + +EXTRA_OEMESON += "--buildtype release" \ No newline at end of file diff --git a/recipes-wlroots/labwc/files/autostart b/recipes-wlroots/labwc/files/autostart new file mode 100644 index 0000000..5b76448 --- /dev/null +++ b/recipes-wlroots/labwc/files/autostart @@ -0,0 +1,38 @@ +# Example autostart file + +# Set background color +swaybg -i /etc/xdg/labwc/wpp.jpg >/dev/null 2>&1 & + +# wlr-randr --output DPI-1 --transform 90 + +# Configure output directives such as mode, position, scale and transform. +# Use wlr-randr to get your output names +# Example ~/.config/kanshi/config below: +# profile { +# output HDMI-A-1 position 1366,0 +# output eDP-1 position 0,0 +# } +# kanshi >/dev/null 2>&1 & + +# Launch a panel such as yambar or waybar. +# waybar >/dev/null 2>&1 & + +# Enable notifications. Typically GNOME/KDE application notifications go +# through the org.freedesktop.Notifications D-Bus API and require a client such +# as mako to function correctly. Thunderbird is an example of this. +# mako >/dev/null 2>&1 & + +# Lock screen after 1 minute; turn off display after another 5 minutes. +# +# Note that in the context of idle system power management, it is *NOT* a good +# idea to turn off displays by 'disabling outputs' for example by +# `wlr-randr --output --off` because this re-arranges views +# (since a837fef). Instead use a wlr-output-power-management client such as +# https://git.sr.ht/~leon_plickat/wlopm +#swayidle -w timeout 60 'wlopm --off DPI-1' resume 'wlopm --on DPI-1' & + +#SFWBAR_CNF="/etc/xdg/sfwbar/sfwbar.config" +#if [ -e "$HOME/.config/sfwbar/sfwbar.config" ]; then +# SFWBAR_CNF="$HOME/.config/sfwbar/sfwbar.config" +#fi +#sfwbar -f "$SFWBAR_CNF" diff --git a/recipes-wlroots/labwc/files/environment b/recipes-wlroots/labwc/files/environment new file mode 100644 index 0000000..d0fb461 --- /dev/null +++ b/recipes-wlroots/labwc/files/environment @@ -0,0 +1,28 @@ +# Example environment file + +# This allows xdg-desktop-portal-wlr to function (e.g. for screen-recording) +XDG_CURRENT_DESKTOP=wlroots + +# Set keyboard layout to Swedish +# XKB_DEFAULT_LAYOUT=se + +# Set two keyboard layouts and toggle between them using alt+shift +# XKB_DEFAULT_LAYOUT=se,de +XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle + +# Force firefox to use wayland backend +# MOZ_ENABLE_WAYLAND=1 + +# Set cursor theme. +# Find icons themes with the command below or similar: +# find /usr/share/icons/ -type d -name "cursors" +XCURSOR_THEME=breeze_cursors + +# Disable hardware cursors. Most users wouldn't want to do this, but if you +# are experiencing issues with disappearing cursors, this might fix it. +# WLR_NO_HARDWARE_CURSORS=1 + +# For Java applications such as JetBrains/Intellij Idea, set this variable +# to avoid menus with incorrect offset and blank windows +# See https://github.com/swaywm/sway/issues/595 +# _JAVA_AWT_WM_NONREPARENTING=1 diff --git a/recipes-wlroots/labwc/files/init b/recipes-wlroots/labwc/files/init new file mode 100755 index 0000000..9177f97 --- /dev/null +++ b/recipes-wlroots/labwc/files/init @@ -0,0 +1,53 @@ +#!/bin/sh +# +### BEGIN INIT INFO +# Provides: labwc +# Required-Start: $local_fs $remote_fs +# Required-Stop: $local_fs $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +### END INIT INFO +LABWC_USER=diya +LABWC_CONFDIR="/etc/xdg/labwc" +if test -e "/home/$LABWC_USER/.config/labwc" ; then + LABWC_CONFDIR="/home/$LABWC_USER/.config/labwc" +fi + +killproc() { + pid=`/bin/pidof $1` + [ "$pid" != "" ] && kill $pid +} + +read CMDLINE < /proc/cmdline +for x in $CMDLINE; do + case $x in + labwc=false) + echo "labwc disabled" + exit 0; + ;; + esac +done + +case "$1" in + start) + . /etc/profile + su - $LABWC_USER -c "labwc -C $LABWC_CONFDIR" & + ;; + + stop) + echo "Stopping labwc" + killproc labwc + ;; + + restart) + $0 stop + sleep 1 + $0 start + ;; + + *) + echo "usage: $0 { start | stop | restart }" + ;; +esac + +exit 0 diff --git a/recipes-wlroots/labwc/files/menu.xml b/recipes-wlroots/labwc/files/menu.xml new file mode 100644 index 0000000..3daf1a8 --- /dev/null +++ b/recipes-wlroots/labwc/files/menu.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/recipes-wlroots/labwc/files/rc.xml b/recipes-wlroots/labwc/files/rc.xml new file mode 100644 index 0000000..b48299e --- /dev/null +++ b/recipes-wlroots/labwc/files/rc.xml @@ -0,0 +1,71 @@ + + + + + + + + 10 + + + + Adwaita + 0 + + + + + + + + + + + + + + root-menu + + + + + root-menu + + + + + + + + + bash -c "bash -c \"`drun`\"" + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/recipes-wlroots/labwc/files/wpp.jpg b/recipes-wlroots/labwc/files/wpp.jpg new file mode 100644 index 0000000..7871b7d Binary files /dev/null and b/recipes-wlroots/labwc/files/wpp.jpg differ diff --git a/recipes-wlroots/labwc/labwc_%.bbappend b/recipes-wlroots/labwc/labwc_%.bbappend new file mode 100644 index 0000000..49eaf49 --- /dev/null +++ b/recipes-wlroots/labwc/labwc_%.bbappend @@ -0,0 +1,28 @@ +PACKAGECONFIG:remove = " man-pages xwayland " +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +RRECOMMENDS:${PN} = "" +SRC_URI += " file://autostart \ + file://init \ + file://environment \ + file://menu.xml \ + file://rc.xml \ + file://wpp.jpg \ + " +do_install:append () { + install -d ${D}/${sysconfdir}/xdg + install -d ${D}/${sysconfdir}/init.d + install -d ${D}/${sysconfdir}/xdg/labwc + install -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/labwc + + install -m 0755 ${WORKDIR}/wpp.jpg ${D}/${sysconfdir}/xdg/labwc/ + install -m 0755 ${WORKDIR}/autostart ${D}/${sysconfdir}/xdg/labwc/ + install -m 0755 ${WORKDIR}/environment ${D}/${sysconfdir}/xdg/labwc/ + install -m 0755 ${WORKDIR}/menu.xml ${D}/${sysconfdir}/xdg/labwc/ + install -m 0755 ${WORKDIR}/rc.xml ${D}/${sysconfdir}/xdg/labwc/ + +} + +inherit update-rc.d +INITSCRIPT_NAME = "labwc" +INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ." diff --git a/recipes-wlroots/wlroots/wlroots-%.bbappend b/recipes-wlroots/wlroots/wlroots-%.bbappend new file mode 100644 index 0000000..e47a686 --- /dev/null +++ b/recipes-wlroots/wlroots/wlroots-%.bbappend @@ -0,0 +1,2 @@ +PACKAGECONFIG += " opengl gbm libinput " +PACKAGECONFIG:remove = " sysvinit systemd x11 xwayland " \ No newline at end of file diff --git a/wic/image.wks.in b/wic/image.wks.in new file mode 100644 index 0000000..47cb8a2 --- /dev/null +++ b/wic/image.wks.in @@ -0,0 +1,12 @@ +# short-description: Create Raspberry Pi SD card image +# long-description: Creates a partitioned SD card image for use with + +part u-boot --source rawcopy --sourceparams="file=${SPL_BINARY}" --ondisk mmcblk1 --no-table --align 8 +part /boot --source bootimg-partition --ondisk mmcblk1 --fstype=vfat --label boot --active --align 4096 --size 32 +# read only roofs +part / --source rootfs --ondisk mmcblk1 --fstype=ext4 --label root --align 4096 --size 150 --exclude-path home/ --exclude-path var/etc/ --exclude-path boot/ +# modifiable configurations stored in /var/etc +part /var/etc --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/var/etc --ondisk mmcblk1 --fstype=ext4 --label diya --align 1024 --size 32 +# home partition +part /home --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/home --ondisk mmcblk1 --fstype=ext4 --label home --align 1024 --size 16 +# part /home --ondisk mmcblk1 --fstype=vfat --label music --active --align 1024 --size 16 \ No newline at end of file