From c177d37560e2b24c6a53ecb589f13d83834d0f99 Mon Sep 17 00:00:00 2001 From: debianpepper Date: Sat, 21 Sep 2024 18:00:54 +0900 Subject: [PATCH] Update: Added in all the KDE parts Signed-off-by: debianpepper --- Makefile | 30 ++++++++------ iso_configs/pylibraries/pepperpy/hooks.py | 9 ----- python_modules/build_iso.py | 48 +++++++++++++++++++++++ python_modules/conf.py | 12 ++++-- python_modules/inflate_bubble.py | 12 ++++++ python_modules/infra.py | 16 ++++++++ 6 files changed, 104 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index c47c511b..1572f553 100644 --- a/Makefile +++ b/Makefile @@ -5,41 +5,49 @@ # This Make file is used to execute the different parts if the bubble system # by running for example deb64 will chain execute copy_fls, copy_flders and # inflate to build an ISO . To begin a fresh skeleton, you need to run only -# fresh...after that. As build sare release for publication you can run nightly -# or release to move the files to your web server location the -# run the build you need. +# fresh...after that. As builds are released for publication you can run nightly +# or releases to move the files to your web server location the +# run the build as you need. # None of these steps need to run as root all this can be ran ad a normal user PY_PATH = ~/bubbles/python_modules ## 64 bit ISOs -dev64xfce: - python3 ${PY_PATH}/build_iso.py set e-xfce b-dev64 deb64xfce: python3 ${PY_PATH}/build_iso.py set e-xfce b-deb64 deb64gfb: python3 ${PY_PATH}/build_iso.py set e-gnomefb b-deb64 -dev64gfb: - python3 ${PY_PATH}/build_iso.py set e-gnomefb b-dev64 deb64opb: python3 ${PY_PATH}/build_iso.py set e-openbox b-deb64 +deb64kde: + python3 ${PY_PATH}/build_iso.py set e-kde b-deb64 +dev64xfce: + python3 ${PY_PATH}/build_iso.py set e-xfce b-dev64 +dev64gfb: + python3 ${PY_PATH}/build_iso.py set e-gnomefb b-dev64 dev64opb: python3 ${PY_PATH}/build_iso.py set e-openbox b-dev64 +dev64kde: + python3 ${PY_PATH}/build_iso.py set e-kde b-dev64 ## 32 bit ISOs deb32xfce: python3 ${PY_PATH}/build_iso.py set e-xfce b-deb32 -dev32xfce: - python3 ${PY_PATH}/build_iso.py set e-xfce b-dev32 deb32gfb: python3 ${PY_PATH}/build_iso.py set e-gnomefb b-deb32 -dev32gfb: - python3 ${PY_PATH}/build_iso.py set e-gnomefb b-dev32 deb32opb: python3 ${PY_PATH}/build_iso.py set e-openbox b-deb32 +deb32kde: + python3 ${PY_PATH}/build_iso.py set e-kde b-deb32 +dev32xfce: + python3 ${PY_PATH}/build_iso.py set e-xfce b-dev32 +dev32gfb: + python3 ${PY_PATH}/build_iso.py set e-gnomefb b-dev32 dev32opb: python3 ${PY_PATH}/build_iso.py set e-openbox b-dev32 +dev32kde: + python3 ${PY_PATH}/build_iso.py set e-kde b-dev32 ## arm ISOs debarmxfce: diff --git a/iso_configs/pylibraries/pepperpy/hooks.py b/iso_configs/pylibraries/pepperpy/hooks.py index 98fbcfb7..85d9ea1f 100644 --- a/iso_configs/pylibraries/pepperpy/hooks.py +++ b/iso_configs/pylibraries/pepperpy/hooks.py @@ -248,15 +248,6 @@ def final_cleanup(): os.system('echo "# Changing these values to \\"1\\" may quickly fill up a small partition" > /etc/apt/apt.conf.d/99No-Recommends') # Append additional content to the file os.system('echo "APT::Install-Recommends \\"0\\";\nAPT::Install-Suggests \\"0\\";" >> /etc/apt/apt.conf.d/99No-Recommends') - - - - - - #os.system('echo -e "# Changing these values to \"1\" may quickly fill up a small partition" > /etc/apt/apt.conf.d/99No-Recommends') - #os.system('echo -e "APT::Install-Recommends \"0\";\nAPT::Install-Suggests \"0\";" >> /etc/apt/apt.conf.d/99No-Recommends') - #os.system('echo -e "# Changing these values to \\"1\\" may quickly fill up a small partition" > /etc/apt/apt.conf.d/99No-Recommends') - #os.system('echo -e "APT::Install-Recommends \\"0\\";\nAPT::Install-Suggests \\"0\\";" >> /etc/apt/apt.conf.d/99No-Recommends') ### Fixes the "Not installing grub for UEFI Secure Boot" in all versions , after the default was changed. #sed s/keyutils/"keyutils --install-recommends"/ /usr/sbin/bootloader-config > /tmp/bootloader-config os.system('echo -e "$(grep -A1 -B20 "Installing grub-efi (uefi)..." /usr/sbin/bootloader-config) --install-recommends" > /tmp/bootloader-config') diff --git a/python_modules/build_iso.py b/python_modules/build_iso.py index e157f73e..f4539fc3 100644 --- a/python_modules/build_iso.py +++ b/python_modules/build_iso.py @@ -203,6 +203,36 @@ class BuildOpenbox(BuildBase): return cmd_list +class BuildKde(BuildBase): + """ This class will ensure the KDE builds are built """ + def __init__(self, sbase, sarch): + """ + init the building, super will + ensure that the method resolution order (MRO) is followed + correctly, allowing for a smooth inheritance hierarchy + """ + super().__init__(sbase, sarch, self.kde_helper) + + + def kde_helper(self): + """ + The helper functions to ensure the kde requirements are + used + """ + arch_suffix = self.sarch[1:] + cmd_list = None + if self.sbase in ["deb", "dev", "debmin", "devmin", "debsrv", + "devsrv", "debld", "devld"]: + if arch_suffix in ["64", "32", "arm"]: + os.system(f'touch {self.sbase.upper()}.{arch_suffix}kde') + if arch_suffix in ["64", "32", "arm"]: + cmd_list = getattr(conf, f"build{arch_suffix}_kde_build", []) + for command in cmd_list: + execute = command + '()' + exec(execute) + return cmd_list + + class BuildLoaded(BuildBase): """ This class will ensure the loaded xfce builds are built """ def __init__(self, sbase, sarch): @@ -409,6 +439,24 @@ class Decisions: logger.critical("You have not specified a build to process!") + def dkdeself): + """ Arguments for the KDE """ + build_type_mapping = { + 'b-deb64': ("deb", "_64"), + 'b-deb32': ("deb", "_32"), + 'b-dev64': ("dev", "_64"), + 'b-dev32': ("dev", "_32"), + 'b-debarm': ("deb", "_arm"), + 'b-devarm': ("dev", "_arm"), + } + build_argument = self.arguments.b + if build_argument in build_type_mapping: + readybuild() + BuildKde(*build_type_mapping[build_argument]) + else: + logger.critical("You have not specified a build to process!") + + def dloadxf(self): """ Arguments for the loaded xfce """ build_type_mapping = { diff --git a/python_modules/conf.py b/python_modules/conf.py index 43594961..5c5ab900 100644 --- a/python_modules/conf.py +++ b/python_modules/conf.py @@ -77,6 +77,8 @@ setup_gfb_cmds = ('inflate_bubble.set_gfb', setup_opb_cmds = ('inflate_bubble.set_opb', 'infra.open_box_configs', ) +setup_kde_cmds =('') + setup_loaded_cmds = ('inflate_bubble.set_loaded', 'infra.loaded_configs', 'infra.loaded_folders', @@ -85,7 +87,6 @@ setup_server_cmds = ('inflate_bubble.set_server', 'infra.server_configs', ) setup_mini_cmds = ('inflate_bubble.set_mini',) - # Setup grub chroot setup_chroot_grub_64 = ('inflate_bubble.set_chroot_grub_64',) setup_chroot_grub_arm = ('inflate_bubble.set_chroot_grub_arm',) @@ -119,6 +120,9 @@ buildarm_xfce_build = (shared_setup_cmds + setup_xfce_cmds + setup_chroot_grub_arm + setup_binary_grub_arm + setup_fw_arm ) +# KDE +build_64_kde_build = () + # Gnome_FlashBack build64_gfb_build = (shared_setup_cmds + setup_gfb_cmds + setup_chroot_grub_64 + setup_binary_grub_64 + @@ -245,6 +249,7 @@ OPENBOX_LIST = ('openbox\n' 'jgmenu\n' ) + LOADED_LIST = ('accountsservice\n' 'apt-config-auto-update\n' 'atril\n' @@ -308,6 +313,7 @@ LOADED_LIST = ('accountsservice\n' 'xserver-xorg-video-all\n' ) + SERVER_LIST = ('btop\n' 'cups\n' 'debsecan\n' @@ -329,12 +335,12 @@ SERVER_LIST = ('btop\n' 'zonefstoolspep\n' ) + MINI_LIST = ('nano\n' ) -KDE_LIST = ('sample1\n' - 'sample2\n' +KDE_LIST = ('kde-full' ) diff --git a/python_modules/inflate_bubble.py b/python_modules/inflate_bubble.py index 430d4946..a2666819 100644 --- a/python_modules/inflate_bubble.py +++ b/python_modules/inflate_bubble.py @@ -214,6 +214,11 @@ def make_bld_openbox(base, arch): make_build_file(base, arch, 'opb', 'OpenBox Build') +def make_bld_kde(base, arch): + """Write the kde build file""" + make_build_file(base, arch, 'kde', 'KDE Build') + + def make_bld_loaded(base, arch): """Write the loaded build file""" make_build_file(base, arch, 'loaded', 'Loaded Build') @@ -300,6 +305,13 @@ def set_opb(): ) +def set_kde(): + """ Create the list file for the kde list""" + make_package_list('kde.list.chroot', + conf.KDE_LIST, mode='x' + ) + + def set_loaded(): """ Create the list for the loaded list""" make_package_list('loaded.list.chroot', diff --git a/python_modules/infra.py b/python_modules/infra.py index fad33f45..978752f9 100644 --- a/python_modules/infra.py +++ b/python_modules/infra.py @@ -376,6 +376,7 @@ def get_id_build_type(): shutil.copy(src_file, dest_file) print(f'Copied: {src_file} to {dest_file}') + def ignore_missing_files(src, names): return [name for name in names if not os.path.exists(os.path.join(src, name))] @@ -698,6 +699,21 @@ def open_box_configs(): logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + des_ob) +def kde_configs(): + """ + Copy the kde files + """ + logger.info("Copy KDE configs") + src_kde = '/kde' + des_kde = '/etc/skel/' + logger.info("INFO: Copying - " + HOME_FOLDER + src_kde) + shutil.copytree(HOME_FOLDER + src_kde, + HOME_FOLDER + WPCHROOT + des_kde, + dirs_exist_ok = True + ) + logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + des_kde) + + def loaded_configs(): """ Copy the loaded xfce files