commit 9fa0e7636f26951f7c82cd083665ba88e5b91994 Author: Lino Jorzick Date: Wed Nov 9 21:21:32 2022 +0100 Initial Commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ff34921 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +debian/gruelag-hppdg6-uefi-conf/* +debian/gruelag-hppdg6-uefi-conf.substvars +debian/gruelag-hppdg6-uefi-conf.debhelper.log +debian/files +debian/debhelper-build-stamp +debian/*.debhelper diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3857f4b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Felix Jacobi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/control b/control new file mode 100644 index 0000000..0971ff7 --- /dev/null +++ b/control @@ -0,0 +1,138 @@ +[Product] +type: localboot +id: gruelag-hppdg6-uefi-conf +name: Gruelag HP Prodesk G6 UEFI Konfiguration +description: Mit diesem Paket werden grundsätzliche Systemparameter (BIOS-Settings) für die HP-Rechner gesetzt. +advice: +version: 1.0 +packageVersion: 1.5 +setupScript: install.ins + +[ProductProperty] +name: propplaceholder +description: Property-Tag Platzhalter +default: SCHULE + +[ProductProperty] +name: oldpw +description: BIOS-Kennwort (bisher) +default: + +[ProductProperty] +name: newpw +description: BIOS-Kennwort (neu) +default: + +[ProductProperty] +name: uefibootorder +description: UEFI Boot Order (z.B. HDD:M.2:1,HDD:USB:1,NETWORK IPV4:EMBEDDED:1,NETWORK IPV6:EMBEDDED:1) +default: ["HDD:M.2:1,NETWORK IPV4:EMBEDDED:1"] + +[ProductProperty] +name: language +description: BIOS-Sprache +editable: false +values: ["English", "Deutsch"] +default: ["English"] + +[ProductProperty] +name: keyboardlayout +description: Tastaturlayout +editable: false +values: ["English", "Deutsch"] +default: ["Deutsch"] + +[ProductProperty] +name: pxeboot +description: Network (PXE) Boot +editable: false +values: ["Enable", "Disable"] +default: ["Enable"] + +[ProductProperty] +name: ipv6pxeboot +description: IPv6 during UEFI Boot +editable: false +values: ["Enable", "Disable"] +default: ["Disable"] + +[ProductProperty] +name: restrictusb +description: Restrict USB Devices +editable: false +values: ["Allow all USB Devices", "Allow only keyboard and mouse", "Allow all but storage devices and hubs"] +default: ["Allow all USB Devices"] + +[ProductProperty] +name: modponpw +description: Allow User to Modify Power-on Password +editable: false +values: ["No", "Change Only", "Change or Delete"] +default: ["No"] + +[ProductProperty] +name: passforbootmn +description: Prompt for Admin authentication on F9 (Boot Menu) +editable: false +values: ["Enable", "Disable"] +default: ["Enable"] + +[ProductProperty] +name: passforrecover +description: Prompt for Admin authentication on F11 (System Recovery) +editable: false +values: ["Enable", "Disable"] +default: ["Enable"] + +[ProductProperty] +name: passforpxe +description: Prompt for Admin authentication on F12 (Network Boot) +editable: false +values: ["Enable", "Disable"] +default: ["Enable"] + +[ProductProperty] +name: intspkr +description: Internal Speakers +editable: false +values: ["Enable", "Disable"] +default: ["Enable"] + +[ProductProperty] +name: secureboot +description: Secure Boot +editable: false +values: ["Enable", "Disable"] +default: ["Disable"] + +[ProductProperty] +name: wakeonlan +description: Wake On LAN +editable: false +values: ["Disabled", "Boot to Network", "Boot to Hard Drive", "Boot to Normal Boot Order"] +default: ["Boot to Network"] + +[ProductProperty] +name: wakeonlanpw +description: Wake on LAN Power-on Password Policy +editable: false +values: ["Bypass Password", "Require Password"] +default: ["Bypass Password"] + + + + + + + + + + + + + + + + + + diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..dbe4ab1 --- /dev/null +++ b/debian/control @@ -0,0 +1,18 @@ +Source: winst-gruelag-hppdg6-uefi-conf +Section: misc +Priority: optional +Maintainer: Gruelag GmbH +Build-Depends: debhelper-compat (= 13), + dh-sequence-iserv, + dh-sequence-iserv-winst, +Standards-Version: 4.4.1 +Homepage: https://www.gruelag.de +Rules-Requires-Root: no + +Package: winst-gruelag-hppdg6-uefi-conf +Architecture: all +Depends: ${misc:Depends}, + ${perl:Depends}, + ${iserv:winst:Depends}, +Description: ${iserv:winst:Description} +Tag: suite::iserv::deploy, role:package diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..98804b9 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,29 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: winst-gruelag-hppdg6-uefi-conf + +Files: * +Copyright: 2022 Gruelag GmbH +License: MIT + +Files: debian/* +Copyright: 2022 Gruelag GmbH +License: MIT + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..2d33f6a --- /dev/null +++ b/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/debian/winst-gruelag-hppdg6-uefi-conf.install b/debian/winst-gruelag-hppdg6-uefi-conf.install new file mode 100644 index 0000000..6a16232 --- /dev/null +++ b/debian/winst-gruelag-hppdg6-uefi-conf.install @@ -0,0 +1 @@ +LICENSE* usr/share/doc/gruelag-hppdg6-uefi-conf diff --git a/files/hp-cmsl-latest.exe b/files/hp-cmsl-latest.exe new file mode 100644 index 0000000..bd9258c Binary files /dev/null and b/files/hp-cmsl-latest.exe differ diff --git a/install.ins b/install.ins new file mode 100644 index 0000000..2d69d58 --- /dev/null +++ b/install.ins @@ -0,0 +1,140 @@ +[Initial] +Message=Installiere HP UEFI Einstellungen... +DefVar $PropPlacehldr$ +DefVar $Uefioldpw$ +DefVar $Uefinewpw$ +DefVar $Uefibootorder$ +DefVar $Uefilanguage$ +DefVar $Uefikeyboardlayout$ +DefVar $Uefipxeboot$ +DefVar $Uefiipv6pxeboot$ +DefVar $Uefirestrictusb$ +DefVar $Uefimodponpw$ +DefVar $Uefipassforbootmn$ +DefVar $Uefipassforrecover$ +DefVar $Uefipassforpxe$ +DefVar $Uefiintspkr$ +DefVar $Uefisecureboot$ +DefVar $Uefiwakeonlan$ +DefVar $Uefiwakeonlanpw$ +DefStringList $Result$ +DefStringList $PowershellResult$ +DefVar $Value$ +DefVar $Hostname$ +DefVar $Invnumber$ +DefVar $ExitCode$ + + +[Actions] +ShowBitmap "%ScriptPath%\logo.png" "HP ProDesk G6 UEFI-Settings" +Sub_GetProperties +Files_Copy +Sub_GetVars +Winbatch_setup /Sysnative +Sub_HandlePw +ExecWith_powershell "powershell.exe" -ExecutionPolicy Bypass +Sub_HandleFirstExitCode +Files_Cleanup +Sub_HandleExitCode + + +[Sub_GetProperties] +Set $PropPlacehldr$ = GetProductProperty("propplaceholder", "") +Set $Uefioldpw$ = GetProductProperty("oldpw", "") +Set $Uefinewpw$ = GetProductProperty("newpw", "") +Set $Uefibootorder$ = GetProductProperty("uefibootorder", "") +Set $Uefilanguage$ = GetProductProperty("language", "") +Set $Uefikeyboardlayout$ = GetProductProperty("keyboardlayout", "") +Set $Uefipxeboot$ = GetProductProperty("pxeboot", "") +Set $Uefiipv6pxeboot$ = GetProductProperty("ipv6pxeboot", "") +Set $Uefirestrictusb$ = GetProductProperty("restrictusb", "") +Set $Uefimodponpw$ = GetProductProperty("modponpw", "") +Set $Uefipassforbootmn$ = GetProductProperty("passforbootmn", "") +Set $Uefipassforrecover$ = GetProductProperty("passforrecover", "") +Set $Uefipassforpxe$ = GetProductProperty("passforpxe", "") +Set $Uefiintspkr$ = GetProductProperty("intspkr", "") +Set $Uefisecureboot$ = GetProductProperty("secureboot", "") +Set $Uefiwakeonlan$ = GetProductProperty("wakeonlan", "") +Set $Uefiwakeonlanpw$ = GetProductProperty("wakeonlanpw", "") + +[Sub_GetVars] +Set $Result$ = GetReturnListFromSection("opsiservicecall_GetPcname") +Set $Hostname$ = TakeString("0", $Result$) +Set $Result$ = GetReturnListFromSection("opsiservicecall_GetInventoryNumber") +Set $Invnumber$ = TakeString("0", $Result$) + +comment "Hostname is: " + $Hostname$ +comment "Inventory Number is: " + $Invnumber$ + +[Winbatch_setup] +"%opsiTmpDir%\%installingProdName%\files\hp-cmsl-latest.exe" /silent + +[Sub_HandlePw] +Set $PowershellResult$ = PowershellCall('Get-HPBIOSSetupPasswordIsSet') +Set $Value$ = TakeString("0", $PowershellResult$) +comment "BIOS Password set?: " + $Value$ + +if ($Value$ = "True") + if not ($Uefioldpw$ = $Uefinewpw$) + PowershellCall('Clear-HPBIOSSetupPassword "'+$Uefioldpw$+'"') + PowershellCall('Set-HPBIOSSetupPassword "'+$Uefinewpw$+'"') + endif + else + PowershellCall('Set-HPBIOSSetupPassword "'+$Uefinewpw$+'"') +endif + + + +[ExecWith_powershell] +Set-HPBIOSSettingValue "$Uefinewpw$" "UEFI Boot Order" "$Uefibootorder$" +Set-HPBIOSSettingValue "$Uefinewpw$" "Select Language" "$Uefilanguage$" +Set-HPBIOSSettingValue "$Uefinewpw$" "Select Keyboard Layout" "$Uefikeyboardlayout$" +Set-HPBIOSSettingValue "$Uefinewpw$" "Network (PXE) Boot" "$Uefipxeboot$" +Set-HPBIOSSettingValue "$Uefinewpw$" "IPv6 during UEFI Boot" "$Uefiipv6pxeboot$" +Set-HPBIOSSettingValue "$Uefinewpw$" "Restrict USB Devices" "$Uefirestrictusb$" +Set-HPBIOSSettingValue "$Uefinewpw$" "Allow User to Modify Power-on Password" "$Uefimodponpw$" +Set-HPBIOSSettingValue "$Uefinewpw$" "Prompt for Admin authentication on F9 (Boot Menu)" "$Uefipassforbootmn$" +Set-HPBIOSSettingValue "$Uefinewpw$" "Prompt for Admin authentication on F11 (System Recovery)" "$Uefipassforrecover$" +Set-HPBIOSSettingValue "$Uefinewpw$" "Prompt for Admin authentication on F12 (Network Boot)" "$Uefipassforpxe$" +Set-HPBIOSSettingValue "$Uefinewpw$" "Internal Speakers" "$Uefiintspkr$" +Set-HPBIOSSettingValue "$Uefinewpw$" "Secure Boot" "$Uefisecureboot$" +Set-HPBIOSSettingValue "$Uefinewpw$" "Wake On LAN" "$Uefiwakeonlan$" +Set-HPBIOSSettingValue "$Uefinewpw$" "Ownership Tag" "$PropPlacehldr$-$Hostname$" +Set-HPBIOSSettingValue "$Uefinewpw$" "Wake on LAN Power-on Password Policy" "$Uefiwakeonlanpw$" + +[Files_Copy] +copy -s "\\iserv\deploy\install\%installingProdName%\files\*" "%opsiTmpDir%\%installingProdName%\files\" + +[Files_Cleanup] +delete -sf "%opsiTmpDir%\%installingProdName%\" + +[Sub_HandleFirstExitCode] +; check return code +Set $ExitCode$ = GetLastExitCode +; checking possible errors on first run +Switch $ExitCode$ + Case "0" + comment "Looks good: setup program gives exitcode zero. Proceed." + EndCase + DefaultCase + comment "We can't handle this Exitcode here: " + $exitcode$ + EndCase +EndSwitch + +[Sub_HandleExitCode] +; check return code +Set $ExitCode$ = GetLastExitCode +comment "GetLastExitCode: " + $ExitCode$ +if not($ExitCode$ = "0") + LogError "Fatal: setup returned exit code " + $ExitCode$ + IsFatalError +endif + + +[opsiservicecall_GetPcname] +"method":"collect_wlan_mac_hostName" +"params":[] + +[opsiservicecall_GetInventoryNumber] +"method":"collect_wlan_mac_inventoryNumber" +"params":[] diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..a312cb7 Binary files /dev/null and b/logo.png differ diff --git a/usr/share/lintian/overrides/gruelag-hppdg6-uefi-conf b/usr/share/lintian/overrides/gruelag-hppdg6-uefi-conf new file mode 100644 index 0000000..3ff93ba --- /dev/null +++ b/usr/share/lintian/overrides/gruelag-hppdg6-uefi-conf @@ -0,0 +1,2 @@ +# by design +gruelag-hppdg6-uefi-conf: extra-license-file usr/share/doc/gruelag-hppdg6-uefi-conf/LICENSE