Will MX-25 come with secureboot?
Posted: Tue May 06, 2025 12:30 pm
HI MX Team,
will you provide secure boot option in MX-25?
will you provide secure boot option in MX-25?
Support for MX and antiX Linux distros
https://www.forum.mxlinux.org/
This is coming when i try to install it.FullScale4Me wrote: Tue May 06, 2025 3:14 pm This has been a discussion here about how to turn it on from time to time (that I have seen in MX 21 and MX 23).
So the TL;DR answer is: Secure Boot has been a user configurable option for 4+ years.
‘MX-23 Secure Boot How-to‘ update on April 24, 2025 to include MX 23. PDF 82 Kb. This PDF is a conversion of an MX 21 post in this forum by felix, one of the MX developers.
Code: Select all
--bootloader-id=ID
the ID of bootloader. This option is only available on EFI and Macs.
That screen is telling you where to read for your solution.
Thanks for that. I'll add this to my notes for future inclusion.baldyeti wrote: Sat May 10, 2025 2:29 pm according to the grub-install man page:so: a single option, introduced by two dashesCode: Select all
--bootloader-id=ID the ID of bootloader. This option is only available on EFI and Macs.
@FullScale4Me perhaps an erratum for your nice HowTo note
Thanks for finding the needed edit! Corrections made, both files were updated. Revision: May 13, 2025.baldyeti wrote: Sat May 10, 2025 2:29 pm according to the grub-install man page:so: a single option, introduced by two dashesCode: Select all
--bootloader-id=ID the ID of bootloader. This option is only available on EFI and Macs.
@FullScale4Me perhaps an erratum for your nice HowTo note
Code: Select all
2 Install Debian's signed efi-GRUB loader into ESP (EFI System Partition) with bootloader id 'MX23'
sudo grub-install -–bootloader-id=MX23
which replaces the existing unsigned efi-GRUB loader with the Debian’s signed efi-loader.
3 Install the signed efi-GRUB loader with Debian’s default bootloader ID 'debian'.
sudo grub-install -–bootloader-id=debian --no-nvram
4 Install the signed efi-GRUB loader with the removable media option for fallback.
sudo grub-install -–bootloader-id=mx23 –-force-extra-removable --recheck
I guess the pdf was combined out of a couple of posts:dolphin_oracle wrote: Sat May 24, 2025 4:34 pm question:
do you need 2 and 4? and can the --force-extra-removable be combined with set 2?Code: Select all
2 Install Debian's signed efi-GRUB loader into ESP (EFI System Partition) with bootloader id 'MX23' sudo grub-install -–bootloader-id=MX23 which replaces the existing unsigned efi-GRUB loader with the Debian’s signed efi-loader. 3 Install the signed efi-GRUB loader with Debian’s default bootloader ID 'debian'. sudo grub-install -–bootloader-id=debian --no-nvram 4 Install the signed efi-GRUB loader with the removable media option for fallback. sudo grub-install -–bootloader-id=mx23 –-force-extra-removable --recheck
Thank you both for the valued feedback!fehlix wrote: Sat May 24, 2025 5:20 pmI guess the pdf was combined out of a couple of posts:dolphin_oracle wrote: Sat May 24, 2025 4:34 pm question:
do you need 2 and 4? and can the --force-extra-removable be combined with set 2?Code: Select all
2 Install Debian's signed efi-GRUB loader into ESP (EFI System Partition) with bootloader id 'MX23' sudo grub-install -–bootloader-id=MX23 which replaces the existing unsigned efi-GRUB loader with the Debian’s signed efi-loader. 3 Install the signed efi-GRUB loader with Debian’s default bootloader ID 'debian'. sudo grub-install -–bootloader-id=debian --no-nvram 4 Install the signed efi-GRUB loader with the removable media option for fallback. sudo grub-install -–bootloader-id=mx23 –-force-extra-removable --recheck
* 4 is not needed, so –-force-extra-removable --recheck can go into 2
* 3 could be simpliefied by just cp /EFI/MX23 to /EF/debian, but it seems simpler just to run the command with --no-nvram
* 3 is probaly needed b/c "/EFI/debian" location is compiled into / "harcoded" within debian's signed efi-loader (grubx64.efi)
Without havinj /EFI/debian I found it would not always fallback to the currently loaded from directory (/EFI(MX23).
and in case of a shared ESP with a Debian install, it would never boot a MX-23 signed install.
Code: Select all
sudo apt install grub-efi-amd64-signed mokutil shim-signed
sudo grub-install --bootloader-id=MX23 --force-extra-removable --recheck
sudo grub-install bootloader-id=debian --no-nvram
Code: Select all
sudo mokutil --sb-state
[sudo] password for dolphin:
SecureBoot enabled
Good, at least it shows secure boot (sb) does it's job and protects loadig unsigned modules.dolphin_oracle wrote: Sat May 24, 2025 11:57 pm ok installed the required packages
and did grub install commands
and I am running with secure bootCode: Select all
sudo apt install grub-efi-amd64-signed mokutil shim-signed sudo grub-install --bootloader-id=MX23 --force-extra-removable --recheck sudo grub-install bootloader-id=debian --no-nvram
still leaves dkms modules as a problem. during dkms build broadcom-sta-dkms and virtualbox-dkms both report signing of modules, but neither will load with modprobe, complaining of rejected key. boot up is not prevented, the modules just don't load.Code: Select all
sudo mokutil --sb-state [sudo] password for dolphin: SecureBoot enabled
Code: Select all
sudo mokutil --disable-validation
Code: Select all
sudo mokutil --import /var/lib/dkms/mok.pub
Code: Select all
sudo mokutil --list-enrolled
Code: Select all
sudo mokutil --list-enrolled
[sudo] password for dolphin:
[key 1]
Owner: 605dab50-e046-4300-abb6-3dd810dd8b23
SHA1 Fingerprint: 53:61:0c:f8:1f:bd:7e:0c:eb:67:91:3c:9e:f3:e7:94:a9:63:3e:cb
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
ed:54:a1:d5:af:87:48:94:8d:9f:89:32:ee:9c:7c:34
Signature Algorithm: sha256WithRSAEncryption
Issuer: CN=Debian Secure Boot CA
[key 2]
Owner: 605dab50-e046-4300-abb6-3dd810dd8b23
SHA1 Fingerprint: 0b:64:8b:df:49:ed:2b:9b:df:3d:0c:b7:55:dd:9d:23:47:03:76:3a
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
49:fc:ef:df:e6:f5:e2:46:d1:4b:d9:1a:d6:ce:2d:4b:08:0a:cd:01
Signature Algorithm: sha256WithRSAEncryption
Issuer: CN=DKMS module signing key
Validity
Code: Select all
sudo mokutil --import /var/lib/dkms/mok.pub
Code: Select all
sudo grub-install bootloader-id=debian --no-nvram
sudo mokutil --import /var/lib/dkms/mok.pub
sudo reboot
What are your thoughts on adding a link to the pertinent location in this thread into the document? Sometimes, folk reading through step-throughs have difficulty following them because they may be overthinking stuff.FullScale4Me wrote: Sat May 24, 2025 8:12 pm
PDF updated and uploaded - ‘Secure Boot: How to‘ updated May 24, 2025
The MX Installer "minstall" creates when booted with secure boot and after having installed grub-efi-amd64-signed and shim-signeddolphin_oracle wrote: Sun May 25, 2025 8:58 pm minor corollary to the procedure.
you can do a fresh install on a secure boot enabled system, as long as you do the install AFTER installing the grub-efi-amd64-signed mokutil shim-signed packages (say, while running live). then use a chroot (chroot-rescue scan is easy) to do install the debian efi and do the mok key stuff. on first reboot, you confirm the mok key, and then continue on to boot the SB system, with the dkms modules intact and loadable.
after an install, including grub install, in the chroot (however you get into one)Code: Select all
sudo grub-install bootloader-id=debian --no-nvram sudo mokutil --import /var/lib/dkms/mok.pub sudo reboot
Code: Select all
Boot000B* MX Linux HD(2,GPT,689045a6-184b-473e-8c0f-d962306d94a6,0x1000,0x100000)/File(\EFI\MX\grubx64.efi)
Code: Select all
search.fs_uuid eaa74c5f-435f-4791-9e6a-3236ce674524 root
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
Code: Select all
efibootmgr -qcL "MX Linux" -d /dev/vda -p 2 -l /EFI/MX/grubx64.efi
Code: Select all
efibootmgr -qcL "MX Linux" -d /dev/vda -p 2 -l /EFI/MX/shimx64.efi
Code: Select all
shimx64.efi,debian,,This is the boot entry for debian
Code: Select all
echo "shimx64.efi,MX Linux,,This is the boot entry for MX Linux" | iconv -t UCS-2 | sudo tee /usr/lib/shim/BOOTX64.CSV
Code: Select all
echo "shimx64.efi,MX Linux,,This is the boot entry for MX Linux" | iconv -t UCS-2 | tee EFI/MX//BOOTX64.CSV
Code: Select all
cp /EFI/MX/fbx64.efi /EFI/BOOT/fbx64.efi
Code: Select all
sudo grub-install bootloader-id=debian --no-nvram
Code: Select all
mkdir /EFI/debian
# or
rm /EFI/debian/*
# and
cp /EFI/MX/grub.cfg /EFI/debian/grub.cfg
* booting from disks will make efi look for the first ESP on that drive and try to boot /EFI/BOOT/BOOTx64.efi.dolphin_oracle wrote: Mon May 26, 2025 6:35 pm good point. I didn't get to the fallback, I manually selected the entry with "shim64.efi" in it. interestingly, this shows up in nvram as a lowercase mx where by the usual grub-install shows up with a capital MX. the actual files in the fat32 ESP are all in the same MX folder though.
**edit*** just saw your edit with the simplification. will try that next go around.
Code: Select all
efibootmgr -qcL "MX Linux" -d /dev/vda -p 2 -l /EFI/MX/grubx64.efi
Code: Select all
efibootmgr --quiet --create --label "MX Linux" --disk /dev/vda --part 2 --loader '\EFI\MX\shimx64.efi'
Code: Select all
efibootmgr: ** Warning ** : Boot0001 has same label MX Linux
Code: Select all
Boot0001* MX Linux HD(2,GPT,689045a6-184b-473e-8c0f-d962306d94a6,0x1000,0x100000)/File(\EFI\MX\grubx64.efi)
Code: Select all
Boot000B* MX Linux HD(2,GPT,689045a6-184b-473e-8c0f-d962306d94a6,0x1000,0x100000)/File(\EFI\MX\shimx64.efi)
Code: Select all
// Add a new NVRAM boot variable.
if (fitesp != partman.mounts.end()) {
const PartMan::NameParts &bs = PartMan::splitName(fitesp->second->name);
//efi size & secureboot
//if 32, don't bother with secure boot
//if 64, check for secure boot shimx64.efi
QString efitype;
if (efisize==32){
efitype="/grubia32.efi";
} else {
efitype="/grubx64.efi";
if (QFile("/usr/lib/shim/shimx64.efi").exists()){
efitype="/shimx64.efi";
}
}
proc.exec("efibootmgr", {"-qcL", loaderLabel, "-d", "/dev/"+bs.drive, "-p", bs.partition,
"-l", "/EFI/" + loaderID + efitype});
yes! There is also an identical but unsigned shim, which would have the benefit to introducedolphin_oracle wrote: Mon May 26, 2025 8:34 pm the shim entry would work whether secure boot enabled or not?
Havn't seen you'r additon until just now..dolphin_oracle wrote: Mon May 26, 2025 8:34 pm so something like this:
in this case, loaderLabel and loaderID are both lowercase (set earlier).Code: Select all
// Add a new NVRAM boot variable. if (fitesp != partman.mounts.end()) { const PartMan::NameParts &bs = PartMan::splitName(fitesp->second->name); //efi size & secureboot //if 32, don't bother with secure boot //if 64, check for secure boot shimx64.efi QString efitype; if (efisize==32){ efitype="/grubia32.efi"; } else { efitype="/grubx64.efi"; if (QFile("/usr/lib/shim/shimx64.efi").exists()){ efitype="/shimx64.efi"; } } proc.exec("efibootmgr", {"-qcL", loaderLabel, "-d", "/dev/"+bs.drive, "-p", bs.partition, "-l", "/EFI/" + loaderID + efitype});
Code: Select all
/usr/lib/shim/shimx64.efi
/usr/lib/shim/shimx64.efi.signed
yep, that will be the next thing. just trying to make something work now.fehlix wrote: Tue May 27, 2025 1:38 pm
Havn't seen you'r additon until just now..
* generation of an NVRAM boot variable with the current implementation fails to remove (or better update) an exsiting one
which makes whith every install attempt another boot-entry into the nvram.
ah, gotcha.* we have two shim's unsigned and signed:Code: Select all
/usr/lib/shim/shimx64.efi /usr/lib/shim/shimx64.efi.signed
where grub-install if secure-boot detected will use /usr/lib/shim/shimx64.efi.signed
So, as this is currently run after "grub-install --no-nvram ...",
we might check an existing shim at /EFI/loaderID/shimx64.efi, which was added by grub-install.
and use this , otherwise use grubx64.efi
from Section A, item 7mokutil -–sb-state
Thanks. Next time I do live testing, I'll have the file on the USB to copy the commands into the terminal. No typing from memory as it missed, as you found, a typo. Ended up being a hyphen and an em-dash, the Libre Office Writer autocorrect swapped in.MikeR wrote: Fri Jun 06, 2025 8:23 am Minor nit:
@FullScale4Me
If I cut-&-pastefrom Section A, item 7mokutil -–sb-state
I get 'Invalid option'. It requires two hyphens...
HTH
Mike