Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mkimage-profiles
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
mkimage-profiles
Commits
1f066d54
Commit
1f066d54
authored
Nov 24, 2022
by
Anton Midyukov
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
efi: add workaround for p10 branch to fix booting from a flash drive
parent
5ab5e016
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
0 deletions
+69
-0
config.mk
features.in/efi/config.mk
+3
-0
50-efiboot-img
features.in/efi/stage1/scripts.d/50-efiboot-img
+66
-0
No files found.
features.in/efi/config.mk
View file @
1f066d54
...
...
@@ -35,6 +35,9 @@ use/efi/signed: use/efi
@$(call add,COMMON_PACKAGES,shim-signed)
@$(call add,COMMON_PACKAGES,mokutil pesign)
@$(call add,RESCUE_PACKAGES,openssl)
ifeq (p10,$(BRANCH))
@$(call add,STAGE1_PACKAGES,shim-signed-installer-kludge grub-efi alt-uefi-certs dosfstools mtools)
endif
use/efi/lilo: use/efi use/bootloader/lilo
@$(call set,EFI_BOOTLOADER,elilo)
...
...
features.in/efi/stage1/scripts.d/50-efiboot-img
0 → 100755
View file @
1f066d54
#!/bin/sh -efu
# This is a workaround to fix booting from a flash drive on some UEFIs.
# Create .efiboot.img in STAGE1 with old shim, wich without problem.
# This code from mkimage/tools/mki-copy-efiboot-chrooted.
shim_dir
=
/usr/lib/shim-installer-kludge
grub64
=
/usr/lib64/efi/grubx64.efi
grub32
=
/usr/lib64/efi/grubia32.efi
img
=
.efiboot.img
[
-d
"
$shim_dir
"
]
||
exit
0
[
-s
"
$grub64
"
]
||
exit
1
[
-s
"
$grub32
"
]
||
exit
1
cd
/.image
mkdir
-p
EFI/BOOT
# copy shim
cp
-pLf
$shim_dir
/shimx64.efi EFI/BOOT/bootx64.efi
cp
-pLf
$shim_dir
/shimia32.efi EFI/BOOT/bootia32.efi
cp
-pLf
$shim_dir
/mmx64.efi EFI/BOOT/
cp
-pLf
$shim_dir
/mmia32.efi EFI/BOOT/
# copy grub
cp
-pLf
$grub64
EFI/BOOT/
cp
-pLf
$grub32
EFI/BOOT/
# copy cert
mkdir
-p
EFI/enroll
cp
/etc/pki/uefi/altlinux.cer EFI/enroll/
# add_grub_cfg
{
cat
<<-
GRUB_EOF
search --file --set=root /.disk/info
set prefix=(\
$root
)/boot/grub
source \
$prefix
/grub.cfg
GRUB_EOF
}
>
"EFI/BOOT/grub.cfg"
# write efiboot img
imgsize
=
"
$((
$(
du
-lsB32k
EFI |
cut
-f1
)
+
10
))
"
dd
if
=
/dev/zero
of
=
"
$img
"
bs
=
32k
count
=
"
$imgsize
"
# dosfstools-4.0 has dropped those ancient symlinks, *sigh*
mkfs
=
for
bin
in
mkfs.fat mkfs.vfat
;
do
if
$bin
--help
>
/dev/null 2>&1
;
then
mkfs
=
"
$bin
"
break
fi
done
[
-n
"
$mkfs
"
]
||
exit
1
$mkfs
-n
"El Torito"
$img
# mtools insists that total number of sectors
# is a multiple of sectors per track (the infamous 63),
# and dosfstools-4.0 doesn't follow that anymore
echo
"mtools_skip_check=1"
>
~/.mtoolsrc
mcopy
-i
"
$img
"
-s
"EFI"
::
mv
"
$img
"
EFI/
Roman Alifanov
@ximper
mentioned in commit
b85017a6
·
Jun 14, 2023
mentioned in commit
b85017a6
mentioned in commit b85017a6ed2f663258f29fb864c7929359254641
Toggle commit list
Roman Alifanov
@ximper
mentioned in commit
544f92ee
·
Jul 25, 2023
mentioned in commit
544f92ee
mentioned in commit 544f92ee907f71259b70a04a243321db7ac0500b
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment