This commit is contained in:
Marc Beninca 2024-11-13 11:34:59 +01:00
parent 39fdabd885
commit a6e63a6722
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
4 changed files with 17 additions and 21 deletions

View file

@ -6,21 +6,21 @@ ps1() {
local path="${PWD}"
local user="${USER}"
local view="└ "
if [ ${code} -ne 0 ] ; then
if [ ${code} -ne 0 ]; then
view="${view}\e[0;31m"
else
view="${view}\e[0;32m"
fi
view="${view}${code}\e[0m @ \e[0;33m${date}\e[0m"
if [ "$(type -t __git_ps1)" == "function" ] ; then
if [ "$(type -t __git_ps1)" == "function" ]; then
git="$(__git_ps1)"
if [ "${git}" ] ; then
if [ "${git}" ]; then
view="${view} –\e[0;35m${git}\e[0m"
fi
fi
view="${view}\n\e[0;36m${path}\e[0m"
view="${view}\n┌ "
if [ ${EUID} -eq 0 ] ; then
if [ ${EUID} -eq 0 ]; then
view="${view}\e[0;31m"
else
view="${view}\e[0;32m"

View file

@ -1,7 +1,7 @@
mrc() {
local container="${1}"
local f
for f in "dev" "dev/pts" "proc" "sys" ; do
for f in "dev" "dev/pts" "proc" "sys"; do
mount --bind "/${f}" "overlay/mount/var/lib/lxc/${container}/squashfs-root/${f}"
done
}
@ -15,12 +15,11 @@ crc() {
urc() {
local container="${1}"
local f
for f in "sys" "proc" "dev/pts" "dev" ; do
for f in "sys" "proc" "dev/pts" "dev"; do
umount --lazy "overlay/mount/var/lib/lxc/${container}/squashfs-root/${f}"
done
}
mmc() {
local container="${1}"
mount --bind "/deb" "overlay/mount/var/lib/lxc/${container}/squashfs-root/deb"

View file

@ -1,13 +1,13 @@
mo() {
local directory="${1}"
local file
if [ -n "${directory}" ] ; then
if [ -n "${directory}" ]; then
directory="$(realpath "${directory}")"
file="${directory}/filesystem.squashfs"
if mkdir "overlay" ; then
if mkdir "overlay"; then
cd "overlay"
mkdir {lower,upper,work,mount}
if mount "${file}" "lower" ; then
if mount "${file}" "lower"; then
mount \
-o lowerdir="lower",upperdir="upper",workdir="work" \
-t "overlay" \
@ -22,10 +22,10 @@ mo() {
uo() {
cd "overlay"
if umount "mount" ; then
if umount "mount"; then
rmdir "mount"
rm --recursive "upper" "work"
if umount "lower" ; then
if umount "lower"; then
rmdir "lower"
fi
fi
@ -33,10 +33,9 @@ uo() {
rmdir "overlay"
}
mr() {
local f
for f in "dev" "dev/pts" "proc" "sys" ; do
for f in "dev" "dev/pts" "proc" "sys"; do
mount --bind "/${f}" "overlay/mount/${f}"
done
}
@ -54,12 +53,11 @@ chroot \
ur() {
local f
for f in "sys" "proc" "dev/pts" "dev" ; do
for f in "sys" "proc" "dev/pts" "dev"; do
umount --lazy "overlay/mount/${f}"
done
}
mm() {
mount --make-rslave --rbind "/deb" "overlay/mount/deb"
}
@ -68,12 +66,11 @@ um() {
umount --recursive "overlay/mount/deb"
}
ms() {
local directory="${1}"
local level="${2}"
if [ -n "${directory}" ] ; then
if mkdir "${directory}" ; then
if [ -n "${directory}" ]; then
if mkdir "${directory}"; then
[ -n "${level}" ] || level="18"
cp overlay/mount/{vmlinuz,initrd.img} "${directory}"
mksquashfs \