Add sw64 architecture
Signed-off-by: wzx <wuzx1226@qq.com>
This commit is contained in:
parent
362108007e
commit
7bac48d7ae
124
anaconda-33.19.sw.patch
Executable file
124
anaconda-33.19.sw.patch
Executable file
@ -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,
|
||||
@ -1,7 +1,7 @@
|
||||
%define _empty_manifest_terminate_build 0
|
||||
Name: anaconda
|
||||
Version: 33.19
|
||||
Release: 47
|
||||
Release: 48
|
||||
Summary: Graphical system installer
|
||||
License: GPLv2+ and MIT
|
||||
URL: http://fedoraproject.org/wiki/Anaconda
|
||||
@ -127,6 +127,9 @@ Patch6082: Support-configuration-of-additional-boot-arguments.patch
|
||||
|
||||
Patch6083: backport-revert-Set-default-entry-to-the-BLS-id-instead-of-th.patch
|
||||
Patch6084: bugfix-Solve-the-problem-that-the-circular-loading-progress-bar-does-not-rotate.patch
|
||||
%ifarch sw_64
|
||||
Patch6085: anaconda-33.19.sw.patch
|
||||
%endif
|
||||
|
||||
%define dbusver 1.2.3
|
||||
%define dnfver 3.6.0
|
||||
@ -366,6 +369,12 @@ update-desktop-database &> /dev/null || :
|
||||
%{_prefix}/libexec/anaconda/dd_*
|
||||
|
||||
%changelog
|
||||
* Tue Oct 18 2022 wuzx<wuzx1226@qq.com> - 33.19-48
|
||||
- Type:feature
|
||||
- CVE:NA
|
||||
- SUG:NA
|
||||
- DESC:Add sw64 architecture
|
||||
|
||||
* Wed Sep 21 2022 sunhai <sunhai10@huawei.com> - 33.19-47
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user