From: Waldemar Kozaczuk <[email protected]>
Committer: Waldemar Kozaczuk <[email protected]>
Branch: master

scripts: use common binary partition header file to build disk images

The scripts/build accepts the '--create-disk' option to allow
creating disk images (disk.img) intended to be used when booting
OSv in direct kernel mode (-k option to run.py). Currently
the build script uses `build/last/boot.bin` as a partition table disk header.
Even though the end result is working, boot.bin contains unnecessary code
from arch/x64/boot16.S and more importantly is not present in aarch64 build.

So this patch adds tiny 512-bytes partition table template file (510 zeros 
followed by 0xaa, 0x55)
which is then used as a disk image header when creating a ROFS or ZFS disk.

Signed-off-by: Waldemar Kozaczuk <[email protected]>

---
diff --git a/scripts/build b/scripts/build
--- a/scripts/build
+++ b/scripts/build
@@ -266,7 +266,7 @@ fi
 
 if [[ ${vars[create_disk]} == "true" ]]; then
        partition_offset=512
-       bare=boot.bin
+       bare="$SRC"/scripts/disk.bin
        raw_disk=disk
        qcow2_disk=disk
        upload_kernel_mode="-k"
diff --git a/scripts/disk.bin b/scripts/disk.bin
--- a/scripts/disk.bin
+++ b/scripts/disk.bin
null

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/000000000000a1ab8005a9d1242a%40google.com.

Reply via email to