Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-27 Thread Neil Bothwick
On Sun, 27 Dec 2020 01:07:58 +, antlists wrote:

> > UEFI is dead simple, and you can use gdisk, which is the GPT variant
> > of fdisk. So that only leave the boot manager to learn, and if you
> > don't already know GRUB, I'd say start with something simpler.
> > 
> >   
> I got the impression that on newer systems, gdisk and fdisk were the 
> same thing ...
> 
> Certainly I moved to gdisk because "fdisk can't handle GPTs", and then 
> someone said "oh yes it can" so I investigated and oh yes it could. I 
> still use gdisk, but as I say they now appear to be the same thing.

Indeed, GPT support has now been added to fdisk. So all versions of gdisk
handle GPT while recent versions of fdisk do it. That's why I recommend
gdisk, to be certain of using a version with GPT support.


-- 
Neil Bothwick

The trouble with doing something right the first time is that nobody
appreciates how difficult it was.


pgp8caj6cBWSS.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-26 Thread Dale
antlists wrote:
> On 25/12/2020 18:24, Neil Bothwick wrote:
>> On Fri, 25 Dec 2020 11:41:03 -0500, Walter Dnes wrote:
>>
>>>    After 20 years on linux, I've been reduced to a newbie.  BIOS boot,
>>> Lilo, and fdisk served me well for 2 decades.  Now I'm going to have to
>>> learn UEFI, grub, and parted all at once.  I'll start a new thread
>>> tomorrow once I have my config files copied off.  Then I'll install
>>> UEFI
>>> mode properly.
>>
>> UEFI is dead simple, and you can use gdisk, which is the GPT variant of
>> fdisk. So that only leave the boot manager to learn, and if you don't
>> already know GRUB, I'd say start with something simpler.
>>
>>
> I got the impression that on newer systems, gdisk and fdisk were the
> same thing ...
>
> Certainly I moved to gdisk because "fdisk can't handle GPTs", and then
> someone said "oh yes it can" so I investigated and oh yes it could. I
> still use gdisk, but as I say they now appear to be the same thing.
>
> Cheers,
> Wol
>
>


I think fdisk couldn't handle GPT at first.  I guess that's why gdisk
came along.  Then I think the fdisk folks added support for GPT and
since then it handles both.  That's my understanding of it.  If
possible, you may want to check the time stamps on the info you have
found.  I suspect the ones saying fdisk can't handle GPT are older posts
or people who don't know it can now.  From the man page:


fdisk is a dialog-driven program for creation and manipulation of
partition tables.  It understands GPT, MBR, Sun, SGI and BSD partition
tables.

For gdisk:

GPT fdisk (aka gdisk) is a text-mode menu-driven program for creation
and manipulation of partition tables. It will automatically convert an
old-style Master Boot Record (MBR) partition table or BSD disklabel
stored without an MBR  carrier  partition  to  the  newer  Globally
Unique Identifier (GUID) Partition Table (GPT) format, or will load a
GUID partition table.


Odds are, you can likely use either tool but if you are using GPT, you
may as well use the tool made for that purpose.  I think a lot of it is
very similar as far as options that do the same things in each program. 

Also, there is also cfdisk and cgdisk too.  The interface is different. 
You may want to try the proper one and see which you like.  I use c*disk
tools myself.  You may prefer the others.  Same result I guess. 

Hope that helps.

Dale

:-)  :-) 



Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-26 Thread antlists

On 25/12/2020 18:24, Neil Bothwick wrote:

On Fri, 25 Dec 2020 11:41:03 -0500, Walter Dnes wrote:


   After 20 years on linux, I've been reduced to a newbie.  BIOS boot,
Lilo, and fdisk served me well for 2 decades.  Now I'm going to have to
learn UEFI, grub, and parted all at once.  I'll start a new thread
tomorrow once I have my config files copied off.  Then I'll install UEFI
mode properly.


UEFI is dead simple, and you can use gdisk, which is the GPT variant of
fdisk. So that only leave the boot manager to learn, and if you don't
already know GRUB, I'd say start with something simpler.


I got the impression that on newer systems, gdisk and fdisk were the 
same thing ...


Certainly I moved to gdisk because "fdisk can't handle GPTs", and then 
someone said "oh yes it can" so I investigated and oh yes it could. I 
still use gdisk, but as I say they now appear to be the same thing.


Cheers,
Wol



Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-26 Thread Dan Egli



On 12/25/2020 9:41 AM, Walter Dnes wrote:

On Thu, Dec 24, 2020 at 03:49:35PM -0700, Dan Egli wrote

I see your problem, I think. You don't have your ESP mounted, so
grub can't write the EFI files to it. You are likely trying to use
grub with grub-install /dev/sda. That won't work for EFI.

mkdir /boot/efi
mount -t vfat /dev/sda1 /boot/efi
grub-install --target=x86_64-efi --efi-directory=/boot/efi
grub-mkconfig -o /boot/grub/grub.cfg

you MAY need to add --removable to the grub-install line. Some EFI
setups prefer that.

   I have this sinking feeling in my stomach that I need to blow away
the install (after scp'ing config files to my desktop) and start over.
There is no room for another partition.  Apparently, using fdisk (like I
did) to partition a GPT system is begging for problems down the road.

   After 20 years on linux, I've been reduced to a newbie.  BIOS boot,
Lilo, and fdisk served me well for 2 decades.  Now I'm going to have to
learn UEFI, grub, and parted all at once.  I'll start a new thread
tomorrow once I have my config files copied off.  Then I'll install UEFI
mode properly.

One thing you could try is using gparted to shrink the partition ever so 
slightly. It doesn't need to be big at all. The standard windows EFI 
partition is 100MB! That's it. It's not a matter of using FDisk, as I 
did too. It's just a matter of remembering to make the partition.



--
Dan Egli
From my Test Server




Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-25 Thread Dale
Neil Bothwick wrote:
> On Fri, 25 Dec 2020 16:38:13 -0600, Dale wrote:
>
>>> You can also use systemd-boot, a separate package for OpenRC users,
>>> which I have used without an initramfs. systemd-boot is very
>>> lightweight and only requires a two line config for each kernel, plus
>>> a two line general config (timeout and default). That's six lines of
>>> config for a choice of two kernels. 
>>>
>>> Of course, if you want absolutely minimal, you don't need any boot
>>> manager with UEFI and you can select your kernel from the firmware's
>>> boot menu, but that loses you the ability to edit options on the fly.
>> Is that similar to the old now gone Grub?  I admit, I sort of liked the
>> old grub.  Adding/removing a kernel was pretty darn easy. 
> It's much simpler. GRUB is a bootloader, UEFI is a bootloader in
> firmware, so the software is only used to tell it what to do, not control
> the boot process itself.
>
>

Oh.  I'm still on BIOS so that leaves me out, for now at least.  ;-) 
That said, my mobo is getting some age on it.  After the internet
switch, NAS and such, I plan to build a new rig.  May recycle some stuff
but newish anyway. 

Dale

:-)  :-)



Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-25 Thread Neil Bothwick
On Fri, 25 Dec 2020 16:38:13 -0600, Dale wrote:

> > You can also use systemd-boot, a separate package for OpenRC users,
> > which I have used without an initramfs. systemd-boot is very
> > lightweight and only requires a two line config for each kernel, plus
> > a two line general config (timeout and default). That's six lines of
> > config for a choice of two kernels. 
> >
> > Of course, if you want absolutely minimal, you don't need any boot
> > manager with UEFI and you can select your kernel from the firmware's
> > boot menu, but that loses you the ability to edit options on the fly.

> Is that similar to the old now gone Grub?  I admit, I sort of liked the
> old grub.  Adding/removing a kernel was pretty darn easy. 

It's much simpler. GRUB is a bootloader, UEFI is a bootloader in
firmware, so the software is only used to tell it what to do, not control
the boot process itself.


-- 
Neil Bothwick

She's fine, upstanding, and wonderful laying down.


pgpyDRUMehktl.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-25 Thread Dale
Neil Bothwick wrote:
> On Fri, 25 Dec 2020 15:55:23 -0500, Walter Dnes wrote:
>
>>   One other thing, looking at the docs, it seems that refind requires
>> initrd.  Am I reading it correctly?  If so, I may as well go with grub.
>> Grub usually requires setting up stuff once.  Initrd requires running
>> more often.
> While I've only used rEFInd with an initramfs, because I have an
> encrypted /, there doesn't appear to be any reason to need one. All it
> does is load a kernel and pass it some options.
>
> You can also use systemd-boot, a separate package for OpenRC users, which
> I have used without an initramfs. systemd-boot is very lightweight and
> only requires a two line config for each kernel, plus a two line general
> config (timeout and default). That's six lines of config for a choice of
> two kernels. 
>
> Of course, if you want absolutely minimal, you don't need any boot manager
> with UEFI and you can select your kernel from the firmware's boot menu,
> but that loses you the ability to edit options on the fly.
>
>


Is that similar to the old now gone Grub?  I admit, I sort of liked the
old grub.  Adding/removing a kernel was pretty darn easy. 

Dale

:-)  :-) 



Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-25 Thread Peter Humphrey
On Friday, 25 December 2020 19:17:24 GMT Walter Dnes wrote:
> On Fri, Dec 25, 2020 at 06:45:42PM +, Jorge Almeida wrote
> 
> > Learning about UEFI: https://www.rodsbooks.com/refind/
> > Suggestion: forget about grub; refind is the way to go (link above)
> > Also: you don't need parted; gdisk is fine if you're OK with fdisk
> 
>   Thanks for the pointers.  Are there any changes I have to make in my
> linux kernel to boot UEFI?  Note; legacy BIOS boot is *NOT* an option
> on my new Dell XPS8940.  It's UEFI boot only.

The installation handbook is useful on setting UEFI up. It worked for me, 
anyway.

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader

-- 
Regards,
Peter.






Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-25 Thread Neil Bothwick
On Fri, 25 Dec 2020 15:55:23 -0500, Walter Dnes wrote:

>   One other thing, looking at the docs, it seems that refind requires
> initrd.  Am I reading it correctly?  If so, I may as well go with grub.
> Grub usually requires setting up stuff once.  Initrd requires running
> more often.

While I've only used rEFInd with an initramfs, because I have an
encrypted /, there doesn't appear to be any reason to need one. All it
does is load a kernel and pass it some options.

You can also use systemd-boot, a separate package for OpenRC users, which
I have used without an initramfs. systemd-boot is very lightweight and
only requires a two line config for each kernel, plus a two line general
config (timeout and default). That's six lines of config for a choice of
two kernels. 

Of course, if you want absolutely minimal, you don't need any boot manager
with UEFI and you can select your kernel from the firmware's boot menu,
but that loses you the ability to edit options on the fly.


-- 
Neil Bothwick

"Press Return to Continue" - known as "The Mail Menupause".


pgpnfwbyRgWP_.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-25 Thread Jorge Almeida
On Fri, Dec 25, 2020 at 9:01 PM Jorge Almeida  wrote:
>
> On Fri, Dec 25, 2020 at 8:55 PM Walter Dnes  wrote:
> >
>
> >

> The initrd documentation can be a bit overwhelming. Still, much better
I meant "The refind documentation", of course.



Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-25 Thread Jorge Almeida
On Fri, Dec 25, 2020 at 8:55 PM Walter Dnes  wrote:
>

>
>   One other thing, looking at the docs, it seems that refind requires
> initrd.  Am I reading it correctly?  If so, I may as well go with grub.
> Grub usually requires setting up stuff once.  Initrd requires running
> more often.
>
No. I use refind and I don't have an initrd.
The initrd documentation can be a bit overwhelming. Still, much better
than the Grub documentation, IMO.

Jorge



Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-25 Thread Walter Dnes
On Fri, Dec 25, 2020 at 07:32:42PM +, Jorge Almeida wrote
> On Fri, Dec 25, 2020 at 7:17 PM Walter Dnes  wrote:
> >
> 
> >   Thanks for the pointers.  Are there any changes I have to make in my
> > linux kernel to boot UEFI?  Note; legacy BIOS boot is *NOT* an option
> > on my new Dell XPS8940.  It's UEFI boot only.
> >
> I'm not sure that it is really necessary for refind, but it doesn't hurt:
> 
>  Processor type and features -> EFI runtime service support
> " ->  EFI stub support

  One other thing, looking at the docs, it seems that refind requires
initrd.  Am I reading it correctly?  If so, I may as well go with grub.
Grub usually requires setting up stuff once.  Initrd requires running
more often.

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



Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-25 Thread Jorge Almeida
On Fri, Dec 25, 2020 at 7:17 PM Walter Dnes  wrote:
>

>   Thanks for the pointers.  Are there any changes I have to make in my
> linux kernel to boot UEFI?  Note; legacy BIOS boot is *NOT* an option
> on my new Dell XPS8940.  It's UEFI boot only.
>
I'm not sure that it is really necessary for refind, but it doesn't hurt:

 Processor type and features -> EFI runtime service support
" ->  EFI stub support

Jorge



Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-25 Thread Walter Dnes
On Fri, Dec 25, 2020 at 06:45:42PM +, Jorge Almeida wrote

> Learning about UEFI: https://www.rodsbooks.com/refind/
> Suggestion: forget about grub; refind is the way to go (link above)
> Also: you don't need parted; gdisk is fine if you're OK with fdisk

  Thanks for the pointers.  Are there any changes I have to make in my
linux kernel to boot UEFI?  Note; legacy BIOS boot is *NOT* an option
on my new Dell XPS8940.  It's UEFI boot only.

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



Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-25 Thread Jorge Almeida
On Fri, Dec 25, 2020 at 4:41 PM Walter Dnes  wrote:
>

>   After 20 years on linux, I've been reduced to a newbie.  BIOS boot,
> Lilo, and fdisk served me well for 2 decades.  Now I'm going to have to
> learn UEFI, grub, and parted all at once.  I'll start a new thread
> tomorrow once I have my config files copied off.  Then I'll install UEFI
> mode properly.
Learning about UEFI: https://www.rodsbooks.com/refind/
Suggestion: forget about grub; refind is the way to go (link above)
Also: you don't need parted; gdisk is fine if you're OK with fdisk

Cheers

Jorge Almeida



Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-25 Thread Neil Bothwick
On Fri, 25 Dec 2020 11:41:03 -0500, Walter Dnes wrote:

>   After 20 years on linux, I've been reduced to a newbie.  BIOS boot,
> Lilo, and fdisk served me well for 2 decades.  Now I'm going to have to
> learn UEFI, grub, and parted all at once.  I'll start a new thread
> tomorrow once I have my config files copied off.  Then I'll install UEFI
> mode properly.

UEFI is dead simple, and you can use gdisk, which is the GPT variant of
fdisk. So that only leave the boot manager to learn, and if you don't
already know GRUB, I'd say start with something simpler.


-- 
Neil Bothwick

The number one cause of computer problems is computer solutions.


pgpcbSUbJHI4U.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-25 Thread Walter Dnes
On Thu, Dec 24, 2020 at 03:49:35PM -0700, Dan Egli wrote
> I see your problem, I think. You don't have your ESP mounted, so
> grub can't write the EFI files to it. You are likely trying to use
> grub with grub-install /dev/sda. That won't work for EFI.
> 
> mkdir /boot/efi
> mount -t vfat /dev/sda1 /boot/efi
> grub-install --target=x86_64-efi --efi-directory=/boot/efi
> grub-mkconfig -o /boot/grub/grub.cfg
> 
> you MAY need to add --removable to the grub-install line. Some EFI 
> setups prefer that.

  I have this sinking feeling in my stomach that I need to blow away
the install (after scp'ing config files to my desktop) and start over.
There is no room for another partition.  Apparently, using fdisk (like I
did) to partition a GPT system is begging for problems down the road.

  After 20 years on linux, I've been reduced to a newbie.  BIOS boot,
Lilo, and fdisk served me well for 2 decades.  Now I'm going to have to
learn UEFI, grub, and parted all at once.  I'll start a new thread
tomorrow once I have my config files copied off.  Then I'll install UEFI
mode properly.

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



Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-24 Thread Dan Egli
I see your problem, I think. You don't have your ESP mounted, so grub 
can't write the EFI files to it. You are likely trying to use grub with 
grub-install /dev/sda. That won't work for EFI. Try this (as root):


mkdir /boot/efi
mount -t vfat /dev/sda1 /boot/efi
grub-install --target=x86_64-efi --efi-directory=/boot/efi
grub-mkconfig -o /boot/grub/grub.cfg

you MAY need to add --removable to the grub-install line. Some EFI 
setups prefer that.


On 12/22/2020 10:37 PM, Walter Dnes wrote:

[d531][waltdnes][~] ll /boot
total 18412
drwxr-xr-x  2 root root4096 Dec 22 21:42 .
drwxr-xr-x 21 root root4096 Oct 24 12:14 ..
-rw-r--r--  1 root root   0 Oct 11 19:55 .keep
-rw-r--r--  1 root root   0 Oct 13 05:57 .keep_sys-boot_lilo-0
-rw---  1 root root  139264 Dec 22 21:42 .map
-rw-r--r--  1 root root 2979997 Dec 21 19:31 System.map.experimental
-rw-r--r--  1 root root 2991033 Oct 13 06:03 System.map.production
-rw-r--r--  1 root root 512 Oct 13 06:04 boot.0800
-rw-r--r--  1 root root   90538 Dec 21 19:31 config.experimental
-rw-r--r--  1 root root   90579 Oct 13 06:03 config.production
-rw-r--r--  1 root root 6214192 Dec 21 19:31 kernel.experimental
-rw-r--r--  1 root root 6271536 Oct 13 06:03 kernel.production



Yea, see, no directories except . and .., which is no good at all for 
EFI. Try what I said above, and see if that doesn't help.


--
Dan Egli
From my Test Server




Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-23 Thread Michael
On Wednesday, 23 December 2020 05:37:01 GMT Walter Dnes wrote:
> On Wed, Dec 23, 2020 at 04:16:46AM -, Grant Edwards wrote
> 
> > Does the UEFI BIOS recognize that /dev/sda1 exists, but just isn't
> > bootable? If yes, then it should be possible to install Grub on a USB
> > key and boot a kernel on /dev/sda1. It might be simpler to just put
> > the kernel and initrd on the USB key also. Though boot time might be
> > slightly slower that way, it won't affect performance after that.
> 
>   The point of this excercise is to bypass UEFI BIOS as much as
> possible.  

>From what I've read in the interwebs Intel have been moving to UEFI Class-3 
without the legacy BIOS Compatibility Support Module (CSM).  Dell who are 
mostly a Wintel shop would be early adopters I imagine.

With no CSM one has to use UEFI and an ESP partition to boot from.  Any 
applications/drivers requiring 16-bit BIOS will no longer work on bare metal.  
I suppose they should work in QEMU with sgabios.bin as long as QEMU can 
emulate the interface to the hardware.

As far as I know, Intel have not made Secure Boot mandatory, so no need to use 
Microsoft-RHL keys to sign your kernel images, but either way you will need to 
drop these in the ESP VFAT formatted partition under an EFI/ directory, or 
EFI// subdirectory.

At some point in this /progress/ towards UEFI Class-3, Dell disabled booting 
internal drives with CSM.  Only external drives/media can be booted if CSM is 
enabled - I think you need to press F12 to select the external bootable 
device.


> The machine will happily automatically boot from the Gentoo
> minimal install USB key, which I believe is grub, so that works.  And
> the minimal install does indeed recognize /dev/sda, which is why I was
> able to install linux in the first place.  What I'm looking for is the
> grub "recipie" to automatically hand off control to /dev/sda1 at bootup.
> This will require leaving a USB key permanently in one of the 6 USB
> ports in the back of the machine.

You could install GRUB to a USB device, you need to pass the '--removable' 
option to the grub-install command.


>   I've been using lilo for 20 years plus, so I don't have a clue about
> grub and how it works.  I generally have 2 kernels available on the lilo
> boot menu, "production" and "experimental".  I test the "expermental"
> kernel for a while before copying it over the "production" kernel.  My
> menu normally waits up to 15 seconds.  If no keypress, it defaults to
> the "production" kernel.  Grub would need to load one of
> /boot/kernel.experimental or /boot/kernel.production.  I could
> re-arrange the layout if necessary.  Here's my current /boot layout...
> 
> [d531][waltdnes][~] ll /boot
> total 18412
> drwxr-xr-x  2 root root4096 Dec 22 21:42 .
> drwxr-xr-x 21 root root4096 Oct 24 12:14 ..
> -rw-r--r--  1 root root   0 Oct 11 19:55 .keep
> -rw-r--r--  1 root root   0 Oct 13 05:57 .keep_sys-boot_lilo-0
> -rw---  1 root root  139264 Dec 22 21:42 .map
> -rw-r--r--  1 root root 2979997 Dec 21 19:31 System.map.experimental
> -rw-r--r--  1 root root 2991033 Oct 13 06:03 System.map.production
> -rw-r--r--  1 root root 512 Oct 13 06:04 boot.0800
> -rw-r--r--  1 root root   90538 Dec 21 19:31 config.experimental
> -rw-r--r--  1 root root   90579 Oct 13 06:03 config.production
> -rw-r--r--  1 root root 6214192 Dec 21 19:31 kernel.experimental
> -rw-r--r--  1 root root 6271536 Oct 13 06:03 kernel.production

GRUB will install its UEFI image grubx64.efi in the ESP partition and then 
boot with that any OS kernel images you have included in the ESP partition.  
GRUB will scan the ESP partition and create its grub.cfg file to include in 
its boot menu automagically any kernel/initramfs images, when you run update-
grub.

Alternatively, instead of booting a mini OS (UEFI firmware), to boot another 
mini OS (GRUB), to boot your intended OS (Gentoo), you can skip GRUB 
altogether and just use efibootmgr to manipulate the UEFI firmware boot menu 
for your kernel images in the ESP partition.

signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-22 Thread Walter Dnes
On Wed, Dec 23, 2020 at 04:16:46AM -, Grant Edwards wrote

> Does the UEFI BIOS recognize that /dev/sda1 exists, but just isn't
> bootable? If yes, then it should be possible to install Grub on a USB
> key and boot a kernel on /dev/sda1. It might be simpler to just put
> the kernel and initrd on the USB key also. Though boot time might be
> slightly slower that way, it won't affect performance after that.

  The point of this excercise is to bypass UEFI BIOS as much as
possible.  The machine will happily automatically boot from the Gentoo
minimal install USB key, which I believe is grub, so that works.  And
the minimal install does indeed recognize /dev/sda, which is why I was
able to install linux in the first place.  What I'm looking for is the
grub "recipie" to automatically hand off control to /dev/sda1 at bootup.
This will require leaving a USB key permanently in one of the 6 USB
ports in the back of the machine.

  I've been using lilo for 20 years plus, so I don't have a clue about
grub and how it works.  I generally have 2 kernels available on the lilo
boot menu, "production" and "experimental".  I test the "expermental"
kernel for a while before copying it over the "production" kernel.  My
menu normally waits up to 15 seconds.  If no keypress, it defaults to
the "production" kernel.  Grub would need to load one of
/boot/kernel.experimental or /boot/kernel.production.  I could
re-arrange the layout if necessary.  Here's my current /boot layout...

[d531][waltdnes][~] ll /boot
total 18412
drwxr-xr-x  2 root root4096 Dec 22 21:42 .
drwxr-xr-x 21 root root4096 Oct 24 12:14 ..
-rw-r--r--  1 root root   0 Oct 11 19:55 .keep
-rw-r--r--  1 root root   0 Oct 13 05:57 .keep_sys-boot_lilo-0
-rw---  1 root root  139264 Dec 22 21:42 .map
-rw-r--r--  1 root root 2979997 Dec 21 19:31 System.map.experimental
-rw-r--r--  1 root root 2991033 Oct 13 06:03 System.map.production
-rw-r--r--  1 root root 512 Oct 13 06:04 boot.0800
-rw-r--r--  1 root root   90538 Dec 21 19:31 config.experimental
-rw-r--r--  1 root root   90579 Oct 13 06:03 config.production
-rw-r--r--  1 root root 6214192 Dec 21 19:31 kernel.experimental
-rw-r--r--  1 root root 6271536 Oct 13 06:03 kernel.production

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



[gentoo-user] Re: Is a USB-key-to-hard-drive-tap-dance-boot possible?

2020-12-22 Thread Grant Edwards
On 2020-12-23, Walter Dnes  wrote:

> Situation; I have a Dell XPS8940 with that abomination known as
> UEFI, and no "legacy boot". UEFI claims there are no bootable
> partitions on the hard drive (/dev/sda).  Yet it will automatically
> boot up properly from a USB key (/dev/sdb) with Gentoo minimal
> install.

Yea, where I work, we've run into similar issues with some Dell
machines that IT insisted they procure for us to use in manufacturing
as production test stations. There seems to be no way to get them to
boot Linux from internal hard-drives, though they're quite happy
booting Linux from external USB drives. After wasting days of
engineering time, we finally told IT the machines were useless to us.

> Question; is it possible to install grub/lilo/syslinux/whatever on
> the USB key (/dev/sdb) so that it boots up and hands off control of
> the boot process to the hard drive (/dev/sda1)?

Does the UEFI BIOS recognize that /dev/sda1 exists, but just isn't
bootable? If yes, then it should be possible to install Grub on a USB
key and boot a kernel on /dev/sda1. It might be simpler to just put
the kernel and initrd on the USB key also. Though boot time might be
slightly slower that way, it won't affect performance after that.

I think...

--
Grant