Saturday, April 25, 2026

Save and restore Dell bios config to/from files on Linux.

Note: works on vostro 3491 

Dell provides dell command configure software package using which can configure the bios from the OS including saving and restoring the whole bios config to files.

Ensure that the SMM Security Mitigation BIOS Feature is Disabled on applicable platforms running Linux operating systems. Dell Command | Configure on Linux operating systems does not work as intended if the SMM Security Mitigation BIOS feature is Enabled.

Dell provides deb files for this software (which works on Ubuntu 24 and Debian trixie), so it won't work on Gentoo. Further, this requires higher privileges so in case you're planning to make it work on lxc any (docker) container, it'll not work out of the box. You've to tweak the privileges in order to get it to work (in case you've have, please post a comment). In fact, the deb packages won't even install this way.

Download package command-configure_5.1.0-6.ubuntu24_amd64.deb srvadmin-hapi_9.5.0_amd64.deb and install it on Debian trixie or Ubuntu 24; this work only when the machine is booted on Debian trixe.

reference: https://www.dell.com/support/manuals/en-in/command-configure/dcc_5.x_ref_guide/introduction-to-dell-command-configure?guid=guid-8ed40681-7cf4-4f1e-95bf-d086f3cfadaf&lang=en-us
https://www.dell.com/support/manuals/en-in/command-configure/dcc_5.x_ref_guide/command-line-syntax?guid=guid-61e28cf5-6240-42c2-b395-e5263aea511d&lang=en-us

Dell bios have user defined saved config which stays in the bios. For vostro 3491, there is just 1 slot where this can be saved. This slot is UserConfig1. Other laptops may also have UserConfig2.
Save config to bios -- 

cctk --SaveConfig UserConfig1|UserConfig2
cctk -O <file> -- this will generate an INI file and save the bios config there.
cctk --I/--infile <file> to restore from the saved ini file.
cctk --RestoreBIOSSettings UserConfig1 -- to restore config from this saved config in the bios.

How to get this to work when you're not using Debian Trixie or Ubuntu 24 -- 

To save the bios config to file and BIOS memory, we've to use the cctk command; since this won't work on Gentoo, I've maintained a separate copy of Debian trixie. The Debian trixie disk image gas a GPT partition table limited to 6GB; what I did is that I created a 6G loopback device. We created partitions on this. This backing file of this loopback device will be written to PD when needed. 5GB of space is good enough. 1GB of boot is good enough. Total 6GB.

For this system to work, at least a minimum 8GB pd must be be available.

blank gpt partition setup commands (over loopback device) -- 
    dd if=/dev/zero of=dell bs=6G count=0 seek=1
    losetup /dev/loop10 dell
    formatting
        sector size = 512
        size of root = 10485760s
        size of boot = 2097152s
        boot range: 40s to 2097192s
        root range: 2097193s 12582953s
        in parted -- 
        mklabel gpt
        mkpart primary fat32 40s 2097192s
        mkpart primary xfs 2097193s 12582872s
Before installation the PD will be filled with zeros.
    dd if=/dev/zero of=/dev/sdx bs=1M 

installation of trixe was done on the laptop itself

After installation is complete, and you've installed the cctk packages, you can dd the file to a 8GB or higher capacity pendrive and boot from it to get the cctk commands.

I've already created such an image in case you want to use it -- 

 https://drive.google.com/file/d/1Bql0aD3hItXNPbYoccQzaa5hM4BwuB3z/view?usp=sharing

password for the root user is 'qwer qwer' (or maybe 'asdf asdf'? I'm not sure) 

Just xzcat <file> | dd of=<your PD block device>

this image and boot from it.

cctk was also configured and installed in the disk image along with script -- 
saveConfigBios1.sh -- save the bios config to UserConfig1
saveConfigBios2.sh -- save the bios config to UserConfig2
saveConfigBiosFile.sh -- save the bios config to a file bios_config.ini in PWD
restoreConfigBios1.sh -- restore the bios config from UserConfig1
restoreConfigBios2.sh -- restore the bios config from UserConfig2
restoreConfigBiosFile.sh <file> -- restore the bios config from a file which is passed as the 1st argument. 

No comments:

Post a Comment