{"id":1025,"date":"2023-06-15T14:03:27","date_gmt":"2023-06-15T12:03:27","guid":{"rendered":"https:\/\/valentijn.sessink.nl\/?p=1025"},"modified":"2023-06-15T16:53:28","modified_gmt":"2023-06-15T14:53:28","slug":"update-hp-bios-settings-in-linux","status":"publish","type":"post","link":"https:\/\/valentijn.sessink.nl\/?p=1025","title":{"rendered":"Update HP BIOS settings in Linux"},"content":{"rendered":"\n<p>For a larger project, we had to update BIOS settings on a HP Z2 Mini G9 Workstation Desktop PC &#8211; from within Linux, that is. Now &#8220;BIOS&#8221; in essence is the firmware that is running before Linux is active. This means it is highly manufacturer dependent and you cannot &#8211; possibly &#8211; update the BIOS without a manufacturer supplied program to do that.<\/p>\n\n\n\n<p>Is there such thing for HP? Turns out: there is! So now you can change any BIOS setting from within Linux. Also, for example, configuration settings to start the PC at a certain time or day, or to change power-on-button settings.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>At <a href=\"https:\/\/ftp.hp.com\/pub\/caps-softpaq\/cmit\/linuxtools\/HP_LinuxTools.html\">https:\/\/ftp.hp.com\/pub\/caps-softpaq\/cmit\/linuxtools\/HP_LinuxTools.html<\/a>, HP supplies us with a nice .tgz file that contains several RPM&#8217;s and a few utilities that have been nicely compiled for other Linux distributions. Installation is rather easy:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wget https:\/\/ftp.hp.com\/pub\/softpaq\/sp143001-143500\/sp143035.tgz\ntar -zxf sp143035.tgz\ncd hpflash-3.22\/\ncd non-rpms\/\ntar -ztf hpuefi-mod-3.04.tgz\ncd hpuefi-mod-3.04\/\nmake\nsudo insmod hpuefi.ko\nsudo mknod -m 644 \/dev\/hpuefi c `grep hpuefi \/proc\/devices|cut -d ' ' -f 1` 0<\/pre>\n\n\n\n<p>So there we are: our kernel module has been loaded and a device is available. If we go back up one directory, you&#8217;ll notice that there is another tgz-file there, called <code>hp-flash-3.22_x86_64.tgz<\/code>. This is full of <code>hp-flash<\/code> utilities, compiled for several Linux-distributions. You can find, for example, hp-<code>flash.u2204<\/code>, <code>hp-flash.rh610<\/code>, <code>hp-flash.sled15<\/code> among others. A nice <code>install.sh<\/code> script could help you put these in the <code>\/opt\/hp\/hp-flash\/bin\/<\/code> directory, should you be interested in that.<\/p>\n\n\n\n<p>Now I&#8217;m actually quite lazy and not willing to clutter my system with proprietary HP utilities, so I will not run the installer script. The <code>hp-repsetup<\/code> utility is what is needed for BIOS functionality and as I&#8217;m running Ubuntu 22.04, I&#8217;ll just run the <code>hp-repsetup.u2204<\/code> utility right from the <code>builds\/<\/code> directory.<\/p>\n\n\n\n<p>After this, things are quite easy.<\/p>\n\n\n\n<p>Reading all BIOS settings can be done with <code>hp-repsetup.u2204 -a -g biosfile<\/code> &#8211; where the <code>-a<\/code> option means &#8220;write ASCII&#8221;, the <code>-g<\/code> is for &#8220;get&#8221; and <code>biosfile<\/code> is where the output will be stored. If you leave the <code>-a<\/code> out, the output file is written as Unicode UCS-2, which can be edited by <code>vi<\/code>, but will not show up nicely in <code>less<\/code>.<\/p>\n\n\n\n<p>Now you can edit the fields that you want to change, by editing the <code>biosfile<\/code> that you just created with an editor of choice. Simply put a <strong>*<\/strong> in front of options that you would like to enable. Then run hp-repsetup again, this time as <code>hp-repsetup -a -s biosfile<\/code> &#8211; where <code>-a<\/code> is still for ASCII and <code>-s<\/code> is for &#8220;set&#8221;. You don&#8217;t have to set everything at once, it is also possible to just change a single setting. For example, make a file <code>\/tmp\/newsetting<\/code> that only contains:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Wednesday\n\t*Enable<\/pre>\n\n\n\n<p>Then use <code>hp-repsetup.u2204 -a -s \/tmp\/newsetting<\/code> to just have the PC autostart on Wednesdays.<\/p>\n\n\n\n<p>Important Wisdom: as far as I can see, the &#8220;language&#8221; setting does not interfere with the <code>hp-repsetup<\/code> BIOS output, i.e. if you change your BIOS language to Traditional Chinese, your settings in <code>hp-repsetup<\/code> will still be English. (Tip: should you want to test this yourself, please use a language that you can revert from without calling HP support!)<\/p>\n\n\n\n<p>The <code>hp-repsetup<\/code> <em>script<\/em> (as opposed to the <code>hp-repsetup.u2204<\/code> <em>program<\/em> that I&#8217;m running) does a few more things: it runs <code>modprobe hpuefi.ko<\/code> and re-runs the <code>mknod<\/code> command with a script that it (most likely) installed during install phase; afterwards, it unloads the <code>hpuefi.ko<\/code> kernel module from memory again.<\/p>\n\n\n\n<p>As said, I did not install and I&#8217;m only doing this once, so I&#8217;m not too interested in putting this somewhere on the system, but your situation could be different.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Change BIOS settings from within Linux in a HP Z2 Mini G9 Workstation Desktop PC<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[177,178,176,179,9],"class_list":["post-1025","post","type-post","status-publish","format-standard","hentry","category-happy-hacking","tag-bios","tag-bios-settings","tag-hp","tag-hp-workstation","tag-linux"],"_links":{"self":[{"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/posts\/1025","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1025"}],"version-history":[{"count":9,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/posts\/1025\/revisions"}],"predecessor-version":[{"id":1036,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/posts\/1025\/revisions\/1036"}],"wp:attachment":[{"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1025"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1025"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1025"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}