Add portage overlays.

This commit is contained in:
andreili 2025-07-04 19:02:30 +02:00
parent b65f940ed6
commit e86266df6c
16 changed files with 102 additions and 6669 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
masters = gentoo
auto-sync = false

View File

@ -0,0 +1 @@
andreil

View File

@ -0,0 +1 @@
EBUILD klipper-11.ebuild 603 BLAKE2B fe8ca3d46a257c6c056f8a2480afdb5270b3e370495d2fad3ebbf7b066b456c2b365c2e83c3c6d42a81018f6bbc2f15cb36be502fff3589343620e844cc21d41 SHA512 14dad1041e1ecaf645bb6c508089d292bc30cf644c656c127e8299c67e1866f5cafe016af8794c2a81f26f7d405c1ff558e9aca1e8c43a9b595ebe63c5b977fd

View File

@ -0,0 +1,29 @@
EAPI=8
DESCRIPTION=""
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="mainsail"
RDEPEND="
dev-vcs/git
dev-python/pip
media-libs/openjpeg
dev-db/lmdb
dev-libs/libsodium
net-wireless/wireless-tools
x11-libs/wxGTK
x11-base/xorg-server
media-libs/libjpeg-turbo
sys-apps/systemd[policykit(+)]
app-admin/sudo
net-misc/networkmanager
sys-apps/usbutils
app-mobilephone/dfu-util
mainsail? ( www-servers/nginx )
media-video/ffmpeg[x264(+),x265(+)]
sci-libs/openblas
dev-python/matplotlib
sys-devel/crossdev
sys-apps/pciutils
"

View File

@ -0,0 +1 @@
/var/db/repos/gentoo/sys-devel/binutils

View File

@ -0,0 +1 @@
/var/db/repos/gentoo/sys-devel/gcc

View File

@ -0,0 +1 @@
/var/db/repos/gentoo/dev-debug/gdb

View File

@ -0,0 +1 @@
/var/db/repos/gentoo/sys-libs/newlib

View File

@ -0,0 +1,5 @@
# Autogenerated and managed by crossdev
# Delete the above line if you want to manage this file yourself
masters = gentoo
repo-name = crossdev

View File

@ -0,0 +1 @@
cross-arm-none-eabi

View File

@ -0,0 +1 @@
8

View File

@ -0,0 +1 @@
crossdev

View File

@ -1,48 +1,46 @@
#!/bin/sh #!/bin/sh
OS_DIR_DEF="./root/" OS_DIR_DEF="./root/"
DDIR=$(realpath "$1")
ROOT_DIR="$2"
#do_chroot() if [ -z "${DDIR}" ]
#{ then
if [ -z "$1" ] echo "No directory specified!"
then exit 1
DDIR=${OS_DIR_DEF} fi
else
DDIR=$(realpath "$1")
mount --bind ${OS_DIR_DEF}/usr/portage ${DDIR}/usr/portage
fi
mkdir -p ${DDIR}/usr/src/linux-6.14-rc7
if [ -z "${DDIR}" ] mkdir -p ${DDIR}/usr/portage
then mount --bind ${ROOT_DIR}/files/portage ${DDIR}/usr/portage
echo "No directory specified!" mkdir -p ${DDIR}/usr/src/linux-6.14-rc7
exit 1 mount --bind ${ROOT_DIR}/build/common/kernel ${DDIR}/usr/src/linux-6.14-rc7
fi
mount --bind /dev ${DDIR}/dev mount --bind /dev ${DDIR}/dev
mount --bind /dev/shm ${DDIR}/dev/shm mount --bind /dev/shm ${DDIR}/dev/shm
mount --bind /dev/pts ${DDIR}/dev/pts mount --bind /dev/pts ${DDIR}/dev/pts
mount --bind /sys ${DDIR}/sys mount --bind /sys ${DDIR}/sys
mount --bind /proc ${DDIR}/proc mount --bind /proc ${DDIR}/proc
if [ -d "/var/db/repos" ]; then
mount --bind /var/db/repos ${DDIR}/var/db/repos mount --bind /var/db/repos ${DDIR}/var/db/repos
mount --bind /mnt/work/SBC/universal/build/common/kernel ${DDIR}/usr/src/linux-6.14-rc7 fi
mount -t tmpfs tmpfs ${DDIR}/var/tmp/ mount -t tmpfs tmpfs ${DDIR}/var/tmp/
if [ -z "$2" ] if [ -z "$3" ]
then then
chroot ${DDIR}/ /bin/bash chroot ${DDIR}/ /bin/bash
else else
chroot ${DDIR}/ /bin/bash -c "${@:2}" chroot ${DDIR}/ /bin/bash -c "${@:3}"
fi fi
umount ${DDIR}/var/tmp umount ${DDIR}/var/tmp
umount ${DDIR}/usr/src/linux-6.14-rc7 umount ${DDIR}/usr/src/linux-6.14-rc7
if [ -d "/var/db/repos" ]; then
umount ${DDIR}/var/db/repos umount ${DDIR}/var/db/repos
umount ${DDIR}/proc fi
umount ${DDIR}/sys umount ${DDIR}/proc
umount ${DDIR}/dev/pts umount ${DDIR}/sys
umount ${DDIR}/dev/shm umount ${DDIR}/dev/pts
umount ${DDIR}/dev umount ${DDIR}/dev/shm
if [ -n "$1" ] umount ${DDIR}/dev
then if [ -n "$1" ]
umount ${DDIR}/usr/portage then
fi umount ${DDIR}/usr/portage
#} fi

View File

@ -42,7 +42,7 @@ class OS:
if (dir == ""): if (dir == ""):
dir = self.root_dir dir = self.root_dir
Logger.os(f"Start chroot'ed command '{command}' into '{dir}'") Logger.os(f"Start chroot'ed command '{command}' into '{dir}'")
self.__sudo(["bash", f"{ROOT_DIR}/scripts/chroot.sh", dir, command]) self.__sudo(["bash", f"{ROOT_DIR}/scripts/chroot.sh", dir, ROOT_DIR, command])
def umount_safe(self): def umount_safe(self):
self.__sudo(["umount", "--all-targets", "--recursive", self.root_dir]) self.__sudo(["umount", "--all-targets", "--recursive", self.root_dir])
@ -57,6 +57,9 @@ class OS:
def chroot(self): def chroot(self):
self.__chroot("") self.__chroot("")
def chroot_ext(self, command, dir):
self.__chroot(command, dir)
def sync_repo(self): def sync_repo(self):
self.__chroot("eix-sync -v") self.__chroot("eix-sync -v")
@ -146,10 +149,13 @@ class OS:
# enable network services # enable network services
services = "systemctl enable NetworkManager ntpdate sshd" services = "systemctl enable NetworkManager ntpdate sshd"
self.__chroot(services, dir) self.__chroot(services, dir)
# minimize systemd journal files
journal_min = "sed -i -E 's/^#(\\S+MaxUse)=$/\\1=10M/' /etc/systemd/journald.conf &&" journal_min = "sed -i -E 's/^#(\\S+MaxUse)=$/\\1=10M/' /etc/systemd/journald.conf &&"
journal_min += "sed -i -E 's/^#(\\S+MaxFileSize)=$/\\1=10M/' /etc/systemd/journald.conf" journal_min += "sed -i -E 's/^#(\\S+MaxFileSize)=$/\\1=10M/' /etc/systemd/journald.conf"
self.__chroot(journal_min, dir) self.__chroot(journal_min, dir)
self.__sudo(["cp", "-r", f"{ROOT_DIR}/files/firmware/usr", f"{dir}/"]) self.__sudo(["cp", "-r", f"{ROOT_DIR}/files/firmware/usr", f"{dir}/"])
soft = Software(self)
soft.finalize(dir)
def sqh(self): def sqh(self):
self.__fix_xorg() self.__fix_xorg()

View File

@ -3,9 +3,18 @@ from pathlib import Path
from . import * from . import *
class Software: class Software:
def __init__(self): def __init__(self, os):
self.os = os
js_fn = f"{ROOT_DIR}/config/software.json" js_fn = f"{ROOT_DIR}/config/software.json"
with open(js_fn) as json_data: with open(js_fn) as json_data:
json = json.load(json_data) js = json.load(json_data)
json_data.close() json_data.close()
self.user = json["user"] self.user = js["user"]
def finalize(self, dir):
cmd_user = f"useradd -m -G wheel,video,audio,disk,usb {self.user} --password {self.user}"
cmd_klipper = "sudo klipper 'cd ~ && git clone https://github.com/dw-0/kiauh.git --depth=1'"
cmd_venv = "sudo klipper 'cd ~ && python -m venv ~/venv'"
self.os.chroot_ext(cmd_user, dir)
self.os.chroot_ext(cmd_klipper, dir)
self.os.chroot_ext(cmd_venv, dir)