From: Waldemar Kozaczuk <jwkoz...@gmail.com>
Committer: Waldemar Kozaczuk <jwkoz...@gmail.com>
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 <jwkoz...@gmail.com>
---
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 osv-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osv-dev/000000000000a1ab8005a9d1242a%40google.com.
On Tue, Jul 7, 2020 at 5:56 AM Commit Bot <b...@cloudius-systems.com> wrote:From: Waldemar Kozaczuk <jwkoz...@gmail.com>
Committer: Waldemar Kozaczuk <jwkoz...@gmail.com>
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.How did you determine this magic file needs to be exactly those bytes?Your actual file has 0x55 first and then 0xaa, and not the other way around as you said it.... Does that matter?