Skip to content

Instantly share code, notes, and snippets.

View Googulator's full-sized avatar

Googulator

  • I don't work for QuickHeal, despite what myce.com claims.
View GitHub Profile
@Googulator
Googulator / lb0205.patch
Created February 5, 2024 03:59
live-bootstrap-nofilelist.patch
diff --git a/builder-hex0 b/builder-hex0
--- a/builder-hex0
+++ b/builder-hex0
@@ -1 +1 @@
-Subproject commit d49733d3e89538b2845f2be90ca6839deabf0042
+Subproject commit d49733d3e89538b2845f2be90ca6839deabf0042-dirty
diff --git a/lib/generator.py b/lib/generator.py
index 272f89f..1828fc6 100755
--- a/lib/generator.py
+++ b/lib/generator.py
@Googulator
Googulator / kconfig,diff
Created January 30, 2024 01:34
Kernel config diff for building 64-bit kernel
--- /steps/linux-4.9.10/files/config Thu Jan 1 00:00:00 1970
+++ /root/linux-4.9.10/.config Tue Jan 30 01:46:58 2024
@@ -1,27 +1,25 @@
-# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
-# SPDX-FileCopyrightText: 2024 Gábor Stefanik <netrolller.3d@gmail.com>
#
-# SPDX-License-Identifier: MIT
+# Automatically generated file; DO NOT EDIT.
+# Linux/x86 4.9.10-gnu Kernel Configuration
#
@Googulator
Googulator / perl.diff
Created December 27, 2023 22:14
Perl failure analysis
diff -ru perl-normal/usr/lib/perl5/5.32.1/i386-linux/Config_heavy.pl perl-weird/usr/lib/perl5/5.32.1/i386-linux/Config_heavy.pl
--- perl-normal/usr/lib/perl5/5.32.1/i386-linux/Config_heavy.pl 1970-01-01 01:00:00.000000000 +0100
+++ perl-weird/usr/lib/perl5/5.32.1/i386-linux/Config_heavy.pl 1970-01-01 01:00:00.000000000 +0100
@@ -941,7 +941,7 @@
i8size='1'
i8type='signed char'
i_arpainet='define'
-i_bfd='undef'
+i_bfd='define'
i_bsdioctl=''
@Googulator
Googulator / libtool.diff
Created December 27, 2023 21:02
Libtool failure analysis
diff -ru libtool-normal/usr/share/man/man1/libtool.1 libtool-weird/usr/share/man/man1/libtool.1
--- libtool-normal/usr/share/man/man1/libtool.1 1970-01-01 01:00:00.000000000 +0100
+++ libtool-weird/usr/share/man/man1/libtool.1 1970-01-01 01:00:00.000000000 +0100
@@ -102,7 +102,7 @@
linker: /usr/bin/ld (gnu? yes)
version: libtool (GNU libtool) 2.4.7
automake:
-autoconf: autoconf (GNU Autoconf) 2.53
+autoconf:
.SH AUTHOR
@Googulator
Googulator / gist:2e9ee8ed7db95234236b04b6fb10acc7
Created December 18, 2023 21:25
Screen contents at the time of the freeze
+> tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o unified-libc.o unified-libc.c
unified-libc.c:2121: warning: assignment makes pointer from integer without a cast
unified-libc.c:2438: warning: SYS_exit redefined
unified-libc.c:2656: warning: SYS_write redefined
+> tcc-mes -ar cr /usr/lib/mes/libc.a unified-libc.o
+> mkdir /usr/lib/mes/tcc
+> tcc-mes -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/x86 -o libtcc1.o lib/libtcc1.c
+> if match x86 riscv64
+> tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 lib/posix/getopt.c
+> tcc-mes -ar cr /usr/lib/mes/libgetopt.a getopt.o
# note: apply on top of https://github.com/fosslinux/live-bootstrap/commit/8ed2e010203bb08081250ea1e0f6b5ae4432953c (yes, I'll need to update to the current status quo)
diff --git a/kernel-bootstrap/builder-hex0-x86-stage2.hex0 b/kernel-bootstrap/builder-hex0-x86-stage2.hex0 # NOTE: this is builder-hex0-x86-stage2.hex0 from https://github.com/ironmeld/builder-hex0/pull/5
index 241295a..c64749f 100644
--- a/kernel-bootstrap/builder-hex0-x86-stage2.hex0
+++ b/kernel-bootstrap/builder-hex0-x86-stage2.hex0
@@ -10,21 +10,19 @@
# 16 bit Functions
# ----------------
-# stage2_entry
if (strcmp(get_var("DEBUG"), "True") == 0) {
if (using_bash != 1) {
fputs("trap 'env - PATH=${PREFIX}/bin PS1=\"[TRAP] \\w # \" bash -i' ERR\n", out);
} else {
fputs("trap 'bash -c '\"'\"'while true; do printf \"[TRAP - use Ctrl+D] $(pwd) # \"; $(cat); done'\"'\"'' ERR\n", out);
}
} else {
fputs("set -e\n", out);
}
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-2.0-only
Use gen_initramfs_list.sh from outside kernel source tree.
--- scripts/gen_initramfs_list.sh 2021-10-10 20:37:12.220231015 +1100
+++ scripts/gen_initramfs_list.sh 2021-10-10 20:37:22.694296140 +1100
@@ -174,7 +174,7 @@
${dep_list}header "$1"
@Googulator
Googulator / builder-hex0-x86-stage1.hex2
Last active December 2, 2023 07:06
builder-hex0 experiments
# SPDX-FileCopyrightText: 2023 Richard Masters <grick23@gmail.com>
# SPDX-License-Identifier: MIT
#
# Builder-Hex0 is a small bootable machine image which acts as
# a bootloader using a hex0 compiler. It compiles hex0 code starting
# at sector 2, placing the compiled code at address 0x7E00 and then
# and then jumps to the resulting binary.
#
# hex0 is a "language" for binary encoding in hexadecimal
# with support for comments.
Apply on top of https://github.com/Googulator/live-bootstrap/tree/playground.
diff --git a/rootfs.py b/rootfs.py
index cf3d73a..a950c67 100755
--- a/rootfs.py
+++ b/rootfs.py
@@ -98,6 +98,8 @@ def main():
parser.add_argument("-qr", "--qemu-ram", help="Memory (in megabytes) allocated to QEMU VM",
default=4096)
parser.add_argument("-qk", "--kernel", help="Custom sysa kernel to use")