diff options
author | aqua <aqua@iserlohn-fortress.net> | 2022-03-28 20:03:38 +0300 |
---|---|---|
committer | aqua <aqua@iserlohn-fortress.net> | 2022-08-12 10:13:59 +0300 |
commit | edf9e71e2a7b6b89775c29cf28c19c6b89992c25 (patch) | |
tree | 3adbf944d9e47a743063487c4facb7eed1fbdee0 /scripts | |
download | kernel-edf9e71e2a7b6b89775c29cf28c19c6b89992c25.tar.xz |
Initial commit
x86 kernel that prints a hello world message to com1
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/mkiso.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/mkiso.py b/scripts/mkiso.py new file mode 100755 index 0000000..b1f1dc5 --- /dev/null +++ b/scripts/mkiso.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +import argparse +from os import makedirs as mkpath +from shutil import copy +from subprocess import run + +def main(): + parser = argparse.ArgumentParser(description='Build a bootable CD-ROM image using grub-mkrescue') + parser.add_argument('kernel', metavar='zcore', type=str, help='path to kernel') + parser.add_argument('grub', metavar='grub.cfg', type=str, help='path to grub.cfg') + parser.add_argument('mkrescue_args', metavar='MKRESCUE_ARGS', type=str, nargs='*', help='Additional arguments passed to grub-mkrescue') + parser.add_argument('--cache', type=str, default='isodir', help='isodir') + parser.add_argument('-o', '--output', type=str, default='glitch.iso', help='glitch.iso') + + args = parser.parse_args() + + mkpath('isodir/boot/grub', exist_ok=True) + copy(args.grub, 'isodir/boot/grub/grub.cfg') + mkpath('isodir/boot/glitch', exist_ok=True) + copy(args.kernel, 'isodir/boot/glitch/glitch.elf') + + run(['grub-mkrescue', '-o', args.output, args.cache] + args.mkrescue_args) + +if __name__ == "__main__": + main() + |