mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-04 18:35:24 +01:00
- This idea originates from very early in the project and was, at the
time, a very easy way to categorise things.
- Now, it doesn't really make much sense - it is fairly arbitary, often
occuring when there is a change in kernel, but not from builder-hex0
to fiwix, and sysb is in reality completely unnecessary.
- In short, the sys* stuff is a bit of a mess that makes the project
more difficult to understand.
- This puts everything down into one folder and has a manifest file that
is used to generate the build scripts on the fly rather than using
coded scripts.
- This is created in the "seed" stage.
stage0-posix -- (calls) --> seed -- (generates) --> main steps
Alongside this change there are a variety of other smaller fixups to the
general structure of the live-bootstrap rootfs.
- Creating a rootfs has become much simpler and is defined as code in
go.sh. The new structure, for an about-to-be booted system, is
/
-- /steps (direct copy of steps/)
-- /distfiles (direct copy of distfiles/)
-- all files from seed/*
-- all files from seed/stage0-posix/*
- There is no longer such a thing as /usr/include/musl, this didn't
really make any sense, as musl is the final libc used. Rather, to
separate musl and mes, we have /usr/include/mes, which is much easier
to work with.
- This also makes mes easier to blow away later.
- A few things that weren't properly in packages have been changed;
checksum-transcriber, simple-patch, kexec-fiwix have all been given
fully qualified package names.
- Highly breaking change, scripts now exist in their package directory
but NOT WITH THE packagename.sh. Rather, they use pass1.sh, pass2.sh,
etc. This avoids manual definition of passes.
- Ditto with patches; default directory is patches, but then any patch
series specific to a pass are named patches-passX.
50 lines
1.6 KiB
Diff
50 lines
1.6 KiB
Diff
# SPDX-FileCopyrightText: 2023 Richard Masters <grick23@gmail.com>
|
|
# SPDX-License-Identifier: MIT
|
|
diff -r -u musl-1.2.3.orig/arch/i386/pthread_arch.h musl-1.2.3/arch/i386/pthread_arch.h
|
|
--- arch/i386/pthread_arch.h 2022-04-07 17:12:40.000000000 +0000
|
|
+++ arch/i386/pthread_arch.h 2023-04-07 12:07:07.929132587 +0000
|
|
@@ -1,8 +1,7 @@
|
|
+extern uintptr_t g_pthread;
|
|
static inline uintptr_t __get_tp()
|
|
{
|
|
- uintptr_t tp;
|
|
- __asm__ ("movl %%gs:0,%0" : "=r" (tp) );
|
|
- return tp;
|
|
+ return g_pthread;
|
|
}
|
|
|
|
#define MC_PC gregs[REG_EIP]
|
|
diff -r -u musl-1.2.3.orig/arch/i386/syscall_arch.h musl-1.2.3/arch/i386/syscall_arch.h
|
|
--- arch/i386/syscall_arch.h 2022-04-07 17:12:40.000000000 +0000
|
|
+++ arch/i386/syscall_arch.h 2022-12-20 17:28:21.734839560 +0000
|
|
@@ -1,3 +1,4 @@
|
|
+#define SYSCALL_NO_TLS 1
|
|
#define __SYSCALL_LL_E(x) \
|
|
((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
|
|
((union { long long ll; long l[2]; }){ .ll = x }).l[1]
|
|
diff -r -u musl-1.2.3.orig/src/env/__init_tls.c musl-1.2.3/src/env/__init_tls.c
|
|
--- src/env/__init_tls.c 2022-04-07 17:12:40.000000000 +0000
|
|
+++ src/env/__init_tls.c 2023-04-07 12:07:38.677133193 +0000
|
|
@@ -10,20 +10,19 @@
|
|
#include "syscall.h"
|
|
|
|
volatile int __thread_list_lock;
|
|
+uintptr_t g_pthread;
|
|
|
|
int __init_tp(void *p)
|
|
{
|
|
pthread_t td = p;
|
|
td->self = td;
|
|
- int r = __set_thread_area(TP_ADJ(p));
|
|
- if (r < 0) return -1;
|
|
- if (!r) libc.can_do_threads = 1;
|
|
td->detach_state = DT_JOINABLE;
|
|
td->tid = __syscall(SYS_set_tid_address, &__thread_list_lock);
|
|
td->locale = &libc.global_locale;
|
|
td->robust_list.head = &td->robust_list.head;
|
|
td->sysinfo = __sysinfo;
|
|
td->next = td->prev = td;
|
|
+ g_pthread = (uintptr_t) td;
|
|
return 0;
|
|
}
|
|
|