Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

disk_util: add support for experimental nspawn booting #411

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions build_library/disk_layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@
"blocks":"12943360"
}
},
"nspawn":{
"9":{
"label":"ROOT",
"type":"4f68bce3-e8cd-4db1-96e7-fbcaf984b709",
"blocks":"12943360"
}
},
"azure":{
"9":{
"label":"ROOT",
Expand Down
6 changes: 6 additions & 0 deletions build_library/disk_util
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,12 @@ def Tune2fsReadWrite(options, partition, disable_rw):
image.seek(partition['first_byte'] + flag_offset)
image.write(chr(flag_value))

# bit 60 is 'read-only', TODO: support this in cgpt
# http://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/
attr_cmd = "set" if disable_rw else "clear"
attr_arg = "--attributes=%s:%s:60" % (partition['num'], attr_cmd)
subprocess.check_call(['sgdisk', attr_arg, options.disk_image])


def IsE2fsReadWrite(options, partition):
"""Returns True if FS is read-write, False if hack is active.
Expand Down
4 changes: 4 additions & 0 deletions build_library/vm_image_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ VALID_IMG_TYPES=(
secure_demo
niftycloud
cloudsigma
nspawn
)

#list of oem package names, minus the oem- prefix
Expand Down Expand Up @@ -108,6 +109,9 @@ IMG_DEFAULT_BUNDLE_FORMAT=
# Memory size to use in any config files
IMG_DEFAULT_MEM=1024

## systemd-nspawn
IMG_nspawn_DISK_LAYOUT=nspawn

## qemu
IMG_qemu_DISK_FORMAT=qcow2
IMG_qemu_DISK_LAYOUT=vm
Expand Down