bubbles/python_modules/deb_32.py

171 lines
5.6 KiB
Python
Raw Normal View History

2024-09-21 21:27:04 +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
# 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_deb32)
os.system(lbsetup)
def copy_deb32_specific():
"""" Debian 32 copy jobs"""
shutil.copytree(cur_dir + paths.src_deb32_osrelease,
WP_CHROOT + paths.des_osrelease,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb32_osrelease,
WP_CHROOT + paths.des_osrelease_opt,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb32_slpash,
cur_dir + paths.des_splash,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb32_isolinux,
cur_dir + paths.des_isolinux,
dirs_exist_ok=True
)
#shutil.copytree(cur_dir + paths.src_deb32_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_deb32_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_deb32_grub_etc,
WP_CHROOT + paths.des_grub_etc
)
shutil.copy(cur_dir + paths.src_deb32_settings,
WP_CHROOT + paths.des_setttings
)
shutil.copy(cur_dir + paths.src_deb32_installer,
WP_CHROOT + paths.des_installer
)
#shutil.copy(cur_dir + paths.src_deb32_sourcesfinal,
# WP_CHROOT + paths.des_sourcesfinal
# )
shutil.copy(cur_dir + paths.src_deb32_bootloader,
WP_CHROOT + paths.des_bootloader
)
shutil.copy(cur_dir + paths.src_deb32_netinstall,
WP_CHROOT + paths.des_netinstall
)
shutil.copy(cur_dir + paths.src_deb32_sourcelist,
WP_CHROOT + paths.des_sourcelist
)
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_32()
# 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_32()
copy_folders.copy_folders_files()
copy_files_specified.copy_specific_files()
copy_files_specified.set_symlinks()
copy_deb32_specific()
run_build()
finish_cleanup.make_check_sum()
finish_cleanup.copy_iso_file_nightly_deb32()
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_32()
# 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_32()
copy_folders.copy_folders_files()
copy_files_specified.copy_specific_files()
copy_files_specified.set_symlinks()
copy_deb32_specific()
run_build()
finish_cleanup.make_check_sum()
finish_cleanup.copy_iso_file_nightly_deb32()
finish_cleanup.kill_old_iso()
readybuild()