merge git repos

This commit is contained in:
manuel 2024-09-22 16:22:05 +00:00
parent adb0057618
commit 9d44d90d88
6 changed files with 190 additions and 139 deletions

View File

@ -76,6 +76,7 @@ class BuildBase:
infra_methods = [infra.BinaryFolders, infra.ChrootInstallerFiles, infra_methods = [infra.BinaryFolders, infra.ChrootInstallerFiles,
infra.ArchitectureFiles, infra.Archive, infra.ArchitectureFiles, infra.Archive,
infra.InstallerFiles, infra.FusatoConfigs, infra.InstallerFiles, infra.FusatoConfigs,
infra.ServerConfigFiles,
] ]
for method in infra_methods: for method in infra_methods:
method(self.sbase, self.sarch) method(self.sbase, self.sarch)

View File

@ -1,4 +1,3 @@
<<<<<<< HEAD
""" """
* Author: "PeppermintOS Team(peppermintosteam@proton.me) * Author: "PeppermintOS Team(peppermintosteam@proton.me)
* *
@ -8,16 +7,15 @@
* and desktop as the need to scale the builds arises, you can add more * and desktop as the need to scale the builds arises, you can add more
* settings to meet the need. * settings to meet the need.
""" """
=======
import paths import paths
import inflate_bubble import inflate_bubble
import finish_cleanup import finish_cleanup
import copy_folders import copy_folders
import copy_files_specified import copy_files_specified
>>>>>>> 6dd24574 (Updated)
######################################### #########################################
# Sepcify the build to use, for exmaple # # Sepecify the build to use, for exmaple #
# bookworm, trixie etc... # # bookworm, trixie etc... #
######################################### #########################################
debian_codename ='bookworm' debian_codename ='bookworm'
@ -42,8 +40,7 @@ shared_setup_cmds = ('inflate_bubble.set_fusato_structure',
'infra.add_web_profile' 'infra.add_web_profile'
) )
shared_setup_loaded_cmds = ( shared_setup_loaded_cmds = ('inflate_bubble.set_fusato_structure',
'inflate_bubble.set_fusato_structure',
'inflate_bubble.set_fusato_installer_structure', 'inflate_bubble.set_fusato_installer_structure',
'inflate_bubble.set_general_shared', 'inflate_bubble.set_general_shared',
'inflate_bubble.set_grub_shared', 'inflate_bubble.set_grub_shared',
@ -56,17 +53,12 @@ shared_setup_loaded_cmds = (
'infra.boostrap_shared' 'infra.boostrap_shared'
) )
shared_setup_server_cmds = ( shared_setup_server_cmds = ('inflate_bubble.set_fusato_server_installer_structure',
'inflate_bubble.set_fusato_server_installer_structure',
'inflate_bubble.set_fusato_server_structure', 'inflate_bubble.set_fusato_server_structure',
'inflate_bubble.set_grub_shared',
'inflate_bubble.set_binary_shared',
'infra.shared_server_files', 'infra.shared_server_files',
'infra.boostrap_shared'
) )
shared_setup_mini_cmds = ( shared_setup_mini_cmds = ('inflate_bubble.set_fusato_mini_installer_structure',
'inflate_bubble.set_fusato_mini_installer_structure',
'inflate_bubble.set_binary_shared', 'inflate_bubble.set_binary_shared',
'infra.mini_shared_installer_files' 'infra.mini_shared_installer_files'
) )
@ -97,13 +89,11 @@ setup_server_cmds = ('inflate_bubble.set_server',
'infra.server_configs', 'infra.server_configs',
) )
setup_mini_cmds = ('inflate_bubble.set_mini',) setup_mini_cmds = ('inflate_bubble.set_mini',)
# Setup grub chroot # Setup grub chroot
setup_chroot_grub_64 = ('inflate_bubble.set_chroot_grub_64',) setup_chroot_grub_64 = ('inflate_bubble.set_chroot_grub_64',)
setup_chroot_grub_arm = ('inflate_bubble.set_chroot_grub_arm',) setup_chroot_grub_arm = ('inflate_bubble.set_chroot_grub_arm',)
setup_chroot_grub_32 = ('inflate_bubble.set_chroot_grub_32',) setup_chroot_grub_32 = ('inflate_bubble.set_chroot_grub_32',)
setup_chroot_grub_64ld = ('inflate_bubble.set_chroot_grub_64ld',)
setup_chroot_grub_64srv = ('inflate_bubble.set_chroot_grub_64srv',)
setup_chroot_grub_64min = ('inflate_bubble.set_chroot_grub_64,min',)
# Setup grub binary # Setup grub binary
setup_binary_grub_64 = ('inflate_bubble.set_binary_64',) setup_binary_grub_64 = ('inflate_bubble.set_binary_64',)
@ -165,7 +155,7 @@ buildarm_opb_build = (shared_setup_cmds + setup_opb_cmds +
setup_fw_arm setup_fw_arm
) )
#Open_box #Kde
build64_kde_build = (shared_setup_cmds + setup_kde_cmds + build64_kde_build = (shared_setup_cmds + setup_kde_cmds +
setup_chroot_grub_64 + setup_binary_grub_64 + setup_chroot_grub_64 + setup_binary_grub_64 +
setup_fw_64_32 setup_fw_64_32
@ -193,7 +183,6 @@ build32_loaded_build = (shared_setup_loaded_cmds + setup_loaded_cmds +
#Server #Server
build64_server_build = (shared_setup_server_cmds + setup_server_cmds + build64_server_build = (shared_setup_server_cmds + setup_server_cmds +
setup_chroot_grub_64 + setup_binary_grub_64 +
setup_fw_64_32 setup_fw_64_32
) )
@ -276,89 +265,91 @@ OPENBOX_LIST = ('openbox\n'
) )
LOADED_LIST = ('accountsservice\n' LOADED_LIST = ('xfce4\n'
'apt-config-auto-update\n'
'atril\n'
'baobab\n'
'bleachbit\n'
'blueman\n'
'catfish\n'
'cheese\n'
'ffmpegthumbnailer\n'
'flatpak\n'
'gnome-packagekit\n'
'gnome-system-tools\n'
'gvfs-backends\n'
'gufw\n'
'gnome-calculator\n'
'gnome-2048\n'
'gnome-chess\n'
'gnome-mahjongg\n'
'gnome-sudoku\n'
'gimp\n'
'gimp-data-extras\n'
'gir1.2-flatpak-1.0\n'
'inkscape\n'
'menulibre\n'
'libreoffice\n'
'libreoffice-gtk3\n'
'libreoffice-l10n*\n'
'mintstick\n'
'ntpsec-ntpdate\n'
'ntpsec\n'
'parole \n'
'peplocale\n'
'pepinstall\n'
'printer-driver-cups-pdf\n'
'qt5-style-plugins\n'
'qt5ct\n'
'squashfs-tools\n'
'sticky\n'
'transmission-gtk\n'
'timeshift\n'
'thunderbird\n'
'thunderbird-l10n-all\n'
'tumbler\n'
'tumbler-plugins-extra\n'
'system-config-printer\n'
'tela-icon-theme\n'
'xdg-user-dirs-gtk\n'
'xfce4\n'
'xfce4-goodies\n' 'xfce4-goodies\n'
'xfsdump\n'
'xorg\n' 'xorg\n'
'xscreensaver\n'
'xscreensaver-data\n'
'xscreensaver-data-extra\n'
'xscreensaver-gl\n'
'xscreensaver-gl-extra\n'
'xserver-xorg\n' 'xserver-xorg\n'
'xserver-xorg-input-synaptics\n' 'xserver-xorg-input-synaptics\n'
'xserver-xorg-input-all\n' 'xserver-xorg-input-all\n'
'xserver-xorg-video-vmware\n' 'xserver-xorg-video-vmware\n'
'xserver-xorg-video-all\n' 'xserver-xorg-video-all\n'
'apt-config-auto-update\n'
'gnome-system-tools\n'
'gvfs-backends\n'
'blueman\n'
'bluez-cups\n'
'bluez-alsa-utils\n'
'gufw\n'
'plank\n'
'tela-icon-theme\n'
'system-config-printer\n'
'menulibre\n'
'xscreensaver\n'
'xscreensaver-data\n'
'xscreensaver-data-extra\n'
'xscreensaver-gl\n'
'xscreensaver-gl-extra\n'
'gnome-calculator\n'
'accountsservice\n'
'catfish\n'
'timeshift\n'
'pepinstall\n'
'sticky\n'
'mintstick\n'
'peplocale\n'
'bleachbit\n'
'gimp\n'
'gimp-data-extras\n'
'inkscape\n'
'atril\n'
'transmission-gtk\n'
'thunderbird\n'
'thunderbird-l10n-all\n'
'libreoffice\n'
'libreoffice-gtk3\n'
'libreoffice-l10n*\n'
'printer-driver-cups-pdf\n'
'gnome-2048\n'
'gnome-chess\n'
'gnome-mahjongg\n'
'gnome-sudoku\n'
'cheese\n'
'parole \n'
'qt5-style-plugins\n'
'qt5ct\n'
'xfsdump\n'
'tumbler\n'
'tumbler-plugins-extra\n'
'ffmpegthumbnailer\n'
'baobab\n'
'xdg-user-dirs-gtk\n'
'squashfs-tools\n'
'flatpak\n'
'gir1.2-flatpak-1.0\n'
'ntpsec-ntpdate\n'
'ntpsec\n'
'mugshot\n'
) )
SERVER_LIST = ('zonefstoolspep\n'
SERVER_LIST = ('btop\n'
'cups\n'
'debsecan\n'
'dmzonedtoolspep\n' 'dmzonedtoolspep\n'
'firewalld\n'
'gvfs-backends\n'
'git\n'
'net-tools\n'
'nfs-common\n'
'libzbdpep1\n' 'libzbdpep1\n'
'sudo\n' 'sudo\n'
'samba\n'
'rkhunter\n'
'sshguard\n'
'task-ssh-server\n' 'task-ssh-server\n'
'task-web-server\n' 'dialog\n'
'sshguard\n'
'whois\n' 'whois\n'
'rkhunter\n'
'debsecan\n'
'net-tools\n'
'nfs-common\n'
'firewalld\n'
'openssl\n'
'cups\n'
'git\n'
'grub-pc\n'
'wget\n' 'wget\n'
'zonefstoolspep\n' 'curl\n'
) )
@ -446,14 +437,6 @@ GRUB_LIST_64 = ('grub-efi-amd64\n'
'grub-efi-ia32-bin\n' 'grub-efi-ia32-bin\n'
) )
# Grub things shared by 64bit
GRUB_LIST_64LD = ('grub-efi-amd64\n'
'grub-efi-amd64-bin\n'
'grub-efi-amd64-signed\n'
'shim-helpers-amd64-signed\n'
'grub-efi-ia32-bin\n'
)
# Grub things shared by ARM # Grub things shared by ARM
GRUB_LIST_ARM64 = ('grub-efi-arm64\n' GRUB_LIST_ARM64 = ('grub-efi-arm64\n'
'grub-efi-arm64-bin\n' 'grub-efi-arm64-bin\n'
@ -507,8 +490,6 @@ FIRMWARE_LIST_32_64 = ('atmel-firmware\n'
'midisport-firmware\n' 'midisport-firmware\n'
) )
# Frimware packages used by ARM
FIRMWARE_LIST_ARM = ('firmware-atheros\n'
### Inflate bubble section ### Inflate bubble section
import paths import paths
src_paths = [paths.src_deb64_osrelease, src_paths = [paths.src_deb64_osrelease,
@ -813,13 +794,8 @@ BINARY_LIST_32 = ('grub-efi-ia32\n'
'grub-efi-ia32-signed\n' 'grub-efi-ia32-signed\n'
'grub-efi-ia32-bin\n' 'grub-efi-ia32-bin\n'
'shim-helpers-i386-signed\n' 'shim-helpers-i386-signed\n'
'firmware-libertas\n'
'firmware-netxen\n'
'firmware-zd1211\n'
'firmware-ralink'
) )
binary_list_64 = ('efibootmgr\n' binary_list_64 = ('efibootmgr\n'
'grub-common\n' 'grub-common\n'
'grub2-common\n' 'grub2-common\n'
@ -919,6 +895,7 @@ f' --distribution {debian_codename}'
LBSET_DEVUAN_SHARED = ( LBSET_DEVUAN_SHARED = (
f' --distribution {devuan_codename}' f' --distribution {devuan_codename}'
' --initsystem sysvinit' ' --initsystem sysvinit'
' --debootstrap-options --include=ca-certificates'
' --mirror-bootstrap http://deb.devuan.org/merged' ' --mirror-bootstrap http://deb.devuan.org/merged'
' --parent-mirror-bootstrap http://deb.devuan.org/merged' ' --parent-mirror-bootstrap http://deb.devuan.org/merged'
' --parent-mirror-chroot http://deb.devuan.org/merged' ' --parent-mirror-chroot http://deb.devuan.org/merged'

View File

@ -10,7 +10,6 @@ import os
import shutil import shutil
from pathlib import Path from pathlib import Path
from datetime import date from datetime import date
<<<<<<< HEAD
import time import time
# Set the home path used regardless the user logged in # Set the home path used regardless the user logged in
@ -37,14 +36,12 @@ string_home = str(home_folder)
def make_check_sum(): def make_check_sum():
""" Generate the check sum files """ """ Generate the check sum files """
<<<<<<< HEAD
os.chdir(HOME_FOLDER + FUSATO_ROOT) os.chdir(HOME_FOLDER + FUSATO_ROOT)
current_working_directory = os.getcwd().replace('/', '/') current_working_directory = os.getcwd().replace('/', '/')
for _, _, files in os.walk(current_working_directory): for _, _, files in os.walk(current_working_directory):
======= =======
current_dir = os.getcwd().replace('/', '/') current_dir = os.getcwd().replace('/', '/')
for root, dirs, files in os.walk(current_dir): for root, dirs, files in os.walk(current_dir):
>>>>>>> cc1e91f1 (Updated)
for fiso in files: for fiso in files:
if fiso.endswith('.iso'): if fiso.endswith('.iso'):
sha = "sha512sum " sha = "sha512sum "
@ -53,7 +50,6 @@ def make_check_sum():
os.system(gen_sum) os.system(gen_sum)
<<<<<<< HEAD
def process_iso(base, arch, desktop): def process_iso(base, arch, desktop):
""" """
Process the ISO for a given base, architecture, and desktop. Process the ISO for a given base, architecture, and desktop.
@ -313,7 +309,6 @@ def kill_fusato():
def kill_old_iso(): def kill_old_iso():
""" Delete older ISOs""" """ Delete older ISOs"""
<<<<<<< HEAD
base_path = BASE_DESTINATION base_path = BASE_DESTINATION
arch_list = ['/deb32/', '/deb64/', '/debarm/', '/dev32/', '/dev64/', '/devarm/'] arch_list = ['/deb32/', '/deb64/', '/debarm/', '/dev32/', '/dev64/', '/devarm/']
de_list = ['gfb', 'opb', 'xfce', 'loaded', 'server', 'mini', 'kde'] de_list = ['gfb', 'opb', 'xfce', 'loaded', 'server', 'mini', 'kde']

View File

@ -23,7 +23,6 @@ def set_config_structure():
# you can add additional, folders to the array as needed, you can also # you can add additional, folders to the array as needed, you can also
# remove a folder if you do not deem it necessary to be used # remove a folder if you do not deem it necessary to be used
folders = ["aliases", "xfce", "wallpaper", "user_config", "theme", folders = ["aliases", "xfce", "wallpaper", "user_config", "theme",
<<<<<<< HEAD
"sources", "icons", "profile", "polkit", "sources", "icons", "profile", "polkit",
"plymouth", "osrelease", "multimedia", "menu", "splash", "plymouth", "osrelease", "multimedia", "menu", "splash",
"lightdm", "issue", "info", "hooks", "grub", "font", "lightdm", "issue", "info", "hooks", "grub", "font",
@ -31,13 +30,6 @@ def set_config_structure():
"application", "PepProPixMaps", "PepProTools", "packages", "application", "PepProPixMaps", "PepProTools", "packages",
"loaded-application", "loaded-hooks", "loaded-wallpaper", "loaded-application", "loaded-hooks", "loaded-wallpaper",
"loaded-xfce", "id_files", "server-hooks,", "server-installer", "server-firewall", "server-scripts" "loaded-xfce", "id_files", "server-hooks,", "server-installer", "server-firewall", "server-scripts"
=======
"sources", "icons", "gksudo", "profile", "polkit",
"plymouth", "osrelease", "multimedia", "menu", "splash",
"lightdm", "issue", "info", "hooks", "grub", "font",
"desktop_base", "database", "calamares_settings",
"application", "PepProPixMaps", "PepProTools", "packages"
>>>>>>> cc1e91f1 (Updated)
] ]
for f in folders: for f in folders:
if os.path.exists(f): if os.path.exists(f):
@ -47,8 +39,4 @@ def set_config_structure():
else: else:
os.makedirs(f) os.makedirs(f)
<<<<<<< HEAD
set_config_structure() set_config_structure()
=======
set_config_structure()
>>>>>>> cc1e91f1 (Updated)

View File

@ -9,7 +9,6 @@
import os import os
from pathlib import Path from pathlib import Path
<<<<<<< HEAD
import conf import conf
# Set the home path used regardless the user logged in # Set the home path used regardless the user logged in
@ -68,8 +67,9 @@ def set_fusato_server_structure():
at the moment you deal with chroot, bootstrap, and at the moment you deal with chroot, bootstrap, and
includes-installer includes-installer
""" """
make_chroot = ['etc/firewalld/zones', make_chroot = ['etc/firewalld/zones/',
'boot/grub', 'boot/grub/',
'usr/local/bin/',
] ]
os.chdir(os.path.join(HOME_FOLDER, FUSATO_ROOT)) os.chdir(os.path.join(HOME_FOLDER, FUSATO_ROOT))
if os.path.exists('config'): if os.path.exists('config'):
@ -498,4 +498,4 @@ def set_fusato_structure():
# make needed folders # make needed folders
for f in make_fldrs: for f in make_fldrs:
os.makedirs(working_path + f) os.makedirs(working_path + f)
>>>>>>> cc1e91f1 (Updated)

View File

@ -309,6 +309,96 @@ def mini_shared_installer_files():
shutil.copy(src_path, des_path) shutil.copy(src_path, des_path)
logger.info(f"Copy completed: {des_path}") logger.info(f"Copy completed: {des_path}")
class ServerConfigFiles:
"""
Copies server initial config files CHROOT depending on the base.
"""
ALLOWED_BASES = {"debsrv", "devsrv"}
def __init__(self, base, sarch=None):
self.base = base
self.sarch = sarch
if self.base not in self.ALLOWED_BASES:
logger.warning(f"Base '{self.base}' is not allowed. Skipping.")
return
logger.info(f"Copy Server Files for base: {self.base}")
server_path = '/server/scripts/'
self.src_paths = (
f'{server_path}{self.base}/welcome.sh',
f'{server_path}{self.base}/configure_apache2.sh',
f'{server_path}{self.base}/configure_firewalld.sh',
f'{server_path}{self.base}/configure_hostname.sh',
f'{server_path}{self.base}/configure_mariadb.sh',
f'{server_path}{self.base}/configure_nginx.sh',
f'{server_path}{self.base}/configure_php_and_docker.sh',
f'{server_path}{self.base}/configure_postfix.sh',
f'{server_path}{self.base}/configure_postgresql.sh',
f'{server_path}{self.base}/configure_sqlite.sh',
f'{server_path}{self.base}/configure_ssh.sh',
f'{server_path}{self.base}/configure_static_ip.sh',
f'{server_path}{self.base}/create_user.sh',
f'{server_path}{self.base}/update_and_install.sh'
)
self.des_paths = (
'/usr/local/bin',
'/usr/local/bin',
'/usr/local/bin',
'/usr/local/bin',
'/usr/local/bin',
'/usr/local/bin',
'/usr/local/bin',
'/usr/local/bin',
'/usr/local/bin',
'/usr/local/bin',
'/usr/local/bin',
'/usr/local/bin',
'/usr/local/bin',
'/usr/local/bin'
)
self.copy_files()
def copy_files(self):
""" Ensure destination directories exist before copying"""
for des in self.des_paths:
full_des_path = os.path.join(HOME_FOLDER, WPCHROOT.strip('/'), des.strip('/'))
try:
os.makedirs(full_des_path, exist_ok=True)
logger.info(f"Ensured directory exists: {full_des_path}")
except Exception as e:
logger.error(f"Error creating directory {full_des_path}: {e}")
src_q = collections.deque(self.src_paths)
des_q = collections.deque(self.des_paths)
size_q = len(src_q)
for _ in range(size_q):
source = src_q.popleft()
des = des_q.popleft()
full_src_path = os.path.join(HOME_FOLDER, source.strip('/'))
full_des_path = os.path.join(HOME_FOLDER,
WPCHROOT.strip('/'), des.strip('/')
)
logger.info(MSG_COPY + full_src_path)
try:
if os.path.exists(full_src_path):
if os.path.isdir(full_src_path):
shutil.copytree(full_src_path,
os.path.join(full_des_path,
os.path.basename(full_src_path)),
dirs_exist_ok=True
)
else:
shutil.copy(full_src_path, full_des_path)
logger.info(MSG_FIN + full_des_path)
else:
logger.error(f"Source path does not exist: {full_src_path}")
except Exception as e:
logger.error(f"Error copying {full_src_path} to {full_des_path}: {e}")
@classmethod
def run_for_all_bases(cls):
""" Define the bases to be used"""
bases = ["debsrv", "devsrv", "invalid_base"]
for base in bases:
cls(base)
class ArchitectureFiles: class ArchitectureFiles:
""" """