diff --git a/anaconda-33.19.sw.patch b/anaconda-33.19.sw.patch new file mode 100755 index 0000000..9bbb5bd --- /dev/null +++ b/anaconda-33.19.sw.patch @@ -0,0 +1,124 @@ +diff -Nuar anaconda-33.19.org/pyanaconda/modules/storage/bootloader/factory.py anaconda-33.19.sw/pyanaconda/modules/storage/bootloader/factory.py +--- anaconda-33.19.org/pyanaconda/modules/storage/bootloader/factory.py 2022-09-07 14:50:46.860000000 +0800 ++++ anaconda-33.19.sw/pyanaconda/modules/storage/bootloader/factory.py 2022-09-07 14:50:57.380000000 +0800 +@@ -106,6 +106,10 @@ + platform_class = platform.platform.__class__ + + # Get the type of the bootloader. ++ if platform_class is platform.Sw_64: ++ from pyanaconda.modules.storage.bootloader.grub2 import GRUB2 ++ return GRUB2 ++ + if platform_class is platform.X86: + from pyanaconda.modules.storage.bootloader.grub2 import GRUB2 + return GRUB2 +diff -Nuar anaconda-33.19.org/pyanaconda/modules/storage/bootloader/grub2.py anaconda-33.19.sw/pyanaconda/modules/storage/bootloader/grub2.py +--- anaconda-33.19.org/pyanaconda/modules/storage/bootloader/grub2.py 2022-09-07 14:50:46.860000000 +0800 ++++ anaconda-33.19.sw/pyanaconda/modules/storage/bootloader/grub2.py 2022-09-07 14:56:42.550000000 +0800 +@@ -101,7 +101,7 @@ + name = "GRUB2" + # grub2 is a virtual provides that's provided by grub2-pc, grub2-ppc64le, + # and all of the primary grub components that aren't grub2-efi-${EFIARCH} +- packages = ["grub2", "grub2-tools"] ++ packages = ["grub2-common", "grub2-tools"] + _config_file = "grub.cfg" + _config_dir = "grub2" + _passwd_file = "user.cfg" +@@ -453,16 +453,47 @@ + return + + try: +- self.write_device_map() +- self.stage2_device.format.sync(root=conf.target.physical_root) +- os.sync() +- self.install() +- os.sync() +- self.stage2_device.format.sync(root=conf.target.physical_root) ++ if os.path.exists("/mnt/sysroot/boot/grub"): ++ FileName="/mnt/sysroot/boot/grub/grub.cfg" ++ f=open(FileName,"w+") ++ f.write("# SW_64 Grub default configurations\n") ++ f.write("set default=0\n") ++ f.write("set timeout=10\n") ++ f.write("\n") ++ f.write("set menu_color_normal=white/black\n") ++ f.write("set menu_color_highlight=light-red/black\n") ++ f.write("\n") ++ f.write("loadfont ${prefix}/fonts/unicode.pf2\n") ++ f.write("insmod efi_gop\n") ++ f.write("set lang=zh_CN\n") ++ f.write("set gfxmode=800x600\n") ++ f.write("set gfxplayload=auto\n") ++ f.write("terminal_output gfxterm\n") ++ f.write("background_color 64,0,64\n") ++ f.write("\n") ++ f.write("menuentry 'openEuler 22.03 LTS SP1' --class gnu-linux --class gnu --class os{\n") ++ f.write("echo \"Loading, please wait for a moment......\"\n") ++ f.write ("set boot=(${root})\n") ++ f.write("echo \"Loading boot\"\n") ++ f.write ("linux.boot ${boot}/initramfs-5.10.0-39.0.0.21.sw_64.img\n") ++ f.write("echo \"Loading vmlinuz\"\n") ++ f.write("linux.vmlinux ${boot}/vmlinuz-5.10.0-39.0.0.21.sw_64 root=/dev/mapper/openeuler-root rootdelay=60 net.ifnames=0 loglevel=0 vga=current rd.systemd.show_status=false rd.udev.log-priority=3 quiet splash video=sm750fb:1280x1024@60 cgroup.memory=nokmem notc\n") ++ f.write("echo \"Booting......\"\n") ++ f.write("boot\n") ++ f.write("}") ++ f.close() ++ else: ++ self.write_device_map() ++ self.stage2_device.format.sync(root=conf.target.physical_root) ++ os.sync() ++ self.install() ++ os.sync() ++ self.stage2_device.format.sync(root=conf.target.physical_root) + finally: +- self.write_config() +- os.sync() +- self.stage2_device.format.sync(root=conf.target.physical_root) ++ pass ++ #self.write_config() ++ #os.sync() ++ #self.stage2_device.format.sync(root=conf.target.physical_root) + + def check(self): + """When installing to the mbr of a disk grub2 needs enough space +diff -Nuar anaconda-33.19.org/pyanaconda/modules/storage/platform.py anaconda-33.19.sw/pyanaconda/modules/storage/platform.py +--- anaconda-33.19.org/pyanaconda/modules/storage/platform.py 2022-09-07 14:50:46.850000000 +0800 ++++ anaconda-33.19.sw/pyanaconda/modules/storage/platform.py 2022-09-07 14:50:57.380000000 +0800 +@@ -116,6 +116,17 @@ + selection fails.""" + return self._boot_stage1_missing_error + ++class Sw_64(Platform): ++ _boot_stage1_device_types = ["disk"] ++ _boot_mbr_description = N_("Master Boot Record") ++ _boot_descriptions = {"disk": _boot_mbr_description, ++ "partition": Platform._boot_partition_description, ++ "mdarray": Platform._boot_raid_description} ++ ++ # XXX hpfs, if reported by blkid/udev, will end up with a type of None ++ _non_linux_format_types = ["vfat", "ntfs", "hpfs"] ++ _boot_stage1_missing_error = N_("You must include at least one MBR- or " ++ "GPT-formatted disk as an install target.") + + class X86(Platform): + _boot_stage1_device_types = ["disk"] +@@ -281,6 +292,8 @@ + raise SystemError("Unsupported PPC machine type: %s" % ppc_machine) + elif arch.is_s390(): + return S390() ++ elif arch.is_sw_64(): ++ return Sw_64() + elif arch.is_efi(): + if arch.is_mactel(): + return MacEFI() +diff -Nuar anaconda-33.19.org/tests/nosetests/pyanaconda_tests/module_bootloader_test.py anaconda-33.19.sw/tests/nosetests/pyanaconda_tests/module_bootloader_test.py +--- anaconda-33.19.org/tests/nosetests/pyanaconda_tests/module_bootloader_test.py 2022-09-07 14:50:46.610000000 +0800 ++++ anaconda-33.19.sw/tests/nosetests/pyanaconda_tests/module_bootloader_test.py 2022-09-07 14:50:57.130000000 +0800 +@@ -393,6 +393,7 @@ + # Test known platforms. + boot_loader_by_platform = { + platform.X86: GRUB2, ++ platform.Sw_64: GRUB2, + platform.EFI: EFIGRUB, + platform.MacEFI: MacEFIGRUB, + platform.PPC: GRUB2, diff --git a/anaconda.spec b/anaconda.spec index 12fbc93..2270673 100644 --- a/anaconda.spec +++ b/anaconda.spec @@ -1,7 +1,7 @@ %define _empty_manifest_terminate_build 0 Name: anaconda Version: 36.16.5 -Release: 8 +Release: 12 Summary: Graphical system installer License: GPLv2+ and MIT URL: http://fedoraproject.org/wiki/Anaconda @@ -32,8 +32,13 @@ Patch9015: bugfix-change-gnome-kiosk-to-use-metacity.patch Patch9016: bugfix-add-log-and-background.patch Patch9017: bugfix-add-SM3-with-tui.patch Patch9018: bugfix-change-product-name-do-not-with-upper.patch +Patch9019: bugfix-adapt-active-connection-without-interface-name.patch + +%ifarch sw_64 +Patch6001: anaconda-33.19.sw.patch +%endif %ifarch loongarch64 -Patch9019: 0001-add-loongarch-support-for-anaconda.patch +Patch6002: 0001-add-loongarch-support-for-anaconda.patch %endif %define dasbusver 1.3 @@ -273,10 +278,38 @@ update-desktop-database &> /dev/null || : %{_prefix}/libexec/anaconda/dd_* %changelog -* Mon Dec 12 2022 Wenlong Zhang - 36.16.5-8 +* Mon Dec 26 2022 fengtao - 36.16.5-12 +- Type:feature - ID:NA - SUG:NA -- DESC: add loongarch support for anaconda +- DESC: add loongarch and sw support patch in SP1 + +* Tue Dec 20 2022 Qingqing Li - 36.16.5-11 +- Type:feature +- ID:NA +- SUG:NA +- DESC:cgroup files is a additional enhanced cgroup feature, which will + limit cgroup opened files, add cgroup_disable=files to + default cmdline to disable this feature to keep cgroup's default behavior. + +* Thu Dec 15 2022 sunhai - 36.16.5-10 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix conf of storage + +* Wed Dec 14 2022 sunhai - 36.16.5-9 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:adapt active connection without interface name + +* Sat Dec 10 2022 sunhai - 36.16.5-8 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:ignore detect enable smt + open swap in storage * Tue Nov 29 2022 sunhai - 36.16.5-7 - Type:bugfix diff --git a/bugfix-adapt-active-connection-without-interface-name.patch b/bugfix-adapt-active-connection-without-interface-name.patch new file mode 100644 index 0000000..393a8ea --- /dev/null +++ b/bugfix-adapt-active-connection-without-interface-name.patch @@ -0,0 +1,26 @@ +From ade550fb89b10cf218ce96541e1c540a2a8a7ea1 Mon Sep 17 00:00:00 2001 +From: sun_hai_10 +Date: Wed, 14 Dec 2022 11:04:41 +0800 +Subject: [PATCH] adapt active connection without interface-name + +--- + pyanaconda/modules/network/initialization.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/pyanaconda/modules/network/initialization.py b/pyanaconda/modules/network/initialization.py +index c7f0ba4..85a1da7 100644 +--- a/pyanaconda/modules/network/initialization.py ++++ b/pyanaconda/modules/network/initialization.py +@@ -135,6 +135,9 @@ class ApplyKickstartTask(Task): + def _find_initramfs_connection_of_iface(self, iface): + device = self._nm_client.get_device_by_iface(iface) + if device: ++ active_connection = device.get_active_connection() ++ if active_connection: ++ return active_connection.get_connection() + cons = device.get_available_connections() + for con in cons: + if con.get_interface_name() == iface and con.get_id() == iface: +-- +2.23.0 + diff --git a/euleros.conf b/euleros.conf index 1e4c0b7..fb008b5 100644 --- a/euleros.conf +++ b/euleros.conf @@ -10,7 +10,7 @@ os_id = EulerOS variant_id = server [Installation System] -can_detect_enabled_smt = True +can_detect_enabled_smt = False [Network] default_on_boot = FIRST_WIRED_WITH_LINK @@ -23,9 +23,13 @@ additional_arguments = crash_kexec_post_notifiers softlockup_panic=1 reserve_kbo enable_closest_mirror = True [Storage] +default_partitioning = + / (min 1 GiB, max 70 GiB) + /home (min 500 MiB, free 50 GiB) + swap [Storage Constraints] -swap_is_recommended = True +swap_is_recommended = False [User Interface] blivet_gui_supported = False diff --git a/hce.conf b/hce.conf index d6113b7..98ea38f 100644 --- a/hce.conf +++ b/hce.conf @@ -10,7 +10,7 @@ os_id = HCE variant_id = server [Installation System] -can_detect_enabled_smt = True +can_detect_enabled_smt = False [Network] default_on_boot = FIRST_WIRED_WITH_LINK @@ -23,9 +23,13 @@ additional_arguments = crash_kexec_post_notifiers softlockup_panic=1 reserve_kbo enable_closest_mirror = True [Storage] +default_partitioning = + / (min 1 GiB, max 70 GiB) + /home (min 500 MiB, free 50 GiB) + swap [Storage Constraints] -swap_is_recommended = True +swap_is_recommended = False [User Interface] blivet_gui_supported = False diff --git a/openeuler.conf b/openeuler.conf index d3503f9..294518a 100644 --- a/openeuler.conf +++ b/openeuler.conf @@ -9,22 +9,26 @@ profile_id = openEuler os_id = openEuler [Installation System] -can_detect_enabled_smt = True +can_detect_enabled_smt = False [Network] default_on_boot = FIRST_WIRED_WITH_LINK [Bootloader] efi_dir = openEuler -additional_arguments = +additional_arguments = cgroup_disable=files [Payload] enable_closest_mirror = True [Storage] +default_partitioning = + / (min 1 GiB, max 70 GiB) + /home (min 500 MiB, free 50 GiB) + swap [Storage Constraints] -swap_is_recommended = True +swap_is_recommended = False [User Interface] blivet_gui_supported = False