linux-qubasis

linux oasis port as a qubes template

git clone https://9o.is/git/linux-qubasis.git

commit df465cab73737f27bb587ec76824b27fbc0a83e8
parent a247ec7d8de977a356ff4df6869c7982607ecc41
Author: Jul <jul@9o.is>
Date:   Sat, 13 Sep 2025 20:32:52 +0800

add rc shell

Diffstat:
M.gitmodules | 5+++++
Mgen.sh | 1+
Apkg/rc/config.h | 136+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/rc/gen.sh | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/rc/patch/0001-modify-output-path-in-mksignal.patch | 46++++++++++++++++++++++++++++++++++++++++++++++
Apkg/rc/repo | 1+
Apkg/rc/version.h | 1+
7 files changed, 258 insertions(+), 0 deletions(-)

diff --git a/.gitmodules b/.gitmodules @@ -77,3 +77,8 @@ [submodule "xz-embedded"] path = pkg/xz-embedded/repo url = https://github.com/tukaani-project/xz-embedded + ignore = all +[submodule "rc"] + path = pkg/rc/repo + url = https://github.com/rakitzis/rc + ignore = all diff --git a/gen.sh b/gen.sh @@ -30,6 +30,7 @@ subgen pkg/netbsd-curses subgen pkg/oksh subgen pkg/pax subgen pkg/probe +subgen pkg/rc subgen pkg/sbase subgen pkg/util-linux subgen pkg/xz-embedded diff --git a/pkg/rc/config.h b/pkg/rc/config.h @@ -0,0 +1,136 @@ +/* Define if you want to include extra builtins in addon.c */ +#define RC_ADDON 0 + +/* Define if you want to include parse tree dumper */ +#define RC_DEVELOP 0 + +/* Define if you want rc to hand off exec errors to (e.g.) /bin/sh. */ +#define DEFAULTINTERP "/bin/sh" + +/* Define to the default path used if $PATH is empty when rc starts. */ +#define DEFAULTPATH "/usr/local/bin","/usr/bin","/bin","." + +/* Define if your kernel has SysV special SIGCLD semantics. */ +#define HAVE_SYSV_SIGCLD 1 + +/* Define if you have /dev/fd. */ +#define HAVE_DEV_FD 1 + +/* Define if you have /proc/self/fd. */ +#define HAVE_PROC_SELF_FD 1 + +/* Define if you have named pipes. */ +#define HAVE_FIFO 1 + +/* Define if quad_t is a native type. */ +/* #undef HAVE_QUAD_T */ + +/* Define if you have rlim_t. */ +#define HAVE_RLIM_T 1 + +/* Define if you have sigsetjmp(). */ +#define HAVE_SIGSETJMP 1 + +/* Define if you have strerror(). */ +#define HAVE_STRERROR 1 + +/* Define if syscalls automatically restart after interruption by signal */ +#define HAVE_RESTARTABLE_SYSCALLS 0 + +/* Define if your system can execute script files starting with '#!' */ +#define HASH_BANG 1 + +/* Define if you want rc to encode strange characters in the environment. */ +#define PROTECT_ENV 1 + +/* Define if you want echo as a builtin. */ +#define RC_ECHO 0 + +/* Define if you want rc to support broken apps, like a job control shell. */ +#define RC_JOB 1 + +/* Define if rlim_t is quad_t. */ +/* #undef RLIM_T_IS_QUAD_T */ + +/* Define to 1 if you have the `getgroups' function. */ +#define HAVE_GETGROUPS 1 + +/* Define if you have POSIX getgroups(). */ +#define HAVE_POSIX_GETGROUPS 1 + +/* Define to the type of elements in the array set by `getgroups'. Usually + this is either `int' or `gid_t'. */ +#define GETGROUPS_T gid_t + +/* Define to 1 if you have the `lstat' function. */ +#define HAVE_LSTAT 1 + +/* Define to 1 if you have the `mkfifo' function. */ +/* #undef HAVE_MKFIFO */ + +/* Define to 1 if you have the `setpgrp' function. */ +#define HAVE_SETPGRP 1 + +/* Define to 1 if the `setpgrp' function takes no argument. */ +#define SETPGRP_VOID 1 + +/* Define to 1 if you have the `setrlimit' function. */ +#define HAVE_SETRLIMIT 1 + +/* Define if RLIMIT_* macros need _KERNEL. */ +/* #undef RLIMIT_NEEDS_KERNEL */ + +/* Define to 1 if you have the `sigaction' function. */ +#define HAVE_SIGACTION 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the <sys/resource.h> header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + + diff --git a/pkg/rc/gen.sh b/pkg/rc/gen.sh @@ -0,0 +1,68 @@ +fetch git + +cflags " + -std=c99 + -D _POSIX_C_SOURCE=200112L + -I $dir + -I $outdir/_include + -Wno-implicit-fallthrough + -Wno-implicit-function-declaration + -Wno-clobbered + -Wno-unused-parameter +" + +rule mkstatval '$hostdir/mkstatval >$out' +bind description 'MKSTATVAL $out' + +rule mksignal '$hostdir/mksignal $out' +bind description 'MKSIGNAL $out' + +host() { + exe mksignal mksignal.c + exe mkstatval mkstatval.c +} + +build mksignal '$outdir/_include/sigmsgs.h $outdir/_c/sigmsgs.c' '|' $hostdir/mksignal +build mkstatval $outdir/_include/statval.h '|' $hostdir/mkstatval + +dep " + $outdir/_include/statval.h + $outdir/_include/sigmsgs.h +" + +exe rc " + builtins.c + edit-null.c + except.c + exec.c + fn.c + footobar.c + getopt.c + glob.c + glom.c + hash.c + heredoc.c + input.c + lex.c + list.c + main.c + match.c + nalloc.c + open.c + parse.c + print.c + redir.c + signal.c + status.c + system.c + tree.c + utils.c + var.c + wait.c + walk.c + which.c + $outdir/_c/sigmsgs.c +" + +bin rc +man rc.1 diff --git a/pkg/rc/patch/0001-modify-output-path-in-mksignal.patch b/pkg/rc/patch/0001-modify-output-path-in-mksignal.patch @@ -0,0 +1,46 @@ +From 90fcc30feb11c198c298b14b7e7daabca14cf65c Mon Sep 17 00:00:00 2001 +From: Jul <jul@qh.is> +Date: Sat, 13 Sep 2025 20:10:52 +0800 +Subject: [PATCH] modify output path in mksignal + +--- + mksignal.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/mksignal.c b/mksignal.c +index 3119ade..1367e37 100644 +--- a/mksignal.c ++++ b/mksignal.c +@@ -197,11 +197,19 @@ int main(void) { + struct signaming *snp; + FILE *outf; + ++ if (argc < 3) { ++ printf("Usage: %s <sigmsgs.h> <sigmsgs.c>\n", argv[0]); ++ return 1; ++ } ++ ++ char *header_file = argv[1]; ++ char *source_file = argv[2]; ++ + for (snp = signamings; snp->signo; ++snp) + if (snp->signo > maxsig) + maxsig = snp->signo; + +- outf = fopen("sigmsgs.h", "w"); ++ outf = fopen(header_file, "w"); + if (!outf) barf("could not open sigmsgs.h for writing"); + fprintf(outf, "typedef struct {\n"); + fprintf(outf, "\tchar *name, *msg;\n"); +@@ -210,7 +218,7 @@ int main(void) { + fprintf(outf, "#define NUMOFSIGNALS %d\n", maxsig+1); + if (fclose(outf) == EOF) barf("could not fclose sigmsgs.h after writing"); + +- outf = fopen("sigmsgs.c", "w"); ++ outf = fopen(source_file, "w"); + if (!outf) barf("could not open sigmsgs.c for writing"); + fprintf(outf, "#include \"sigmsgs.h\"\n\n"); + fprintf(outf, "Sigmsgs signals[] = {\n"); +-- +2.50.1 + diff --git a/pkg/rc/repo b/pkg/rc/repo @@ -0,0 +1 @@ +Subproject commit 90fcc30feb11c198c298b14b7e7daabca14cf65c diff --git a/pkg/rc/version.h b/pkg/rc/version.h @@ -0,0 +1 @@ +#define VERSION "1.7.4"