### Configure System Initialization Scripts Source: https://github.com/oasislinux/oasis/wiki/Install Opens the `/etc/rc.local` and `/etc/profile` files for editing. `rc.local` is used for system initialization during boot before `perp` starts, and `profile` is for user environment setup. ```bash $EDITOR etc/rc.local $EDITOR etc/profile ``` -------------------------------- ### Install syslinux Bootloader for BIOS Source: https://github.com/oasislinux/oasis/wiki/Install Installs the syslinux bootloader for BIOS systems. This involves creating a syslinux directory, installing the bootloader, writing the MBR, and configuring `syslinux.cfg`. ```bash sudo apt install extlinux mkdir $ROOT/boot/syslinux extlinux --install $ROOT/boot/syslinux dd if=/usr/lib/EXTLINUX/mbr.bin of=/dev/$DRIVE bs=440 cat >$ROOT/boot/syslinux/syslinux.cfg < config.lua << 'EOF' local sets = dofile(basedir..'/sets.lua') return { builddir='out', prefix='', gzman=true, fs={ {sets.core, exclude={'^include/', '^lib/.*%.a$'}}, {sets.extra}, }, target={ platform='x86_64-linux-musl', cflags='-Os -fPIE -pipe', ldflags='-s -static-pie', }, host={cflags='-O2 -pipe', ldflags=''}, repo={ path='../..', -- Point to root filesystem flags='', tag='tree', branch='oasis', }, } EOF # Build and commit to repository lua setup.lua ninja commit # Merge into root filesystem cd /mnt git config branch.master.remote . git config branch.master.merge oasis git merge ./libexec/applyperms ``` -------------------------------- ### Configure System Time and Filesystem Table Source: https://github.com/oasislinux/oasis/wiki/Install Sets up the system's timezone by creating a symbolic link and configures the filesystem table (`/etc/fstab`) with the root and boot partitions. It also creates a placeholder for the last login log. ```bash ln -s ../share/zoneinfo/$TIMEZONE etc/localtime cat >>etc/fstab </dev/null cp arch/x86/boot/bzImage /boot/linux umount /boot ``` -------------------------------- ### Install Package to Staging Area and Commit Source: https://context7.com/oasislinux/oasis/llms.txt Installs a package into a staging directory and commits it to a git repository. This is useful for preparing packages before merging them into main branches. ```bash make install DESTDIR=$PWD/stage git -C stage add . git -C stage commit -m 'somepackage 1.2.3' ``` -------------------------------- ### Configure Bootloader for Oasis System Source: https://context7.com/oasislinux/oasis/llms.txt Provides two options for configuring the bootloader: syslinux for BIOS systems and an EFI stub for UEFI systems with CONFIG_EFI_STUB enabled. This sets up the system to boot the installed Oasis Linux kernel. ```bash # Option 1: syslinux (BIOS) mkdir /boot/syslinux extlinux --install /boot/syslinux dd if=/lib/syslinux/bios/mbr.bin of=/dev/sda bs=440 cat > /boot/syslinux/syslinux.cfg << 'EOF' PROMPT 1 TIMEOUT 50 DEFAULT oasis LABEL oasis LINUX ../linux APPEND root=/dev/sda2 init=/bin/sinit ro EOF # Option 2: EFI stub (UEFI with CONFIG_EFI_STUB=y) efibootmgr -c -d /dev/sda -p 1 -l /linux -L oasis \ "root=/dev/sda2 init=/bin/sinit ro" ``` -------------------------------- ### Add and Merge Oasis Toolchain Repository Source: https://github.com/oasislinux/oasis/wiki/Install Adds the Oasis toolchain Git repository as a remote, fetches its latest changes, and merges it into the current branch. This ensures the necessary toolchain components are available. ```bash git remote add toolchain https://github.com/oasislinux/toolchain.git git fetch toolchain '--depth=1' git config --add branch.master.merge toolchain/master git merge --allow-unrelated-histories ``` -------------------------------- ### Configure nsd Build Options Source: https://github.com/oasislinux/oasis/blob/master/pkg/nsd/README.md This snippet shows the command used to configure the nsd build. It specifies installation directories, features to include or exclude, and custom library/include paths. The configuration aims to integrate with the oasis project's build environment. ```shell ./configure \ --prefix= \ --sbindir=/bin \ --with-zonesdir=/etc/nsd/zone \ --with-pidfile=/run/nsd.pid \ --without-ssl \ --without-libevent \ CPPFLAGS=-I/src/oasis/pkg/openbsd/include \ LIBS=/src/oasis/out/pkg/openbsd/libbsd.a ``` -------------------------------- ### Enable SSHD Service in Oasis Linux Source: https://github.com/oasislinux/oasis/wiki/Administration Enables the SSH daemon (sshd) by first generating host keys and then activating the service using the perpctl command. Assumes perpctl is installed and configured. ```bash ssh-keygen -A perpctl A sshd ``` -------------------------------- ### Merge Oasis Build into Root Repository Source: https://github.com/oasislinux/oasis/wiki/Install Merges the built Oasis system into the main root repository. It configures Git to track the local repository as a remote and then performs the merge. Finally, it applies file permissions. ```bash cd $ROOT git config branch.master.remote . git config branch.master.merge oasis git merge ./libexec/applyperms ``` -------------------------------- ### Add New Software Package using Git Worktree Source: https://github.com/oasislinux/oasis/wiki/Repository Adds a new software package to the Oasis Linux project. It involves creating a new worktree, installing the package, committing the changes, and merging the new package branch into master. ```git git -C / worktree add --detach --no-checkout $PWD/stage git -C stage symbolic-ref HEAD refs/heads/somepackage make install DESTDIR=$PWD/stage git -C stage add . git -C stage commit -m 'somepackage X.Y' git -C / config --add branch.master.merge somepackage git -C / merge --allow-unrelated ``` -------------------------------- ### File Creation and Temporary Files Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for creating various types of files, including directories, FIFOs, special files, and secure temporary files. Includes mkdir, mkfifo, mknod, mkstemp, and mkdtemp. ```c #include int mkdir(const char *pathname, mode_t mode); int mkfifo(const char *pathname, mode_t mode); int mknod(const char *pathname, mode_t mode, dev_t dev); int mkstemp(char *template); char *mkdtemp(char *template); ``` -------------------------------- ### Process Spawning (POSIX) Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for creating new processes. Includes posix_spawn and related functions for managing file actions and attributes. ```c #include int posix_spawn(pid_t *pid, const char *path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t *attrp, char *const argv[], char *const envp[]); int posix_spawnp(pid_t *pid, const char *file, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t *attrp, char *const argv[], char *const envp[]); ``` -------------------------------- ### File and Path Configuration Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for querying file and path configuration limits and properties. Includes pathconf and fpathconf. ```c #include long pathconf(const char *path, int name); long fpathconf(int fd, int name); ``` -------------------------------- ### System Configuration and Information Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for querying system configuration parameters and managing process groups and session IDs. ```c #include #include long sysconf(int name); pid_t setpgid(pid_t pid, pid_t pgid); pid_t getpgid(pid_t pid); pid_t setsid(void); pid_t getsid(pid_t pid); int setpgrp(void); int getpriority(int which, id_t who); int setpriority(int which, id_t who, int value); ``` -------------------------------- ### Configure Static Native Toolchain with musl-cross-make Source: https://github.com/oasislinux/oasis/wiki/Toolchain Provides a sample `config.mak` file for building a static native toolchain. It specifies target architecture, download command, compiler flags, and various configuration options for GCC and musl. ```makefile NATIVE = 1 TARGET = x86_64-linux-musl DL_CMD = curl -Lo COMMON_CONFIG += CC='cc -static --static' COMMON_CONFIG += CXX='c++ -static --static' COMMON_CONFIG += CFLAGS='-O2 -pipe' COMMON_CONFIG += CXXFLAGS='-O2 -pipe' COMMON_CONFIG += LDFLAGS='-s' COMMON_CONFIG += --build=$(TARGET) COMMON_CONFIG += --with-build-sysroot=/ COMMON_CONFIG += --disable-nls COMMON_CONFIG += --enable-deterministic-archives COMMON_CONFIG += --with-debug-prefix-map=$(CURDIR)= GCC_CONFIG += --with-native-system-header-dir=/include GCC_CONFIG += --disable-bootstrap GCC_CONFIG += --disable-libgomp GCC_CONFIG += --disable-libquadmath GCC_CONFIG += --disable-lto KERNEL_VARS += HOSTCC='cc -static' # only static COMMON_CONFIG += --disable-shared MUSL_CONFIG += --disable-shared ``` -------------------------------- ### Thread Scheduling and Concurrency Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for managing thread scheduling parameters, getting CPU clock IDs, and controlling the concurrency level. Includes pthread_getschedparam, pthread_getcpuclockid, and pthread_getconcurrency. ```c #include int pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param); int pthread_getcpuclockid(pthread_t thread, clockid_t *clock_id); int pthread_setconcurrency(int level); int pthread_getconcurrency(void); ``` -------------------------------- ### Download and Extract Intel Microcode Source: https://github.com/oasislinux/oasis/wiki/Kernel Downloads the latest Intel microcode, extracts it, and places it in the intel-ucode directory. This is for systems with Intel CPUs that require microcode updates at boot. ```bash cd /src/linux-firmware curl -LO https://downloadmirror.intel.com/26798/eng/microcode-20170511.tgz zcat microcode-20170511.tgz | pax -r intel-ucode/* ``` -------------------------------- ### Build the Linux Kernel Source: https://github.com/oasislinux/oasis/wiki/Kernel Compiles the Linux kernel using the 'make' command. This command should be run from the root directory of the kernel source code. ```bash make ``` -------------------------------- ### Configure Binutils Build Source: https://github.com/oasislinux/oasis/blob/master/pkg/binutils/README.md This snippet shows the command used to configure the binutils build. It specifies the target architecture, disables certain features like Gold linker and NLS, and enables others like deterministic archives and GNU hash style. The output is a configured build environment. ```bash ./configure \ --target=x86_64-linux-musl \ --disable-gold \ --disable-libctf \ --disable-nls \ --disable-plugins \ --enable-default-hash-style=gnu \ --enable-deterministic-archives \ --enable-new-dtags \ --without-msgpack make configure-host ``` -------------------------------- ### Clone musl-cross-make Repository Source: https://github.com/oasislinux/oasis/wiki/Toolchain Clones the musl-cross-make repository from GitHub and navigates into the directory. It also includes a command to pull the latest changes. ```bash git clone https://github.com/richfelker/musl-cross-make /src/musl-cross-make cd /src/musl-cross-make git pull --no-edit https://github.com/oasislinux/musl-cross-make ``` -------------------------------- ### Process Control and Management Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for creating, managing, and controlling processes. Includes functions like fork, exec, wait, exit, kill, nice, and more. ```c #include #include pid_t fork(void); int execve(const char *filename, char *const argv[], char *const envp[]); pid_t wait(int *wstatus); void exit(int status); int kill(pid_t pid, int sig); ``` ```c #include int nice(int increment); ``` -------------------------------- ### Package Build Script with Lua (gen.lua) Source: https://context7.com/oasislinux/oasis/llms.txt Defines package build processes using Lua scripts to generate Ninja build rules. It specifies compiler flags, dependencies, source files, and build targets like executables, libraries, and man pages. It also supports fetching sources from Git repositories. ```lua -- Example: pkg/nginx/gen.lua cflags{ '-I $dir', '-I $srcdir/src/core', '-I $srcdir/src/event', '-I $srcdir/src/http/v2', '-I $srcdir/src/os/unix', '-isystem $builddir/pkg/linux-headers/include', } pkg.deps = {'pkg/linux-headers/headers'} -- Define source files using path expansion syntax local sources = paths[["src/( core/(nginx.c ngx_log.c ngx_palloc.c ngx_array.c) event/(ngx_event.c ngx_event_timer.c modules/ngx_epoll_module.c) os/unix/(ngx_time.c ngx_errno.c ngx_alloc.c ngx_process.c) )]] -- Build executable and install exe('nginx', {sources, 'ngx_modules.c.o', libs}) file('bin/nginx', '755', '$outdir/nginx') file('share/nginx/mime.types', '644', '$srcdir/conf/mime.types') -- Build and install man page man{'$outdir/nginx.8'} -- Fetch sources from git fetch 'git' ``` -------------------------------- ### Process and System Information Functions Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Documentation for functions related to process management, waiting, and system information retrieval. ```APIDOC ## Process and System Information Functions ### Description This section includes functions for managing process execution, waiting for process state changes, and retrieving system-level information. ### Endpoints - `man3p/tsearch.3p` - `man3p/twalk.3p` - `man3p/wait.3p` - `man3p/waitid.3p` - `man3p/waitpid.3p` ### Parameters (Specific parameters depend on individual man pages, refer to each file for details.) ### Request Example (Not applicable for man page documentation) ### Response (Not applicable for man page documentation) ``` -------------------------------- ### System Logging Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for opening, writing to, and closing system log files. Includes openlog, syslog, and closelog. ```c #include void openlog(const char *ident, int option, int facility); void syslog(int priority, const char *message, ...); void closelog(void); ``` -------------------------------- ### File System Operations Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for interacting with the file system, including creating, deleting, opening, closing, and manipulating files and directories. Covers functions like open, close, read, write, lseek, mkdir, rmdir, stat, lstat, mmap, munmap, and more. ```c #include #include int open(const char *pathname, int flags, ...); int close(int fd); ssize_t read(int fd, void *buf, size_t count); ssize_t write(int fd, const void *buf, size_t count); off_t lseek(int fd, off_t offset, int whence); ``` ```c #include int mkdir(const char *pathname, mode_t mode); int rmdir(const char *pathname); int stat(const char *pathname, struct stat *statbuf); int lstat(const char *pathname, struct stat *statbuf); ``` ```c #include void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); int munmap(void *addr, size_t length); ``` -------------------------------- ### Configure xz Build Options Source: https://github.com/oasislinux/oasis/blob/master/pkg/xz/README.md This snippet shows the command used to configure the xz build. It disables native language support (nls) and enables the lzip decoder, while disabling microlzma. ```bash ./configure \ --disable-nls \ --enable-lzip-decoder \ --disable-microlzma ``` -------------------------------- ### Configure Kernel with Extra Firmware Source: https://github.com/oasislinux/oasis/wiki/Kernel Sets kernel configuration options to include extra firmware. CONFIG_EXTRA_FIRMWARE_DIR points to the location of firmware files, and CONFIG_EXTRA_FIRMWARE specifies which firmware files to include. ```bash CONFIG_EXTRA_FIRMWARE_DIR="/src/linux-firmware" CONFIG_EXTRA_FIRMWARE="$FIRMWARE" ``` -------------------------------- ### Add New User in Oasis Linux Source: https://github.com/oasislinux/oasis/wiki/Administration Manually adds a new user to the system by editing passwd, group, and shadow files, creating a home directory, and setting ownership. Requires root privileges. ```bash echo "$USER:x:$UID:$UID:$NAME:/home/$USER:/bin/ksh" >> /etc/passwd echo "$USER:x:$UID:" >> /etc/group echo "$USER:*:::::::": >> /etc/shadow mkdir /home/$USER chown $USER:$USER /home/$USER passwd $USER ``` -------------------------------- ### Time and Timer Functions Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Documentation for functions related to time manipulation and timer management. ```APIDOC ## Time and Timer Functions ### Description This section details functions for managing time, creating, deleting, and querying timers, and handling time zones. ### Endpoints - `man3p/time.3p` - `man3p/timer_create.3p` - `man3p/timer_delete.3p` - `man3p/timer_getoverrun.3p` - `man3p/times.3p` - `man3p/timezone.3p` - `man3p/tzset.3p` ### Parameters (Specific parameters depend on individual man pages, refer to each file for details.) ### Request Example (Not applicable for man page documentation) ### Response (Not applicable for man page documentation) ``` -------------------------------- ### Configure Script for util-linux Build Source: https://github.com/oasislinux/oasis/blob/master/pkg/util-linux/README.md This snippet shows the configure script execution with specific options to customize the build of util-linux. It disables most programs while enabling specific libraries and features like fsck, libblkid, libmount, and libuuid. ```bash ./configure \ --disable-all-programs \ --enable-fs-paths-default=/bin \ --enable-fsck \ --enable-libblkid \ --enable-libmount \ --enable-libuuid ``` -------------------------------- ### Network Byte Order Conversion Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for converting between host byte order and network byte order for integers. Includes ntohl and htonl. ```c #include u_long ntohl(u_long netlong); u_short ntohs(u_short netshort); u_long htonl(u_long hostlong); u_short htons(u_short hostshort); ``` -------------------------------- ### Oasis Configuration File (config.lua) Source: https://context7.com/oasislinux/oasis/llms.txt Defines build output settings, target toolchain, and package/file selection for an Oasis system. It specifies directories, compression, filesystem inclusions/exclusions, toolchain flags, and the output repository. ```lua local sets = dofile(basedir..'/sets.lua') return { -- Build output directory builddir='out', -- Install prefix prefix='', -- Compress man pages gzman=true, -- Package/file selection -- Each entry contains a list of packages, patterns to include/exclude fs={ -- Include core packages, exclude headers and static libraries {sets.core, exclude={'^include/', '^lib/.*%.a$'}}, -- Add extra packages {sets.extra}, -- Add development tools {sets.devel}, -- Add desktop environment {sets.desktop}, }, -- Target toolchain and flags (for static musl-based binaries) target={ platform='x86_64-linux-musl', cflags='-Os -fPIE -pipe -Werror=implicit-function-declaration', ldflags='-s -static-pie', }, -- Host toolchain and flags host={ cflags='-O2 -pipe', ldflags='', }, -- Output git repository repo={ path='$builddir/root.git', flags='--bare', tag='tree', branch='master', }, -- GPU driver (possible values: amdgpu intel nouveau) -- video_drivers={intel=true} } ``` -------------------------------- ### Math Functions (Logarithmic and Rounding) Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Mathematical functions for logarithmic operations, base conversion, and rounding. Includes functions like log, log2, logb, lrint, lround, modf, nearbyint, and more. ```c #include double log(double x); double log2(double x); double logb(double x); long lrint(double x); long lround(double x); double modf(double x, double *iptr); double nearbyint(double x); ``` -------------------------------- ### Configure Expat Build with Custom Flags Source: https://github.com/oasislinux/oasis/blob/master/pkg/expat/README.md This snippet shows the command used to configure the expat library build. It specifies custom preprocessor flags (CPPFLAGS) for include paths, linker flags (LDFLAGS) for library paths, and explicitly links the 'bsd' library (LIBS). ```bash ./configure \ CPPFLAGS=-I/src/oasis/pkg/openbsd/include \ LDFLAGS='-L/src/oasis/pkg/openbsd' \ LIBS='-lbsd' ``` -------------------------------- ### Directory Operations Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for opening, reading, and closing directories. Includes functions like opendir, readdir, closedir, and nftw. ```c #include DIR *opendir(const char *name); struct dirent *readdir(DIR *dirp); int closedir(DIR *dirp); ``` ```c #include int nftw(const char *dirpath, int (*fn)(const char *, const struct stat *, int, struct FTW *), int nopen, int flags); ``` -------------------------------- ### Process Execution and Control Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for executing commands and controlling processes, including popen and pclose for creating pipes to/from child processes. ```c #include FILE *popen(const char *command, const char *type); int pclose(FILE *stream); ``` -------------------------------- ### Standard I/O Functions Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Standard input/output functions for formatted printing and error reporting. Includes printf, perror, and psiginfo. ```c #include int printf(const char *format, ...); #include void perror(const char *s); #include void psiginfo(const siginfo_t *pinfo, FILE *fp); ``` -------------------------------- ### POSIX Spawn File Actions Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for manipulating POSIX spawn file actions, which define file operations to be performed when a new process is spawned. Includes addclose, adddup2, addopen, and destroy. ```c #include int posix_spawn_file_actions_init(posix_spawn_file_actions_t *file_actions); int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *file_actions); int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *file_actions, int fd, const char *path, int oflag, mode_t mode); int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *file_actions, int fd, int newfd); int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *file_actions, int fd); ``` -------------------------------- ### Clone Linux Firmware Repository Source: https://github.com/oasislinux/oasis/wiki/Kernel Clones the linux-firmware repository, which contains various firmware files for devices like iwlwifi. This is a prerequisite for including specific firmware in the kernel build. ```bash git clone https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git /src/linux-firmware ``` -------------------------------- ### Ninja Build API Functions (ninja.lua) Source: https://context7.com/oasislinux/oasis/llms.txt Provides high-level functions within the ninja.lua module for generating Ninja build rules. These functions abstract common build tasks like compiling C sources, creating static libraries, linking executables, and generating parsers. ```lua -- Compile C source files to object files cc('source.c', deps, {cflags='$cflags -DEXTRA_FLAG'}) -- Build multiple source files into object files local objs = objects('src/(main.c util.c helper.c)', deps) -- Create static library from sources lib('libfoo.a', [[ foo.c bar.c baz/(qux.c quux.c) ]], deps) -- Link executable from objects and libraries exe('myprogram', {'main.c', 'util.c', 'libfoo.a.d'}, deps, { ldlibs='-lm', }) -- Link with explicit object files and response file for libraries link('output', {objs, 'libfoo.a.d'}, {ldlibs='@libs.rsp'}) -- Create archive (static library) ar('libbar.a', {'foo.c.o', 'bar.c.o', 'libbaz.a'}) -- Generate yacc parser yacc('parser', 'grammar.y') -- Generate Wayland protocol bindings waylandproto('protocols/xdg-shell.xml', { client='xdg-shell-client.h', server='xdg-shell-server.h', code='xdg-shell-protocol.c', }) ``` -------------------------------- ### Project Configuration and Versioning Source: https://github.com/oasislinux/oasis/blob/master/pkg/yt-dlp/pylibs.txt This snippet highlights essential configuration and versioning files within the yt-dlp project. 'yt_dlp/socks.py' might contain logic for SOCKS proxy support. 'yt_dlp/update.py' likely handles the process of updating yt-dlp itself. 'yt_dlp/version.py' defines the current version of the software, and 'yt_dlp/webvtt.py' suggests utilities for handling WebVTT subtitle files. ```Python yt_dlp/socks.py yt_dlp/update.py yt_dlp/version.py yt_dlp/webvtt.py ``` -------------------------------- ### Signal Handling and Information Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions related to signal handling, including sending signals and retrieving signal information. Includes kill, psiginfo, and signal-related functions. ```c #include int kill(pid_t pid, int sig); void psiginfo(const siginfo_t *pinfo, FILE *fp); ``` -------------------------------- ### Memory Allocation and Management Functions Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for dynamic memory allocation, deallocation, and manipulation. Includes functions like malloc, calloc, realloc, free, memchr, memcpy, memmove, and memset. ```c #include void *malloc(size_t size); void *calloc(size_t num, size_t size); void *realloc(void *ptr, size_t new_size); void free(void *ptr); ``` ```c #include void *memchr(const void *s, int c, size_t n); void *memcpy(void *dest, const void *src, size_t n); void *memmove(void *dest, const void *src, size_t n); int memcmp(const void *s1, const void *s2, size_t n); void *memset(void *s, int c, size_t n); ``` -------------------------------- ### Process Synchronization (POSIX Barriers) Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for creating and managing POSIX barriers, which are synchronization primitives that allow multiple threads to wait for each other. ```c #include int pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned count); int pthread_barrier_wait(pthread_barrier_t *barrier); int pthread_barrier_destroy(pthread_barrier_t *barrier); ``` -------------------------------- ### Time and Date Functions Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for converting between time representations and manipulating time values. Includes mktime and nanosleep. ```c #include time_t mktime(struct tm *timeptr); int nanosleep(const struct timespec *req, struct timespec *rem); ``` -------------------------------- ### String Output Functions Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for writing strings to a stream or buffer. Includes formatted output and simple string output. ```c #include int puts(const char *s); int printf(const char *format, ...); int sprintf(char *str, const char *format, ...); int snprintf(char *str, size_t size, const char *format, ...); ``` -------------------------------- ### File Descriptor Operations (openat) Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for opening files relative to a directory file descriptor, providing enhanced security and control. Includes openat and open. ```c #include int open(const char *pathname, int flags, ...); int openat(int dirfd, const char *pathname, int flags, ...); ``` -------------------------------- ### Bootstrap Pkgsrc with Oasis Linux Configuration Source: https://github.com/oasislinux/oasis/wiki/pkgsrc Boots the pkgsrc framework on Oasis Linux with custom environment variables and make arguments. It addresses circular dependencies and toolchain incompatibilities by specifying paths and flags for essential build tools like flex, bash, and sed. ```sh doas env groupsprog='id -Gn' FGREP='/bin/grep -F' EGREP='/bin/grep -E' TOUCH_FLAGS= \ ./bootstrap/bootstrap --prefix /pkg --prefer-pkgsrc yes --mk-fragment - < double remainder(double x, double y); double remquo(double x, double y, int *quo); double signbit(double x); ``` -------------------------------- ### Configure Python Build Options Source: https://github.com/oasislinux/oasis/blob/master/pkg/python/README.md This snippet shows the command used to configure the Python build for the Oasis Linux project. It specifies options like disabling pymalloc, enabling specific hash algorithms, and setting default SSL/TLS cipher suites. These options are crucial for security and performance. ```bash ./configure \ --without-pymalloc \ --with-builtin-hashlib-hashes='sha3,blake2' \ --with-ssl-default-suites='TLSv1.3:TLSv1.2+AEAD+ECDHE:TLSv1.2+AEAD+DHE' \ ax_cv_c_float_words_bigendian=no ``` -------------------------------- ### POSIX Trace Functions Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for creating, managing, and interacting with POSIX trace streams. Includes functions for trace attributes, events, and stream control. ```c #include int posix_trace_create(trace_id_t trace_id, const trace_attr_t *attr, int overwrite); int posix_trace_open(const char *name, int oflag, ...); int posix_trace_close(trace_id_t trace_id); int posix_trace_start(trace_id_t trace_id); int posix_trace_stop(trace_id_t trace_id); int posix_trace_flush(trace_id_t trace_id); ``` -------------------------------- ### Signal Handling Functions Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for manipulating signal masks, pending signals, and signal actions. Includes setting up signal handlers and managing signal sets. ```c #include int sigaction(int sig, const struct sigaction *act, struct sigaction *oldact); int sigprocmask(int how, const sigset_t *set, sigset_t *oldset); int sigpending(sigset_t *set); int sigsuspend(const sigset_t *mask); int sigwait(const sigset_t *set, int *sig); int sigwaitinfo(const sigset_t *set, siginfo_t *info); int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout); int sigqueue(pid_t pid, int sig, union sigval value); int sigemptyset(sigset_t *set); int sigfillset(sigset_t *set); int sigaddset(sigset_t *set, int signo); int sigdelset(sigset_t *set, int signo); int sigismember(const sigset_t *set, int signo); int siginterrupt(int sig, int flag); int sighold(int sig); int sigrelse(int sig); int sigpause(int sigmask); void (*signal(int sig, void (*func)(int)))(int, siginfo_t *, void *); int sigaltstack(const struct sigaltstack *ss, struct sigaltstack *oss); int siglongjmp(sigjmp_buf env, int val); int sigsetjmp(sigjmp_buf env, int savemask); ``` -------------------------------- ### Timer and Interval Operations Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for setting and retrieving interval timers, and for managing process group IDs. ```c #include int getitimer(int which, struct itimerval *value); int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue); ``` -------------------------------- ### Enable DHCP on eth0 in Oasis Linux Source: https://github.com/oasislinux/oasis/wiki/Administration Configures the system to use DHCP on the eth0 network interface. This involves bringing the interface up, adding configuration to rc.local, creating a service directory, and activating the service. ```bash ip link set eth0 up $EDITOR /etc/rc.local cd /etc/perp mkdir sdhcp@eth0 ln -s ../.sdhcp/rc.main ../.default/rc.log sdhcp@eth0 perpctl A sdhcp@eth0 ``` -------------------------------- ### Mathematical Functions (Rounding and Scaling) Source: https://github.com/oasislinux/oasis/blob/master/pkg/man-pages-posix/manpages.txt Functions for rounding floating-point numbers to the nearest integer, and for scaling numbers. ```c #include double round(double x); double rint(double x); double scalbln(double x, long n); ``` -------------------------------- ### Configure Oasis Linux with Disabled Compression Libraries Source: https://github.com/oasislinux/oasis/blob/master/pkg/file/README.md This snippet shows the command used to configure the Oasis Linux project. It explicitly disables several compression libraries (xzlib, bzlib, zstdlib, lzlib) to potentially reduce the build size or avoid external dependencies. ```bash ./configure \ --disable-xzlib \ --disable-bzlib \ --disable-zstdlib \ --disable-lzlib ```