stages/grub2: make booting in ro/rw mode configurable

Move the decision whether the root fs should be mounted ro or rw
into the pipeline configuration.

Update the pipelines accordingly.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2019-08-24 23:20:02 +02:00 committed by Lars Karlitski
parent 17d562e75f
commit 5854ceea42
3 changed files with 21 additions and 5 deletions

View file

@ -33,15 +33,30 @@
} }
}, },
{ {
"name": "org.osbuild.selinux", "name": "org.osbuild.fstab",
"options": { "options": {
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts" "filesystems": [
{
"uuid": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",
"vfs_type": "ext4",
"path": "/",
"freq": "1",
"passno": "1"
}
]
} }
}, },
{ {
"name": "org.osbuild.grub2", "name": "org.osbuild.grub2",
"options": { "options": {
"root_fs_uuid": "76a22bf4-f153-4541-b6c7-0332c0dfaeac" "root_fs_uuid": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",
"kernel_opts": "ro biosdevname=0 net.ifnames=0 console=ttyS0,115200"
}
},
{
"name": "org.osbuild.selinux",
"options": {
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts"
} }
}, },
{ {

View file

@ -20,7 +20,7 @@ def main(tree, options):
env.write("# GRUB Environment Block\n" env.write("# GRUB Environment Block\n"
f"GRUB2_ROOT_FS_UUID={root_fs_uuid}\n" f"GRUB2_ROOT_FS_UUID={root_fs_uuid}\n"
f"GRUB2_BOOT_FS_UUID={root_fs_uuid}\n" f"GRUB2_BOOT_FS_UUID={root_fs_uuid}\n"
f"kernelopts=root=UUID={root_fs_uuid} rw {kernel_opts}\n") f"kernelopts=root=UUID={root_fs_uuid} {kernel_opts}\n")
with open(f"{tree}/boot/grub2/grub.cfg", "w") as cfg: with open(f"{tree}/boot/grub2/grub.cfg", "w") as cfg:
cfg.write("set timeout=0\n" cfg.write("set timeout=0\n"
"load_env\n" "load_env\n"

View file

@ -46,7 +46,8 @@
{ {
"name": "org.osbuild.grub2", "name": "org.osbuild.grub2",
"options": { "options": {
"root_fs_uuid": "76a22bf4-f153-4541-b6c7-0332c0dfaeac" "root_fs_uuid": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",
"kernel_opts": "rw"
} }
} }
], ],