Added instructions for creating a linux UEFI boot stick

This commit is contained in:
root 2023-06-17 22:35:39 +02:00
parent 3be4375d6d
commit 497ca664da
16 changed files with 171 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,50 @@
set default="1"
function load_video {
insmod efi_gop
insmod efi_uga
insmod video_bochs
insmod video_cirrus
#
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
#
insmod all_video
}
load_video
set gfxpayload=keep
insmod gzio
#
insmod increment
insmod xfs
insmod part_gpt
insmod fat
insmod blscfg
#
insmod part_gpt
insmod ext2
set timeout=-1
search --no-floppy --set=root -l 'RESCUE'
menuentry 'Colibri' {
linuxefi /images/colibri/vmlinuz root=/dev/mapper/centos-root ro crashkernel=auto resume=/dev/mapper/centos-swap rd.lvm.lv=centos/root rd.luks.uuid=luks-0dd30579-2c04-422c-b6c6-3ab35d4c783f rd.lvm.lv=centos/swap rhgb quiet intel_iommu=on
initrdefi /images/colibri/initrd.img
}
menuentry 'Rocky' {
linuxefi /images/rocky/vmlinuz root=/dev/mapper/centos-rockyroot ro crashkernel=auto resume=/dev/mapper/centos-swap rd.lvm.lv=centos/rockyroot rd.luks.uuid=luks-0dd30579-2c04-422c-b6c6-3ab35d4c783f rd.lvm.lv=centos/swap rhgb quiet intel_iommu=on
initrdefi /images/rocky/initrd.img
}
menuentry 'buzzard' {
linuxefi /images/buzzard/vmlinuz root=/dev/mapper/centos-root ro rd.lvm.lv=centos/root rd.luks.uuid=luks-7a701398-14f8-428c-93c6-09e340beb118 rd.luks.options=discard rd.lvm.lv=centos/swap rhgb quiet LANG=en_US.UTF-8 nouveau.modeset=0 rd.driver.blacklist=nouveau
initrdefi /images/buzzard/initrd.img
}

View File

@ -0,0 +1,44 @@
set default="1"
function load_video {
insmod efi_gop
insmod efi_uga
insmod video_bochs
insmod video_cirrus
#
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
#
insmod all_video
}
load_video
set gfxpayload=keep
insmod gzio
#
insmod increment
insmod xfs
insmod part_gpt
insmod fat
insmod blscfg
#
insmod part_gpt
insmod ext2
set timeout=-1
search --no-floppy --set=root -l 'RESCUE'
menuentry 'Colibri' {
linuxefi /images/colibri/vmlinuz root=/dev/mapper/centos-root ro crashkernel=auto resume=/dev/mapper/centos-swap rd.lvm.lv=centos/root rd.luks.uuid=luks-0dd30579-2c04-422c-b6c6-3ab35d4c783f rd.lvm.lv=centos/swap rhgb quiet intel_iommu=on
initrdefi /images/colibri/initrd.img
}
menuentry 'Rocky' {
linuxefi /images/rocky/vmlinuz root=/dev/mapper/centos-rockyroot ro crashkernel=auto resume=/dev/mapper/centos-swap rd.lvm.lv=centos/rockyroot rd.luks.uuid=luks-0dd30579-2c04-422c-b6c6-3ab35d4c783f rd.lvm.lv=centos/swap rhgb quiet intel_iommu=on
initrdefi /images/rocky/initrd.img
}

Binary file not shown.

View File

@ -0,0 +1,68 @@
# Creating a bootable USB UEFI stick
## Identify the drive
Insert your USB stick and tail /var/log/message to find out the device name.
Then set the device name in a variable
```
DRIVE=/dev/sdc
```
## Initial formatting of the USB stick
This is a one-time operation. When updating the USB stick
this step can be skipped.
Formatting:
* gpt partition table
* primary partition of type ext2
* primary partition of type EFI (EF)
* label /dev/sdc1 as RESCUE
```
parted ${DRIVE}
```
Create partitions in parted:
```
mktable gpt
mkpart primary ext2 1 512MB
mkpart primary fat32 512MB 1024MB
set 2 boot on
```
Format the partitions:
```
mkfs.ext2 ${DRIVE}1 # this will contain the images.
mkfs.vfat ${DRIVE}2 # this will contain the UEFI bootloader and grub.cfg
e2label ${DRIVE}1 RESCUE
```
## Synchronize file to the USB stick
Sync images:
```
mount ${DRIVE}1 /mnt/tmp
mkdir -p /mnt/tmp/images
rsync -av images/ /mnt/tmp/images/
umount /mnt/tmp
```
Sync the grub configuration:
```
mount ${DRIVE}2 /mnt/tmp
mkdir -p /mnt/tmp/EFI
rsync -av EFI/ /mnt/tmp/EFI/
umount /mnt/tmp
```

View File

@ -0,0 +1,3 @@
* initramdisks are dummies since they can be large and may be a security risk
* * * * * * * * kernel images are also dummies to reduce the size

View File

@ -0,0 +1,4 @@
Symbolic links work too. This reduces maintenance since this allows you to use
initrd.img and vmlinuz as names in the grub.cfg, and only requires updating of
symlinks to move to another version.

View File

@ -0,0 +1 @@
initramfs-3.10.0-1160.80.1.el7.x86_64.img

View File

@ -0,0 +1 @@
vmlinuz-3.10.0-1160.80.1.el7.x86_64

View File