wiki:techsheets:schulkonsole

Technische Dokumentation Schulkonsole

LINBO - start.conf-Editor: Neue Variablen hinzufügen

1. Global

  • In lib/Schulkonsole/Linbo.pm unter %_allowed_keys in Bereich 3 die Variablendefinition hinzufügen:
    	3 => {	# [LINBO]
    		group => 1,
    		cache => 1,
    		server => 1,
    		downloadtype => 1,
    		roottimeout => 2,
    		autopartition => 4,
    		autoformat => 4,
    		autoinitcache => 4,
    		backgroundfontcolor => 1,
    		consolefontcolorstdout => 1,
    		consolefontcolorstderr => 1,
    	},
    
    • string => 1
    • integer => 2
    • hex => 3
    • boolean => 4
  • Auch in Linbo.pm muss in der Subroutine sub write_start_conf (ca. ab Zeile 1065) in einer foreach-Schleife die Liste der globalen Variablen ergänzt werden (ca. Zeile 1265):
    	foreach my $key (('Cache', 'Server', 'Group', 'RootTimeout',
    	                  'Autopartition', 'AutoFormat', 'AutoInitCache',
    	                  'DownloadType', 'BackgroundFontColor',
                              'ConsoleFontColorStdout', 'ConsoleFontColorStderr')) {
    		my $key_data = $$linbo{Keys}{lc $key};
    		next unless $key_data;
    
  • In der Konfigurationsvorlage linbo/templates/part/start.conf.partition ist die neue Variable ebenso zu ergänzen:
      [LINBO]                        # globale Konfiguration
      Cache = /dev/$DEVICE8          # Gerätenamen der lokalen Cachpartition
      Server = $SERVER-IP            # IP des Servers
      RootTimeout = 600              # automatischer Rootlogout nach 600 Sek.
      AutoPartition = no             # automatische Partitionsreparatur beim LINBO-Start
      AutoFormat = no                # automatisches Formatieren aller Partitionen beim LINBO-Start
      AutoInitCache = no             # automatisches Befüllen des Caches beim LINBO-Start
      DownloadType = rsync           # Image-Download per Rsync
      BackgroundFontColor = white    # Bildschirmschriftfarbe (default: white)
      ConsoleFontColorStdout = white # Konsolenschriftfarbe (default: white)
      ConsoleFontColorStderr = red   # Konsolenschriftfarbe für Fehler-/Warnmeldungen (default: red)
    
  • Im html-Template shtml/linbo_edit.shtml muss im globalen Konfigurationsbereich für jede Option eine Tabellenzeile (class="odd/even") hinzugefügt werden:
      </tr>
      <tr class="odd">
      <td><label for="linbo_backgroundfontcolor"><gettext>Bildschirmschriftfarbe</gettext>:</label></td>
      <td><input id="linbo_backgroundfontcolor" name="linbo_backgroundfontcolor" value="white"></td>
      </tr>
    
  • Schließlich muss die Variable noch in den cgi-Quellen des Linbo-Editors in src/cgi-bin/linbo_edit.in eingetragen werden:
      =item C<linbo_backgroundfontcolor>
    
      Value of key BackgroundFontColor
    

2. OS

  • In lib/Schulkonsole/Linbo.pm unter %_allowed_keys in Bereich 2 die Variablendefinition hinzufügen:
    	2 => {	# [OS]
    		name => 1,
    		version => 1,
    		description => 1,
    		iconname => 1,
    		image => 1,
    		baseimage => 1,
    		boot => 1,
    		root => 1,
    		kernel => 1,
    		initrd => 1,
    		append => 1,
    		startenabled => 4,
    		syncenabled => 4,
    		newenabled => 4,
    		hidden => 4,
    		autostart => 4,
    		autostarttimeout => 2,
    		defaultaction => 1,
    	},
    
  • Ebenfalls in Linbo.pm muss in der Subroutine sub write_start_conf (ca. ab Zeile 1065) in einer foreach-Schleife die Liste der OS-Variablen ergänzt werden (ca. Zeile 1347):
    		foreach my $key (('Name', 'Version', 'Description', 'IconName', 'Image',
    		                  'BaseImage', 'Boot', 'Root', 'Kernel', 'Initrd',
    		                  'Append', 'StartEnabled', 'SyncEnabled',
    		                  'NewEnabled', 'Hidden', 'Autostart',
    		                  'AutostartTimeout', 'DefaultAction')) {
    			my $key_data = $oss{$name_version}{Keys}{lc $key};
    			next unless $key_data;
    
  • In den Konfigurationsvorlagen für die Betriebssystem unter linbo/templates/os muss die neue Variable ebenso ergänzt werden :
    	[OS]                                            # Beginn einer Betriebssystemdefinition
    	Name = Debian Etch Part$PART                    # Name des Betriebssystems
    	Version =                                       # Version (optional, frei waehlbar)
    	Description = Debian Etch Part$PART             # Beschreibung
    	IconName = debian.png                           # Icon für die Startseite, muss unter /var/linbo/icons abgelegt sein
    	Image =                                         # Dateiname des differentiellen Images (Erweiterung .rsync)
    	BaseImage = $RECHNERGRUPPE-etch-part$PART.cloop # Dateiname des Basisimages (Erweiterung .cloop)
    	Boot = /dev/$DEVICE$PART                        # Partition, die Kernel & Initrd enthaelt
    	Root = /dev/$DEVICE$PART                        # Partition, in die das BS installiert ist
    	Kernel = vmlinuz                                # bei Windows immer grub.exe
    	Initrd = initrd.img                             # Relativer Pfad zur Initrd
    	Append = ro                                     # Kernel-Append-Parameter
    	StartEnabled = yes                              # "Start"-Button anzeigen
    	SyncEnabled = yes                               # "Sync+Start"-Button anzeigen
    	NewEnabled = yes                                # "Neu+Start"-Button anzeigen
    	Hidden = yes                                    # blendet den OS-Reiter für dieses System aus
     	Autostart = no                                  # yes: startet dieses System automatisch synchronisiert
    	DefaultAction = sync                            # Standardaktion bei Autostart: start|sync|new
    	AutostartTimeout = 5                            # Timeout in Sekunden für Benutzerabbruch bei Autostart
    
  • Im html-Template shtml/linbo_edit.shtml muss im OS-Konfigurationsbereich für jede Option eine Tabellenzeile (class="odd/even") hinzugefügt werden:
    	<tr class="odd">
    	<td><label for="${devs{os}{n}}_defaultaction"><gettext>Standard-Autostart-Aktion ausw&auml;hlen</gettext>:</label></td>
    	<td>
    	<select name="${devs{os}{n}}_defaultaction">
    	<option value="start"><gettext>start</gettext></option>
    	<option value="sync"><gettext>sync</gettext></option>
    	<option value="new"><gettext>new</gettext></option>
    	</select>
    	</td>
    	</tr>
    
  • Schließlich muss die Variable noch in den cgi-Quellen des Linbo-Editors in src/cgi-bin/linbo_edit.in eingetragen werden:
      =item C<linbo_backgroundfontcolor>
    
      Value of key BackgroundFontColor