fix
This commit is contained in:
parent
e3fdbaf22a
commit
8dc05feed0
51
gentoo.sh
51
gentoo.sh
@ -64,7 +64,7 @@ CPU_TYPE="x86-64"
|
|||||||
BUILD_SERVER="n"
|
BUILD_SERVER="n"
|
||||||
BUILD_SERVER_ADDRESS="192.168.0.55"
|
BUILD_SERVER_ADDRESS="192.168.0.55"
|
||||||
BUILD_PATH="/raid/@gentoo"
|
BUILD_PATH="/raid/@gentoo"
|
||||||
RSYNC_EXCLUDES="--exclude=tmp/* --exclude=var/lib/libvirt/* --exclude=var/db/repos --exclude=var/cache --exclude=var/notmpfs --exclude=var/lib/docker --exclude=var/db/repos/* --exclude=var/lib/systemd/coredump/* --exclude=var/cache/* --exclude=home/$USER* --exclude=.snapshots/* --exclude=sys/* --exclude=dev/* --exclude=proc/* --exclude=run/*"
|
RSYNC_EXCLUDES="--exclude=/var/tmp/* --exclude=/tmp/* --exclude=/var/lib/libvirt/* --exclude=/var/db/repos --exclude=/var/cache --exclude=/var/notmpfs --exclude=/var/lib/docker --exclude=/var/db/repos/* --exclude=/var/lib/systemd/coredump/* --exclude=/var/cache/* --exclude=/home/$USER* --exclude=/.snapshots/* --exclude=/sys/* --exclude=/dev/* --exclude=/home/$USER/* --exclude=/proc/* --exclude=/run/*"
|
||||||
#Add Masked Packages to the Array
|
#Add Masked Packages to the Array
|
||||||
MASKED_PACKAGES+=(media-video/obs-studio net-misc/nyx net-libs/stem sys-libs/libudev-compat dev-libs/nss dev-libs/libappindicator media-video/ffmpeg games-util/game-device-udev-rules games-util/steam-launcher net-im/telegram-desktop-bin)
|
MASKED_PACKAGES+=(media-video/obs-studio net-misc/nyx net-libs/stem sys-libs/libudev-compat dev-libs/nss dev-libs/libappindicator media-video/ffmpeg games-util/game-device-udev-rules games-util/steam-launcher net-im/telegram-desktop-bin)
|
||||||
|
|
||||||
@ -348,13 +348,13 @@ liveOSrestore() {
|
|||||||
mkdir /tmp/live
|
mkdir /tmp/live
|
||||||
SCRIPT=$(pwd)
|
SCRIPT=$(pwd)
|
||||||
INSTALL_TYPE=$(mount | grep ' / ')
|
INSTALL_TYPE=$(mount | grep ' / ')
|
||||||
if [[ $INSTALL_TYPE = *mapper* ]]; then
|
#if [[ $INSTALL_TYPE = *mapper* ]]; then
|
||||||
LIVE_OS_DM="/dev/mapper/$(mount | grep -i ' / ' | cut -d '/' -f4 | cut -d ' ' -f1)"
|
# LIVE_OS_DM="/dev/mapper/$(mount | grep -i ' / ' | cut -d '/' -f4 | cut -d ' ' -f1)"
|
||||||
LIVE_OS_SUBVOL="@$(mount | grep -i ' / ' | cut -d '@' -f2 | sed 's/)//g')"
|
# LIVE_OS_SUBVOL="@$(mount | grep -i ' / ' | cut -d '@' -f2 | sed 's/)//g')"
|
||||||
else
|
#else
|
||||||
LIVE_OS_DM="$(mount | grep ' / ' | cut -d ' ' -f1)"
|
# LIVE_OS_DM="$(mount | grep ' / ' | cut -d ' ' -f1)"
|
||||||
LIVE_OS_SUBVOL="@$(mount | grep -i ' / ' | cut -d '@' -f2 | sed 's/)//g')"
|
# LIVE_OS_SUBVOL="@$(mount | grep -i ' / ' | cut -d '@' -f2 | sed 's/)//g')"
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
partitions
|
partitions
|
||||||
systemMounts
|
systemMounts
|
||||||
@ -362,14 +362,15 @@ liveOSrestore() {
|
|||||||
|
|
||||||
echo "[Transferring Currenting Running OS from $LIVE_OS_DM to $HARD_DISK ]"
|
echo "[Transferring Currenting Running OS from $LIVE_OS_DM to $HARD_DISK ]"
|
||||||
echo
|
echo
|
||||||
mount $LIVE_OS_DM /tmp/live
|
#mount $LIVE_OS_DM /tmp/live
|
||||||
|
#cd /tmp/live/$LIVE_OS_SUBVOL
|
||||||
cd /tmp/live/$LIVE_OS_SUBVOL
|
#mkdir boot
|
||||||
|
#mount $EFI /tmp/live/$LIVE_OS_SUBVOL/boot
|
||||||
|
|
||||||
if [[ $BUILD_SERVER = *y* ]]; then
|
if [[ $BUILD_SERVER = *y* ]]; then
|
||||||
rsync -av --delete -e ssh root@$BUILD_SERVER_ADDRESS:/$BUILD_PATH/ $RSYNC_EXCLUDES .
|
rsync -av --delete -e ssh root@$BUILD_SERVER_ADDRESS:/$BUILD_PATH/ $RSYNC_EXCLUDES $TARGET/
|
||||||
else
|
else
|
||||||
rsync -av --delete . $RSYNC_EXCLUDES $TARGET/
|
rsync -av --delete / $RSYNC_EXCLUDES $TARGET/
|
||||||
rsync -av --delete /boot/ $TARGET/boot/
|
rsync -av --delete /boot/ $TARGET/boot/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -381,7 +382,7 @@ liveOSrestore() {
|
|||||||
echo 'bash /usr/bin/gentoo.sh accounts' >>$TARGET/setup.sh
|
echo 'bash /usr/bin/gentoo.sh accounts' >>$TARGET/setup.sh
|
||||||
echo 'bash /usr/bin/gentoo.sh btrfs-tweaks' >>$TARGET/setup.sh
|
echo 'bash /usr/bin/gentoo.sh btrfs-tweaks' >>$TARGET/setup.sh
|
||||||
echo 'bash /usr/bin/gentoo.sh hibernate' >>$TARGET/setup.sh
|
echo 'bash /usr/bin/gentoo.sh hibernate' >>$TARGET/setup.sh
|
||||||
echo "chown -R $USER:$USER $TARGET/home/$USER" >>$TARGET/setup.sh
|
echo "chown -R $USER:$USER /home/$USER" >>$TARGET/setup.sh
|
||||||
chmod +x $TARGET/usr/bin/gentoo.sh
|
chmod +x $TARGET/usr/bin/gentoo.sh
|
||||||
chmod +x $TARGET/setup.sh
|
chmod +x $TARGET/setup.sh
|
||||||
chroot $TARGET bash /setup.sh
|
chroot $TARGET bash /setup.sh
|
||||||
@ -405,21 +406,21 @@ liveOSrestore() {
|
|||||||
|
|
||||||
backupOS() {
|
backupOS() {
|
||||||
mkdir /tmp/live
|
mkdir /tmp/live
|
||||||
INSTALL_TYPE=$(mount | grep ' / ')
|
#INSTALL_TYPE=$(mount | grep ' / ')
|
||||||
if [[ $INSTALL_TYPE = *mapper* ]]; then
|
#if [[ $INSTALL_TYPE = *mapper* ]]; then
|
||||||
LIVE_OS_DM="/dev/mapper/$(mount | grep -i ' / ' | cut -d '/' -f4 | cut -d ' ' -f1)"
|
# LIVE_OS_DM="/dev/mapper/$(mount | grep -i ' / ' | cut -d '/' -f4 | cut -d ' ' -f1)"
|
||||||
LIVE_OS_SUBVOL="@$(mount | grep -i ' / ' | cut -d '@' -f2 | sed 's/)//g')"
|
# LIVE_OS_SUBVOL="@$(mount | grep -i ' / ' | cut -d '@' -f2 | sed 's/)//g')"
|
||||||
else
|
#else
|
||||||
LIVE_OS_DM="$(mount | grep ' / ' | cut -d ' ' -f1)"
|
# LIVE_OS_DM="$(mount | grep ' / ' | cut -d ' ' -f1)"
|
||||||
LIVE_OS_SUBVOL="@$(mount | grep -i ' / ' | cut -d '@' -f2 | sed 's/)//g')"
|
# LIVE_OS_SUBVOL="@$(mount | grep -i ' / ' | cut -d '@' -f2 | sed 's/)//g')"
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
partitions
|
partitions
|
||||||
systemMounts
|
systemMounts
|
||||||
clear
|
clear
|
||||||
mount $LIVE_OS_DM /tmp/live
|
#mount $LIVE_OS_DM /tmp/live
|
||||||
cd /tmp/live/$LIVE_OS_SUBVOL
|
#cd /tmp/live/$LIVE_OS_SUBVOL
|
||||||
rsync -av -e ssh --delete . $RSYNC_EXCLUDES root@$BUILD_SERVER_ADDRESS:$BUILD_PATH/
|
rsync -av -e ssh --delete / $RSYNC_EXCLUDES root@$BUILD_SERVER_ADDRESS:$BUILD_PATH/
|
||||||
rsync -av -e ssh --delete /boot/ root@$BUILD_SERVER_ADDRESS:$BUILD_PATH/boot/
|
rsync -av -e ssh --delete /boot/ root@$BUILD_SERVER_ADDRESS:$BUILD_PATH/boot/
|
||||||
umount /tmp/live
|
umount /tmp/live
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user