Problems booting Porteus under rEFInd

Technical issues/questions of an intermediate or advanced nature.
rchase
Shogun
Shogun
Posts: 282
Joined: 10 Jan 2016, 17:26
Distribution: Porteus 5.0 rc3 xfce
Location: Denver, Colorado

Problems booting Porteus under rEFInd

Post#1 by rchase » 03 Mar 2022, 20:50

I have successfully booted Porteus on an old iMac under rEFInd using the manual stanza:

Code: Select all

menuentry "Porteus 5.0" {
	icon /EFI/icons/os_porteus-wg.png
	volume Porteus
	loader /boot/syslinux/vmlinuz
	initrd /boot/syslinux/initrd.xz
	options "from=UUID:eb840d24-6e24-4f26-b905-3115ae790fec changes=UUID:eb840d24-6e24-4f26-b905-3115ae790fec/porteus timezone=America/Denver login=root"
}
I can't observe the boot process until after modules have been loaded because the text is garbled until INIT, but I can make out its color. When I put a second installation of Porteus in volume "kde" and attempt to boot with the almost identical:

Code: Select all

menuentry "Porteus KDE" {
	icon /EFI/icons/os_porteus-wg.png
	volume kde
	loader /boot/syslinux/vmlinuz
	initrd /boot/syslinux/initrd.xz
	options "from=UUID:b5d90074-3e41-4d9f-9106-e614a3a39534 changes=UUID:b5d90074-3e41-4d9f-9106-e614a3a39534/porteus timezone=America/Denver login=root"
# from=UUID:b5d90074-3e41-4d9f-9106-e614a3a39534 changes=UUID:b5d90074-3e41-4d9f-9106-e614a3a39534/porteus 
}
booting halts with yellow text indicating that my from= cheatcode was incorrect; if I hit enter, Porteus boots from my original installation (discarding changes) -- I've carefully verified the partitions' UUIDs. Regardless of whether I use UUID: or /sda3 with from= or changes=, this second installation of Porteus (in volume kde) cannot find them and always uses data from my original installation (in /sda6); if I deny access to the rest of the drive using "nohd" or if I rename /boot or /porteus in /sda6, booting fails and the computer restarts. It's as though something is causing Porteus' own partition to be hidden from it mid-boot -- in only one of two copies of Porteus 5.0rc3! The loader in /sda3 (volume kde) is definitely being successfully invoked by rEFInd. The disk has a FAT32 ESP, HFS+ El Capitan and Recovery partitions, and three ext4 partitions, one containing Linux Lite and two containing different editions of Porteus -- rEFInd transfers control to all the loaders correctly, only the one in the second installation of porteus then can't see its own partition.

P.S. I created another ext4 partition and copied the Porteus files from volume kde into it, then put the new partition's UUID in place of that pointing to volume kde in refind.conf -- Porteus couldn't find that partition either. I conclude that the problem lies in Porteus -- refind encounters the stanza invoking kde first, but it doesn't ever work with it and always works with the Porteus in volume Porteus.

User avatar
Ed_P
Contributor
Contributor
Posts: 8360
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Problems booting Porteus under rEFInd

Post#2 by Ed_P » 03 Mar 2022, 22:01

Does rEFInd support the volume parameter?

Does rEFInd support the search command?

When you're booting you're using the initial Porteus install's EFI app. And I'm pretty sure all references it makes are to the original Porteus install files.

See if rEFInd allows you to "set root" to the 2nd Porteus install drive. And remember some systems count drives 1,2,3 and some count them as 0,1,2.
Ed

rchase
Shogun
Shogun
Posts: 282
Joined: 10 Jan 2016, 17:26
Distribution: Porteus 5.0 rc3 xfce
Location: Denver, Colorado

Problems booting Porteus under rEFInd

Post#3 by rchase » 03 Mar 2022, 23:27

Yes, rEFInd supports the volume command -- it searches the partition name and file system label; it's also supposed to work with the partition UUID. There is no "search" command in rEFInd; there's a procedure it follows to automatically identify kernels to boot, which I only use to identify and boot El Capitan; my manual stanza above succeeds in booting Porteus 5.0rc3 installed to /sda6 (volume Porteus) every time and the stanza:

Code: Select all

menuentry "Linux Lite" {
    loader /EFI/ubuntu/grubx64.efi
    icon /EFI/icons/os_linuxlite.png
}
boots Linux Lite every time; that stanza does use ubuntu's grubx64.efi, but note that my rEFInd stanzas for Porteus load vmlinuz and initrd.xz directly -- they don't use Porteus' /EFI data at all. rEFInd isn't grub; the volume command sets the root for subsequent file references. There's no question but that rEFInd is transferring control to Porteus' initrd.xz in /sda3 (volume kde), i.e. the loader command is pointed at the correct initrd.xz, but all Porteus parameters that make reference to files fail except those to the partition in which the first copy of Porteus resides (/sda6, volume Porteus). I can probably run a fresh copy of Porteus off a flash drive formatted to be Apple-bootable, but that doesn't solve my problem with multi-boot.

rchase
Shogun
Shogun
Posts: 282
Joined: 10 Jan 2016, 17:26
Distribution: Porteus 5.0 rc3 xfce
Location: Denver, Colorado

Problems booting Porteus under rEFInd

Post#4 by rchase » 03 Mar 2022, 23:36

P.S. I just double checked that rEFInd is pointing to the right copy of the Porteus loader; I added "kde" to the end of the filenames of vmlinux and initrd.xz located in /sda3 and changed the references in the boot stanza -- Porteus' loader definitely starts, but issues the warning that it can't find the location pointed to by the from= parameter (and if I proceed, it loads Porteus data from /sda6 instead).

User avatar
Ed_P
Contributor
Contributor
Posts: 8360
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Problems booting Porteus under rEFInd

Post#5 by Ed_P » 04 Mar 2022, 04:42

When Porteus starts doesn't it search for the porteus-v5.0-x86_64.cfg file? And once found loads the remaining files from the drive the cfg was found on?
Ed

rchase
Shogun
Shogun
Posts: 282
Joined: 10 Jan 2016, 17:26
Distribution: Porteus 5.0 rc3 xfce
Location: Denver, Colorado

Problems booting Porteus under rEFInd

Post#6 by rchase » 04 Mar 2022, 06:00

That's how Porteus boots through BIOS -- UEFI boots through the menu-driven system in Porteus' /EFI folder (although it also hasn't booted on such systems). I'm successfully booting OSX El Capitan, Linux Lite, and Porteus 5.0rc3 XFCE on an SSD through rEFInd on a 2008 iMac. rEFInd automatically locates OSX and generates an icon to select it for boot from a graphical menu and the manual stanzas I reproduced here add choices for Linux Lite and Porteus to the menu; I invoke Linux Lite through its .efi file, but I load Porteus directly, passing my own options to initrd rather than using porteus.cfg. Everything (mostly) works well, except that I cannot add another Porteus installation on the main drive to the scheme, for what reason I cannot fathom. Porteus begins to load in the new partition, but cannot find any kind of file or device reference in the options -- all attempts to direct its attention to its own partition with "from=" have failed; booting pauses with some yellow on the screen that's what displays of the error message; when I hit enter, booting proceeds using the Porteus data from my original installation. I can't even start fresh. I installed Porteus 5.0rc3 KDE on a flash drive in El Capitan, but Apple's boot menu didn't show it as an option when I booted with the Alt key depressed; I was able to boot fresh into another desktop (LXQT, I think) on that drive through rEFInd.
Last edited by rchase on 05 Mar 2022, 18:20, edited 1 time in total.

User avatar
Ed_P
Contributor
Contributor
Posts: 8360
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Problems booting Porteus under rEFInd

Post#7 by Ed_P » 04 Mar 2022, 07:26

rchase wrote:
04 Mar 2022, 06:00
I'm successfully booting OSX El Capitan, Linux Lite, and Porteus 5.0rc3 XFCE on an SSD through rEFInd
Yes but different names, different programs, different files. The two Porteus systems are the same except for the DE.

Personally I use grub2 and I boot ISOs rather than partitions so I'm not much help for you unfortunately. :(
Ed

rchase
Shogun
Shogun
Posts: 282
Joined: 10 Jan 2016, 17:26
Distribution: Porteus 5.0 rc3 xfce
Location: Denver, Colorado

Problems booting Porteus under rEFInd

Post#8 by rchase » 04 Mar 2022, 14:31

The two Porteus are located in different partitions and rEFInd passes control to the appropriate initrd, but options referring to devices and file systems then fail; on its own, Porteus manages to load data from the wrong partition unless I block it by renaming folders or using the nohd option (in which case booting fails and control returns to rEFInd). Something very fishy is going on.

User avatar
Ed_P
Contributor
Contributor
Posts: 8360
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Problems booting Porteus under rEFInd

Post#9 by Ed_P » 04 Mar 2022, 20:23

Try renaming the porteus-v5.0*.cfg file on the XFCE drive when you want to boot the KDE system.

Why do you want to boot the KDE system?
Ed

rchase
Shogun
Shogun
Posts: 282
Joined: 10 Jan 2016, 17:26
Distribution: Porteus 5.0 rc3 xfce
Location: Denver, Colorado

Problems booting Porteus under rEFInd

Post#10 by rchase » 04 Mar 2022, 21:42

Bluetooth isn't working -- the module prepared for 5.0rc1 XFCE no longer works.

User avatar
Ed_P
Contributor
Contributor
Posts: 8360
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Problems booting Porteus under rEFInd

Post#11 by Ed_P » 11 Mar 2022, 06:27

From one install running run this script before booting the other install.

bootmenu.sh

Code: Select all

#!/bin/sh

# Script to aide booting two Porteus installs on the same drive.
# Copy script to each install and run prior to rebooting to the alternate install.

Porteus1=/mnt/sda1                            # Customize to fit the primary Porteus drive.
Porteus2=/mnt/nvme0n1p7                       # Customize to fit the secondary Porteus drive.

echo -en "\033]0;Boot Menu\a"

BOOTDRV=`grep -A1 "Booting" /var/log/porteus-livedbg|tail -n1|sed 's^//^/^g'`
if [ "$BOOTDRV" == "/mnt/isoloop" ]; then
   BOOTDRV=`grep -A1 "ISO=" /var/log/porteus-livedbg`
   if [ ${BOOTDRV:9:4} == "nvme" ]; then
      BOOTDRV=${BOOTDRV:4:14}
   else
      BOOTDRV=${BOOTDRV:4:9}
   fi
fi
BOOTDE=`grep "/003-" /var/log/porteus-livedbg`
if [ -e $BOOTDRV/porteus/*.cfg ]; then
   cd $BOOTDRV/porteus/
   BOOTCFG=`ls *.cfg`
fi

echo
echo "Booted system:" $BOOTDE
echo "Booted drive: " $BOOTDRV 
echo "Booted .cfg:  " $BOOTCFG
echo
read -p "New Boot Drive: 1. $Porteus1 or 2. $Porteus2? (1,2) " DRV
#set -x;
if [ "$DRV" == "1" ] || [ "$DRV" == "2" ]; then
   mv $BOOTCFG X$BOOTCFG
   if [ "$DRV" == "1" ]; then
      cd $Porteus1/porteus/
      BOOTCFG=`ls *.cfg`
      BOOTCFG1=${BOOTCFG:0:1}
      if [ "$BOOTCFG1" == "X" ]; then
         BOOTCFG=${BOOTCFG:1:30}
         $(mv X$BOOTCFG $BOOTCFG)
      fi
      echo; echo $Porteus1/porteus/$BOOTCFG
   fi
   if [ "$DRV" == "2" ]; then
      cd $Porteus2/porteus/
      BOOTCFG=`ls *.cfg`
      BOOTCFG1=${BOOTCFG:0:1}
      if [ "$BOOTCFG1" == "X" ]; then
         BOOTCFG=${BOOTCFG:1:30}
         $(mv X$BOOTCFG $BOOTCFG)
      fi
      echo; echo $Porteus2/porteus/$BOOTCFG
   fi
fi  
read
Ed

beny
Full of knowledge
Full of knowledge
Posts: 2092
Joined: 02 Jan 2011, 11:33
Location: italy

Problems booting Porteus under rEFInd

Post#12 by beny » 11 Mar 2022, 16:27

hi rchase if you have two porteus system that have the same 001-core 002-xorg and kernel you don't need two system but one you can put in the xfce4 module and the kde module,well you have to boot in text mode and with xwmconfig choose the xfce4 or kde well is a try, maybe work. well you need the gtk3 and the qt5 i don't know if they are inside the core or the desktop packages.

User avatar
Ed_P
Contributor
Contributor
Posts: 8360
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Problems booting Porteus under rEFInd

Post#13 by Ed_P » 13 Mar 2022, 15:57

A better solution rchase, use the cfgfile= cheatcode. It's described in the /boot/docs/cheatcodes.txt file.
Ed

Post Reply