From c2bb38102286b56e60afdee13c1430c0ba994e26 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Wed, 8 Feb 2023 14:13:50 +0100 Subject: host-control: Add system initramfs update support Signed-off-by: Paul Kocialkowski --- host-control | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/host-control b/host-control index c9e0cb0..a7c3505 100755 --- a/host-control +++ b/host-control @@ -27,6 +27,7 @@ class host_control(): " system-ping ping host system\n" \ " system-update update system\n" \ " system-restart restart system\n" \ + " system-initramfs-update update system initramfs\n" \ " system-daemon-status show systemd status\n" \ " system-daemon-log show systemd log\n" \ " system-daemon-reload reload systemd units\n" \ @@ -401,6 +402,22 @@ class host_control(): self.print_command(command) subprocess.call(command) + def system_initramfs_update(self, host): + address = self.ssh_address(host) + + hook = self.hook_lookup(host, "initramfs-update") + if hook == None: + return 1 + + arguments = self.hook_command(hook) + if arguments == None: + return 1 + + command = self.ssh_command(address, arguments) + + self.print_command(command) + subprocess.call(command) + def system_daemon_status(self, host): address = self.ssh_address(host) arguments = [ "SYSTEMD_COLORS=1", "systemctl", "status" ] @@ -498,6 +515,8 @@ class host_control(): return self.system_update(host) elif action == "system-restart": return self.system_restart(host) + elif action == "system-initramfs-update": + return self.system_initramfs_update(host) elif action == "system-daemon-status": return self.system_daemon_status(host) elif action == "system-daemon-log": -- cgit v1.2.3