Compare commits
3 Commits
b344241b33
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| c2fcde0f26 | |||
| a60bcf941b | |||
| c200c89b75 |
@@ -2,3 +2,12 @@ debian/clean_environment
|
|||||||
debian/test_environment
|
debian/test_environment
|
||||||
debian/debootstrap
|
debian/debootstrap
|
||||||
debian/debootstrap.tar.gz
|
debian/debootstrap.tar.gz
|
||||||
|
|
||||||
|
void/clean_environment
|
||||||
|
void/test_environment
|
||||||
|
void/xbps-static*.tar.xz
|
||||||
|
|
||||||
|
arch/archlinux-bootstrap*.tar.zst
|
||||||
|
arch/clean_environment
|
||||||
|
arch/test_environment
|
||||||
|
arch/pkglist.x86_64.txt
|
||||||
|
|||||||
Executable
+102
@@ -0,0 +1,102 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if test `id -u` -ne 0
|
||||||
|
then
|
||||||
|
echo "$0 must be run as root."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
FRESH=clean_environment
|
||||||
|
ROOT=test_environment
|
||||||
|
|
||||||
|
add_mount() {
|
||||||
|
if mountpoint -q "$ROOT$1"
|
||||||
|
then
|
||||||
|
echo "$ROOT$1 already mounted."
|
||||||
|
else
|
||||||
|
echo "Mounting $2$1 to $ROOT$1"
|
||||||
|
mkdir -p "$ROOT$1"
|
||||||
|
mount -o bind "$2$1" "$ROOT$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_mount() {
|
||||||
|
if mountpoint -q "$ROOT$1"
|
||||||
|
then
|
||||||
|
echo "Unmounting $ROOT$1"
|
||||||
|
umount -l "$ROOT$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
add_mounts() {
|
||||||
|
add_mount / "$ROOT"
|
||||||
|
add_mount /proc
|
||||||
|
add_mount /sys
|
||||||
|
add_mount /dev
|
||||||
|
add_mount /dev/pts
|
||||||
|
add_mount /tmp/.X11-unix
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_mounts() {
|
||||||
|
remove_mount /tmp/.X11-unix
|
||||||
|
remove_mount /dev/pts
|
||||||
|
remove_mount /dev
|
||||||
|
remove_mount /sys
|
||||||
|
remove_mount /proc
|
||||||
|
remove_mount /
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_environment() {
|
||||||
|
if test -d "$ROOT"
|
||||||
|
then
|
||||||
|
# Call this script that automatically unmounts the mount points too.
|
||||||
|
remove_mounts
|
||||||
|
echo "Removing $ROOT"
|
||||||
|
rm -r "$ROOT"
|
||||||
|
else
|
||||||
|
echo "No environment found at $ROOT. Doing nothing."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_everything() {
|
||||||
|
if test -d "$ROOT"
|
||||||
|
then
|
||||||
|
# Call this script that automatically unmounts the mount points too.
|
||||||
|
remove_environment
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -d "$FRESH"
|
||||||
|
then
|
||||||
|
echo "Removing $FRESH"
|
||||||
|
rm -r "$FRESH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -d debootstrap
|
||||||
|
then
|
||||||
|
echo "Removing debootstrap"
|
||||||
|
rm -r debootstrap
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -f pkglist.x86_64.txt
|
||||||
|
then
|
||||||
|
echo "Removing pkglist.x86_64.txt"
|
||||||
|
rm pkglist.x86_64.txt
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -f archlinux-bootstrap*.tar.zst
|
||||||
|
then
|
||||||
|
echo "Removing archlinux bootstrap tarballs."
|
||||||
|
rm archlinux-bootstrap*.tar.zst
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
everything) remove_everything ;;
|
||||||
|
mounts) remove_mounts ;;
|
||||||
|
add_mounts) add_mounts ;;
|
||||||
|
environment) remove_environment ;;
|
||||||
|
"") remove_environment ;;
|
||||||
|
esac
|
||||||
|
|
||||||
Executable
+50
@@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if test `id -u` -ne 0
|
||||||
|
then
|
||||||
|
echo "$0 must be run as root."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
ROOT=test_environment
|
||||||
|
FRESH=clean_environment
|
||||||
|
|
||||||
|
TARBALL=archlinux-bootstrap-x86_64.tar.zst
|
||||||
|
REPO="https://geo.mirror.pkgbuild.com"
|
||||||
|
|
||||||
|
if test -e "$FRESH"
|
||||||
|
then
|
||||||
|
echo "Clean arch environment found at $FRESH. Good."
|
||||||
|
else
|
||||||
|
echo "No arch environment found at $FRESH, downloading from $REPO"
|
||||||
|
curl -O "$REPO/iso/latest/$TARBALL"
|
||||||
|
tar -xf "$TARBALL"
|
||||||
|
mv root.x86_64 "$FRESH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -e "$ROOT"
|
||||||
|
then
|
||||||
|
echo "Existing installation found at $ROOT, removing."
|
||||||
|
./cleanup
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Copying $FRESH to $ROOT."
|
||||||
|
cp -r "$FRESH" "$ROOT"
|
||||||
|
|
||||||
|
echo "Initializing $ROOT."
|
||||||
|
|
||||||
|
./cleanup add_mounts
|
||||||
|
|
||||||
|
chmod 1777 "$ROOT/tmp"
|
||||||
|
|
||||||
|
echo 'Server = http://ftp.swin.edu.au/archlinux/$repo/os/$arch' > "$ROOT/etc/pacman.d/mirrorlist"
|
||||||
|
cp /etc/resolv.conf "$ROOT/etc/resolv.conf"
|
||||||
|
|
||||||
|
|
||||||
|
cp -r install_scripts "$ROOT/root"
|
||||||
|
|
||||||
|
chroot "$ROOT" /root/install_scripts/user_setup "$@" || echo Script failed.
|
||||||
|
|
||||||
|
./cleanup mounts
|
||||||
Executable
+22
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if test `id -u` -ne 0
|
||||||
|
then
|
||||||
|
echo "$0 must be run as root."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
ROOT=test_environment
|
||||||
|
|
||||||
|
if test -e "$ROOT"
|
||||||
|
then
|
||||||
|
echo "Using existing environment in $ROOT."
|
||||||
|
else
|
||||||
|
./create_environment
|
||||||
|
fi
|
||||||
|
|
||||||
|
./cleanup add_mounts
|
||||||
|
|
||||||
|
chroot "$ROOT" sudo -iu user "$@"
|
||||||
|
|
||||||
|
./cleanup mounts
|
||||||
Executable
+29
@@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Finds pacstrap in $PATH, or download some version of it if not found.
|
||||||
|
# This script prefers to use local copies that are already downloaded, over
|
||||||
|
# system-wide installations, in case you want to test on some specific
|
||||||
|
# outdated version of pacstrap.
|
||||||
|
|
||||||
|
LOCALDIR=`pwd`/arch-install-scripts
|
||||||
|
if test -e "$LOCALDIR/pacstrap"
|
||||||
|
then
|
||||||
|
echo "Found $LOCALDIR/pacstrap in current directory"
|
||||||
|
|
||||||
|
# Run pacstrap without installing it to the system.
|
||||||
|
bash "$LOCALDIR/pacstrap" "$@"
|
||||||
|
elif IT=`command -v pacstrap`
|
||||||
|
then
|
||||||
|
echo "Found $IT in PATH"
|
||||||
|
|
||||||
|
# Use the version of pacstrap that was already installed.
|
||||||
|
pacstrap "$@"
|
||||||
|
else
|
||||||
|
echo "pacstrap not found. Downloading to $LOCALDIR."
|
||||||
|
git clone https://gitlab.archlinux.org/archlinux/arch-install-scripts
|
||||||
|
make -C arch-install-scripts pacstrap
|
||||||
|
|
||||||
|
# Run pacstrap without installing it to the system.
|
||||||
|
bash "$LOCALDIR/pacstrap" "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
Executable
+10
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
sudo pacman -S wget erlang erlang-wx --noconfirm
|
||||||
|
|
||||||
|
wget -q https://zxq9.com/projects/zomp/get_zx && bash get_zx
|
||||||
|
export PATH=$PATH:$HOME/bin
|
||||||
|
|
||||||
|
zx import realm install_scripts/qpq.zrf
|
||||||
|
zx import realm install_scripts/uwiger.zrf
|
||||||
|
zx run qpq-gajumine
|
||||||
Binary file not shown.
Executable
+23
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
pacman-key --init
|
||||||
|
pacman-key --populate archlinux
|
||||||
|
pacman -Sy sudo --noconfirm
|
||||||
|
|
||||||
|
# Overwrite locale setting specified before the chroot
|
||||||
|
export LANG=C
|
||||||
|
export LC_ALL=C
|
||||||
|
|
||||||
|
# Add a passwordless sudoer
|
||||||
|
useradd -m -s /bin/bash -G wheel user
|
||||||
|
passwd -d user
|
||||||
|
echo "user ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/user"
|
||||||
|
chmod 0440 "/etc/sudoers.d/user"
|
||||||
|
|
||||||
|
# Copy the install scripts into their home directory
|
||||||
|
cp -r ~/install_scripts /home/user
|
||||||
|
chown -R user:user /home/user/install_scripts
|
||||||
|
|
||||||
|
# su to this new user... Or sudo -iu, since we want to pass in arguments too.
|
||||||
|
cd /home/user
|
||||||
|
sudo -iu user "$@"
|
||||||
Binary file not shown.
Vendored
-25
@@ -1,25 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if test `id -u` -ne 0
|
|
||||||
then
|
|
||||||
echo "$0 must be run as root."
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
ROOT=test_environment
|
|
||||||
|
|
||||||
check_mount() {
|
|
||||||
if mountpoint "$ROOT$1" > /dev/null
|
|
||||||
then
|
|
||||||
echo "$ROOT$1 already mounted."
|
|
||||||
else
|
|
||||||
mkdir -p "$ROOT$1"
|
|
||||||
mount -o bind "$1" "$ROOT$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
check_mount /proc
|
|
||||||
check_mount /sys
|
|
||||||
check_mount /dev
|
|
||||||
check_mount /dev/pts
|
|
||||||
|
|
||||||
Executable
+86
@@ -0,0 +1,86 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if test `id -u` -ne 0
|
||||||
|
then
|
||||||
|
echo "$0 must be run as root."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
FRESH=clean_environment
|
||||||
|
ROOT=test_environment
|
||||||
|
|
||||||
|
add_mount() {
|
||||||
|
if mountpoint "$ROOT$1" -q
|
||||||
|
then
|
||||||
|
echo "$ROOT$1 already mounted."
|
||||||
|
else
|
||||||
|
echo "Mounting $1 to $ROOT$1"
|
||||||
|
mkdir -p "$ROOT$1"
|
||||||
|
mount -o bind "$1" "$ROOT$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_mount() {
|
||||||
|
if mountpoint "$ROOT$1" -q
|
||||||
|
then
|
||||||
|
echo "Unmounting $ROOT$1"
|
||||||
|
umount "$ROOT$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
add_mounts() {
|
||||||
|
add_mount /proc
|
||||||
|
add_mount /sys
|
||||||
|
add_mount /dev
|
||||||
|
add_mount /dev/pts
|
||||||
|
add_mount /tmp/.X11-unix
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_mounts() {
|
||||||
|
remove_mount /tmp/.X11-unix
|
||||||
|
remove_mount /dev/pts
|
||||||
|
remove_mount /dev
|
||||||
|
remove_mount /sys
|
||||||
|
remove_mount /proc
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_environment() {
|
||||||
|
if test -d "$ROOT"
|
||||||
|
then
|
||||||
|
# Call this script that automatically unmounts the mount points too.
|
||||||
|
remove_mounts
|
||||||
|
echo "Removing $ROOT"
|
||||||
|
rm -r "$ROOT"
|
||||||
|
else
|
||||||
|
echo "No environment found at $ROOT. Doing nothing."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_everything() {
|
||||||
|
if test -d "$ROOT"
|
||||||
|
then
|
||||||
|
# Call this script that automatically unmounts the mount points too.
|
||||||
|
remove_environment
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -d "$FRESH"
|
||||||
|
then
|
||||||
|
echo "Removing $FRESH"
|
||||||
|
rm -r "$FRESH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -f xbps-static*.tar.xz
|
||||||
|
then
|
||||||
|
echo "Removing xbps-static tarballs."
|
||||||
|
rm xbps-static*.tar.xz
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
everything) remove_everything ;;
|
||||||
|
mounts) remove_mounts ;;
|
||||||
|
add_mounts) add_mounts ;;
|
||||||
|
environment) remove_environment ;;
|
||||||
|
"") remove_environment ;;
|
||||||
|
esac
|
||||||
|
|
||||||
Executable
+63
@@ -0,0 +1,63 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if test `id -u` -ne 0
|
||||||
|
then
|
||||||
|
echo "$0 must be run as root."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
ROOT=test_environment
|
||||||
|
FRESH=clean_environment
|
||||||
|
|
||||||
|
TARBALL=xbps-static-static-0.59_5.x86_64-musl.tar.xz
|
||||||
|
# See https://xmirror.voidlinux.org/ for other mirrors.
|
||||||
|
REPO=https://ftp.swin.edu.au/voidlinux
|
||||||
|
|
||||||
|
if test -e "$FRESH"
|
||||||
|
then
|
||||||
|
echo "Void installation found at $FRESH. Good."
|
||||||
|
else
|
||||||
|
if test -e "$TARBALL"
|
||||||
|
then
|
||||||
|
echo "Tarball found."
|
||||||
|
else
|
||||||
|
URL="$REPO/static/$TARBALL"
|
||||||
|
echo "Fetching tarball from $URL"
|
||||||
|
curl "$URL" -O
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir "$FRESH"
|
||||||
|
tar xf "$TARBALL" -C "$FRESH"
|
||||||
|
|
||||||
|
mkdir -p "$FRESH/etc/xbps.d"
|
||||||
|
echo "repository=$REPO/current" > "$FRESH/etc/xbps.d/00-repository-main.conf"
|
||||||
|
|
||||||
|
XBPS_ARCH=x86_64 "$FRESH/usr/bin/xbps-install.static" -r "$FRESH" -S base-system
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -e "$ROOT"
|
||||||
|
then
|
||||||
|
echo "Existing installation found at $ROOT, removing."
|
||||||
|
./cleanup
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Copying $FRESH to $ROOT."
|
||||||
|
cp -r "$FRESH" "$ROOT"
|
||||||
|
|
||||||
|
echo "Initializing $ROOT."
|
||||||
|
|
||||||
|
chmod 1777 "$ROOT"
|
||||||
|
chmod 1777 "$ROOT/bin"
|
||||||
|
chmod 1777 "$ROOT/tmp"
|
||||||
|
chmod 4755 "$ROOT/usr/bin/sudo"
|
||||||
|
|
||||||
|
# Add DNS configs
|
||||||
|
cp /etc/resolv.conf "$ROOT/etc/resolv.conf"
|
||||||
|
|
||||||
|
cp -r install_scripts "$ROOT/root"
|
||||||
|
|
||||||
|
./cleanup add_mounts
|
||||||
|
|
||||||
|
chroot "$ROOT" /root/install_scripts/user_setup "$@"
|
||||||
|
|
||||||
|
./cleanup mounts
|
||||||
Executable
+22
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if test `id -u` -ne 0
|
||||||
|
then
|
||||||
|
echo "$0 must be run as root."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
ROOT=test_environment
|
||||||
|
|
||||||
|
if test -e "$ROOT"
|
||||||
|
then
|
||||||
|
echo "Using existing environment in $ROOT."
|
||||||
|
else
|
||||||
|
./create_environment
|
||||||
|
fi
|
||||||
|
|
||||||
|
./cleanup add_mounts
|
||||||
|
|
||||||
|
chroot "$ROOT" sudo -iu user "$@"
|
||||||
|
|
||||||
|
./cleanup mounts
|
||||||
Executable
+21
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
sudo xbps-install -y curl wget git gcc autoconf make libxslt noto-fonts-ttf \
|
||||||
|
wxWidgets-gtk3-devel openssl-devel ncurses-devel glu-devel
|
||||||
|
|
||||||
|
mkdir ~/bin
|
||||||
|
ln -s /usr/bin/wx-config-gtk3 ~/bin/wx-config
|
||||||
|
export PATH=$PATH:$HOME/bin
|
||||||
|
|
||||||
|
curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl
|
||||||
|
chmod a+x kerl
|
||||||
|
./kerl build 27.3.4 27.3.4
|
||||||
|
./kerl install 27.3.4 ~/.erts/27.3.4
|
||||||
|
echo '. "$HOME"/.erts/27.3.4/activate' >> .bashrc
|
||||||
|
. ~/.erts/27.3.4/activate
|
||||||
|
|
||||||
|
wget -q https://zxq9.com/projects/zomp/get_zx && bash get_zx
|
||||||
|
|
||||||
|
zx import realm ~/install_scripts/qpq.zrf
|
||||||
|
zx import realm ~/install_scripts/uwiger.zrf
|
||||||
|
zx run qpq-gajumine
|
||||||
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
sudo xbps-install wget erlang-wx noto-fonts-ttf
|
||||||
|
|
||||||
|
wget -q https://zxq9.com/projects/zomp/get_zx && bash get_zx
|
||||||
|
export PATH=$PATH:$HOME/bin
|
||||||
|
|
||||||
|
zx run gajudesk
|
||||||
Binary file not shown.
Executable
+19
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Overwrite locale setting specified before the chroot
|
||||||
|
#export LANG=C
|
||||||
|
#export LC_ALL=C
|
||||||
|
|
||||||
|
# Add a passwordless sudoer
|
||||||
|
useradd -m -s /bin/bash -G wheel user
|
||||||
|
passwd -d user
|
||||||
|
echo "user ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/user"
|
||||||
|
chmod 0440 "/etc/sudoers.d/user"
|
||||||
|
|
||||||
|
# Copy the install scripts into their home directory
|
||||||
|
cp -r /root/install_scripts /home/user
|
||||||
|
#chown -R user:user /home/user/install_scripts
|
||||||
|
|
||||||
|
# su to this new user... Or sudo -iu, since we want to pass in arguments too.
|
||||||
|
cd /home/user
|
||||||
|
sudo -iu user "$@"
|
||||||
Binary file not shown.
Reference in New Issue
Block a user