grub2.inst: Add support for creating iso9660 boot image
Don't include the "location" offset, and use just a path for the prefix
section to set the path of the grub2 modules on the iso. eg.
{
"filename": "eltorito.img",
"platform": "i386-pc",
"core": {
"type": "mkimage",
"partlabel": "gpt",
"filesystem": "iso9660"
},
"prefix": {
"path": "/boot/grub2/"
}
}
This commit is contained in:
parent
41c0550a1f
commit
3bed7c7ace
3 changed files with 70 additions and 17 deletions
|
|
@ -31,3 +31,22 @@ def test_grub2_partition(tmp_path, stage_module):
|
|||
with open(treedir / "disk.img", "rb") as f:
|
||||
msg = f.read(12)
|
||||
assert msg != b"Just testing"
|
||||
|
||||
def test_grub2_iso9660(tmp_path, stage_module):
|
||||
treedir = tmp_path / "tree"
|
||||
os.makedirs(treedir, exist_ok=True)
|
||||
|
||||
options = {
|
||||
"filename": "eltorito.img",
|
||||
"platform": "i386-pc",
|
||||
"core": {
|
||||
"type": "mkimage",
|
||||
"partlabel": "gpt",
|
||||
"filesystem": "iso9660",
|
||||
},
|
||||
"prefix": {
|
||||
"path": "/boot/grub2/",
|
||||
},
|
||||
}
|
||||
stage_module.main(treedir, options)
|
||||
assert os.path.exists(treedir / "eltorito.img")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue