logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>
commit: c61b4afd8ad7a83ded3c236e60ed96ce656e79a1
parent 7a31257eaa439a4370b443385422dfa8aade192f
Author: Paul Dersey <pdersey@gmail.com>
Date:   Wed, 14 Jun 2023 13:23:24 -0400

Boot Fiwix and Linux without serial console on bare metal

Diffstat:

Mrootfs.py1+
Msysa/kexec-fiwix/kexec-fiwix.checksums2+-
Msysa/kexec-fiwix/src/kexec-fiwix.c11++++++++++-
3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/rootfs.py b/rootfs.py @@ -36,6 +36,7 @@ def create_configuration_file(args): config.write(f"UPDATE_CHECKSUMS={args.update_checksums}\n") config.write(f"JOBS={args.cores}\n") config.write(f"INTERNAL_CI={args.internal_ci}\n") + config.write(f"BARE_METAL={args.bare_metal}\n") if (args.bare_metal or args.qemu) and not args.kernel: config.write("DISK=sda\n") config.write("KERNEL_BOOTSTRAP=True\n") diff --git a/sysa/kexec-fiwix/kexec-fiwix.checksums b/sysa/kexec-fiwix/kexec-fiwix.checksums @@ -1 +1 @@ -4f78914aef30b569a531102998e52a0514d8836204d57ff42bf0a3324968f247 /usr/bin/kexec-fiwix +7c0d280b732b8dfe767cacefc0245698796d953083ab4bcccfcb77f6d4fc4828 /usr/bin/kexec-fiwix diff --git a/sysa/kexec-fiwix/src/kexec-fiwix.c b/sysa/kexec-fiwix/src/kexec-fiwix.c @@ -77,7 +77,16 @@ int main() { puts("Preparing multiboot info for kernel..."); char cmdline[256]; - sprintf(cmdline, "fiwix console=/dev/ttyS0 root=/dev/ram0 ramdisksize=%d initrd=sysa.ext2 kexec_proto=linux kexec_size=67000 kexec_cmdline=\"init=/init console=ttyS0\"", INITRD_MB * 1024); + /* Don't use a serial console if configured for bare metal */ + char *bare_metal = getenv("BARE_METAL"); + if (bare_metal != NULL && strcmp(bare_metal, "True") == 0) + { + sprintf(cmdline, "fiwix root=/dev/ram0 ramdisksize=%d initrd=sysa.ext2 kexec_proto=linux kexec_size=67000 kexec_cmdline=\"init=/init\"", INITRD_MB * 1024); + } + else + { + sprintf(cmdline, "fiwix console=/dev/ttyS0 root=/dev/ram0 ramdisksize=%d initrd=sysa.ext2 kexec_proto=linux kexec_size=67000 kexec_cmdline=\"init=/init console=ttyS0\"", INITRD_MB * 1024); + } char * boot_loader_name = "kexec-fiwix"; unsigned int next_avail_mem = 0x9800;