You are not logged in.

#1 2023-03-13 14:01:18

pmb
Member
Registered: 2023-03-13
Posts: 4

[SOLVED] Avoid vmlinuz, initramfs, intel-ucode to be copied in ESP

Hi all,
I would like to know how I can avoid for files vmlinuz-linux, initramfs.img and intel-ucode.img to be copied in ESP partition every time that I boot the system.

I use UEFI with Grub.
ESP partition: /boot/efi

 >> sudo fdisk -l /dev/nvme0n1
...               
Disklabel type: gpt
Disk identifier: 34A1E904-5329-4F75-A815-E200F06E5FC9
...
Device             Start        End    Sectors   Size Type
/dev/nvme0n1p1      2048      77823      75776    37M EFI System
... 
 >> file -s /dev/nvme0n1p1
/dev/nvme0n1p1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "mkfs.fat", Media descriptor 0xf8, sectors/track 32, heads 64, hidden sectors 2048, sectors 75776 (volumes > 32 MB), FAT (32 bit), sectors/FAT 583, reserved 0x1, serial number 0x4d576315, unlabeled
 >> cat /boot/grub/grub.cfg
...
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-6a9fdaed-17b3-4af4-be85-1880da7d5d17' {
	recordfail
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	search --no-floppy --fs-uuid --set=root 6a9fdaed-17b3-4af4-be85-1880da7d5d17
	linux	/boot/vmlinuz-linux-lts root=UUID=6a9fdaed-17b3-4af4-be85-1880da7d5d17 rw  quiet loglevel=3 vt.global_cursor_default=0 rd.systemd.show_status=false rd.udev.log-priority=3 sysrq_always_enabled=1 nowatchdog resume=/dev/nvme0n1p2 resume_offset=10823680
	initrd  /boot/intel-ucode.img /boot/intel-ucode.img /boot/initramfs-linux-lts.img}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-6a9fdaed-17b3-4af4-be85-1880da7d5d17' {
	menuentry 'Arch Linux, with Linux linux-lts' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-lts-advanced-6a9fdaed-17b3-4af4-be85-1880da7d5d17' {
		recordfail
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod ext2
		search --no-floppy --fs-uuid --set=root 6a9fdaed-17b3-4af4-be85-1880da7d5d17
		echo	'Loading Linux linux-lts ...'
		linux	/boot/vmlinuz-linux-lts root=UUID=6a9fdaed-17b3-4af4-be85-1880da7d5d17 rw  quiet loglevel=3 vt.global_cursor_default=0 rd.systemd.show_status=false rd.udev.log-priority=3 sysrq_always_enabled=1 nowatchdog resume=/dev/nvme0n1p2 resume_offset=10823680
	 echo     'Loading initial ramdisk ...'
		initrd  /boot/intel-ucode.img /boot/intel-ucode.img /boot/initramfs-linux-lts.img	}
	menuentry 'Arch Linux, with Linux linux-lts (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-lts-fallback-6a9fdaed-17b3-4af4-be85-1880da7d5d17' {
		recordfail
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod ext2
		search --no-floppy --fs-uuid --set=root 6a9fdaed-17b3-4af4-be85-1880da7d5d17
		echo	'Loading Linux linux-lts ...'
		linux	/boot/vmlinuz-linux-lts root=UUID=6a9fdaed-17b3-4af4-be85-1880da7d5d17 rw  quiet loglevel=3 vt.global_cursor_default=0 rd.systemd.show_status=false rd.udev.log-priority=3 sysrq_always_enabled=1 nowatchdog resume=/dev/nvme0n1p2 resume_offset=10823680
	 echo     'Loading initial ramdisk ...'
		initrd  /boot/intel-ucode.img /boot/initramfs-linux-lts-fallback.img	}
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-6a9fdaed-17b3-4af4-be85-1880da7d5d17' {
		recordfail
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod ext2
		search --no-floppy --fs-uuid --set=root 6a9fdaed-17b3-4af4-be85-1880da7d5d17
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=6a9fdaed-17b3-4af4-be85-1880da7d5d17 rw  quiet loglevel=3 vt.global_cursor_default=0 rd.systemd.show_status=false rd.udev.log-priority=3 sysrq_always_enabled=1 nowatchdog resume=/dev/nvme0n1p2 resume_offset=10823680
	 echo     'Loading initial ramdisk ...'
		initrd  /boot/intel-ucode.img /boot/intel-ucode.img /boot/initramfs-linux.img	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-6a9fdaed-17b3-4af4-be85-1880da7d5d17' {
		recordfail
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod ext2
		search --no-floppy --fs-uuid --set=root 6a9fdaed-17b3-4af4-be85-1880da7d5d17
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=6a9fdaed-17b3-4af4-be85-1880da7d5d17 rw  quiet loglevel=3 vt.global_cursor_default=0 rd.systemd.show_status=false rd.udev.log-priority=3 sysrq_always_enabled=1 nowatchdog resume=/dev/nvme0n1p2 resume_offset=10823680
	 echo     'Loading initial ramdisk ...'
		initrd  /boot/intel-ucode.img /boot/initramfs-linux-fallback.img	}
...
}
 >> cat /etc/default/grub
# GRUB boot loader configuration

#GRUB_DEFAULT=0
GRUB_DEFAULT=gnulinux-linux-lts-advanced-6a9fdaed-17b3-4af4-be85-1880da7d5d17

GRUB_TIMEOUT=0
GRUB_RECORDFAIL_TIMEOUT=$GRUB_TIMEOUT
GRUB_DISTRIBUTOR="Arch"

#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vt.global_cursor_default=0 loglevel=3 rd.systemd.show_status=false rd.udev.log-priority=3 sysrq_always_enabled=1 nowatchdog"
#GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 vt.global_cursor_default=0 rd.systemd.show_status=false rd.udev.log-priority=3 sysrq_always_enabled=1 nowatchdog resume=/dev/nvme0n1p2 resume_offset=10823680"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=true

# Uncomment to enable Hidden Menu, and optionally hide the timeout count
#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to make GRUB remember the last selection. This requires to
# set 'GRUB_DEFAULT=saved' above.
#GRUB_SAVEDEFAULT="true"

I have another computer where I don't have this problem, that is, the files are not copied in ESP partition.
It has the same, as far as, I know. UEFI boot, GPT partition table, Grub, ESP (/boot/efi).

Please, could you help me where to look?
I don't know how to continue to investigate this issue.

Your feedback will be very welcome.

Last edited by pmb (2023-03-13 16:57:10)

Offline

#2 2023-03-13 14:13:03

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,255

Re: [SOLVED] Avoid vmlinuz, initramfs, intel-ucode to be copied in ESP

This will be something you've setup somewhere, by default all of these packages simply install into /boot and it's your decision whether that's a mount point to the ESP or a simple directory on your root partition.  How sure are you that your ESP is actually mounted to /boot/efi and not to /boot directly? What are the outputs of

mount
lsblk -f

Offline

#3 2023-03-13 14:27:56

pmb
Member
Registered: 2023-03-13
Posts: 4

Re: [SOLVED] Avoid vmlinuz, initramfs, intel-ucode to be copied in ESP

Thanks for your feedback V1del.

See the output.

 >> findmnt --real
TARGET      SOURCE         FSTYPE OPTIONS
/           /dev/nvme0n1p2 ext4   rw,relatime
├─/home     /dev/nvme0n1p3 ext4   rw,relatime
└─/boot/efi /dev/nvme0n1p1 vfat   rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro
 >> lsblk -f      
NAME        FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
nvme0n1                                                                            
├─nvme0n1p1 vfat   FAT32       4D57-6315                               2.7M    93% /boot/efi
├─nvme0n1p2 ext4   1.0         6a9fdaed-17b3-4af4-be85-1880da7d5d17   38.4G    29% /
└─nvme0n1p3 ext4   1.0         9a5bb5a7-656d-44c9-9a14-b3be7f760a92  570.4G    28% /home
 >> efibootmgr   
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000
Boot0000* GRUB  HD(1,GPT,c7e1d6a6-aeff-47a0-8a28-1c113c865d0f,0x800,0x12800)/File(\EFI\GRUB\GRUBX64.EFI)
 >> vifm
 [tree] @ /boot/efi                                                                                                                                           
  ..                                                                                                                                  10  01/01/1970 01:00  
   EFI/                                                                                                                                 1  13/03/2023 09:13  
  `--  GRUB/                                                                                                                            1  08/01/2021 09:31  
      `--  grubx64.efi                                                                                                              136 K  13/03/2023 10:03  
   initramfs-linux.img                                                                                                               15 M  13/03/2023 10:05  
   intel-ucode.img                                                                                                                  6.8 M  13/03/2023 10:05  
   vmlinuz-linux                                                                                                                     12 M  13/03/2023 10:05  

Offline

#4 2023-03-13 14:44:00

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,255

Re: [SOLVED] Avoid vmlinuz, initramfs, intel-ucode to be copied in ESP

Any custom presets in /etc/mkinitcpio.d/ ? A custom libalpm script that explicitly copies them to /boot/efi from /boot ? Are you building unified/signed kernel images? Are you using sbctl ?

Offline

#5 2023-03-13 15:55:48

pmb
Member
Registered: 2023-03-13
Posts: 4

Re: [SOLVED] Avoid vmlinuz, initramfs, intel-ucode to be copied in ESP

No custom presets in /etc/mkinitcpio.d
No custom libalpm script. (I don't know how to create a custom libalpm script).
I am not building unified/signed kernel images. I used

pacman -S linux linux-lts

I am not using sbctl. I am not using Secure Boot.

Offline

#6 2023-03-13 15:59:10

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,727

Re: [SOLVED] Avoid vmlinuz, initramfs, intel-ucode to be copied in ESP

You said it happens ever time you boot the system? Not just when you install the packages? If so, what does `tree /etc/systemd/` show?

Online

#7 2023-03-13 16:19:12

pmb
Member
Registered: 2023-03-13
Posts: 4

Re: [SOLVED] Avoid vmlinuz, initramfs, intel-ucode to be copied in ESP

The issue is resolved.
V1del and Scimmia thanks a lot for your support.

In the past, I tried to setup "systemd-boot", but I never used it.
Before posting, I "clean up" all files created during this setup, but I forgot to disable a custom systemd service that I created to copy the files to /boo/efi.

My apologies for such obvious mistake from my side. Checking how to change title to add [Resolved].

Offline

Board footer

Powered by FluxBB