Init, adding corrade,magnum,magnum-plugins,magnum-integration,magnum-extras, and magnum-examples 2025.47_1

This commit is contained in:
2025-11-19 13:35:26 +02:00
parent 6031ef978f
commit 17b687c5c1
346 changed files with 28087 additions and 12 deletions

View File

@@ -0,0 +1,13 @@
CHROOT STYLES
=============
This directory contains scripts to perform the chroot operation with xbps-src.
The scripts should accept at least 5 arguments:
- $1 (MASTERDIR) masterdir to chroot
- $2 (DISTDIR) path to the void-packages directory
- $3 (HOSTDIR) path to hostdir
- $4 (EXTRA_ARGS) additional arguments to be passed
- $5 (CMD) command to execute
- $@ remaining arguments to pass

31
common/chroot-style/bwrap.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/sh
#
# This chroot script uses bubblewrap (see https://github.com/containers/bubblewrap)
#
set -e
readonly MASTERDIR="$1"
readonly DISTDIR="$2"
readonly HOSTDIR="$3"
readonly EXTRA_ARGS="$4"
shift 4
if ! command -v bwrap >/dev/null 2>&1; then
exit 1
fi
if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
echo "$0 MASTERDIR/DISTDIR not set"
exit 1
fi
if [ -z "$XBPS_TEMP_MASTERDIR" ]; then
exec bwrap --bind "$MASTERDIR" / \
--ro-bind "$DISTDIR" /void-packages \
--dev /dev --tmpfs /tmp --proc /proc \
${HOSTDIR:+--bind "$HOSTDIR" /host} ${EXTRA_ARGS} "$@"
else
exec bwrap --overlay-src "$MASTERDIR" --tmp-overlay / \
--ro-bind "$DISTDIR" /void-packages \
--dev /dev --tmpfs /tmp --proc /proc \
${HOSTDIR:+--bind "$HOSTDIR" /host} ${EXTRA_ARGS} "$@"
fi

135
common/chroot-style/ethereal.sh Executable file
View File

@@ -0,0 +1,135 @@
#!/bin/sh
#
# This chroot script uses symlinks to emulate being in a chroot using
# the host system as the masterdir
#
# It will damage your host system, only use it in disposable
# containers.
#
# 2 extra steps required when using this chroot-style:
# 1. Symlink / to masterdir inside the void-packages repo
# 2. write the arch of the host system, as dictated by xbps-uhelper arch
# into /.xbps_chroot_init
#
# The supported way to make use of thie chroot-style is to create
# a root filesystem that has base-chroot and git installed and
# have it inside a container engine like Docker.
#
# Docker example:
# $ mkdir -p /tmp/image
# $ xbps-install -y -r /tmp/image \
# -R http://mirrors.servercentral.com/voidlinux/current \
# -S base-chroot
# $ tar -pC /tmp/image -c . | sudo docker import - voidlinux/masterdir
# $ rm -rf /tmp/image
# # docker run --rm -it \
# -e XBPS_CHROOT_CMD=ethereal \
# -e XBPS_ALLOW_CHROOT_BREAKOUT=yes \
# -v $(pwd):/hostrepo voidlinux/masterdir \
# /bin/bash -c 'ln -s / /hostrepo/masterdir && /hostrepo/xbps-src pkg <pkgname>'
#
readonly MASTERDIR="$1"
readonly DISTDIR="$2"
readonly HOSTDIR="$3"
readonly EXTRA_ARGS="$4"
readonly CMD="$5"
shift 5
if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
echo "$0 MASTERDIR/DISTDIR not set"
exit 1
fi
msg_red() {
# error messages in bold/red
[ -n "$NOCOLORS" ] || printf >&2 "\033[1m\033[31m"
printf "=> ERROR: %s\\n" "$@" >&2
[ -n "$NOCOLORS" ] || printf >&2 "\033[m"
}
fake_mount() {
# If we already have a symlink from the desired place
# to the base location then just return 0
if [ -L "$2" -a "$(readlink "$2")" = "$1" ]; then
return 0
fi
if [ -d "$2" ] && ! rmdir "$2" >/dev/null 2>&1; then
msg_red "Failed to remove $2, not empty ?\n"
exit 1
fi
[ -f "$2" -o -L "$2" ] && rm -f "$2"
ln -s "$1" "$2"
echo "linked $2 -> $1"
}
if [ "${XBPS_ALLOW_CHROOT_BREAKOUT}" != "yes" ]; then
msg_red "chroot-style 'ethereal' requires XBPS_ALLOW_CHROOT_BREAKOUT=yes\n"
msg_red "This chroot-style is meant for disposable containers and will destroy your system\n"
exit 1
fi
if [ ! -L "$MASTERDIR" -o "$(readlink "$MASTERDIR")" != "/" ]; then
msg_red "$MASTERDIR isn't symlinked to /!\n"
exit 1
fi
fake_mount "$DISTDIR" "$MASTERDIR"/void-packages
# Do the same for hostdir
if [ -n "$HOSTDIR" ]; then
fake_mount "$HOSTDIR" "$MASTERDIR"/host
fi
# xbps-src may send some other binds, parse them here
while getopts 'b:' c -- "$EXTRA_ARGS"; do
# Skip everything that's not a bind
[ "$c" = "b" ] || continue
from="${OPTARG%:*}"
to="${OPTARG#*:}"
fake_mount "$from" "$to"
mounts="${mounts} $to"
done
# Store current directory for returning later
OLDPWD="$(pwd)"
# To give the illusion we entered the chroot, cd to /
cd / || {
msg_red "Failed to change directory to root!\n"
exit 1 ; }
# Tell xbps-src that we are "in the chroot"
# Start with `env` so our environment var's stay the same
env IN_CHROOT=1 $CMD $@
# Store return of the command we care about
ret="$?"
# Return to OLDPWD
cd "${OLDPWD}"
# Remove the symlink and restore an empty dir to simulate
# an umount operation.
if [ -n "$HOSTDIR" ]; then
rm -f "$MASTERDIR"/host
mkdir -p "$MASTERDIR"/host
fi
# Same as the operation above, do it all for all mountpoints
# that were passed to us.
for m in $mounts; do
rm -f "$m"
mkdir -p "$m"
done
rm -f "$MASTERDIR"/void-packages
mkdir -p "$MASTERDIR"/void-packages
exit $ret

36
common/chroot-style/uchroot.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/sh
#
# This chroot script uses xbps-uchroot(1).
#
readonly MASTERDIR="$1"
readonly DISTDIR="$2"
readonly HOSTDIR="$3"
readonly EXTRA_ARGS="$4"
readonly CMD="$5"
shift 5
msg_red() {
# error messages in bold/red
[ -n "$NOCOLORS" ] || printf >&2 "\033[1m\033[31m"
printf "=> ERROR: %s\\n" "$@" >&2
[ -n "$NOCOLORS" ] || printf >&2 "\033[m"
}
readonly XBPS_UCHROOT_CMD="$(command -v xbps-uchroot 2>/dev/null)"
if [ -z "$XBPS_UCHROOT_CMD" ]; then
msg_red "could not find xbps-uchroot"
exit 1
fi
if ! [ -x "$XBPS_UCHROOT_CMD" ]; then
msg_red "xbps-uchroot is not executable. Are you in the $(stat -c %G "$XBPS_UCHROOT_CMD") group?"
exit 1
fi
if [ -z "$MASTERDIR" ] || [ -z "$DISTDIR" ]; then
msg_red "$0: MASTERDIR/DISTDIR not set"
exit 1
fi
exec xbps-uchroot ${XBPS_TEMP_MASTERDIR:+-O} $EXTRA_ARGS -b $DISTDIR:/void-packages ${HOSTDIR:+-b $HOSTDIR:/host} -- $MASTERDIR $CMD "$@"

21
common/chroot-style/uunshare.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/sh
#
# This chroot script uses xbps-uunshare(1) with user_namespaces(7).
#
readonly MASTERDIR="$1"
readonly DISTDIR="$2"
readonly HOSTDIR="$3"
readonly EXTRA_ARGS="$4"
readonly CMD="$5"
shift 5
if ! command -v xbps-uunshare >/dev/null 2>&1; then
exit 1
fi
if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
echo "$0 MASTERDIR/DISTDIR not set"
exit 1
fi
exec xbps-uunshare $EXTRA_ARGS -b $DISTDIR:/void-packages ${HOSTDIR:+-b $HOSTDIR:/host} -- $MASTERDIR $CMD $@