2023-08-24 06:16:56 +00:00
|
|
|
"""
|
|
|
|
* Author: "PeppermintOS Team(peppermintosteam@proton.me)
|
|
|
|
*
|
|
|
|
* License: SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*
|
|
|
|
* Set the infrastructure for bubbles to begin the ISO build
|
2023-11-15 02:01:16 -01:00
|
|
|
* This copies needed config files to the binary and chroot
|
|
|
|
* locations, based on the build base and architecture
|
2023-08-24 06:16:56 +00:00
|
|
|
"""
|
|
|
|
import os
|
|
|
|
import collections
|
|
|
|
from pathlib import Path
|
|
|
|
import shutil
|
2023-09-06 13:24:42 +00:00
|
|
|
import logging
|
2023-09-05 14:38:55 +00:00
|
|
|
|
2023-12-12 03:23:10 -01:00
|
|
|
import conf
|
|
|
|
|
2023-08-24 06:16:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Public Variables used in the classes
|
|
|
|
BSTRING_ISO_CONFIGS = '~/bubbles/iso_configs'
|
|
|
|
HOME_FOLDER = str(Path(BSTRING_ISO_CONFIGS).expanduser())
|
|
|
|
WPCHROOT = "/fusato/config/includes.chroot"
|
2023-08-27 07:58:28 +00:00
|
|
|
BINARYPTH = "/fusato/config/includes.binary"
|
2023-08-24 06:16:56 +00:00
|
|
|
BOOTSTRAP = "/fusato/config/includes.bootstrap"
|
|
|
|
FUSATOCONFIG = "/fusato/config"
|
|
|
|
|
2023-09-06 13:24:42 +00:00
|
|
|
# Set up the logging format
|
|
|
|
logger = logging.getLogger()
|
|
|
|
MSG_COPY = "Copying - "
|
|
|
|
MSG_FIN = "Finished - "
|
|
|
|
|
|
|
|
|
2023-09-22 04:54:19 +00:00
|
|
|
class Archive:
|
|
|
|
"""
|
2023-09-22 11:16:52 +00:00
|
|
|
Copy the multimedia to the ARCHIVES folder Depending on
|
2023-09-22 04:54:19 +00:00
|
|
|
the architecture it will, copy folders as needed
|
|
|
|
"""
|
|
|
|
def __init__(self,sbase,sarch):
|
|
|
|
logger.info("Copy Archive")
|
|
|
|
self.sbase = sbase
|
|
|
|
self.sarch = sarch
|
2023-09-22 11:27:43 +00:00
|
|
|
src_archive = ('/multimedia/' + self.sbase + self.sarch,)
|
2023-09-22 11:54:48 +00:00
|
|
|
des_archive =('/archives',)
|
2023-09-22 04:54:19 +00:00
|
|
|
# Archives Folders.
|
|
|
|
archive_src_q = collections.deque(src_archive)
|
|
|
|
archive_des_q = collections.deque(des_archive)
|
|
|
|
archive_size_q = len(archive_src_q)
|
2023-09-22 10:25:06 +00:00
|
|
|
for size_length in range(archive_size_q):
|
2023-09-22 04:54:19 +00:00
|
|
|
source = archive_src_q.popleft()
|
|
|
|
des = archive_des_q.popleft()
|
|
|
|
logger.info(MSG_COPY + HOME_FOLDER + source)
|
|
|
|
shutil.copytree(HOME_FOLDER + source,
|
2023-09-22 11:54:48 +00:00
|
|
|
HOME_FOLDER + FUSATOCONFIG + des,
|
2023-09-22 04:54:19 +00:00
|
|
|
dirs_exist_ok = True
|
|
|
|
)
|
2023-09-22 11:54:48 +00:00
|
|
|
logger.info(MSG_FIN + HOME_FOLDER + FUSATOCONFIG + des)
|
2023-09-22 04:54:19 +00:00
|
|
|
|
|
|
|
|
2023-08-24 06:16:56 +00:00
|
|
|
class ChrootFolders:
|
|
|
|
"""
|
|
|
|
Copy all the needed folders to CHROOT Depending on
|
|
|
|
the architecture it will, copy folders as needed
|
|
|
|
"""
|
|
|
|
def __init__(self,sbase,sarch):
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info("Copy Chroot")
|
2023-08-24 06:16:56 +00:00
|
|
|
self.sbase = sbase
|
|
|
|
self.sarch = sarch
|
|
|
|
src_chroot = ('/osrelease/' + self.sbase + self.sarch,
|
|
|
|
'/osrelease/' + self.sbase + self.sarch,
|
2023-08-25 03:52:52 +00:00
|
|
|
'/grub/'+ self.sbase + self.sarch,
|
2023-09-05 14:38:55 +00:00
|
|
|
'/calamares_settings/' + self.sbase + self.sarch +
|
2023-08-24 06:16:56 +00:00
|
|
|
'/calamares/modules',
|
2023-08-25 03:52:52 +00:00
|
|
|
'/grub/' + self.sbase + '_themes'
|
2023-08-24 06:16:56 +00:00
|
|
|
)
|
|
|
|
des_chroot =('/usr/lib',
|
|
|
|
'/opt/pepconf',
|
2023-08-29 04:04:59 +00:00
|
|
|
'/etc/default',
|
2023-08-24 06:16:56 +00:00
|
|
|
'/etc/calamares/modules',
|
|
|
|
'/boot/grub/themes'
|
|
|
|
)
|
|
|
|
# Chroot Folders.
|
|
|
|
chroot_src_q = collections.deque(src_chroot)
|
|
|
|
chroot_des_q = collections.deque(des_chroot)
|
|
|
|
chroot_size_q = len(chroot_src_q)
|
|
|
|
for size_length in range(chroot_size_q):
|
|
|
|
source = chroot_src_q.popleft()
|
|
|
|
des = chroot_des_q.popleft()
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_COPY + HOME_FOLDER + source)
|
2023-08-25 11:14:42 +00:00
|
|
|
shutil.copytree(HOME_FOLDER + source,
|
|
|
|
HOME_FOLDER + WPCHROOT + des,
|
|
|
|
dirs_exist_ok = True
|
|
|
|
)
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + des)
|
2023-09-05 14:38:55 +00:00
|
|
|
|
2023-08-24 06:16:56 +00:00
|
|
|
|
|
|
|
class BinaryFolders:
|
|
|
|
"""
|
|
|
|
Copy all the needed folders to BINARY Depending on
|
|
|
|
the architecture it will, copy folders as needed
|
|
|
|
"""
|
|
|
|
def __init__(self, sbase, sarch):
|
2023-09-11 11:53:23 +00:00
|
|
|
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info("Copy Binary")
|
2023-08-24 06:16:56 +00:00
|
|
|
self.sbase = sbase
|
|
|
|
self.sarch = sarch
|
|
|
|
src_binary = ('/splash/' + self.sbase + self.sarch + '/boot',
|
|
|
|
'/splash/' + self.sbase + self.sarch +'/isolinux',
|
|
|
|
'/splash/' + self.sbase + '_live-theme',
|
|
|
|
'/splash/' + self.sbase + '_splash',
|
|
|
|
'/splash/' + self.sbase + '_splash'
|
|
|
|
)
|
|
|
|
des_binary =('/boot',
|
|
|
|
'/isolinux',
|
|
|
|
'/boot/grub',
|
|
|
|
'/isolinux',
|
|
|
|
'/boot/grub'
|
|
|
|
)
|
|
|
|
# Binary Folders
|
|
|
|
binary_src_q = collections.deque(src_binary)
|
|
|
|
binary_des_q = collections.deque(des_binary)
|
|
|
|
binary_size_q = len(binary_src_q)
|
|
|
|
for size_length in range(binary_size_q):
|
|
|
|
source = binary_src_q.popleft()
|
|
|
|
des = binary_des_q.popleft()
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_COPY+ HOME_FOLDER + source)
|
2023-08-24 06:16:56 +00:00
|
|
|
shutil.copytree(HOME_FOLDER + source,
|
|
|
|
HOME_FOLDER + BINARYPTH + des,
|
|
|
|
dirs_exist_ok = True
|
|
|
|
)
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_FIN + HOME_FOLDER + BINARYPTH + des)
|
2023-08-24 06:16:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ArchitectureFiles:
|
|
|
|
"""
|
|
|
|
Copy all the needed files to CHROOT Depending on the
|
|
|
|
architecture it will, copy files as needed
|
|
|
|
"""
|
|
|
|
def __init__(self, sbase, sarch):
|
2023-09-11 11:53:23 +00:00
|
|
|
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info("Copy Architecture")
|
2023-09-11 11:53:23 +00:00
|
|
|
|
2023-08-24 06:16:56 +00:00
|
|
|
self.sbase = sbase
|
|
|
|
self.sarch = sarch
|
|
|
|
calamares_path = '/calamares_settings/'
|
|
|
|
sources_path = '/sources/'
|
|
|
|
src_paths = (calamares_path + self.sbase + self.sarch +
|
|
|
|
'/calamares/settings.conf',
|
|
|
|
calamares_path + self.sbase + self.sarch +
|
|
|
|
'/install-peppermint',
|
|
|
|
calamares_path + self.sbase + self.sarch +
|
|
|
|
'/sources-final',
|
|
|
|
calamares_path + self.sbase + self.sarch +
|
|
|
|
'/bootloader-config',
|
|
|
|
calamares_path +
|
|
|
|
'adddesktopicon/add-calamares-desktop-icon',
|
|
|
|
sources_path + self.sbase + self.sarch +
|
|
|
|
'/sources.list',
|
|
|
|
'/id_files/pep_id'
|
|
|
|
)
|
|
|
|
des_paths = ('/etc/calamares/settings.conf',
|
|
|
|
'/usr/bin/install-peppermint',
|
|
|
|
'/usr/sbin/sources-final',
|
|
|
|
'/usr/sbin/bootloader-config',
|
|
|
|
'/usr/bin/add-calamares-desktop-icon',
|
|
|
|
'/opt/pepconf/sources.list',
|
|
|
|
'/usr/share/peppermint/pep_id'
|
|
|
|
)
|
|
|
|
# copy files to thier CHROOT Location
|
|
|
|
src_q = collections.deque(src_paths)
|
|
|
|
des_q = collections.deque(des_paths)
|
|
|
|
size_q = len(src_q)
|
|
|
|
for size_length in range(size_q):
|
|
|
|
source = src_q.popleft()
|
|
|
|
des = des_q.popleft()
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_COPY+ HOME_FOLDER + source)
|
2023-08-24 06:16:56 +00:00
|
|
|
shutil.copy(HOME_FOLDER + source,
|
|
|
|
HOME_FOLDER + WPCHROOT + des
|
|
|
|
)
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + des)
|
2023-08-24 06:16:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
def set_symlinks():
|
|
|
|
"""
|
|
|
|
Set the symliknks that are used for all builds.
|
|
|
|
"""
|
2023-09-11 11:57:40 +00:00
|
|
|
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info("Copy Symlinks")
|
2023-09-11 11:57:40 +00:00
|
|
|
|
2023-08-24 06:16:56 +00:00
|
|
|
pep_info = '/usr/share/python-apt/templates/Peppermint.info'
|
|
|
|
pep_mirror = '/usr/share/python-apt/templates/Peppermint.mirrors'
|
|
|
|
pep_csv = '/usr/share/distro-info/peppermint.csv'
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info("Making - " + HOME_FOLDER + WPCHROOT + pep_info)
|
2023-08-24 06:16:56 +00:00
|
|
|
os.symlink('Debian.info', HOME_FOLDER + WPCHROOT + pep_info)
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + pep_info)
|
|
|
|
logger.info("Making - " + HOME_FOLDER + WPCHROOT + pep_mirror)
|
2023-08-24 06:16:56 +00:00
|
|
|
os.symlink('Debian.mirrors', HOME_FOLDER + WPCHROOT + pep_mirror)
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + pep_mirror)
|
|
|
|
logger.info("Making - " + HOME_FOLDER + WPCHROOT + pep_csv)
|
2023-08-24 06:16:56 +00:00
|
|
|
os.symlink('debian.csv', HOME_FOLDER + WPCHROOT + pep_csv)
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + pep_csv)
|
2023-08-24 06:16:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
def shared_folders():
|
|
|
|
"""
|
|
|
|
This function will get the files that are shared commonly amongst
|
|
|
|
all the builds,
|
|
|
|
"""
|
2023-09-11 11:57:40 +00:00
|
|
|
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info("Copy Shared folders")
|
2023-09-11 11:57:40 +00:00
|
|
|
|
2023-08-24 06:16:56 +00:00
|
|
|
src_paths = ('/plymouth/lines',
|
|
|
|
'/application',
|
|
|
|
'/font',
|
|
|
|
'/hooks/live',
|
|
|
|
'/issue',
|
|
|
|
'/issue',
|
|
|
|
'/polkit',
|
|
|
|
'/database',
|
|
|
|
'/user_config',
|
|
|
|
'/PepProPixMaps',
|
|
|
|
'/wallpaper',
|
|
|
|
'/menu/menus',
|
|
|
|
'/face',
|
|
|
|
'/neofetch/neofetch',
|
|
|
|
'/pmostools',
|
|
|
|
'/autostart',
|
|
|
|
'/pylibraries',
|
2023-09-14 03:54:24 +00:00
|
|
|
'/calamares_settings/branding'
|
2023-08-24 06:16:56 +00:00
|
|
|
)
|
|
|
|
des_paths =('/usr/share/plymouth/themes/lines',
|
|
|
|
'/usr/share/applications',
|
|
|
|
'/usr/share/fonts/pepconf',
|
|
|
|
'/usr/lib/live/config',
|
|
|
|
'/etc',
|
|
|
|
'/opt/pepconf',
|
|
|
|
'/usr/share/polkit-1/actions',
|
|
|
|
'/opt/pypep/dbpep',
|
|
|
|
'/etc/live/config.conf.d',
|
|
|
|
'/usr/share/pixmaps',
|
|
|
|
'/usr/share/backgrounds',
|
|
|
|
'/etc/skel/.config/menus',
|
|
|
|
'/etc/skel/',
|
|
|
|
'/etc/skel/.config/neofetch',
|
|
|
|
'/etc/skel/.local/share/pmostools',
|
|
|
|
'/etc/skel/.config/autostart',
|
|
|
|
'/usr/lib/python3/dist-packages',
|
2023-08-28 06:15:50 +00:00
|
|
|
'/etc/calamares/branding'
|
2023-08-24 06:16:56 +00:00
|
|
|
)
|
|
|
|
src_q = collections.deque(src_paths)
|
|
|
|
des_q = collections.deque(des_paths)
|
2023-08-24 06:46:21 +00:00
|
|
|
size_q = len(des_q)
|
2023-08-24 06:16:56 +00:00
|
|
|
for size_length in range(size_q):
|
|
|
|
source = src_q.popleft()
|
|
|
|
des = des_q.popleft()
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_COPY+ HOME_FOLDER + source)
|
2023-08-24 06:16:56 +00:00
|
|
|
shutil.copytree(HOME_FOLDER + source,
|
|
|
|
HOME_FOLDER + WPCHROOT + des,
|
|
|
|
dirs_exist_ok = True
|
|
|
|
)
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + des)
|
2023-08-24 06:16:56 +00:00
|
|
|
|
|
|
|
|
2023-08-25 11:15:59 +00:00
|
|
|
def icons_themes():
|
2023-08-24 06:16:56 +00:00
|
|
|
"""
|
|
|
|
This function will get the icons and themse that are
|
|
|
|
for all the builds
|
|
|
|
"""
|
2023-09-11 11:57:40 +00:00
|
|
|
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info("Copy icons and themes")
|
2023-09-11 11:57:40 +00:00
|
|
|
|
2023-08-24 12:55:01 +00:00
|
|
|
src_paths =('/theme/Marwaita Dark Debian/',
|
|
|
|
'/theme/Marwaita Dark Manjaro/',
|
|
|
|
'/theme/Marwaita Dark Peppermint/',
|
|
|
|
'/theme/Marwaita Debian/',
|
|
|
|
'/theme/Marwaita Manjaro/',
|
|
|
|
'/theme/Marwaita Peppermint/',
|
2023-09-14 11:57:24 +00:00
|
|
|
'/theme/Marwaita-Xfwm/',
|
|
|
|
'/theme/Marwaita-Xfwm-Alt/',
|
|
|
|
'/theme/Marwaita-Xfwm-Color-Dark-Text/',
|
|
|
|
'/theme/Marwaita-Xfwm-Color-Light-Text/',
|
|
|
|
'/theme/Marwaita-Xfwm-Dark/',
|
2023-08-24 12:55:01 +00:00
|
|
|
'/icons/Tela-circle-blue-dark/',
|
|
|
|
'/icons/Tela-circle-green-dark/',
|
|
|
|
'/icons/Tela-circle-red-dark/',
|
|
|
|
'/icons/Tela-circle-blue/',
|
|
|
|
'/icons/Tela-circle-green/',
|
|
|
|
'/icons/Tela-circle-red/',
|
|
|
|
'/icons/Tela-circle/'
|
2023-08-24 06:16:56 +00:00
|
|
|
)
|
2023-09-05 14:38:55 +00:00
|
|
|
des_paths = ('/usr/share/themes/Marwaita Dark Debian/',
|
2023-08-25 04:22:49 +00:00
|
|
|
'/usr/share/themes/Marwaita Dark Manjaro/',
|
2023-09-05 14:38:55 +00:00
|
|
|
'/usr/share/themes/Marwaita Dark Peppermint/',
|
2023-08-25 04:22:49 +00:00
|
|
|
'/usr/share/themes/Marwaita Debian/',
|
2023-09-05 14:38:55 +00:00
|
|
|
'/usr/share/themes/Marwaita Manjaro/',
|
2023-08-25 04:22:49 +00:00
|
|
|
'/usr/share/themes/Marwaita Peppermint/',
|
2023-09-14 11:57:24 +00:00
|
|
|
'/usr/share/themes/Marwaita-Xfwm/',
|
|
|
|
'/usr/share/themes/Marwaita-Xfwm-Alt/',
|
|
|
|
'/usr/share/themes/Marwaita-Xfwm-Color-Dark-Text/',
|
|
|
|
'/usr/share/themes/Marwaita-Xfwm-Color-Light-Text/',
|
|
|
|
'/usr/share/themes/Marwaita-Xfwm-Dark/',
|
2023-09-05 14:38:55 +00:00
|
|
|
'/usr/share/icons/Tela-circle-blue-dark/',
|
2023-08-25 04:22:49 +00:00
|
|
|
'/usr/share/icons/Tela-circle-green-dark/',
|
2023-09-05 14:38:55 +00:00
|
|
|
'/usr/share/icons/Tela-circle-red-dark/',
|
2023-08-25 04:22:49 +00:00
|
|
|
'/usr/share/icons/Tela-circle-blue/',
|
2023-09-05 14:38:55 +00:00
|
|
|
'/usr/share/icons/Tela-circle-green/',
|
2023-08-25 04:22:49 +00:00
|
|
|
'/usr/share/icons/Tela-circle-red/',
|
|
|
|
'/usr/share/icons/Tela-circle/'
|
2023-08-24 06:16:56 +00:00
|
|
|
)
|
|
|
|
src_q = collections.deque(src_paths)
|
|
|
|
des_q = collections.deque(des_paths)
|
|
|
|
size_q = len(src_q)
|
2023-08-25 11:27:18 +00:00
|
|
|
|
2023-08-25 11:26:08 +00:00
|
|
|
|
2023-08-24 06:16:56 +00:00
|
|
|
for size_length in range(size_q):
|
|
|
|
source = src_q.popleft()
|
2023-08-25 11:42:09 +00:00
|
|
|
des = des_q.popleft()
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_COPY+ HOME_FOLDER + source)
|
2023-08-25 11:45:41 +00:00
|
|
|
shutil.copytree(HOME_FOLDER + source,
|
2023-08-25 03:52:52 +00:00
|
|
|
HOME_FOLDER + WPCHROOT + des,
|
2023-08-25 11:42:57 +00:00
|
|
|
dirs_exist_ok = True
|
2023-08-25 03:52:52 +00:00
|
|
|
)
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + des)
|
2023-08-25 11:42:09 +00:00
|
|
|
|
2023-08-24 06:16:56 +00:00
|
|
|
|
|
|
|
def shared_files():
|
|
|
|
"""
|
|
|
|
This silll copy all specific files that a used for all
|
|
|
|
builds.
|
2023-09-05 14:38:55 +00:00
|
|
|
"""
|
2023-09-11 11:57:40 +00:00
|
|
|
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info("Copy Shared Files")
|
2023-09-11 11:57:40 +00:00
|
|
|
|
2023-08-24 06:16:56 +00:00
|
|
|
src_paths = ('/aliases/bash_aliases',
|
2023-09-14 03:54:24 +00:00
|
|
|
'/sources/peppermint.list',
|
2023-08-24 06:16:56 +00:00
|
|
|
'/PepProTools/xDaily',
|
|
|
|
'/PepProTools/hub',
|
|
|
|
'/PepProTools/welcome',
|
|
|
|
'/PepProTools/kumo',
|
|
|
|
'/lightdm/lightdm.conf',
|
|
|
|
'/lightdm/lightdm-gtk-greeter.conf',
|
|
|
|
'/plymouth/plymouthd.conf',
|
2023-09-22 04:54:19 +00:00
|
|
|
#'/packages/deb-multimedia-keyring_2016.8.1_all.deb',
|
|
|
|
#'/repo_public_key/trusted.gpg',
|
2023-09-14 11:57:24 +00:00
|
|
|
|
2023-09-01 05:00:46 +00:00
|
|
|
|
2023-08-24 06:16:56 +00:00
|
|
|
)
|
|
|
|
des_paths = ('/etc/skel/.bash_aliases',
|
2023-09-14 03:54:24 +00:00
|
|
|
'/etc/apt/sources.list.d',
|
2023-08-24 06:16:56 +00:00
|
|
|
'/usr/local/bin/xDaily',
|
|
|
|
'/usr/local/bin/hub',
|
|
|
|
'/usr/local/bin/welcome',
|
|
|
|
'/usr/local/bin/kumo',
|
|
|
|
'/etc/lightdm/lightdm.conf',
|
|
|
|
'/etc/lightdm/lightdm-gtk-greeter.conf',
|
|
|
|
'/usr/share/plymouthd.conf',
|
2023-09-22 04:54:19 +00:00
|
|
|
#'/opt/pepconf/deb-multimedia-keyring_2016.8.1_all.deb',
|
|
|
|
#'/etc/apt/trusted.gpg.d/trusted.gpg',
|
2023-09-14 03:54:24 +00:00
|
|
|
|
2023-08-24 06:16:56 +00:00
|
|
|
)
|
|
|
|
# copy files to thier CHROOT Location
|
|
|
|
src_q = collections.deque(src_paths)
|
|
|
|
des_q = collections.deque(des_paths)
|
|
|
|
size_q = len(src_q)
|
|
|
|
for size_length in range(size_q):
|
|
|
|
source = src_q.popleft()
|
|
|
|
des = des_q.popleft()
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_COPY+ HOME_FOLDER + source)
|
2023-08-24 06:16:56 +00:00
|
|
|
shutil.copy(HOME_FOLDER + source,
|
|
|
|
HOME_FOLDER + WPCHROOT + des
|
|
|
|
)
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + des)
|
2023-08-24 06:16:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
def fusato_configs():
|
|
|
|
"""
|
|
|
|
Copy specific folders in the root of fusato configs
|
|
|
|
"""
|
2023-09-11 11:57:40 +00:00
|
|
|
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info("Copy Fusato Configs")
|
2023-09-11 11:57:40 +00:00
|
|
|
|
2023-08-24 06:16:56 +00:00
|
|
|
src_paths = ('/hooks/normal',)
|
|
|
|
des_paths = ('/hooks/normal',)
|
|
|
|
src_q = collections.deque(src_paths)
|
|
|
|
des_q = collections.deque(des_paths)
|
|
|
|
size_q = len(src_q)
|
|
|
|
for size_length in range(size_q):
|
|
|
|
source = src_q.popleft()
|
|
|
|
des = des_q.popleft()
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_COPY+ HOME_FOLDER + source)
|
2023-08-24 06:16:56 +00:00
|
|
|
shutil.copytree(HOME_FOLDER + source,
|
|
|
|
HOME_FOLDER + FUSATOCONFIG + des,
|
|
|
|
dirs_exist_ok = True
|
|
|
|
)
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + des)
|
2023-08-24 06:16:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
def boostrap_shared():
|
|
|
|
"""
|
|
|
|
Copy specific folders in the boostrap location
|
2023-08-26 11:39:13 +00:00
|
|
|
"""
|
2023-09-11 11:57:40 +00:00
|
|
|
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info("Copy Shared BootStrap")
|
2023-09-11 11:57:40 +00:00
|
|
|
|
2023-08-24 06:16:56 +00:00
|
|
|
src_paths = ('/issue',)
|
|
|
|
des_paths = ('/etc',)
|
|
|
|
src_q = collections.deque(src_paths)
|
|
|
|
des_q = collections.deque(des_paths)
|
|
|
|
size_q = len(src_q)
|
|
|
|
for size_length in range(size_q):
|
|
|
|
source = src_q.popleft()
|
|
|
|
des = des_q.popleft()
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_COPY+ HOME_FOLDER + source)
|
2023-08-24 06:16:56 +00:00
|
|
|
shutil.copytree(HOME_FOLDER + source,
|
|
|
|
HOME_FOLDER + BOOTSTRAP + des,
|
|
|
|
dirs_exist_ok = True
|
|
|
|
)
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + des)
|
2023-08-24 06:16:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
def xfce_configs():
|
|
|
|
"""
|
|
|
|
Copy the xfce files.
|
|
|
|
"""
|
2023-09-11 11:57:40 +00:00
|
|
|
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info("Copy xfce4 configs")
|
2023-09-11 11:57:40 +00:00
|
|
|
|
2023-08-24 06:16:56 +00:00
|
|
|
src_xfce = '/xfce/xfce4'
|
|
|
|
des_xfce = '/etc/skel/.config/xfce4'
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_COPY + HOME_FOLDER + src_xfce)
|
2023-08-24 06:16:56 +00:00
|
|
|
shutil.copytree(HOME_FOLDER + src_xfce,
|
|
|
|
HOME_FOLDER + WPCHROOT + des_xfce,
|
|
|
|
dirs_exist_ok = True
|
|
|
|
)
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + des_xfce)
|
2023-08-24 06:16:56 +00:00
|
|
|
src_thunar = '/xfce/Thunar'
|
|
|
|
des_thunar = '/etc/skel/.config/Thunar'
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_COPY+ HOME_FOLDER + src_thunar)
|
2023-08-24 06:16:56 +00:00
|
|
|
shutil.copytree(HOME_FOLDER + src_thunar,
|
|
|
|
HOME_FOLDER + WPCHROOT + des_thunar,
|
|
|
|
dirs_exist_ok = True
|
|
|
|
)
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + des_thunar)
|
2023-08-24 06:16:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
def gnome_flahsbak_configs():
|
|
|
|
"""
|
|
|
|
Copy the gnome flashback files
|
|
|
|
"""
|
2023-09-11 11:57:40 +00:00
|
|
|
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info("Copy Gnome Flashback configs")
|
2023-08-24 06:16:56 +00:00
|
|
|
src_gnomef = '/gnome-flashback'
|
2023-09-24 16:03:14 +00:00
|
|
|
des_gnomef = '/etc/skel/'
|
2023-09-06 13:24:42 +00:00
|
|
|
logger.info("INFO: Copying - " + HOME_FOLDER + src_gnomef)
|
2023-08-24 06:16:56 +00:00
|
|
|
shutil.copytree(HOME_FOLDER + src_gnomef,
|
|
|
|
HOME_FOLDER + WPCHROOT + des_gnomef,
|
|
|
|
dirs_exist_ok = True
|
|
|
|
)
|
2023-09-09 10:27:30 +00:00
|
|
|
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + des_gnomef)
|
2023-09-09 10:33:02 +00:00
|
|
|
|
2023-09-22 11:31:37 +00:00
|
|
|
|
2023-09-23 15:14:55 +00:00
|
|
|
def open_box_configs():
|
|
|
|
"""
|
|
|
|
Copy the openbox files
|
|
|
|
"""
|
|
|
|
|
|
|
|
logger.info("Copy openbox configs")
|
2024-01-06 17:52:34 -01:00
|
|
|
src_ob = '/openbox'
|
|
|
|
des_ob = '/etc/skel/'
|
2023-09-23 15:14:55 +00:00
|
|
|
logger.info("INFO: Copying - " + HOME_FOLDER + src_ob)
|
|
|
|
shutil.copytree(HOME_FOLDER + src_ob,
|
|
|
|
HOME_FOLDER + WPCHROOT + des_ob,
|
|
|
|
dirs_exist_ok = True
|
|
|
|
)
|
|
|
|
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + des_ob)
|
|
|
|
|
|
|
|
|
|
|
|
|