Page 2 of 3

Running Porteus on harddisk via GRUB ?!

Posted: 09 Oct 2020, 04:17
by Ed_P
If you set root to the partition you're booting and don't use the from= cheatcode does it boot?

If you set root to the grub partition you're booting and set the from= cheatcode to the name of the folder name you want to use does it boot? No /mnt or /dev just the folder name your using.

Added in 10 hours 52 minutes 52 seconds:
This is a grub menu I use for an installed version of Porteus. No from= cheatcode used.

Code: Select all

menuentry "Porteus 3.2.2 - installed" --class slackware   --class icon-porteus  {
     echo "Boot disk address is: "$root
     echo "Prefix is:            "$prefix
     echo "The boot mode is:     "$grub2win_bootmode

     search -f /boot/syslinux/vmlinuz --set=root

     echo "Porteus root is:      "$root
     echo "ISO is:               n/a"
     echo "Porteus folders:      /"

     set porteus_parms="extramod=/Modules;/Modsavedat changes=EXIT:/porteus/porteussave.dat volume=33 reboot=cold"  # acpi=off"

     echo "Porteus parms are:    "$porteus_parms
     echo
     sleep -v -i 5

     linux /boot/syslinux/vmlinuz $porteus_parms
     initrd /boot/syslinux/initrd.xz
     echo "Booting Porteus"
}

Running Porteus on harddisk via GRUB ?!

Posted: 11 Oct 2020, 02:29
by francois
If he is able to boot with some grub menu entry to the usb, this is already a result. He just needs to specify the uuid as in grubconfig to install easily grub legacy (0.97) on porteus

He has not grub legacy, he has grub2.
https://askubuntu.com/questions/413479/ ... on-of-grub
GRUB 2 is version 1.98 or later.

Why can't he show is syntax?

Running Porteus on harddisk via GRUB ?!

Posted: 11 Oct 2020, 03:20
by Ed_P
When booting from an install with grub2 I don't need the from= cheatcode, I don't understand why he thinks he does.

Running Porteus on harddisk via GRUB ?!

Posted: 11 Oct 2020, 18:26
by roadie
Ed_P wrote:
11 Oct 2020, 03:20
When booting from an install with grub2 I don't need the from= cheatcode, I don't understand why he thinks he does.
Ed_P,

Not to speak for Buurman here, but this is my view on things.

From the OP's posts, it's clear that Buurman has much the same issue that I'm having, though worse because Buurman is using a "porteus" folder where I'm renaming folders. I imagine Buurman thinks he needs the "from=" cheatcode cause nothing else works. And it's not like his setup is anything exotic or out of the ordinary. It appears to be a "normal" setup, same as mine. There's no issue in finding the kernel and initrd, then booting it. Any kernel or initrd by any name is found without a problem. The Porteus files are a different story.

Buurman and I should be able to boot with no problems whatsoever, but something prevents the files being found. No cheatcodes have any effect, apart from displaying one version of error message or the other.

It's good that you don't need the from= cheatcode to boot Porteus, be happy for that. I haven't posted about my problems because I don't believe the issue is necessarily with Porteus.....and I like fixing stuff myself. I'm looking at partitions, GPT, UEFI, that kinda stuff. I don't think the answer lays in Grub, or any bootloader. Otherwise there would be lots of posts from users not being able to boot Porteus.

And, it's not like renaming folders is something new in Porteus, I, and I'm sure many others, have been doing it since Porteus first came out. Simply by using the from= cheatcode......that doesn't work now. I can get around it with a rebuilt initrd, Buurman cannot......well, Buurman might be able to boot with a rebuilt initrd that looks for a different folder, rather than porteus.....but it shouldn't be needed.

As far as showing syntax used for booting, what's the point? I've been using Porteus long enough to have an idea what a boot line should look like, Buurman can boot other installs, and really, the Porteus files should be easy to find in Buurman's case since they're in a "porteus" folder and USB and ISO boots easily.

I can well understand the frustration Buurman is having with this.

Running Porteus on harddisk via GRUB ?!

Posted: 12 Oct 2020, 03:49
by Ed_P
Thank you roadie. :) My USB installs are on FAT32 drives which I'm sure plays a part in their working for me.

Maybe if Buurman keeps the "porteus" name for his Porteus install it will still be separate from his other installs and work without the from= cheatcode.

Just trying to be helpful.

Running Porteus on harddisk via GRUB ?!

Posted: 12 Oct 2020, 04:58
by Buurman
"socially distanced" myself from the matter for a few days , even though i already figured out what is wrong.
there is no more syntax to be given than i already said (albeit not in a < / > code form)
there are (were) basically 2 things going wrong here, flipflopping back and forth

anyway here are my findings:

Code: Select all

elif [ $ISO ]; then CFGDEV=/mnt/isoloop
    locate -e $FROM && { BOOTDEV=/mnt/$DEV; mkdir /mnt/isoloop; mount -o loop /mnt/$DEV/$LPTH /mnt/isoloop; ISOSRC=/mnt/$DEV/$LPTH; }
else
    if [ $FROM ]; then
	locate -e $FROM/porteus/$CFG
	if [ $? -eq 0 ]; then
	    DIR=`echo $LPTH | rev | cut -d/ -f3- | rev`; [ $DIR ] && FOLDER=$DIR/porteus
	else
	    echo -e "${YELLOW}from= cheatcode is incorrect, press enter to search through all devices${RST}"
	    read -s; search -e porteus/$CFG
	fi
    else
	search -e porteus/$CFG || lazy -e porteus/$CFG
    fi
    CFGDEV=/mnt/$DEV
fi
.. when using an ISO the string from FROM= is just that and boots from there (Ed_P)

but when using separate base files (exported/unzipped/etc), there HAS TO BE the config file
AND the linuxrc automatically ADDS "porteus" to the path ! (Roadie and I)

so FROM=/mnt/sda1/porteus can never work .. since it gets passed on internally as /mnt/sda1/porteus/porteus
the cheatcode manual DOES NOT state to omit the porteus directory
renaming porteus to something else also does NOT work because of this (also case sensitive)
and if there is NO cfg file (within a directory called ../porteus) it halts the bootproces alltogether regardless of whether or not the path is correct in regards to FROM= (even though the cfg is empty anyway)

the extramod cheatcode does NOT add directory name /modules (in other words extramod= is absolute)

Code: Select all

else
    if [ "$EXTRAMOD" ]; then
	for folder in $EXTRAMOD; do
	    echo $i"searching for additional modules in $folder"
	    locate -d $folder && { find /mnt/$DEV/$LPTH -name "*.xzm" 2>/dev/null | egrep -ve "$NOLOAD" | sort >>/tmp/modules; } || fail $folder
	done
    fi
fi
BUT, if FROM= is succesfully used AND EXTRAMOD= is given it will try to load the modules TWICE (first from the subdirectory of /porteus and then from the EXTRAMOD= command, giving erros on /images/memory/blabla)

yet in changes= directoryname has to be omitted again or you'll end up with /mnt/sda1/porteus/changes/changes

my command line now looks like:

from=/mnt/sda1 extramod=/mnt/sda1/porteus/modules changes=/mnt/sda1/porteus

which internally gets treated as:

from=/mnt/sda1/PORTEUS extramod=/mnt/sda1/porteus/modules changes=/mnt/sda1/porteus/CHANGES

note the inconsistency ?


-> so linuxrc is inconsistent on directory-structure and manual needs to be clearer on the subject

But imo the whole 'PORTEUS' (incl BASE) and CHANGES paths should be omitted from the linuxrc altogether in order to give users true, full freedom of where to put what, also why the need to look for a cfg that is empty ? Don't 'search' just use or don't use the path given from command line. (so yeah, problems like these most probably only occur on very few occasions of stubborn users who rename their files and directories :cry: instead of doing and using what and how they are told / how they are supposed to)

Running Porteus on harddisk via GRUB ?!

Posted: 12 Oct 2020, 18:27
by roadie
Ed_P wrote:
12 Oct 2020, 03:49
Thank you roadie. :) My USB installs are on FAT32 drives which I'm sure plays a part in their working for me.

Maybe if Buurman keeps the "porteus" name for his Porteus install it will still be separate from his other installs and work without the from= cheatcode.

Just trying to be helpful.
I expect that would be the case as it's always worked well in the past.....and there are no other posts saying otherwise. It looks like Buurman has found a solution, so all is good. I'm still on the hunt for my solution.

I tried a ISO boot this morning, no problems at all. It's strange that an ISO is found and booted easily, but a renamed folder is not. Anyway, the quest continues. I think up next is a good look into the HD, partitions, GPT, that kinda thing.

Running Porteus on harddisk via GRUB ?!

Posted: 17 Oct 2020, 18:19
by francois
If it is a question of finding the right porteus installation, did you thought about specifying a different folder target with custom-name.sgn file?

Code: Select all

sgnfile=some_name.sgn

... This cheatcode specifies the *.sgn file which Porteus will
search for. This is useful when you want to store several
Porteus editions on one disk/disc.
Example: 'sgnfile=porteus-usb.sgn'

Running Porteus on harddisk via GRUB ?!

Posted: 11 Nov 2020, 05:35
by roadie
francois wrote:
17 Oct 2020, 18:19
If it is a question of finding the right porteus installation, did you thought about specifying a different folder target with custom-name.sgn file?

Code: Select all

sgnfile=some_name.sgn

... This cheatcode specifies the *.sgn file which Porteus will
search for. This is useful when you want to store several
Porteus editions on one disk/disc.
Example: 'sgnfile=porteus-usb.sgn'
I missed this post somehow, but no, in my case, sgnfile=, or cfgfile= does not work. They worked in the past but not with my current machine. The only thing that has worked is a custom initrd and even that doesn't boot straight from the menu, the error message of not finding the files is shown, but on hitting enter, it does find them.

But, I've found the solution and am now able to boot any install without having to rebuild an initrd for each one. It also uses the standard porteus-v5.0-x86_64.cfg file and works with the "from=" cheatcode. It's a simple modification to the search commands in linuxrc and is working flawlessly now.......life is good.

Of course, it still means rebuilding the initrd, but it's done only once and works for everything I've tried it with.

Running Porteus on harddisk via GRUB ?!

Posted: 11 Nov 2020, 17:02
by raja
I always used to change FOLDER=porteus and cfg file name*, to a name in my installation, in linuxrc. It worked. But as you said, one has to rebuild initrd every time.

Can you please post the changes you made in the "search" command for cfg file, in linuxrc.?

In grub 2.02, I keep vmlinuz and initrd.xz in boot folder and refer to it in menu entry. Grub finds the folder and boot from any partition. Very easy to multi boot and test any release.

* cfg file name is same for all desktops.

Running Porteus on harddisk via GRUB ?!

Posted: 11 Nov 2020, 17:54
by roadie
raja wrote:
11 Nov 2020, 17:02
I always used to change FOLDER=porteus and cfg file name*, to a name in my installation, in linuxrc. It worked. But as you said, one has to rebuild initrd every time.

Can you please post the changes you made in the "search" command for cfg file, in linuxrc.?

In grub 2.02, I keep vmlinuz and initrd.xz in boot folder and refer to it in menu entry. Grub finds the folder and boot from any partition. Very easy to multi boot and test any release.

* cfg file name is same for all desktops.
I've been doing the same, changing the folder name and cfg file in linuxrc and it gets to be tedious after a while. I had thought of trying Grub, but I didn't think it would make much difference as it's still up to linuxrc to find the folder.

Here is the section I changed in linuxrc......lines 80 to 88......I changed every instance of "porteus" to "$PORTEUS"......I don't know why it works, I'm not in any way a coder.

Code: Select all

    if [ $FROM ]; then
	locate -e $FROM/$PORTEUS/$CFG
	if [ $? -eq 0 ]; then
	    DIR=`echo $LPTH | rev | cut -d/ -f3- | rev`; [ $DIR ] && FOLDER=$DIR/$PORTEUS
	else
	    echo -e "${YELLOW}from= cheatcode is incorrect, press enter to search through all devices${RST}"
	    read -s; search -e $PORTEUS/$CFG
	fi
    else
	search -e $PORTEUS/$CFG || lazy -e $PORTEUS/$CFG
    fi
    CFGDEV=/mnt/$DEV

EDIT: I forgot to say that I also change the "FOLDER=porteus" on line 42 to "FOLDER=$PORTEUS"

I just tested some things, and this change is very effective at finding the folders. For example, I need only to input "from=/porteus-xfce4" on the command line and it boots.

Running Porteus on harddisk via GRUB ?!

Posted: 11 Nov 2020, 20:06
by roadie
Further testing shows that only line 80 and 82 of linuxrc need the change for my system.

Running Porteus on harddisk via GRUB ?!

Posted: 11 Nov 2020, 23:43
by ncmprhnsbl
um... would think that $PORTEUS would need to be defined somewhere? ie. PORTEUS=<something> ?

Running Porteus on harddisk via GRUB ?!

Posted: 11 Nov 2020, 23:50
by Ed_P
Setting grub's root to the drive is all that I do and it works.

Code: Select all

menuentry " Porteus 4.0 USB - EFI" --class slackware   --class icon-porteus  {

     set bootmgr=/EFI/boot/bootx64.efi

     set bootdrv=$root
     search -f $bootmgr --set=root
     if [ $root != $bootdrv ]; then
        chainloader $bootmgr
     else
        echo "----------------------------------------"
        echo USB drive NOT found.
        echo
        sleep -v -i 10
     fi
     set root=$bootdrv
     }
And yes $ variables need to be set / defined before they are used.

Running Porteus on harddisk via GRUB ?!

Posted: 12 Nov 2020, 01:45
by roadie
ncmprhnsbl wrote:
11 Nov 2020, 23:43
um... would think that $PORTEUS would need to be defined somewhere? ie. PORTEUS=<something> ?
I think that the variable "FOLDER=$PORTEUS" on line 42 is doing that......it's the only other change I made. It's easy to test if one is so inclined. I'm happy with it, as I said everything I've tried boots right from the menu, don't even need an /mnt/sdx, or UUID. Just a "from=porteus-whatever" and it's off to the races.......a very short race, but still a race.