2023-07-11 06:48:53 +00:00
|
|
|
"""
|
|
|
|
* 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
|
2023-08-05 08:44:26 +00:00
|
|
|
import queue
|
2023-07-11 06:48:53 +00:00
|
|
|
|
|
|
|
# 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"""
|
2023-08-05 08:44:26 +00:00
|
|
|
source_q = queue.Queue()
|
|
|
|
destination_q = queue.Queue()
|
2023-08-05 08:59:51 +00:00
|
|
|
source_q.put(paths.src_deb64_osrelease)
|
|
|
|
source_q.put(paths.src_deb64_osrelease)
|
|
|
|
source_q.put(paths.src_deb64_slpash)
|
|
|
|
source_q.put(paths.src_deb64_isolinux)
|
|
|
|
source_q.put(paths.src_deb64_multi)
|
|
|
|
source_q.put(paths.src_deb_grub_theme)
|
|
|
|
source_q.put(paths.src_deb64_modules)
|
|
|
|
source_q.put(paths.src_deb_splash_image)
|
|
|
|
source_q.put(paths.src_deb_splash_image)
|
|
|
|
source_q.put(paths.src_deb_live_theme)
|
2023-08-05 08:44:26 +00:00
|
|
|
|
2023-08-05 08:59:51 +00:00
|
|
|
destination_q.put(paths.des_osrelease)
|
|
|
|
destination_q.put(paths.des_osrelease_opt)
|
|
|
|
destination_q.put(paths.des_splash)
|
|
|
|
destination_q.put(paths.des_isolinux)
|
|
|
|
destination_q.put(paths.des_archives)
|
|
|
|
destination_q.put(paths.des_grub_theme)
|
|
|
|
destination_q.put(paths.des_modules)
|
|
|
|
destination_q.put(paths.des_splash_image_isolinux)
|
|
|
|
destination_q.put(paths.des_splash_image_grub)
|
|
|
|
destination_q.put(paths.des_live_theme)
|
2023-08-05 08:44:26 +00:00
|
|
|
|
|
|
|
src_size = source_q.qsize()
|
|
|
|
for p in range(src_size):
|
|
|
|
x = source_q.get()
|
|
|
|
y = destination_q.get()
|
2023-08-05 08:56:22 +00:00
|
|
|
shutil.copytree(cur_dir + x,
|
|
|
|
WP_CHROOT + y,
|
2023-08-05 08:44:26 +00:00
|
|
|
dirs_exist_ok=True
|
|
|
|
)
|
|
|
|
|
2023-07-11 06:48:53 +00:00
|
|
|
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
|
|
|
|
)
|
2023-07-12 11:08:41 +00:00
|
|
|
shutil.copy(cur_dir + paths.src_main_line_pep_id,
|
|
|
|
WP_CHROOT + paths.des_main_line_pep_id
|
|
|
|
)
|
2023-07-11 06:48:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
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()
|
2023-07-12 03:46:17 +00:00
|
|
|
inflate_bubble.set_extra_packages()
|
|
|
|
inflate_bubble.set_general_packages()
|
|
|
|
inflate_bubble.set_system_packages()
|
2023-07-11 06:48:53 +00:00
|
|
|
inflate_bubble.set_system_packages_64()
|
2023-07-12 03:46:17 +00:00
|
|
|
inflate_bubble.set_artwork_packages()
|
2023-07-11 13:00:19 +00:00
|
|
|
inflate_bubble.set_python_packages()
|
2023-07-11 06:48:53 +00:00
|
|
|
inflate_bubble.set_calamares_packages()
|
2023-07-12 06:02:54 +00:00
|
|
|
inflate_bubble.set_firmware_packages()
|
2023-07-11 06:48:53 +00:00
|
|
|
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()
|
2023-07-14 13:54:13 +00:00
|
|
|
finish_cleanup.copy_iso_file_prod_deb64()
|
2023-07-11 06:48:53 +00:00
|
|
|
finish_cleanup.kill_old_iso()
|
2023-07-14 13:54:13 +00:00
|
|
|
|
2023-07-11 06:48:53 +00:00
|
|
|
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()
|
2023-07-12 03:46:17 +00:00
|
|
|
inflate_bubble.set_extra_packages()
|
|
|
|
inflate_bubble.set_general_packages()
|
|
|
|
inflate_bubble.set_system_packages()
|
2023-07-11 06:48:53 +00:00
|
|
|
inflate_bubble.set_system_packages_64()
|
2023-07-12 03:46:17 +00:00
|
|
|
inflate_bubble.set_artwork_packages()
|
2023-07-11 13:00:19 +00:00
|
|
|
inflate_bubble.set_python_packages()
|
2023-07-11 06:48:53 +00:00
|
|
|
inflate_bubble.set_calamares_packages()
|
2023-07-12 06:02:54 +00:00
|
|
|
inflate_bubble.set_firmware_packages()
|
2023-07-11 06:48:53 +00:00
|
|
|
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()
|
2023-07-14 13:54:13 +00:00
|
|
|
finish_cleanup.copy_iso_file_prod_deb64()
|
2023-07-11 06:48:53 +00:00
|
|
|
finish_cleanup.kill_old_iso()
|
|
|
|
|
|
|
|
|
2023-07-14 13:54:13 +00:00
|
|
|
|
2023-07-11 06:48:53 +00:00
|
|
|
readybuild()
|