From 013e6bde892d111824a30e6cf915307d8c958437 Mon Sep 17 00:00:00 2001 From: sasha0552 Date: Wed, 20 Dec 2023 22:48:54 +0600 Subject: [PATCH] Initial commit --- .github/workflows/build.yml | 38 ++++ .gitmodules | 19 ++ LICENSE | 21 ++ README.md | 1 + airootfs/etc/group | 3 + airootfs/etc/gshadow | 2 + airootfs/etc/hostname | 1 + airootfs/etc/issue | 2 + airootfs/etc/locale.conf | 1 + airootfs/etc/localtime | 1 + airootfs/etc/lsb-release | 3 + airootfs/etc/mkinitcpio.conf.d/archiso.conf | 1 + airootfs/etc/mkinitcpio.d/linux.preset | 8 + airootfs/etc/passwd | 2 + airootfs/etc/shadow | 2 + airootfs/etc/sudoers | 3 + airootfs/etc/systemd/journald.conf | 2 + .../etc/systemd/network/20-ethernet.network | 10 + .../nvidia-persistenced.service | 1 + .../multi-user.target.wants/sshd.service | 1 + .../systemd-networkd.service | 1 + airootfs/home/tori/SillyTavern-Extras | 1 + airootfs/home/tori/automatic | 1 + airootfs/home/tori/koboldcpp | 1 + airootfs/home/tori/llama.cpp | 1 + airootfs/home/tori/text-generation-webui | 1 + airootfs/root/customize_airootfs.sh | 32 +++ .../files/automatic-config.json | 10 + .../0000-automatic-drop-pstate-in-idle.patch | 69 +++++++ .../0000-koboldcpp-drop-pstate-in-idle.patch | 54 +++++ .../0001-koboldcpp-faster-mixtral-pp.patch | 192 ++++++++++++++++++ .../0000-remove-git-submodule-pointers.sh | 5 + .../scripts/0100-automatic-patches.sh | 22 ++ .../scripts/0100-koboldcpp-patches.sh | 11 + .../scripts/1000-automatic-dependencies.sh | 17 ++ .../1000-sillytavern-extras-dependencies.sh | 19 ++ ...1000-text-generation-webui-dependencies.sh | 17 ++ airootfs/usr/lib/os-release.new | 11 + airootfs/usr/local/bin/nvidia-pstate | 96 +++++++++ bootstrap_packages.x86_64 | 2 + efiboot/loader/entries/00-default.conf | 5 + efiboot/loader/loader.conf | 1 + packages.x86_64 | 37 ++++ pacman.conf | 98 +++++++++ profiledef.sh | 22 ++ syslinux/syslinux.cfg | 5 + 46 files changed, 853 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .gitmodules create mode 100644 LICENSE create mode 100644 README.md create mode 100644 airootfs/etc/group create mode 100644 airootfs/etc/gshadow create mode 100644 airootfs/etc/hostname create mode 100644 airootfs/etc/issue create mode 100644 airootfs/etc/locale.conf create mode 120000 airootfs/etc/localtime create mode 100644 airootfs/etc/lsb-release create mode 100644 airootfs/etc/mkinitcpio.conf.d/archiso.conf create mode 100644 airootfs/etc/mkinitcpio.d/linux.preset create mode 100644 airootfs/etc/passwd create mode 100644 airootfs/etc/shadow create mode 100644 airootfs/etc/sudoers create mode 100644 airootfs/etc/systemd/journald.conf create mode 100644 airootfs/etc/systemd/network/20-ethernet.network create mode 120000 airootfs/etc/systemd/system/multi-user.target.wants/nvidia-persistenced.service create mode 120000 airootfs/etc/systemd/system/multi-user.target.wants/sshd.service create mode 120000 airootfs/etc/systemd/system/multi-user.target.wants/systemd-networkd.service create mode 160000 airootfs/home/tori/SillyTavern-Extras create mode 160000 airootfs/home/tori/automatic create mode 160000 airootfs/home/tori/koboldcpp create mode 160000 airootfs/home/tori/llama.cpp create mode 160000 airootfs/home/tori/text-generation-webui create mode 100644 airootfs/root/customize_airootfs.sh create mode 100644 airootfs/root/customize_airootfs/files/automatic-config.json create mode 100644 airootfs/root/customize_airootfs/patches/0000-automatic-drop-pstate-in-idle.patch create mode 100644 airootfs/root/customize_airootfs/patches/0000-koboldcpp-drop-pstate-in-idle.patch create mode 100644 airootfs/root/customize_airootfs/patches/0001-koboldcpp-faster-mixtral-pp.patch create mode 100644 airootfs/root/customize_airootfs/scripts/0000-remove-git-submodule-pointers.sh create mode 100644 airootfs/root/customize_airootfs/scripts/0100-automatic-patches.sh create mode 100644 airootfs/root/customize_airootfs/scripts/0100-koboldcpp-patches.sh create mode 100644 airootfs/root/customize_airootfs/scripts/1000-automatic-dependencies.sh create mode 100644 airootfs/root/customize_airootfs/scripts/1000-sillytavern-extras-dependencies.sh create mode 100644 airootfs/root/customize_airootfs/scripts/1000-text-generation-webui-dependencies.sh create mode 100644 airootfs/usr/lib/os-release.new create mode 100644 airootfs/usr/local/bin/nvidia-pstate create mode 100644 bootstrap_packages.x86_64 create mode 100644 efiboot/loader/entries/00-default.conf create mode 100644 efiboot/loader/loader.conf create mode 100644 packages.x86_64 create mode 100644 pacman.conf create mode 100644 profiledef.sh create mode 100644 syslinux/syslinux.cfg diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c956c65 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,38 @@ +name: Build ISO + +on: + push: + branches: main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Cleanup + uses: rokibhasansagar/slimhub_actions@main + with: + retain: "docker_imgcache,docker_buildkit,docker_imgcache" + + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Build image + uses: addnab/docker-run-action@v3 + with: + image: archlinux:latest + options: --privileged + run: | + # Refresh package databases + pacman --sync --noconfirm --refresh + + # Upgrade system + pacman --sync --noconfirm --sysupgrade + + # Install required packages + pacman --sync --noconfirm --needed archiso + + # Build image + mkarchiso -v . diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..081d29f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,19 @@ +[submodule "airootfs/home/tori/automatic"] + path = airootfs/home/tori/automatic + url = https://github.com/vladmandic/automatic.git + +[submodule "airootfs/home/tori/koboldcpp"] + path = airootfs/home/tori/koboldcpp + url = https://github.com/LostRuins/koboldcpp.git + +[submodule "airootfs/home/tori/llama.cpp"] + path = airootfs/home/tori/llama.cpp + url = https://github.com/ggerganov/llama.cpp.git + +[submodule "airootfs/home/tori/SillyTavern-Extras"] + path = airootfs/home/tori/SillyTavern-Extras + url = https://github.com/SillyTavern/SillyTavern-Extras.git + +[submodule "airootfs/home/tori/text-generation-webui"] + path = airootfs/home/tori/text-generation-webui + url = https://github.com/oobabooga/text-generation-webui.git diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5621a3f --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 sasha0552 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..83d694c --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# ToriLinux \ No newline at end of file diff --git a/airootfs/etc/group b/airootfs/etc/group new file mode 100644 index 0000000..ecf82f6 --- /dev/null +++ b/airootfs/etc/group @@ -0,0 +1,3 @@ +root:x:0:root +wheel:x:10:tori +tori:x:1000: diff --git a/airootfs/etc/gshadow b/airootfs/etc/gshadow new file mode 100644 index 0000000..e591438 --- /dev/null +++ b/airootfs/etc/gshadow @@ -0,0 +1,2 @@ +root:!*::root +tori:!*:: diff --git a/airootfs/etc/hostname b/airootfs/etc/hostname new file mode 100644 index 0000000..b178b22 --- /dev/null +++ b/airootfs/etc/hostname @@ -0,0 +1 @@ +torilinux diff --git a/airootfs/etc/issue b/airootfs/etc/issue new file mode 100644 index 0000000..e8ad0fb --- /dev/null +++ b/airootfs/etc/issue @@ -0,0 +1,2 @@ +Tori Linux \r (\l) + diff --git a/airootfs/etc/locale.conf b/airootfs/etc/locale.conf new file mode 100644 index 0000000..01ec548 --- /dev/null +++ b/airootfs/etc/locale.conf @@ -0,0 +1 @@ +LANG=en_US.UTF-8 diff --git a/airootfs/etc/localtime b/airootfs/etc/localtime new file mode 120000 index 0000000..0e35b57 --- /dev/null +++ b/airootfs/etc/localtime @@ -0,0 +1 @@ +/usr/share/zoneinfo/UTC \ No newline at end of file diff --git a/airootfs/etc/lsb-release b/airootfs/etc/lsb-release new file mode 100644 index 0000000..d4e896e --- /dev/null +++ b/airootfs/etc/lsb-release @@ -0,0 +1,3 @@ +DISTRIB_ID="Tori" +DISTRIB_RELEASE="rolling" +DISTRIB_DESCRIPTION="Tori Linux" diff --git a/airootfs/etc/mkinitcpio.conf.d/archiso.conf b/airootfs/etc/mkinitcpio.conf.d/archiso.conf new file mode 100644 index 0000000..d59fbd2 --- /dev/null +++ b/airootfs/etc/mkinitcpio.conf.d/archiso.conf @@ -0,0 +1 @@ +HOOKS=(base udev modconf kms memdisk archiso archiso_loop_mnt archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs block filesystems keyboard) diff --git a/airootfs/etc/mkinitcpio.d/linux.preset b/airootfs/etc/mkinitcpio.d/linux.preset new file mode 100644 index 0000000..8e85205 --- /dev/null +++ b/airootfs/etc/mkinitcpio.d/linux.preset @@ -0,0 +1,8 @@ +# mkinitcpio preset file for the 'linux' package on archiso + +PRESETS=('archiso') + +ALL_kver='/boot/vmlinuz-linux' +archiso_config='/etc/mkinitcpio.conf.d/archiso.conf' + +archiso_image="/boot/initramfs-linux.img" diff --git a/airootfs/etc/passwd b/airootfs/etc/passwd new file mode 100644 index 0000000..27649b7 --- /dev/null +++ b/airootfs/etc/passwd @@ -0,0 +1,2 @@ +root:x:0:0:root:/root:/usr/bin/zsh +tori:x:1000:1000::/home/tori:/usr/bin/zsh diff --git a/airootfs/etc/shadow b/airootfs/etc/shadow new file mode 100644 index 0000000..6a57f9b --- /dev/null +++ b/airootfs/etc/shadow @@ -0,0 +1,2 @@ +root:!*::::::: +tori:!*::::::: diff --git a/airootfs/etc/sudoers b/airootfs/etc/sudoers new file mode 100644 index 0000000..0dcc09b --- /dev/null +++ b/airootfs/etc/sudoers @@ -0,0 +1,3 @@ +Defaults lecture="never" + +%wheel ALL=(ALL:ALL) ALL diff --git a/airootfs/etc/systemd/journald.conf b/airootfs/etc/systemd/journald.conf new file mode 100644 index 0000000..74beb58 --- /dev/null +++ b/airootfs/etc/systemd/journald.conf @@ -0,0 +1,2 @@ +[Journal] +Storage=none diff --git a/airootfs/etc/systemd/network/20-ethernet.network b/airootfs/etc/systemd/network/20-ethernet.network new file mode 100644 index 0000000..177e0aa --- /dev/null +++ b/airootfs/etc/systemd/network/20-ethernet.network @@ -0,0 +1,10 @@ +[Match] +# Matching with "Type=ether" causes issues with containers because it also matches virtual Ethernet interfaces (veth*). +# See https://bugs.archlinux.org/task/70892 +# Instead match by globbing the network interface name. +Name=en* +Name=eth* + +[Network] +DHCP=yes +MulticastDNS=yes diff --git a/airootfs/etc/systemd/system/multi-user.target.wants/nvidia-persistenced.service b/airootfs/etc/systemd/system/multi-user.target.wants/nvidia-persistenced.service new file mode 120000 index 0000000..28c0a35 --- /dev/null +++ b/airootfs/etc/systemd/system/multi-user.target.wants/nvidia-persistenced.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/nvidia-persistenced.service \ No newline at end of file diff --git a/airootfs/etc/systemd/system/multi-user.target.wants/sshd.service b/airootfs/etc/systemd/system/multi-user.target.wants/sshd.service new file mode 120000 index 0000000..d21ebd9 --- /dev/null +++ b/airootfs/etc/systemd/system/multi-user.target.wants/sshd.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/sshd.service \ No newline at end of file diff --git a/airootfs/etc/systemd/system/multi-user.target.wants/systemd-networkd.service b/airootfs/etc/systemd/system/multi-user.target.wants/systemd-networkd.service new file mode 120000 index 0000000..4c158e6 --- /dev/null +++ b/airootfs/etc/systemd/system/multi-user.target.wants/systemd-networkd.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/systemd-networkd.service \ No newline at end of file diff --git a/airootfs/home/tori/SillyTavern-Extras b/airootfs/home/tori/SillyTavern-Extras new file mode 160000 index 0000000..47a5489 --- /dev/null +++ b/airootfs/home/tori/SillyTavern-Extras @@ -0,0 +1 @@ +Subproject commit 47a54891428bd3a9a923048b1a1b2fa3676ccd5f diff --git a/airootfs/home/tori/automatic b/airootfs/home/tori/automatic new file mode 160000 index 0000000..00281e1 --- /dev/null +++ b/airootfs/home/tori/automatic @@ -0,0 +1 @@ +Subproject commit 00281e15d2f4d50b53fa892bae4e1cfa56e7ecd6 diff --git a/airootfs/home/tori/koboldcpp b/airootfs/home/tori/koboldcpp new file mode 160000 index 0000000..ec05230 --- /dev/null +++ b/airootfs/home/tori/koboldcpp @@ -0,0 +1 @@ +Subproject commit ec052307035091123af865b4ce19e03e487ba98d diff --git a/airootfs/home/tori/llama.cpp b/airootfs/home/tori/llama.cpp new file mode 160000 index 0000000..799fc22 --- /dev/null +++ b/airootfs/home/tori/llama.cpp @@ -0,0 +1 @@ +Subproject commit 799fc2268989482054944c902874cca76337580f diff --git a/airootfs/home/tori/text-generation-webui b/airootfs/home/tori/text-generation-webui new file mode 160000 index 0000000..489f4a2 --- /dev/null +++ b/airootfs/home/tori/text-generation-webui @@ -0,0 +1 @@ +Subproject commit 489f4a23bf7ceba1568d3f82c540fa2ed4ca5809 diff --git a/airootfs/root/customize_airootfs.sh b/airootfs/root/customize_airootfs.sh new file mode 100644 index 0000000..4b4ade3 --- /dev/null +++ b/airootfs/root/customize_airootfs.sh @@ -0,0 +1,32 @@ +#!/bin/bash +set -eu + +# move new os-release to its place +mv /usr/lib/os-release.new /usr/lib/os-release + +# set user password +echo "tori:tori" | chpasswd + +# disable alternate screen capability +echo "termcapinfo * ti=:te=" >> /etc/skel/.screenrc + +# enter user directory +cd "/home/tori" + +# customize_airootfs temporary directory +export CUSTOMIZE_AIROOTFS=/root/customize_airootfs + +# execute scripts +for script in $CUSTOMIZE_AIROOTFS/scripts/*.sh; do + # print current script + echo "===> Executing script $script" + + # add execution permission + chmod +x "$script" + + # launch script as user + su tori -c "$script" +done + +# remove customize_airootfs temporary directory +rm -r "$CUSTOMIZE_AIROOTFS" diff --git a/airootfs/root/customize_airootfs/files/automatic-config.json b/airootfs/root/customize_airootfs/files/automatic-config.json new file mode 100644 index 0000000..787ad06 --- /dev/null +++ b/airootfs/root/customize_airootfs/files/automatic-config.json @@ -0,0 +1,10 @@ +{ + "precision": "Full", + "cuda_dtype": "FP32", + "no_half": true, + "no_half_vae": true, + + "cross_attention_options": [ + "SDP disable memory attention" + ] +} diff --git a/airootfs/root/customize_airootfs/patches/0000-automatic-drop-pstate-in-idle.patch b/airootfs/root/customize_airootfs/patches/0000-automatic-drop-pstate-in-idle.patch new file mode 100644 index 0000000..d044483 --- /dev/null +++ b/airootfs/root/customize_airootfs/patches/0000-automatic-drop-pstate-in-idle.patch @@ -0,0 +1,69 @@ +--- a/launch.py ++++ b/launch.py +@@ -7,6 +7,7 @@ import shlex + import subprocess + from functools import lru_cache + import installer ++from modules.pstates import enter_pstate_low + + + commandline_args = os.environ.get('COMMANDLINE_ARGS', "") +@@ -165,6 +166,7 @@ def start_server(immediate=True, server=None): + + + if __name__ == "__main__": ++ enter_pstate_low() + installer.ensure_base_requirements() + init_args() # setup argparser and default folders + installer.args = args +diff --git a/modules/pstates.py b/modules/pstates.py +new file mode 100644 +index 00000000..44865a87 +--- /dev/null ++++ b/modules/pstates.py +@@ -0,0 +1,17 @@ ++import os ++import subprocess ++ ++def _set_pstate(pstate): ++ visible_devices = os.getenv("CUDA_VISIBLE_DEVICES") ++ ++ if visible_devices: ++ for device in visible_devices.split(","): ++ subprocess.check_call([ "nvidia-pstate", "-i", device, "-ps", pstate ], stdout=subprocess.DEVNULL) ++ else: ++ subprocess.check_call([ "nvidia-pstate", "-ps", pstate ], stdout=subprocess.DEVNULL) ++ ++def enter_pstate_low(): ++ _set_pstate("8") ++ ++def enter_pstate_high(): ++ _set_pstate("16") +--- a/modules/shared_state.py ++++ b/modules/shared_state.py +@@ -3,6 +3,7 @@ import sys + import time + import datetime + from modules.errors import log ++from modules.pstates import enter_pstate_high, enter_pstate_low + + + class State: +@@ -77,6 +78,8 @@ class State: + self.time_start = time.time() + if self.debug_output: + log.debug(f'State begin: {self.job}') ++ if self.job != "load": ++ enter_pstate_high() + modules.devices.torch_gc() + + def end(self): +@@ -86,6 +89,8 @@ class State: + self.time_start = time.time() + if self.debug_output: + log.debug(f'State end: {self.job} time={time.time() - self.time_start:.2f}') ++ if self.job != "load": ++ enter_pstate_low() + self.job = "" + self.job_count = 0 + self.job_no = 0 diff --git a/airootfs/root/customize_airootfs/patches/0000-koboldcpp-drop-pstate-in-idle.patch b/airootfs/root/customize_airootfs/patches/0000-koboldcpp-drop-pstate-in-idle.patch new file mode 100644 index 0000000..552737e --- /dev/null +++ b/airootfs/root/customize_airootfs/patches/0000-koboldcpp-drop-pstate-in-idle.patch @@ -0,0 +1,54 @@ +--- a/koboldcpp.py ++++ b/koboldcpp.py +@@ -13,6 +13,7 @@ import os + import argparse + import json, sys, http.server, time, asyncio, socket, threading + from concurrent.futures import ThreadPoolExecutor ++from pstates import enter_pstate_high, enter_pstate_low + + sampler_order_max = 7 + stop_token_max = 16 +@@ -301,6 +302,7 @@ def load_model(model_filename): + return ret + + def generate(prompt, memory="", max_length=32, max_context_length=512, temperature=0.7, top_k=100, top_a=0.0, top_p=0.92, min_p=0.0, typical_p=1.0, tfs=1.0, rep_pen=1.1, rep_pen_range=128, mirostat=0, mirostat_tau=5.0, mirostat_eta=0.1, sampler_order=[6,0,1,3,4,2,5], seed=-1, stop_sequence=[], use_default_badwordsids=False, stream_sse=False, grammar='', grammar_retain_state=False, genkey='', trimstop=False, quiet=False): ++ enter_pstate_high() + global maxctx, args, currentusergenkey, totalgens + inputs = generation_inputs() + outputs = ctypes.create_unicode_buffer(ctypes.sizeof(generation_outputs)) +@@ -364,6 +366,7 @@ def generate(prompt, memory="", max_length=32, max_context_length=512, temperatu + sindex = outstr.find(trim_str) + if sindex != -1 and trim_str!="": + outstr = outstr[:sindex] ++ enter_pstate_low() + return outstr + + def utfprint(str): +@@ -2031,6 +2034,7 @@ def sanitize_string(input_string): + return sanitized_string + + def main(launch_args,start_server=True): ++ enter_pstate_low() + global args, friendlymodelname + args = launch_args + embedded_kailite = None +--- /dev/null ++++ b/pstates.py +@@ -0,0 +1,17 @@ ++import os ++import subprocess ++ ++def _set_pstate(pstate): ++ visible_devices = os.getenv("CUDA_VISIBLE_DEVICES") ++ ++ if visible_devices: ++ for device in visible_devices.split(","): ++ subprocess.check_call([ "nvidia-pstate", "-i", device, "-ps", pstate ], stdout=subprocess.DEVNULL) ++ else: ++ subprocess.check_call([ "nvidia-pstate", "-ps", pstate ], stdout=subprocess.DEVNULL) ++ ++def enter_pstate_low(): ++ _set_pstate("8") ++ ++def enter_pstate_high(): ++ _set_pstate("16") diff --git a/airootfs/root/customize_airootfs/patches/0001-koboldcpp-faster-mixtral-pp.patch b/airootfs/root/customize_airootfs/patches/0001-koboldcpp-faster-mixtral-pp.patch new file mode 100644 index 0000000..083be5e --- /dev/null +++ b/airootfs/root/customize_airootfs/patches/0001-koboldcpp-faster-mixtral-pp.patch @@ -0,0 +1,192 @@ +From 799fc2268989482054944c902874cca76337580f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Johannes=20G=C3=A4=C3=9Fler?= +Date: Wed, 20 Dec 2023 15:41:22 +0100 +Subject: [PATCH] CUDA: Faster Mixtral prompt processing (#4538) + +* CUDA: make MoE tensors contiguous for batch size>1 + +* Update ggml-cuda.cu + +Co-authored-by: slaren + +--------- + +Co-authored-by: slaren +--- + ggml-cuda.cu | 116 ++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 92 insertions(+), 24 deletions(-) + +diff --git a/ggml-cuda.cu b/ggml-cuda.cu +index f20846fef8de..9f4b188cbb0d 100644 +--- a/ggml-cuda.cu ++++ b/ggml-cuda.cu +@@ -7830,6 +7830,11 @@ static void ggml_cuda_set_peer_access(const int n_tokens) { + } + + #ifdef NDEBUG ++ for (int id = 0; id < g_device_count; ++id) { ++ CUDA_CHECK(ggml_cuda_set_device(id)); ++ CUDA_CHECK(cudaDeviceSynchronize()); ++ } ++ + for (int id = 0; id < g_device_count; ++id) { + CUDA_CHECK(ggml_cuda_set_device(id)); + +@@ -7881,8 +7886,6 @@ static void ggml_cuda_op_mul_mat( + const int nb2 = dst->nb[2]; + const int nb3 = dst->nb[3]; + +- ggml_cuda_set_peer_access(ne11); +- + GGML_ASSERT(dst->backend != GGML_BACKEND_GPU_SPLIT); + GGML_ASSERT(src1->backend != GGML_BACKEND_GPU_SPLIT); + +@@ -8781,16 +8784,21 @@ static void ggml_cuda_mul_mat_id(const ggml_tensor * src0, const ggml_tensor * s + + GGML_ASSERT(dst->backend == GGML_BACKEND_GPU); + ++ const int64_t nb11 = src1->nb[1]; ++ const int64_t nb1 = dst->nb[1]; ++ + const struct ggml_tensor * ids = src0; + const int32_t id = ((int32_t *) dst->op_params)[0]; + const int32_t n_as = ((int32_t *) dst->op_params)[1]; + + std::vector ids_host(ggml_nbytes(ids)); + ++ const cudaStream_t stream = g_cudaStreams[g_main_device][0]; ++ + if (ids->backend == GGML_BACKEND_GPU) { + const char * ids_dev = (const char *)((const ggml_tensor_extra_gpu *)ids->extra)->data_device[g_main_device]; +- CUDA_CHECK(cudaMemcpyAsync(ids_host.data(), ids_dev, ggml_nbytes(ids), cudaMemcpyDeviceToHost, g_cudaStreams[g_main_device][0])); +- CUDA_CHECK(cudaStreamSynchronize(g_cudaStreams[g_main_device][0])); ++ CUDA_CHECK(cudaMemcpyAsync(ids_host.data(), ids_dev, ggml_nbytes(ids), cudaMemcpyDeviceToHost, stream)); ++ CUDA_CHECK(cudaStreamSynchronize(stream)); + } else { + memcpy(ids_host.data(), ids->data, ggml_nbytes(ids)); + } +@@ -8804,37 +8812,93 @@ static void ggml_cuda_mul_mat_id(const ggml_tensor * src0, const ggml_tensor * s + ggml_tensor src1_row = *src1; + ggml_tensor dst_row = *dst; + +- src1_row.ne[1] = 1; +- dst_row.ne[1] = 1; ++ src1_row.extra = &src1_row_extra; ++ dst_row.extra = &dst_row_extra; + +- src1_row.nb[2] = src1_row.nb[1]; +- dst_row.nb[2] = dst_row.nb[1]; ++ char * src1_original = (char *) src1_extra->data_device[g_main_device]; ++ char * dst_original = (char *) dst_extra->data_device[g_main_device]; + +- src1_row.nb[3] = src1_row.nb[1]; +- dst_row.nb[3] = dst_row.nb[1]; ++ if (src1->ne[1] == 1) { ++ for (int64_t i01 = 0; i01 < ids->ne[1]; i01++) { ++ //int32_t row_id; ++ //CUDA_CHECK(cudaMemcpyAsync(&row_id, ids_dev + i01*ids->nb[1] + id*ids->nb[0], sizeof(int32_t), cudaMemcpyDeviceToHost, g_cudaStreams[g_main_device][0])); ++ //CUDA_CHECK(cudaStreamSynchronize(g_cudaStreams[g_main_device][0])); + +- src1_row.extra = &src1_row_extra; +- dst_row.extra = &dst_row_extra; ++ const int32_t row_id = *(const int32_t *) (ids_host.data() + i01*ids->nb[1] + id*ids->nb[0]); + ++ GGML_ASSERT(row_id >= 0 && row_id < n_as); + +- for (int64_t i01 = 0; i01 < ids->ne[1]; i01++) { +- //int32_t row_id; +- //CUDA_CHECK(cudaMemcpyAsync(&row_id, ids_dev + i01*ids->nb[1] + id*ids->nb[0], sizeof(int32_t), cudaMemcpyDeviceToHost, g_cudaStreams[g_main_device][0])); +- //CUDA_CHECK(cudaStreamSynchronize(g_cudaStreams[g_main_device][0])); ++ const struct ggml_tensor * src0_row = dst->src[row_id + 2]; + +- const int32_t row_id = *(const int32_t *) (ids_host.data() + i01*ids->nb[1] + id*ids->nb[0]); ++ src1_row_extra.data_device[g_main_device] = src1_original + i01*src1->nb[1]; ++ src1_row.data = (char *) src1->data + i01*src1->nb[1]; // TODO why is this set? + +- GGML_ASSERT(row_id >= 0 && row_id < n_as); ++ dst_row_extra.data_device[g_main_device] = dst_original + i01*dst->nb[1]; ++ dst_row.data = (char *) dst->data + i01*dst->nb[1]; // TODO why is this set? + +- const struct ggml_tensor * src0_row = dst->src[row_id + 2]; ++ ggml_cuda_mul_mat(src0_row, &src1_row, &dst_row); ++ } ++ } else { ++ size_t as_src1, as_dst; ++ char * src1_contiguous = (char *) ggml_cuda_pool_malloc(sizeof(float)*ggml_nelements(src1), &as_src1); ++ char * dst_contiguous = (char *) ggml_cuda_pool_malloc(sizeof(float)*ggml_nelements(dst), &as_dst); + +- src1_row_extra.data_device[g_main_device] = (char *) src1_extra->data_device[g_main_device] + i01*src1->nb[1]; +- src1_row.data = (char *) src1->data + i01*src1->nb[1]; ++ src1_row_extra.data_device[g_main_device] = src1_contiguous; ++ dst_row_extra.data_device[g_main_device] = dst_contiguous; ++ ++ for (int32_t row_id = 0; row_id < n_as; ++row_id) { ++ const struct ggml_tensor * src0_row = dst->src[row_id + 2]; ++ ++ int64_t num_src1_rows = 0; ++ for (int64_t i01 = 0; i01 < ids->ne[1]; i01++) { ++ const int32_t row_id_i = *(const int32_t *) (ids_host.data() + i01*ids->nb[1] + id*ids->nb[0]); ++ ++ if (row_id_i != row_id) { ++ continue; ++ } + +- dst_row_extra.data_device[g_main_device] = (char *) dst_extra->data_device[g_main_device] + i01*dst->nb[1]; +- dst_row.data = (char *) dst->data + i01*dst->nb[1]; ++ GGML_ASSERT(row_id >= 0 && row_id < n_as); + +- ggml_cuda_mul_mat(src0_row, &src1_row, &dst_row); ++ CUDA_CHECK(cudaMemcpyAsync(src1_contiguous + num_src1_rows*nb11, src1_original + i01*nb11, ++ nb11, cudaMemcpyDeviceToDevice, stream)); ++ num_src1_rows++; ++ } ++ ++ if (num_src1_rows == 0) { ++ continue; ++ } ++ ++ src1_row.ne[1] = num_src1_rows; ++ dst_row.ne[1] = num_src1_rows; ++ ++ src1_row.nb[1] = nb11; ++ src1_row.nb[2] = num_src1_rows*nb11; ++ src1_row.nb[3] = num_src1_rows*nb11; ++ ++ dst_row.nb[1] = nb1; ++ dst_row.nb[2] = num_src1_rows*nb1; ++ dst_row.nb[3] = num_src1_rows*nb1; ++ ++ ggml_cuda_mul_mat(src0_row, &src1_row, &dst_row); ++ ++ num_src1_rows = 0; ++ for (int64_t i01 = 0; i01 < ids->ne[1]; i01++) { ++ const int32_t row_id_i = *(const int32_t *) (ids_host.data() + i01*ids->nb[1] + id*ids->nb[0]); ++ ++ if (row_id_i != row_id) { ++ continue; ++ } ++ ++ GGML_ASSERT(row_id >= 0 && row_id < n_as); ++ ++ CUDA_CHECK(cudaMemcpyAsync(dst_original + i01*nb1, dst_contiguous + num_src1_rows*nb1, ++ nb1, cudaMemcpyDeviceToDevice, stream)); ++ num_src1_rows++; ++ } ++ } ++ ++ ggml_cuda_pool_free(src1_contiguous, as_src1); ++ ggml_cuda_pool_free(dst_contiguous, as_dst); + } + } + +@@ -9370,6 +9434,10 @@ bool ggml_cuda_compute_forward(struct ggml_compute_params * params, struct ggml_ + return false; + } + ++ if (tensor->src[0] != nullptr && tensor->src[0]->backend == GGML_BACKEND_GPU_SPLIT) { ++ ggml_cuda_set_peer_access(tensor->src[1]->ne[1]); ++ } ++ + if (params->ith != 0) { + return true; + } diff --git a/airootfs/root/customize_airootfs/scripts/0000-remove-git-submodule-pointers.sh b/airootfs/root/customize_airootfs/scripts/0000-remove-git-submodule-pointers.sh new file mode 100644 index 0000000..5ad1dcc --- /dev/null +++ b/airootfs/root/customize_airootfs/scripts/0000-remove-git-submodule-pointers.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -eu + +# remove git submodule pointers to the root project +find -type f -name .git -exec rm {} \; diff --git a/airootfs/root/customize_airootfs/scripts/0100-automatic-patches.sh b/airootfs/root/customize_airootfs/scripts/0100-automatic-patches.sh new file mode 100644 index 0000000..23c6c08 --- /dev/null +++ b/airootfs/root/customize_airootfs/scripts/0100-automatic-patches.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -eu + +# automatic patches +pushd "automatic" + # remove git dependency + sed -i '/installer.check_modified_files()/d' launch.py + sed -i '/installer.install_submodules()/d' launch.py + sed -i '/installer.update_wiki()/d' launch.py + sed -i 's/installer.check_timestamp()/False/g' launch.py + + # remove internet dependency + sed -i '/installer.check_version()/d' launch.py + sed -i 's/lambda: {"choices": theme.list_themes()}, refresh=theme.refresh_themes/{"choices": ["black-teal"]}/g' modules/shared.py + sed -i 's/shared.opts.motd/False/g' modules/api/api.py + + # drop pstate in idle + patch -p1 < "$CUSTOMIZE_AIROOTFS/patches/0000-automatic-drop-pstate-in-idle.patch" + + # copy config + cp "$CUSTOMIZE_AIROOTFS/files/automatic-config.json" "config.json" +popd diff --git a/airootfs/root/customize_airootfs/scripts/0100-koboldcpp-patches.sh b/airootfs/root/customize_airootfs/scripts/0100-koboldcpp-patches.sh new file mode 100644 index 0000000..bff3ed8 --- /dev/null +++ b/airootfs/root/customize_airootfs/scripts/0100-koboldcpp-patches.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -eu + +# koboldcpp patches +pushd "koboldcpp" + # drop pstate in idle + patch -p1 < "$CUSTOMIZE_AIROOTFS/patches/0000-koboldcpp-drop-pstate-in-idle.patch" + + # faster mixtral prompt processing + patch -p1 < "$CUSTOMIZE_AIROOTFS/patches/0001-koboldcpp-faster-mixtral-pp.patch" +popd diff --git a/airootfs/root/customize_airootfs/scripts/1000-automatic-dependencies.sh b/airootfs/root/customize_airootfs/scripts/1000-automatic-dependencies.sh new file mode 100644 index 0000000..e857bfa --- /dev/null +++ b/airootfs/root/customize_airootfs/scripts/1000-automatic-dependencies.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -eu + +# automatic dependencies +pushd "automatic" + # create venv + python3 -m venv venv + + # activate venv + source venv/bin/activate + + # disable package caching + export PIP_NO_CACHE_DIR=0 + + # install dependencies + python3 launch.py --test +popd diff --git a/airootfs/root/customize_airootfs/scripts/1000-sillytavern-extras-dependencies.sh b/airootfs/root/customize_airootfs/scripts/1000-sillytavern-extras-dependencies.sh new file mode 100644 index 0000000..cf9d401 --- /dev/null +++ b/airootfs/root/customize_airootfs/scripts/1000-sillytavern-extras-dependencies.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -eu + +# SillyTavern-Extras dependencies +pushd "SillyTavern-Extras" + # create venv + python3 -m venv venv + + # activate venv + source venv/bin/activate + + # disable package caching + export PIP_NO_CACHE_DIR=0 + + # install dependencies + pip3 install -r requirements.txt + pip3 install -r requirements-coqui.txt + pip3 install -r requirements-rvc.txt +popd diff --git a/airootfs/root/customize_airootfs/scripts/1000-text-generation-webui-dependencies.sh b/airootfs/root/customize_airootfs/scripts/1000-text-generation-webui-dependencies.sh new file mode 100644 index 0000000..19667d9 --- /dev/null +++ b/airootfs/root/customize_airootfs/scripts/1000-text-generation-webui-dependencies.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -eu + +# text-generation-webui dependencies +pushd "text-generation-webui" + # create venv + python3 -m venv venv + + # activate venv + source venv/bin/activate + + # disable package caching + export PIP_NO_CACHE_DIR=0 + + # install dependencies + pip3 install -r requirements.txt +popd diff --git a/airootfs/usr/lib/os-release.new b/airootfs/usr/lib/os-release.new new file mode 100644 index 0000000..8442993 --- /dev/null +++ b/airootfs/usr/lib/os-release.new @@ -0,0 +1,11 @@ +NAME="Tori Linux" +PRETTY_NAME="Tori Linux" +ID=tori +BUILD_ID=rolling +ANSI_COLOR="38;2;23;147;209" +HOME_URL="https://github.com/sasha0552/ToriLinux" +DOCUMENTATION_URL="https://github.com/sasha0552/ToriLinux" +SUPPORT_URL="https://github.com/sasha0552/ToriLinux/issues" +BUG_REPORT_URL="https://github.com/sasha0552/ToriLinux/issues" +PRIVACY_POLICY_URL="https://github.com/sasha0552/ToriLinux" +LOGO=torilinux-logo diff --git a/airootfs/usr/local/bin/nvidia-pstate b/airootfs/usr/local/bin/nvidia-pstate new file mode 100644 index 0000000..3730127 --- /dev/null +++ b/airootfs/usr/local/bin/nvidia-pstate @@ -0,0 +1,96 @@ +#!/usr/bin/env python3 + +import argparse +import ctypes + +# Library +_lib = ctypes.CDLL("libnvidia-api.so") + +# QueryInterface +_nvapi_QueryInterface = _lib.nvapi_QueryInterface +_nvapi_QueryInterface.argtypes = [ctypes.c_int] +_nvapi_QueryInterface.restype = ctypes.c_void_p +def nvapi_QueryInterface(address: int) -> ctypes.c_void_p: + return _nvapi_QueryInterface(address) + +# Initialize NvAPI +_NvAPI_Initialize_ptr = nvapi_QueryInterface(0x0150e828) +_NvAPI_Initialize_proto = ctypes.CFUNCTYPE(ctypes.c_int) +_NvAPI_Initialize = ctypes.cast(_NvAPI_Initialize_ptr, _NvAPI_Initialize_proto) +def NvAPI_Initialize() -> int: + return _NvAPI_Initialize() + +# Unload NvAPI +_NvAPI_Unload_ptr = nvapi_QueryInterface(0xd22bdd7e) +_NvAPI_Unload_proto = ctypes.CFUNCTYPE(ctypes.c_int) +_NvAPI_Unload = ctypes.cast(_NvAPI_Unload_ptr, _NvAPI_Unload_proto) +def NvAPI_Unload() -> int: + return _NvAPI_Unload() + +# Get GPU list +_NvAPI_EnumPhysicalGPUs_ptr = nvapi_QueryInterface(0xe5ac921f) +_NvAPI_EnumPhysicalGPUs_proto = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_void_p, ctypes.c_void_p) +_NvAPI_EnumPhysicalGPUs = ctypes.cast(_NvAPI_EnumPhysicalGPUs_ptr, _NvAPI_EnumPhysicalGPUs_proto) +def NvAPI_EnumPhysicalGPUs(gpu_array: ctypes.c_void_p, gpu_count: ctypes.c_void_p) -> int: + return _NvAPI_EnumPhysicalGPUs(gpu_array, gpu_count) + +# Force Perfomance State +_NvAPI_GPU_SetForcePstate_ptr = nvapi_QueryInterface(0x025bfb10) +_NvAPI_GPU_SetForcePstate_proto = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_void_p, ctypes.c_int, ctypes.c_int) +_NvAPI_GPU_SetForcePstate = ctypes.cast(_NvAPI_GPU_SetForcePstate_ptr, _NvAPI_GPU_SetForcePstate_proto) +def NvAPI_GPU_SetForcePstate(gpu: ctypes.c_void_p, state: int, int3: int) -> int: + return _NvAPI_GPU_SetForcePstate(gpu, state, int3) + +# Function to set performance state +def set_performance_state(gpu_array, gpu_count, gpu_id, pstate): + if not (0 <= gpu_id < gpu_count): + print(f"Invalid GPU ID: {args.id}") + return + + if NvAPI_GPU_SetForcePstate(gpu_array[gpu_id], pstate, 2) == 0: + print(f"Performance state has been set successfully for gpu #{gpu_id}") + else: + print(f"Failed to set performance state for gpu #{gpu_id}") + +# Entry point +def main(): + # Argument parser setup + parser = argparse.ArgumentParser() + parser.add_argument("-i", "--id", type=int, dest="id", help="Target a specific GPU.") + parser.add_argument("-ps", "--performance-state", dest="pstate", default=16, type=int, help="Specifies performance state.") + + # Command line arguments + args = parser.parse_args() + + # Array to hold GPU handles + gpu_array = (ctypes.c_void_p * 64)() + + # Integer to hold GPU count + gpu_count = ctypes.pointer(ctypes.c_int32()) + + # Initialize NvAPI + if NvAPI_Initialize() != 0: + print("Failed to initialize NvAPI") + return + + # Enumerate GPUs + if NvAPI_EnumPhysicalGPUs(gpu_array, gpu_count) != 0: + print("Failed to enumerate GPUs") + return + + # GPU count as int + gpu_count_int = gpu_count.contents.value + + # Set performance state for specified GPU or all GPUs + if args.id is None: + for i in range(gpu_count_int): + set_performance_state(gpu_array, gpu_count_int, i, args.pstate) + else: + set_performance_state(gpu_array, gpu_count_int, args.id, args.pstate) + + # Unload NvAPI + if NvAPI_Unload() != 0: + print("Failed to unload NvAPI") + +if __name__ == "__main__": + main() diff --git a/bootstrap_packages.x86_64 b/bootstrap_packages.x86_64 new file mode 100644 index 0000000..64966d0 --- /dev/null +++ b/bootstrap_packages.x86_64 @@ -0,0 +1,2 @@ +arch-install-scripts +base diff --git a/efiboot/loader/entries/00-default.conf b/efiboot/loader/entries/00-default.conf new file mode 100644 index 0000000..9f01b47 --- /dev/null +++ b/efiboot/loader/entries/00-default.conf @@ -0,0 +1,5 @@ +linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux +initrd /%INSTALL_DIR%/boot/amd-ucode.img +initrd /%INSTALL_DIR%/boot/intel-ucode.img +initrd /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img +options archisobasedir=%INSTALL_DIR% archisodevice=UUID=%ARCHISO_UUID% cow_spacesize=1G diff --git a/efiboot/loader/loader.conf b/efiboot/loader/loader.conf new file mode 100644 index 0000000..3a2b359 --- /dev/null +++ b/efiboot/loader/loader.conf @@ -0,0 +1 @@ +default 00-default.conf diff --git a/packages.x86_64 b/packages.x86_64 new file mode 100644 index 0000000..ab0d8c4 --- /dev/null +++ b/packages.x86_64 @@ -0,0 +1,37 @@ +amd-ucode +base +base-devel +btop +cmake +cuda +curl +darkhttpd +ffmpeg +gcc12 +git +grml-zsh-config +htop +intel-ucode +less +linux +linux-firmware +mkinitcpio +mkinitcpio-archiso +mkinitcpio-nfs-utils +nano +ncdu +neofetch +nfs-utils +nvidia +nvidia-utils +nvtop +openssh +pv +python-pip +qemu-guest-agent +reptyr +screen +sudo +syslinux +wget +zsh diff --git a/pacman.conf b/pacman.conf new file mode 100644 index 0000000..f382fab --- /dev/null +++ b/pacman.conf @@ -0,0 +1,98 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = auto + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +#Color +#NoProgressBar +# We cannot check disk space from within a chroot environment +#CheckSpace +#VerbosePkgLists +ParallelDownloads = 5 + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Arch Linux +# packagers with `pacman-key --populate archlinux`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +#[core-testing] +#Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +#[extra-testing] +#Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +# If you want to run 32 bit applications on your x86_64 system, +# enable the multilib repositories as required here. + +#[multilib-testing] +#Include = /etc/pacman.d/mirrorlist + +#[multilib] +#Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs diff --git a/profiledef.sh b/profiledef.sh new file mode 100644 index 0000000..58dec80 --- /dev/null +++ b/profiledef.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# shellcheck disable=SC2034 + +iso_name="torilinux" +iso_label="TORI_$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" "+%Y%m%d_%H%M%S")" +iso_publisher="Tori Linux" +iso_application="Tori Linux" +iso_version="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" "+%Y-%m-%d_%H-%M-%S")" +install_dir="tori" +buildmodes=("iso") +bootmodes=("bios.syslinux.mbr" "bios.syslinux.eltorito" + "uefi-ia32.systemd-boot.esp" "uefi-x64.systemd-boot.esp" + "uefi-ia32.systemd-boot.eltorito" "uefi-x64.systemd-boot.eltorito") +arch="x86_64" +pacman_conf="pacman.conf" +airootfs_image_type="squashfs" +airootfs_image_tool_options=("-comp" "lz4" "-Xhc") +file_permissions=( + ["/etc/gshadow"]="0:0:400" + ["/etc/shadow"]="0:0:400" + ["/usr/local/bin/nvidia-pstate"]="0:0:755" +) diff --git a/syslinux/syslinux.cfg b/syslinux/syslinux.cfg new file mode 100644 index 0000000..3ebc87c --- /dev/null +++ b/syslinux/syslinux.cfg @@ -0,0 +1,5 @@ +DEFAULT default +LABEL default +LINUX /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux +INITRD /%INSTALL_DIR%/boot/amd-ucode.img,/%INSTALL_DIR%/boot/intel-ucode.img,/%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img +APPEND archisobasedir=%INSTALL_DIR% archisodevice=UUID=%ARCHISO_UUID% cow_spacesize=1G