Skip to content

Commit

Permalink
meta-meson: add startup script for fdt overlay
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Wan <[email protected]>
Change-Id: Ib61da1e3002859f9fb818ec1ca3176e012ba572d
  • Loading branch information
Mark-Wan-Namtso committed Dec 16, 2024
1 parent 25112c5 commit 93e5446
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion recipes-core/images/aml-package.inc
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ do_aml_pack() {
if [ -n "${BOARD_NAME}" ]; then
local img_file="${BOARD_NAME}-yocto-$(date +"%Y%m%d" | cut -c 3-).img"
mv ${DEPLOY_DIR_IMAGE}/aml_upgrade_package.img ${DEPLOY_DIR_IMAGE}/$img_file
xz -k ${DEPLOY_DIR_IMAGE}/$img_file
xz -kf ${DEPLOY_DIR_IMAGE}/$img_file
fi
}

Expand Down
13 changes: 13 additions & 0 deletions recipes-khadas/khadas-custom/files/khadas-custom.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=khadas custom rootfs init
After=dnsmasq.service

[Service]
User=root
Group=root
AmbientCapabilities=CAP_DAC_OVERRIDE
CapabilityBoundingSet=CAP_DAC_OVERRIDE
ExecStart=/usr/bin/khadas-custom.sh

[Install]
WantedBy=multi-user.target
6 changes: 6 additions & 0 deletions recipes-khadas/khadas-custom/files/khadas-custom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

rm /boot -rf
ln -sf /rom/boot/ /boot


11 changes: 11 additions & 0 deletions recipes-khadas/khadas-custom/khadas-custom.bb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ SUMMARY = "khadas-custom"
SECTION = "khadas-custom"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

inherit systemd

S = "${WORKDIR}"

Expand Down Expand Up @@ -47,6 +49,8 @@ SRC_URI = "\
file://overlays/vim1s/spi0.dtbo \
file://overlays/vim1s/uart_c.dtbo \
file://overlays/vim1s/kvim1s.dtb.overlay.env \
file://khadas-custom.sh \
file://khadas-custom.service \
"

do_install() {
Expand Down Expand Up @@ -79,8 +83,15 @@ do_install() {
install -m 0755 ${S}/fan.sh ${D}${bindir}
install -m 0755 ${S}/fan_setup.sh ${D}${bindir}

if [ "${@bb.utils.contains("DISTRO_FEATURES", "systemd", "yes", "no", d)}" = "yes" ]; then
install -D -m 0644 ${WORKDIR}/khadas-custom.service ${D}${systemd_unitdir}/system/khadas-custom.service
fi
install -m 0755 ${S}/khadas-custom.sh ${D}${bindir}

}

SYSTEMD_SERVICE:${PN} = " khadas-custom.service "

FILES:${PN} += " /boot/* "


0 comments on commit 93e5446

Please sign in to comment.