forked from Xilinx/XRT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created a Daemon to modprobe/rmmod vdu drivers based on request. (Xil…
…inx#6916) * adding a daemon which modprobes vdu modules * removing unneccessary locks * changing the method to modprobe and rmmod of vdu * removing zocl logic * removing zocl logic * changing names * removed unused functionalities Co-authored-by: root <[email protected]>
- Loading branch information
1 parent
35d7eef
commit b46719c
Showing
4 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/sh | ||
# This script is used for probing and removing vdu modules | ||
|
||
log_file="/var/log/vdu_daemon_logs" | ||
vdu_init_dir="/etc/" | ||
vdu_init_file=$vdu_init_dir/vdu_init | ||
|
||
function write_log() { | ||
now_time='['$(date +"%Y-%m-%d %H:%M:%S")']' | ||
echo $now_time $1 | tee -a "$log_file" | ||
} | ||
|
||
function vdu_probe() { | ||
|
||
write_log 'modprobing vdu modules ...' | ||
|
||
modprobe allegro ; modprobe al5d ; | ||
if [ $? == 0 ] | ||
then | ||
write_log 'modprobe successful' | ||
else | ||
write_log 'modprobe failed' | ||
fi | ||
echo 0 > $vdu_init_file | ||
} | ||
|
||
write_log 'Daemon script started. this script is used for probing/removing vdu modules' | ||
|
||
mkdir -p $vdu_init_dir | ||
touch $vdu_init_file | ||
chmod 666 $vdu_init_file | ||
while true | ||
do | ||
action=$(cat $vdu_init_file) | ||
#action :0 -> dont do anything | ||
#action :1 -> modprobe the modules | ||
|
||
if [ "$action" == 1 ] | ||
then | ||
vdu_probe | ||
fi | ||
|
||
sleep 5 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
SUMMARY = "modprobe/rmmod of vdu modules" | ||
SECTION = "PETALINUX/apps" | ||
LICENSE = "MIT" | ||
|
||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
|
||
SRC_URI = "file://vdu-init file://vdu-init.service " | ||
|
||
S = "${WORKDIR}" | ||
|
||
FILESEXTRAPATHS:prepend := "${THISDIR}/files:" | ||
|
||
inherit update-rc.d systemd | ||
|
||
INITSCRIPT_NAME = "vdu-init" | ||
INITSCRIPT_PARAMS = "start 99 S ." | ||
|
||
SYSTEMD_PACKAGES = "${PN}" | ||
SYSTEMD_SERVICE:${PN} = "vdu-init.service" | ||
SYSTEMD_AUTO_ENABLE:${PN}="enable" | ||
|
||
do_install() { | ||
if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
install -d ${D}${sysconfdir}/init.d/ | ||
install -m 0755 ${WORKDIR}/vdu-init ${D}${sysconfdir}/init.d/ | ||
fi | ||
|
||
install -d ${D}${bindir} | ||
install -m 0755 ${WORKDIR}/vdu-init ${D}${bindir}/ | ||
install -d ${D}${systemd_system_unitdir} | ||
install -m 0644 ${WORKDIR}/vdu-init.service ${D}${systemd_system_unitdir} | ||
} | ||
|
||
FILES:${PN} += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${sysconfdir}/*', '', d)}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Unit] | ||
Description=vdu-init | ||
|
||
[Service] | ||
ExecStart=/usr/bin/vdu-init | ||
StandardOutput=journal+console | ||
|
||
[Install] | ||
WantedBy=multi-user.target |