Re: [gentoo-user] Re: Exact setting in grub to default to a kernel by name?

2021-06-15 Thread Neil Bothwick
On Mon, 14 Jun 2021 16:25:00 -0400, Walter Dnes wrote:

>   Unfortunately, just like the standard grub.cfg, it's a tiny-looking
> text font on my 1920x1080 monitor that I have to squint at.  Next
> step...  what do I do to get a functioning GUI?

Set up a theme, you can use one of the supplied examples as a base, with
a larger font.

https://www.gnu.org/software/grub/manual/grub/grub.html#Fonts


-- 
Neil Bothwick

Bus: (n.) a connector you plug money into, something like a slot machine.


pgpHR3bY8nLLj.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] Re: Exact setting in grub to default to a kernel by name?

2021-06-14 Thread Walter Dnes
On Mon, Jun 14, 2021 at 08:38:50AM -, Grant Edwards wrote

> Note that on this machine I just tell grub to search for the
> filesystem with the label "root" instead of specifying it manually --
> though it is still specified manually for the kernel argument. I don't
> remember why I did that...

  Because specifying it manually doesn't work... ask me how I found out.
Partial success... the following gives me a working text mode menu just
like the standard grub.cfg.


set timeout=15
insmod vga
set gfxmode=640x480
set gfxpayload=640x480
insmod gfxterm
terminal_output gfxterm
search --set=root --label rootfs
menuentry 'Linux Experimental' {
linux   /vmlinuz-experimental root=/dev/sda2 ro  noexec=on 
net.ifnames=0 intel_pstate=disable ipv6.disable=1
}
menuentry 'Linux Experimental Recovery' {
linux   /vmlinuz-experimental root=/dev/sda2 ro
}
menuentry 'Linux Production' {
linux   /vmlinuz-production root=/dev/sda2 ro  noexec=on net.ifnames=0 
intel_pstate=disable ipv6.disable=1
}
menuentry 'Linux Production Recovery' {
linux   /vmlinuz-production root=/dev/sda2 ro
}


  Unfortunately, just like the standard grub.cfg, it's a tiny-looking
text font on my 1920x1080 monitor that I have to squint at.  Next
step...  what do I do to get a functioning GUI?

-- 
Walter Dnes 
I don't run "desktop environments"; I run useful applications



Re: [gentoo-user] Re: Exact setting in grub to default to a kernel by name?

2021-06-14 Thread Neil Bothwick
On Sun, 13 Jun 2021 22:34:30 -0400, Walter Dnes wrote:

> > > 1) Is "insmod extfs3" necessary? I've built extfs3 into the
> > > kernels.  
> > 
> > If the kernel is on an ext3 filesystem, yes. This is GRUB's module, it
> > uses it to read an ext3 filesystem in order to load the kernel.  
> 
>   Some confusion here.  "fdisk -l" on my new machine gives...
> 
> Device  StartEndSectors   Size Type
> /dev/sda12048 526335 524288   256M EFI System
> /dev/sda2  526336 1886416303 1885889968 899.3G Linux filesystem
> /dev/sda3  1886418352 1953523119   6710476832G Linux filesystem
> 
>   The EFI Systen partition is fat32.  The web examples I read show
> "insmod " matching the filesystem of the linux system being
> booted.  But all entries in grub.cfg on my new machine are "insmod fat".
> I wonder if the web documentation was referring to BIOS-booting
> machines. grub.cfg would be sitting on an xfs or extfs3 or whatever
> file system, and would need to read it off that filesystem.

If /boot is on the ESP, i.e. FAT, you won't need the ext3 module. I
suspect part of the auto-configuration setup is "load everything we
might need". It's not really an issue since the memory used by the
modules should be freed when GRUB exits.

The bloatedness is a combination of the must run everywhere defaults and
using a full bootloader when you only need a minimal boot manager. These
days, I only use GRUB on BIOS systems.


-- 
Neil Bothwick

No, you *can't* call 999 now. I'm downloading my mail.


pgpIc98Xe9Yze.pgp
Description: OpenPGP digital signature


[gentoo-user] Re: Exact setting in grub to default to a kernel by name?

2021-06-14 Thread Grant Edwards
On 2021-06-14, Walter Dnes  wrote:

> On Mon, Jun 14, 2021 at 01:00:38AM -, Grant Edwards wrote

>> All my grub.cfg files looks like this:
>> 
>> 
>> timeout=10
>> root=hd0,1
>> default=0
>> 
>> menuentry 'vmlinuz-5.10.27-gentoo' {
>>   linux /boot/vmlinuz-5.10.27-gentoo root=/dev/sda1
>>   }
>>  
>> menuentry 'vmlinuz-5.4.97-gentoo' {
>>   linux /boot/vmlinuz-5.4.97-gentoo root=/dev/sda1
>>   }
>> 
>
>   Thanks.  It's nice to have a working example.  Are you booting via
> BIOS?  I'm on a UEFI-only machine, and the generated grub.cfg has...

The example above is BIOS boot with a GPT labelled root disk.

Now that you've reminded me, I do have one UEFI system, and it does
contain a few extra global lines. It's also GPT labelled, and still
contains the original Lenovo Win10 installation -- I shrunk the Win10
partition and added two new partitions (Linux root, Linux
swap). Below is the grub.cfg for that machine:

IIRC, it worked fine without any of the gfx/font/video stuff, but like
you I wanted a nice big font.

Note that on this machine I just tell grub to search for the
filesystem with the label "root" instead of specifying it manually --
though it is still specified manually for the kernel argument. I don't
remember why I did that...



timeout=5

loadfont "DejavuSansMono24"
set gfxmode=auto
set gfxpayload=keep
insmod all_video
insmod gfxterm
terminal_output gfxterm

search --set=root --label rootfs

sleep 2

menuentry vmlinuz-5.10.27-gentoo {
  linux /boot/vmlinuz-5.10.27-gentoo root=/dev/nvme0n1p5
}

menuentry 'vmlinuz-5.4.97-gentoo' {
  linux /boot/vmlinuz-5.4.97-gentoo root=/dev/nvme0n1p5
}

menuentry 'vmlinuz-4.19.175-gentoo' {
  linux /boot/vmlinuz-4.19.175-gentoo root=/dev/nvme0n1p5
}







Re: [gentoo-user] Re: Exact setting in grub to default to a kernel by name?

2021-06-13 Thread Walter Dnes
On Mon, Jun 14, 2021 at 01:00:38AM -, Grant Edwards wrote

> All my grub.cfg files looks like this:
> 
> 
> timeout=10
> root=hd0,1
> default=0
> 
> menuentry 'vmlinuz-5.10.27-gentoo' {
>   linux /boot/vmlinuz-5.10.27-gentoo root=/dev/sda1
>   }
>  
> menuentry 'vmlinuz-5.4.97-gentoo' {
>   linux /boot/vmlinuz-5.4.97-gentoo root=/dev/sda1
>   }
> 

  Thanks.  It's nice to have a working example.  Are you booting via
BIOS?  I'm on a UEFI-only machine, and the generated grub.cfg has...

set root='hd0,gpt1' (EFI fat partition sda1 where to look for kernels)

linux   /vmlinuz-production root=/dev/sda2 (ext3fs on sda2)

-- 
Walter Dnes 
I don't run "desktop environments"; I run useful applications



Re: [gentoo-user] Re: Exact setting in grub to default to a kernel by name?

2021-06-13 Thread Walter Dnes
On Mon, Jun 14, 2021 at 12:20:44AM +0100, Neil Bothwick wrote
> On Sun, 13 Jun 2021 18:57:49 -0400, Walter Dnes wrote:
> 
> /etc/default/grub is only used when you call grub-mkconfig.
> 
> > 1) Is "insmod extfs3" necessary? I've built extfs3 into the kernels.
> 
> If the kernel is on an ext3 filesystem, yes. This is GRUB's module, it
> uses it to read an ext3 filesystem in order to load the kernel.

  Some confusion here.  "fdisk -l" on my new machine gives...

Device  StartEndSectors   Size Type
/dev/sda12048 526335 524288   256M EFI System
/dev/sda2  526336 1886416303 1885889968 899.3G Linux filesystem
/dev/sda3  1886418352 1953523119   6710476832G Linux filesystem

  The EFI Systen partition is fat32.  The web examples I read show
"insmod " matching the filesystem of the linux system being
booted.  But all entries in grub.cfg on my new machine are "insmod fat".
I wonder if the web documentation was referring to BIOS-booting machines.
grub.cfg would be sitting on an xfs or extfs3 or whatever file system,
and would need to read it off that filesystem.

  I have a UEFI system which demands a fat32 boot partition.  Since grub
and the kernels are sitting on a fat32 partition, my machine needs
"insmod fat".

  Things that make you go h...
* you need to put "insmod fat" in grub.cfg to tell grub that the kernels
  are sitting on a fat32 partition
* but grub has to first read grub.cfg on the fat32 partition before it
  knows that it must read a fat32 partition

  I wonder if this is due to the verbose automagic configuration.  I
also noticed that all menuentries on my machine contain "insmod gzio
and "insmod part_gpt", so I'm including them here.  Here is my proposed
grub.cfg.  If anybody sees any problems, please let me know.  Otherwise,
I'll try the following tomorrow on the new machine...



set timeout_style=menu
set timeout=15
insmod vga
set gfxpayload=640x480
insmod gzio
insmod part_gpt
insmod fat
set root='hd0,gpt1'
menuentry 'Linux Experimental' --class gnu-linux {
linux   /vmlinuz-experimental root=/dev/sda2 ro  noexec=on 
net.ifnames=0 intel_pstate=disable ipv6.disable=1
}
menuentry 'Linux Experimental Recovery' --class gnu-linux {
linux   /vmlinuz-experimental root=/dev/sda2 ro
}
menuentry 'Linux Production' --class gnu-linux {
linux   /vmlinuz-production root=/dev/sda2 ro  noexec=on net.ifnames=0 
intel_pstate=disable ipv6.disable=1
}
menuentry 'Linux Production Recovery' --class gnu-linux {
linux   /vmlinuz-production root=/dev/sda2 ro
}


-- 
Walter Dnes 
I don't run "desktop environments"; I run useful applications



[gentoo-user] Re: Exact setting in grub to default to a kernel by name?

2021-06-13 Thread Grant Edwards
On 2021-06-13, Walter Dnes  wrote:
> On Sun, Jun 13, 2021 at 05:38:53PM -, Grant Edwards wrote
>> On 2021-06-13, Walter Dnes  wrote:
>> 
>> >   I'd be tempted to do a manual gub.cfg if I had documentation.
>> 
>> I gave up on the grub2 auto-magical config system many years ago. My
>> grub.cfg is typically 10-20 lines long. The documentation is at
>> 
>>   https://www.gnu.org/software/grub/manual/grub/grub.html
>> 
>> For manual confiuration: see section 6:
>> 
>>   
>> https://www.gnu.org/software/grub/manual/grub/html_node/Configuration.html#Configuration
>
>   When experimenting with this, I'll backup grub.cfg.  If things go
> awry, boot with the USB key I used for the install, and copy back the
> old known working grub.cfg.  I've done a first crack at this.  I assume
> that nothing in /etc/default/grub will have any effect.  Questions...
>
> 1) Is "insmod extfs3" necessary? I've built extfs3 into the kernels.

I've never used it it, and my boot partitions are always ext3/4 

> 2) I assume that the the first "menuentry" will be the default boot?

Unless you set the `default` variable to something other than 0

> 3) Is the default timeout still 5 seconds?

Dunny, I always set 'timeout=10'

> 3) I assume that 640x480 is supported on just about every monitor
>out there.  I want as large text as possible.  My eyes are
>getting old... just like me.  Any obvious errors in the following
>grub.cfg?



>
>=
> menuentry 'Linux Experimental' --class gnu-linux {
> set gfxpayload=640x480
> insmod ext3fs
> set root='hd0,gpt1'
> linux   /vmlinuz-experimental root=/dev/sda2 ro  noexec=on 
> net.ifnames=0 intel_pstate=disable ipv6.disable=1
> }

I don't know if you really need the gfxpayload or the insmod lines, I don't
recall ever needing those to boot kernels from ext3/4 partitions.

All my grub.cfg files looks like this:


timeout=10
root=hd0,1
default=0

menuentry 'vmlinuz-5.10.27-gentoo' {
  linux /boot/vmlinuz-5.10.27-gentoo root=/dev/sda1
  }
 
menuentry 'vmlinuz-5.4.97-gentoo' {
  linux /boot/vmlinuz-5.4.97-gentoo root=/dev/sda1
  }


> Something that occured to me.  Can I move the duplicated lines to the
> top of the file and take them out of the menuentries?  E.g.

Yes.





Re: [gentoo-user] Re: Exact setting in grub to default to a kernel by name?

2021-06-13 Thread Neil Bothwick
On Sun, 13 Jun 2021 18:57:49 -0400, Walter Dnes wrote:

>   When experimenting with this, I'll backup grub.cfg.  If things go
> awry, boot with the USB key I used for the install, and copy back the
> old known working grub.cfg.  I've done a first crack at this.  I assume
> that nothing in /etc/default/grub will have any effect.  Questions...

/etc/default/grub is only used when you call grub-mkconfig.

> 1) Is "insmod extfs3" necessary? I've built extfs3 into the kernels.

If the kernel is on an ext3 filesystem, yes. This is GRUB's module, it
uses it to read an ext3 filesystem in order to load the kernel.

> 2) I assume that the the first "menuentry" will be the default boot?

Yes, you'll see default=0 in the first part of grub.cfg.

> 3) Is the default timeout still 5 seconds?

Not sure on that one, but look at grub.cfg.

> 3) I assume that 640x480 is supported on just about every monitor
> out there.  I want as large text as possible.  My eyes are getting
> old... just like me.

My eyes are better than they were 40 years ago but don't ask about my
hearing, or if you must, do it loudly...


-- 
Neil Bothwick

Documentation: (n.) a novel sold with software, designed to entertain the
   operator during episodes of bugs or glitches.


pgp_fXOqbnpCs.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] Re: Exact setting in grub to default to a kernel by name?

2021-06-13 Thread Walter Dnes
On Sun, Jun 13, 2021 at 05:38:53PM -, Grant Edwards wrote
> On 2021-06-13, Walter Dnes  wrote:
> 
> >   I'd be tempted to do a manual gub.cfg if I had documentation.
> 
> I gave up on the grub2 auto-magical config system many years ago. My
> grub.cfg is typically 10-20 lines long. The documentation is at
> 
>   https://www.gnu.org/software/grub/manual/grub/grub.html
> 
> For manual confiuration: see section 6:
> 
>   
> https://www.gnu.org/software/grub/manual/grub/html_node/Configuration.html#Configuration

  When experimenting with this, I'll backup grub.cfg.  If things go
awry, boot with the USB key I used for the install, and copy back the
old known working grub.cfg.  I've done a first crack at this.  I assume
that nothing in /etc/default/grub will have any effect.  Questions...

1) Is "insmod extfs3" necessary? I've built extfs3 into the kernels.
2) I assume that the the first "menuentry" will be the default boot?
3) Is the default timeout still 5 seconds?
3) I assume that 640x480 is supported on just about every monitor
out there.  I want as large text as possible.  My eyes are getting
old... just like me.  Any obvious errors in the following grub.cfg?

=
menuentry 'Linux Experimental' --class gnu-linux {
set gfxpayload=640x480
insmod ext3fs
set root='hd0,gpt1'
linux   /vmlinuz-experimental root=/dev/sda2 ro  noexec=on 
net.ifnames=0 intel_pstate=disable ipv6.disable=1
}
menuentry 'Linux Experimental Recovery' --class gnu-linux {
set gfxpayload=640x480
insmod ext3fs
set root='hd0,gpt1'
linux   /vmlinuz-experimental root=/dev/sda2 ro
}
menuentry 'Linux Production' --class gnu-linux { 
set gfxpayload=640x480
insmod ext3fs
set root='hd0,gpt1'
linux   /vmlinuz-production root=/dev/sda2 ro  noexec=on net.ifnames=0 
intel_pstate=disable ipv6.disable=1
}
menuentry 'Linux Production Recovery' --class gnu-linux { 
set gfxpayload=640x480
insmod ext3fs
set root='hd0,gpt1'
linux   /vmlinuz-production root=/dev/sda2 ro
}
=

  Something that occured to me.  Can I move the duplicated lines to the
top of the file and take them out of the menuentries?  E.g.

=
set gfxpayload=640x480
insmod ext3fs
set root='hd0,gpt1'
menuentry 'Linux Experimental' --class gnu-linux {
linux   /vmlinuz-experimental root=/dev/sda2 ro  noexec=on 
net.ifnames=0 intel_pstate=disable ipv6.disable=1
}
menuentry 'Linux Experimental Recovery' --class gnu-linux {
linux   /vmlinuz-experimental root=/dev/sda2 ro
}
menuentry 'Linux Production' --class gnu-linux { 
linux   /vmlinuz-production root=/dev/sda2 ro  noexec=on net.ifnames=0 
intel_pstate=disable ipv6.disable=1
}
menuentry 'Linux Production Recovery' --class gnu-linux { 
linux   /vmlinuz-production root=/dev/sda2 ro
}
=

-- 
Walter Dnes 
I don't run "desktop environments"; I run useful applications



[gentoo-user] Re: Exact setting in grub to default to a kernel by name?

2021-06-13 Thread Grant Edwards
On 2021-06-13, Walter Dnes  wrote:

>   I'd be tempted to do a manual gub.cfg if I had documentation.

I gave up on the grub2 auto-magical config system many years ago. My
grub.cfg is typically 10-20 lines long. The documentation is at

  https://www.gnu.org/software/grub/manual/grub/grub.html

For manual confiuration: see section 6:

  
https://www.gnu.org/software/grub/manual/grub/html_node/Configuration.html#Configuration