Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pmbootstrap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aster Boese
pmbootstrap
Commits
1c4e81ae
Commit
1c4e81ae
authored
6 months ago
by
Aster Boese
Browse files
Options
Downloads
Patches
Plain Diff
pmb.install: switch to gpt with discoverable partitions
parent
ad58e4a5
No related branches found
No related tags found
No related merge requests found
Pipeline
#208096
passed
6 months ago
Stage: lint
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pmb/install/partition.py
+14
-11
14 additions, 11 deletions
pmb/install/partition.py
with
14 additions
and
11 deletions
pmb/install/partition.py
+
14
−
11
View file @
1c4e81ae
...
...
@@ -8,6 +8,7 @@ import pmb.chroot
import
pmb.config
import
pmb.install.losetup
from
pmb.core
import
Chroot
import
pmb.core.dps
# FIXME (#2324): this function drops disk to a string because it's easier
...
...
@@ -91,7 +92,7 @@ def partition(layout, size_boot, size_reserve):
# will stop there (see #463).
boot_part_start
=
pmb
.
parse
.
deviceinfo
().
boot_part_start
or
"
2048
"
partition_type
=
pmb
.
parse
.
deviceinfo
().
partition_type
or
"
msdos
"
partition_type
=
pmb
.
parse
.
deviceinfo
().
partition_type
or
"
gpt
"
commands
=
[
[
"
mktable
"
,
partition_type
],
...
...
@@ -102,19 +103,20 @@ def partition(layout, size_boot, size_reserve):
mb_reserved_end
=
f
"
{
round
(
size_reserve
+
size_boot
)
}
M
"
commands
+=
[[
"
mkpart
"
,
"
primary
"
,
mb_boot
,
mb_reserved_end
]]
arch
=
str
(
pmb
.
parse
.
deviceinfo
().
arch
)
commands
+=
[
[
"
mkpart
"
,
"
primary
"
,
mb_root_start
,
"
100%
"
],
[
"
set
"
,
str
(
layout
[
"
boot
"
]),
"
boot
"
,
"
on
"
],
[
"
type
"
,
str
(
layout
[
"
root
"
]),
pmb
.
core
.
dps
.
root
[
arch
][
1
]],
# esp is an alias for boot on GPT
# setting this should be fine for msdos since we set boot later
[
"
set
"
,
str
(
layout
[
"
boot
"
]),
"
esp
"
,
"
on
"
],
[
"
type
"
,
str
(
layout
[
"
boot
"
]),
pmb
.
core
.
dps
.
boot
[
"
esp
"
][
1
]],
]
# Not strictly necessary if the device doesn't use EFI boot, but marking
# it as an ESP will cover all situations where the device does use EFI
# boot. Marking it as ESP is helpful for EFI fw when it's looking for EFI
# system partitions. It's assumed that setting this bit is unlikely to
# cause problems for other situations, like when using Legacy BIOS boot
# or u-boot.
if
partition_type
.
lower
()
==
"
gpt
"
:
commands
+=
[[
"
set
"
,
str
(
layout
[
"
boot
"
]),
"
esp
"
,
"
on
"
]]
# Some devices still use MBR and will not work with only esp set
if
partition_type
.
lower
()
==
"
msdos
"
:
commands
+=
[[
"
set
"
,
str
(
layout
[
"
boot
"
]),
"
boot
"
,
"
on
"
]]
for
command
in
commands
:
pmb
.
chroot
.
root
([
"
parted
"
,
"
-s
"
,
"
/dev/install
"
]
+
command
,
check
=
False
)
...
...
@@ -123,7 +125,8 @@ def partition(layout, size_boot, size_reserve):
def
partition_cgpt
(
layout
,
size_boot
,
size_reserve
):
"""
This function does similar functionality to partition(), but this
one is for ChromeOS devices which use special GPT.
one is for ChromeOS devices which use special GPT. We don
'
t follow
the Discoverable Partitions Specification here for that exact reason.
:param layout: partition layout from get_partition_layout()
:param size_boot: size of the boot partition in MiB
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment