Skip to content

Commit

Permalink
Merge pull request #341 from fosslinux/early-tools
Browse files Browse the repository at this point in the history
Early tools in subdirectories
  • Loading branch information
fosslinux authored Dec 15, 2023
2 parents 73c4985 + 829f18d commit d4e0fc9
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ Source: https://github.com/fosslinux/live-bootstrap
# Copyright: $YEAR $NAME <$CONTACT>
# License: ...

Files: sys*/*/sources sysa/checksum-transcriber.*.SHA256SUM sysa/*/*.checksums sysa/SHA256SUMS.pkgs sysa/*/simple-patches/*
Files: sys*/*/sources sysa/*/*.checksums sysa/SHA256SUMS.pkgs sysa/*/simple-patches/*
Copyright: none
License: MIT
File renamed without changes.
20 changes: 20 additions & 0 deletions sysa/checksum-transcriber-1.0/checksum-transcriber-1.0.kaem
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]>
#
# SPDX-License-Identifier: GPL-3.0-or-later

set -ex

# Build & install
M2-Mesoplanet --architecture ${ARCH} -f src/checksum-transcriber.c -o ${BINDIR}/checksum-transcriber

# Checksums
if match x${UPDATE_CHECKSUMS} xTrue; then
sha256sum -o ${pkg}.${ARCH}.checksums \
/usr/bin/checksum-transcriber

cp ${pkg}.${ARCH}.checksums ${SRCDIR}
else
sha256sum -c ${pkg}.${ARCH}.checksums
fi
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ int main() {
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);
sprintf(cmdline, "fiwix root=/dev/ram0 ramdisksize=%d initrd=fiwix.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);
sprintf(cmdline, "fiwix console=/dev/ttyS0 root=/dev/ram0 ramdisksize=%d initrd=fiwix.ext2 kexec_proto=linux kexec_size=67000 kexec_cmdline=\"init=/init console=ttyS0\"", INITRD_MB * 1024);
}
char * boot_loader_name = "kexec-fiwix";

Expand Down Expand Up @@ -117,8 +117,8 @@ int main() {
pmultiboot_module->mod_end = 0x1C6000 + (INITRD_MB * 1024 * 1024);
next_avail_mem += sizeof(multiboot_module_t);
pmultiboot_module->cmdline = next_avail_mem;
strcpy((char *) next_avail_mem, "sysa.ext2");
next_avail_mem += (strlen("sysa.ext2") + 1);
strcpy((char *) next_avail_mem, "fiwix.ext2");
next_avail_mem += (strlen("fiwix.ext2") + 1);

/* Set memory map info */
pmultiboot_info->mmap_addr = next_avail_mem;
Expand Down Expand Up @@ -182,7 +182,7 @@ int main() {
int filenum;
unsigned int filename_addr;
for (filenum = 4, filename_addr = 0x201000; filenum <= 14335; filenum++, filename_addr += 1024) {
if (!strcmp((char *) filename_addr, "/boot/sysa.ext2")) {
if (!strcmp((char *) filename_addr, "/boot/fiwix.ext2")) {
printf("Found image at filenum %d\n", filenum);
break;
}
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions sysa/lwext4-1.0.0-lb1/files/make_fiwix_initrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ int main(int argc, char **argv)

next_file_address = *((unsigned int *) 0x7F8D);

printf("Starting sysa.ext2 at addr 0x%08x\n", next_file_address);
printf("Starting fiwix.ext2 at addr 0x%08x\n", next_file_address);

/* Create zeroed out disk image file */
input_name = "/boot/sysa.ext2";
input_name = "/boot/fiwix.ext2";

memset(zeros, 0, BLOCK_SIZE);
FILE *ext2file = fopen(input_name, "w");
Expand Down
16 changes: 11 additions & 5 deletions sysa/run.kaem
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@

set -ex

# checksum-transcriber utility
M2LIBC_PATH=/M2libc
M2-Mesoplanet --architecture ${ARCH} -f checksum-transcriber.c -o ${BINDIR}/checksum-transcriber
sha256sum -c checksum-transcriber.${ARCH}.SHA256SUM

# checksum-transcriber utility
pkg="checksum-transcriber-1.0"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..

# simple patch tool based on before and after chunks
M2-Mesoplanet --architecture ${ARCH} -f simple-patch.c -o ${BINDIR}/simple-patch
pkg="simple-patch-1.0"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..

# Environmental variables needed for mes
NYACC_PKG=nyacc-1.00.2
Expand Down Expand Up @@ -69,7 +75,7 @@ if match x${BUILD_FIWIX} xTrue; then
cd ..

# Live boot loader for Fiwix
pkg="kexec-fiwix"
pkg="kexec-fiwix-1.0"
cd ${pkg}
kaem --verbose --file ${pkg}.kaem
cd ..
Expand Down
20 changes: 20 additions & 0 deletions sysa/simple-patch-1.0/simple-patch-1.0.kaem
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]>
#
# SPDX-License-Identifier: GPL-3.0-or-later

set -ex

# Build & install
M2-Mesoplanet --architecture ${ARCH} -f src/simple-patch.c -o ${BINDIR}/simple-patch

# Checksums
if match x${UPDATE_CHECKSUMS} xTrue; then
sha256sum -o ${pkg}.checksums \
/usr/bin/simple-patch

cp ${pkg}.checksums ${SRCDIR}
else
sha256sum -c ${pkg}.${ARCH}.checksums
fi
1 change: 1 addition & 0 deletions sysa/simple-patch-1.0/simple-patch-1.0.x86.checksums
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bf49a897e96fe4052904aaedc8281f6849e3dc1836899d393c43726cc8f5e92e /usr/bin/simple-patch
File renamed without changes.

0 comments on commit d4e0fc9

Please sign in to comment.