I don't know what happened to my secure boot flash drive but I cleaned everything off it, reinstalled Porteus to it then readded the Ubuntu grub2 files and now it all works again. Whatever happened that caused the x86_64-efi and i386-pc problems and etc I have no idea.
In my testing to figure out what was happening I developed a couple of simple scripts and modified my grub.cfg file accordingly. For someone wanting to test the secure boot grub2 changes these may help.
These I put in the /EFI folder.
BIOSboot.sh
Code: Select all
#!/bin/sh
# Switch UEFI Secure Boot config to standard Porteus boot config.
USBdrv=/mnt/sdb1 # USB drive
if [ -d $USBdrv/EFI/Porteusboot ]; then
mv -f $USBdrv/EFI/boot $USBdrv/EFI/UbuntuBOOT
mv -f $USBdrv/EFI/Porteusboot $USBdrv/EFI/boot
else
echo " Porteus boot config already in place."
fi
Code: Select all
#!/bin/sh
# Switch standard Porteus boot config to UEFI Secure Boot config.
USBdrv=/mnt/sdb1 # USB drive
if [ -d $USBdrv/EFI/UbuntuBOOT ]; then
mv $USBdrv/EFI/boot $USBdrv/EFI/Porteusboot
mv $USBdrv/EFI/UbuntuBOOT $USBdrv/EFI/boot
else
echo " UEFI Secure Boot config already in place."
fi
grub.cfg
Code: Select all
if loadfont /boot/grub/font.pf2 ; then
# set gfxmode=auto
set gfxmode=800x600,auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
fi
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
set timeout=60
set gfxpayload=1024x768
menuentry " 1. UEFI Porteus 4.0 system - for Secure Boot enabled" {
set efibootmgr=/EFI/boot/grubx64.efi
set porteus_parms="volume=33 reboot=cold extramod=/Modules;/Modsavedat noload=save.dat;cinnamon"
# Change parms to fit your needs.
set bootdrv=$root
search -f $efibootmgr
if [ $? == 0 ]; then
linux /boot/syslinux/vmlinuz $porteus_parms
initrd /boot/syslinux/initrd.xz
echo " "
echo " -> "
echo " -> If /boot/grub/x86-64-efi errors appear, disregard."
echo " -> Secure Boot not enabled."
echo " -> "
sleep -i 4
else
echo "----------------------------------------"
echo Porteus drive NOT found.
echo
sleep -i 10
fi
set root=$bootdrv
}
menuentry " 2. UEFI Porteus 4.0 menu - aborts if Secure Boot enabled" {
set efibootmgr=/EFI/Porteusboot/bootx64.efi
set bootdrv=$root
search -f $efibootmgr
if [ $? == 0 ]; then
chainloader $efibootmgr
echo " "
echo " -> "
echo " -> If /boot/grub/x86-64-efi errors appear, disregard."
echo " -> "
sleep -i 4
else
echo "----------------------------------------"
echo Porteus drive NOT found.
echo
sleep -i 10
fi
set root=$bootdrv
}
menuentry " " { echo }
menuentry " 3. Reboot" {
reboot
}
menuentry " 4. Shutdown" {
halt
}
menuentry " " { echo }
menuentry " Notes" {
echo
echo "To switch the USB drive's boot mode to BIOS mode "
echo "run the BIOSboot.sh script in the /EFI directory."
echo
echo "To switch the USB drive boot mode back to EFI mode"
echo "run the Secureboot.sh script in the /EFI directory."
echo
sleep -i 10
}
The drive is now working on both EFI and non-EFI machines again.
The script I use to add the grub2 files to the drive is here: [Solved] Security Boot Fail (Post by Ed_P #66853) I don't install Ubuntu I just copy 2 folders from the ISO.
-Update-
BTW My /boot/syslinux/porteus.cfg file menu changes. The GRAPHICAL change is the APPEND line to support my USB's UUID and the following one is a new option. It runs Porteus without saving changes it may make. Good for when the grandkids play games.
Code: Select all
LABEL GRAPHICAL
MENU LABEL Graphics mode
KERNEL /boot/syslinux/vmlinuz
INITRD /boot/syslinux/initrd.xz
APPEND changes=EXIT:UUID:8486-DDC5/changes/porteussave.dat extramod=UUID:8486-DDC5/Modules
TEXT HELP
Run Porteus the best way we can.
Try to autoconfigure graphics
card and use the maximum
allowed resolution
ENDTEXT
LABEL safe
MENU LABEL Graphics mode (Safe)
KERNEL /boot/syslinux/vmlinuz
INITRD /boot/syslinux/initrd.xz
APPEND extramod=UUID:8486-DDC5/Modules;UUID:8486-DDC5/Modsavedat
TEXT HELP
Run Porteus the best way we can.
Try to autoconfigure graphics
card and use the maximum
allowed resolution
ENDTEXT
Code: Select all
DEFAULT safe
-update 2-
A related change to the flash drive system. [Solved] 4.0 doesn't support wifi on netbook. 3.2.2 does.