Skip to content

Commit 781005f

Browse files
committed
ti: Add more packages and make weston the OOB
Default and officially supported TI images will be the console image with weston installed and running on top of it. Therefore add weston in the list of packages to install. Also add a systemd service file to launch weston by-default on boot. Further, add an explicit step to bind dkms packages to kernel. Currently the dkms package gets installed before the kernel, therefore if this step is excluded, the binding would occur on first boot, which would cause the first boot time to get longer. Therefore add the "dkms autoinstall" step. Additionally, add firmware, gstreamer, chromium etc packages. Note: Weston does not launch on first boot, since the booting process kills it. It does launch on second boot onwards. Currently, full-fledged DEs make the armbian-firstlogin script launch them after the script finishes setup. But there is no logic yet to start other systemd services such as weston. Such logic should be added later. Signed-off-by: Suhaas Joshi <[email protected]>
1 parent 996e934 commit 781005f

File tree

7 files changed

+134
-1
lines changed

7 files changed

+134
-1
lines changed

config/boards/sk-am62b.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ ATF_BOARD="lite"
1616
OPTEE_ARGS="CFG_TEE_CORE_LOG_LEVEL=1"
1717
OPTEE_PLATFORM="k3-am62x"
1818
CC33XX_SUPPORT="yes"
19+
GPU_SUPPORT="yes"
20+
SOC_ID="am62"
21+
DISPLAY_SUPPORT="yes"
22+
CHROMIUM_SUPPORT="yes"

config/boards/sk-am64b.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ SERIALCON="ttyS2"
1616
ATF_BOARD="lite"
1717
OPTEE_ARGS=""
1818
OPTEE_PLATFORM="k3-am64x"
19+
SOC_ID="am64"
20+
EXTRA_BOARD_PACKAGES=("firmware-ti-prueth-am64" "firmware-ti-pruhsr-am64" "firmware-ti-prusw-am64")

config/sources/families/k3.conf

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,33 @@ declare -g SPD_OPTEED="SPD=opteed"
2020

2121
declare -g INSTALL_HEADERS="yes"
2222

23-
declare -g TI_PACKAGES=()
23+
declare -g TI_PACKAGES=("k3conf" "vim")
2424
if [[ "${CC33XX_SUPPORT}" == "yes" ]] ; then
2525
if [[ "${RELEASE}" == "trixie" || "${RELEASE}" == "noble" ]] ; then
2626
TI_PACKAGES+=("cc33xx-fw" "cc33xx-target-scripts" "cc33conf" "cc33calibrator")
2727
fi
2828
fi
2929

30+
if [[ "${GPU_SUPPORT}" == "yes" ]] ; then
31+
TI_PACKAGES+=("ti-img-rogue-driver-${SOC_ID}-dkms" "ti-img-rogue-umlibs-${SOC_ID}" "ti-img-rogue-tools-${SOC_ID}" "ti-img-rogue-firmware-${SOC_ID}")
32+
TI_PACKAGES+=("mesa-vulkan-drivers" "libgl1-mesa-dri")
33+
TI_PACKAGES+=("gstreamer1.0-tools" "gstreamer1.0-plugins-good" "gstreamer1.0-plugins-bad" "gstreamer1.0-plugins-base")
34+
fi
35+
36+
if [[ "${DISPLAY_SUPPORT}" == "yes" ]] ; then
37+
TI_PACKAGES+=("weston" "seatd")
38+
fi
39+
40+
if [[ "${CHROMIUM_SUPPORT}" == "yes" ]] ; then
41+
TI_PACKAGES+=("chromium")
42+
fi
43+
44+
TI_PACKAGES+=("firmware-cnm-wave" "firmware-ti-ipc-${SOC_ID}" "firmware-ti-connectivity")
45+
46+
if [[ ! -z ${EXTRA_BOARD_PACKAGES} ]] ; then
47+
TI_PACKAGES+=("${EXTRA_BOARD_PACKAGES[@]}")
48+
fi
49+
3050
enable_extension "ti-debpkgs"
3151

3252
case "${BRANCH}" in

extensions/ti-debpkgs.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,20 @@ function custom_apt_repo__install_ti_packages() {
3535
display_alert "Valid Options Would Have Been: ${valid_suites[@]}"
3636
fi
3737
}
38+
39+
function pre_customize_image__enable_services() {
40+
run_host_command_logged "mkdir -p $DEST/lib/systemd/system/"
41+
run_host_command_logged "cp -v $SRC/packages/bsp/ti/weston/weston.socket $SDCARD/lib/systemd/system/weston.socket"
42+
run_host_command_logged "cp -v $SRC/packages/bsp/ti/weston/weston.service $SDCARD/lib/systemd/system/weston.service"
43+
run_host_command_logged "cp -v $SRC/packages/bsp/ti/weston/weston $SDCARD/etc/default/weston"
44+
45+
chroot_sdcard "systemctl enable weston" || display_alert "systemctl enable failed"
46+
}
47+
48+
function post_install_kernel_debs__activate_dkms() {
49+
if [[ ${GPU_SUPPORT} == "yes" ]] ; then
50+
kernel_version=$(grab_version "${SRC}/cache/sources/${LINUXSOURCEDIR}")
51+
kernel_version_family="${kernel_version}-${BRANCH}-${LINUXFAMILY}"
52+
chroot_sdcard "dkms autoinstall --verbose --kernelver ${kernel_version_family}"
53+
fi
54+
}

packages/bsp/ti/weston/weston

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
XDG_RUNTIME_DIR=/run/user/0
2+
WAYLAND_DISPLAY=wayland-1
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# This is a system unit for launching Weston with auto-login as the
2+
# user configured here.
3+
#
4+
# Weston must be built with systemd support, and your weston.ini must load
5+
# the plugin systemd-notify.so.
6+
[Unit]
7+
Description=Weston, a Wayland compositor, as a system service
8+
Documentation=man:weston(1) man:weston.ini(5)
9+
Documentation=http://wayland.freedesktop.org/
10+
11+
# Make sure we are started after logins are permitted.
12+
Requires=systemd-user-sessions.service
13+
After=systemd-user-sessions.service
14+
15+
# If Plymouth is used, we want to start when it is on its way out.
16+
After=plymouth-quit-wait.service
17+
18+
# D-Bus is necessary for contacting logind. Logind is required.
19+
Wants=dbus.socket
20+
After=dbus.socket
21+
22+
# Ensure the socket is present
23+
Requires=weston.socket
24+
25+
# Since we are part of the graphical session, make sure we are started before
26+
# it is complete.
27+
Before=graphical.target
28+
29+
# Prevent starting on systems without virtual consoles, Weston requires one
30+
# for now.
31+
ConditionPathExists=/dev/tty0
32+
33+
# Ensure that it doesn't run on 1st boot, since the setup process will kill it
34+
ConditionPathExists=!/root/.not_logged_in_yet
35+
36+
[Service]
37+
# Requires systemd-notify.so Weston plugin.
38+
Type=simple
39+
EnvironmentFile=/etc/default/weston
40+
ExecStart=/usr/bin/weston --backend=drm-backend.so --continue-without-input --idle-time=0
41+
42+
# Optional watchdog setup
43+
#TimeoutStartSec=60
44+
#WatchdogSec=20
45+
46+
# The user to run Weston as.
47+
User=root
48+
Group=root
49+
50+
# Make sure the working directory is the users home directory
51+
WorkingDirectory=/root/
52+
53+
# Set up a full user session for the user, required by Weston.
54+
PAMName=weston-autologin
55+
56+
# A virtual terminal is needed.
57+
TTYPath=/dev/tty7
58+
TTYReset=yes
59+
TTYVHangup=yes
60+
TTYVTDisallocate=yes
61+
62+
# Fail to start if not controlling the tty.
63+
StandardInput=tty-fail
64+
StandardOutput=journal
65+
StandardError=journal
66+
67+
# Log this user with utmp, letting it show up with commands 'w' and 'who'.
68+
UtmpIdentifier=tty7
69+
UtmpMode=user
70+
71+
[Install]
72+
# Note: If you only want weston to start on-demand, remove this line with a
73+
# service drop file
74+
WantedBy=graphical.target multi-user.target
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[Unit]
2+
Description=Weston socket
3+
RequiresMountsFor=/run
4+
5+
[Socket]
6+
ListenStream=/run/wayland-0
7+
SocketMode=0775
8+
# SocketUser=weston
9+
# SocketGroup=wayland
10+
RemoveOnStop=yes
11+
12+
[Install]
13+
WantedBy=sockets.target
14+

0 commit comments

Comments
 (0)