chroot-manager: More cpp packages; arch-chroot loader; xephyer pid handling

This commit is contained in:
itdominator 2024-06-18 21:34:43 -05:00
parent a143a5ab56
commit 2cefc6c953
2 changed files with 35 additions and 6 deletions

Binary file not shown.

View File

@ -10,6 +10,7 @@
PREMAKE_URL="https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-linux.tar.gz" PREMAKE_URL="https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-linux.tar.gz"
BAZELISK_URL="https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-arm64" BAZELISK_URL="https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-arm64"
BOOST_URL="https://archives.boost.io/release/1.82.0/source/boost_1_82_0.zip"
CHROOT_FOLDERS_PATH="/home/abaddon/Portable_Apps/chroot-dev-envs" CHROOT_FOLDERS_PATH="/home/abaddon/Portable_Apps/chroot-dev-envs"
DEV_BASHRC_FILE="/home/developer/.bashrc" DEV_BASHRC_FILE="/home/developer/.bashrc"
@ -53,6 +54,7 @@ function _install_software() {
wget \ wget \
curl \ curl \
zip \ zip \
unzip \
7zip \ 7zip \
procps \ procps \
file \ file \
@ -103,12 +105,14 @@ function install_cpp_software() {
cat << EOF | sudo chroot --userspec=developer:developer --groups=sudo,developer "${chroot_env}" cat << EOF | sudo chroot --userspec=developer:developer --groups=sudo,developer "${chroot_env}"
. /home/developer/.bashrc . /home/developer/.bashrc
cd cd
mkdir -p premake mkdir -p apps/premake
cd premake cd apps/premake
wget -O premake.tar.gz $PREMAKE_URL wget -O premake.tar.gz $PREMAKE_URL
tar xvf *.tar.gz tar xvf *.tar.gz && rm *.tar.gz
rm *.tar.gz echo ${DEV_PASSWORD} | /bin/sudo -S ln -s `pwd`/premake5 /bin/premake
echo ${DEV_PASSWORD} | /bin/sudo -S ln -s ~/premake/premake5 /bin/premake cd ~/apps
wget -O boost.zip ${BOOST_URL}
unzip boost.zip
wget -O bazelisk ${BAZELISK_URL} wget -O bazelisk ${BAZELISK_URL}
chmod +x bazelisk chmod +x bazelisk
chown root:root bazelisk chown root:root bazelisk
@ -343,6 +347,8 @@ EOF
echo "export XAUTHORITY=~/.Xauthority" >> ~/.bashrc echo "export XAUTHORITY=~/.Xauthority" >> ~/.bashrc
echo $'export HOMEBREW_NO_ANALYTICS=1\n' >> ~/.bashrc echo $'export HOMEBREW_NO_ANALYTICS=1\n' >> ~/.bashrc
mkdir -p ~/projects mkdir -p ~/projects
mkdir -p ~/apps
mkdir -p ~/includes
EOF EOF
} }
@ -370,6 +376,28 @@ function load_chroot() {
kill -2 ${XEPHYR_PID} kill -2 ${XEPHYR_PID}
} }
function load_chroot_arch() {
clear
cd "${CHROOT_FOLDERS_PATH}"
chroot_env=$(_get_chroot_env " " "Load Chroot Venv:")
cd "${chroot_env}"
sudo cp /etc/resolv.conf etc/resolv.conf
sudo cp /etc/hosts etc/hosts
Xephyr -resizeable -screen "${SCREEN_W}"x"${SCREEN_H}" "${X_PORT}" &
XEPHYR_PID=$!
sudo arch-chroot . bash
# Note: Run in unshare mode. This will use unshare(1) to create a new mount
# and user namespace, allowing regular users to create new system installations.
# sudo arch-chroot -N . bash
kill -2 ${XEPHYR_PID}
}
function load_chroot_sysd() { function load_chroot_sysd() {
clear clear
cd "${CHROOT_FOLDERS_PATH}" cd "${CHROOT_FOLDERS_PATH}"
@ -382,10 +410,11 @@ function load_chroot_sysd() {
sudo cp /etc/hosts etc/hosts sudo cp /etc/hosts etc/hosts
Xephyr -resizeable -screen "${SCREEN_W}"x"${SCREEN_H}" "${X_PORT}" & Xephyr -resizeable -screen "${SCREEN_W}"x"${SCREEN_H}" "${X_PORT}" &
XEPHYR_PID=$!
sudo systemd-nspawn -D . /sbin/init sudo systemd-nspawn -D . /sbin/init
killall Xephyr kill -2 ${XEPHYR_PID}
} }
function poweroff_chroot_sysd() { function poweroff_chroot_sysd() {