Re: [gentoo-user] UEFI boot [FIXED]
On Saturday, 26 October 2019 12:36:56 BST Peter Humphrey wrote: > On Friday, 25 October 2019 16:33:07 BST Mick wrote: > > If you intend to have a list of available OS kernels displayed for you to > > choose from at boot time, then you need a Boot Manager (eLILO, GRUB, > > systemd- boot, et al.) and will *have* to follow the respective Boot > > Manager's conventions regarding its configuration and storage/naming of > > kernel images. > > That's the key. It's clear that I haven't understood what was going on until > now. Mind you, I've not been helped by the plethora of mutually > contradictory wiki and other articles purporting to guide me through the > boot process - for instance, should my boot partition (FAT32) be mounted on > /efi, /boot or /boot/efi? All are recommended in various places. Mine is on > /boot. Your $BOOT partition should be set as type ESP (i.e. with GUID C12A7328- F81F-11D2-BA4B-00A0C93EC93B), or as 'Linux Extended Boot' (GUID BC13C2FF-59E6-4262-A352-B275FD6F7172),[1] as long as this is a disk with a GPT rather than MBR partition table. [1] The 'Linux Extended Boot' partition type as called by fdisk is typically used when the ESP is too small to contain all OS kernels, Boot Manager files and UEFI applications. You'll need to set the ESP partition type using a partition manager, like gdisk, parted, fdisk. The filesystem on $BOOT should be FAT32 (although it can be FAT12, or FAT16). The $BOOT partition should be mounted on mountpoint /boot. In its filesystem-root, boot/ should have a directory EFI/, i.e. /boot/EFI. Any OS system kernel images you expect the UEFI boot manager to autodetect and list in its own firmware/BIOS GUI should be added in /boot/EFI/, each one in a separate subdirectory suitably named to identify the OS. In boot/EFI should also be the subdirectory boot/EFI/BOOT/, in which the default fall-back OS kernel image should be stored. The UEFI boot manager will boot this kernel image if other kernel images fail to boot. Removable devices can have more than one subdirectory with a kernel image in them, in boot/EFI/BOOT/, to automatically boot one of them. The above is no gospel, indeed some binary distros install /boot/efi/EFI and drop their Boot Manager's grubX64.efi in some suitably named subdirectory in there, but you get the gist. > To sum up: I didn't need efibootmgr at all, except to remove an entry I'd > created before. I did need bootctl from sys-boot/systemd-boot, and I had to > 'bootctl install' it without any configuration files under /boot. I also > needed a machine ID in /etc/machine-id, without which 'bootctl install' > refused to do anything. systemd-boot uses the machine-id[2] in its nomenclature for each OS installed on this hardware and it also creates a correspondingly named subdirectory within /boot/ for OS kernel images and associated files to be dropped in there by binary distros' kernel installer scripts. Without a machine-id I would think systemd-boot would cough loudly when you try to install it, just as you report. The same machine-id is subsequently used for the naming of .conf files for each OS/kernel - see below. [2] If there is no /etc/machine-id check for /var/lib/dbus/machine-id. The machine-id is generated at install time, by dbus. On my system /var/lib/dbus/ machine-id is a symlink to /etc/machine-id. > The procedure was: > > 1. Format /dev/nvme0n1p2 as FAT32 and mount it on /boot. > 2. Build and install the kernel. > 3. Run bootctl install. > 4. Write /boot/loader/loader.conf, and suitable .conf files under > /boot/loader/entries. > > That still left an empty /boot/ directory. I may risk removing > it some time. I wouldn't do such a thing, but YMMV. If your intention is to use systemd- boot as the Boot Manager of choice, I would try moving all kernels and associated files to your /boot// subdirectory. Then create corresponding /boot/loader/entries/*.conf files, which according to the systemd boot loader specification should be named like so: /boot/loader/entries/4eec63dc92f83de25e1e2e485d7f6536-4.19.72-gentoo.conf /boot/loader/entries/-..conf For use the output of 'uname -r'. For use the ID field of /etc/os-release. You may 'find uname -r' and os-release-ID are the same on your Gentoo installation. The contents of the file should look like so: title08-gentoo-4.19.72-rescue (My rescue kernel) version 4.19.72-gentoo machine-id 4eec63dc92f83de25e1e2e485d7f6536 options root=/dev/nvme0n1p4 net.ifnames=0 architecture x64 linux/4eec63dc92f83de25e1e2e485d7f6536/4.19.72-gentoo/linux initrd /4eec63dc92f83de25e1e2e485d7f6536/4.19.72-gentoo/initrd For 'title' you can use the PRETTY_NAME in /etc/os-release, or whatever you want displayed in the boot menu to differentiate visibly this menu entry from all others. For 'version' you can use the kernel version you want to boot with, but it is an optional field. Machine-id is also optional, but it helps
Re: [gentoo-user] Provide a package for a special PHP version / slot / USE flag?
On 10/26/19 4:56 AM, Matthias Hanft wrote: > > Is there a way to prevent portage warnings and errors in this > case? > Probably not what you want to hear, but: harass upstream until they release a version that isn't six years old, then open a bug and ask us to add it to the tree.
Re: [gentoo-user] per package parallel build
There's no need to mess around adding and removing masks, just use the - - exclude option. Yep! For some reason, that option doesn’t always occur to me, but that’s clearly a simpler way to do it. Thanks for reminding me! John
Re: [gentoo-user] per package parallel build
On 26 October 2019 12:16:37 BST, John Blinka wrote: >> >> I agree that it would be nice if emerge could do that automatically, >> although I have no clue how to do that or even if it can be done at >> all. Back when I had less memory, I could let FF, LOo or another >> package run at full speed but only if it was only one of those >packages >> at a time. Thing is, on occasion two or more of those updates would >hit >> and due to the long compile times, end up compiling at the same time. >> Do you think there is a way for the devs to set up a method to tell >> emerge not to emerge certain packages at the same time? In other >words, >> if Firefox is emerging, LOo is held until it is done or vice versa. >> Maybe even have it so others can be listed. The list of large >packages >> are likely small but they can have a huge impact on systems with less >> memory. >> >> You think that a feature worth asking the devs about? Maybe they can >> figure out a way to implement that?? > > >There already is a mechanism you can use, but it’s not the automatic >type >that you (and, admittedly I) would like. > >I have 3 old 2 core machines, and I use distcc heavily to reduce emerge >times. The “fastest” (not really) and best equipped has 16 gb memory. >I >do updates on this machine (with distcc help from the others) and >distribute packages to the rest. After a lot of experimenting, I find >that >MAKEOPTS=“-j13 -l5” works the best on this fastest machine. That >setting >allows it to attempt a workload that it alone doesn’t have the >resources to >accomplish, but successfully distributes to the other machines. I use >firefox, chromium, and libreoffice. Occasionally portage wants to >upgrade >more than one of these at a time, which I discover by running emerge >—pretend. On those occasions, I’ve learned that I run out of >resources >and builds fail. So I just temporarily mask all but one of those >updates, >do the upgrade, unmask one of the masked updates, do another upgrade, >and >so on. Works well for me. No builds crash, essentially no swap gets >used, >and I have substantially accelerated compile and ebuild times. > >The tools exist to do what you want to do. If you were so inclined, >you >might even contemplate writing a script to automate what I just >described. > >John Blinka There's no need to mess around adding and removing masks, just use the - - exclude option. -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
Re: [gentoo-user] UEFI boot [FIXED]
On Friday, 25 October 2019 16:33:07 BST Mick wrote: > If you intend to have a list of available OS kernels displayed for you to > choose from at boot time, then you need a Boot Manager (eLILO, GRUB, > systemd- boot, et al.) and will *have* to follow the respective Boot > Manager's conventions regarding its configuration and storage/naming of > kernel images. That's the key. It's clear that I haven't understood what was going on until now. Mind you, I've not been helped by the plethora of mutually contradictory wiki and other articles purporting to guide me through the boot process - for instance, should my boot partition (FAT32) be mounted on /efi, /boot or /boot/efi? All are recommended in various places. Mine is on /boot. To sum up: I didn't need efibootmgr at all, except to remove an entry I'd created before. I did need bootctl from sys-boot/systemd-boot, and I had to 'bootctl install' it without any configuration files under /boot. I also needed a machine ID in /etc/machine-id, without which 'bootctl install' refused to do anything. The procedure was: 1. Format /dev/nvme0n1p2 as FAT32 and mount it on /boot. 2. Build and install the kernel. 3. Run bootctl install. 4. Write /boot/loader/loader.conf, and suitable .conf files under /boot/loader/entries. That still left an empty /boot/ directory. I may risk removing it some time. I've assembled some notes on my /boot contents, attached. > PS. Happy to discuss specifics off-list if you think this is less of a > Gentoo issue. Thanks Mick; that's generous. For the moment though I think I needn't trouble You. :) -- Regards, Peter. This is the layout of my FAT32 /boot partition: # tree /boot /boot ├── 4eec63dc92f83de25e1e2e485d7f6536 ├── config-4.19.72-gentoo ├── config-4.19.72-gentoo-rescue ├── early_ucode.cpio ├── EFI │ ├── BOOT │ │ └── BOOTX64.EFI │ └── systemd │ └── systemd-bootx64.efi ├── intel-uc.img ├── loader │ ├── entries │ │ ├── 08-gentoo-4.19.72-rescue.conf │ │ ├── 09-gentoo-4.19.72-rescue.nonet.conf │ │ ├── 30-gentoo-4.19.72.conf │ │ ├── 32-gentoo-4.19.72.nox.conf │ │ └── 34-gentoo-4.19.72.nonet.conf │ ├── loader.conf │ └── random-seed ├── System.map-4.19.72-gentoo ├── System.map-4.19.72-gentoo-rescue ├── vmlinuz-4.19.72-gentoo └── vmlinuz-4.19.72-gentoo-rescue 7 directories, 17 files A couple of files: # cat /boot/loader/loader.conf default 30-gentoo-4.19.72 timeout 15 # cat /boot/loader/entries/30-gentoo-4.19.72.conf title Gentoo Linux 4.19.72 linux /vmlinuz-4.19.72-gentoo options root=/dev/nvme0n1p4 initrd=/intel-uc.img net.ifnames=0 What the NVRAM and boot programs know about the system: # efibootmgr BootCurrent: 0005 Timeout: 1 seconds BootOrder: 0005,0003,0001,0002 Boot0001* CD/DVD Drive Boot0002* Hard Drive Boot0003* UEFI OS Boot0005* Linux Boot Manager (Boot0005 was created by 'bootctl install') # bootctl status System: Firmware: UEFI 2.31 (American Megatrends 5.09) Secure Boot: disabled Setup Mode: user Current Boot Loader: Product: systemd-boot 243 Features: ✓ Boot counting ✓ Menu timeout control ✓ One-shot menu timeout control ✓ Default entry control ✓ One-shot entry control ✓ Support for XBOOTLDR partition ✓ Support for passing random seed to OS ESP: /dev/disk/by-partuuid/c39faa8e-3fce-4113-bc7e-ab31cb896cf8 File: └─/EFI/systemd/systemd-bootx64.efi Random Seed: Passed to OS: no System Token: not set Exists: yes Available Boot Loaders on ESP: ESP: /boot (/dev/disk/by-partuuid/c39faa8e-3fce-4113-bc7e-ab31cb896cf8) File: └─/EFI/systemd/systemd-bootx64.efi (systemd-boot 243) File: └─/EFI/BOOT/BOOTX64.EFI Boot Loaders Listed in EFI Variables: Title: Linux Boot Manager ID: 0x0005 Status: active, boot-order Partition: /dev/disk/by-partuuid/c39faa8e-3fce-4113-bc7e-ab31cb896cf8 File: └─/EFI/systemd/systemd-bootx64.efi Title: UEFI OS ID: 0x0003 Status: active, boot-order Partition: /dev/disk/by-partuuid/c39faa8e-3fce-4113-bc7e-ab31cb896cf8 File: └─/EFI/BOOT/BOOTX64.EFI Boot Loader Entries: $BOOT: /boot (/dev/disk/by-partuuid/c39faa8e-3fce-4113-bc7e-ab31cb896cf8) Default Boot Loader Entry: title: Gentoo Linux 4.19.72 id: 30-gentoo-4.19.72 source: /boot/loader/entries/30-gentoo-4.19.72.conf linux: /vmlinuz-4.19.72-gentoo options: root=/dev/nvme0n1p4 initrd=/intel-uc.img net.ifnames=0 End of bootctl status.
Re: [gentoo-user] per package parallel build
> > I agree that it would be nice if emerge could do that automatically, > although I have no clue how to do that or even if it can be done at > all. Back when I had less memory, I could let FF, LOo or another > package run at full speed but only if it was only one of those packages > at a time. Thing is, on occasion two or more of those updates would hit > and due to the long compile times, end up compiling at the same time. > Do you think there is a way for the devs to set up a method to tell > emerge not to emerge certain packages at the same time? In other words, > if Firefox is emerging, LOo is held until it is done or vice versa. > Maybe even have it so others can be listed. The list of large packages > are likely small but they can have a huge impact on systems with less > memory. > > You think that a feature worth asking the devs about? Maybe they can > figure out a way to implement that?? There already is a mechanism you can use, but it’s not the automatic type that you (and, admittedly I) would like. I have 3 old 2 core machines, and I use distcc heavily to reduce emerge times. The “fastest” (not really) and best equipped has 16 gb memory. I do updates on this machine (with distcc help from the others) and distribute packages to the rest. After a lot of experimenting, I find that MAKEOPTS=“-j13 -l5” works the best on this fastest machine. That setting allows it to attempt a workload that it alone doesn’t have the resources to accomplish, but successfully distributes to the other machines. I use firefox, chromium, and libreoffice. Occasionally portage wants to upgrade more than one of these at a time, which I discover by running emerge —pretend. On those occasions, I’ve learned that I run out of resources and builds fail. So I just temporarily mask all but one of those updates, do the upgrade, unmask one of the masked updates, do another upgrade, and so on. Works well for me. No builds crash, essentially no swap gets used, and I have substantially accelerated compile and ebuild times. The tools exist to do what you want to do. If you were so inclined, you might even contemplate writing a script to automate what I just described. John Blinka
[gentoo-user] Provide a package for a special PHP version / slot / USE flag?
Hi, since dev-php/pecl-haru seems not to be available for PHP 7, I installed it myself from github. But at every emerge, it tells me about unmet dependencies. Of course, I could remove the pecl-haru package completely from @world and just use my self-installed "version 7". But for a short time, I need both versions in parallel (i.e. the 5.6 version from portage tree, and my own 7.3 version from github). I know (and already used) the "packacke.provided" mechanism, but it seems that I cannot "provide" certain slots, PHP versions, or USE flags there. Is there a way to prevent portage warnings and errors in this case? Thanks, -Matt
Re: [gentoo-user] per package parallel build
On Friday, 25 October 2019 18:01:57 BST Dale wrote: > Mick wrote: > > PS. In an ideal AI world, portage would know how much memory is necessary > > for a given package and would auto-adjust the number of jobs to minimise > > swapping given any amount of RAM. In an even more ideal world, it would > > be able to do this in real time. :-) > > I agree that it would be nice if emerge could do that automatically, > although I have no clue how to do that or even if it can be done at > all. Back when I had less memory, I could let FF, LOo or another > package run at full speed but only if it was only one of those packages > at a time. Thing is, on occasion two or more of those updates would hit > and due to the long compile times, end up compiling at the same time. > Do you think there is a way for the devs to set up a method to tell > emerge not to emerge certain packages at the same time? In other words, > if Firefox is emerging, LOo is held until it is done or vice versa. > Maybe even have it so others can be listed. The list of large packages > are likely small but they can have a huge impact on systems with less > memory. > > You think that a feature worth asking the devs about? Maybe they can > figure out a way to implement that?? > > Dale > > :-) :-) Well, ebuilds with known large compiles have specific tests at present, e.g. chromium, FF, et al., run checks on available disk space for /var/tmp/portage and warn the user accordingly. In firefox-70.0.ebuild we see this: ... pkg_pretend() { # Ensure we have enough disk space to compile if use pgo || use lto || use debug || use test ; then CHECKREQS_DISK_BUILD="8G" else CHECKREQS_DISK_BUILD="4G" fi check-reqs_pkg_setup } I guess a lot can be included in such checks, but I have no idea how to do it, or how complicated an ebuild would get as a result. The problem with RAM usage is that it changes continuously. You open a browser, or some large PDF, or LO and more RAM is being used, just at the moment an ebuild decides to run a check on available RAM. It can't guess if you will shut down your applications and log out of your desktop the next moment to free up more memory, if you will shut down web servers, databases or whatever else you may be running in the background and drop to a console. For this reason I assume such a measure won't be implemented in rush and even if it did, it would annoy people, especially if they are asked to add USE="I-really-know-what-I-am- doing" to allow the compile to start. -- Regards, Mick signature.asc Description: This is a digitally signed message part.