dom0+vm: Trigger appmenus sync after yum transaction (#45), NEW QREXEC COMMAND
After yum transaction (install/upgrade/remove), yum-plugin-post-transaction-actions will execute script which trigger qvm-sync-appmenus in dom0 (through qrexec). THIS INTRODUCE NEW PREDEFINED COMMAND IN QREXEC
This commit is contained in:
parent
4634a6897c
commit
83d211836a
1
common/qubes_trigger_sync_appmenus.action
Normal file
1
common/qubes_trigger_sync_appmenus.action
Normal file
@ -0,0 +1 @@
|
|||||||
|
*:any:/usr/lib/qubes/qubes_trigger_sync_appmenus.sh
|
7
common/qubes_trigger_sync_appmenus.sh
Executable file
7
common/qubes_trigger_sync_appmenus.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
UPDATEABLE=`/usr/bin/xenstore-read qubes_vm_updateable`
|
||||||
|
|
||||||
|
if [ "$UPDATEABLE" = "True" ]; then
|
||||||
|
echo -n SYNC > /var/run/qubes/qrexec_agent
|
||||||
|
fi
|
@ -51,7 +51,8 @@ enum {
|
|||||||
|
|
||||||
enum {
|
enum {
|
||||||
QREXEC_EXECUTE_FILE_COPY=0x700,
|
QREXEC_EXECUTE_FILE_COPY=0x700,
|
||||||
QREXEC_EXECUTE_FILE_COPY_FOR_DISPVM
|
QREXEC_EXECUTE_FILE_COPY_FOR_DISPVM,
|
||||||
|
QREXEC_EXECUTE_APPMENUS_SYNC
|
||||||
};
|
};
|
||||||
|
|
||||||
struct server_header {
|
struct server_header {
|
||||||
|
@ -482,6 +482,9 @@ void handle_trigger_io()
|
|||||||
else if (!strcmp(buf, "DVMR"))
|
else if (!strcmp(buf, "DVMR"))
|
||||||
s_hdr.client_id =
|
s_hdr.client_id =
|
||||||
QREXEC_EXECUTE_FILE_COPY_FOR_DISPVM;
|
QREXEC_EXECUTE_FILE_COPY_FOR_DISPVM;
|
||||||
|
else if (!strcmp(buf, "SYNC"))
|
||||||
|
s_hdr.client_id =
|
||||||
|
QREXEC_EXECUTE_APPMENUS_SYNC;
|
||||||
if (s_hdr.client_id) {
|
if (s_hdr.client_id) {
|
||||||
s_hdr.type = MSG_AGENT_TO_SERVER_TRIGGER_EXEC;
|
s_hdr.type = MSG_AGENT_TO_SERVER_TRIGGER_EXEC;
|
||||||
write_all_vchan_ext(&s_hdr, sizeof s_hdr);
|
write_all_vchan_ext(&s_hdr, sizeof s_hdr);
|
||||||
|
@ -361,6 +361,10 @@ void handle_execute_predefined_command(int req)
|
|||||||
rcmd = "directly:user:/usr/lib/qubes/qfile-agent-dvm";
|
rcmd = "directly:user:/usr/lib/qubes/qfile-agent-dvm";
|
||||||
lcmd = "/usr/lib/qubes/qfile-daemon-dvm";
|
lcmd = "/usr/lib/qubes/qfile-daemon-dvm";
|
||||||
break;
|
break;
|
||||||
|
case QREXEC_EXECUTE_APPMENUS_SYNC:
|
||||||
|
rcmd = "user:grep -H = /usr/share/applications/*.desktop";
|
||||||
|
lcmd = "/usr/bin/qvm-sync-appmenus";
|
||||||
|
break;
|
||||||
default: /* cannot happen, already sanitized */
|
default: /* cannot happen, already sanitized */
|
||||||
fprintf(stderr, "got trigger exec no %d\n", req);
|
fprintf(stderr, "got trigger exec no %d\n", req);
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -402,7 +406,8 @@ void sanitize_message_from_agent(struct server_header *untrusted_header)
|
|||||||
case MSG_AGENT_TO_SERVER_TRIGGER_EXEC:
|
case MSG_AGENT_TO_SERVER_TRIGGER_EXEC:
|
||||||
untrusted_cmd = untrusted_header->client_id;
|
untrusted_cmd = untrusted_header->client_id;
|
||||||
if (untrusted_cmd != QREXEC_EXECUTE_FILE_COPY &&
|
if (untrusted_cmd != QREXEC_EXECUTE_FILE_COPY &&
|
||||||
untrusted_cmd != QREXEC_EXECUTE_FILE_COPY_FOR_DISPVM) {
|
untrusted_cmd != QREXEC_EXECUTE_FILE_COPY_FOR_DISPVM &&
|
||||||
|
untrusted_cmd != QREXEC_EXECUTE_APPMENUS_SYNC) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"received MSG_AGENT_TO_SERVER_TRIGGER_EXEC cmd %d ?\n",
|
"received MSG_AGENT_TO_SERVER_TRIGGER_EXEC cmd %d ?\n",
|
||||||
untrusted_cmd);
|
untrusted_cmd);
|
||||||
|
@ -33,6 +33,7 @@ License: GPL
|
|||||||
URL: http://www.qubes-os.org
|
URL: http://www.qubes-os.org
|
||||||
Requires: /usr/bin/xenstore-read
|
Requires: /usr/bin/xenstore-read
|
||||||
Requires: fedora-release
|
Requires: fedora-release
|
||||||
|
Requires: yum-plugin-post-transaction-actions
|
||||||
BuildRequires: xen-devel
|
BuildRequires: xen-devel
|
||||||
|
|
||||||
%define _builddir %(pwd)/common
|
%define _builddir %(pwd)/common
|
||||||
@ -78,6 +79,10 @@ mkdir -p $RPM_BUILD_ROOT/etc/udev/rules.d
|
|||||||
cp qubes_network.rules $RPM_BUILD_ROOT/etc/udev/rules.d/
|
cp qubes_network.rules $RPM_BUILD_ROOT/etc/udev/rules.d/
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes/
|
mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||||
cp setup_ip $RPM_BUILD_ROOT/usr/lib/qubes/
|
cp setup_ip $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/etc/yum/post-actions
|
||||||
|
cp qubes_trigger_sync_appmenus.action $RPM_BUILD_ROOT/etc/yum/post-actions/
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes
|
||||||
|
cp qubes_trigger_sync_appmenus.sh $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||||
|
|
||||||
%triggerin -- initscripts
|
%triggerin -- initscripts
|
||||||
cp /var/lib/qubes/serial.conf /etc/init/serial.conf
|
cp /var/lib/qubes/serial.conf /etc/init/serial.conf
|
||||||
@ -226,3 +231,5 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
/usr/bin/xenstore-watch-qubes
|
/usr/bin/xenstore-watch-qubes
|
||||||
/etc/udev/rules.d/qubes_network.rules
|
/etc/udev/rules.d/qubes_network.rules
|
||||||
/usr/lib/qubes/setup_ip
|
/usr/lib/qubes/setup_ip
|
||||||
|
/etc/yum/post-actions/qubes_trigger_sync_appmenus.action
|
||||||
|
/usr/lib/qubes/qubes_trigger_sync_appmenus.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user