This commit is contained in:
Jonas Forsberg 2021-09-23 12:54:33 +02:00
parent 8ecb1687b3
commit cac777ffeb
4 changed files with 111 additions and 14 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 KiB

View File

@ -0,0 +1,71 @@
#DEFAULT vesamenu.c32
#PROMPT 0
UI vesamenu.c32
TIMEOUT 150
ONTIMEOUT local
MENU TITLE Transportable Lab Unit PXE Menu
MENU RESOLUTION 1024 768
MENU BACKGROUND opensuse.png
# color codes in #AARRGGBB notation, where AA RR GG BB are hexadecimal digits for
# alpha (opacity), red, green and blue, respectively. #00000000 represents fully
# transparent, and #ffffffff represents opaque white.
#MENU COLOR element ansi foreground background shadow
MENU COLOR screen 0 #80ffffff #00000000 std # background colour not covered by the splash image
MENU COLOR border 0 #ffffffff #ee000000 std # The wire-frame border
MENU COLOR title 0 #ff30ba78 #ee000000 std # Menu title text
MENU COLOR sel 0 #ff7ad4aa #ee000000 std # Selected menu option
MENU COLOR hotsel 0 #ffff8e77 #ee000000 std # The selected hotkey (set with ^ in MENU LABEL)
MENU COLOR unsel 0 #ffffffff #ee000000 std # Unselected menu options
MENU COLOR hotkey 0 #ffff8e77 #ee000000 std # Unselected hotkeys (set with ^ in MENU LABEL)
MENU COLOR tabmsg 0 #c07ad4aa #00000000 std # Tab text
MENU COLOR timeout_msg 0 #807ad4aa #00000000 std # Timout text
MENU COLOR timeout 0 #c0ff6a52 #00000000 std # Timout counter
MENU COLOR disabled 0 #807f7f7f #ee000000 std # Disabled menu options, including SEPARATORs
MENU COLOR cmdmark 0 #c000ffff #ee000000 std # Command line marker - The '> ' on the left when editing an option
MENU COLOR cmdline 0 #c0ffffff #ee000000 std # Command line - The text being edited
# Options below haven't been tested, descriptions may be lacking.
MENU COLOR scrollbar 0 #40000000 #00000000 std # Scroll bar
MENU COLOR pwdborder 0 #80ffffff #20ffffff std # Password box wire-frame border
MENU COLOR pwdheader 0 #80ff8080 #20ffffff std # Password box header
MENU COLOR pwdentry 0 #80ffffff #20ffffff std # Password entry field
MENU COLOR help 0 #c0ffffff #00000000 std # Help text, if set via 'TEXT HELP ... ENDTEXT'
LABEL local
MENU LABEL Boot local
localboot
MENU BEGIN opensuse
MENU TITLE openSUSE Installs
LABEL Previous
MENU LABEL ^Previous Menu
MENU EXIT
MENU SEPARATOR
MENU INCLUDE pxelinux.cfg/opensuse.menu
MENU END
MENU BEGIN home_servers
MENU TITLE Servers at Home
LABEL Previous
MENU LABEL ^Previous Menu
MENU EXIT
MENU SEPARATOR
MENU INCLUDE pxelinux.cfg/home_servers.menu
MENU END
MENU BEGIN tools
MENU TITLE Tools
LABEL Previous
MENU LABEL ^Previous Menu
MENU EXIT
MENU SEPARATOR
MENU INCLUDE pxelinux.cfg/tools.menu
MENU END
LABEL poweroff
MENU LABEL Power Off
COMBOOT poweroff.com

View File

@ -0,0 +1,27 @@
Install syslinux:
pkg.installed:
- name: syslinux
Install atftp:
pkg.installed:
- name: atftp
{% set files = ['memdisk', 'poweroff.com', 'pxelinux.0', 'vesamenu.c32'] -%}
{% for file in files -%}
Linking {{ file }}:
file.symlink:
- name: /srv/tftpboot/{{ file }}
- target: /usr/share/syslinux/{{ file }}
{% endfor %}
Add files to tftpboot:
file.recurse:
- name: /srv/tftpboot
- source: salt://atftp/files
- include_empty: True
Start the atftpd.socket:
service.running:
- name: atftpd.socket
- enable: True

View File

@ -5,6 +5,7 @@ gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from gi.repository import Gio
from gi.repository import GLib
import os
import time
import threading
@ -80,24 +81,22 @@ class Main:
"rmt-server-sync.timer",
"rmt-server-mirror.timer",
"rmt-server-systems-scc-sync.timer",
"atftp.socket",
"atftpd.socket",
"mariadb"
]
self.update()
def update(self):
logging.debug("Update triggered")
self.check_service()
self.check_ip()
timer_thread = threading.Thread(target=self.sleep)
timer_thread = threading.Thread(target=self.update)
timer_thread.daemon = True
timer_thread.start()
def sleep(self):
def update(self):
while True:
logging.debug("Update triggered")
GLib.idle_add(self.check_service)
GLib.idle_add(self.check_ip)
time.sleep(SLEEPTIMER)
self.update()
def check_service(self):
for service in self.service_checks:
@ -106,10 +105,10 @@ class Main:
result = subprocess.run(["systemctl", "is-active", service, "--quiet"])
if result.returncode == 0:
logging.debug("%s is running", service)
image.set_from_gicon(self.icon_ok, Gtk.IconSize.DIALOG)
image.set_from_gicon(self.icon_ok, Gtk.IconSize.BUTTON)
else:
logging.debug("%s is not running, exit code %i",service, result.returncode)
image.set_from_gicon(self.icon_not_ok, Gtk.IconSize.DIALOG)
image.set_from_gicon(self.icon_not_ok, Gtk.IconSize.BUTTON)
def check_ip(self):
#checking LAN network