[scripts] global update

This commit is contained in:
max/sooulix 2024-09-22 09:22:28 +02:00
parent 674510d075
commit 63bf25be02
5 changed files with 43 additions and 2 deletions

View File

@ -2,10 +2,10 @@
set -xe set -xe
AURA_BIN=/usr/bin/aura AURA_BIN=/usr/bin/aura
CURRENT_VERSION=`${AURA_BIN} -Qi linux | sed -n '/^Version *:/p' | grep -o '[^ ]*$'` CURRENT_VERSION=`${AURA_BIN} -Qi linux | sed -n '/^Version *:/p' | grep -o '[^ ]*$'`
BOOT_BLK=/dev/vg1/boot BOOT_BLK=/dev/vg0/boot
BOOT_ORIG=/boot BOOT_ORIG=/boot
BOOT_DST=/mnt/boot BOOT_DST=/mnt/boot
ARCH_BOOT_DST=$BOOT_DST/arch ARCH_BOOT_DST=$BOOT_DST/archlinux
ARCH_BOOT_DST_CURRENT_VERSION=$ARCH_BOOT_DST/$CURRENT_VERSION ARCH_BOOT_DST_CURRENT_VERSION=$ARCH_BOOT_DST/$CURRENT_VERSION
ARCH_INITRAMFS=initramfs-linux.img ARCH_INITRAMFS=initramfs-linux.img
ARCH_INITRAMFS_FALLBACK=initramfs-linux-fallback.img ARCH_INITRAMFS_FALLBACK=initramfs-linux-fallback.img

7
chroot.sh Executable file
View File

@ -0,0 +1,7 @@
mount --rbind /dev /mnt/chroot/dev
mount --make-rslave /mnt/chroot/dev
mount -t proc /proc /mnt/chroot/proc
mount --rbind /sys /mnt/chroot/sys
mount --make-rslave /mnt/chroot/sys
mount --rbind /tmp /mnt/chroot/tmp
mount --bind /run /mnt/chroot/run

1
output_hdmi.sh Executable file
View File

@ -0,0 +1 @@
xrandr --output HDMI-1-0 --right-of eDP-1 --auto

25
setup_lxd_network.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
set -x
if [[ $1 = "up" ]]
then
ip link add name virbr0 type bridge
ip link set up dev virbr0
ip addr add 10.0.0.1/8 dev virbr0
ip route append default via 10.0.0.1 dev virbr0
nft add table inet nat
nft add chain inet nat postrouting '{ type nat hook postrouting priority 100 ; }'
nft add rule inet nat postrouting oifname wlan0 masquerade
nft add rule inet filter forward ct state related,established accept
nft add rule inet filter forward iifname virbr0 oifname wlan0 accept
elif [[ $1 = "down" ]]
then
nft delete rule inet filter forward iifname virbr0 oifname wlan0 accept
nft delete rule inet filter forward ct state related,established accept
nft delete table inet nat
ip link del virbr0
else
echo "Use the 'up' or 'down' command"
fi

8
snapshot-rootfs.sh Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/bash
VG=vg0
ROOTFS=rootfs-arch
SZ=10G
DATE=`date +%Y%m%dT%H%M`
lvcreate -n $ROOTFS-$DATE --snapshot -L $SZ $VG/$ROOTFS