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_ADDRESS="192.168.0.55"
|
||||
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
|
||||
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
|
||||
SCRIPT=$(pwd)
|
||||
INSTALL_TYPE=$(mount | grep ' / ')
|
||||
if [[ $INSTALL_TYPE = *mapper* ]]; then
|
||||
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')"
|
||||
else
|
||||
LIVE_OS_DM="$(mount | grep ' / ' | cut -d ' ' -f1)"
|
||||
LIVE_OS_SUBVOL="@$(mount | grep -i ' / ' | cut -d '@' -f2 | sed 's/)//g')"
|
||||
fi
|
||||
#if [[ $INSTALL_TYPE = *mapper* ]]; then
|
||||
# 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')"
|
||||
#else
|
||||
# LIVE_OS_DM="$(mount | grep ' / ' | cut -d ' ' -f1)"
|
||||
# LIVE_OS_SUBVOL="@$(mount | grep -i ' / ' | cut -d '@' -f2 | sed 's/)//g')"
|
||||
#fi
|
||||
|
||||
partitions
|
||||
systemMounts
|
||||
@ -362,14 +362,15 @@ liveOSrestore() {
|
||||
|
||||
echo "[Transferring Currenting Running OS from $LIVE_OS_DM to $HARD_DISK ]"
|
||||
echo
|
||||
mount $LIVE_OS_DM /tmp/live
|
||||
|
||||
cd /tmp/live/$LIVE_OS_SUBVOL
|
||||
#mount $LIVE_OS_DM /tmp/live
|
||||
#cd /tmp/live/$LIVE_OS_SUBVOL
|
||||
#mkdir boot
|
||||
#mount $EFI /tmp/live/$LIVE_OS_SUBVOL/boot
|
||||
|
||||
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
|
||||
rsync -av --delete . $RSYNC_EXCLUDES $TARGET/
|
||||
rsync -av --delete / $RSYNC_EXCLUDES $TARGET/
|
||||
rsync -av --delete /boot/ $TARGET/boot/
|
||||
fi
|
||||
|
||||
@ -381,7 +382,7 @@ liveOSrestore() {
|
||||
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 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/setup.sh
|
||||
chroot $TARGET bash /setup.sh
|
||||
@ -405,21 +406,21 @@ liveOSrestore() {
|
||||
|
||||
backupOS() {
|
||||
mkdir /tmp/live
|
||||
INSTALL_TYPE=$(mount | grep ' / ')
|
||||
if [[ $INSTALL_TYPE = *mapper* ]]; then
|
||||
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')"
|
||||
else
|
||||
LIVE_OS_DM="$(mount | grep ' / ' | cut -d ' ' -f1)"
|
||||
LIVE_OS_SUBVOL="@$(mount | grep -i ' / ' | cut -d '@' -f2 | sed 's/)//g')"
|
||||
fi
|
||||
#INSTALL_TYPE=$(mount | grep ' / ')
|
||||
#if [[ $INSTALL_TYPE = *mapper* ]]; then
|
||||
# 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')"
|
||||
#else
|
||||
# LIVE_OS_DM="$(mount | grep ' / ' | cut -d ' ' -f1)"
|
||||
# LIVE_OS_SUBVOL="@$(mount | grep -i ' / ' | cut -d '@' -f2 | sed 's/)//g')"
|
||||
#fi
|
||||
|
||||
partitions
|
||||
systemMounts
|
||||
clear
|
||||
mount $LIVE_OS_DM /tmp/live
|
||||
cd /tmp/live/$LIVE_OS_SUBVOL
|
||||
rsync -av -e ssh --delete . $RSYNC_EXCLUDES root@$BUILD_SERVER_ADDRESS:$BUILD_PATH/
|
||||
#mount $LIVE_OS_DM /tmp/live
|
||||
#cd /tmp/live/$LIVE_OS_SUBVOL
|
||||
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/
|
||||
umount /tmp/live
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user