""" * Author: "PeppermintOS Team(peppermintosteam@proton.me) * * License: SPDX-License-Identifier: GPL-3.0-or-later * * Move and copy files as needed """ import os import shutil from pathlib import Path import conf import paths import inflate_bubble import finish_cleanup import copy_folders import copy_files_specified # Set the home path used regardless the user logged in BSTRING = paths.bstring_iso_configs home_folder = Path(BSTRING).expanduser() # Move to iso_configs os.chdir(home_folder) # Set the working path WP_CHROOT = paths.WPCHROOT # Set the current working folder cur_dir = os.getcwd().replace('/', '/') def lbinit(): """ runs the lb config command for the iso build""" current_dir = os.getcwd().replace('/', '/') os.chdir(current_dir + '/fusato') lbsetup = (conf.lbset_deb64) os.system(lbsetup) def copy_deb64_specific(): """" Debian 64 copy jobs""" shutil.copytree(cur_dir + paths.src_deb64_osrelease, WP_CHROOT + paths.des_osrelease, dirs_exist_ok=True ) shutil.copytree(cur_dir + paths.src_deb64_osrelease, WP_CHROOT + paths.des_osrelease_opt, dirs_exist_ok=True ) shutil.copytree(cur_dir + paths.src_deb64_slpash, cur_dir + paths.des_splash, dirs_exist_ok=True ) shutil.copytree(cur_dir + paths.src_deb64_isolinux, cur_dir + paths.des_isolinux, dirs_exist_ok=True ) shutil.copytree(cur_dir + paths.src_deb64_multi, cur_dir + paths.des_archives, dirs_exist_ok=True ) shutil.copytree(cur_dir + paths.src_deb_grub_theme, WP_CHROOT + paths.des_grub_theme, dirs_exist_ok=True ) shutil.copytree(cur_dir + paths.src_deb64_modules, WP_CHROOT + paths.des_modules, dirs_exist_ok=True ) shutil.copytree(cur_dir + paths.src_deb_splash_image, cur_dir + paths.des_splash_image_isolinux, dirs_exist_ok=True ) shutil.copytree(cur_dir + paths.src_deb_splash_image, cur_dir + paths.des_splash_image_grub, dirs_exist_ok=True ) shutil.copytree(cur_dir + paths.src_deb_live_theme, cur_dir + paths.des_live_theme, dirs_exist_ok=True ) shutil.copy(cur_dir + paths.src_deb64_grub_etc, WP_CHROOT + paths.des_grub_etc ) shutil.copy(cur_dir + paths.src_deb64_settings, WP_CHROOT + paths.des_setttings ) shutil.copy(cur_dir + paths.src_deb64_installer, WP_CHROOT + paths.des_installer ) shutil.copy(cur_dir + paths.src_deb64_sourcesfinal, WP_CHROOT + paths.des_sourcesfinal ) shutil.copy(cur_dir + paths.src_deb64_bootloader, WP_CHROOT + paths.des_bootloader ) shutil.copy(cur_dir + paths.src_deb64_netinstall, WP_CHROOT + paths.des_netinstall ) shutil.copy(cur_dir + paths.src_deb64_sourcelist, WP_CHROOT + paths.des_sourcelist ) shutil.copy(cur_dir + paths.src_main_line_pep_id, WP_CHROOT + paths.des_main_line_pep_id ) def run_build(): """ Run and start the build""" run_cmd = 'sudo lb build' os.chdir(home_folder) os.chdir('fusato') os.system(run_cmd) def readybuild(): """" Ready the bld structure""" if os.path.exists('fusato'): rm_cmd = "sudo rm -r -f fusato" os.system(rm_cmd) os.makedirs('fusato') # Run lb config to begin the setup lbinit() # Prep the folders inflate_bubble.set_fusato_structure() # Packages inflate_bubble.set_desktop_environment() inflate_bubble.set_extra_packages() inflate_bubble.set_general_packages() inflate_bubble.set_system_packages() inflate_bubble.set_system_packages_64() inflate_bubble.set_artwork_packages() inflate_bubble.set_python_packages() inflate_bubble.set_calamares_packages() inflate_bubble.set_firmware_packages() inflate_bubble.set_binary_packages_64() copy_folders.copy_folders_files() copy_files_specified.copy_specific_files() copy_files_specified.set_symlinks() copy_deb64_specific() run_build() finish_cleanup.make_check_sum() finish_cleanup.copy_iso_file_nightly_deb64() finish_cleanup.copy_iso_file_prod_deb64() finish_cleanup.kill_old_iso() else: os.makedirs('fusato') # Run lb config to begin the setup lbinit() # Prep the folders inflate_bubble.set_fusato_structure() # Packages inflate_bubble.set_desktop_environment() inflate_bubble.set_extra_packages() inflate_bubble.set_general_packages() inflate_bubble.set_system_packages() inflate_bubble.set_system_packages_64() inflate_bubble.set_artwork_packages() inflate_bubble.set_python_packages() inflate_bubble.set_calamares_packages() inflate_bubble.set_firmware_packages() inflate_bubble.set_binary_packages_64() copy_folders.copy_folders_files() copy_files_specified.copy_specific_files() copy_files_specified.set_symlinks() copy_deb64_specific() run_build() finish_cleanup.make_check_sum() finish_cleanup.copy_iso_file_nightly_deb64() finish_cleanup.copy_iso_file_prod_deb64() finish_cleanup.kill_old_iso() readybuild()