On Tue, Jul 7, 2020 at 5:56 AM Commit Bot <[email protected]> wrote:
> 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. > 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? By the way, you could have the script (or Makefile) create it with a command instead of having it pre-exist, for example: python -c 'import sys; sys.stdout.buffer.write(b"\0"*510+b"\x55\xaa")' To make it easier for somebody to later change these bytes - but I don't know if that would ever be needed. > 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 > . > -- 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/CANEVyju2ZVjsFPyNJqbbLDvg%3D_6k6y0vddjG0%3DhPTnfuAa2yZA%40mail.gmail.com.
