Initial Commit

This commit is contained in:
Justin Hammond 2023-04-18 16:12:33 +08:00
commit 37c3da57ba
13 changed files with 365 additions and 0 deletions

17
COPYING.MIT Normal file
View file

@ -0,0 +1,17 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

91
README Normal file
View file

@ -0,0 +1,91 @@
This is a Yocto Image/Layer for the Star64/PineTabV devices from Pine64
Please see the corresponding sections below for details.
QuickStart
==========
Pre-built SD/MMC images can be downloaded from https://pine64.my-ho.st:8443/
The images are configured with deb package management. Additional packages can
be installed via the apt tool (you should first run ```apt update```). packages
are hosted at the same above site.
For additional packages not present, please submit a issue request, i'll do my
best to find a recipe to include those packages.
The Following Images are currently provided:
* star64-image-minimal - A CommandLine only image
* star64-image-weston - A Weston/Wayland "Demo" image.
* star64-image-xfce - A XFCE Based Image.
* star64-image-gnome - A Gnome Based Image.
All Images contain the necessary patches to the kernel/userspace to support
GPU/VPU Acceleration.
The Kernel used is 5.15 - This is due to the GPU Model used in Star64 (BXE-4-32 GPU) (img-rouge) driver not
available for more recent kernels yet
*Warning* - Right now, these images might be a bit unstable as we finetune the image configurations.
Running apt upgrade *might* break things.
Usernames
=========
* root
password: pine64
* pine64
password: pine64
Table of Contents
=================
1. Layer Dependancies
2. Patches
3. Adding the meta-pine64 layer to your build
4. Misc
1. Dependencies
===============
URI: https://git.yoctoproject.org/poky
branch: mickledore
URI: https://github.com/riscv/meta-riscv
branch: master
(this is pending patches to be upstreamed - For the moment, please use
https://github.com/Fishwaldo/meta-riscv - star64 branch)
https://github.com/openembedded/meta-openembedded
branch: mickledore
layers:
* meta-oe
* meta-networking
* meta-python
* meta-gnome
* meta-multimedia
* meta-xfce
2. Patches
==========
This repository will accept patches that are for specific configurations of the Star64/PineTabV
If your patches are to fix builds, they should be submitted upstream to either the Yocto Project,
or the meta-riscv if they are riscv related.
These images have "default" configuration of the upstream sources. These upstream configurations
might not work well on Star64 or PineTabV. If you find a configuration that is incompatible with
these devices, please submit a issue (or better yet, add a bbappend recipe with fixes)
3. Adding the meta-pine64 layer to your build
=================================================
Run 'bitbake-layers add-layer meta-pine64'
4. Misc
=======
Discussions around these images takes place in the Star64 Channel on the Pine64 community
(discord, telegram, matrix, IRC). Please see the Pine64 website for links to join these
online chat.

43
conf/distro/star64.conf Normal file
View file

@ -0,0 +1,43 @@
require conf/distro/poky.conf
DISTRO = "star64"
DISTRO_NAME = "star64"
DISTRO_VERSION = "0.1"
DISTRO_CODENAME = ""
SDK_VENDOR = "-pine64"
TARGET_VENDOR = "-pine64"
MAINTAINER = "Justin Hammond <justin@dynam.ac>"
# Comment out any of the lines below to disable them in the build
# DISTRO_FEATURES options:
# alsa bluetooth ext2 pcmcia usbgadget usbhost wifi nfs zeroconf pci
DISTRO_FEATURES = " pci \
ipv4 \
ipv6 \
usbhost \
wifi \
alsa \
bluetooth \
nfs \
zeroconf \
systemd \
wayland \
pam \
opengl \
x11 \
seccomp \
polkit \
"
PACKAGE_CLASSES ?= "package_deb"
PACKAGE_FEED_URIS = "https://pine64.my-ho.st:8443/deb/"
PACKAGE_FEED_ARCHS = "all star64 riscv64"
POKY_INIT_MANAGER:star64 = "systemd"
INITRAMFS_FSTYPES = "cpio.gz"
INITRAMFS_IMAGE = "star64-image-initramfs"
#UBOOT_RD_LOADADDRESS = "0x46100000"

13
conf/layer.conf Normal file
View file

@ -0,0 +1,13 @@
# 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-pine64"
BBFILE_PATTERN_meta-pine64 = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-pine64 = "6"
LAYERDEPENDS_meta-pine64 = "core"
LAYERSERIES_COMPAT_meta-pine64 = "mickledore"

View file

@ -0,0 +1,19 @@
SUMMARY = "A psplash customization recipe"
DESCRIPTION ="This recipe allows personalization of pshlash colors and image"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=39bba7d2cf0ba1036f2a6e2be52fe3f0"
# Logo image file name as in /files folder
SPLASH_IMAGE_NAME = "logo.png"
# Color values in R,G,B format "0x00,0x00, 0x00"
BACKGROUND_COLOR = "0xff,0xff,0xff"
TEXT_COLOR = "0xff,0x00,0x00"
BAR_COLOR = "0x6d,0x6d,0x70"
BAR_BACKGROUND_COLOR = "0xff,0xff,0xff"
# Overide MACHINE_PSPLASH_PKG name
# add you own override if misssing
MACHINE_PSPLASH_PKG:qemuall = "default"
MACHINE_PSPLASH_PKG:qemux86-64 = "default"
MACHINE_PSPLASH_PKG:rpi = "raspberrypi"

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

View file

@ -0,0 +1,51 @@
include customize.bb
MACHINE_PSPLASH_PKG ?= "default"
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SPLASH_IMAGES:forcevariable = "file://${SPLASH_IMAGE_NAME} \
file://${SPLASH_IMAGE_NAME};outsuffix=${MACHINE_PSPLASH_PKG} \
"
# TASKS
def setPsplashColors(srcdir, BACKGROUND_COLOR, TEXT_COLOR, BAR_COLOR, BAR_BACKGROUND_COLOR):
import re
import stat
path = f"{srcdir}/psplash-colors.h"
f = open(path, "r")
psplash_colors = f.read()
f.close()
psplash_colors = re.sub("BACKGROUND_COLOR .*", f"BACKGROUND_COLOR {BACKGROUND_COLOR}", psplash_colors, 1)
psplash_colors = re.sub("TEXT_COLOR .*", f"TEXT_COLOR {TEXT_COLOR}", psplash_colors, 1)
psplash_colors = re.sub("BAR_COLOR .*", f"BAR_COLOR {BAR_COLOR}", psplash_colors, 1)
psplash_colors = re.sub("BAR_BACKGROUND_COLOR .*", f"BAR_BACKGROUND_COLOR {BAR_BACKGROUND_COLOR}", psplash_colors, 1)
# enable reading and writing permission
os.chmod(path, stat.S_IRWXU | stat.S_IRWXO | stat.S_IRWXG )
f = open(path, "w")
f.write(psplash_colors)
f.close()
python do_display_banner() {
bb.plain("***********************************************");
bb.plain("* META-SPLASH *");
bb.plain("* Applying custom psplash image *");
bb.plain("***********************************************");
}
addtask display_banner before do_build
do_compile:prepend() {
bb.plain("***********************************************");
bb.plain("* Applying custom psplash colors *");
bb.plain("***********************************************");
srcdir = d.getVar('S')
setPsplashColors(
srcdir,
d.getVar('BACKGROUND_COLOR'),
d.getVar('TEXT_COLOR'),
d.getVar('BAR_COLOR'),
d.getVar('BAR_BACKGROUND_COLOR')
)
}

View file

@ -0,0 +1,23 @@
SUMMARY = "Resize rootfs to fill userdata partition."
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
PACKAGE_ARCH = "${MACHINE_ARCH}"
ALLOW_EMPTY:${PN} = "1"
pkg_postinst_ontarget:${PN}() {
root=`lsblk -o NAME,LABEL -r | grep root | awk -F' ' '{print $1}'`
if [[ "$root" == *"mmcblk"* ]]; then
echo "Resizing $root partition to fill SDCard..."
psplash-write "MSG Resizing $root partition to fill SDCard..." || true
sgdisk -e /dev/${root:0:-2}
partprobe
echo yes | parted ---pretend-input-tty /dev/${root:0:-2} resizepart ${root:0-1} 100%
partprobe
resize2fs /dev/$root
fi
}
RDEPENDS:${PN} += "e2fsprogs-resize2fs parted util-linux gptfdisk"

View file

@ -0,0 +1,13 @@
SUMMARY = "A small weston gtk3 demo image for Star64"
require star64-image-minimal.bb
IMAGE_FEATURES += "splash package-management ssh-server-dropbear hwcodecs weston"
LICENSE = "MIT"
IMAGE_INSTALL += " packagegroup-gnome-desktop \
packagegroup-gnome-apps \
"

View file

@ -0,0 +1,31 @@
# Simple initramfs image. Mostly used for live images.
DESCRIPTION = "Small image capable of booting a device. The kernel includes \
the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
first 'init' program more efficiently."
INITRAMFS_SCRIPTS ?= "\
initramfs-framework-base \
linux-firmware-visionfive2-imggpu \
linux-firmware-visionfive2-wave420l \
linux-firmware-visionfive2-wave511 \
"
PACKAGE_INSTALL = "${INITRAMFS_SCRIPTS} ${VIRTUAL-RUNTIME_base-utils} udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
# Do not pollute the initrd image with rootfs features
IMAGE_FEATURES = ""
IMAGE_NAME_SUFFIX ?= ""
IMAGE_LINGUAS = ""
LICENSE = "MIT"
IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
inherit core-image
IMAGE_ROOTFS_SIZE = "8192"
IMAGE_ROOTFS_EXTRA_SPACE = "0"
# Use the same restriction as initramfs-module-install
COMPATIBLE_HOST = 'riscv64-pine64-linux'

View file

@ -0,0 +1,39 @@
SUMMARY = "A small commandline only image for Star64"
inherit core-image extrausers
P64_PACKAGES_MINIMAL = "resize-rootfs \
mc \
joe \
ca-certificates \
networkmanager \
wpa-supplicant \
avahi-daemon \
networkmanager-nmtui \
"
IMAGE_INSTALL = "packagegroup-core-boot \
packagegroup-core-full-cmdline \
${CORE_IMAGE_EXTRA_INSTALL} \
${P64_PACKAGES_MINIMAL} \
"
IMAGE_FEATURES += " splash \
package-management \
"
IMAGE_VERSION_SUFFIX = "-${DISTRO_VERSION}"
LICENSE = "MIT"
IMAGE_ROOTFS_SIZE ?= "8192"
IMAGE_FSTYPES = "wic.bz2"
#password is "pine64"
PASSWD = "\$5\$svJwM1eWQPV5bb\$CgKgw8mrSVcZEBPR1re37qeShy/scdk5GMbKZaSln74"
EXTRA_USERS_PARAMS = "\
useradd -p '${PASSWD}' pine64; \
usermod -p '${PASSWD}' root; \
"

View file

@ -0,0 +1,13 @@
SUMMARY = "A small weston gtk3 demo image for Star64"
require star64-image-minimal.bb
IMAGE_FEATURES += "splash package-management ssh-server-dropbear hwcodecs weston"
LICENSE = "MIT"
IMAGE_INSTALL += " gtk+3-demo \
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'weston-xwayland matchbox-terminal', '', d)} \
"

View file

@ -0,0 +1,12 @@
SUMMARY = "A small weston gtk3 demo image for Star64"
require star64-image-minimal.bb
IMAGE_FEATURES += "splash package-management ssh-server-dropbear hwcodecs weston"
LICENSE = "MIT"
IMAGE_INSTALL += " packagegroup-xfce-extended \
"