Re: install Kernel and GRUB in chroot.

2024-02-05 Thread Max Nikulin

On 05/02/2024 17:40, Dmitry wrote:

 > It would not work with secure boot

Yes.

But secure boot is usually turned off. It is a standard advice during 
Linux installation.


That advice may be standard for distributions that do not provide signed 
shim and grub. Likely it is applicable for Arch and derivatives. Debian 
supports installation with enabled secure boot.


At first I suspected that you enrolled your own MOK and maybe even wiped 
out Microsoft keys.


Perhaps you may get encrypted /boot in Debian similar to what you have 
in Manjaro, but certainly it is not default configuration.





Re: install Kernel and GRUB in chroot.

2024-02-05 Thread Ralph Aichinger
On Mon, 2024-02-05 at 17:40 +0700, Dmitry wrote:
> 
> But secure boot is usually turned off. It is a standard advice during
> Linux 
> installation.
> 
Will probably be increasingly common though, I've got a Microsoft
Surface Laptop that works fine with Debian, but if you switch off
secure boot, it displays some big red scary warning screen before the
bootloader.

/ralph



Re: install Kernel and GRUB in chroot.

2024-02-05 Thread Dmitry

> It would not work with secure boot

Yes.

But secure boot is usually turned off. It is a standard advice during Linux 
installation.




Re: install Kernel and GRUB in chroot.

2024-02-04 Thread Dmitry

sudo -i


Thank you!



I am unsure what UUID you mean.


At Manjaro:

grubx64.efi is at the sdb1 - EFI vfat /dev/sdb1
grub.cfg is at the sdb2 - crypto_LUKS /dev/sdb2

grubx64.efi contains data UUID=""a8...b7" of /dev/sdb2 which is 
TYPE="crypto_LUKS".


`blkid` output:
/dev/sdb2: UUID="a8...b7" TYPE="crypto_LUKS" PARTUUID="8...5"

`strings /boot/efi/EFI/Manjaro/grub64x.efi` output:
cryptomount -u a8...b7
(cryptouuid/a8...b7)/boot/grub

I have a Manjaro installed, and what to migrate to Debian. That involves 
exploration of Booting order.


In the Manjaro GRUB installation mounting point for ESP (sdb1) is:
/boot/efi
And the grub.cfg is
/boot/grub/grub.cfg

The grub.cfg located at the crypto partition sdb2.

Manjaro has different GRUB installation scheme from Debian.



Re: install Kernel and GRUB in chroot.

2024-02-04 Thread Max Nikulin

On 03/02/2024 22:32, Dmitry wrote:

2. sudo bash


sudo -i


3. cd /boot/efi/EFI/Mangaro
4. strings grubx64.efi
5. And at the output of strings there is UUID and /boot/grub.


I am unsure what UUID you mean.

Summary: GRUB installation not only involves configuration of text 
files, but

also it involves generating data in binary grubx64.efi.


It would not work with secure boot

md5sum /boot/efi/EFI/debian/grubx64.efi 
/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed

62ff1ee5b75b4565f609043c4b1da759  /boot/efi/EFI/debian/grubx64.efi
62ff1ee5b75b4565f609043c4b1da759 
/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed






Re: install Kernel and GRUB in chroot.

2024-02-03 Thread Felix Miata
Tim Woodall composed on 2024-02-03 21:25 (UTC):

> Max Nikulin wrote:

>> It seems secure boot is disabled in your case, so I am wondering why you do 
>> not boot xen.efi directly.

> Because the NVRAM is extremely tempremental. 

Not in my experience. I recognized long ago that WRT non-removable media, only 
one
bootloader per machine is required, and pretty well stuck to having only one
active, or at all, no matter how many FOSS operating systems or media I have
installed. The Grubs I have used are not picky about whose kernel or initrd they
are called to load. With only one bootloader installed, retouching NVRAM isn't
often required, and there needn't be much in it to scramble.
-- 
Evolution as taught in public schools is, like religion,
based on faith, not based on science.

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata



Re: install Kernel and GRUB in chroot.

2024-02-03 Thread Tim Woodall

On Sat, 3 Feb 2024, Max Nikulin wrote:

It seems secure boot is disabled in your case, so I am wondering why you do 
not boot xen.efi directly.



Because the NVRAM is extremely tempremental. Most updates fail, or
worse, corrupt it to the point it's hard to get anything to boot.

Additionally, there was a bug in an older version of xen that caused a
kernel oops if wifi networking was started. So I wanted to start vanilla
debian and I don't dare touch the NVRAM again (or the bios) until I
absolutely have to.

I don't remember for certain now but I might be booting using
bootx86.efi (which is a copy of grubx64.efi)

It's an old laptop but it still works well for me.




Re: install Kernel and GRUB in chroot.

2024-02-03 Thread Dmitry

Main question is resolved.

GRUB knows how to reach grub.cfg because grubx64.efi binary has the UUID and 
path to grub configurations.


1. sudo blkid;
2. sudo bash
3. cd /boot/efi/EFI/Mangaro
4. strings grubx64.efi
5. And at the output of strings there is UUID and /boot/grub.

Summary: GRUB installation not only involves configuration of text files, but
also it involves generating data in binary grubx64.efi.



Re: install Kernel and GRUB in chroot.

2024-02-02 Thread Max Nikulin

On 03/02/2024 02:15, Tim Woodall wrote:

$ cat /boot/efi/EFI/XEN/xen.cfg

[...]

I'd be interested if there's a way to tell grubx64.efi to look for a
particular partition UUID.


An example of such grub.cfg from EFI/debian has been posted already in 
this thread

https://lists.debian.org/msgid-search/20240201200846.0bb82...@dorfdsl.de

Frankly speaking, I am unsure concerning your configuration. Perhaps the 
following may make it more clear


efibootmgr -v
find /boot/efi | sort

It seems secure boot is disabled in your case, so I am wondering why you 
do not boot xen.efi directly.




Re: install Kernel and GRUB in chroot.

2024-02-02 Thread Max Nikulin

On 03/02/2024 02:51, Thomas Schmitt wrote:

Max Nikulin wrote:

Just copy files from LiveCD (it should have EFI/Boot/bootx64.efi)
to the ESP partition on the USB stick.

The /EFI/boot directory of a bootable Debian ISO usually does not contain
the full GRUB equipment for EFI. Important parts of an amd64 Live ISO are
in /boot/grub.


Certainly. And grubx64.efi in EFI/Boot of a live media behaves a bit 
differently from one in EFI/debian of a regular install since in the 
former case it relies on boot/grub residing on the same partition.


My point was to copy *files* to the pre-partitioned drive, not a whole 
image to the whole block device. I had a hope that the topic starter is 
aware of the recommended way to create a bootable USB stick using dd (or 
cp, etc.).


I usually copy files to existing single FAT partition on USB drives 
having msdos partition table (as they are shipped). It requires 
additional actions to setup syslinux for the sake of legacy boot, but it 
leaves enough space to put some additional files while the boot drive is 
prepared or during live session (requires remounting as rw). UEFI boot 
relies on files and their specific layouts, not on specific block addresses.




Re: install Kernel and GRUB in chroot.

2024-02-02 Thread Franco Martelli

On 02/02/24 at 15:12, Dmitry wrote:

Going to read carefully.

https://www.debian.org/releases/buster/amd64/ch04s03.en.html

Interesting that Buster has more documentation than current release.




Nope, maybe you gave a quick read, the release notes of the current 
release ¹  are exhaustive. If you need to go deeper, a link ² to the 
wiki it's published in that page.


Kind regards,


¹ https://www.debian.org/releases/bookworm/amd64/ch04s03.en.html
² https://wiki.debian.org/DebianInstaller/CreateUSBMedia
--
Franco Martelli



Re: install Kernel and GRUB in chroot.

2024-02-02 Thread Thomas Schmitt
Hi,

Dmitry wrote:
> Yep. `dd` copy partitions table. Amazing.

Not so amazing after you realize that a partition table is just data on
the storage medium and not some special property of the storage device.
dd copies data. If these data contain a partition table and get copied to
the right place on the storage medium, the partition table will be
recognized by EFI and Linux.


> applies no 'intelligence' to the operation.

This describes it very well. Sometimes dumb is good. Sometimes not.


Initially you stated in
  https://lists.debian.org/debian-user/2024/02/msg8.html
>...> I need to prepare that system for booting.
>...> 1. Install Kernel.
>...> 2. Install GRUB and Configure.
>...> 3. Add changes to UEFI to start booting.

dd-ing a bootable Debian ISO will not do what you describe.
Assumed the ISO is prepared for booting from USB stick, you will get a
bootable Live or an installer system. At least ISOs for i386, amd64, and
arm64 should be prepared for that.

If it is not ready for booting from USB stick, it will be just a storage
with a mountable filesystem and Debian files in it.


Max Nikulin wrote:
> > Just copy files from LiveCD (it should have EFI/Boot/bootx64.efi)
> > to the ESP partition on the USB stick.

The /EFI/boot directory of a bootable Debian ISO usually does not contain
the full GRUB equipment for EFI. Important parts of an amd64 Live ISO are
in /boot/grub.
The programs in /EFI/boot are specialized on convincing Secure Boot and
on finding the ISO filesystem with /boot/grub in it. (Actually those are
copies of the EFI boot partition files. The boot partition is a FAT
filesystem image file inside the ISO named /boot/grub/efi.img .)


Tim Woodall wrote:
> > I'm not exactly sure what you're doing.

I join this statement. :))

Do you want a normal changeable Debian system installation or do you want
a Live system with its immutable core and maybe some partition where you
can store files ?
(Just curiosity of mine. Possibly i could not help much with chroot
questions anyway.)


Have a nice day :)

Thomas



Re: install Kernel and GRUB in chroot.

2024-02-02 Thread Tim Woodall

On Thu, 1 Feb 2024, Marco Moock wrote:


Am 01.02.2024 um 19:20:01 Uhr schrieb Tim Woodall:


$ cat /boot/efi/EFI/XEN/xen.cfg
[global]
default=debian

[debian]
options=console=vga smt=true
kernel=vmlinuz root=/dev/mapper/vg--dirac-root ro quiet
ramdisk=initrd.img


menuentry "Xen EFI NVME" {
 insmod part_gpt
 insmod search_fs_uuid
 insmod chain
#set root=(hd1,gpt1)
 search --no-floppy --fs-uuid --set=root C057-BC13
 chainloader (hd1,gpt1)/EFI/XEN/xen.efi
}


Then this file tells the boot loader about the /boot or / partition.
Is that the Xen virtualization software?


The NVRAM is configured to boot:
/boot/efi/EFI/debian/grubx64.efi

That then hunts for grub.cfg. I believe it finds the first grub.cfg -
which has caused me issues in the past where I've had a legacy partition
on the disk that I'd forgotten about but the efi application sees. I'd
be interested if there's a way to tell grubx64.efi to look for a
particular partition UUID.

That menuentry above then tells efi to chainload the xen.efi
application. This is all in efi land.

That then reads xen.cfg and boots the kernel and initrd defined in that
file.




Re: install Kernel and GRUB in chroot.

2024-02-02 Thread tomas
On Sat, Feb 03, 2024 at 01:17:05AM +0700, Dmitry wrote:
> > Just copy files from LiveCD (it should have EFI/Boot/bootx64.efi) to the
> ESP partition on the USB stick.
> 
> As I understand right now `dd` command applied to a device will copy all
> information including partitions table. Thus:

Actually, cp (or even, horrors ;-) cat do the same. One advantage of dd is...

> dd if=debian-xx.iso of=/dev/sdb bs=4M status=progress; sync

...this "status=progress". The other is "oflag=sync": for bigger sticks
(and if you have tons of RAM) this last "sync" could take a long while,
without giving you feedback of what's happening.

And the third one (which it shares with cp but not with cat) is that
sudo won't work in "sudo cat foo.img > /dev/bar" (unless you already
are root, but that'd be cheating ;-)

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: install Kernel and GRUB in chroot.

2024-02-02 Thread Dmitry
> Just copy files from LiveCD (it should have EFI/Boot/bootx64.efi) to the 
ESP partition on the USB stick.


Yep. `dd` copy partitions table. Amazing.

```
dd will simply recreate the old partition scheme, as it is a bitwise copy & 
applies no 'intelligence' to the operation.

```
https://askubuntu.com/a/847533



Re: install Kernel and GRUB in chroot.

2024-02-02 Thread Dmitry
> Just copy files from LiveCD (it should have EFI/Boot/bootx64.efi) to the 
ESP partition on the USB stick.


As I understand right now `dd` command applied to a device will copy all 
information including partitions table. Thus:


dd if=debian-xx.iso of=/dev/sdb bs=4M status=progress; sync

Would just create a copy of device, with FileSystem and PartitionsTable.



Re: install Kernel and GRUB in chroot.

2024-02-02 Thread David Wright
On Fri 02 Feb 2024 at 21:12:30 (+0700), Dmitry wrote:
> Going to read carefully.
> 
> https://www.debian.org/releases/buster/amd64/ch04s03.en.html
> 
> Interesting that Buster has more documentation than current release.

It appears the balance has now been spun off into a wiki page, at

  https://wiki.debian.org/DebianInstaller/CreateUSBMedia

Cheers,
David.



Re: install Kernel and GRUB in chroot.

2024-02-02 Thread Max Nikulin

On 02/02/2024 21:06, Dmitry wrote:
Need additional research what to do with a FlashStick with several 
partitions to make a LiveCD from it.


Just copy files from LiveCD (it should have EFI/Boot/bootx64.efi) to the 
ESP partition on the USB stick.




Re: install Kernel and GRUB in chroot.

2024-02-02 Thread Dmitry

Going to read carefully.

https://www.debian.org/releases/buster/amd64/ch04s03.en.html

Interesting that Buster has more documentation than current release.




Re: install Kernel and GRUB in chroot.

2024-02-02 Thread Dmitry

> Do you want to install the OS on it?

Eventually no, I do not want OS on the Flash Stick.
The Flash Stick is only a testing place. I want OS at the SSD.

Now I am wondering how to prepare the Flash Stick to write LiveImage on it. 
Because I already created a GPT table on that Flash and use debootstrap.


Looks like need to create a new parition and copy LiveImage there.
Need additional research what to do with a FlashStick with several partitions 
to make a LiveCD from it.



> Do you want an encrypted system?

No. I do not need this abstraction layer now.



Re: install Kernel and GRUB in chroot.

2024-02-02 Thread Marco Moock
Am 02.02.2024 schrieb Dmitry :

> I want OS at the SSD.

Then the ESP should be on that SSD too.



Re: install Kernel and GRUB in chroot.

2024-02-01 Thread Marco Moock

Max Nikulin schrieb:
On a *removable* drive EFI/Boot/bootx64.efi (that is actually 
/usr/lib/shim/shimx64.efi.signed that loads grubx64.efi) may allow to 
boot without modification of boot entries in NVRAM.
Yes, UEFI can (and must be able) to boot from a device without a boot 
entry in the UEFI. Otherwise you wouldn't be able to install an OS.
You can boot such a device by simply selecting the device in the UEFI 
boot manager. Often it shows the model number of the device.
Likely it is implementation-dependent whether a drive with GPT 
partition table is considered as a removable. For regular (internal) 
drives UEFI requires GPT.

MBR should also work.




Re: install Kernel and GRUB in chroot.

2024-02-01 Thread Max Nikulin

On 02/02/2024 01:46, Dmitry wrote:

3. Now I want to boot using that Flash.

1. ESP is a partition that stores GRUB Binary. /boot/EFI/Name/grub64.eif


On a *removable* drive EFI/Boot/bootx64.efi (that is actually 
/usr/lib/shim/shimx64.efi.signed that loads grubx64.efi) may allow to 
boot without modification of boot entries in NVRAM. Likely it is 
implementation-dependent whether a drive with GPT partition table is 
considered as a removable. For regular (internal) drives UEFI requires 
GPT. I do not suggest you to use msdos partition table that might be 
suitable for live media, not for installation with multiple partitions 
including Linux native file systems.



3. At the system partition there is a /boot/grub/grub.cfg


There are 2 grub.cfg: for ESP and for /boot




Re: install Kernel and GRUB in chroot.

2024-02-01 Thread Marco Moock
Am 01.02.2024 um 19:20:01 Uhr schrieb Tim Woodall:

> $ cat /boot/efi/EFI/XEN/xen.cfg
> [global]
> default=debian
> 
> [debian]
> options=console=vga smt=true
> kernel=vmlinuz root=/dev/mapper/vg--dirac-root ro quiet
> ramdisk=initrd.img
> 
> 
> menuentry "Xen EFI NVME" {
>  insmod part_gpt
>  insmod search_fs_uuid
>  insmod chain
> #set root=(hd1,gpt1)
>  search --no-floppy --fs-uuid --set=root C057-BC13
>  chainloader (hd1,gpt1)/EFI/XEN/xen.efi
> }

Then this file tells the boot loader about the /boot or / partition.
Is that the Xen virtualization software?

-- 
Gruß
Marco

Spam und Werbung bitte an ichschickerekl...@cartoonies.org



Re: install Kernel and GRUB in chroot.

2024-02-01 Thread Tim Woodall

On Thu, 1 Feb 2024, Marco Moock wrote:


Am 02.02.2024 um 01:46:06 Uhr schrieb Dmitry:


2. ==>BAM<== some how that binary knows the system partition.


That information is on the EFI partition, where the GRUB bootloader
binary also resides.

root@ryz:/boot/efi/EFI# cat /boot/efi/EFI/debian/grub.cfg
search.fs_uuid 5b8b669d-xyz root hd0,gpt2 #boot partition
set prefix=($root)'/grub'
configfile $prefix/grub.cfg
root@ryz:/boot/efi/EFI#

If that information is loaded, the kernel can be loaded from the boot
partition.





Are you sure that file does anything? I don't have one

drwxr-xr-x 2 root root   4096 Dec 31  2017 .
drwxr-xr-x 6 root root   4096 Dec 25  2019 ..
-rwxr-xr-x 1 root root 163840 Sep 11  2022 grubx64.efi


This finds my boot partition and then chainloads the XEN efi binary
which does have some config.

/boot/efi/EFI/XEN:
total 38204
drwxr-xr-x 2 root root 4096 May  5  2023 .
drwxr-xr-x 6 root root 4096 Dec 25  2019 ..
-rwxr-xr-x 1 root root 31132473 Aug 12 08:34 initrd.img
-rwxr-xr-x 1 root root  5283136 Aug 12 08:34 vmlinuz
-rwxr-xr-x 1 root root  138 May  5  2023 xen.cfg
-rwxr-xr-x 1 root root  2687456 Jun 20  2021 xen.efi

$ cat /boot/efi/EFI/XEN/xen.cfg
[global]
default=debian

[debian]
options=console=vga smt=true
kernel=vmlinuz root=/dev/mapper/vg--dirac-root ro quiet
ramdisk=initrd.img


menuentry "Xen EFI NVME" {
insmod part_gpt
insmod search_fs_uuid
insmod chain
#set root=(hd1,gpt1)
search --no-floppy --fs-uuid --set=root C057-BC13
chainloader (hd1,gpt1)/EFI/XEN/xen.efi
}



Re: install Kernel and GRUB in chroot.

2024-02-01 Thread Tim Woodall

On Fri, 2 Feb 2024, Dmitry wrote:


Hi Tim. The community is so kind.

So.


I'm not exactly sure what you're doing.


Understand how GRUB works, to boot myself.

1. Trying to install Debian on the Flash.
2. Use it by the Debootstrap.
3. Now I want to boot using that Flash.

Looks like a caught the thread.

1. ESP is a partition that stores GRUB Binary. /boot/EFI/Name/grub64.eif
2. ==>BAM<== some how that binary knows the system partition.



because grub64.efi understands the disk layout and looks for it. You can
build your own

I'm not giving any guarantees - look at the date on this file:

$ ls -al test-uefi
-rw-r--r-- 1 tim tim 341 Dec 31  2018 test-uefi

$ cat test-uefi
grub-mkimage -o bootx64.efi -p /EFI/BOOT -O x86_64-efi \
 fat iso9660 part_gpt part_msdos \
 normal boot echo linux configfile loopback chain \
 efifwsetup efi_gop efi_uga \
 ls search search_label search_fs_uuid search_fs_file \
 gfxterm gfxterm_background gfxterm_menu test all_video loadenv \
 exfat ext2 lvm mdraid09 mdraid1x diskfilter

but that probably builds (or once worked) a .efi application that will
successfully boot a system by searching for grub.cfg. I don't remember
the details...

I also have this - take with a pinch of salt - I wrote this learning
about this system as you are trying to now...


$ ls -al uefi-notes
-rw-r--r-- 1 tim tim 2375 Dec  1  2018 uefi-notes

1 FDISK

g - create a new empty GPT partition table

p - create a primary partition
+128M (size)

t - change type
1 - EFI system

p - create primary partition
fill rest of disk

vgcreate vg-uefi-boot /dev/sdb2

lvcreate -L 128M -n boot vg-uefi-boot

lvcreate -l 100%FREE -n root vg-uefi-boot

mke2fs -j /dev/mapper/vg--uefi--boot-boot

mke2fs -j /dev/mapper/vg--uefi--boot-root

mkdosfs /dev/sdb1

mount /dev/vg-uefi-boot/root /mnt/image/

debootstrap --variant=minbase stretch /mnt/image ftp://einstein/debian/

mount -o bind /proc /mnt/image/proc
mount -o bind /dev /mnt/image/dev
mount -o bind /sys /mnt/image/sys

chroot /mnt/image /etc/kernel-img.conf

apt-get update
apt-get -y upgrade

apt-get -y install sysvinit-core
apt-get -y install openssh-server
apt-get -y install ifupdown
apt-get -y install grub-efi-amd64
apt-get -y install mdadm
apt-get -y install lvm2
apt-get -y install linux-image-amd64

grub-install

mkdir /boot/efi/EFI/BOOT
cp /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/BOOT/bootx64.efi

update-grub

(update root password)

umount /boot/efi
umount /boot

EOF

umount /mnt/image/proc
umount /mnt/image/dev
umount /mnt/image/sys
umount /mnt/image/

vgchange -aln vg-uefi-boot

(Installed firmware-realtek)

mount /dev/vg-uefi-boot/root /mnt/image/
mount -o bind /proc /mnt/image/proc
mount -o bind /dev /mnt/image/dev
mount -o bind /sys /mnt/image/sys
chroot /mnt/image
mount -a

umount -a
exit

umount /mnt/image/proc
umount /mnt/image/dev
umount /mnt/image/sys
umount /mnt/image/
vgchange -aln vg-uefi-boot




Re: install Kernel and GRUB in chroot.

2024-02-01 Thread Marco Moock
Am 02.02.2024 um 01:46:06 Uhr schrieb Dmitry:

> 2. ==>BAM<== some how that binary knows the system partition.

That information is on the EFI partition, where the GRUB bootloader
binary also resides.

root@ryz:/boot/efi/EFI# cat /boot/efi/EFI/debian/grub.cfg
search.fs_uuid 5b8b669d-xyz root hd0,gpt2 #boot partition
set prefix=($root)'/grub'
configfile $prefix/grub.cfg
root@ryz:/boot/efi/EFI#

If that information is loaded, the kernel can be loaded from the boot
partition.


-- 
Gruß
Marco

Spam und Werbung bitte an ichschickerekl...@cartoonies.org



Re: install Kernel and GRUB in chroot.

2024-02-01 Thread Dmitry

Hi Tim. The community is so kind.

So.

> I'm not exactly sure what you're doing.

Understand how GRUB works, to boot myself.

1. Trying to install Debian on the Flash.
2. Use it by the Debootstrap.
3. Now I want to boot using that Flash.

Looks like a caught the thread.

1. ESP is a partition that stores GRUB Binary. /boot/EFI/Name/grub64.eif
2. ==>BAM<== some how that binary knows the system partition.
3. At the system partition there is a /boot/grub/grub.cfg
4. And at that /boot/grub/grub.cfg is UUID and etc. to start Booting.

But the question is on the step 2. /boot/EFI/Name/grub64.efi knows where
to start /boot/grub/grub.cfg that resides at the absolutely different partition.

Interesting.
But the question already asked. Now it possible to find the answer.

Thank you!



Re: install Kernel and GRUB in chroot.

2024-02-01 Thread Marco Moock
Am 02.02.2024 um 00:09:56 Uhr schrieb Dmitry:

> I made experiments with a FlashDrive, and create GPT there,
> if I want to use standard Debian Image how I should partition that
> flash drive (MBR, GPT)?

Do you want to install the OS on it?
For the partition table, I recommend GPT.

Do you want an encrypted system?

>  > Do you need a special configuration here or is the default just
>  > fine?  
> 
> Need just working one. But I am confusing about how GRUB would get a
> plenty of things related to filesystem, kernel location and so on.

That is being done be the installer. If you don't need special
configuration, use the install process. It does everything for you.

-- 
Gruß
Marco

Spam und Werbung bitte an ichschickerekl...@cartoonies.org



Re: install Kernel and GRUB in chroot.

2024-02-01 Thread Dmitry

Huge thanks.
Your message starts the understanding.
And as well give a plenty of texts to read.

> EFI/debian/grub.cfg on the EFI System Partition contains filesystem UUID 
where grub files reside.


All parts are simple But when compounding them together become messy.

In the Manjaro:
/boot/EFI/Majaro/grub64x.efi - binary to start by UEFI.
/boot/grub/grub.cfg - shell (?) script with configurations.
/boot/vimlinuz.* - the kernel.

And if call a `lsblk`.
Only a /boot/efi with a binary is a separate partiton.

Things become more clear.



Re: install Kernel and GRUB in chroot.

2024-02-01 Thread Tim Woodall

On Thu, 1 Feb 2024, Dmitry wrote:


Greetings!

After:
1. Creating GPT table and GPT partition with fdisk.
2. Copy data with a debootstrap.
3. Chroot into newly creating system.

I need to prepare that system for booting.
1. Install Kernel.
2. Install GRUB and Configure.
3. Add changes to UEFI to start booting.

And at the point two (Install GRUB) I a little bit confused.

1. Need to create ESP, and put GRUB there.
2. Need to configure GRUB to select appropriate kernel and ramdisk.


I'm not exactly sure what you're doing. But the "trick" to doing most of
this in a chroot is to bind mount /dev, /proc, /sys and /run into the
chroot.

Then things like installing the kernel, building the initrd etc
(usually) just work.

"Add changes to UEFI to start booting" depends on the actual hardware
that will boot. If you're preparing images on one system to boot on
another then that bit you'll have to solve by booting the hardware.

I'd probably pick a live distro but it's theoretically[1] possible to
generate your own bootx64.efi that will then boot your system. Once it's
booted you can then use the normal tools to replace it with a more
easily maintained debian solution.

[1] Not just theoretical, I've actually done it once long ago.



Re: install Kernel and GRUB in chroot.

2024-02-01 Thread Dmitry

> Why don't you use the normal setup?

Spend a lot of time on research, it would be nice to finish.

I made experiments with a FlashDrive, and create GPT there,
if I want to use standard Debian Image how I should partition that
flash drive (MBR, GPT)?

> Do you need a special configuration here or is the default just fine?

Need just working one. But I am confusing about how GRUB would get a
plenty of things related to filesystem, kernel location and so on.

> If you create a separate boot partition (do you really need it?), it
must be mounted at /boot.

Here where the mess starts. How GRUB and Kernel would get information about
all this mounting points during the Boot.



Re: install Kernel and GRUB in chroot.

2024-02-01 Thread Max Nikulin

On 01/02/2024 22:54, Marco Moock wrote:

Am 01.02.2024 schrieb Dmitry:

Use gdisk for that.
You can create an EFI partition there.
Choose Type EFI (EF00), 100MB.
Format it with FAT32.


550MiB is recommended in "Preparing your ESP"
http://www.rodsbooks.com/linux-uefi/#installing
see also
https://www.rodsbooks.com/gdisk/advice.html#esp_sizing
https://fedoraproject.org/wiki/Changes/BiggerESP


2. Need to configure GRUB to select appropriate kernel and ramdisk.


Do you need a special configuration here or is the default just fine?


EFI/debian/grub.cfg on the EFI System Partition contains filesystem UUID 
where grub files reside.


After installing grub check that NVRAM has an appropriate entry

efibootmgr -v


How GRUB would understand where to be install and where is the kernel?


It loads files from filesystem on the specified partition. Unlike for 
BIOS device blocks are not involved.





Re: install Kernel and GRUB in chroot.

2024-02-01 Thread Marco Moock
Am 01.02.2024 schrieb Dmitry :

Why don't you use the normal setup?
It does many tasks for you.

> After:
> 1. Creating GPT table and GPT partition with fdisk.

Use gdisk for that.
You can create an EFI partition there.
Choose Type EFI (EF00), 100MB.
Format it with FAT32.

> And at the point two (Install GRUB) I a little bit confused.
> 
> 1. Need to create ESP

Do that before the install with gdisk.

> and put GRUB there.

That is done automatically if it is mounted at /boot/efi.

> 2. Need to configure GRUB to select appropriate kernel and ramdisk.

Do you need a special configuration here or is the default just fine?

> How to create a ESP partition and mount it to /boot?

That must be mounted to /boot/efi.

If you create a separate boot partition (do you really need it?), it
must be mounted at /boot.

> How GRUB would understand where to be install and where is the kernel?

It chooses by the path.
grub-install is the command, no device as parameter.