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
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Anton Palgunov
mkimage-profiles
Commits
265b5e6f
Commit
265b5e6f
authored
Jul 18, 2023
by
Anton Midyukov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tar2fs: install grub-pc for x86_64 with UEFI
Both UEFI and Legacy BIOS are supported on x86_64 machines. Now the image x86_64 will be bootloaded on both.
parent
4ed779d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
tar2fs
bin/tar2fs
+19
-6
No files found.
bin/tar2fs
View file @
265b5e6f
...
...
@@ -77,7 +77,12 @@ if [ "$BOOTLOADER" == grub-efi -o "$BOOTTYPE" == EFI ]; then
EFIPART
=
"1"
EFIPARTSIZEM
=
"256"
EFIPARTFSTYPE
=
"fat"
ROOTPART
=
"2"
if
[
"
$ARCH
"
=
x86_64
]
;
then
BIOSPART
=
"2"
ROOTPART
=
"3"
else
ROOTPART
=
"2"
fi
fi
# tested to work: ext[234], jfs
...
...
@@ -217,7 +222,7 @@ trap exit_handler EXIT ERR
# prepare disk image and a filesystem inside it
rm
-f
--
"
$IMG
"
OFFSET
=
"
$((
$CUR_BOUNDARY
+
$EFIPARTSIZEM
+
$BOOTLOADERPARTSIZEM
+
$BOOTSIZEM
+
$ROOTSIZEM
-
1
))
"
OFFSET
=
"
$((
$CUR_BOUNDARY
+
$EFIPARTSIZEM
+
$BOOTLOADERPARTSIZEM
+
$BOOTSIZEM
+
$
{
BIOSPART
:+1
}
+
$
ROOTSIZEM
-
1
))
"
dd
if
=
/dev/zero
of
=
"
$IMG
"
conv
=
notrunc
bs
=
$MB
count
=
1
seek
=
"
$OFFSET
"
losetup
-f
"
$IMG
"
LOOPDEV
=
$(
losetup
-j
"
$IMG
"
|
cut
-f
1
-d
':'
)
...
...
@@ -249,6 +254,12 @@ if [ -n "$EFIPART" ]; then
fi
fi
if
[
-n
"
$BIOSPART
"
]
;
then
parting mkpart bios
$((
CUR_BOUNDARY+1
))
MiB
$((
$CUR_BOUNDARY
+
2
))
MiB
CUR_BOUNDARY
=
"
$((
$CUR_BOUNDARY
+
1
))
"
parting
set
"
$BIOSPART
"
bios on
fi
if
[
-n
"
$BOOTPART
"
]
;
then
BOOTDEV
=
"
$BLOCKDEV$BOOTPART
"
mkpart
"
$BOOTSIZEM
"
...
...
@@ -447,8 +458,10 @@ grub-efi)
--removable
--uefi-secure-boot
chroot
"
$ROOTFS
"
grub-install
--target
=
x86_64-efi
--recheck
\
--removable
--uefi-secure-boot
sed
-i
's/initrd16/initrdefi/g'
"
$ROOTFS
/boot/grub/grub.cfg"
sed
-i
's/linux16/linuxefi/g'
"
$ROOTFS
/boot/grub/grub.cfg"
sed
-i
's/initrd16/initrd/g'
"
$ROOTFS
/boot/grub/grub.cfg"
sed
-i
's/linux16/linux/g'
"
$ROOTFS
/boot/grub/grub.cfg"
[
-n
"
$BIOSPART
"
]
&&
chroot
"
$ROOTFS
"
grub-install
--target
=
i386-pc
"
$LOOPDEV
"
;;
aarch64
)
chroot
"
$ROOTFS
"
grub-install
--target
=
arm64-efi
--recheck
\
...
...
@@ -477,8 +490,8 @@ grub)
case
"
$ARCH
"
in
*
86
*
)
chroot
"
$ROOTFS
"
grub-install
--target
=
i386-pc
"
$LOOPDEV
"
sed
-i
's/initrdefi/initrd
16
/g'
"
$ROOTFS
/boot/grub/grub.cfg"
sed
-i
's/linuxefi/linux
16
/g'
"
$ROOTFS
/boot/grub/grub.cfg"
sed
-i
's/initrdefi/initrd/g'
"
$ROOTFS
/boot/grub/grub.cfg"
sed
-i
's/linuxefi/linux/g'
"
$ROOTFS
/boot/grub/grub.cfg"
;;
ppc
*
)
[
-z
"
$LOOPBOOTLOADER
"
]
||
...
...
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