mirror of
https://github.com/andreili/SBC_builder.git
synced 2025-08-23 19:04:06 +02:00
Add portage overlays.
This commit is contained in:
parent
b65f940ed6
commit
e86266df6c
6625
cfg/kernel_work
6625
cfg/kernel_work
File diff suppressed because it is too large
Load Diff
2
files/portage/andreil/metadata/layout.conf
Normal file
2
files/portage/andreil/metadata/layout.conf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
masters = gentoo
|
||||||
|
auto-sync = false
|
1
files/portage/andreil/profiles/repo_name
Normal file
1
files/portage/andreil/profiles/repo_name
Normal file
@ -0,0 +1 @@
|
|||||||
|
andreil
|
1
files/portage/andreil/virtual/klipper/Manifest
Normal file
1
files/portage/andreil/virtual/klipper/Manifest
Normal file
@ -0,0 +1 @@
|
|||||||
|
EBUILD klipper-11.ebuild 603 BLAKE2B fe8ca3d46a257c6c056f8a2480afdb5270b3e370495d2fad3ebbf7b066b456c2b365c2e83c3c6d42a81018f6bbc2f15cb36be502fff3589343620e844cc21d41 SHA512 14dad1041e1ecaf645bb6c508089d292bc30cf644c656c127e8299c67e1866f5cafe016af8794c2a81f26f7d405c1ff558e9aca1e8c43a9b595ebe63c5b977fd
|
29
files/portage/andreil/virtual/klipper/klipper-11.ebuild
Normal file
29
files/portage/andreil/virtual/klipper/klipper-11.ebuild
Normal 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
|
||||||
|
"
|
1
files/portage/crossdev/cross-arm-none-eabi/binutils
Symbolic link
1
files/portage/crossdev/cross-arm-none-eabi/binutils
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
/var/db/repos/gentoo/sys-devel/binutils
|
1
files/portage/crossdev/cross-arm-none-eabi/gcc
Symbolic link
1
files/portage/crossdev/cross-arm-none-eabi/gcc
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
/var/db/repos/gentoo/sys-devel/gcc
|
1
files/portage/crossdev/cross-arm-none-eabi/gdb
Symbolic link
1
files/portage/crossdev/cross-arm-none-eabi/gdb
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
/var/db/repos/gentoo/dev-debug/gdb
|
1
files/portage/crossdev/cross-arm-none-eabi/newlib
Symbolic link
1
files/portage/crossdev/cross-arm-none-eabi/newlib
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
/var/db/repos/gentoo/sys-libs/newlib
|
5
files/portage/crossdev/metadata/layout.conf
Normal file
5
files/portage/crossdev/metadata/layout.conf
Normal 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
|
||||||
|
|
1
files/portage/crossdev/profiles/categories
Normal file
1
files/portage/crossdev/profiles/categories
Normal file
@ -0,0 +1 @@
|
|||||||
|
cross-arm-none-eabi
|
1
files/portage/crossdev/profiles/eapi
Normal file
1
files/portage/crossdev/profiles/eapi
Normal file
@ -0,0 +1 @@
|
|||||||
|
8
|
1
files/portage/crossdev/profiles/repo_name
Normal file
1
files/portage/crossdev/profiles/repo_name
Normal file
@ -0,0 +1 @@
|
|||||||
|
crossdev
|
@ -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
|
||||||
|
@ -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()
|
||||||
|
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user