diff options
123 files changed, 3229 insertions, 2412 deletions
@@ -1,3 +1,5 @@ +*.pyc +*.pyo /*.patch *.swp *.orig @@ -1,5 +1,5 @@ Introduction ------------ +------------ This layer provides an installation program based on OE platform. The installation program is anaconda from fedora, which is the installer of distribution Fedora, @@ -7,7 +7,7 @@ RedHat and Centos. (https://fedoraproject.org/wiki/Anaconda) There are two builds required, one is target build, -another is host build. +the other is host build. The image/packages of target build is installed on the target hard disk as user requirements. @@ -38,28 +38,28 @@ http://git.yoctoproject.org/git/meta-anaconda Maintenance ----------- -Maintainers: Hongxu Jia <jiahongxujia@163.com> | <hongxu.jia@windriver.com> +Maintainers: Hongxu Jia <jiahongxujia@163.com> | <hongxu.jia@windriver.com> Robert Yang <liezhi.yang@windriver.com> - Mark Hatle <mark.hatle@windriver.com> + Kai Kang <kai.kang@windriver.com> Contributing ------------ +------------ Contributions and patches can be sent to the Yocto Project mailing -list: yocto@yoctoproject.org" +list: yocto@yoctoproject.org When sending patches please take a look at the contribution guide available -here: https://wiki.yoctoproject.org/wiki/Contribution_Guidelines +here: https://docs.yoctoproject.org/dev/contributor-guide/submit-changes.html example: git send-email -1 -M --to yocto@yoctoproject.org --subject-prefix=meta-anaconda][PATCH Limitation ------------ +---------- 1) Since OE use grub-efi to generate live image, the compatible host is i.86|x86_64 (Set MACHINE = "qemux86-64|qemux86" in default build) -2) The target installer based on fedora 26, so it requires: +2) The target installer based on fedora 39, so it requires: - systemd as init manager - python3 - dnf2/rpm4 @@ -67,37 +67,40 @@ Limitation in MACHINE_FEATURES Building the target installer ------------ +----------------------------- 1. Summary The target installer is enabled by including this layer. There are two images in target installer, one is target - image which to be installed to target, another is installer image - which to do the installation. + image which to be installed to target, the other is installer + image which to do the installation. A target image requires specific components to be compatible with the installer. To install these components set - DISTRO_FEATURES_append = " anaconda-support" in local.conf + + DISTRO_FEATURES:append = " anaconda-support" + + in local.conf. For installer image, you are not supposed to change the 'DISTRO' setting in target build directory. It may work, but it's not - recommended. Instead we should recommend the user run a - oe-init-build-env and create a new build directory for the installer. - Set DISTRO = 'anaconda' in local.conf file. + recommended. Instead we should recommend user to run `source + oe-init-build-env` and create a new build directory for the installer. + Then set `DISTRO = 'anaconda'` in local.conf file. There are two kinds of installer builds: "Image Based Install" and "Package Based Install". The former is to install a prebuilt image, - the latter is to install RPM packages. + and the latter is to install RPM packages. For Image Based Install, set INSTALLER_TARGET_BUILD = '<target-build-image>' in local.conf to specify an .ext2, .ext3, or ext4 image file, then the installer will copy this image to the target. - For Package Based Install, set INSTALLER_TARGET_BUILD = + For Package Based Install, set INSTALLER_TARGET_BUILD = '<target-build-topdir>' to specify the path to target build directory - that will supply RPMs, and INSTALLER_TARGET_IMAGE = '<target-image-pn>' + which will supply RPMs, and INSTALLER_TARGET_IMAGE = '<target-image-pn>' to specify the image recipe name, then the installer will install its - RPMs to the target; + RPMs to the target. 2. Two main use cases 2.1 Installer image with ext2, ext3 or ext4 image from the target @@ -132,12 +135,12 @@ Building the target installer The build requires 'anaconda-support' in DISTRO_FEATURES to help installation. It also requires pam, RPM packages and systemd init manager. Edit conf/local.conf to use: - $ echo 'DISTRO_FEATURES_append = " anaconda-support"' >> conf/local.conf - $ echo 'DISTRO_FEATURES_append = " pam"' >> conf/local.conf + $ echo 'DISTRO_FEATURES:append = " anaconda-support"' >> conf/local.conf + $ echo 'DISTRO_FEATURES:append = " pam"' >> conf/local.conf $ echo 'PACKAGE_CLASSES = "package_rpm"' >> conf/local.conf $ echo 'VIRTUAL-RUNTIME_init_manager = "systemd"' >> conf/local.conf - $ echo 'DISTRO_FEATURES_append = " systemd"' >> conf/local.conf - $ echo 'DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " sysvinit"' >> conf/local.conf + $ echo 'DISTRO_FEATURES:append = " systemd"' >> conf/local.conf + $ echo 'DISTRO_FEATURES_BACKFILL_CONSIDERED:append = " sysvinit"' >> conf/local.conf Edit conf/bblayers.conf to include other layers BBLAYERS ?= " \ @@ -162,7 +165,7 @@ Building the target installer Edit conf/local.conf to use: $ echo 'PACKAGE_CLASSES = "package_rpm"' >> conf/local.conf $ echo 'DISTRO = "anaconda"' >> conf/local.conf - $ echo 'INSTALLER_TARGET_BUILD = "<target_build>/tmp-glibc/deploy/images/qemux86/core-image-minimal-qemux86.ext4"' >> conf/local.conf + $ echo 'INSTALLER_TARGET_BUILD = "<target_build>/tmp-glibc/deploy/images/qemux86/core-image-minimal-qemux86.rootfs.ext4"' >> conf/local.conf Edit conf/bblayers.conf to include other layers BBLAYERS ?= " \ @@ -424,10 +427,11 @@ Building the target installer The file be download to target image (/mnt/image/****). 12. How to authenticate while downloading kickstart from web server - 12.1 We add boot options 'ksuser' and 'kspasswd'(listed in /proc/cmdline) + 12.1 We add boot options 'inst.ksuser' and 'inst.kspasswd'(listed in /proc/cmdline) to support authentication while downloading kickstart from web server. - You could integrate them to installer image by set APPEND_append = - " ks=<url-ks> ksuser=<username> kspasswd=<password>" in local.conf + You could integrate them to installer image by set APPEND:append = + " inst.ks=<url-ks> inst.ksuser=<username> inst.kspasswd=<password>" in + local.conf 12.2 Currently, we support basic/digest authentication, which decided by your web server. diff --git a/classes/anaconda_image.bbclass b/classes/anaconda_image.bbclass index a2f86ff..5830ac0 100644 --- a/classes/anaconda_image.bbclass +++ b/classes/anaconda_image.bbclass @@ -1,8 +1,11 @@ -RPM_POSTPROCESS_COMMANDS_append = "wrl_installer;" +RPM_POSTPROCESS_COMMANDS:append = "wrl_installer;" do_rootfs[vardeps] += "INSTALLER_TARGET_BUILD INSTALLER_TARGET_IMAGE" +# fail to start metacity if default target is graphical.target +SYSTEMD_DEFAULT_TARGET = "multi-user.target" + # Fix system-shutdown hang at ratelimiting -APPEND_append = " printk.devkmsg=on" +APPEND:append = " printk.devkmsg=on" INSTPRODUCT ?= "${@d.getVar('DISTRO_NAME')[:30]}" INSTVER ?= "${DISTRO_VERSION}" @@ -14,14 +17,14 @@ INSTALLER_CONFDIR = "${IMAGE_ROOTFS}/installer-config" KICKSTART_FILE ?= "" WRL_INSTALLER_CONF ?= "" -build_iso_prepend() { +build_iso:prepend() { install -d ${ISODIR} ln -snf /.discinfo ${ISODIR}/.discinfo ln -snf /.buildstamp ${ISODIR}/.buildstamp ln -snf /Packages ${ISODIR}/Packages } -build_iso_append() { +build_iso:append() { implantisomd5 ${IMGDEPLOYDIR}/${IMAGE_NAME}.iso } @@ -59,7 +62,7 @@ wrl_installer_copy_local_repos() { deploy_dir_rpm=$1 if [ -d "$deploy_dir_rpm" ]; then - echo "Copy rpms from target build to installer image." + echo "Copy rpms from target build $deploy_dir_rpm to installer image." mkdir -p ${IMAGE_ROOTFS}/Packages.$prj_name cat > ${IMAGE_ROOTFS}/Packages.$prj_name/.treeinfo <<ENDOF @@ -135,7 +138,7 @@ wrl_installer_copy_pkgs() { | sed -e 's/=/=\"/' -e 's/$/\"/' > ${BB_LOGFILE}.distro_vals" eval "cat $target_build/installersupport_$target_image | \ - grep -e '^WORKDIR=.*' >> ${BB_LOGFILE}.distro_vals" + grep -e '^WORKDIR=.*' -e '^DEPLOY_DIR_RPM=.*' >> ${BB_LOGFILE}.distro_vals" eval `cat ${BB_LOGFILE}.distro_vals` if [ $? -ne 0 ]; then @@ -192,14 +195,30 @@ IMAGE_LINGUAS=${IMAGE_LINGUAS} _EOF fi - if [ -d "$WORKDIR/oe-rootfs-repo/rpm" ]; then - # Copy local repos while the image is not initramfs - bpn=${BPN} - if [ "${bpn##*initramfs}" = "${bpn%%initramfs*}" ]; then - wrl_installer_copy_local_repos $WORKDIR/oe-rootfs-repo/rpm + if [ -f "$installer_conf" ]; then + if [ -z "$DEPLOY_DIR_RPM" ]; then + bbfatal "Can't determine \$DEPLOY_DIR_RPM to construct rpm repo." + fi + + if [ -d "$DEPLOY_DIR_RPM" ]; then + target_repo="$DEPLOY_DIR_RPM" + else + bbfatal "$DEPLOY_DIR_RPM is not a valid rpm repo." fi - echo "$DISTRO::$prj_name::$DISTRO_NAME::$DISTRO_VERSION" >> ${IMAGE_ROOTFS}/.target_build_list + else + if [ -d "$WORKDIR/oe-rootfs-repo/rpm" ]; then + target_repo="$WORKDIR/oe-rootfs-repo/rpm" + else + bbfatal "$WORKDIR/oe-rootfs-repo/rpm is not a valid rpm repo." + fi + fi + + # Copy local repos while the image is not initramfs + bpn=${BPN} + if [ "${bpn##*initramfs}" = "${bpn%%initramfs*}" ]; then + wrl_installer_copy_local_repos $target_repo fi + echo "$DISTRO::$prj_name::$DISTRO_NAME::$DISTRO_VERSION" >> ${IMAGE_ROOTFS}/.target_build_list } wrl_installer_get_count() { @@ -294,14 +313,14 @@ _EOF } python __anonymous() { - if "selinux" in d.getVar("DISTRO_FEATURES", True).split(): + if "selinux" in d.getVar("DISTRO_FEATURES").split(): raise bb.parse.SkipPackage("Unable to build the installer when selinux is enabled.") if bb.data.inherits_class('image', d): - if d.getVar("DISTRO", True) != "anaconda": + if d.getVar("DISTRO") != "anaconda": raise bb.parse.SkipPackage("Set DISTRO = 'anaconda' in local.conf") - target_builds = d.getVar('INSTALLER_TARGET_BUILD', True) + target_builds = d.getVar('INSTALLER_TARGET_BUILD') if not target_builds: errmsg = "No INSTALLER_TARGET_BUILD is found,\n" errmsg += "set INSTALLER_TARGET_BUILD = '<target-build-topdir>' and\n" @@ -313,15 +332,18 @@ python __anonymous() { count = 0 for target_build in target_builds.split(): + target_build = os.path.abspath(target_build) if not os.path.exists(target_build): raise bb.parse.SkipPackage("The %s of INSTALLER_TARGET_BUILD does not exist" % target_build) if os.path.isdir(target_build): count += 1 + else: + d.appendVar('PSEUDO_IGNORE_PATHS', ',' + os.path.abspath(os.path.dirname(target_build))) # While do package management install if count > 0: - target_images = d.getVar('INSTALLER_TARGET_IMAGE', True) + target_images = d.getVar('INSTALLER_TARGET_IMAGE') if not target_images: errmsg = "The INSTALLER_TARGET_BUILD is a dir, but not found INSTALLER_TARGET_IMAGE,\n" errmsg += "set INSTALLER_TARGET_IMAGE = '<target-image-pn>' to do RPMs install" @@ -333,7 +355,7 @@ python __anonymous() { raise bb.parse.SkipPackage(errmsg) # The count of INSTALLER_TARGET_BUILD and WRL_INSTALLER_CONF must match when set. - wrlinstaller_confs = d.getVar('WRL_INSTALLER_CONF', True) + wrlinstaller_confs = d.getVar('WRL_INSTALLER_CONF') if wrlinstaller_confs: if len(wrlinstaller_confs.split()) != len(target_builds.split()): raise bb.parse.SkipPackage("The count of INSTALLER_TARGET_BUILD and WRL_INSTALLER_CONF not match!") @@ -342,7 +364,7 @@ python __anonymous() { raise bb.parse.SkipPackage("The installer conf %s in WRL_INSTALLER_CONF doesn't exist!" % wrlinstaller_conf) # The count of INSTALLER_TARGET_BUILD and KICKSTART_FILE must match when set. - kickstart_files = d.getVar('KICKSTART_FILE', True) + kickstart_files = d.getVar('KICKSTART_FILE') if kickstart_files: if len(kickstart_files.split()) != len(target_builds.split()): raise bb.parse.SkipPackage("The count of INSTALLER_TARGET_BUILD and KICKSTART_FILE not match!") @@ -350,6 +372,9 @@ python __anonymous() { if not os.path.exists(kickstart_file): raise bb.parse.SkipPackage("The kickstart file %s in KICKSTART_FILE doesn't exist!" % kickstart_file) + # enable EFI runtime for -rt kernel + if d.getVar("PREFERRED_PROVIDER_virtual/kernel") == "linux-yocto-rt": + d.appendVar('APPEND', ' efi=runtime') } systemd_preset_all () { diff --git a/classes/anaconda_kernel.bbclass b/classes/anaconda_kernel.bbclass index c4adefc..b5dc983 100644 --- a/classes/anaconda_kernel.bbclass +++ b/classes/anaconda_kernel.bbclass @@ -1,14 +1,13 @@ -FILESEXTRAPATHS_prepend := "${LAYER_PATH_meta-anaconda}/recipes-kernel/linux/files/:" -SRC_URI_append = " \ +FILESEXTRAPATHS:prepend := "${LAYER_PATH_meta-anaconda}/recipes-kernel/linux/files/:" +SRC_URI:append = " \ file://dmthin.scc \ file://crypt.scc \ file://liveinstall.scc \ - file://efivars.scc \ + file://efivarfs.scc \ file://multipath.scc \ - file://ide.scc \ " -KERNEL_FEATURES_append = " \ +KERNEL_FEATURES:append = " \ features/overlayfs/overlayfs.scc \ cfg/systemd.scc \ " diff --git a/classes/anaconda_support_image.bbclass b/classes/anaconda_support_image.bbclass index ce48616..c2560ef 100644 --- a/classes/anaconda_support_image.bbclass +++ b/classes/anaconda_support_image.bbclass @@ -1,13 +1,14 @@ FEATURE_PACKAGES_anaconda-support = "packagegroup-anaconda-support" -IMAGE_FEATURES_append = " anaconda-support package-management" +IMAGE_FEATURES:append = " anaconda-support package-management" # Generate filesystem images for image copy install IMAGE_FSTYPES += "ext4" +IMAGE_FSTYPES:remove = "live" -ROOTFS_POSTPROCESS_COMMAND_append = " copy_grub_lib;" -IMAGE_POSTPROCESS_COMMAND_append = " emit_image_env;" +ROOTFS_POSTPROCESS_COMMAND:append = " copy_grub_lib;" +IMAGE_POSTPROCESS_COMMAND:append = " emit_image_env;" -inherit distro_features_check +inherit features_check REQUIRED_DISTRO_FEATURES = "systemd ldconfig pam" DEPENDS += "grub grub-efi" @@ -35,6 +36,6 @@ python __anonymous () { if not bb.utils.contains("PACKAGE_CLASSES", "package_rpm", True, False, d): raise bb.parse.SkipPackage('Target build requires RPM packages to be the default in PACKAGE_CLASSES.') - if d.getVar("VIRTUAL-RUNTIME_init_manager", True) != "systemd": + if d.getVar("VIRTUAL-RUNTIME_init_manager") != "systemd": raise bb.parse.SkipPackage('Target build requires systemd, set VIRTUAL-RUNTIME_init_manager = "systemd" in local.conf') } diff --git a/classes/anaconda_support_kernel.bbclass b/classes/anaconda_support_kernel.bbclass index ae3f8bb..e987898 100644 --- a/classes/anaconda_support_kernel.bbclass +++ b/classes/anaconda_support_kernel.bbclass @@ -1,8 +1,8 @@ -FILESEXTRAPATHS_prepend := "${LAYER_PATH_meta-anaconda}/recipes-kernel/linux/files/:" -SRC_URI_append = " \ +FILESEXTRAPATHS:prepend := "${LAYER_PATH_meta-anaconda}/recipes-kernel/linux/files/:" +SRC_URI:append = " \ file://dmthin.scc \ file://crypt.scc \ " -KERNEL_FEATURES_append = " cfg/systemd.scc" +KERNEL_FEATURES:append = " cfg/systemd.scc" diff --git a/conf/distro/anaconda.conf b/conf/distro/anaconda.conf index d0954a2..927b1b3 100644 --- a/conf/distro/anaconda.conf +++ b/conf/distro/anaconda.conf @@ -1,10 +1,10 @@ # use systemd as the default init manager # comment the following lines to use 'sysvinit' as the init manager VIRTUAL-RUNTIME_init_manager = "systemd" -DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " sysvinit" -DISTRO_FEATURES_append = " systemd" +DISTRO_FEATURES_BACKFILL_CONSIDERED:append = " sysvinit" +DISTRO_FEATURES:append = " systemd" -DISTRO_FEATURES_append = " \ +DISTRO_FEATURES:append = " \ x11 \ opengl \ pam \ @@ -12,13 +12,13 @@ DISTRO_FEATURES_append = " \ VIRTUAL-RUNTIME_base-utils = "busybox" -KERNEL_CLASSES_append = " anaconda_kernel" +KERNEL_CLASSES:append = " anaconda_kernel" -IMAGE_FEATURES_append = " package-management" +IMAGE_FEATURES:append = " package-management" # Want ldconfig in the output package # The python module require it -DISTRO_FEATURES_append = " ldconfig" +DISTRO_FEATURES:append = " ldconfig" # It works for both of syslinux and grub-efi LABELS_LIVE = "boot" @@ -26,10 +26,16 @@ LABELS_LIVE = "boot" # Have graphics and serial in the boot menu when use grub-efi in iso GRUB_GFXSERIAL = "1" -QB_MEM_qemux86-64 = "-m 2048" +QB_MEM:qemux86-64 = "-m 2048" -HOSTTOOLS_append = " tac" +HOSTTOOLS:append = " tac" -MACHINE_FEATURES_append = " efi pcbios" +MACHINE_FEATURES:append = " efi pcbios" UVESA_MODE = "1024x768-32" + +# The unit is block and size of one block is always 1024 bytes for mkdosfs +# Overwrite default value '512' to make UEFI eltorito boot image work +BOOTIMG_EXTRA_SPACE = "8192" + +PREFERRED_VERSION_python3-blivet = "3.8.2" diff --git a/conf/layer.conf b/conf/layer.conf index 49d233f..47ff6c9 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -11,7 +11,7 @@ BBFILE_PRIORITY_meta-anaconda = "10" LAYERVERSION_meta-anaconda = "2" -LAYERSERIES_COMPAT_meta-anaconda = "thud warrior" +LAYERSERIES_COMPAT_meta-anaconda = "scarthgap" LAYERDEPENDS_meta-anaconda = " \ core \ @@ -25,6 +25,13 @@ LAYERDEPENDS_meta-anaconda = " \ LAYER_PATH_meta-anaconda = "${LAYERDIR}" -KERNEL_CLASSES_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'anaconda-support', 'anaconda_support_kernel', '', d)}" -IMAGE_CLASSES_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'anaconda-support', 'anaconda_support_image', '', d)}" +DISTROOVERRIDES:append = "${@bb.utils.contains('DISTRO_FEATURES', 'anaconda-support', ':anaconda-support', '', d)}" +KERNEL_CLASSES:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'anaconda-support', 'anaconda_support_kernel', '', d)}" +IMAGE_CLASSES:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'anaconda-support', 'anaconda_support_image', '', d)}" + +PACKAGE_CLASSES:anaconda = "package_rpm" +PACKAGE_CLASSES:anaconda-support = "package_rpm" + +INIT_MANAGER:anaconda = "systemd" +INIT_MANAGER:anaconda-support = "systemd" diff --git a/lib/oeqa/selftest/cases/anaconda_oe.py b/lib/oeqa/selftest/cases/anaconda_oe.py index e568709..20b8d5b 100644 --- a/lib/oeqa/selftest/cases/anaconda_oe.py +++ b/lib/oeqa/selftest/cases/anaconda_oe.py @@ -17,10 +17,10 @@ class TestAnacondaOE(OESelftestTestCase): features = 'MACHINE = "%s"\n' % self.machine features += 'PACKAGE_CLASSES = "package_rpm"\n' features += 'VIRTUAL-RUNTIME_init_manager = "systemd"\n' - features += 'DISTRO_FEATURES_append = " systemd"\n' - features += 'DISTRO_FEATURES_append = " pam"\n' - features += 'DISTRO_FEATURES_append = " ldconfig"\n' - features += 'DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " sysvinit"\n' + features += 'DISTRO_FEATURES:append = " systemd"\n' + features += 'DISTRO_FEATURES:append = " pam"\n' + features += 'DISTRO_FEATURES:append = " ldconfig"\n' + features += 'DISTRO_FEATURES_BACKFILL_CONSIDERED:append = " sysvinit"\n' self.write_config(features) self.logger.info('local.conf:\n%s' % features) @@ -94,7 +94,7 @@ class TestAnacondaOE(OESelftestTestCase): @OETestDepends(['anaconda_oe.TestAnacondaOE.test_testanaconda_create_target_disk']) def test_testanaconda_build_target_image(self): - features = 'DISTRO_FEATURES_append = " anaconda-support"\n' + features = 'DISTRO_FEATURES:append = " anaconda-support"\n' self.logger.info('extra local.conf:\n%s' % features) self.append_config(features) @@ -146,10 +146,10 @@ class TestAnacondaOE(OESelftestTestCase): ks_file = os.path.join(self.layer_path, 'example/ks-imagecopy.cfg') features = 'TMPDIR .= "_host"\n' features += 'DISTRO = "%s"\n' % self.anaconda_distro - features += 'INSTALLER_TARGET_BUILD = "%s/%s-%s.ext4"\n' % (self.target_deploy_dir_image, self.target_recipe, self.machine) + features += 'INSTALLER_TARGET_BUILD = "%s/%s-%s.rootfs.ext4"\n' % (self.target_deploy_dir_image, self.target_recipe, self.machine) features += 'KICKSTART_FILE = "%s"\n' % ks_file features += 'SYSLINUX_TIMEOUT = "10"\n' - features += 'APPEND_append = " textinst"\n' + features += 'APPEND:append = " textinst"\n' features += 'INSTALLER_SERIAL = ""\n' self.logger.info('extra local.conf:\n%s' % features) self.append_config(features) @@ -164,7 +164,7 @@ class TestAnacondaOE(OESelftestTestCase): def test_testanaconda_imagecopy_install(self): features = 'TMPDIR .= "_host"\n' features += 'DISTRO = "%s"\n' % self.anaconda_distro - features += 'INSTALLER_TARGET_BUILD = "%s/%s-%s.ext4"\n' % (self.target_deploy_dir_image, self.target_recipe, self.machine) + features += 'INSTALLER_TARGET_BUILD = "%s/%s-%s.rootfs.ext4"\n' % (self.target_deploy_dir_image, self.target_recipe, self.machine) self.logger.info('extra local.conf:\n%s' % features) self.append_config(features) diff --git a/recipes-core/systemd/files/0001-set-tty2-as-default-instance.patch b/recipes-core/systemd/files/0001-set-tty2-as-default-instance.patch index 5a2e02a..936f95e 100644 --- a/recipes-core/systemd/files/0001-set-tty2-as-default-instance.patch +++ b/recipes-core/systemd/files/0001-set-tty2-as-default-instance.patch @@ -8,15 +8,19 @@ TTY1 is reserved for anaconda Upstream-Status: Inappropriate [meta-anaconda specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for systemd 249.1. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - units/getty@.service.m4 | 2 +- + units/getty@.service.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/units/getty@.service.m4 b/units/getty@.service.m4 -index 80e793b..9707a20 100644 ---- a/units/getty@.service.m4 -+++ b/units/getty@.service.m4 -@@ -57,4 +57,4 @@ UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETAR +diff --git a/units/getty@.service.in b/units/getty@.service.in +index 78deb7cffe..de1f4f52c6 100644 +--- a/units/getty@.service.in ++++ b/units/getty@.service.in +@@ -59,4 +59,4 @@ UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETAR [Install] WantedBy=getty.target diff --git a/recipes-core/systemd/systemd-serialgetty.bbappend b/recipes-core/systemd/systemd-serialgetty.bbappend index 24ce19a..0325192 100644 --- a/recipes-core/systemd/systemd-serialgetty.bbappend +++ b/recipes-core/systemd/systemd-serialgetty.bbappend @@ -1,10 +1,10 @@ INSTALLER_SERIAL ??= "1" -FILESEXTRAPATHS_prepend_anaconda := "${@bb.utils.contains('INSTALLER_SERIAL', '1', '${THISDIR}/files:', '', d)}" -SRC_URI_append_anaconda = " \ +FILESEXTRAPATHS:prepend:anaconda := "${@bb.utils.contains('INSTALLER_SERIAL', '1', '${THISDIR}/files:', '', d)}" +SRC_URI:append:anaconda = " \ ${@bb.utils.contains('INSTALLER_SERIAL', '1', 'file://serial-screen-anaconda.sh', '', d)} \ " -do_install_append_anaconda() { +do_install:append:anaconda() { if [ "${INSTALLER_SERIAL}" = "1" ]; then install -d ${D}${sysconfdir}/profile.d install -m 644 ${WORKDIR}/serial-screen-anaconda.sh ${D}${sysconfdir}/profile.d/ diff --git a/recipes-core/systemd/systemd_%.bbappend b/recipes-core/systemd/systemd_%.bbappend index 56e2937..d8bad53 100644 --- a/recipes-core/systemd/systemd_%.bbappend +++ b/recipes-core/systemd/systemd_%.bbappend @@ -1,10 +1,13 @@ -FILESEXTRAPATHS_prepend_anaconda := "${THISDIR}/files:" -SRC_URI_append_anaconda = " \ +FILESEXTRAPATHS:prepend:anaconda := "${THISDIR}/files:" +SRC_URI:append:anaconda = " \ file://0001-set-tty2-as-default-instance.patch \ " -do_install_append_anaconda() { +PACKAGECONFIG:remove:anaconda = "timesyncd" + +do_install:append:anaconda() { # Explicitly enable tty2 + mkdir -p ${D}${sysconfdir}/systemd/system/getty.target.wants ln -nsf ${systemd_unitdir}/system/getty@.service \ ${D}${sysconfdir}/systemd/system/getty.target.wants/getty@tty2.service diff --git a/recipes-devtools/dnf/dnf/0001-Revert-Does-not-print-Verify-package-RhBug-1908253.patch b/recipes-devtools/dnf/dnf/0001-Revert-Does-not-print-Verify-package-RhBug-1908253.patch new file mode 100644 index 0000000..7e6093c --- /dev/null +++ b/recipes-devtools/dnf/dnf/0001-Revert-Does-not-print-Verify-package-RhBug-1908253.patch @@ -0,0 +1,29 @@ +Revert "Does not print Verify: package (RhBug:1908253)" + +This reverts commit b2acddd4f6fda369a7f2f1656a7cd646c3423f60. + +Invoke verify function is still required by anaconda, so add it back. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- + dnf/base.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dnf/base.py b/dnf/base.py +index a6b35746..7ab81240 100644 +--- a/dnf/base.py ++++ b/dnf/base.py +@@ -1179,7 +1179,7 @@ class Base(object): + + # sync up what just happened versus what is in the rpmdb + if not self._ts.isTsFlagSet(rpm.RPMTRANS_FLAG_TEST): +- self._verify_transaction() ++ self._verify_transaction(cb.verify_tsi_package) + + return tid + +-- +2.34.1 + diff --git a/recipes-devtools/dnf/dnf_%.bbappend b/recipes-devtools/dnf/dnf_%.bbappend new file mode 100644 index 0000000..42e817d --- /dev/null +++ b/recipes-devtools/dnf/dnf_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI:append:anaconda = " file://0001-Revert-Does-not-print-Verify-package-RhBug-1908253.patch" diff --git a/recipes-extended/python-blivet/python3-blivet/0002-run_program-support-timeout.patch b/recipes-extended/python-blivet/python3-blivet/0002-run_program-support-timeout.patch new file mode 100644 index 0000000..5b38859 --- /dev/null +++ b/recipes-extended/python-blivet/python3-blivet/0002-run_program-support-timeout.patch @@ -0,0 +1,103 @@ +From 713cf821ebe17f9e1771502a85e0905ea04dafae Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Fri, 23 Nov 2018 17:03:58 +0800 +Subject: [PATCH 02/11] run_program support timeout + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + blivet/util.py | 70 ++++++++++++++++++++++++++++++++++------------------------ + 1 file changed, 41 insertions(+), 29 deletions(-) + +diff --git a/blivet/util.py b/blivet/util.py +index 4eac8b9..4f05076 100644 +--- a/blivet/util.py ++++ b/blivet/util.py +@@ -158,6 +158,30 @@ class Path(str): + def __hash__(self): + return self._path.__hash__() + ++def timeout_command(argv, timeout, *args, **kwargs): ++ """call shell-command and either return its output or kill it ++ if it doesn't normally exit within timeout seconds and return None""" ++ import subprocess, datetime, os, time, signal ++ start = datetime.datetime.now() ++ ++ try: ++ proc = subprocess.Popen(argv, *args, **kwargs) ++ while proc.poll() is None: ++ time.sleep(0.1) ++ now = datetime.datetime.now() ++ if (now - start).seconds> timeout: ++ os.kill(proc.pid, signal.SIGKILL) ++ os.waitpid(-1, os.WNOHANG) ++ program_log.debug("%d seconds timeout" % timeout) ++ return (-1, None) ++ ++ ++ except OSError as e: ++ program_log.error("Error running %s: %s", argv[0], e.strerror) ++ raise ++ ++ program_log.debug("Return code: %d", proc.returncode) ++ return (proc.returncode, proc.stdout.read()) + + def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=False, binary_output=False): + if env_prune is None: +@@ -180,35 +204,23 @@ def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=Fa + stderr_dir = subprocess.STDOUT + else: + stderr_dir = subprocess.PIPE +- try: +- proc = subprocess.Popen(argv, # pylint: disable=subprocess-popen-preexec-fn +- stdin=stdin, +- stdout=subprocess.PIPE, +- stderr=stderr_dir, +- close_fds=True, +- preexec_fn=chroot, cwd=root, env=env) +- +- out, err = proc.communicate() +- if not binary_output and six.PY3: +- out = out.decode("utf-8") +- if out: +- if not stderr_to_stdout: +- program_log.info("stdout:") +- for line in out.splitlines(): +- program_log.info("%s", line) +- +- if not stderr_to_stdout and err: +- program_log.info("stderr:") +- for line in err.splitlines(): +- program_log.info("%s", line) +- +- except OSError as e: +- program_log.error("Error running %s: %s", argv[0], e.strerror) +- raise +- +- program_log.debug("Return code: %d", proc.returncode) +- +- return (proc.returncode, out) ++ ++ res, out = timeout_command(argv, 10, ++ stdin=stdin, ++ stdout=subprocess.PIPE, ++ stderr=stderr_dir, ++ close_fds=True, ++ preexec_fn=chroot, cwd=root, env=env) ++ if not binary_output and six.PY3: ++ out = out.decode("utf-8") ++ if out: ++ if not stderr_to_stdout: ++ program_log.info("stdout:") ++ for line in out.splitlines(): ++ program_log.info("%s", line) ++ ++ return (res, out) ++ + + + def run_program(*args, **kwargs): +-- +2.7.4 + diff --git a/recipes-extended/python-blivet/python3-blivet/0003-support-infinit-timeout.patch b/recipes-extended/python-blivet/python3-blivet/0003-support-infinit-timeout.patch new file mode 100644 index 0000000..861b2cd --- /dev/null +++ b/recipes-extended/python-blivet/python3-blivet/0003-support-infinit-timeout.patch @@ -0,0 +1,66 @@ +From 5d5436dfa3bdde7b4e87ce5a40cbc724199847d6 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Mon, 8 May 2017 16:18:02 +0800 +Subject: [PATCH 03/11] support infinit timeout + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + blivet/util.py | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/blivet/util.py b/blivet/util.py +index 4f05076..7e89949 100644 +--- a/blivet/util.py ++++ b/blivet/util.py +@@ -158,6 +158,7 @@ class Path(str): + def __hash__(self): + return self._path.__hash__() + ++# timeout = -1 means infinite timeout, always wait. + def timeout_command(argv, timeout, *args, **kwargs): + """call shell-command and either return its output or kill it + if it doesn't normally exit within timeout seconds and return None""" +@@ -169,7 +170,7 @@ def timeout_command(argv, timeout, *args, **kwargs): + while proc.poll() is None: + time.sleep(0.1) + now = datetime.datetime.now() +- if (now - start).seconds> timeout: ++ if timeout != -1 and (now - start).seconds> timeout: + os.kill(proc.pid, signal.SIGKILL) + os.waitpid(-1, os.WNOHANG) + program_log.debug("%d seconds timeout" % timeout) +@@ -183,7 +184,7 @@ def timeout_command(argv, timeout, *args, **kwargs): + program_log.debug("Return code: %d", proc.returncode) + return (proc.returncode, proc.stdout.read()) + +-def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=False, binary_output=False): ++def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=False, binary_output=False, timeout=10): + if env_prune is None: + env_prune = [] + +@@ -192,7 +193,10 @@ def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=Fa + os.chroot(root) + + with program_log_lock: # pylint: disable=not-context-manager +- program_log.info("Running... %s", " ".join(argv)) ++ if timeout != -1: ++ program_log.info("Running... %s", " ".join(argv)) ++ else: ++ program_log.info("Running... %s ...infinite timeout", " ".join(argv)) + + env = os.environ.copy() + env.update({"LC_ALL": "C", +@@ -205,7 +209,7 @@ def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=Fa + else: + stderr_dir = subprocess.PIPE + +- res, out = timeout_command(argv, 10, ++ res, out = timeout_command(argv, timeout, + stdin=stdin, + stdout=subprocess.PIPE, + stderr=stderr_dir, +-- +2.7.4 + diff --git a/recipes-extended/python-blivet/python3-blivet/0005-fix-incorrect-timeout-while-system-time-changed.patch b/recipes-extended/python-blivet/python3-blivet/0005-fix-incorrect-timeout-while-system-time-changed.patch new file mode 100644 index 0000000..9c5d53b --- /dev/null +++ b/recipes-extended/python-blivet/python3-blivet/0005-fix-incorrect-timeout-while-system-time-changed.patch @@ -0,0 +1,48 @@ +From f783b9b00da5df176fcd7927b752f574ca6db319 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Fri, 26 Aug 2016 02:02:49 -0400 +Subject: [PATCH 05/11] fix incorrect timeout while system time changed + +While system time changed by NTP, invoking timeout_command +breaks with incorrect timeout. +-------- +|05:40:55,872 INFO program: Running... mount -t ext2 -o + defaults,ro /dev/sda2 /mnt/sysimage +|01:40:55,086 DEBUG program: 10 seconds timeout +-------- + +Use numbert count to replace current time count could workaround +the issue. + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + blivet/util.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/blivet/util.py b/blivet/util.py +index 7e89949..5571e73 100644 +--- a/blivet/util.py ++++ b/blivet/util.py +@@ -163,14 +163,14 @@ def timeout_command(argv, timeout, *args, **kwargs): + """call shell-command and either return its output or kill it + if it doesn't normally exit within timeout seconds and return None""" + import subprocess, datetime, os, time, signal +- start = datetime.datetime.now() ++ count = 0 + + try: + proc = subprocess.Popen(argv, *args, **kwargs) + while proc.poll() is None: + time.sleep(0.1) +- now = datetime.datetime.now() +- if timeout != -1 and (now - start).seconds> timeout: ++ count += 1 ++ if timeout != -1 and count > timeout*10: + os.kill(proc.pid, signal.SIGKILL) + os.waitpid(-1, os.WNOHANG) + program_log.debug("%d seconds timeout" % timeout) +-- +2.7.4 + diff --git a/recipes-extended/python-blivet/python3-blivet/0006-tweak-btrfs-packages.patch b/recipes-extended/python-blivet/python3-blivet/0006-tweak-btrfs-packages.patch new file mode 100644 index 0000000..2e53a64 --- /dev/null +++ b/recipes-extended/python-blivet/python3-blivet/0006-tweak-btrfs-packages.patch @@ -0,0 +1,45 @@ +From 8932ae933f2b6acf5e98c9956beff69ae430eed2 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Mon, 8 May 2017 16:33:15 +0800 +Subject: [PATCH 06/11] tweak btrfs packages + +In oe-cre/yocto, we name btrfs package with btrfs-tools, +rather than btrfs-progs. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + blivet/devices/btrfs.py | 2 +- + blivet/formats/fs.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/blivet/devices/btrfs.py b/blivet/devices/btrfs.py +index cada940..7e4d4b8 100644 +--- a/blivet/devices/btrfs.py ++++ b/blivet/devices/btrfs.py +@@ -55,7 +55,7 @@ class BTRFSDevice(StorageDevice): + + """ Base class for BTRFS volume and sub-volume devices. """ + _type = "btrfs" +- _packages = ["btrfs-progs"] ++ _packages = ["btrfs-tools"] + _external_dependencies = [availability.BLOCKDEV_BTRFS_PLUGIN] + + def __init__(self, *args, **kwargs): +diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py +index 81e367f..55e5d57 100644 +--- a/blivet/formats/fs.py ++++ b/blivet/formats/fs.py +@@ -926,7 +926,7 @@ class BTRFS(FS): + _formattable = True + _linux_native = True + _supported = True +- _packages = ["btrfs-progs"] ++ _packages = ["btrfs-tools"] + _min_size = Size("256 MiB") + _max_size = Size("16 EiB") + _mkfs_class = fsmkfs.BTRFSMkfs +-- +2.7.4 + diff --git a/recipes-extended/python-blivet/python3-blivet/0007-invoking-mount-with-infinite-timeout.patch b/recipes-extended/python-blivet/python3-blivet/0007-invoking-mount-with-infinite-timeout.patch new file mode 100644 index 0000000..b2606d7 --- /dev/null +++ b/recipes-extended/python-blivet/python3-blivet/0007-invoking-mount-with-infinite-timeout.patch @@ -0,0 +1,31 @@ +From f53481dc4a56b8a996628733553e080bb0aafdd7 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Fri, 23 Nov 2018 17:07:22 +0800 +Subject: [PATCH 07/11] invoking mount with infinite timeout + +This large timeout is needed when running on machines with +lots of disks, or with slow disks. + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + blivet/util.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/blivet/util.py b/blivet/util.py +index 5571e73..02c8033 100644 +--- a/blivet/util.py ++++ b/blivet/util.py +@@ -258,7 +258,7 @@ def mount(device, mountpoint, fstype, options=None): + makedirs(mountpoint) + + argv = ["mount", "-t", fstype, "-o", options, device, mountpoint] +- return run_program(argv) ++ return run_program(argv, timeout=-1) + + + def umount(mountpoint): +-- +2.7.4 + diff --git a/recipes-extended/python-blivet/python3-blivet/0008-use-oe-variable-to-replace-hardcoded-dir.patch b/recipes-extended/python-blivet/python3-blivet/0008-use-oe-variable-to-replace-hardcoded-dir.patch new file mode 100644 index 0000000..1e8bcac --- /dev/null +++ b/recipes-extended/python-blivet/python3-blivet/0008-use-oe-variable-to-replace-hardcoded-dir.patch @@ -0,0 +1,38 @@ +From 12e2579333258d1a690f8718e91b0f217078e886 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Mon, 8 May 2017 03:54:12 -0400 +Subject: [PATCH 08/11] use oe variable to replace hardcoded dir + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for python3-blivet 3.4.0. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- + setup.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/setup.py b/setup.py +index b745a79..b5b4258 100644 +--- a/setup.py ++++ b/setup.py +@@ -61,10 +61,10 @@ class blivet_sdist(sdist): + + + data_files = [ +- ('/etc/dbus-1/system.d', ['dbus/blivet.conf']), +- ('/usr/share/dbus-1/system-services', ['dbus/com.redhat.Blivet0.service']), +- ('/usr/libexec', ['dbus/blivetd']), +- ('/usr/lib/systemd/system', ['dbus/blivet.service']) ++ (os.environ.get('sysconfdir')+'/dbus-1/system.d', ['dbus/blivet.conf']), ++ (os.environ.get('datadir')+'/dbus-1/system-services', ['dbus/com.redhat.Blivet0.service']), ++ (os.environ.get('libexecdir'), ['dbus/blivetd']), ++ (os.environ.get('systemd_system_unitdir'), ['dbus/blivet.service']) + ] + + +-- +2.7.4 + diff --git a/recipes-extended/python-blivet/python3-blivet/0009-invoking-fsck-with-infinite-timeout.patch b/recipes-extended/python-blivet/python3-blivet/0009-invoking-fsck-with-infinite-timeout.patch new file mode 100644 index 0000000..f477877 --- /dev/null +++ b/recipes-extended/python-blivet/python3-blivet/0009-invoking-fsck-with-infinite-timeout.patch @@ -0,0 +1,31 @@ +From 9624b6d0dda40aaecbaf9530be819943575a2ec6 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Thu, 1 Jun 2017 16:05:27 +0800 +Subject: [PATCH 09/11] invoking fsck with infinite timeout + +This large timeout is needed when running on machines with +lots of disks, or with slow disks. + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + blivet/tasks/fsck.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/blivet/tasks/fsck.py b/blivet/tasks/fsck.py +index 5274f13..6e074c4 100644 +--- a/blivet/tasks/fsck.py ++++ b/blivet/tasks/fsck.py +@@ -77,7 +77,7 @@ class FSCK(task.BasicApplication, fstask.FSTask): + raise FSError("\n".join(error_msgs)) + + try: +- rc = util.run_program(self._fsck_command) ++ rc = util.run_program(self._fsck_command, timeout=-1) + except OSError as e: + raise FSError("filesystem check failed: %s" % e) + +-- +2.7.4 + diff --git a/recipes-extended/python-blivet/python3-blivet/0010-invoking-mkfs-with-infinite-timeout.patch b/recipes-extended/python-blivet/python3-blivet/0010-invoking-mkfs-with-infinite-timeout.patch new file mode 100644 index 0000000..c441acd --- /dev/null +++ b/recipes-extended/python-blivet/python3-blivet/0010-invoking-mkfs-with-infinite-timeout.patch @@ -0,0 +1,35 @@ +From 33844f6773a676bd57240954e402ae9a843663a4 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Fri, 16 Jun 2017 15:43:00 +0800 +Subject: [PATCH 10/11] invoking mkfs with infinite timeout + +This large timeout is needed when running on machines with +lots of disks, or with slow disks. + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for python3-blivet 3.4.0. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- + blivet/tasks/fsmkfs.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/blivet/tasks/fsmkfs.py b/blivet/tasks/fsmkfs.py +index e4a6aaa8..9730f7e5 100644 +--- a/blivet/tasks/fsmkfs.py ++++ b/blivet/tasks/fsmkfs.py +@@ -203,7 +203,7 @@ class FSMkfs(task.BasicApplication, FSMkfsTask): + options = options or [] + cmd = self._mkfs_command(options, label, set_uuid, nodiscard) + try: +- ret = util.run_program(cmd) ++ ret = util.run_program(cmd, timeout=-1) + except OSError as e: + raise FSError(e) + +-- +2.7.4 + diff --git a/recipes-extended/python-blivet/python3-blivet/0011-invoking-dd-with-infinite-timeout.patch b/recipes-extended/python-blivet/python3-blivet/0011-invoking-dd-with-infinite-timeout.patch new file mode 100644 index 0000000..13c2933 --- /dev/null +++ b/recipes-extended/python-blivet/python3-blivet/0011-invoking-dd-with-infinite-timeout.patch @@ -0,0 +1,31 @@ +From 21ca2b859a49e96a230d55a7866dfc7ed5d1366c Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Tue, 6 Mar 2018 17:28:56 +0800 +Subject: [PATCH 11/11] invoking dd with infinite timeout + +This large timeout is needed when running on machines with +lots of disks, or with slow disks. + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + blivet/devices/partition.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py +index 623e1c9..141d8ad 100644 +--- a/blivet/devices/partition.py ++++ b/blivet/devices/partition.py +@@ -618,7 +618,7 @@ class PartitionDevice(StorageDevice): + cmd = ["dd", "if=/dev/zero", "of=%s" % device, "bs=%d" % bs, + "seek=%d" % start, "count=%d" % count] + try: +- util.run_program(cmd) ++ util.run_program(cmd, timeout=-1) + except OSError as e: + log.error(str(e)) + finally: +-- +2.7.4 + diff --git a/recipes-extended/python-blivet/python3-blivet_3.8.2.bb b/recipes-extended/python-blivet/python3-blivet_3.8.2.bb new file mode 100644 index 0000000..52b3aa7 --- /dev/null +++ b/recipes-extended/python-blivet/python3-blivet_3.8.2.bb @@ -0,0 +1,36 @@ +DESCRIPTION = "A python module for system storage configuration" +HOMEPAGE = "http://fedoraproject.org/wiki/blivet" +LICENSE = "LGPL-2.0-or-later" +SECTION = "devel/python" + +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +SRC_URI += "\ + file://0002-run_program-support-timeout.patch \ + file://0003-support-infinit-timeout.patch \ + file://0005-fix-incorrect-timeout-while-system-time-changed.patch \ + file://0006-tweak-btrfs-packages.patch \ + file://0007-invoking-mount-with-infinite-timeout.patch \ + file://0008-use-oe-variable-to-replace-hardcoded-dir.patch \ + file://0009-invoking-fsck-with-infinite-timeout.patch \ + file://0010-invoking-mkfs-with-infinite-timeout.patch \ + file://0011-invoking-dd-with-infinite-timeout.patch \ +" +SRC_URI[sha256sum] = "88d1500c76c4660aec7da9e9aa54f7f574546571b52c07a67e1417883c2cb25b" + +inherit pypi features_check systemd setuptools3_legacy + +REQUIRED_DISTRO_FEATURES = "systemd" + +RDEPENDS:${PN} += "python3-pykickstart python3-pyudev \ + parted python3-pyparted multipath-tools \ + lsof cryptsetup libblockdev \ + libbytesize \ +" + +FILES:${PN} += " \ + ${datadir}/dbus-1/system-services \ +" + +SYSTEMD_AUTO_ENABLE = "disable" +SYSTEMD_SERVICE:${PN} = "blivet.service" diff --git a/recipes-gnome/gtk+/files/workaround-for-anaconda-installer-while-loading-libA.patch b/recipes-gnome/gtk+/files/workaround-for-anaconda-installer-while-loading-libA.patch index 17f4197..d19296a 100644 --- a/recipes-gnome/gtk+/files/workaround-for-anaconda-installer-while-loading-libA.patch +++ b/recipes-gnome/gtk+/files/workaround-for-anaconda-installer-while-loading-libA.patch @@ -29,7 +29,7 @@ find its symbol by invoking g_module_symbol. So we hardcode to load the anaconda module explicitly. -Upstream-Status: inappropriate [oe specific] +Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> --- diff --git a/recipes-gnome/gtk+/gtk+3_%.%.%.bbappend b/recipes-gnome/gtk+/gtk+3_%.%.%.bbappend index 752b2f1..cdbb70a 100644 --- a/recipes-gnome/gtk+/gtk+3_%.%.%.bbappend +++ b/recipes-gnome/gtk+/gtk+3_%.%.%.bbappend @@ -1,3 +1,3 @@ -FILESEXTRAPATHS_prepend_anaconda := "${THISDIR}/files:" -SRC_URI_append_anaconda = " file://workaround-for-anaconda-installer-while-loading-libA.patch \ +FILESEXTRAPATHS:prepend:anaconda := "${THISDIR}/files:" +SRC_URI:append:anaconda = " file://workaround-for-anaconda-installer-while-loading-libA.patch \ " diff --git a/recipes-gnome/libgnome/libgnomekbd_3.28.1.bb b/recipes-gnome/libgnome/libgnomekbd_3.28.1.bb new file mode 100644 index 0000000..b0e4590 --- /dev/null +++ b/recipes-gnome/libgnome/libgnomekbd_3.28.1.bb @@ -0,0 +1,13 @@ +SUMMARY = "GNOME keyboard library" +LICENSE = "LGPL-2.0-only" +LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=6e29c688d912da12b66b73e32b03d812" + +SECTION = "x11/gnome/libs" + +DEPENDS = "glib-2.0 gtk+3 libxklavier" + +inherit features_check gnomebase gobject-introspection gsettings gettext + +REQUIRED_DISTRO_FEATURES = "x11" + +SRC_URI[archive.sha256sum] = "22dc59566d73c0065350f5a97340e62ecc7b08c4df19183804bb8be24c8fe870" diff --git a/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend index 5447273..d62f8cc 100644 --- a/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend +++ b/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend @@ -1,10 +1,10 @@ -do_install_prepend_qemux86-64_anaconda () { +do_install:prepend:qemux86-64:anaconda () { if test -s ${WORKDIR}/xorg.conf; then sed -i 's/Modes *"640x480"/Modes "1024x768"/g' ${WORKDIR}/xorg.conf fi } -do_install_prepend_qemux86_anaconda () { +do_install:prepend:qemux86:anaconda () { if test -s ${WORKDIR}/xorg.conf; then sed -i 's/Modes *"640x480"/Modes "1024x768"/g' ${WORKDIR}/xorg.conf fi diff --git a/recipes-installer/anaconda-init/anaconda-init.bb b/recipes-installer/anaconda-init/anaconda-init.bb index a7da0c5..61e3190 100644 --- a/recipes-installer/anaconda-init/anaconda-init.bb +++ b/recipes-installer/anaconda-init/anaconda-init.bb @@ -1,5 +1,5 @@ DESCRIPTION = "Simple Init Script for Anaconda" -LICENSE = "GPLv2" +LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" SRC_URI = "file://anaconda-init \ @@ -17,16 +17,16 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" #RDEPENDS_${PN} = "networkmanager-tests" # For mount -oloop=/dev/loopX, busybox's mount doesn't support this. -RDEPENDS_${PN} = "util-linux" +RDEPENDS:${PN} = "util-linux" # While systemd, we need screen to control anaconda-init first boot -RDEPENDS_${PN} += " \ +RDEPENDS:${PN} += " \ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'screen', '', d)} \ " inherit systemd -SYSTEMD_SERVICE_${PN} = "anaconda-init.service \ +SYSTEMD_SERVICE:${PN} = "anaconda-init.service \ anaconda-init-screen@.service \ anaconda-init.target \ " @@ -69,7 +69,7 @@ INITSCRIPT_PARAMS = "start 30 2 3 4 5 . stop 20 0 1 6 ." # Use fixed Xusername of xuser for now, this will need to be # fixed if the Xusername changes from xuser USERADD_PACKAGES = "${PN}" -USERADD_PARAM_${PN} = "--create-home \ +USERADD_PARAM:${PN} = "--create-home \ --groups video,tty,audio \ --user-group xuser" diff --git a/recipes-installer/anaconda-init/anaconda-init/anaconda-init b/recipes-installer/anaconda-init/anaconda-init/anaconda-init index f9afc44..29e8820 100644 --- a/recipes-installer/anaconda-init/anaconda-init/anaconda-init +++ b/recipes-installer/anaconda-init/anaconda-init/anaconda-init @@ -18,37 +18,28 @@ export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin [ -z "$CMDLINE" ] && read CMDLINE < /proc/cmdline for x in $CMDLINE; do - case $x in + case ${x#inst.} in cmdline) cmdline=1 ;; - headless) - headless=1 - ;; - kbdtype=*) - kbdtype="${x#kbdtype=}" - ;; keymap=*) - keymap="${x#keymap=}" + keymap="${x#*=}" ;; ks=*) - ks="${x#ks=}" + ks="${x#*=}" ;; lang=*) - lang="${x#lang=}" + lang="${x#*=}" ;; bootifonly=*) - bootifonly="${x#bootifonly=}" + bootifonly="${x#*=}" ;; stoponfail=*) - stoponfail="${x#stoponfail=}" + stoponfail="${x#*=}" ;; liveinst) liveinst=1 ;; - loglevel=*) - loglevel="${x#loglevel=}" - ;; mpath) mpath=1 ;; @@ -59,25 +50,25 @@ for x in $CMDLINE; do nompath=1 ;; repo=*) - repo="${x#repo=}" + repo="${x#*=}" ;; rescue) rescue=1 ;; resolution=*) - resolution="${x#resolution=}" + resolution="${x#*=}" ;; serial|console=*) textinst=1 ;; syslog=*) - syslog="${x#syslog=}" + syslog="${x#*=}" ;; textinst) textinst=1 ;; updates=*) - updates="${x#updates=}" + updates="${x#*=}" ;; usefbx) usefbx=1 @@ -86,13 +77,13 @@ for x in $CMDLINE; do vnc=1 ;; vncconnect=*) - vncconnect="${x#vncconnect=}" + vncconnect="${x#*=}" ;; vncpassword=*) - vncpassword="${x#vncpassword=}" + vncpassword="${x#*=}" ;; xdriver=*) - xdriver="${x#xdriver=}" + xdriver="${x#*=}" ;; esac done @@ -175,13 +166,13 @@ FOE echo "$vncpassword" > /tmp/vncpassword.dat fi - for OPTIONS in vnc headless usefbx mpath nompath rescue cmdline; do + for OPTIONS in vnc usefbx mpath nompath rescue cmdline; do if [ -n "${!OPTIONS}" ]; then anaconda_opts="$anaconda_opts --$OPTIONS" fi done - for OPTIONS in resolution vncconnect xdriver syslog loglevel lang kbdtype keymap repo; do + for OPTIONS in resolution vncconnect xdriver syslog lang keymap repo; do if [ -n "${!OPTIONS}" ]; then anaconda_opts="$anaconda_opts --$OPTIONS=${!OPTIONS}" fi diff --git a/recipes-installer/anaconda/files/0001-do-not-build-po-and-doc.patch b/recipes-installer/anaconda/files/0001-do-not-build-po-and-doc.patch index 6406beb..895a5a1 100644 --- a/recipes-installer/anaconda/files/0001-do-not-build-po-and-doc.patch +++ b/recipes-installer/anaconda/files/0001-do-not-build-po-and-doc.patch @@ -6,6 +6,10 @@ Subject: [PATCH] do not build po and doc Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebased for Fedora 37. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- Makefile.am | 2 +- configure.ac | 2 -- @@ -13,31 +17,31 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am -index 6f580f4..5c505b4 100644 +index c1ed03c03d..609552febd 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -17,7 +17,7 @@ +@@ -19,7 +19,7 @@ include ./branch-config.mk ACLOCAL_AMFLAGS = -I m4 --SUBDIRS = data docs dracut po pyanaconda scripts tests widgets utils -+SUBDIRS = data dracut pyanaconda scripts tests widgets utils +-SUBDIRS = data docs dracut po pyanaconda scripts tests widgets ui utils ++SUBDIRS = data dracut pyanaconda scripts tests widgets ui utils - EXTRA_DIST = COPYING .coveragerc + EXTRA_DIST = COPYING diff --git a/configure.ac b/configure.ac -index c1af6e2..2321b62 100644 +index 9edcd77da0..39dcc394cc 100644 --- a/configure.ac +++ b/configure.ac -@@ -122,7 +122,6 @@ AC_CONFIG_FILES([Makefile - zanata.xml +@@ -114,7 +114,6 @@ AC_CONFIG_FILES([Makefile + anaconda.spec data/Makefile data/command-stubs/Makefile - docs/Makefile dracut/Makefile data/conf.d/Makefile - data/product.d/Makefile -@@ -134,7 +133,6 @@ AC_CONFIG_FILES([Makefile + data/profile.d/Makefile +@@ -126,7 +125,6 @@ AC_CONFIG_FILES([Makefile data/dbus/Makefile data/window-manager/Makefile data/window-manager/config/Makefile @@ -46,7 +50,7 @@ index c1af6e2..2321b62 100644 pyanaconda/Makefile pyanaconda/version.py diff --git a/widgets/Makefile.am b/widgets/Makefile.am -index 6478ce8..222aeaa 100644 +index 6478ce8764..222aeaac59 100644 --- a/widgets/Makefile.am +++ b/widgets/Makefile.am @@ -19,7 +19,7 @@ diff --git a/recipes-installer/anaconda/files/0001-pyanaconda-payload-Fix-xserver-detection.patch b/recipes-installer/anaconda/files/0001-pyanaconda-payload-Fix-xserver-detection.patch deleted file mode 100644 index b170aa2..0000000 --- a/recipes-installer/anaconda/files/0001-pyanaconda-payload-Fix-xserver-detection.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 95e60867b3172eb64e3f720a3457923f70ea820c Mon Sep 17 00:00:00 2001 -From: Hongxu Jia <hongxu.jia@windriver.com> -Date: Mon, 1 Jul 2019 11:24:13 +0800 -Subject: [PATCH] pyanaconda: payload: Fix xserver detection - -When installing an image that has graphical interface, -/etc/systemd/system/default.target will point to multi-user.target -instead of graphical.target. - -To fix this, use the right rpm query to detect the presence of xserver. - -Upstream-Status: Inappropriate [OE specific] - -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> ---- - pyanaconda/payload/__init__.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pyanaconda/payload/__init__.py b/pyanaconda/payload/__init__.py -index cbe2154..6b3e5ff 100644 ---- a/pyanaconda/payload/__init__.py -+++ b/pyanaconda/payload/__init__.py -@@ -631,7 +631,7 @@ class Payload(metaclass=ABCMeta): - ts = rpm.TransactionSet(util.getSysroot()) - - # XXX one day this might need to account for anaconda's display mode -- if ts.dbMatch("provides", 'service(graphical-login)').count() and \ -+ if ts.dbMatch('provides', 'xserver-xorg').count() and \ - not flags.usevnc: - # We only manipulate the ksdata. The symlink is made later - # during the config write out. --- -2.7.4 - diff --git a/recipes-installer/anaconda/files/0003-tweak-iso-mount-dir-and-kernel-name.patch b/recipes-installer/anaconda/files/0003-tweak-iso-mount-dir-and-kernel-name.patch index 4711d39..54b65fc 100644 --- a/recipes-installer/anaconda/files/0003-tweak-iso-mount-dir-and-kernel-name.patch +++ b/recipes-installer/anaconda/files/0003-tweak-iso-mount-dir-and-kernel-name.patch @@ -12,90 +12,87 @@ Subject: [PATCH] tweak iso mount dir and kernel name Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +* update context for anaconda 32 +* backport patch from Upstream to 'Handle bytes and strings from RPM' +* replace obsolete function 'util.getSysroot' + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 34 + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37 + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 39. + +* variable INSTALL_TREE has been removed in upstream + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + --- - pyanaconda/core/constants.py | 6 +++--- - pyanaconda/payload/__init__.py | 18 +++++++++++------- - 2 files changed, 14 insertions(+), 10 deletions(-) + pyanaconda/core/constants.py | 2 +- + pyanaconda/modules/payloads/payload/dnf/utils.py | 15 +++++++++++---- + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pyanaconda/core/constants.py b/pyanaconda/core/constants.py -index 8910d48..cdf5ef6 100644 +index b8075da7e3..350e7f7d94 100644 --- a/pyanaconda/core/constants.py +++ b/pyanaconda/core/constants.py -@@ -52,12 +52,12 @@ TRANSLATIONS_UPDATE_DIR = "/tmp/updates/po" - VIRTIO_PORT = "/dev/virtio-ports/org.fedoraproject.anaconda.log.0" +@@ -45,7 +45,7 @@ ANACONDA_CLEANUP = "anaconda-cleanup" + LIVE_MOUNT_POINT = "/run/initramfs/live" - ANACONDA_CLEANUP = "anaconda-cleanup" + # Source mount points. -MOUNT_DIR = "/run/install" --DRACUT_REPODIR = "/run/install/repo" +MOUNT_DIR = "/media/realroot" -+DRACUT_REPODIR = MOUNT_DIR + "/Packages" DRACUT_ISODIR = "/run/install/source" + DRACUT_REPO_DIR = "/run/install/repo" ISO_DIR = MOUNT_DIR + "/isodir" - IMAGE_DIR = MOUNT_DIR + "/image" --INSTALL_TREE = MOUNT_DIR + "/source" -+INSTALL_TREE = "/media/source" - BASE_REPO_NAME = "anaconda" +diff --git a/pyanaconda/modules/payloads/payload/dnf/utils.py b/pyanaconda/modules/payloads/payload/dnf/utils.py +index 196632cbfe..9e0c8805a9 100644 +--- a/pyanaconda/modules/payloads/payload/dnf/utils.py ++++ b/pyanaconda/modules/payloads/payload/dnf/utils.py +@@ -62,7 +62,7 @@ def get_kernel_package(dnf_manager, exclude_list): + return None - # Get list of repo names witch should be used as base repo -diff --git a/pyanaconda/payload/__init__.py b/pyanaconda/payload/__init__.py -index 849b424..7c65d29 100644 ---- a/pyanaconda/payload/__init__.py -+++ b/pyanaconda/payload/__init__.py -@@ -26,7 +26,7 @@ from abc import ABCMeta + # Get the kernel packages. +- kernels = ["kernel"] ++ kernels = ["kernel-image"] - from pyanaconda.core.configuration.anaconda import conf - from pyanaconda.core.constants import DRACUT_ISODIR, DRACUT_REPODIR, DD_ALL, DD_FIRMWARE, \ -- DD_RPMS, INSTALL_TREE, ISO_DIR, GRAPHICAL_TARGET, TEXT_ONLY_TARGET -+ DD_RPMS, INSTALL_TREE, ISO_DIR, GRAPHICAL_TARGET, TEXT_ONLY_TARGET, MOUNT_DIR - from pyanaconda.modules.common.constants.services import SERVICES - from pykickstart.constants import GROUP_ALL, GROUP_DEFAULT, GROUP_REQUIRED - from pyanaconda.flags import flags -@@ -701,7 +701,7 @@ class PackagePayload(Payload, metaclass=ABCMeta): - if "kernel" in self.data.packages.excludedList: - return [] + # ARM systems use either the standard Multiplatform or LPAE platform. + if is_lpae_available(): +@@ -166,19 +166,26 @@ def get_kernel_version_list(): -- kernels = ["kernel"] -+ kernels = ["kernel-image"] + # Find all installed RPMs that provide 'kernel'. + ts = rpm.TransactionSet(conf.target.system_root) +- mi = ts.dbMatch('providename', 'kernel') ++ mi = ts.dbMatch() ++ mi.pattern('name', rpm.RPMMIRE_GLOB, 'kernel-image*') - if payload_utils.arch_is_x86() and isys.isPaeAvailable(): - kernels.insert(0, "kernel-PAE") -@@ -726,14 +726,17 @@ class PackagePayload(Payload, metaclass=ABCMeta): - files = [] + for hdr in mi: ++ log.info("hdr.filenames %s" % hdr.filenames) ++ + # Find all /boot/vmlinuz- files and strip off vmlinuz-. + files.extend(( + f.split("/")[-1][8:] for f in hdr.filenames +- if fnmatch.fnmatch(f, "/boot/vmlinuz-*") or +- fnmatch.fnmatch(f, "/boot/efi/EFI/%s/vmlinuz-*" % efi_dir) ++ if ((fnmatch.fnmatch(f, "/boot/*") or ++ fnmatch.fnmatch(f, "/boot/efi/EFI/%s/*" % efi_dir)) ++ and len(f.split("/")[-1]) > 7 ++ and not f.endswith('.sig')) + )) - ts = rpm.TransactionSet(util.getSysroot()) -- mi = ts.dbMatch('providename', 'kernel') -+ mi = ts.dbMatch() -+ mi.pattern('name', rpm.RPMMIRE_GLOB, 'kernel-image*') - for hdr in mi: -+ log.info("hdr.filenames %s" % hdr.filenames) - unicode_fnames = (f.decode("utf-8") for f in hdr.filenames) - # Find all /boot/vmlinuz- files and strip off vmlinuz- - files.extend((f.split("/")[-1][8:] for f in unicode_fnames -- if fnmatch(f, "/boot/vmlinuz-*") or -- fnmatch(f, "/boot/efi/EFI/%s/vmlinuz-*" % conf.bootloader.efi_dir))) -+ if(fnmatch(f, "/boot/*") or fnmatch(f, "/boot/efi/EFI/%s/*" % conf.bootloader.efi_dir)) -+ and len(f.split("/")[-1]) > 7)) + # Sort the kernel versions. + sort_kernel_version_list(files) -+ log.info("kernelVersionList %s" % files) - return sorted(files, key=functools.cmp_to_key(payload_utils.version_cmp)) ++ log.info("kernelVersionList %s" % files) ++ + return files - @property -@@ -1056,12 +1059,13 @@ class PackagePayload(Payload, metaclass=ABCMeta): - # FIXME: We really should not talk about NFS here - regression from re-factorization? - # Did dracut leave the DVD or NFS mounted for us? -- device = payload_utils.get_mount_device(DRACUT_REPODIR) -+ device = payload_utils.get_mount_device(MOUNT_DIR) - - # Check for valid optical media if we didn't boot from one -- if not verifyMedia(DRACUT_REPODIR): -+ if not verifyMedia(MOUNT_DIR): - self.install_device = opticalInstallMedia(storage.devicetree) - -+ log.info("device %s, install_device %s" % (device, self.install_device)) - # Only look at the dracut mount if we don't already have a cdrom - if device and not self.install_device: - self.install_device = storage.devicetree.get_device_by_path(device) -- 2.7.4 - diff --git a/recipes-installer/anaconda/files/0004-customize-default-option-for-OE.patch b/recipes-installer/anaconda/files/0004-customize-default-option-for-OE.patch index 539032b..96918a8 100644 --- a/recipes-installer/anaconda/files/0004-customize-default-option-for-OE.patch +++ b/recipes-installer/anaconda/files/0004-customize-default-option-for-OE.patch @@ -10,24 +10,28 @@ Subject: [PATCH] customize default option for OE Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 37. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- pyanaconda/argument_parsing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyanaconda/argument_parsing.py b/pyanaconda/argument_parsing.py -index b520509..bd1eda8 100644 +index fc23edd2f3..f5a747126d 100644 --- a/pyanaconda/argument_parsing.py +++ b/pyanaconda/argument_parsing.py -@@ -462,7 +462,7 @@ def getArgumentParser(version_string, boot_cmdline=None): - help=help_parser.help_text("stage2")) +@@ -482,7 +482,7 @@ def getArgumentParser(version_string, boot_cmdline=None): + ap.add_argument("--addrepo", dest="addRepo", default=[], metavar="NAME,ADDITIONAL_REPO_URL", - action="append", help=help_parser.help_text("addrepo")) + action=ParseAddRepo, help=help_parser.help_text("addrepo")) - ap.add_argument("--noverifyssl", action="store_true", default=False, + ap.add_argument("--noverifyssl", action="store_true", default=True, help=help_parser.help_text("noverifyssl")) ap.add_argument("--liveinst", action="store_true", default=False, help=help_parser.help_text("liveinst")) -@@ -500,7 +500,7 @@ def getArgumentParser(version_string, boot_cmdline=None): +@@ -515,7 +515,7 @@ def getArgumentParser(version_string, boot_cmdline=None): from pykickstart.constants import SELINUX_DISABLED, SELINUX_ENFORCING from pyanaconda.core.constants import SELINUX_DEFAULT ap.add_argument("--noselinux", dest="selinux", action="store_const", diff --git a/recipes-installer/anaconda/files/0006-livepayload-fix-mount-install-tree-failed.patch b/recipes-installer/anaconda/files/0006-livepayload-fix-mount-install-tree-failed.patch index 6cf2e23..ee20ae4 100644 --- a/recipes-installer/anaconda/files/0006-livepayload-fix-mount-install-tree-failed.patch +++ b/recipes-installer/anaconda/files/0006-livepayload-fix-mount-install-tree-failed.patch @@ -13,23 +13,26 @@ Try mounting with noload Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Update context for anaconda 32. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- pyanaconda/payload/livepayload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyanaconda/payload/livepayload.py b/pyanaconda/payload/livepayload.py -index 6a8d345..c8df0cd 100644 +index cca38c0510..dbcb04fee0 100644 --- a/pyanaconda/payload/livepayload.py +++ b/pyanaconda/payload/livepayload.py -@@ -80,7 +80,7 @@ class LiveImagePayload(Payload): +@@ -82,7 +82,7 @@ class LiveImagePayload(Payload): (self.data.method.partition,)) if errorHandler.cb(exn) == ERROR_RAISE: raise exn -- rc = payload_utils.mount(osimg.path, INSTALL_TREE, fstype="auto", options="ro") -+ rc = payload_utils.mount(osimg.path, INSTALL_TREE, fstype="auto", options="ro,noload") +- rc = payload_utils.mount(osimg_path, INSTALL_TREE, fstype="auto", options="ro") ++ rc = payload_utils.mount(osimg_path, INSTALL_TREE, fstype="auto", options="ro,noload") if rc != 0: raise PayloadInstallError("Failed to mount the install tree") -- 2.7.4 - diff --git a/recipes-installer/anaconda/files/0007-dnfpayload.py-customize-for-OE.patch b/recipes-installer/anaconda/files/0007-dnfpayload.py-customize-for-OE.patch index 7842c97..e99cb92 100644 --- a/recipes-installer/anaconda/files/0007-dnfpayload.py-customize-for-OE.patch +++ b/recipes-installer/anaconda/files/0007-dnfpayload.py-customize-for-OE.patch @@ -6,229 +6,262 @@ Subject: [PATCH] dnfpayload.py: customize for OE Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Update context for anaconda 32. + +the storage and data are not propagated to the payload again, so remove +from setup(). + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 34 on 20210727. +* rebase code +* remove debug code +* remove patch for function language_groups() which has been remove from upstream + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37 on 20230227. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 38 on 20231107. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + + +Rebase for anaconda 39 on 20240327. + +* funtion is_environment_valid() has been removed in upstream +* create class OEConfigureTask to handle oe specific configuration +* set DNF default source from install disk + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + --- - pyanaconda/payload/dnfpayload.py | 397 +++++++++++++++++++++++++++++++++------ - 1 file changed, 340 insertions(+), 57 deletions(-) + pyanaconda/modules/payloads/payload/dnf/dnf.py | 6 +- + .../modules/payloads/payload/dnf/dnf_manager.py | 181 +++++++++++++++++---- + .../modules/payloads/payload/dnf/initialization.py | 4 + + .../modules/payloads/payload/dnf/installation.py | 75 ++++++++- + .../modules/payloads/payload/dnf/requirements.py | 21 +++ + .../payloads/payload/dnf/transaction_progress.py | 9 +- + pyanaconda/modules/payloads/payload/dnf/utils.py | 10 -- + .../modules/payloads/payload/dnf/validation.py | 83 ++++++++++ + pyanaconda/payload/dnf/payload.py | 4 +- + 9 files changed, 347 insertions(+), 46 deletions(-) -diff --git a/pyanaconda/payload/dnfpayload.py b/pyanaconda/payload/dnfpayload.py -index 1f2925d..53d40eb 100644 ---- a/pyanaconda/payload/dnfpayload.py -+++ b/pyanaconda/payload/dnfpayload.py -@@ -17,6 +17,7 @@ - # Red Hat, Inc. - # - import os -+import os.path - import configparser - import collections - import multiprocessing -@@ -55,6 +56,7 @@ import dnf.transaction - import libdnf.conf - import rpm - from dnf.const import GROUP_PACKAGE_TYPES -+import dnf.const - - from blivet.size import Size - from pykickstart.constants import GROUP_ALL, GROUP_DEFAULT, KS_MISSING_IGNORE -@@ -62,6 +64,11 @@ from pykickstart.constants import GROUP_ALL, GROUP_DEFAULT, KS_MISSING_IGNORE - from pyanaconda.anaconda_loggers import get_packaging_logger, get_dnf_logger - log = get_packaging_logger() - +diff --git a/pyanaconda/modules/payloads/payload/dnf/dnf.py b/pyanaconda/modules/payloads/payload/dnf/dnf.py +index 9f7921de4d..133fb8dfdb 100644 +--- a/pyanaconda/modules/payloads/payload/dnf/dnf.py ++++ b/pyanaconda/modules/payloads/payload/dnf/dnf.py +@@ -37,7 +37,7 @@ from pyanaconda.modules.payloads.payload.dnf.initialization import configure_dnf + from pyanaconda.modules.payloads.payload.dnf.installation import SetRPMMacrosTask, \ + ResolvePackagesTask, PrepareDownloadLocationTask, DownloadPackagesTask, InstallPackagesTask, \ + CleanUpDownloadLocationTask, WriteRepositoriesTask, ImportRPMKeysTask, \ +- UpdateDNFConfigurationTask ++ UpdateDNFConfigurationTask, OEConfigureTask + from pyanaconda.modules.payloads.payload.dnf.tear_down import ResetDNFManagerTask + from pyanaconda.modules.payloads.payload.dnf.utils import calculate_required_space + from pyanaconda.modules.payloads.payload.payload_base import PayloadBase +@@ -473,6 +473,10 @@ class DNFModule(PayloadBase): + sysroot=conf.target.system_root, + configuration=self.packages_configuration, + ), ++ OEConfigureTask( ++ sysroot=conf.target.system_root, ++ dnf_module=self, ++ ), + ResetDNFManagerTask( + dnf_manager=self.dnf_manager + ) +diff --git a/pyanaconda/modules/payloads/payload/dnf/dnf_manager.py b/pyanaconda/modules/payloads/payload/dnf/dnf_manager.py +index 4852fcdc9d..8256bd9e2b 100644 +--- a/pyanaconda/modules/payloads/payload/dnf/dnf_manager.py ++++ b/pyanaconda/modules/payloads/payload/dnf/dnf_manager.py +@@ -21,6 +21,10 @@ import multiprocessing + import shutil + import threading + import traceback ++import os +import inspect -+if __name__ == "__main__": -+ from pyanaconda import anaconda_logging -+ anaconda_logging.init() -+ anaconda_logging.logger.setupVirtio(constants.VIRTIO_PORT) - - DNF_CACHE_DIR = '/tmp/dnf.cache' - DNF_PLUGINCONF_DIR = '/tmp/dnf.pluginconf' -@@ -232,7 +239,17 @@ class PayloadRPMDisplay(dnf.callback.TransactionProgress): - """Report an error that occurred during the transaction. Message is a - string which describes the error. - """ -- self._queue.put(('error', message)) -+ token = "error" -+ if message.startswith("Error in POSTIN scriptlet in rpm package"): -+ token = "warn" -+ self._queue.put((token, message)) -+ log.info("error: %s" % message) -+ -+ def scriptout(self, msgs): -+ if msgs is None: -+ return -+ -+ log.info("scriptout: %s" % msgs) - - - class DownloadProgress(dnf.callback.DownloadProgress): -@@ -302,6 +319,12 @@ class DNFPayload(payload.PackagePayload): - self._updates_enabled = True - self._configure() - -+ self.requirements.add_packages(['base-files', 'base-passwd', 'shadow'], reason="basic packages") -+ # Support grub-mkconfig -+ self.requirements.add_packages(['sed', 'coreutils'], reason="Support grub-mkconfig") -+ # Support create new user -+ self.requirements.add_packages(['shadow'], reason="Support create new user") -+ - # Protect access to _base.repos to ensure that the dictionary is not - # modified while another thread is attempting to iterate over it. The - # lock only needs to be held during operations that change the number -@@ -315,12 +338,28 @@ class DNFPayload(payload.PackagePayload): - self._req_packages = set() - self.requirements.set_apply_callback(self._apply_requirements) ++import collections ++import configparser + + import dnf + import dnf.exceptions +@@ -37,7 +41,7 @@ from pyanaconda.core.constants import DNF_DEFAULT_TIMEOUT, DNF_DEFAULT_RETRIES, + URL_TYPE_MIRRORLIST, URL_TYPE_METALINK, DNF_DEFAULT_REPO_COST + from pyanaconda.core.i18n import _ + from pyanaconda.core.payload import ProxyString, ProxyStringError +-from pyanaconda.core.util import get_os_release_value ++from pyanaconda.core.util import get_os_release_value, execWithRedirect, execWithCapture + from pyanaconda.modules.common.errors.installation import PayloadInstallationError + from pyanaconda.modules.common.errors.payload import UnknownCompsEnvironmentError, \ + UnknownCompsGroupError, UnknownRepositoryError +@@ -104,11 +108,17 @@ class DNFManager(object): + self._md_hashes = {} + self._enabled_system_repositories = [] + # OE specific + self.image = {} + self.tasks = {} ++ self.failed_scriptlets_pkgnames = collections.OrderedDict() + -+ def setup(self, storage): -+ log.info("%s %s" % (self.__class__.__name__, inspect.stack()[0][3])) -+ -+ # OE specific -+ self.image, self.tasks = self._read_buildstamp() -+ -+ super().setup(storage) -+ - def unsetup(self): - super().unsetup() - self._base = None - self._configure() - self._repoMD_list = [] + @property + def _base(self): + """The DNF base.""" + if self.__base is None: + self.__base = self._create_base() ++ self._oe_configure(self.__base.conf) + + return self.__base + +@@ -137,7 +147,7 @@ class DNFManager(object): + + # Set the platform id based on the /os/release present + # in the installation environment. +- platform_id = get_os_release_value("PLATFORM_ID") ++ platform_id = get_os_release_value("VERSION_ID") + + if platform_id is not None: + base.conf.module_platform_id = platform_id +@@ -171,6 +181,9 @@ class DNFManager(object): + self._md_hashes = {} + self._enabled_system_repositories = [] -+ # OE specific + self.image = {} + self.tasks = {} + - def _replace_vars(self, url): - """Replace url variables with their values. + log.debug("The DNF base has been reset.") + + def configure_base(self, data: PackagesConfigurationData): +@@ -225,7 +238,8 @@ class DNFManager(object): -@@ -482,24 +521,16 @@ class DNFPayload(payload.PackagePayload): - log.debug("excluding group %s", group.name) - exclude_list.append("@{}".format(group.name)) + :return: a list of ids + """ +- return [env.id for env in self._base.comps.environments] ++ log.info("%s %s: %s" % (self.__class__.__name__, inspect.stack()[0][3], self.tasks.keys())) ++ return sorted(self.tasks.keys()) + + def _get_environment(self, environment_name): + """Translate the given environment name to a DNF object. +@@ -236,7 +250,7 @@ class DNFManager(object): + if not environment_name: + return None + +- return self._base.comps.environment_by_pattern(environment_name) ++ return environment_name -- # core groups -- if self.data.packages.nocore: -- log.info("skipping core group due to %%packages --nocore; system may not be complete") -- exclude_list.append("@core") -- else: -- log.info("selected group: core") -- include_list.append("@core") + def resolve_environment(self, environment_name): + """Translate the given environment name to a group ID. +@@ -244,12 +258,9 @@ class DNFManager(object): + :param environment_name: an identifier of an environment + :return: a string with the environment ID or None + """ +- env = self._get_environment(environment_name) ++ log.info("%s %s, environment %s" % (self.__class__.__name__, inspect.stack()[0][3], environment_name)) + +- if not env: +- return None - - # environment - env = None -- if self.data.packages.default and self.environments: -- env = self.environments[0] -- log.info("selecting default environment: %s", env) -- elif self.data.packages.environment: -+ if self.data.packages.environment: - env = self.data.packages.environment - log.info("selected environment: %s", env) -- if env: -- include_list.append("@{}".format(env)) -+ elif self.environments: -+ env = self.environments[0] -+ for pkg_name in self._apply_yocto_environment(env): -+ log.info("selected yocto package: '%s'", pkg_name) -+ include_list.append(pkg_name) +- return env.id ++ return environment_name - # groups from kickstart data - for group in self.data.packages.groupList: -@@ -579,6 +610,62 @@ class DNFPayload(payload.PackagePayload): - except Exception as e: # pylint: disable=broad-except - self._payload_setup_error(e) + def get_environment_data(self, environment_name) -> CompsEnvironmentData: + """Get the data of the specified environment. +@@ -271,24 +282,11 @@ class DNFManager(object): + :param env: a DNF representation of the environment + :return: an instance of CompsEnvironmentData + """ ++ task = self.tasks.get(env) + data = CompsEnvironmentData() +- data.id = env.id or "" +- data.name = env.ui_name or "" +- data.description = env.ui_description or "" +- +- optional = {i.name for i in env.option_ids} +- default = {i.name for i in env.option_ids if i.default} +- +- for grp in self._base.comps.groups: +- +- if grp.id in optional: +- data.optional_groups.append(grp.id) +- +- if grp.visible: +- data.visible_groups.append(grp.id) +- +- if grp.id in default: +- data.default_groups.append(grp.id) ++ data.id = env or "" ++ data.name = task[0] or "" ++ data.description = task[1] or "" -+ def _apply_yocto_environment(self, env): -+ if not env: -+ return [] -+ -+ (image_name, description) = self.environment_description(env) -+ log.info("image_name %s, des %s" % (image_name, description)) -+ image_id = image_name.split()[0] -+ (image_summary, image_description, package_install, package_install_attemptonly, image_linguas) = self.image[image_id] -+ log.info("package_install %s, attempt %s, linguas %s" % -+ (package_install, package_install_attemptonly, image_linguas)) -+ -+ # Language locale -+ self._select_yocto_linguas(image_linguas) -+ -+ # -dbg/-doc/-dev -+ for group in self.tasks[env][2].split(): -+ self._select_yocto_group(group) -+ -+ # Installing packages -+ return package_install.split() -+ -+ def _select_yocto_group(self, group_id): -+ log.info("_select_yocto_group %s" % group_id) -+ if not group_id: -+ return [] -+ -+ glob = self._yocto_complementary_glob(group_id) -+ -+ # get all available languages in repos -+ available_packs = self._base.sack.query().available() \ -+ .filter(name__glob = "*-%s"%glob) -+ allpkgnames = [p.name for p in available_packs] -+ log.info("allpkgnames %d" % len(allpkgnames)) -+ for pkgname in allpkgnames: -+ self._try_install_package(pkgname) + return data + +@@ -298,7 +296,8 @@ class DNFManager(object): + + :return: a list of IDs + """ +- return [g.id for g in self._base.comps.groups] ++ log.info("%s %s: %s" % (self.__class__.__name__, inspect.stack()[0][3], self.tasks.keys())) ++ return [] + + def _get_group(self, group_name): + """Translate the given group name into a DNF object. +@@ -343,9 +342,8 @@ class DNFManager(object): + :return: an instance of CompsGroupData + """ + data = CompsGroupData() +- data.id = grp.id or "" +- data.name = grp.ui_name or "" +- data.description = grp.ui_description or "" ++ log.info("%s %s, %s" % (self.__class__.__name__, inspect.stack()[0][3], grp)) ++ (data.id, data.name, data.description) = self.tasks[grp] + return data + + def configure_proxy(self, url): +@@ -684,6 +682,16 @@ class DNFManager(object): + + # Wait for the transaction to end. + process.join() ++ ++ for pkg in self.failed_scriptlets_pkgnames.keys(): ++ self._save_rpmpostinst(pkg) ++ ++ # create symlinks for distro feature usrmerge ++ for d in ('bin', 'sbin', 'lib', 'lib32', 'lib64'): ++ if (not os.path.lexists(os.path.join(conf.target.system_root, d)) ++ and os.path.exists(os.path.join(conf.target.system_root, 'usr', d))): ++ execWithCapture("ln", ["-rs", os.path.join('/usr', d), os.path.join('/', d)], ++ root=conf.target.system_root) + finally: + # Kill the transaction after the timeout. + process.join(timeout) +@@ -1047,3 +1055,116 @@ class DNFManager(object): + continue + + return "" ++ ++ def environment_description(self, environment_id): ++ log.info("%s %s, %s" % (self.__class__.__name__, inspect.stack()[0][3], environment_id)) + -+ def _select_yocto_linguas(self, image_linguas): -+ lc_globs = [] -+ for ling in image_linguas.split(): -+ if ling not in lc_globs: -+ lc_globs.append(ling) ++ if environment_id not in self.tasks: ++ raise NoSuchGroup(environment_id) + -+ baselang = ling.split('-')[0] -+ if ling != baselang and baselang not in lc_globs: -+ lc_globs.append(baselang) ++ if environment_id in self.tasks: ++ log.info("environmentDescription %s" % self.tasks) ++ (name, description, group) = self.tasks[environment_id] + -+ log.info("lc_globs: %s" % lc_globs) -+ for glob in lc_globs: -+ self._select_yocto_group("locale-%s" % glob) ++ return (name, description) ++ return (environment_id, environment_id) + -+ def _try_install_package(self, pkg_name): -+ try: -+ return self._base.install(pkg_name, strict=False) -+ except dnf.exceptions.MarkingError: -+ raise payload.NoSuchPackage(pkg_name, required=False) -+ - def _apply_requirements(self, requirements): - self._req_groups = set() - self._req_packages = set() -@@ -594,7 +681,7 @@ class DNFPayload(payload.PackagePayload): - log.debug("selected package: %s, requirement for %s %s", - req.id, req.reasons, ", ".join(ignore_msgs)) - -- for req in self.requirements.groups: -+ for req in self.requirements.groups or []: - # NOTE: req.strong not handled yet - log.debug("selected group: %s, requirement for %s", - req.id, req.reasons) -@@ -645,16 +732,47 @@ class DNFPayload(payload.PackagePayload): - if os.path.exists("/etc/os-release"): - config = SimpleConfigFile() - config.read("/etc/os-release") -- os_release_platform_id = config.get("PLATFORM_ID") -+ os_release_platform_id = config.get("VERSION_ID") - # simpleconfig return "" for keys that are not found - if os_release_platform_id: - platform_id = os_release_platform_id - else: -- log.error("PLATFORM_ID missing from /etc/os-release") -+ log.error("VERSION_ID missing from /etc/os-release") - else: - log.error("/etc/os-release is missing, platform id can't be obtained") - return platform_id - + def _oe_configure(self, dnf_conf): + # Refers oe-core's recipes of dnf and rpm + os.environ['RPM_NO_CHROOT_FOR_SCRIPTS'] = "1" + + # Refers oe-core's meta/lib/oe/package_manager.py + # def _prepare_pkg_transaction(self) in class RpmPM(PackageManager) -+ target_rootfs = util.getSysroot() ++ target_rootfs = conf.target.system_root + os.environ['D'] = target_rootfs + os.environ['OFFLINE_ROOT'] = target_rootfs + os.environ['IPKG_OFFLINE_ROOT'] = target_rootfs @@ -242,272 +275,9 @@ index 1f2925d..53d40eb 100644 + dnf_conf.errorlevel = dnf.const.VERBOSE_LEVEL + dnf_conf.debuglevel = dnf.const.VERBOSE_LEVEL + -+ -+ def _oe_configure_post(self): -+ # Refers oe-core's meta/lib/oe/package_manager.py -+ # def _configure_rpm(self) and def _configure_dnf(self) -+ # in class RpmPM(PackageManager) -+ # directly copy its result from installer system -+ target_sysconf = "%s/etc" % util.getSysroot() -+ util.execWithRedirect("cp", ["-fr", "/etc/rpmrc", target_sysconf]) -+ util.execWithRedirect("cp", ["-rf", "/etc/dnf", target_sysconf]) -+ util.execWithRedirect("cp", ["-rf", "/etc/rpm", target_sysconf]) -+ - def _configure(self): - self._base = dnf.Base() - config = self._base.conf -@@ -674,6 +792,8 @@ class DNFPayload(payload.PackagePayload): - config.installroot = util.getSysroot() - config.prepend_installroot('persistdir') - -+ self._oe_configure(config) -+ - self._base.conf.substitutions.update_from_etc(config.installroot) - - if self.data.packages.multiLib: -@@ -801,20 +921,23 @@ class DNFPayload(payload.PackagePayload): - def base_repo(self): - # is any locking needed here? - repo_names = [constants.BASE_REPO_NAME] + constants.DEFAULT_REPOS -+ log.info("repo_names %s" % repo_names) - with self._repos_lock: - for repo in self._base.repos.iter_enabled(): -+ log.info("repo.id %s" % repo.id) - if repo.id in repo_names: - return repo.id - return None - - @property - def environments(self): -- return [env.id for env in self._base.comps.environments] -+ log.info("%s %s: %s" % (self.__class__.__name__, inspect.stack()[0][3], self.tasks.keys())) -+ return sorted(self.tasks.keys()) - - @property - def groups(self): -- groups = self._base.comps.groups_iter() -- return [g.id for g in groups] -+ log.info("%s %s: %s" % (self.__class__.__name__, inspect.stack()[0][3], self.tasks.keys())) -+ return [] - - @property - def repos(self): -@@ -936,42 +1059,39 @@ class DNFPayload(payload.PackagePayload): - super().enable_repo(repo_id) - - def environment_description(self, environment_id): -- env = self._base.comps.environment_by_pattern(environment_id) -- if env is None: -- raise NoSuchGroup(environment_id) -- return (env.ui_name, env.ui_description) -+ log.info("%s %s, %s" % (self.__class__.__name__, inspect.stack()[0][3], environment_id)) -+ -+ if environment_id not in self.tasks: -+ raise NoSuchGroup(environment_id) -+ -+ if environment_id in self.tasks: -+ log.info("environmentDescription %s" % self.tasks) -+ (name, description, group) = self.tasks[environment_id] -+ -+ return (name, description) -+ return (environment_id, environment_id) - - def environment_id(self, environment): - """Return environment id for the environment specified by id or name.""" -- # the enviroment must be string or else DNF >=3 throws an assert error -- if not isinstance(environment, str): -- log.warning("environment_id() called with non-string argument: %s", environment) -- env = self._base.comps.environment_by_pattern(environment) -- if env is None: -- raise NoSuchGroup(environment) -- return env.id -+ log.info("%s %s, environment %s" % (self.__class__.__name__, inspect.stack()[0][3], environment)) -+ # TODO -+ return environment - - def environment_has_option(self, environment_id, grpid): -- env = self._base.comps.environment_by_pattern(environment_id) -- if env is None: -- raise NoSuchGroup(environment_id) -- return grpid in (id_.name for id_ in env.option_ids) -+ log.info("%s %s, %s, %s" % (self.__class__.__name__, inspect.stack()[0][3], environment_id, grpid)) -+ # TODO -+ return True - - def environment_option_is_default(self, environment_id, grpid): -- env = self._base.comps.environment_by_pattern(environment_id) -- if env is None: -- raise NoSuchGroup(environment_id) -- -- # Look for a group in the optionlist that matches the group_id and has -- # default set -- return any(grp for grp in env.option_ids if grp.name == grpid and grp.default) -+ log.info("%s %s, %s, %s" % (self.__class__.__name__, inspect.stack()[0][3], environment_id, grpid)) -+ # TODO -+ return True - - def group_description(self, grpid): - """Return name/description tuple for the group specified by id.""" -- grp = self._base.comps.group_by_pattern(grpid) -- if grp is None: -- raise NoSuchGroup(grpid) -- return (grp.ui_name, grp.ui_description) -+ log.info("%s %s, %s" % (self.__class__.__name__, inspect.stack()[0][3], grpid)) -+ (name, description, group) = self.tasks[grpid] -+ return (name, description) - - def group_id(self, group_name): - """Translate group name to group ID. -@@ -994,6 +1114,31 @@ class DNFPayload(payload.PackagePayload): - self._base.read_comps() - self._refresh_environment_addons() - -+ # Refer upstream oe-core meta/lib/oe/package_manager.py -+ def _save_rpmpostinst(self, pkg): -+ def _script_num_prefix(path): -+ files = os.listdir(path) -+ numbers = set() -+ numbers.add(99) -+ for f in files: -+ numbers.add(int(f.split("-")[0])) -+ return max(numbers) + 1 -+ -+ log.info("Saving postinstall script of %s" % (pkg)) -+ -+ target_rootfs = util.getSysroot() -+ args = ["-q", "--root=%s" % target_rootfs, "--queryformat", "%{postin}", pkg] -+ -+ output = util.execWithCapture('rpm', args, log_output=False) -+ log.info(output) -+ -+ target_path = "%s/etc/rpm-postinsts" % target_rootfs -+ util.execWithRedirect("mkdir", ["-p", target_path]) -+ num = _script_num_prefix(target_path) -+ saved_script_name = os.path.join(target_path, "%d-%s" % (num, pkg)) -+ open(saved_script_name, 'w').write(output) -+ os.chmod(saved_script_name, 0o755) -+ - def install(self): - progress_message(N_('Starting package installation process')) - -@@ -1028,6 +1173,7 @@ class DNFPayload(payload.PackagePayload): - _failure_limbo() - - log.info('Downloading packages finished.') -+ failed_scriptlets_pkgnames = collections.OrderedDict() - - pre_msg = (N_("Preparing transaction from installation source")) - progress_message(pre_msg) -@@ -1060,6 +1206,9 @@ class DNFPayload(payload.PackagePayload): - elif token == 'quit': - msg = ("Payload error - DNF installation has ended up abruptly: %s" % msg) - raise PayloadError(msg) -+ elif token == 'warn': -+ if msg.startswith("Error in POSTIN scriptlet in rpm package"): -+ failed_scriptlets_pkgnames[msg.split()[-1]] = True - elif token == 'error': - exc = PayloadInstallError("DNF error: %s" % msg) - if errors.errorHandler.cb(exc) == errors.ERROR_RAISE: -@@ -1068,6 +1217,10 @@ class DNFPayload(payload.PackagePayload): - (token, msg) = queue_instance.get() - - process.join() -+ -+ for pkg in failed_scriptlets_pkgnames.keys(): -+ self._save_rpmpostinst(pkg) -+ - # Don't close the mother base here, because we still need it. - if os.path.exists(self._download_location): - log.info("Cleaning up downloaded packages: %s", self._download_location) -@@ -1079,6 +1232,39 @@ class DNFPayload(payload.PackagePayload): - # we don't have to care about clearing the download location ourselves. - log.warning("Can't delete nonexistent download location: %s", self._download_location) - -+ def _list_installed(self): -+ output = util.execWithCapture( -+ 'dnf', -+ [ -+ 'repoquery', -+ '--installed', -+ '--installroot='+util.getSysroot(), -+ '--queryformat=Package:%{name}' -+ ], -+ log_output=False -+ ) -+ output = output.rstrip() -+ lines = output.splitlines() -+ installed = [] -+ for line in lines: -+ if not line.startswith("Package:"): -+ continue -+ installed.append(line.replace("Package:", "")) -+ return installed -+ -+ def _yocto_complementary_glob(self, group): -+ complementary_glob = {} -+ complementary_glob['dev-pkgs'] = 'dev' -+ complementary_glob['staticdev-pkgs'] = 'staticdev' -+ complementary_glob['doc-pkgs'] = 'doc' -+ complementary_glob['dbg-pkgs'] = 'dbg' -+ complementary_glob['ptest-pkgs'] = 'ptest' -+ -+ if group in complementary_glob: -+ return complementary_glob[group] -+ -+ return group -+ - def get_repo(self, repo_id): - """Return the yum repo object.""" - return self._base.repos[repo_id] -@@ -1101,16 +1287,7 @@ class DNFPayload(payload.PackagePayload): - return True - - def language_groups(self): -- localization_proxy = LOCALIZATION.get_proxy() -- locales = [localization_proxy.Language] + localization_proxy.LanguageSupport -- match_fn = pyanaconda.localization.langcode_matches_locale -- gids = set() -- gl_tuples = ((g.id, g.lang_only) for g in self._base.comps.groups_iter()) -- for (gid, lang) in gl_tuples: -- for locale in locales: -- if match_fn(lang, locale): -- gids.add(gid) -- return list(gids) -+ return [] - - def reset(self): - super().reset() -@@ -1134,6 +1311,8 @@ class DNFPayload(payload.PackagePayload): - sslverify = True - if method.method == "url": - sslverify = not (method.noverifyssl or flags.noverifyssl) -+ log.info('configuring base repo: url %s, mirrorlist %s, sslverify %s, method %s' -+ % (base_repo_url, mirrorlist, sslverify, method.method)) - - # Read in all the repos from the installation environment, make a note of which - # are enabled, and then disable them all. If the user gave us a method, we want -@@ -1179,6 +1358,7 @@ class DNFPayload(payload.PackagePayload): - sslcacert=getattr(method, 'sslcacert', None), - sslclientcert=getattr(method, 'sslclientcert', None), - sslclientkey=getattr(method, 'sslclientkey', None)) -+ log.debug("base_ksrepo enabled %s" % base_ksrepo.enabled) - self._add_repo(base_ksrepo) - self._fetch_md(base_ksrepo.name) - except (MetadataError, PayloadError) as e: -@@ -1397,6 +1577,66 @@ class DNFPayload(payload.PackagePayload): - self._base.close() - super().post_install() - -+ self._oe_configure_post() -+ -+ # For the generation of anaconda-ks.cfg -+ for pkg in self._list_installed(): -+ if pkg not in self.data.packages.packageList: -+ self.data.packages.packageList.append(pkg) -+ -+ util.execWithRedirect("depmod", -+ ["-a"], -+ root=util.getSysroot()) ++ # OE specific ++ def read_buildstamp(self): ++ self.image, self.tasks = self._read_buildstamp() + + def _read_buildstamp(self): + image = {} @@ -516,7 +286,7 @@ index 1f2925d..53d40eb 100644 + config = configparser.ConfigParser() + config.read(["/tmp/product/.buildstamp", "/.buildstamp", os.environ.get("PRODBUILDPATH", "")]) + -+ image_list = (config.get("Rootfs", "LIST") or "").split() ++ image_list = config.get("Rootfs", "LIST", fallback='').split() + for image_name in image_list: + _id_ = image_name.split('-')[0] + image_summary = config.get(image_name, "SUMMARY") @@ -558,56 +328,352 @@ index 1f2925d..53d40eb 100644 + tasks[taskid] = (name, description, group) + + return image, tasks ++ ++ # Refer upstream oe-core meta/lib/oe/package_manager.py ++ def _save_rpmpostinst(self, pkg): ++ def _script_num_prefix(path): ++ files = os.listdir(path) ++ numbers = set() ++ numbers.add(99) ++ for f in files: ++ numbers.add(int(f.split("-")[0])) ++ return max(numbers) + 1 ++ ++ log.info("Saving postinstall script of %s" % (pkg)) ++ ++ target_rootfs = conf.target.system_root ++ args = ["-q", "--root=%s" % target_rootfs, "--queryformat", "%{postin}", pkg] ++ ++ output = execWithCapture('rpm', args, log_output=False) ++ log.info(output) ++ ++ target_path = "%s/etc/rpm-postinsts" % target_rootfs ++ execWithRedirect("mkdir", ["-p", target_path]) ++ num = _script_num_prefix(target_path) ++ saved_script_name = os.path.join(target_path, "%d-%s" % (num, pkg)) ++ with open(saved_script_name, 'w') as f: ++ f.write(output) ++ os.chmod(saved_script_name, 0o755) +diff --git a/pyanaconda/modules/payloads/payload/dnf/initialization.py b/pyanaconda/modules/payloads/payload/dnf/initialization.py +index 841c122c3e..6f5192b068 100644 +--- a/pyanaconda/modules/payloads/payload/dnf/initialization.py ++++ b/pyanaconda/modules/payloads/payload/dnf/initialization.py +@@ -201,6 +201,10 @@ class SetUpDNFSourcesTask(SetUpSourcesTask): + dnf_manager.configure_substitution(self._release_version) + dnf_manager.dump_configuration() + dnf_manager.read_system_repositories() ++ ++ # OE specific ++ dnf_manager.read_buildstamp() ++ + return dnf_manager + + def _load_source(self, dnf_manager, source, repository=None): +diff --git a/pyanaconda/modules/payloads/payload/dnf/installation.py b/pyanaconda/modules/payloads/payload/dnf/installation.py +index 222cceebb5..c24fb3a283 100644 +--- a/pyanaconda/modules/payloads/payload/dnf/installation.py ++++ b/pyanaconda/modules/payloads/payload/dnf/installation.py +@@ -31,7 +31,7 @@ from pyanaconda.modules.common.structures.packages import PackagesConfigurationD + from pyanaconda.modules.common.task import Task + from pyanaconda.modules.payloads.payload.dnf.requirements import collect_remote_requirements, \ + collect_language_requirements, collect_platform_requirements, \ +- collect_driver_disk_requirements, apply_requirements ++ collect_driver_disk_requirements, apply_requirements, collect_oe_requirements + from pyanaconda.modules.payloads.payload.dnf.utils import pick_download_location, \ + get_kernel_version_list + from pyanaconda.modules.payloads.payload.dnf.validation import CheckPackagesSelectionTask +@@ -132,7 +132,8 @@ class ResolvePackagesTask(CheckPackagesSelectionTask): + return collect_remote_requirements() \ + + collect_language_requirements(self._dnf_manager) \ + + collect_platform_requirements(self._dnf_manager) \ +- + collect_driver_disk_requirements() ++ + collect_driver_disk_requirements() \ ++ + collect_oe_requirements() + + def _collect_required_specs(self): + """Collect specs for the required software.""" +@@ -248,6 +249,12 @@ class InstallPackagesTask(Task): + self._dnf_manager.install_packages(self.report_progress) + return get_kernel_version_list() + ++ def report_progress(self, message, step_number=None, step_size=None): ++ super().report_progress(message, step_number, step_size) ++ ++ if message.startswith("Error in POSTIN scriptlet in rpm package"): ++ self._dnf_manager.failed_scriptlets_pkgnames[message.split()[-1]] = True ++ - class RepoMDMetaHash(object): - """Class that holds hash of a repomd.xml file content from a repository. -@@ -1469,3 +1709,46 @@ class RepoMDMetaHash(object): - url, proxies, e) + class WriteRepositoriesTask(Task): + """The installation task for writing repositories on the target system.""" +@@ -420,3 +427,67 @@ class UpdateDNFConfigurationTask(Task): + if rc != 0: + log.warning("Failed to update the DNF configuration (%s).", rc) + return ++ ++ ++class OEConfigureTask(Task): ++ """The OE configuration task.""" ++ ++ def __init__(self, sysroot, dnf_module): ++ """Create a new task. ++ ++ :param str sysroot: a path to the system root ++ :param DNFManager dnf_manager: a DNF manager ++ """ ++ super().__init__() ++ self._sysroot = sysroot ++ self._dnf_module = dnf_module ++ ++ @property ++ def name(self): ++ return "Update DNF configuration for OE" ++ ++ def run(self): ++ """Run the task.""" ++ self._oe_configure_post() ++ ++ # For the generation of anaconda-ks.cfg ++ pkg_data = self._dnf_module.packages_selection ++ for pkg in self._list_installed(): ++ if pkg not in pkg_data.packages: ++ pkg_data.packages.append(pkg) ++ self._dnf_module.set_packages_selection(pkg_data) ++ ++ util.execWithRedirect("depmod", ++ ["-a"], ++ root=conf.target.system_root) ++ ++ def _oe_configure_post(self): ++ # Refers oe-core's meta/lib/oe/package_manager.py ++ # def _configure_rpm(self) and def _configure_dnf(self) ++ # in class RpmPM(PackageManager) ++ # directly copy its result from installer system ++ target_sysconf = "%s/etc" % conf.target.system_root ++ util.execWithRedirect("cp", ["-fr", "/etc/rpmrc", target_sysconf]) ++ util.execWithRedirect("cp", ["-rf", "/etc/dnf", target_sysconf]) ++ util.execWithRedirect("cp", ["-rf", "/etc/rpm", target_sysconf]) ++ ++ def _list_installed(self): ++ output = util.execWithCapture( ++ 'dnf', ++ [ ++ 'repoquery', ++ '--installed', ++ '--installroot=' + self._sysroot, ++ '--queryformat=Package:%{name}' ++ ], ++ log_output=False ++ ) ++ output = output.rstrip() ++ lines = output.splitlines() ++ installed = [] ++ for line in lines: ++ if not line.startswith("Package:"): ++ continue ++ installed.append(line.replace("Package:", "")) ++ ++ return installed +diff --git a/pyanaconda/modules/payloads/payload/dnf/requirements.py b/pyanaconda/modules/payloads/payload/dnf/requirements.py +index ee1f517ce2..c5536a9698 100644 +--- a/pyanaconda/modules/payloads/payload/dnf/requirements.py ++++ b/pyanaconda/modules/payloads/payload/dnf/requirements.py +@@ -127,6 +127,27 @@ def collect_driver_disk_requirements(path="/run/install/dd_packages"): + return requirements + + ++def collect_oe_requirements(): ++ """Collect the requirements for oe ++ """ ++ requirements = [] ++ ++ # base packages ++ for pkg in ('base-files', 'base-passwd', 'shadow'): ++ requirements.append(Requirement.for_package( ++ pkg, ++ reason='base packages' ++ )) ++ # Support grub-mkconfig ++ for pkg in ('sed', 'coreutils'): ++ requirements.append(Requirement.for_package( ++ pkg, ++ reason='support grub-mkconfig' ++ )) ++ ++ return requirements ++ ++ + def apply_requirements(requirements, include_list, exclude_list): + """Apply the provided requirements. + +diff --git a/pyanaconda/modules/payloads/payload/dnf/transaction_progress.py b/pyanaconda/modules/payloads/payload/dnf/transaction_progress.py +index b277156819..f992debae1 100644 +--- a/pyanaconda/modules/payloads/payload/dnf/transaction_progress.py ++++ b/pyanaconda/modules/payloads/payload/dnf/transaction_progress.py +@@ -55,6 +55,9 @@ def process_transaction_progress(queue, callback): + break # Installation finished successfully + elif token == 'quit': + raise RuntimeError("The transaction process has ended abruptly: " + msg) ++ elif token == 'warn': ++ if msg.startswith("Error in POSTIN scriptlet in rpm package"): ++ callback(msg) + elif token == 'error': + raise PayloadInstallationError("An error occurred during the transaction: " + msg) + +@@ -140,7 +143,11 @@ class TransactionProgress(dnf.callback.TransactionProgress): + + :param message: a string that describes the error + """ +- self._queue.put(('error', message)) ++ token = "error" ++ if message.startswith("Error in POSTIN scriptlet in rpm package"): ++ token = "warn" ++ self._queue.put((token, message)) ++ log.info("error: %s" % message) - return repomd + def quit(self, message): + """Report the end of the transaction and close the queue. +diff --git a/pyanaconda/modules/payloads/payload/dnf/utils.py b/pyanaconda/modules/payloads/payload/dnf/utils.py +index 9e0c8805a9..032d1eac81 100644 +--- a/pyanaconda/modules/payloads/payload/dnf/utils.py ++++ b/pyanaconda/modules/payloads/payload/dnf/utils.py +@@ -111,18 +111,8 @@ def get_installation_specs(data: PackagesSelectionData, default_environment=None + exclude_list = [] + + # Handle the environment. +- if data.default_environment_enabled and default_environment: +- log.info("Selecting default environment '%s'.", default_environment) +- include_list.append("@{}".format(default_environment)) +- elif data.environment: +- include_list.append("@{}".format(data.environment)) + + # Handle the core group. +- if not data.core_group_enabled: +- log.info("Skipping @core group; system may not be complete.") +- exclude_list.append("@core") +- else: +- include_list.append("@core") + + # Handle groups. + for group_name in data.excluded_groups: +diff --git a/pyanaconda/modules/payloads/payload/dnf/validation.py b/pyanaconda/modules/payloads/payload/dnf/validation.py +index 49ce63f5af..6bc5541857 100644 +--- a/pyanaconda/modules/payloads/payload/dnf/validation.py ++++ b/pyanaconda/modules/payloads/payload/dnf/validation.py +@@ -17,6 +17,7 @@ + # + from contextlib import contextmanager + ++from pyanaconda.core import util + from pyanaconda.anaconda_loggers import get_module_logger + from pyanaconda.core.i18n import _ + from pyanaconda.modules.common.structures.packages import PackagesSelectionData +@@ -112,6 +113,17 @@ class CheckPackagesSelectionTask(ValidationTask): + self._selection, default_environment + ) + ++ env = None ++ if self._selection.environment: ++ env = self._selection.environment ++ elif default_environment: ++ env = default_environment ++ log.info("selected environment: %s", env) + ++ for pkg_name in self._apply_yocto_environment(env): ++ log.info("selected yocto package: '%s'", pkg_name) ++ include_list.append(pkg_name) + -+# For testing -+if __name__ == "__main__": -+ log.info("God bless us") + self._include_list.extend(include_list) + self._exclude_list.extend(exclude_list) + +@@ -159,3 +171,74 @@ class CheckPackagesSelectionTask(ValidationTask): + report.error_messages.append(str(e)) + except InvalidSelectionError as e: + report.error_messages.append(str(e)) + -+ from pykickstart.version import makeVersion ++ def _apply_yocto_environment(self, env): ++ if not env: ++ return [] + -+ # set up ksdata -+ from pyanaconda import kickstart -+ ksdata = kickstart.AnacondaKSHandler() ++ (image_name, description) = self._dnf_manager.environment_description(env) ++ log.info("image_name %s, des %s" % (image_name, description)) ++ image_id = image_name.split()[0] ++ (image_summary, image_description, package_install, ++ package_install_attemptonly, image_linguas) = self._dnf_manager.image[image_id] ++ log.info("package_install %s, attempt %s, linguas %s" % ++ (package_install, package_install_attemptonly, image_linguas)) + -+ ksdata.method.method = "cdrom" ++ # Language locale ++ self._select_yocto_linguas(image_linguas) + -+ from pyanaconda.storage.osinstall import InstallerStorage -+ storage = InstallerStorage() -+ storage.set_default_fstype("ext4") ++ # -dbg/-doc/-dev ++ for group in self._dnf_manager.tasks[env][2].split(): ++ self._select_yocto_group(group) + -+ _payload = DNFPayload(ksdata) ++ # Installing packages ++ return package_install.split() + -+ _payload.setup(storage) ++ def _select_yocto_group(self, group_id): ++ log.info("_select_yocto_group %s" % group_id) ++ if not group_id: ++ return [] + -+ # Keep setting up package-based repositories -+ # Download package metadata -+ try: -+ _payload.update_base_repo(fallback=False, checkmount=True) -+ except payload.PayloadError as e: -+ log.error("PayloadError: %s", e) -+ _payload.unsetup() -+ exit(0) ++ glob = self._yocto_complementary_glob(group_id) + -+ # Gather the group data -+ _payload.gather_repo_metadata() -+ _payload.release() -+ _payload.add_driver_repos() ++ # get all available languages in repos ++ available_packs = self._dnf_manager._base.sack.query().available().filter( ++ name__glob="*-%s" % glob) ++ allpkgnames = [p.name for p in available_packs] ++ log.info("allpkgnames %d" % len(allpkgnames)) ++ for pkgname in allpkgnames: ++ self._try_install_package(pkgname) + -+ log.info("baseRepo %s" % _payload.base_repo) ++ def _select_yocto_linguas(self, image_linguas): ++ lc_globs = [] ++ for ling in image_linguas.split(): ++ if ling not in lc_globs: ++ lc_globs.append(ling) + -+ _payload.pre_install() ++ baselang = ling.split('-')[0] ++ if ling != baselang and baselang not in lc_globs: ++ lc_globs.append(baselang) + -+ _payload.install() ++ log.info("lc_globs: %s" % lc_globs) ++ for lc_glob in lc_globs: ++ self._select_yocto_group("locale-%s" % lc_glob) + -+ _payload.post_install() ++ def _try_install_package(self, pkg_name): ++ try: ++ return self._dnf_manager._base.install(pkg_name, strict=False) ++ except dnf.exceptions.MarkingError: ++ msg = "Payload error - No such package: %s" % pkg_name ++ raise PayloadError(msg) ++ ++ def _yocto_complementary_glob(self, group): ++ complementary_glob = {} ++ complementary_glob['dev-pkgs'] = 'dev' ++ complementary_glob['staticdev-pkgs'] = 'staticdev' ++ complementary_glob['doc-pkgs'] = 'doc' ++ complementary_glob['dbg-pkgs'] = 'dbg' ++ complementary_glob['ptest-pkgs'] = 'ptest' ++ ++ if group in complementary_glob: ++ return complementary_glob[group] ++ ++ return group +diff --git a/pyanaconda/payload/dnf/payload.py b/pyanaconda/payload/dnf/payload.py +index 0d55a69fd2..2ad4ab7e2a 100644 +--- a/pyanaconda/payload/dnf/payload.py ++++ b/pyanaconda/payload/dnf/payload.py +@@ -101,8 +101,8 @@ class DNFPayload(MigratedDBusPayload): + set_source(self.proxy, source_proxy) + + else: +- log.debug("Use the DNF source from the Anaconda configuration file.") +- source_proxy = create_source(conf.payload.default_source) ++ log.debug("Use the DNF source from install disk.") ++ source_proxy = create_source(SOURCE_TYPE_CDROM) + set_source(self.proxy, source_proxy) + + @staticmethod -- -2.7.4 - +2.34.1 diff --git a/recipes-installer/anaconda/files/0009-dynamic-detect-workable-locale.patch b/recipes-installer/anaconda/files/0009-dynamic-detect-workable-locale.patch index c7d9a2e..9e97018 100644 --- a/recipes-installer/anaconda/files/0009-dynamic-detect-workable-locale.patch +++ b/recipes-installer/anaconda/files/0009-dynamic-detect-workable-locale.patch @@ -6,29 +6,38 @@ Subject: [PATCH] dynamic detect workable locale Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Refactor for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37 on 20221020. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/localization.py | 18 +++++++++++++++++- + pyanaconda/localization.py | 19 ++++++++++++++++++- pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py | 2 ++ pyanaconda/ui/tui/spokes/language_support.py | 5 +++-- - 3 files changed, 22 insertions(+), 3 deletions(-) + 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/pyanaconda/localization.py b/pyanaconda/localization.py -index 20908ef..18d4be9 100644 +index 2331fa5b15..7c7c085397 100644 --- a/pyanaconda/localization.py +++ b/pyanaconda/localization.py -@@ -27,7 +27,7 @@ import glob - from collections import namedtuple +@@ -27,7 +27,7 @@ from collections import namedtuple + import functools - from pyanaconda.core import constants, util --from pyanaconda.core.util import upcase_first_letter, setenv, execWithRedirect -+from pyanaconda.core.util import upcase_first_letter, setenv, execWithRedirect, execReadlines + from pyanaconda.core import constants +-from pyanaconda.core.util import setenv, execWithRedirect ++from pyanaconda.core.util import setenv, execWithRedirect, execReadlines + from pyanaconda.core.string import upcase_first_letter + from pyanaconda.modules.common.constants.services import BOSS - from pyanaconda.anaconda_loggers import get_module_logger - log = get_module_logger(__name__) -@@ -776,3 +776,19 @@ def strip_codeset_and_modifier(locale): - if '.' in locale: - locale = locale[:locale.find('.')] - return locale +@@ -667,3 +667,20 @@ def setup_locale_environment(locale=None, text_mode=False, prefer_environment=Fa + for varname in ("LANGUAGE", "LC_ALL", "LC_MESSAGES"): + if varname in os.environ: + del os.environ[varname] ++ + +_all_locales = [] +def list_all_locales(): @@ -36,33 +45,33 @@ index 20908ef..18d4be9 100644 + + if _all_locales == []: + for lang in execReadlines("locale", ["-a"]): -+ parts= parse_langcode(lang) -+ locales = langtable.list_locales(languageId=parts["language"], -+ territoryId=parts.get("territory", ""), -+ scriptId=parts.get("script", "")) ++ parts = langtable.parse_locale(lang) ++ locales = langtable.list_locales(languageId=parts.language, ++ territoryId=parts.territory, ++ scriptId=parts.script) + _all_locales += locales + + log.info("all locales: %s" % _all_locales) + + return _all_locales diff --git a/pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py b/pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py -index 6380c14..c4e361b 100644 +index def8113df4..4e2ec18123 100644 --- a/pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py +++ b/pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py -@@ -166,6 +166,8 @@ class LangLocaleHandler(object): - locales = localization.get_language_locales(lang) - locales = self._filter_locales(lang, locales) +@@ -168,6 +168,8 @@ class LangLocaleHandler(object, metaclass=ABCMeta): for locale in locales: + if self._only_existing_locales and not localization.locale_has_translation(locale): + continue + if locale not in localization.list_all_locales(): + continue self._add_locale(self._localeStore, localization.get_native_name(locale), locale) diff --git a/pyanaconda/ui/tui/spokes/language_support.py b/pyanaconda/ui/tui/spokes/language_support.py -index f4e8f48..9a48a78 100644 +index 59c3596508..a046238429 100644 --- a/pyanaconda/ui/tui/spokes/language_support.py +++ b/pyanaconda/ui/tui/spokes/language_support.py -@@ -97,8 +97,9 @@ class LangSpoke(FirstbootSpokeMixIn, NormalTUISpoke): +@@ -107,8 +107,9 @@ class LangSpoke(FirstbootSpokeMixIn, NormalTUISpoke): if args: self.window.add(TextWidget(_("Available locales"))) for locale in args: @@ -76,4 +85,3 @@ index f4e8f48..9a48a78 100644 for lang in self._langs: -- 2.7.4 - diff --git a/recipes-installer/anaconda/files/0010-reboot-unconditionally.patch b/recipes-installer/anaconda/files/0010-reboot-unconditionally.patch index dbbac27..89f631d 100644 --- a/recipes-installer/anaconda/files/0010-reboot-unconditionally.patch +++ b/recipes-installer/anaconda/files/0010-reboot-unconditionally.patch @@ -1,4 +1,4 @@ -From d01bdbad4c984b818d77d457cae3e2313475977d Mon Sep 17 00:00:00 2001 +From e60cfacef2ec8734ae15ca69f8ccbc94d5f3ffcc Mon Sep 17 00:00:00 2001 From: Hongxu Jia <hongxu.jia@windriver.com> Date: Sat, 29 Jun 2019 12:40:30 +0800 Subject: [PATCH] reboot unconditionally @@ -8,12 +8,13 @@ Whatever image install or live install, reboot unconditionally Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + --- pyanaconda/core/configuration/system.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyanaconda/core/configuration/system.py b/pyanaconda/core/configuration/system.py -index e35da57..7459e2e 100644 +index 5d99dc8b5..333e46bf8 100644 --- a/pyanaconda/core/configuration/system.py +++ b/pyanaconda/core/configuration/system.py @@ -66,7 +66,7 @@ class SystemSection(Section): @@ -24,7 +25,4 @@ index e35da57..7459e2e 100644 + return True @property - def can_switch_tty(self): --- -2.7.4 - + def can_start_user_systemd(self): diff --git a/recipes-installer/anaconda/files/0011-disable-audit.patch b/recipes-installer/anaconda/files/0011-disable-audit.patch deleted file mode 100644 index dceed78..0000000 --- a/recipes-installer/anaconda/files/0011-disable-audit.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 078ddfd93bbcb6e74b1c493615561d56e46bc2da Mon Sep 17 00:00:00 2001 -From: Hongxu Jia <hongxu.jia@windriver.com> -Date: Tue, 25 Jun 2019 11:23:05 +0800 -Subject: [PATCH] disable audit - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> ---- - configure.ac | 3 --- - pyanaconda/core/configuration/system.py | 2 +- - pyanaconda/isys/Makefile.am | 6 ------ - 3 files changed, 1 insertion(+), 10 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 2321b62..dd1ad59 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -77,9 +77,6 @@ AC_CHECK_FUNCS([getcwd memset mkdir strchr strdup], - [], - [ANACONDA_SOFT_FAILURE([Function $ac_func not found.])]) - --AC_CHECK_LIB([audit], [audit_open], [:], -- [ANACONDA_SOFT_FAILURE([libaudit not found])]) -- - AM_PATH_PYTHON(python_required_version) - - # Check for the python extension paths -diff --git a/pyanaconda/core/configuration/system.py b/pyanaconda/core/configuration/system.py -index 77fae1f..e35da57 100644 ---- a/pyanaconda/core/configuration/system.py -+++ b/pyanaconda/core/configuration/system.py -@@ -76,7 +76,7 @@ class SystemSection(Section): - @property - def can_audit(self): - """Can we run the audit daemon?""" -- return self._is_boot_iso -+ return False - - @property - def can_set_hardware_clock(self): -diff --git a/pyanaconda/isys/Makefile.am b/pyanaconda/isys/Makefile.am -index 3318eb8..227deda 100644 ---- a/pyanaconda/isys/Makefile.am -+++ b/pyanaconda/isys/Makefile.am -@@ -28,10 +28,4 @@ _isys_la_LDFLAGS = -module -avoid-version - _isys_la_LIBADD = $(PYTHON3_LIBS) - _isys_la_SOURCES = isys.c - --auditddir = $(libexecdir)/$(PACKAGE_NAME) --auditd_PROGRAMS = auditd --auditd_SOURCES = auditd.c --auditd_CFLAGS = $(SELINUX_CFLAGS) --auditd_LDFLAGS = -laudit -- - MAINTAINERCLEANFILES = Makefile.in --- -2.7.4 - diff --git a/recipes-installer/anaconda/files/0012-bootloader.py-Change-grub2-settings-to-match-oe-core.patch b/recipes-installer/anaconda/files/0012-bootloader.py-Change-grub2-settings-to-match-oe-core.patch index 41bd89c..26f062b 100644 --- a/recipes-installer/anaconda/files/0012-bootloader.py-Change-grub2-settings-to-match-oe-core.patch +++ b/recipes-installer/anaconda/files/0012-bootloader.py-Change-grub2-settings-to-match-oe-core.patch @@ -14,20 +14,32 @@ Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Upstream-Status: Inappropriate [oe specific] Rebase to f30-release Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Set GRUB_DISTRIBUTOR with target system rather than installer image. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37 on 20221020. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/bootloader/base.py | 4 ++++ - pyanaconda/bootloader/grub2.py | 26 +++++++++++++++++--------- - pyanaconda/bootloader/installation.py | 3 +++ - 3 files changed, 24 insertions(+), 9 deletions(-) + pyanaconda/modules/storage/bootloader/base.py | 4 +++ + pyanaconda/modules/storage/bootloader/grub2.py | 40 ++++++++++++++++++++------ + pyanaconda/modules/storage/bootloader/utils.py | 7 +++-- + 3 files changed, 40 insertions(+), 11 deletions(-) -diff --git a/pyanaconda/bootloader/base.py b/pyanaconda/bootloader/base.py -index 447dd05..0550745 100644 ---- a/pyanaconda/bootloader/base.py -+++ b/pyanaconda/bootloader/base.py -@@ -869,6 +869,10 @@ class BootLoader(object): +diff --git a/pyanaconda/modules/storage/bootloader/base.py b/pyanaconda/modules/storage/bootloader/base.py +index da8272b7f3..fb9c588846 100644 +--- a/pyanaconda/modules/storage/bootloader/base.py ++++ b/pyanaconda/modules/storage/bootloader/base.py +@@ -996,6 +996,10 @@ class BootLoader(object): raise BootLoaderError("no config file defined for this boot loader") - config_path = os.path.normpath(util.getSysroot() + self.config_file) + config_path = os.path.normpath(conf.target.system_root + self.config_file) + config_dir = os.path.dirname(config_path) + if not os.path.isdir(config_dir): + os.mkdir(config_dir, 755) @@ -35,11 +47,11 @@ index 447dd05..0550745 100644 if os.access(config_path, os.R_OK): os.rename(config_path, config_path + ".anacbak") -diff --git a/pyanaconda/bootloader/grub2.py b/pyanaconda/bootloader/grub2.py -index 600d2c0..352ad72 100644 ---- a/pyanaconda/bootloader/grub2.py -+++ b/pyanaconda/bootloader/grub2.py -@@ -98,9 +98,9 @@ class GRUB2(BootLoader): +diff --git a/pyanaconda/modules/storage/bootloader/grub2.py b/pyanaconda/modules/storage/bootloader/grub2.py +index 74249a9507..2163a19e9d 100644 +--- a/pyanaconda/modules/storage/bootloader/grub2.py ++++ b/pyanaconda/modules/storage/bootloader/grub2.py +@@ -101,9 +101,9 @@ class GRUB2(BootLoader): 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} @@ -51,10 +63,10 @@ index 600d2c0..352ad72 100644 _passwd_file = "user.cfg" defaults_file = "/etc/default/grub" terminal_type = "console" -@@ -226,6 +226,10 @@ class GRUB2(BootLoader): +@@ -227,6 +227,10 @@ class GRUB2(BootLoader): def write_device_map(self): """Write out a device map containing all supported devices.""" - map_path = os.path.normpath(util.getSysroot() + self.device_map_file) + map_path = os.path.normpath(conf.target.system_root + self.device_map_file) + map_dir = os.path.dirname(map_path) + if not os.path.isdir(map_dir): + os.mkdir(map_dir, 755) @@ -62,86 +74,112 @@ index 600d2c0..352ad72 100644 if os.access(map_path, os.R_OK): os.rename(map_path, map_path + ".anacbak") -@@ -253,9 +257,9 @@ class GRUB2(BootLoader): - defaults_file = "%s%s" % (util.getSysroot(), self.defaults_file) +@@ -254,9 +258,23 @@ class GRUB2(BootLoader): + defaults_file = "%s%s" % (conf.target.system_root, self.defaults_file) defaults = open(defaults_file, "w+") defaults.write("GRUB_TIMEOUT=%d\n" % self.timeout) - defaults.write("GRUB_DISTRIBUTOR=\"$(sed 's, release .*$,,g' /etc/system-release)\"\n") -+ defaults.write("GRUB_DISTRIBUTOR=\"%s\"\n" % productName) ++ ++ targetProductName = '' ++ try: ++ with open(conf.target.system_root + '/etc/issue') as f: ++ for line in f: ++ strippedline = line.strip().replace(r' \n \l', '') ++ if strippedline: ++ targetProductName = strippedline ++ break ++ except FileNotFoundError: ++ pass ++ ++ defaults.write("GRUB_DISTRIBUTOR=\"%s\"\n" % targetProductName ++ if targetProductName else productName) ++ defaults.write("GRUB_DEFAULT=saved\n") - defaults.write("GRUB_DISABLE_SUBMENU=true\n") + defaults.write("GRUB_DISABLE_SUBMENU=y\n") if self.console and self.has_serial_console: defaults.write("GRUB_TERMINAL=\"serial console\"\n") defaults.write("GRUB_SERIAL_COMMAND=\"%s\"\n" % self.serial_command) -@@ -290,7 +294,7 @@ class GRUB2(BootLoader): +@@ -298,7 +316,7 @@ class GRUB2(BootLoader): passwords = "%s\n%s\n" % (self.password, self.password) os.write(pwrite, passwords.encode("utf-8")) os.close(pwrite) - buf = util.execWithCapture("grub2-mkpasswd-pbkdf2", [], + buf = util.execWithCapture("grub-mkpasswd-pbkdf2", [], stdin=pread, - root=util.getSysroot()) + root=conf.target.system_root) os.close(pread) -@@ -303,6 +307,10 @@ class GRUB2(BootLoader): +@@ -311,6 +329,10 @@ class GRUB2(BootLoader): return - users_file = "%s%s/%s" % (util.getSysroot(), self.config_dir, self._passwd_file) + users_file = "%s%s/%s" % (conf.target.system_root, self.config_dir, self._passwd_file) + users_dir = os.path.dirname(users_file) + if not os.path.isdir(users_dir): + os.mkdir(users_dir, 755) + - header = util.open_with_perm(users_file, "w", 0o700) + header = open_with_perm(users_file, "w", 0o600) # XXX FIXME: document somewhere that the username is "root" self._encrypt_password() -@@ -336,21 +344,21 @@ class GRUB2(BootLoader): - machine_id = fd.readline().strip() +@@ -345,7 +367,7 @@ class GRUB2(BootLoader): default_entry = "%s-%s" % (machine_id, self.default.version) -- rc = util.execInSysroot("grub2-set-default", [default_entry]) -+ rc = util.execInSysroot("grub-set-default", [default_entry]) - if rc: - log.error("failed to set default menu entry to %s", productName) - - # set menu_auto_hide grubenv variable if we should enable menu_auto_hide + rc = util.execWithRedirect( +- "grub2-set-default", ++ "grub-set-default", + [default_entry], + root=conf.target.system_root + ) +@@ -356,7 +378,7 @@ class GRUB2(BootLoader): # set boot_success so that the menu is hidden on the boot after install if conf.bootloader.menu_auto_hide: -- rc = util.execInSysroot("grub2-editenv", -+ rc = util.execInSysroot("grub-editenv", - ["-", "set", "menu_auto_hide=1", - "boot_success=1"]) - if rc: - log.error("failed to set menu_auto_hide=1") + rc = util.execWithRedirect( +- "grub2-editenv", ++ "grub-editenv", + ["-", "set", "menu_auto_hide=1", "boot_success=1"], + root=conf.target.system_root + ) +@@ -365,7 +387,7 @@ class GRUB2(BootLoader): # now tell grub2 to generate the main configuration file -- rc = util.execInSysroot("grub2-mkconfig", -+ rc = util.execInSysroot("grub-mkconfig", - ["-o", self.config_file]) - if rc: - raise BootLoaderError("failed to write boot loader configuration") -@@ -420,7 +428,7 @@ class GRUB2(BootLoader): + rc = util.execWithRedirect( +- "grub2-mkconfig", ++ "grub-mkconfig", + ["-o", self.config_file], + root=conf.target.system_root + ) +@@ -425,7 +447,7 @@ class GRUB2(BootLoader): else: log.info("bootloader.py: mbr will be updated for grub2") - rc = util.execWithRedirect("grub2-install", grub_args, + rc = util.execWithRedirect("grub-install", grub_args, - root=util.getSysroot(), + root=conf.target.system_root, env_prune=['MALLOC_PERTURB_']) if rc: -diff --git a/pyanaconda/bootloader/installation.py b/pyanaconda/bootloader/installation.py -index 71b18b2..8f6d999 100644 ---- a/pyanaconda/bootloader/installation.py -+++ b/pyanaconda/bootloader/installation.py -@@ -154,6 +154,9 @@ def _write_sysconfig_kernel(sysroot, storage): +diff --git a/pyanaconda/modules/storage/bootloader/utils.py b/pyanaconda/modules/storage/bootloader/utils.py +index 27fc2a0058..d55db37f7c 100644 +--- a/pyanaconda/modules/storage/bootloader/utils.py ++++ b/pyanaconda/modules/storage/bootloader/utils.py +@@ -180,6 +180,9 @@ def _write_sysconfig_kernel(sysroot, storage): - kernel = h.name.decode() + kernel = h.name -+ if not os.path.isdir(util.getSysroot() + "/etc/sysconfig"): -+ os.mkdir(util.getSysroot() + "/etc/sysconfig", 755) ++ if not os.path.isdir(conf.target.system_root + "/etc/sysconfig"): ++ os.mkdir(conf.target.system_root + "/etc/sysconfig", 755) + f = open(sysroot + "/etc/sysconfig/kernel", "w+") - f.write("# UPDATEDEFAULT specifies if new-kernel-pkg should make\n" + f.write("# UPDATEDEFAULT specifies if kernel-install should make\n" "# new kernels the default\n") +@@ -245,8 +248,8 @@ def create_bls_entries(sysroot, storage, kernel_versions): + # entries will have the correct kernel cmdline and not the value + # taken from /proc/cmdline, that is used to boot the live image. + rc = execWithRedirect( +- "grub2-mkconfig", +- ["-o", "/etc/grub2.cfg"], ++ "grub-mkconfig", ++ ["-o", "/etc/grub.cfg"], + root=sysroot + ) + -- 2.7.4 - diff --git a/recipes-installer/anaconda/files/0013-tweak-detect-kernel-version.patch b/recipes-installer/anaconda/files/0013-tweak-detect-kernel-version.patch index 119dc69..cc0e71f 100644 --- a/recipes-installer/anaconda/files/0013-tweak-detect-kernel-version.patch +++ b/recipes-installer/anaconda/files/0013-tweak-detect-kernel-version.patch @@ -9,16 +9,43 @@ rather than using redhat's. Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/bootloader/installation.py | 21 +++++++++++++-------- - pyanaconda/payload/livepayload.py | 12 +++++++++--- + .../modules/payloads/payload/live_os/utils.py | 12 +++++++++--- + pyanaconda/modules/storage/bootloader/utils.py | 21 +++++++++++++-------- 2 files changed, 22 insertions(+), 11 deletions(-) -diff --git a/pyanaconda/bootloader/installation.py b/pyanaconda/bootloader/installation.py -index 8f6d999..b620ab3 100644 ---- a/pyanaconda/bootloader/installation.py -+++ b/pyanaconda/bootloader/installation.py -@@ -129,14 +129,19 @@ def _write_sysconfig_kernel(sysroot, storage): +diff --git a/pyanaconda/modules/payloads/payload/live_os/utils.py b/pyanaconda/modules/payloads/payload/live_os/utils.py +index 9d1223801..33518723e 100644 +--- a/pyanaconda/modules/payloads/payload/live_os/utils.py ++++ b/pyanaconda/modules/payloads/payload/live_os/utils.py +@@ -31,9 +31,15 @@ def get_kernel_version_list(root_path): + :param root_path: a path to the system root + :return: a list of kernel versions + """ +- efi_dir = conf.bootloader.efi_dir +- files = glob.glob(root_path + "/boot/vmlinuz-*") +- files.extend(glob.glob(root_path + "/boot/efi/EFI/{}/vmlinuz-*".format(efi_dir))) ++ for kernel in ["vmlinux", "bzImage"]: ++ files = glob.glob(root_path + "/boot/%s-*" % kernel) ++ files.extend(glob.glob(root_path + "/boot/efi/EFI/%s/%s-*" % ++ (conf.bootloader.efi_dir, kernel))) ++ ++ versions = sorted((f.split("/")[-1][8:] for f in files if os.path.isfile(f))) ++ if versions: ++ log.info("kernel versions: %s", versions) ++ break + + kernel_version_list = [ + f.split("/")[-1][8:] for f in files +diff --git a/pyanaconda/modules/storage/bootloader/utils.py b/pyanaconda/modules/storage/bootloader/utils.py +index ec4239ecc..2fdf8b921 100644 +--- a/pyanaconda/modules/storage/bootloader/utils.py ++++ b/pyanaconda/modules/storage/bootloader/utils.py +@@ -155,14 +155,19 @@ def _write_sysconfig_kernel(sysroot, storage): log.debug("Writing to /etc/sysconfig/kernel.") # get the name of the default kernel package based on the version @@ -46,29 +73,6 @@ index 8f6d999..b620ab3 100644 try: import rpm -diff --git a/pyanaconda/payload/livepayload.py b/pyanaconda/payload/livepayload.py -index aaafa20..235a3b5 100644 ---- a/pyanaconda/payload/livepayload.py -+++ b/pyanaconda/payload/livepayload.py -@@ -211,9 +211,15 @@ class LiveImagePayload(Payload): - return Size(util.getDirSize("/") * 1024) - - def _update_kernel_version_list(self): -- files = glob.glob(INSTALL_TREE + "/boot/vmlinuz-*") -- files.extend(glob.glob(INSTALL_TREE + "/boot/efi/EFI/%s/vmlinuz-*" % -- conf.bootloader.efi_dir)) -+ for kernel in ["vmlinux", "bzImage"]: -+ files = glob.glob(INSTALL_TREE + "/boot/%s-*" % kernel) -+ files.extend(glob.glob(INSTALL_TREE + "/boot/efi/EFI/%s/%s-*" % -+ (conf.bootloader.efi_dir, kernel))) -+ -+ versions = sorted((f.split("/")[-1][8:] for f in files if os.path.isfile(f))) -+ if versions: -+ log.info("kernel versions: %s", versions) -+ break - - self._kernel_version_list = sorted((f.split("/")[-1][8:] for f in files - if os.path.isfile(f) and "-rescue-" not in f), -- 2.7.4 diff --git a/recipes-installer/anaconda/files/0016-kickstart-not-support-Authselect-Firewall-Firstboot.patch b/recipes-installer/anaconda/files/0016-kickstart-not-support-Authselect-Firewall-Firstboot.patch index f2a110a..6f5b788 100644 --- a/recipes-installer/anaconda/files/0016-kickstart-not-support-Authselect-Firewall-Firstboot.patch +++ b/recipes-installer/anaconda/files/0016-kickstart-not-support-Authselect-Firewall-Firstboot.patch @@ -8,70 +8,80 @@ We do not support kickstart for now Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Refactor for version anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/installation.py | 8 -------- - pyanaconda/kickstart.py | 5 ----- - 2 files changed, 13 deletions(-) + anaconda.py | 2 +- + pyanaconda/installation.py | 6 +++--- + pyanaconda/kickstart.py | 5 +++++ + 3 files changed, 9 insertions(+), 4 deletions(-) +diff --git a/anaconda.py b/anaconda.py +index faaef9c3bc..2b3b42d19a 100755 +--- a/anaconda.py ++++ b/anaconda.py +@@ -414,7 +414,7 @@ if __name__ == "__main__": + anaconda.payload.set_from_opts(opts) + + # Initialize the security configuration. +- startup_utils.initialize_security() ++ #startup_utils.initialize_security() + + # Set the language before loading an interface, when it may be too late. + startup_utils.initialize_locale(opts, text_mode=anaconda.tui_mode) diff --git a/pyanaconda/installation.py b/pyanaconda/installation.py -index da5b4e2..9eb40b3 100644 +index 8a01847004..b98425e3cc 100644 --- a/pyanaconda/installation.py +++ b/pyanaconda/installation.py -@@ -93,14 +93,10 @@ def doConfiguration(storage, payload, ksdata): +@@ -121,7 +121,7 @@ class RunInstallationTask(InstallationTask): + ) - # schedule the execute methods of ksdata that require an installed system to be present - os_config = TaskQueue("Installed system configuration", N_("Configuring installed system")) -- os_config.append(Task("Configure authselect", ksdata.authselect.execute)) -- os_config.append(Task("Configure SELinux", ksdata.selinux.execute)) -- os_config.append(Task("Configure first boot tasks", ksdata.firstboot.execute)) - os_config.append(Task("Configure services", ksdata.services.execute)) - os_config.append(Task("Configure keyboard", ksdata.keyboard.execute)) - os_config.append(Task("Configure timezone", ksdata.timezone.execute)) - os_config.append(Task("Configure language", ksdata.lang.execute)) -- os_config.append(Task("Configure firewall", ksdata.firewall.execute)) - os_config.append(Task("Configure X", ksdata.xconfig.execute)) - configuration_queue.append(os_config) + # add installation tasks for the Security DBus module +- if is_module_available(SECURITY): ++ if False: + security_proxy = SECURITY.get_proxy() + security_dbus_tasks = security_proxy.InstallWithTasks() + os_config.append_dbus_tasks(SECURITY, security_dbus_tasks) +@@ -146,7 +146,7 @@ class RunInstallationTask(InstallationTask): + os_config.append_dbus_tasks(LOCALIZATION, localization_dbus_tasks) -@@ -304,8 +300,6 @@ def doInstall(storage, payload, ksdata): + # add the Firewall configuration task +- if conf.target.can_configure_network: ++ if False: + firewall_proxy = NETWORK.get_proxy(FIREWALL) + firewall_dbus_task = firewall_proxy.InstallWithTask() + os_config.append_dbus_tasks(NETWORK, [firewall_dbus_task]) +@@ -213,7 +213,7 @@ class RunInstallationTask(InstallationTask): + )) + configuration_queue.append(generate_initramfs) - # Check for other possibly needed additional packages. - pre_install = TaskQueue("Pre install tasks", N_("Running pre-installation tasks")) -- pre_install.append(Task("Setup authselect", ksdata.authselect.setup)) -- pre_install.append(Task("Setup firewall", ksdata.firewall.setup)) - pre_install.append(Task("Setup network", ksdata.network.setup)) - # Setup timezone and add chrony as package if timezone was set in KS - # and "-chrony" wasn't in packages section and/or --nontp wasn't set. -@@ -324,8 +318,6 @@ def doInstall(storage, payload, ksdata): - # to finish setting up the system. - payload.requirements.add_packages(storage.packages, reason="storage") - payload.requirements.add_packages(ksdata.realm.packages, reason="realm") -- payload.requirements.add_packages(ksdata.authselect.packages, reason="authselect") -- payload.requirements.add_packages(ksdata.firewall.packages, reason="firewall") - payload.requirements.add_packages(ksdata.network.packages, reason="network") - payload.requirements.add_packages(ksdata.timezone.packages, reason="ntp", strong=False) +- if is_module_available(SECURITY): ++ if False: + security_proxy = SECURITY.get_proxy() + # Configure FIPS. diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py -index 07c3c53..88d552d 100644 +index daf5ffdc04..9a6f32f777 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py -@@ -983,17 +983,12 @@ class AnacondaSection(Section): - # This is just the latest entry from pykickstart.handlers.control with all the - # classes we're overriding in place of the defaults. - commandMap = { -- "auth": UselessCommand, -- "authconfig": UselessCommand, -- "authselect": Authselect, - "autopart": AutoPart, - "btrfs": BTRFS, - "bootloader": UselessCommand, - "clearpart": ClearPart, - "eula": Eula, - "fcoe": UselessCommand, -- "firewall": Firewall, -- "firstboot": Firstboot, - "group": Group, - "ignoredisk": UselessCommand, - "iscsi": Iscsi, +@@ -259,6 +259,11 @@ class AnacondaKickstartSpecification(KickstartSpecification): + command_map = dict(cls.commands) + + for name, command in handler.commandMap.items(): ++ # Skip unsupported commands ++ if name in ('auth', 'authconfig', 'authselect', 'firewall', ++ 'firstboot'): ++ continue ++ + # Ignore removed commands. + if issubclass(command, RemovedCommand): + continue -- 2.7.4 diff --git a/recipes-installer/anaconda/files/0019-support-UEFI-boot.patch b/recipes-installer/anaconda/files/0019-support-UEFI-boot.patch index 1a14fa6..e10ec6f 100644 --- a/recipes-installer/anaconda/files/0019-support-UEFI-boot.patch +++ b/recipes-installer/anaconda/files/0019-support-UEFI-boot.patch @@ -10,49 +10,55 @@ Subject: [PATCH] support UEFI boot Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Refactor for anaconda 34. Function config_file() is removed since it is +not used. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + + +Rebased for fedora 39 on 20240403. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + --- - pyanaconda/bootloader/efi.py | 17 +++++++++++------ - 1 file changed, 11 insertions(+), 6 deletions(-) + pyanaconda/modules/storage/bootloader/efi.py | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) -diff --git a/pyanaconda/bootloader/efi.py b/pyanaconda/bootloader/efi.py -index 0f4131f..377eb10 100644 ---- a/pyanaconda/bootloader/efi.py -+++ b/pyanaconda/bootloader/efi.py -@@ -36,7 +36,12 @@ class EFIBase(object): +diff --git a/pyanaconda/modules/storage/bootloader/efi.py b/pyanaconda/modules/storage/bootloader/efi.py +index d4c0fb60e8..707d729d2c 100644 +--- a/pyanaconda/modules/storage/bootloader/efi.py ++++ b/pyanaconda/modules/storage/bootloader/efi.py +@@ -43,7 +43,7 @@ class EFIBase(object): @property - def _config_dir(self): + def _efi_config_dir(self): - return "efi/EFI/{}".format(conf.bootloader.efi_dir) + return "efi/EFI/BOOT" -+ -+ @property -+ def config_file(self): -+ """ Full path to configuration file. """ -+ return "%s/grub/%s" % (self.config_dir, self._config_file) - def efibootmgr(self, *args, **kwargs): - if not conf.target.is_hardware: -@@ -132,8 +137,8 @@ class EFIBase(object): + def get_fw_platform_size(self): + try: +@@ -146,8 +146,8 @@ class EFIBase(object): class EFIGRUB(EFIBase, GRUB2): """EFI GRUBv2""" - _packages32 = [ "grub2-efi-ia32", "shim-ia32" ] -- _packages_common = [ "efibootmgr", "grub2-tools" ] +- _packages_common = ["efibootmgr", "grub2-tools", "grub2-tools-extra", "grubby" ] + _packages32 = [ "grub-efi" ] + _packages_common = [ "efibootmgr" ] - can_dual_boot = False stage2_is_valid_stage1 = False stage2_bootable = False -@@ -142,7 +147,7 @@ class EFIGRUB(EFIBase, GRUB2): + +@@ -155,7 +155,7 @@ class EFIGRUB(EFIBase, GRUB2): def __init__(self): super().__init__() - self._packages64 = [ "grub2-efi-x64", "shim-x64" ] + self._packages64 = [ "grub-efi" ] - try: - f = open("/sys/firmware/efi/fw_platform_size", "r") -@@ -157,8 +162,8 @@ class EFIGRUB(EFIBase, GRUB2): + if self.get_fw_platform_size() == '32': + self._is_32bit_firmware = True +@@ -163,8 +163,8 @@ class EFIGRUB(EFIBase, GRUB2): @property def _efi_binary(self): if self._is_32bit_firmware: @@ -63,6 +69,15 @@ index 0f4131f..377eb10 100644 @property def packages(self): +@@ -190,7 +190,7 @@ class EFIGRUB(EFIBase, GRUB2): + if fs_uuid is None: + raise BootLoaderError("Could not get stage2 filesystem UUID") + +- grub_dir = util.execWithCapture("grub2-mkrelpath", [grub_dir], ++ grub_dir = util.execWithCapture("grub-mkrelpath", [grub_dir], + root=conf.target.system_root) + if not grub_dir: + raise BootLoaderError("Could not get GRUB directory path") -- 2.7.4 diff --git a/recipes-installer/anaconda/files/0022-fix-quoted-empty-string-failed.patch b/recipes-installer/anaconda/files/0022-fix-quoted-empty-string-failed.patch index a70a1fd..f6a8400 100644 --- a/recipes-installer/anaconda/files/0022-fix-quoted-empty-string-failed.patch +++ b/recipes-installer/anaconda/files/0022-fix-quoted-empty-string-failed.patch @@ -16,15 +16,19 @@ line 823, in parse_components Upstream-Status: Pending Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/core/util.py | 10 +++++++--- + pyanaconda/core/payload.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) -diff --git a/pyanaconda/core/util.py b/pyanaconda/core/util.py -index 90340d9..df94f17 100644 ---- a/pyanaconda/core/util.py -+++ b/pyanaconda/core/util.py -@@ -832,9 +832,13 @@ class ProxyString(object): +diff --git a/pyanaconda/core/payload.py b/pyanaconda/core/payload.py +index 3573c6cd9..645222e82 100644 +--- a/pyanaconda/core/payload.py ++++ b/pyanaconda/core/payload.py +@@ -172,9 +172,13 @@ class ProxyString(object): def parse_components(self): """ Parse the components of a proxy url into url and noauth_url """ diff --git a/recipes-installer/anaconda/files/0025-tweak-bootloader-fs-type.patch b/recipes-installer/anaconda/files/0025-tweak-bootloader-fs-type.patch index 278cf70..7de4d50 100644 --- a/recipes-installer/anaconda/files/0025-tweak-bootloader-fs-type.patch +++ b/recipes-installer/anaconda/files/0025-tweak-bootloader-fs-type.patch @@ -9,14 +9,18 @@ failure while e2fsprogs upgraded to 1.43 Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/bootloader/grub2.py | 2 +- + pyanaconda/modules/storage/bootloader/grub2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/pyanaconda/bootloader/grub2.py b/pyanaconda/bootloader/grub2.py -index 352ad72..80b026a 100644 ---- a/pyanaconda/bootloader/grub2.py -+++ b/pyanaconda/bootloader/grub2.py +diff --git a/pyanaconda/modules/storage/bootloader/grub2.py b/pyanaconda/modules/storage/bootloader/grub2.py +index 47a3a6d55..46c03af68 100644 +--- a/pyanaconda/modules/storage/bootloader/grub2.py ++++ b/pyanaconda/modules/storage/bootloader/grub2.py @@ -186,7 +186,7 @@ class GRUB2(BootLoader): if productName.startswith("Red Hat "): # pylint: disable=no-member return ["xfs", "ext4", "ext3", "ext2"] diff --git a/recipes-installer/anaconda/files/0026-support-timezone-setting.patch b/recipes-installer/anaconda/files/0026-support-timezone-setting.patch index 4d3860a..135d4b3 100644 --- a/recipes-installer/anaconda/files/0026-support-timezone-setting.patch +++ b/recipes-installer/anaconda/files/0026-support-timezone-setting.patch @@ -12,64 +12,72 @@ Subject: [PATCH 26/65] support timezone setting Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37: +* replace pyanaconda.core.util.mkdirChain with pyanaconda.core.path.make_directories + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/timezone.py | 29 +++++++---------------------- - 1 file changed, 7 insertions(+), 22 deletions(-) + pyanaconda/modules/timezone/installation.py | 26 ++++++++------------------ + 1 file changed, 8 insertions(+), 18 deletions(-) -diff --git a/pyanaconda/timezone.py b/pyanaconda/timezone.py -index 6f074ae..40d0f89 100644 ---- a/pyanaconda/timezone.py -+++ b/pyanaconda/timezone.py -@@ -23,6 +23,7 @@ configuration, valid timezones recognition etc. - """ - +diff --git a/pyanaconda/modules/timezone/installation.py b/pyanaconda/modules/timezone/installation.py +index 0cd75106c7..600c3407de 100644 +--- a/pyanaconda/modules/timezone/installation.py ++++ b/pyanaconda/modules/timezone/installation.py +@@ -17,9 +17,10 @@ + # import os + import os.path +import shutil - import pytz - import langtable - from collections import OrderedDict -@@ -101,6 +102,9 @@ def write_timezone_config(timezone_proxy, root): - rooted_tz_file = os.path.normpath(root + tz_file) - relative_path = os.path.normpath("../" + tz_file) - link_path = os.path.normpath(root + "/etc/localtime") -+ if not os.access(rooted_tz_file, os.R_OK) and os.access(tz_file, os.R_OK): -+ util.mkdirChain(os.path.dirname(rooted_tz_file)) -+ shutil.copyfile(tz_file, rooted_tz_file) - if not os.access(rooted_tz_file, os.R_OK): - log.error("Timezone to be linked (%s) doesn't exist", rooted_tz_file) -@@ -117,28 +121,9 @@ def write_timezone_config(timezone_proxy, root): - log.error("Error when symlinking timezone (from %s): %s", - rooted_tz_file, oserr.strerror) + from pyanaconda import ntp +-from pyanaconda.core import service, util ++from pyanaconda.core import service, util, path + from pyanaconda.core.configuration.anaconda import conf + from pyanaconda.timezone import NTP_SERVICE + from pyanaconda.anaconda_loggers import get_module_logger +@@ -107,6 +108,9 @@ class ConfigureTimezoneTask(Task): + rooted_tz_file = os.path.normpath(self._sysroot + tz_file) + relative_path = os.path.normpath("../" + tz_file) + link_path = os.path.normpath(self._sysroot + "/etc/localtime") ++ if not os.access(rooted_tz_file, os.R_OK) and os.access(tz_file, os.R_OK): ++ path.make_directories(os.path.dirname(rooted_tz_file)) ++ shutil.copyfile(tz_file, rooted_tz_file) -- if arch.is_s390(): -- # there is no HW clock on s390(x) -- return -- -- try: -- fobj = open(os.path.normpath(root + "/etc/adjtime"), "r") -- lines = fobj.readlines() -- fobj.close() -- except IOError: -- lines = ["0.0 0 0.0\n", "0\n"] + if not os.access(rooted_tz_file, os.R_OK): + log.error("Timezone to be linked (%s) doesn't exist", rooted_tz_file) +@@ -133,23 +137,9 @@ class ConfigureTimezoneTask(Task): + # there is no Hardware clock on s390(x) + return + +- try: +- with open(os.path.normpath(self._sysroot + "/etc/adjtime"), "r") as fobj: +- lines = fobj.readlines() +- except OSError: +- lines = ["0.0 0 0.0\n", "0\n"] - -- try: -- with open(os.path.normpath(root + "/etc/adjtime"), "w") as fobj: -- fobj.write(lines[0]) -- fobj.write(lines[1]) -- if timezone_proxy.IsUTC: -- fobj.write("UTC\n") -- else: -- fobj.write("LOCAL\n") -- except IOError as ioerr: -- msg = "Error while writing /etc/adjtime file: %s" % ioerr.strerror -- raise TimezoneConfigError(msg) -+ log.info("timezone %s" % timezone_proxy.Timezone) -+ with open(root + "/etc/timezone", "w") as fobj: -+ fobj.write('%s\n' % timezone_proxy.Timezone) +- try: +- with open(os.path.normpath(self._sysroot + "/etc/adjtime"), "w") as fobj: +- fobj.write(lines[0]) +- fobj.write(lines[1]) +- if self._is_utc: +- fobj.write("UTC\n") +- else: +- fobj.write("LOCAL\n") +- except OSError as e: +- msg = "Error while writing /etc/adjtime file: {}".format(e.strerror) +- raise TimezoneConfigurationError(msg) from e ++ log.info("timezone %s" % self._timezone) ++ with open(self._sysroot + "/etc/timezone", "w") as fobj: ++ fobj.write('%s\n' % self._timezone) + - def save_hw_clock(timezone_proxy=None): - """ + class ConfigureNTPTask(Task): -- 2.7.4 diff --git a/recipes-installer/anaconda/files/0027-disable-ntp-support.patch b/recipes-installer/anaconda/files/0027-disable-ntp-support.patch deleted file mode 100644 index 977c220..0000000 --- a/recipes-installer/anaconda/files/0027-disable-ntp-support.patch +++ /dev/null @@ -1,310 +0,0 @@ -From 0fad2179c0b760157abcf2ae5ceca7c8f396fadd Mon Sep 17 00:00:00 2001 -From: Hongxu Jia <hongxu.jia@windriver.com> -Date: Sat, 29 Jun 2019 12:13:28 +0800 -Subject: [PATCH] disable ntp support - -The upstream RHEL7 use chrony.service to support ntp, -it did not exist in oe-core, so remove it. - -Do not support NTP, here are the reasons: -- For systemd based, it already had NTP supported, - another ntp will cause confliction. - -- We also need to consider the situation of sysvinit - based system, it requires a ntp package to be - installed. - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> ---- - pyanaconda/kickstart.py | 54 +--------------- - pyanaconda/ui/gui/spokes/datetime_spoke.glade | 74 ---------------------- - pyanaconda/ui/gui/spokes/datetime_spoke.py | 89 --------------------------- - 3 files changed, 1 insertion(+), 216 deletions(-) - -diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py -index 88d552d..5b69ebb 100644 ---- a/pyanaconda/kickstart.py -+++ b/pyanaconda/kickstart.py -@@ -760,35 +760,7 @@ class Timezone(RemovedCommand): - return timezone_proxy.GenerateKickstart() - - def setup(self, ksdata): -- timezone_proxy = TIMEZONE.get_proxy() -- services_proxy = SERVICES.get_proxy() -- -- enabled_services = services_proxy.EnabledServices -- disabled_services = services_proxy.DisabledServices -- -- # do not install and use NTP package -- if not timezone_proxy.NTPEnabled or NTP_PACKAGE in ksdata.packages.excludedList: -- if util.service_running(NTP_SERVICE) and conf.system.can_set_time_synchronization: -- ret = util.stop_service(NTP_SERVICE) -- if ret != 0: -- timezone_log.error("Failed to stop NTP service") -- -- if NTP_SERVICE not in disabled_services: -- disabled_services.append(NTP_SERVICE) -- services_proxy.SetDisabledServices(disabled_services) -- # install and use NTP package -- else: -- if not util.service_running(NTP_SERVICE) and conf.system.can_set_time_synchronization: -- ret = util.start_service(NTP_SERVICE) -- if ret != 0: -- timezone_log.error("Failed to start NTP service") -- -- self.packages.append(NTP_PACKAGE) -- -- if not NTP_SERVICE in enabled_services and \ -- not NTP_SERVICE in disabled_services: -- enabled_services.append(NTP_SERVICE) -- services_proxy.SetEnabledServices(enabled_services) -+ pass - - def execute(self): - # get the DBus proxies -@@ -805,30 +777,6 @@ class Timezone(RemovedCommand): - - timezone.write_timezone_config(timezone_proxy, util.getSysroot()) - -- # write out NTP configuration (if set) and --nontp is not used -- kickstart_ntp_servers = timezone_proxy.NTPServers -- -- if timezone_proxy.NTPEnabled and kickstart_ntp_servers: -- chronyd_conf_path = os.path.normpath(util.getSysroot() + ntp.NTP_CONFIG_FILE) -- pools, servers = ntp.internal_to_pools_and_servers(kickstart_ntp_servers) -- if os.path.exists(chronyd_conf_path): -- timezone_log.debug("Modifying installed chrony configuration") -- try: -- ntp.save_servers_to_config(pools, servers, conf_file_path=chronyd_conf_path) -- except ntp.NTPconfigError as ntperr: -- timezone_log.warning("Failed to save NTP configuration: %s", ntperr) -- # use chrony conf file from installation environment when -- # chrony is not installed (chrony conf file is missing) -- else: -- timezone_log.debug("Creating chrony configuration based on the " -- "configuration from installation environment") -- try: -- ntp.save_servers_to_config(pools, servers, -- conf_file_path=ntp.NTP_CONFIG_FILE, -- out_file_path=chronyd_conf_path) -- except ntp.NTPconfigError as ntperr: -- timezone_log.warning("Failed to save NTP configuration without chrony package: %s", ntperr) -- - class User(COMMANDS.User): - def execute(self, storage, ksdata, users): - -diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.glade b/pyanaconda/ui/gui/spokes/datetime_spoke.glade -index 37c7c6e..875cfea 100644 ---- a/pyanaconda/ui/gui/spokes/datetime_spoke.glade -+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.glade -@@ -460,80 +460,6 @@ - <property name="position">3</property> - </packing> - </child> -- <child> -- <object class="GtkAlignment" id="alignment4"> -- <property name="visible">True</property> -- <property name="can_focus">False</property> -- <property name="xalign">1</property> -- <property name="xscale">0.20000000298023224</property> -- <property name="right_padding">24</property> -- <child> -- <object class="GtkBox" id="box6"> -- <property name="visible">True</property> -- <property name="can_focus">False</property> -- <property name="halign">end</property> -- <child> -- <object class="GtkLabel" id="networkTimeLabel"> -- <property name="visible">True</property> -- <property name="can_focus">False</property> -- <property name="label" translatable="yes" context="GUI|Date and Time">_Network Time</property> -- <property name="use_underline">True</property> -- <property name="mnemonic_widget">networkTimeSwitch</property> -- </object> -- <packing> -- <property name="expand">False</property> -- <property name="fill">True</property> -- <property name="padding">3</property> -- <property name="position">0</property> -- </packing> -- </child> -- <child> -- <object class="GtkSwitch" id="networkTimeSwitch"> -- <property name="visible">True</property> -- <property name="can_focus">True</property> -- <signal name="notify::active" handler="on_ntp_switched" swapped="no"/> -- <child internal-child="accessible"> -- <object class="AtkObject" id="networkTimeSwitch-atkobject"> -- <property name="AtkObject::accessible-name" translatable="yes">Use Network Time</property> -- </object> -- </child> -- </object> -- <packing> -- <property name="expand">False</property> -- <property name="fill">True</property> -- <property name="padding">1</property> -- <property name="position">1</property> -- </packing> -- </child> -- <child> -- <object class="GtkButton" id="ntpConfigButton"> -- <property name="visible">True</property> -- <property name="can_focus">True</property> -- <property name="receives_default">True</property> -- <property name="image">configImage</property> -- <signal name="clicked" handler="on_ntp_config_clicked" swapped="no"/> -- <child internal-child="accessible"> -- <object class="AtkObject" id="ntpConfigButton-atkobject"> -- <property name="AtkObject::accessible-name" translatable="yes">Configure NTP</property> -- </object> -- </child> -- </object> -- <packing> -- <property name="expand">False</property> -- <property name="fill">True</property> -- <property name="padding">1</property> -- <property name="position">2</property> -- </packing> -- </child> -- </object> -- </child> -- </object> -- <packing> -- <property name="expand">True</property> -- <property name="fill">True</property> -- <property name="position">4</property> -- </packing> -- </child> - </object> - </child> - </object> -diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py -index 9ce853d..a83c2c9 100644 ---- a/pyanaconda/ui/gui/spokes/datetime_spoke.py -+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py -@@ -500,8 +500,6 @@ class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke): - self._year_format, suffix = formats[widgets.index(year_box)] - year_label.set_text(suffix) - -- self._ntpSwitch = self.builder.get_object("networkTimeSwitch") -- - self._regions_zones = get_all_regions_and_timezones() - - # Set the initial sensitivity of the AM/PM toggle based on the time-type selected -@@ -510,9 +508,6 @@ class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke): - if not conf.system.can_set_system_clock: - self._hide_date_time_setting() - -- self._config_dialog = NTPconfigDialog(self.data, self._timezone_module) -- self._config_dialog.initialize() -- - threadMgr.add(AnacondaThread(name=constants.THREAD_DATE_TIME, - target=self._initialize)) - -@@ -600,8 +595,6 @@ class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke): - # TODO: seen should be set from the module - self._kickstarted = False - -- self._timezone_module.proxy.SetNTPEnabled(self._ntpSwitch.get_active()) -- - def execute(self): - if self._update_datetime_timer is not None: - self._update_datetime_timer.cancel() -@@ -639,20 +632,6 @@ class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke): - - self._update_datetime() - -- has_active_network = self._network_module.proxy.Connected -- if not has_active_network: -- self._show_no_network_warning() -- else: -- self.clear_info() -- gtk_call_once(self._config_dialog.refresh_servers_state) -- -- if conf.system.can_set_time_synchronization: -- ntp_working = has_active_network and util.service_running(NTP_SERVICE) -- else: -- ntp_working = self._timezone_module.proxy.NTPEnabled -- -- self._ntpSwitch.set_active(ntp_working) -- - @async_action_wait - def _set_timezone(self, timezone): - """ -@@ -1111,71 +1090,3 @@ class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke): - #contains all date/time setting widgets - footer_alignment = self.builder.get_object("footerAlignment") - footer_alignment.set_sensitive(sensitive) -- -- def _show_no_network_warning(self): -- self.set_warning(_("You need to set up networking first if you "\ -- "want to use NTP")) -- -- def _show_no_ntp_server_warning(self): -- self.set_warning(_("You have no working NTP server configured")) -- -- def on_ntp_switched(self, switch, *args): -- if switch.get_active(): -- #turned ON -- if not conf.system.can_set_time_synchronization: -- #cannot touch runtime system, not much to do here -- return -- -- if not self._network_module.proxy.Connected: -- self._show_no_network_warning() -- switch.set_active(False) -- return -- else: -- self.clear_info() -- -- working_server = self._config_dialog.working_server -- if working_server is None: -- self._show_no_ntp_server_warning() -- else: -- #we need a one-time sync here, because chronyd would not change -- #the time as drastically as we need -- ntp.one_time_sync_async(working_server) -- -- ret = util.start_service(NTP_SERVICE) -- self._set_date_time_setting_sensitive(False) -- -- #if starting chronyd failed and chronyd is not running, -- #set switch back to OFF -- if (ret != 0) and not util.service_running(NTP_SERVICE): -- switch.set_active(False) -- -- else: -- #turned OFF -- if not conf.system.can_set_time_synchronization: -- #cannot touch runtime system, nothing to do here -- return -- -- self._set_date_time_setting_sensitive(True) -- ret = util.stop_service(NTP_SERVICE) -- -- #if stopping chronyd failed and chronyd is running, -- #set switch back to ON -- if (ret != 0) and util.service_running(NTP_SERVICE): -- switch.set_active(True) -- -- self.clear_info() -- -- def on_ntp_config_clicked(self, *args): -- self._config_dialog.refresh() -- -- with self.main_window.enlightbox(self._config_dialog.window): -- response = self._config_dialog.run() -- -- if response == 1: -- pools, servers = self._config_dialog.pools_servers -- self._timezone_module.proxy.SetNTPServers(ntp.pools_servers_to_internal(pools, servers)) -- -- if self._config_dialog.working_server is None: -- self._show_no_ntp_server_warning() -- else: -- self.clear_info() --- -2.7.4 - diff --git a/recipes-installer/anaconda/files/0028-do-not-support-manually-set-time.patch b/recipes-installer/anaconda/files/0028-do-not-support-manually-set-time.patch index e998ef8..12196a5 100644 --- a/recipes-installer/anaconda/files/0028-do-not-support-manually-set-time.patch +++ b/recipes-installer/anaconda/files/0028-do-not-support-manually-set-time.patch @@ -9,24 +9,32 @@ support set time manually neither. Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 39 on 20240304. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + --- pyanaconda/ui/gui/spokes/datetime_spoke.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py -index e8a47b7..7f3569d 100644 +index 17580c0659..7ccefb6b50 100644 --- a/pyanaconda/ui/gui/spokes/datetime_spoke.py +++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py -@@ -549,6 +549,9 @@ class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke): +@@ -316,6 +316,9 @@ class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke): _("Restoring hardware time...")) - threadMgr.wait(constants.THREAD_TIME_INIT) + thread_manager.wait(constants.THREAD_TIME_INIT) + # Do not support manually set time + self._set_date_time_setting_sensitive(False) + - hubQ.send_ready(self.__class__.__name__, False) + hubQ.send_ready(self.__class__.__name__) # report that we are done -- 2.7.4 - diff --git a/recipes-installer/anaconda/files/0031-fix-write-network-conf-failed-while-liveinst.patch b/recipes-installer/anaconda/files/0031-fix-write-network-conf-failed-while-liveinst.patch deleted file mode 100644 index da065a7..0000000 --- a/recipes-installer/anaconda/files/0031-fix-write-network-conf-failed-while-liveinst.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 456d86d674863a5697635bcda4e89b3e3411dd51 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia <hongxu.jia@windriver.com> -Date: Sat, 29 Jun 2019 12:27:35 +0800 -Subject: [PATCH] fix write network conf failed while liveinst - -While liveinst, the network conf writing will overwrite copy -"/etc/resolv.conf" to "/mnt/sysimage/etc/resolv.conf". But in -wrlinux, the "/etc/resolv.conf" and "/mnt/sysimage/etc/resolv.conf" -are the same file which is a symlink to /run/resolve.conf. - -Test same file before copy. - -Upstream-Status: Pending - -iigned-off-by: Hongxu Jia <hongxu.jia@windriver.com> ---- - pyanaconda/network.py | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/pyanaconda/network.py b/pyanaconda/network.py -index c4bc57d..a59e980 100644 ---- a/pyanaconda/network.py -+++ b/pyanaconda/network.py -@@ -282,6 +282,13 @@ def copy_resolv_conf_to_root(root=""): - dst_dir = os.path.dirname(dst) - if not os.path.isdir(dst_dir): - util.mkdirChain(dst_dir) -+ -+ # Same file test -+ if os.path.exists(src) and os.path.exists(dst) and \ -+ os.stat(src).st_ino == os.stat(dst).st_ino: -+ log.info("%s and %s are the same file" % (src, dst)) -+ return -+ - shutil.copyfile(src, dst) - - --- -2.7.4 - diff --git a/recipes-installer/anaconda/files/0033-text-repository-setting-do-not-support-local-ISO-fil.patch b/recipes-installer/anaconda/files/0033-text-repository-setting-do-not-support-local-ISO-fil.patch index 2b3b631..4146a44 100644 --- a/recipes-installer/anaconda/files/0033-text-repository-setting-do-not-support-local-ISO-fil.patch +++ b/recipes-installer/anaconda/files/0033-text-repository-setting-do-not-support-local-ISO-fil.patch @@ -9,23 +9,19 @@ OE does not support repository in local ISO file Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/ui/tui/spokes/installation_source.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + pyanaconda/ui/tui/spokes/installation_source.py | 1 - + 1 file changed, 1 deletion(-) diff --git a/pyanaconda/ui/tui/spokes/installation_source.py b/pyanaconda/ui/tui/spokes/installation_source.py -index be2c29e..193c57b 100644 +index ed25b3a8d..db526a069 100644 --- a/pyanaconda/ui/tui/spokes/installation_source.py +++ b/pyanaconda/ui/tui/spokes/installation_source.py -@@ -146,6 +146,7 @@ class SourceSpoke(NormalTUISpoke, SourceSwitchHandler): - and (self.data.method.method or self.payload.base_repo)) - - def refresh(self, args=None): -+ log.info("refresh args %s" % (args)) - NormalTUISpoke.refresh(self, args) - - threadMgr.wait(THREAD_PAYLOAD) -@@ -177,7 +178,6 @@ class SourceSpoke(NormalTUISpoke, SourceSwitchHandler): +@@ -153,7 +153,6 @@ class SourceSpoke(NormalTUISpoke, SourceSwitchHandler): else: self.window.add(TextWidget(_("Choose an installation source type."))) self._container.add(TextWidget(_("CD/DVD")), self._set_cd_install_source) diff --git a/recipes-installer/anaconda/files/0034-text-repository-setting-support-http-proxy.patch b/recipes-installer/anaconda/files/0034-text-repository-setting-support-http-proxy.patch index d7906e9..6eb4d70 100644 --- a/recipes-installer/anaconda/files/0034-text-repository-setting-support-http-proxy.patch +++ b/recipes-installer/anaconda/files/0034-text-repository-setting-support-http-proxy.patch @@ -11,57 +11,28 @@ For text mode, it supports: Upstream-Status: Pending Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. The helpers.py has been updated in upstream, so +drop the patch for it. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/ui/helpers.py | 8 +++++++- pyanaconda/ui/tui/spokes/installation_source.py | 17 ++++++++++++++++- - 2 files changed, 23 insertions(+), 2 deletions(-) + 1 file changed, 16 insertions(+), 1 deletion(-) -diff --git a/pyanaconda/ui/helpers.py b/pyanaconda/ui/helpers.py -index d980983..e9cdcab 100644 ---- a/pyanaconda/ui/helpers.py -+++ b/pyanaconda/ui/helpers.py -@@ -109,6 +109,7 @@ class SourceSwitchHandler(object, metaclass=ABCMeta): - It will correctly switch to the new method - and cleanup any previous method set. - """ -+ log = get_module_logger(__name__) - - @abstractproperty - def data(self): -@@ -177,7 +178,7 @@ class SourceSwitchHandler(object, metaclass=ABCMeta): - # as we already made the device protected when - # switching to it, we don't need to protect it here - -- def set_source_url(self, url=None): -+ def set_source_url(self, url=None, proxy=None): - """ Switch to install source specified by URL """ - # clean any old HDD ISO sources - self._clean_hdd_iso() -@@ -185,6 +186,11 @@ class SourceSwitchHandler(object, metaclass=ABCMeta): - self.data.method.method = "url" - if url is not None: - self.data.method.url = url -+ self.log.info("url: %s" % url) -+ -+ if proxy is not None: -+ self.data.method.proxy = proxy -+ self.log.info("proxy: %s" % proxy) - - def set_source_nfs(self, opts=None): - """ Switch to NFS install source """ diff --git a/pyanaconda/ui/tui/spokes/installation_source.py b/pyanaconda/ui/tui/spokes/installation_source.py -index ab44ecc..da65437 100644 +index db526a069..b1cf1271b 100644 --- a/pyanaconda/ui/tui/spokes/installation_source.py +++ b/pyanaconda/ui/tui/spokes/installation_source.py -@@ -263,6 +263,7 @@ class SpecifyRepoSpoke(NormalTUISpoke, SourceSwitchHandler): +@@ -238,6 +238,7 @@ class SpecifyRepoSpoke(NormalTUISpoke, SourceSwitchHandler): + self.protocol = protocol self._container = None - - self._url = self.data.url.url + self._url = self._get_url() + self._proxy = self.data.method.proxy - def refresh(self, args=None): - """ Refresh window. """ -@@ -273,11 +274,17 @@ class SpecifyRepoSpoke(NormalTUISpoke, SourceSwitchHandler): + def _get_url(self): + """Get the URL of the current source.""" +@@ -261,11 +262,17 @@ class SpecifyRepoSpoke(NormalTUISpoke, SourceSwitchHandler): dialog = Dialog(_("Repo URL")) self._container.add(EntryWidget(dialog.title, self._url), self._set_repo_url, dialog) @@ -79,7 +50,7 @@ index ab44ecc..da65437 100644 def input(self, args, key): if self._container.process_user_input(key): self.apply() -@@ -302,7 +309,15 @@ class SpecifyRepoSpoke(NormalTUISpoke, SourceSwitchHandler): +@@ -289,7 +296,15 @@ class SpecifyRepoSpoke(NormalTUISpoke, SourceSwitchHandler): # protocol either unknown or entry already starts with a protocol # specification url = self._url diff --git a/recipes-installer/anaconda/files/0036-do-not-support-network-setting-for-now.patch b/recipes-installer/anaconda/files/0036-do-not-support-network-setting-for-now.patch index 9b2a6f3..88176fc 100644 --- a/recipes-installer/anaconda/files/0036-do-not-support-network-setting-for-now.patch +++ b/recipes-installer/anaconda/files/0036-do-not-support-network-setting-for-now.patch @@ -8,16 +8,24 @@ We have a long term plan to support it, but not now. Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Refactor for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- pyanaconda/core/configuration/system.py | 3 ++- - pyanaconda/installation.py | 3 +++ - 2 files changed, 5 insertions(+), 1 deletion(-) + pyanaconda/installation.py | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyanaconda/core/configuration/system.py b/pyanaconda/core/configuration/system.py -index 7459e2e..9b7ef96 100644 +index 63fb8afc5d..912e7452e9 100644 --- a/pyanaconda/core/configuration/system.py +++ b/pyanaconda/core/configuration/system.py -@@ -135,7 +135,8 @@ class SystemSection(Section): +@@ -145,7 +145,8 @@ class SystemSection(Section): @property def can_configure_network(self): """Can we configure the network?""" @@ -26,21 +34,20 @@ index 7459e2e..9b7ef96 100644 + return False @property - def can_detect_unsupported_hardware(self): + def can_detect_enabled_smt(self): diff --git a/pyanaconda/installation.py b/pyanaconda/installation.py -index 9eb40b3..0423a3d 100644 +index b98425e3cc..dff213b09d 100644 --- a/pyanaconda/installation.py +++ b/pyanaconda/installation.py -@@ -79,6 +79,9 @@ def _writeKS(ksdata): - auto_part_proxy = STORAGE.get_proxy(AUTO_PARTITIONING) - auto_part_proxy.SetPassphrase("") +@@ -154,7 +154,7 @@ class RunInstallationTask(InstallationTask): + configuration_queue.append(os_config) -+ # Do not support network configuration -+ ksdata.network.network = [] -+ - # Make it so only root can read - could have passwords - with util.open_with_perm(path, "w", 0o600) as f: - f.write(str(ksdata)) + # schedule network configuration (if required) +- if conf.target.can_configure_network and conf.system.provides_network_config: ++ if False: + overwrite = payload.type in PAYLOAD_LIVE_TYPES + network_config = TaskQueue( + "Network configuration", -- 2.7.4 diff --git a/recipes-installer/anaconda/files/0037-tweak-boot-storage-sanity-check.patch b/recipes-installer/anaconda/files/0037-tweak-boot-storage-sanity-check.patch deleted file mode 100644 index f849eae..0000000 --- a/recipes-installer/anaconda/files/0037-tweak-boot-storage-sanity-check.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 4366d276efcff89b3c4fa44766e73ad0a72a7041 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia <hongxu.jia@windriver.com> -Date: Sat, 29 Jun 2019 14:20:54 +0800 -Subject: [PATCH] tweak /boot storage sanity check - -Since kernel-vmlinux (200MB+) was installed to /boot, -tweak /boot storage sanity check from 200MB to 300MB. - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> ---- - pyanaconda/storage/checker.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pyanaconda/storage/checker.py b/pyanaconda/storage/checker.py -index 0f0be6e..c3e5780 100644 ---- a/pyanaconda/storage/checker.py -+++ b/pyanaconda/storage/checker.py -@@ -567,7 +567,7 @@ class StorageChecker(object): - '/tmp': Size("50 MiB"), - '/var': Size("384 MiB"), - '/home': Size("100 MiB"), -- '/boot': Size("200 MiB") -+ '/boot': Size("300 MiB") - }) - - self.add_new_constraint(STORAGE_MUST_BE_ON_LINUXFS, { --- -2.7.4 - diff --git a/recipes-installer/anaconda/files/0038-support-to-get-kickstart-from-network.patch b/recipes-installer/anaconda/files/0038-support-to-get-kickstart-from-network.patch index 76fcf2f..de19003 100644 --- a/recipes-installer/anaconda/files/0038-support-to-get-kickstart-from-network.patch +++ b/recipes-installer/anaconda/files/0038-support-to-get-kickstart-from-network.patch @@ -1,4 +1,4 @@ -From c2645c00b53107473efcb954afb06bd6906a7b00 Mon Sep 17 00:00:00 2001 +From c65b2674cbdbf3552d697babbdd5e6ab7c2e5415 Mon Sep 17 00:00:00 2001 From: Hongxu Jia <hongxu.jia@windriver.com> Date: Sat, 29 Jun 2019 14:25:21 +0800 Subject: [PATCH] support to get kickstart from network @@ -8,18 +8,26 @@ We support http/https/ftp protocol to get kickstart file Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Update for anaconda 32. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 38 on 20231107. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- pyanaconda/startup_utils.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pyanaconda/startup_utils.py b/pyanaconda/startup_utils.py -index a0fca28..7b19c68 100644 +index 07afd098ec..608dc84a6e 100644 --- a/pyanaconda/startup_utils.py +++ b/pyanaconda/startup_utils.py -@@ -412,8 +412,11 @@ def parse_kickstart(options, addon_paths, pass_to_boss=False): - :returns: kickstart parsed to a data model +@@ -373,8 +373,11 @@ def find_kickstart(options): + :param options: command line/boot options + :returns: a path to a kickstart file or None """ - ksdata = None - if options.ksfile and not options.liveinst: - if not os.path.exists(options.ksfile): + if options.ksfile: @@ -28,11 +36,11 @@ index a0fca28..7b19c68 100644 + not options.ksfile.startswith("https://") and \ + not options.ksfile.startswith("ftp://"): stdout_log.error("Kickstart file %s is missing.", options.ksfile) - util.ipmi_report(constants.IPMI_ABORTED) + ipmi_report(IPMI_ABORTED) sys.exit(1) -@@ -431,8 +434,12 @@ def parse_kickstart(options, addon_paths, pass_to_boss=False): - ks_files = ["/tmp/updates/interactive-defaults.ks", - "/usr/share/anaconda/interactive-defaults.ks"] +@@ -391,8 +394,12 @@ def find_kickstart(options): + else: + ks_files = ["/usr/share/anaconda/interactive-defaults.ks"] + log.info("ks_files: %s" % ks_files) for ks in ks_files: @@ -43,7 +51,4 @@ index a0fca28..7b19c68 100644 + not ks.startswith("ftp://"): continue - kickstart.preScriptPass(ks) --- -2.7.4 - + return ks diff --git a/recipes-installer/anaconda/files/0039-support-authentication-for-kickstart.patch b/recipes-installer/anaconda/files/0039-support-authentication-for-kickstart.patch index 561852b..3cd111a 100644 --- a/recipes-installer/anaconda/files/0039-support-authentication-for-kickstart.patch +++ b/recipes-installer/anaconda/files/0039-support-authentication-for-kickstart.patch @@ -9,44 +9,71 @@ authentication while downloading kickstart from web server. Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Update patch for anaconda 32: +* replace self.cmdline with kernel_arguments +* update patch context + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 34: + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +It requires option prefix 'inst.' in anaconda 34. Update the error +message. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/flags.py | 5 +++ + pyanaconda/flags.py | 6 ++++ pyanaconda/kickstart.py | 37 +++++++++++++++++++--- .../modules/boss/kickstart_manager/parser.py | 10 +++--- - 3 files changed, 42 insertions(+), 10 deletions(-) + 3 files changed, 43 insertions(+), 10 deletions(-) diff --git a/pyanaconda/flags.py b/pyanaconda/flags.py -index 0a98d2c..05442d0 100644 +index 000fd5df87..bbf0d19999 100644 --- a/pyanaconda/flags.py +++ b/pyanaconda/flags.py -@@ -59,6 +59,11 @@ class Flags(object): +@@ -17,6 +17,7 @@ + # along with this program. If not, see <http://www.gnu.org/licenses/>. + # + from pyanaconda.core.constants import ANACONDA_ENVIRON ++from pyanaconda.core.kernel import kernel_arguments + + from pyanaconda.anaconda_loggers import get_module_logger + log = get_module_logger(__name__) +@@ -44,6 +45,11 @@ class Flags(object): + self.kexec = False + # current runtime environments self.environs = [ANACONDA_ENVIRON] - # parse the boot commandline - self.cmdline = KernelArguments.from_defaults() + + # Authentication for downloading kickstart file through http -+ self.ksuser = self.cmdline.get('ksuser', None) -+ self.kspasswd = self.cmdline.get('kspasswd', None) ++ self.ksuser = kernel_arguments.get('ksuser') ++ self.kspasswd = kernel_arguments.get('kspasswd') + # Lock it down: no more creating new flags! self.__dict__['_in_init'] = False diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py -index 5b69ebb..5108a5a 100644 +index 9a6f32f777..f5e13ca34c 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py -@@ -60,7 +60,7 @@ from pyanaconda.timezone import NTP_PACKAGE, NTP_SERVICE - from pykickstart.base import BaseHandler, KickstartCommand - from pykickstart.constants import KS_SCRIPT_POST, KS_SCRIPT_PRE, KS_SCRIPT_TRACEBACK, \ - KS_SCRIPT_PREINSTALL, SELINUX_DISABLED, SELINUX_ENFORCING, SELINUX_PERMISSIVE --from pykickstart.errors import KickstartError, KickstartParseError -+from pykickstart.errors import KickstartError, KickstartParseError, KickstartAuthError +@@ -42,7 +42,7 @@ from pyanaconda.modules.common.structures.kickstart import KickstartReport + + from pykickstart.base import KickstartCommand, RemovedCommand + from pykickstart.constants import KS_SCRIPT_POST, KS_SCRIPT_PRE, KS_SCRIPT_TRACEBACK, KS_SCRIPT_PREINSTALL +-from pykickstart.errors import KickstartError, KickstartParseWarning ++from pykickstart.errors import KickstartError, KickstartParseWarning, KickstartAuthError + from pykickstart.ko import KickstartObject from pykickstart.parser import KickstartParser from pykickstart.parser import Script as KSScript - from pykickstart.sections import NullSection, PackageSection, PostScriptSection, PreScriptSection, PreInstallScriptSection, \ -@@ -1016,8 +1016,35 @@ class AnacondaKSHandler(superclass): - def __str__(self): - return super().__str__() + "\n" + str(self.addons) + str(self.anaconda) +@@ -314,8 +314,35 @@ class AnacondaKSHandler(superclass): + return super().__str__() + "\n" + modules + -class AnacondaPreParser(KickstartParser): - # A subclass of KickstartParser that only looks for %pre scripts and @@ -71,7 +98,7 @@ index 5b69ebb..5108a5a 100644 + flags.kspasswd = self.password + break + except KickstartAuthError as e: -+ msg = 'Append "ksuser=<username> kspasswd=<password>" to boot command' ++ msg = 'Append "inst.ksuser=<username> inst.kspasswd=<password>" to boot command' + raise KickstartError(msg) + except: + raise @@ -80,18 +107,18 @@ index 5b69ebb..5108a5a 100644 +class AnacondaPreParser(OEKickstartParser): + # A subclass of OEKickstartParser that only looks for %pre scripts and # sets them up to be run. All other scripts and commands are ignored. - def __init__(self, handler, followIncludes=True, errorsAreFatal=True, - missingIncludeIsFatal=True): -@@ -1037,7 +1064,7 @@ class AnacondaPreParser(KickstartParser): - self.registerSection(NullSection(self.handler.anaconda, sectionOpen="%anaconda")) + def __init__(self, handler): + super().__init__(handler, missingIncludeIsFatal=False) +@@ -333,7 +360,7 @@ class AnacondaPreParser(KickstartParser): + self.registerSection(NullSection(self.handler, sectionOpen="%addon")) -class AnacondaKSParser(KickstartParser): +class AnacondaKSParser(OEKickstartParser): - def __init__(self, handler, followIncludes=True, errorsAreFatal=True, - missingIncludeIsFatal=True, scriptClass=AnacondaKSScript): + def __init__(self, handler, scriptClass=AnacondaKSScript): self.scriptClass = scriptClass -@@ -1047,7 +1074,7 @@ class AnacondaKSParser(KickstartParser): + super().__init__(handler) +@@ -342,7 +369,7 @@ class AnacondaKSParser(KickstartParser): if not self.handler: return @@ -101,7 +128,7 @@ index 5b69ebb..5108a5a 100644 def setupSections(self): self.registerSection(PreScriptSection(self.handler, dataObj=self.scriptClass)) diff --git a/pyanaconda/modules/boss/kickstart_manager/parser.py b/pyanaconda/modules/boss/kickstart_manager/parser.py -index af9b305..ff840b5 100644 +index 795e6617c5..883117d5af 100644 --- a/pyanaconda/modules/boss/kickstart_manager/parser.py +++ b/pyanaconda/modules/boss/kickstart_manager/parser.py @@ -18,7 +18,7 @@ @@ -113,7 +140,7 @@ index af9b305..ff840b5 100644 from pykickstart.sections import Section from pyanaconda.modules.boss.kickstart_manager.element import KickstartElement,\ -@@ -79,7 +79,7 @@ class StoreSection(Section): +@@ -81,7 +81,7 @@ class StoreSection(Section): self.lines = [] @@ -122,7 +149,7 @@ index af9b305..ff840b5 100644 """Kickstart parser for storing kickstart elements. Stores kickstart elements (commands, sections, addons) with their line -@@ -130,9 +130,9 @@ class SplitKickstartParser(KickstartParser): +@@ -132,9 +132,9 @@ class SplitKickstartParser(KickstartParser): kickstart files :rtype: KickstartElements """ diff --git a/recipes-installer/anaconda/files/0040-support-downloading-file-from-http-ftp-server-to-tar.patch b/recipes-installer/anaconda/files/0040-support-downloading-file-from-http-ftp-server-to-tar.patch index 9b43dba..37ca585 100644 --- a/recipes-installer/anaconda/files/0040-support-downloading-file-from-http-ftp-server-to-tar.patch +++ b/recipes-installer/anaconda/files/0040-support-downloading-file-from-http-ftp-server-to-tar.patch @@ -18,39 +18,64 @@ we could make use of "%pre" section with invoking shell to do that) Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 38 on 20231107. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/installation.py | 1 + - pyanaconda/kickstart.py | 99 ++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 100 insertions(+) + pyanaconda/installation.py | 6 +++ + pyanaconda/kickstart.py | 100 +++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 106 insertions(+) diff --git a/pyanaconda/installation.py b/pyanaconda/installation.py -index 0423a3d..fa5bfc8 100644 +index 9c1372f606..803687d11d 100644 --- a/pyanaconda/installation.py +++ b/pyanaconda/installation.py -@@ -122,6 +122,7 @@ def doConfiguration(storage, payload, ksdata): - # Anaconda addon configuration - addon_config = TaskQueue("Anaconda addon configuration", N_("Configuring addons")) - addon_config.append(Task("Configure Anaconda addons", ksdata.addons.execute, (storage, ksdata, u, payload))) -+ addon_config.append(Task("Configure download", ksdata.download.execute, (ksdata,))) - configuration_queue.append(addon_config) +@@ -184,6 +184,12 @@ class RunInstallationTask(InstallationTask): + _("Configuring addons") + ) - # Initramfs generation ++ addon_config.append(Task( ++ "Configure download", ++ ksdata.download.execute, ++ (ksdata,) ++ )) ++ + boss_proxy = BOSS.get_proxy() + for service_name, object_path in boss_proxy.CollectInstallSystemTasks(): + task_proxy = DBus.get_proxy(service_name, object_path) diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py -index 5108a5a..5f8a050 100644 +index 9f235c1d58..df31b8e44c 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py -@@ -62,6 +62,8 @@ from pykickstart.constants import KS_SCRIPT_POST, KS_SCRIPT_PRE, KS_SCRIPT_TRACE - KS_SCRIPT_PREINSTALL, SELINUX_DISABLED, SELINUX_ENFORCING, SELINUX_PERMISSIVE - from pykickstart.errors import KickstartError, KickstartParseError, KickstartAuthError +@@ -25,6 +25,7 @@ import sys + import tempfile + import time + import warnings ++import requests + + from contextlib import contextmanager + +@@ -45,6 +46,8 @@ from pykickstart.constants import KS_SCRIPT_POST, KS_SCRIPT_PRE, KS_SCRIPT_TRACE + from pykickstart.errors import KickstartError, KickstartParseWarning, KickstartAuthError + from pykickstart.ko import KickstartObject from pykickstart.parser import KickstartParser +from pykickstart.base import KickstartCommand, BaseData +from pykickstart.options import KSOptionParser from pykickstart.parser import Script as KSScript - from pykickstart.sections import NullSection, PackageSection, PostScriptSection, PreScriptSection, PreInstallScriptSection, \ - OnErrorScriptSection, TracebackScriptSection, Section -@@ -924,6 +926,101 @@ class AnacondaSection(Section): - """Let %anaconda know no additional data will come.""" - Section.finalize(self) + from pykickstart.sections import NullSection, PostScriptSection, PreScriptSection, \ + PreInstallScriptSection, OnErrorScriptSection, TracebackScriptSection, Section +@@ -181,6 +184,101 @@ class UselessObject(KickstartObject): + """Generate this part of a kickstart file from the DBus module.""" + return "" +class DownloadData(BaseData): + removedKeywords = BaseData.removedKeywords @@ -130,7 +155,7 @@ index 5108a5a..5f8a050 100644 + stderrLog.critical(msg) + sys.exit(1) + -+ dest = util.getSysroot() + dd.dest ++ dest = conf.target.system_root + dd.dest + log.info("downloading %s to %s" % (dd.src, dest)) + dest_dir = os.path.dirname(dest) + if not os.path.exists(dest_dir): @@ -150,19 +175,19 @@ index 5108a5a..5f8a050 100644 ### ### HANDLERS ### -@@ -965,10 +1062,12 @@ commandMap = { - "xconfig": XConfig, - "zerombr": UselessCommand, - "zfcp": UselessCommand, -+ "download": Download, - } +@@ -208,11 +306,13 @@ class AnacondaKickstartSpecification(KickstartSpecification): + "text": COMMANDS.DisplayMode, + "updates": COMMANDS.Updates, + "vnc": COMMANDS.Vnc, ++ "download": Download, + } - dataMap = { - "RepoData": RepoData, -+ "DownloadData": DownloadData, - } + commands_data = { + "DriverDiskData": COMMANDS.DriverDiskData, + "SshPwData": COMMANDS.SshPwData, ++ "DownloadData": DownloadData, + } - superclass = returnClassForVersion(VERSION) + @classmethod -- 2.7.4 - diff --git a/recipes-installer/anaconda/files/0041-live-install-supports-kickstart.patch b/recipes-installer/anaconda/files/0041-live-install-supports-kickstart.patch deleted file mode 100644 index c824a89..0000000 --- a/recipes-installer/anaconda/files/0041-live-install-supports-kickstart.patch +++ /dev/null @@ -1,33 +0,0 @@ -From dc81c748f528cf9bb68c9ef1cd016b4091e8c543 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia <hongxu.jia@windriver.com> -Date: Wed, 25 Jul 2018 10:20:08 +0800 -Subject: [PATCH 41/65] live install supports kickstart - -While live install, WRLinux does not support harddrive, -use cdrom to replace - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> ---- - pyanaconda/installation.py | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/pyanaconda/installation.py b/pyanaconda/installation.py -index f600595..2fbcb11 100644 ---- a/pyanaconda/installation.py -+++ b/pyanaconda/installation.py -@@ -75,6 +75,10 @@ def _writeKS(ksdata): - # Do not support network configuration - ksdata.network.network = [] - -+ # Correct method of live install, use cdrom to replace -+ if ksdata.method.method == "harddrive": -+ ksdata.method.method = "cdrom" -+ - # Make it so only root can read - could have passwords - with util.open_with_perm(path, "w", 0o600) as f: - f.write(str(ksdata)) --- -2.7.4 - diff --git a/recipes-installer/anaconda/files/0042-support-initramfs-boot.patch b/recipes-installer/anaconda/files/0042-support-initramfs-boot.patch index 777255d..0574376 100644 --- a/recipes-installer/anaconda/files/0042-support-initramfs-boot.patch +++ b/recipes-installer/anaconda/files/0042-support-initramfs-boot.patch @@ -11,42 +11,90 @@ Subject: [PATCH] support initramfs boot Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Update for anaconda 32: +* refactor code to create fake initrd file +* replace obsolete function util.getSysroot() + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37. +* replace pyanaconda.core.util.mkdirChain with pyanaconda.core.path.make_directories + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/bootloader/installation.py | 5 +++++ - pyanaconda/payload/__init__.py | 4 ++++ - 2 files changed, 9 insertions(+) - -diff --git a/pyanaconda/bootloader/installation.py b/pyanaconda/bootloader/installation.py -index b620ab3..c2c097f 100644 ---- a/pyanaconda/bootloader/installation.py -+++ b/pyanaconda/bootloader/installation.py -@@ -50,6 +50,11 @@ def write_boot_loader(storage, payload): - - # Install the boot loader. - if not storage.bootloader.skip_bootloader: -+ for kernel in payload.kernel_version_list: -+ initrd = util.getSysroot()+"/boot/initramfs-%s.img" % kernel -+ if not os.path.exists(initrd): -+ open(initrd, "w").write("\n") + pyanaconda/modules/storage/bootloader/utils.py | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/pyanaconda/modules/storage/bootloader/utils.py b/pyanaconda/modules/storage/bootloader/utils.py +index 04b1e5abfd..38fce041a7 100644 +--- a/pyanaconda/modules/storage/bootloader/utils.py ++++ b/pyanaconda/modules/storage/bootloader/utils.py +@@ -21,6 +21,7 @@ from glob import glob + from pyanaconda.modules.common.errors.installation import BootloaderInstallationError + from pyanaconda.modules.storage.bootloader.image import LinuxBootLoaderImage + from pyanaconda.core.configuration.anaconda import conf ++from pyanaconda.core.path import make_directories + from pyanaconda.core.util import execWithRedirect + from pyanaconda.product import productName + +@@ -96,7 +97,7 @@ def configure_boot_loader(sysroot, storage, kernel_versions): + return + + # Collect the boot loader images. +- _collect_os_images(storage, kernel_versions) ++ _collect_os_images(storage, kernel_versions, sysroot) + + # Write out /etc/sysconfig/kernel. + _write_sysconfig_kernel(sysroot, storage) +@@ -113,7 +114,7 @@ def _get_rescue_kernel_versions(sysroot): + return [f.split("/")[-1][8:] for f in rescue_versions] + + +-def _collect_os_images(storage, kernel_versions): ++def _collect_os_images(storage, kernel_versions, sysroot): + """Collect the OS images for the boot loader. + + :param storage: an instance of the storage +@@ -135,6 +136,12 @@ def _collect_os_images(storage, kernel_versions): + storage.bootloader.add_image(default_image) + storage.bootloader.default = default_image + ++ # Create fake initramfs to cheat grub-mkconfig ++ initrd = sysroot + "/boot/initramfs-%s.img" % version ++ if not os.path.exists(initrd): ++ with open(initrd, 'w') as f: ++ f.write('\n') + - install_boot_loader(storage) + # now add an image for each of the other kernels + for version in kernel_versions: + label = "%s-%s" % (base_label, version) +@@ -145,6 +152,10 @@ def _collect_os_images(storage, kernel_versions): + ) + storage.bootloader.add_image(image) ++ initrd = sysroot + "/boot/initramfs-%s.img" % version ++ if not os.path.exists(initrd): ++ with open(initrd, 'w') as f: ++ f.write('\n') -diff --git a/pyanaconda/payload/__init__.py b/pyanaconda/payload/__init__.py -index 7c65d29..0da743e 100644 ---- a/pyanaconda/payload/__init__.py -+++ b/pyanaconda/payload/__init__.py -@@ -570,6 +570,10 @@ class Payload(metaclass=ABCMeta): - " using dracut instead.") - use_dracut = True + def _write_sysconfig_kernel(sysroot, storage): + """Write to /etc/sysconfig/kernel. +@@ -279,6 +290,10 @@ def recreate_initrds(sysroot, kernel_versions): + log.debug("new-kernel-pkg does not exist, using dracut instead") + use_dracut = True -+ # Make sure temp dir existed, dracut requires it while live install -+ for subdir in ["log", "tmp"]: -+ util.mkdirChain(util.getSysroot() + "/var/volatile/%s" % subdir) ++ # Make sure temp dir existed, dracut requires it while live install ++ for subdir in ["log", "tmp"]: ++ make_directories(conf.target.system_root + "/var/volatile/%s" % subdir) + - for kernel in self.kernel_version_list: - log.info("recreating initrd for %s", kernel) - if not conf.target.is_image: + for kernel in kernel_versions: + log.info("Recreating initrd for %s", kernel) + -- 2.7.4 diff --git a/recipes-installer/anaconda/files/0044-fix-installed-system-boot-from-encrypt-fs-failed.patch b/recipes-installer/anaconda/files/0044-fix-installed-system-boot-from-encrypt-fs-failed.patch index 877e55f..6ee10cc 100644 --- a/recipes-installer/anaconda/files/0044-fix-installed-system-boot-from-encrypt-fs-failed.patch +++ b/recipes-installer/anaconda/files/0044-fix-installed-system-boot-from-encrypt-fs-failed.patch @@ -27,26 +27,39 @@ loop dependency with lvm2, so ommit systemd module in dracut. Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Replace util.getSysroot() with conf.target.system_root. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Update context because 0042-support-initramfs-boot.patch updated for +anaconda 37. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/payload/__init__.py | 5 +++++ + pyanaconda/modules/storage/bootloader/utils.py | 5 +++++ 1 file changed, 5 insertions(+) -diff --git a/pyanaconda/payload/__init__.py b/pyanaconda/payload/__init__.py -index 0da743e..4fb40cb 100644 ---- a/pyanaconda/payload/__init__.py -+++ b/pyanaconda/payload/__init__.py -@@ -574,6 +574,11 @@ class Payload(metaclass=ABCMeta): - for subdir in ["log", "tmp"]: - util.mkdirChain(util.getSysroot() + "/var/volatile/%s" % subdir) +diff --git a/pyanaconda/modules/storage/bootloader/utils.py b/pyanaconda/modules/storage/bootloader/utils.py +index d25c51ee3..d53538d3a 100644 +--- a/pyanaconda/modules/storage/bootloader/utils.py ++++ b/pyanaconda/modules/storage/bootloader/utils.py +@@ -294,6 +294,11 @@ def recreate_initrds(sysroot, kernel_versions): + for subdir in ["log", "tmp"]: + make_directories(conf.target.system_root + "/var/volatile/%s" % subdir) -+ with open(util.getSysroot() + "/etc/dracut.conf.d/cryptsetup.conf", "w") as f: -+ f.write('add_drivers+=" aesni_intel"\n') -+ f.write('add_drivers+=" aes_x86_64"\n') -+ f.write('omit_dracutmodules+=" systemd"\n') ++ with open(conf.target.system_root + "/etc/dracut.conf.d/cryptsetup.conf", "w") as f: ++ f.write('add_drivers+=" aesni_intel"\n') ++ f.write('add_drivers+=" aes_x86_64"\n') ++ f.write('omit_dracutmodules+=" systemd"\n') + - for kernel in self.kernel_version_list: - log.info("recreating initrd for %s", kernel) - if not conf.target.is_image: + for kernel in kernel_versions: + log.info("Recreating initrd for %s", kernel) + -- 2.7.4 diff --git a/recipes-installer/anaconda/files/0046-update-region-while-city-changes.patch b/recipes-installer/anaconda/files/0046-update-region-while-city-changes.patch index 733ed98..5c37efe 100644 --- a/recipes-installer/anaconda/files/0046-update-region-while-city-changes.patch +++ b/recipes-installer/anaconda/files/0046-update-region-while-city-changes.patch @@ -1,7 +1,7 @@ -From de687784e07ee7819b6fa7f36f0f051d111a2dc9 Mon Sep 17 00:00:00 2001 +From 413892849bea41da7af922074a485ff4891ff273 Mon Sep 17 00:00:00 2001 From: Hongxu Jia <hongxu.jia@windriver.com> Date: Fri, 9 Sep 2016 13:23:48 -0400 -Subject: [PATCH 46/65] update region while city changes +Subject: [PATCH] update region while city changes While user select US/Alaska from combobox at first time, the libtimezonemap convert it to America/Anchorage, and anaconda gui page recognize it as @@ -10,16 +10,17 @@ America/Alaska, the fix make sure region/city could be correctly updated. Upstream-Status: Pending Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + --- pyanaconda/ui/gui/spokes/datetime_spoke.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py -index 7f3569d..ab744bd 100644 +index 78a965ae5..ff4b69577 100644 --- a/pyanaconda/ui/gui/spokes/datetime_spoke.py +++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py -@@ -934,7 +934,7 @@ class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke): - +@@ -919,7 +919,7 @@ class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke): + """ region = self._get_active_region() - if not region or region == self._old_region: @@ -27,6 +28,3 @@ index 7f3569d..ab744bd 100644 # region entry being edited or old_value chosen, no action needed # @see: on_city_changed return --- -2.7.4 - diff --git a/recipes-installer/anaconda/files/0047-remove-incorrect-prefix-of-addon-repo-url.patch b/recipes-installer/anaconda/files/0047-remove-incorrect-prefix-of-addon-repo-url.patch deleted file mode 100644 index f36e0c7..0000000 --- a/recipes-installer/anaconda/files/0047-remove-incorrect-prefix-of-addon-repo-url.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 42dcc8683f600d3902fdcb841922bd14bff7e160 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia <hongxu.jia@windriver.com> -Date: Sat, 29 Jun 2019 16:00:30 +0800 -Subject: [PATCH] remove incorrect prefix of addon repo url - -While user set addon repo url with "http://128.224.162.227/intel_x86_64/", -it has incorrect prefix "http://http://128.224.162.227/intel_x86_64/". - -So remove incorrect prefix of addon repo url. - -Upstream-Status: Pending - -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> ---- - pyanaconda/ui/gui/spokes/installation_source.py | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/pyanaconda/ui/gui/spokes/installation_source.py b/pyanaconda/ui/gui/spokes/installation_source.py -index 6fddfd7..6f725a4 100644 ---- a/pyanaconda/ui/gui/spokes/installation_source.py -+++ b/pyanaconda/ui/gui/spokes/installation_source.py -@@ -1713,6 +1713,8 @@ class SourceSpoke(NormalSpoke, GUISpokeInputCheckHandler): - - url_prefix = REPO_PROTO[combo_protocol] - url = self._repo_url_entry.get_text().strip() -+ if url.startswith(url_prefix): -+ url = url[len(url_prefix):] - - if combo_protocol in (PROTOCOL_HTTP, PROTOCOL_HTTPS): - url_type = self._repo_url_type_combo_box.get_active_id() --- -2.7.4 - diff --git a/recipes-installer/anaconda/files/0048-fix-write-sysconfig-network-failed.patch b/recipes-installer/anaconda/files/0048-fix-write-sysconfig-network-failed.patch index d2741d5..a541dc2 100644 --- a/recipes-installer/anaconda/files/0048-fix-write-sysconfig-network-failed.patch +++ b/recipes-installer/anaconda/files/0048-fix-write-sysconfig-network-failed.patch @@ -9,24 +9,28 @@ write sysconfig network. Upstream-Status: Pending Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Update context for anaconda 32. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- pyanaconda/modules/network/installation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyanaconda/modules/network/installation.py b/pyanaconda/modules/network/installation.py -index c063c4e..bf9b931 100644 +index 90dde9a7d5..2d1cebaf60 100644 --- a/pyanaconda/modules/network/installation.py +++ b/pyanaconda/modules/network/installation.py -@@ -114,6 +114,9 @@ Name={} +@@ -164,6 +164,9 @@ Name={} :param overwrite: overwrite existing configuration file :type overwrite: bool """ + if (not os.path.isdir(root + "/etc/sysconfig")): + return False + - return self._write_config_file(root, self.SYSCONF_NETWORK_FILE_PATH, - "# Created by anaconda\n", - "Cannot write {} configuration file".format( + return _write_config_file(root, self.SYSCONF_NETWORK_FILE_PATH, + "# Created by anaconda\n", + "Cannot write {} configuration file".format( -- 2.7.4 diff --git a/recipes-installer/anaconda/files/0049-pyanaconda-ui-gui-utils.py-tweak-mouse-arrow.patch b/recipes-installer/anaconda/files/0049-pyanaconda-ui-gui-utils.py-tweak-mouse-arrow.patch index b804a71..d107034 100644 --- a/recipes-installer/anaconda/files/0049-pyanaconda-ui-gui-utils.py-tweak-mouse-arrow.patch +++ b/recipes-installer/anaconda/files/0049-pyanaconda-ui-gui-utils.py-tweak-mouse-arrow.patch @@ -9,23 +9,27 @@ Gdk.CursorType.LEFT_PTR to replace. Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 37. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- pyanaconda/ui/gui/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyanaconda/ui/gui/utils.py b/pyanaconda/ui/gui/utils.py -index 4c7f3bd..9e21d35 100644 +index 282f1bc53c..6fa2ffc3db 100644 --- a/pyanaconda/ui/gui/utils.py +++ b/pyanaconda/ui/gui/utils.py -@@ -275,7 +275,7 @@ def unbusyCursor(): +@@ -280,7 +280,7 @@ def unbusyCursor(): if not window: return -- window.set_cursor(Gdk.Cursor(Gdk.CursorType.ARROW)) -+ window.set_cursor(Gdk.Cursor(Gdk.CursorType.LEFT_PTR)) +- window.set_cursor(Gdk.Cursor.new_for_display(Gdk.Display.get_default(), Gdk.CursorType.ARROW)) ++ window.set_cursor(Gdk.Cursor.new_for_display(Gdk.Display.get_default(), Gdk.CursorType.LEFT_PTR)) + def ignoreEscape(dlg): - """Prevent a dialog from accepting the escape keybinding, which emits a -- 2.7.4 diff --git a/recipes-installer/anaconda/files/0050-tweak-search-location-of-new-kernel-pkg.patch b/recipes-installer/anaconda/files/0050-tweak-search-location-of-new-kernel-pkg.patch deleted file mode 100644 index 248ce25..0000000 --- a/recipes-installer/anaconda/files/0050-tweak-search-location-of-new-kernel-pkg.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 4749c5a409cb2c121c575cb15118f1b8ff136d75 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia <hongxu.jia@windriver.com> -Date: Sat, 29 Jun 2019 16:15:14 +0800 -Subject: [PATCH] tweak search location of new-kernel-pkg - -In OE, it locates /sbin rather than /usr/sbin - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> ---- - pyanaconda/bootloader/grub2.py | 2 +- - pyanaconda/payload/__init__.py | 2 +- - pyanaconda/payload/livepayload.py | 4 ++-- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/pyanaconda/bootloader/grub2.py b/pyanaconda/bootloader/grub2.py -index 80b026a..bad0806 100644 ---- a/pyanaconda/bootloader/grub2.py -+++ b/pyanaconda/bootloader/grub2.py -@@ -274,7 +274,7 @@ class GRUB2(BootLoader): - defaults.write("GRUB_DISABLE_RECOVERY=\"true\"\n") - #defaults.write("GRUB_THEME=\"/boot/grub2/themes/system/theme.txt\"\n") - -- if self.use_bls and os.path.exists(util.getSysroot() + "/usr/sbin/new-kernel-pkg"): -+ if self.use_bls and os.path.exists(util.getSysroot() + "/sbin/new-kernel-pkg"): - log.warning("BLS support disabled due new-kernel-pkg being present") - self.use_bls = False - -diff --git a/pyanaconda/payload/__init__.py b/pyanaconda/payload/__init__.py -index 4fb40cb..8b48625 100644 ---- a/pyanaconda/payload/__init__.py -+++ b/pyanaconda/payload/__init__.py -@@ -563,7 +563,7 @@ class Payload(metaclass=ABCMeta): - - :returns: None - """ -- if os.path.exists(util.getSysroot() + "/usr/sbin/new-kernel-pkg"): -+ if os.path.exists(util.getSysroot() + "/sbin/new-kernel-pkg"): - use_dracut = False - else: - log.warning("new-kernel-pkg does not exist - grubby wasn't installed? " -diff --git a/pyanaconda/payload/livepayload.py b/pyanaconda/payload/livepayload.py -index 235a3b5..5052977 100644 ---- a/pyanaconda/payload/livepayload.py -+++ b/pyanaconda/payload/livepayload.py -@@ -166,7 +166,7 @@ class LiveImagePayload(Payload): - threadMgr.wait(THREAD_LIVE_PROGRESS) - - # Live needs to create the rescue image before bootloader is written -- if os.path.exists(util.getSysroot() + "/usr/sbin/new-kernel-pkg"): -+ if os.path.exists(util.getSysroot() + "/sbin/new-kernel-pkg"): - use_nkp = True - else: - log.warning("new-kernel-pkg does not exist - grubby wasn't installed?") -@@ -200,7 +200,7 @@ class LiveImagePayload(Payload): - util.execInSysroot("systemd-machine-id-setup", []) - - for kernel in self.kernel_version_list: -- if not os.path.exists(util.getSysroot() + "/usr/sbin/new-kernel-pkg"): -+ if not os.path.exists(util.getSysroot() + "/sbin/new-kernel-pkg"): - log.info("Regenerating BLS info for %s", kernel) - util.execInSysroot("kernel-install", ["add", - kernel, --- -2.7.4 - diff --git a/recipes-installer/anaconda/files/0051-always-write-fstab-after-install.patch b/recipes-installer/anaconda/files/0051-always-write-fstab-after-install.patch deleted file mode 100644 index 08abd93..0000000 --- a/recipes-installer/anaconda/files/0051-always-write-fstab-after-install.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 1dc4c484520fd34f0db971bd7158dc60ce6e7a50 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia <hongxu.jia@windriver.com> -Date: Sat, 29 Jun 2019 16:22:36 +0800 -Subject: [PATCH] always write fstab after install - -We should write the storage after doing the installation -which always writes fstab after instal, make sure the generated -/etc/fstab not overwritten by the one from package install. - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> ---- - pyanaconda/payload/dnfpayload.py | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/pyanaconda/payload/dnfpayload.py b/pyanaconda/payload/dnfpayload.py -index 512f217..cd6b209 100644 ---- a/pyanaconda/payload/dnfpayload.py -+++ b/pyanaconda/payload/dnfpayload.py -@@ -1485,11 +1485,6 @@ class DNFPayload(payload.PackagePayload): - if ks_repo.excludepkgs: - f.write("exclude=%s\n" % ",".join(ks_repo.excludepkgs)) - -- @property -- def needs_storage_configuration(self): -- """Should we write the storage before doing the installation?""" -- return True -- - def post_setup(self): - """Perform post-setup tasks. - --- -2.7.4 - diff --git a/recipes-installer/anaconda/files/0052-invoke-grub-install-to-generate-efi-filesystem.patch b/recipes-installer/anaconda/files/0052-invoke-grub-install-to-generate-efi-filesystem.patch index e17e182..fd4f5ea 100644 --- a/recipes-installer/anaconda/files/0052-invoke-grub-install-to-generate-efi-filesystem.patch +++ b/recipes-installer/anaconda/files/0052-invoke-grub-install-to-generate-efi-filesystem.patch @@ -11,34 +11,48 @@ Add a wraper to generate efi filesystem with fs_uuid located. Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Replace util.getSysroot() with conf.target.system_root. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 38. util.execInSysroot() has been removed and use +execWithRedirect() instead. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/bootloader/efi.py | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/pyanaconda/bootloader/efi.py b/pyanaconda/bootloader/efi.py -index 73d348b..6199b51 100644 ---- a/pyanaconda/bootloader/efi.py -+++ b/pyanaconda/bootloader/efi.py -@@ -129,6 +129,22 @@ class EFIBase(object): + pyanaconda/modules/storage/bootloader/efi.py | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/pyanaconda/modules/storage/bootloader/efi.py b/pyanaconda/modules/storage/bootloader/efi.py +index 2f1afd9306..a61c884f05 100644 +--- a/pyanaconda/modules/storage/bootloader/efi.py ++++ b/pyanaconda/modules/storage/bootloader/efi.py +@@ -128,6 +128,23 @@ class EFIBase(object): self.remove_efi_boot_target() self.add_efi_boot_target() -+ with open(util.getSysroot() + "/tmp/grub-mkimage-wrapper.sh", "w") as f: ++ with open(conf.target.system_root + "/tmp/grub-mkimage-wrapper.sh", "w") as f: + f.write('#!/bin/sh\n') + f.write('uuid=`grub-probe --target=fs_uuid /boot/efi/`\n') + f.write('echo "search.fs_uuid ${uuid} root" > /tmp/load.cfg\n') + f.write('echo "grub-mkimage -c /tmp/load.cfg $@ search_fs_uuid"\n') + f.write('grub-mkimage -c /tmp/load.cfg $@ search_fs_uuid\n') -+ os.chmod(util.getSysroot() + "/tmp/grub-mkimage-wrapper.sh", 0o755) ++ os.chmod(conf.target.system_root + "/tmp/grub-mkimage-wrapper.sh", 0o755) + -+ rc = util.execInSysroot("grub-install", ["--removable", -+ "--efi-directory=/boot/efi/", -+ "--boot-directory=%s" % self.config_dir, -+ "--grub-mkimage=/tmp/grub-mkimage-wrapper.sh", -+ "/boot/efi/" -+ ]) ++ rc = util.execWithRedirect("grub-install", ++ ["--removable", "--efi-directory=/boot/efi/", ++ "--boot-directory=%s" % self.config_dir, ++ "--grub-mkimage=/tmp/grub-mkimage-wrapper.sh", ++ "/boot/efi/"], ++ root=conf.target.system_root) + if rc: + raise BootLoaderError("boot loader install failed") ++ class EFIGRUB(EFIBase, GRUB2): """EFI GRUBv2""" diff --git a/recipes-installer/anaconda/files/0053-do-not-support-closest-mirror.patch b/recipes-installer/anaconda/files/0053-do-not-support-closest-mirror.patch index e1edcb4..023a725 100644 --- a/recipes-installer/anaconda/files/0053-do-not-support-closest-mirror.patch +++ b/recipes-installer/anaconda/files/0053-do-not-support-closest-mirror.patch @@ -6,17 +6,29 @@ Subject: [PATCH] do not support closest mirror Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37 on 20221020. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 39 on 20240304. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- pyanaconda/ui/gui/spokes/installation_source.glade | 1 - - pyanaconda/ui/gui/spokes/installation_source.py | 4 ---- - pyanaconda/ui/tui/spokes/installation_source.py | 5 ----- - 3 files changed, 10 deletions(-) + pyanaconda/ui/gui/spokes/installation_source.py | 1 - + pyanaconda/ui/tui/spokes/installation_source.py | 4 ---- + 3 files changed, 6 deletions(-) diff --git a/pyanaconda/ui/gui/spokes/installation_source.glade b/pyanaconda/ui/gui/spokes/installation_source.glade -index edd466b..6b6a373 100644 +index a72bfc72e8..86ed437996 100644 --- a/pyanaconda/ui/gui/spokes/installation_source.glade +++ b/pyanaconda/ui/gui/spokes/installation_source.glade -@@ -772,7 +772,6 @@ +@@ -353,7 +353,6 @@ <item id="https">https://</item> <item id="ftp">ftp://</item> <item id="nfs">nfs</item> @@ -25,40 +37,29 @@ index edd466b..6b6a373 100644 <signal name="changed" handler="on_protocol_changed" swapped="no"/> </object> diff --git a/pyanaconda/ui/gui/spokes/installation_source.py b/pyanaconda/ui/gui/spokes/installation_source.py -index 6f725a4..b342c28 100644 +index 1bcb330614..c4a7932e32 100644 --- a/pyanaconda/ui/gui/spokes/installation_source.py +++ b/pyanaconda/ui/gui/spokes/installation_source.py -@@ -950,10 +950,6 @@ class SourceSpoke(NormalSpoke, GUISpokeInputCheckHandler): - combo = self.builder.get_object("isoPartitionCombo") - combo.set_active(active) +@@ -613,7 +613,6 @@ class SourceSpoke(NormalSpoke, GUISpokeInputCheckHandler, SourceSwitchHandler): + self._iso_combo.set_active(active_idx) -- # We default to the mirror list, and then if the method tells us -- # something different later, we can change it. + # We defaults and if the method tells us something different later, we can change it. - self._protocol_combo_box.set_active_id(PROTOCOL_MIRROR) -- - if self.data.method.method == "url": - self._network_button.set_active(True) + self._url_type_combo_box.set_active_id(URL_TYPE_BASEURL) + self._updates_enabled = False diff --git a/pyanaconda/ui/tui/spokes/installation_source.py b/pyanaconda/ui/tui/spokes/installation_source.py -index d42423e..ed10deb 100644 +index 663b7c3d9c..845e6b0104 100644 --- a/pyanaconda/ui/tui/spokes/installation_source.py +++ b/pyanaconda/ui/tui/spokes/installation_source.py -@@ -118,8 +118,6 @@ class SourceSpoke(NormalTUISpoke, SourceSwitchHandler): - if not method.dir: - return _("Error setting up software source") - return os.path.basename(method.dir) -- elif self.payload.base_repo: -- return _("Closest mirror") - else: - return _("Nothing selected") - -@@ -161,9 +159,6 @@ class SourceSpoke(NormalTUISpoke, SourceSwitchHandler): - return +@@ -147,10 +147,6 @@ class SourceSpoke(NormalTUISpoke, SourceSwitchHandler): + self._container = ListColumnContainer(1, columns_width=78, spacing=1) if args == self.SET_NETWORK_INSTALL_MODE: -- if self.payload.mirrors_available: +- if conf.payload.enable_closest_mirror: - self._container.add(TextWidget(_("Closest mirror")), - self._set_network_close_mirror) +- self._container.add(TextWidget("http://"), self._set_network_url, SpecifyRepoSpoke.HTTP) diff --git a/recipes-installer/anaconda/files/0054-tweak-MAX_TREEINFO_DOWNLOAD_RETRIES.patch b/recipes-installer/anaconda/files/0054-tweak-MAX_TREEINFO_DOWNLOAD_RETRIES.patch index a6e0d42..2486a45 100644 --- a/recipes-installer/anaconda/files/0054-tweak-MAX_TREEINFO_DOWNLOAD_RETRIES.patch +++ b/recipes-installer/anaconda/files/0054-tweak-MAX_TREEINFO_DOWNLOAD_RETRIES.patch @@ -10,40 +10,31 @@ Tweak log debug to log info. Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/payload/__init__.py | 4 ++-- - pyanaconda/payload/install_tree_metadata.py | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/pyanaconda/payload/__init__.py b/pyanaconda/payload/__init__.py -index 8b48625..cbe2154 100644 ---- a/pyanaconda/payload/__init__.py -+++ b/pyanaconda/payload/__init__.py -@@ -428,9 +428,9 @@ class Payload(metaclass=ABCMeta): - - if self._install_tree_metadata: - version = self._install_tree_metadata.get_release_version() -- log.debug("using treeinfo release version of %s", version) -+ log.info("using treeinfo release version of %s", version) - else: -- log.debug("using default release version of %s", version) -+ log.info("using default release version of %s", version) - - return version - -diff --git a/pyanaconda/payload/install_tree_metadata.py b/pyanaconda/payload/install_tree_metadata.py -index 30abfd6..04799ce 100644 ---- a/pyanaconda/payload/install_tree_metadata.py -+++ b/pyanaconda/payload/install_tree_metadata.py -@@ -27,7 +27,7 @@ from pyanaconda.core import util, constants - from pyanaconda.anaconda_loggers import get_packaging_logger - log = get_packaging_logger() - --MAX_TREEINFO_DOWNLOAD_RETRIES = 6 -+MAX_TREEINFO_DOWNLOAD_RETRIES = 1 + pyanaconda/modules/payloads/payload/dnf/tree_info.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyanaconda/modules/payloads/payload/dnf/tree_info.py b/pyanaconda/modules/payloads/payload/dnf/tree_info.py +index b0aa5f1d28..265419a6f9 100644 +--- a/pyanaconda/modules/payloads/payload/dnf/tree_info.py ++++ b/pyanaconda/modules/payloads/payload/dnf/tree_info.py +@@ -89,7 +89,7 @@ class TreeInfoMetadata(object): + TREE_INFO_NAMES = [".treeinfo", "treeinfo"] + # The number of download retries. +- MAX_TREEINFO_DOWNLOAD_RETRIES = 6 ++ MAX_TREEINFO_DOWNLOAD_RETRIES = 1 - class InstallTreeMetadata(object): + def __init__(self): + """Create a new instance.""" -- 2.7.4 diff --git a/recipes-installer/anaconda/files/0055-tweak-time-setting.patch b/recipes-installer/anaconda/files/0055-tweak-time-setting.patch index 48c7369..9623e18 100644 --- a/recipes-installer/anaconda/files/0055-tweak-time-setting.patch +++ b/recipes-installer/anaconda/files/0055-tweak-time-setting.patch @@ -10,32 +10,40 @@ Subject: [PATCH] tweak time setting Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- pyanaconda/core/constants.py | 2 ++ pyanaconda/ui/gui/spokes/datetime_spoke.py | 2 +- - pyanaconda/ui/tui/spokes/time_spoke.py | 3 +-- - 3 files changed, 4 insertions(+), 3 deletions(-) + pyanaconda/ui/tui/spokes/time_spoke.py | 7 +------ + 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pyanaconda/core/constants.py b/pyanaconda/core/constants.py -index cdf5ef6..5e3cd7b 100644 +index b130f71fd9..70f677f304 100644 --- a/pyanaconda/core/constants.py +++ b/pyanaconda/core/constants.py -@@ -82,6 +82,8 @@ DEFAULT_KEYBOARD = "us" +@@ -76,6 +76,8 @@ DEFAULT_KEYBOARD = "us" DRACUT_SHUTDOWN_EJECT = "/run/initramfs/usr/lib/dracut/hooks/shutdown/99anaconda-eject.sh" +DEFAULT_TZ = "America/New_York" + - # Help. - HELP_DIR = "/usr/share/anaconda/help" - HELP_MAIN_PAGE_GUI = "Installation_Guide.xml" + # VNC questions + USEVNC = N_("Start VNC") + USETEXT = N_("Use text mode") diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py -index 98652cf..b312e05 100644 +index 2e0bc2ec21..c92c227700 100644 --- a/pyanaconda/ui/gui/spokes/datetime_spoke.py +++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py -@@ -65,7 +65,7 @@ SERVER_POOL = 1 - SERVER_WORKING = 2 - SERVER_USE = 3 +@@ -58,7 +58,7 @@ log = get_module_logger(__name__) + + __all__ = ["DatetimeSpoke"] -DEFAULT_TZ = "America/New_York" +DEFAULT_TZ = constants.DEFAULT_TZ @@ -43,10 +51,10 @@ index 98652cf..b312e05 100644 SPLIT_NUMBER_SUFFIX_RE = re.compile(r'([^0-9]*)([-+])([0-9]+)') diff --git a/pyanaconda/ui/tui/spokes/time_spoke.py b/pyanaconda/ui/tui/spokes/time_spoke.py -index e232344..411186b 100644 +index 755ea9043a..8a31913ef5 100644 --- a/pyanaconda/ui/tui/spokes/time_spoke.py +++ b/pyanaconda/ui/tui/spokes/time_spoke.py -@@ -201,7 +201,7 @@ class TimeSpoke(FirstbootSpokeMixIn, NormalTUISpoke): +@@ -125,7 +125,7 @@ class TimeSpoke(FirstbootSpokeMixIn, NormalTUISpoke): if kickstart_timezone: return _("%s timezone") % kickstart_timezone else: @@ -55,14 +63,18 @@ index e232344..411186b 100644 def _summary_text(self): """Return summary of current timezone & NTP configuration. -@@ -245,7 +245,6 @@ class TimeSpoke(FirstbootSpokeMixIn, NormalTUISpoke): - self._container = ListColumnContainer(1, columns_width=78, spacing=1) - - self._container.add(TextWidget(timezone_option), callback=self._timezone_callback) -- self._container.add(TextWidget(_("Configure NTP servers")), callback=self._configure_ntp_server_callback) +@@ -172,11 +172,6 @@ class TimeSpoke(FirstbootSpokeMixIn, NormalTUISpoke): + callback=self._timezone_callback + ) +- self._container.add( +- TextWidget(_("Configure NTP servers")), +- callback=self._configure_ntp_server_callback +- ) +- self.window.add_with_separator(self._container) + def _timezone_callback(self, data): -- 2.7.4 diff --git a/recipes-installer/anaconda/files/0056-Add-dracut-args-for-home-to-bootloader.patch b/recipes-installer/anaconda/files/0056-Add-dracut-args-for-home-to-bootloader.patch index 2d9f362..c1b5bf9 100644 --- a/recipes-installer/anaconda/files/0056-Add-dracut-args-for-home-to-bootloader.patch +++ b/recipes-installer/anaconda/files/0056-Add-dracut-args-for-home-to-bootloader.patch @@ -10,15 +10,19 @@ This also works when upgrading. Upstream-Status: Pending Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/bootloader/base.py | 5 +++++ + pyanaconda/modules/storage/bootloader/base.py | 5 +++++++++ 1 file changed, 5 insertions(+) -diff --git a/pyanaconda/bootloader/base.py b/pyanaconda/bootloader/base.py -index 0550745..d7506ac 100644 ---- a/pyanaconda/bootloader/base.py -+++ b/pyanaconda/bootloader/base.py -@@ -729,6 +729,11 @@ class BootLoader(object): +diff --git a/pyanaconda/modules/storage/bootloader/base.py b/pyanaconda/modules/storage/bootloader/base.py +index 71ca9c5c4..cfe84810e 100644 +--- a/pyanaconda/modules/storage/bootloader/base.py ++++ b/pyanaconda/modules/storage/bootloader/base.py +@@ -760,6 +760,11 @@ class BootLoader(object): if usr_device: dracut_devices.extend([usr_device]) diff --git a/recipes-installer/anaconda/files/0057-do-not-customize-window-theme.patch b/recipes-installer/anaconda/files/0057-do-not-customize-window-theme.patch index 817aa26..2762def 100644 --- a/recipes-installer/anaconda/files/0057-do-not-customize-window-theme.patch +++ b/recipes-installer/anaconda/files/0057-do-not-customize-window-theme.patch @@ -14,23 +14,39 @@ Also remove install-data-hook, which caused host contamination Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37. And it replaces metacity with gnome-kiosk in +upstream. Revert it and turn back to metacity. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 38 on 20231107. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 39 on 20240304. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - data/window-manager/config/Makefile.am | 7 +------ - pyanaconda/display.py | 2 +- - 2 files changed, 2 insertions(+), 7 deletions(-) + data/window-manager/config/Makefile.am | 6 +----- + pyanaconda/display.py | 6 +++--- + 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/data/window-manager/config/Makefile.am b/data/window-manager/config/Makefile.am -index 6d78347..f17ab6a 100644 +index 90e71d9161..5d7a2b80e1 100644 --- a/data/window-manager/config/Makefile.am +++ b/data/window-manager/config/Makefile.am -@@ -27,12 +27,7 @@ dist_schema_DATA = org.gnome.desktop.wm.keybindings.gschema.override \ +@@ -26,11 +26,7 @@ dist_schema_DATA = org.gnome.desktop.wm.keybindings.gschema.override \ # schemas they modify, so pretend that this is the case with symlinks and # create the compiled schema. install-data-hook: - $(MKDIR_P) $(DESTDIR)$(schemadir) - $(LN_S) -f /usr/share/glib-2.0/schemas/org.gnome.desktop.wm.keybindings.gschema.xml $(DESTDIR)$(schemadir) - $(LN_S) -f /usr/share/glib-2.0/schemas/org.gnome.desktop.wm.preferences.gschema.xml $(DESTDIR)$(schemadir) -- $(LN_S) -f /usr/share/glib-2.0/schemas/org.gnome.metacity.gschema.xml $(DESTDIR)$(schemadir) - $(LN_S) -f /usr/share/glib-2.0/schemas/org.gnome.desktop.enums.xml $(DESTDIR)$(schemadir) - glib-compile-schemas --strict $(DESTDIR)$(schemadir) + echo "pass" @@ -38,18 +54,28 @@ index 6d78347..f17ab6a 100644 uninstall-local: rm -f $(DESTDIR)$(schemadir)/*.xml diff --git a/pyanaconda/display.py b/pyanaconda/display.py -index f76bc30..afa03a6 100644 +index a00431c6c0..2c41a6c4cc 100644 --- a/pyanaconda/display.py +++ b/pyanaconda/display.py -@@ -172,7 +172,7 @@ def do_startup_x11_actions(): +@@ -204,16 +204,16 @@ def do_startup_x11_actions(): if 'XDG_DATA_DIRS' in os.environ: xdg_data_dirs = datadir + '/window-manager:' + os.environ['XDG_DATA_DIRS'] else: - xdg_data_dirs = datadir + '/window-manager:/usr/share' + xdg_data_dirs = '/usr/share' - childproc = util.startProgram(["metacity", "--display", ":1", "--sm-disable"], - env_add={'XDG_DATA_DIRS': xdg_data_dirs}) + def x11_preexec(): + # to set GUI subprocess SIGINT handler + signal.signal(signal.SIGINT, signal.SIG_IGN) + +- childproc = util.startProgram(["gnome-kiosk", "--display", ":1", "--sm-disable", "--x11"], ++ childproc = util.startProgram(["metacity", "--display", ":1", "--sm-disable"], + env_add={'XDG_DATA_DIRS': xdg_data_dirs}, + preexec_fn=x11_preexec) +- WatchProcesses.watch_process(childproc, "gnome-kiosk") ++ WatchProcesses.watch_process(childproc, "metacity") + + + def set_x_resolution(runres): -- 2.7.4 - diff --git a/recipes-installer/anaconda/files/0058-tweak-product-short-name.patch b/recipes-installer/anaconda/files/0058-tweak-product-short-name.patch index 78d5474..ba4f710 100644 --- a/recipes-installer/anaconda/files/0058-tweak-product-short-name.patch +++ b/recipes-installer/anaconda/files/0058-tweak-product-short-name.patch @@ -1,7 +1,7 @@ -From 939fba787597edf19835491f782bfdde3bdedfaf Mon Sep 17 00:00:00 2001 +From 802976bb4039e9adfd6c3f80816a78a305a545ab Mon Sep 17 00:00:00 2001 From: Hongxu Jia <hongxu.jia@windriver.com> Date: Mon, 30 Jul 2018 14:52:09 +0800 -Subject: [PATCH 58/65] tweak product short name +Subject: [PATCH] tweak product short name The yocto named its production with braces which caused short name with illegal character that broke lvm partition. @@ -9,15 +9,20 @@ with illegal character that broke lvm partition. Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 39 on 20240304. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + --- - pyanaconda/core/constants.py | 4 +++- + pyanaconda/product.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -diff --git a/pyanaconda/core/constants.py b/pyanaconda/core/constants.py -index cd83920..ccee2fd 100644 ---- a/pyanaconda/core/constants.py -+++ b/pyanaconda/core/constants.py -@@ -41,7 +41,9 @@ isFinal = product.isFinal +diff --git a/pyanaconda/product.py b/pyanaconda/product.py +index 048f4c4bf9..2b680cc9c6 100644 +--- a/pyanaconda/product.py ++++ b/pyanaconda/product.py +@@ -52,7 +52,9 @@ if productVersion == "development": # for use in device names, eg: "fedora", "rhel" shortProductName = productName.lower() # pylint: disable=no-member @@ -27,7 +32,4 @@ index cd83920..ccee2fd 100644 +elif productName.count(" "): # pylint: disable=no-member shortProductName = ''.join(s[0] for s in shortProductName.split()) - # DriverDisc Paths --- -2.7.4 - + diff --git a/recipes-installer/anaconda/files/0059-disable-dmraid.patch b/recipes-installer/anaconda/files/0059-disable-dmraid.patch deleted file mode 100644 index bac719a..0000000 --- a/recipes-installer/anaconda/files/0059-disable-dmraid.patch +++ /dev/null @@ -1,58 +0,0 @@ -From f6bf0fc76221574afcbb2a80aece929bf2ab8a85 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia <hongxu.jia@windriver.com> -Date: Sat, 29 Jun 2019 17:18:42 +0800 -Subject: [PATCH] disable dmraid - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> ---- - pyanaconda/argument_parsing.py | 4 ---- - pyanaconda/core/configuration/anaconda.py | 2 +- - pyanaconda/storage/initialization.py | 2 +- - 3 files changed, 2 insertions(+), 6 deletions(-) - -diff --git a/pyanaconda/argument_parsing.py b/pyanaconda/argument_parsing.py -index bd1eda8..d4b0b70 100644 ---- a/pyanaconda/argument_parsing.py -+++ b/pyanaconda/argument_parsing.py -@@ -520,10 +520,6 @@ def getArgumentParser(version_string, boot_cmdline=None): - - ap.add_argument("--gpt", action="store_true", default=False, help=help_parser.help_text("gpt")) - -- ap.add_argument("--nodmraid", dest="dmraid", action="store_false", default=True, -- help=help_parser.help_text("nodmraid")) -- ap.add_argument("--dmraid", action="store_true", help=help_parser.help_text("dmraid")) -- - ap.add_argument("--noibft", dest="ibft", action="store_false", default=True, - help=help_parser.help_text("noibft")) - ap.add_argument("--ibft", action="store_true", help=help_parser.help_text("ibft")) -diff --git a/pyanaconda/core/configuration/anaconda.py b/pyanaconda/core/configuration/anaconda.py -index 71e6e41..b61b634 100644 ---- a/pyanaconda/core/configuration/anaconda.py -+++ b/pyanaconda/core/configuration/anaconda.py -@@ -228,7 +228,7 @@ class AnacondaConfiguration(Configuration): - self.bootloader._set_option("nonibft_iscsi_boot", opts.nonibftiscsiboot) - - # Set the storage flags. -- self.storage._set_option("dmraid", opts.dmraid) -+ self.storage._set_option("dmraid", False) - self.storage._set_option("ibft", opts.ibft) - self.storage._set_option("gpt", opts.gpt) - self.storage._set_option("multipath_friendly_names", opts.multipath_friendly_names) -diff --git a/pyanaconda/storage/initialization.py b/pyanaconda/storage/initialization.py -index 729b442..264ebb9 100644 ---- a/pyanaconda/storage/initialization.py -+++ b/pyanaconda/storage/initialization.py -@@ -58,7 +58,7 @@ def enable_installer_mode(): - blivet_flags.keep_empty_ext_partitions = False - blivet_flags.discard_new = True - blivet_flags.selinux = conf.security.selinux -- blivet_flags.dmraid = conf.storage.dmraid -+ blivet_flags.dmraid = False - blivet_flags.ibft = conf.storage.ibft - blivet_flags.multipath_friendly_names = conf.storage.multipath_friendly_names - blivet_flags.allow_imperfect_devices = conf.storage.allow_imperfect_devices --- -2.7.4 - diff --git a/recipes-installer/anaconda/files/0060-tweak-shebang-of-bash.patch b/recipes-installer/anaconda/files/0060-tweak-shebang-of-bash.patch index b5ee974..f713667 100644 --- a/recipes-installer/anaconda/files/0060-tweak-shebang-of-bash.patch +++ b/recipes-installer/anaconda/files/0060-tweak-shebang-of-bash.patch @@ -18,7 +18,7 @@ index d31f70c..a774d45 100755 -#!/usr/bin/bash +#!/bin/bash # - # Quick script to attach to tmux where anaconda is running + # Quick script to attach to tmux where anaconda is running. # -- 2.7.4 diff --git a/recipes-installer/anaconda/files/0061-Tweak-label-name.patch b/recipes-installer/anaconda/files/0061-Tweak-label-name.patch index cd0e1ed..055cc31 100644 --- a/recipes-installer/anaconda/files/0061-Tweak-label-name.patch +++ b/recipes-installer/anaconda/files/0061-Tweak-label-name.patch @@ -9,40 +9,57 @@ the gui window, short them. Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37 on 20221020. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 38 on 20231107. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 39 on 20240304. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- pyanaconda/product.py | 4 ++++ - pyanaconda/ui/gui/spokes/welcome.py | 4 ++-- - 2 files changed, 6 insertions(+), 2 deletions(-) + pyanaconda/ui/gui/spokes/welcome.py | 5 +++-- + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pyanaconda/product.py b/pyanaconda/product.py -index 9d97dab..5548f99 100644 +index 2b680cc9c6..748feaf98f 100644 --- a/pyanaconda/product.py +++ b/pyanaconda/product.py -@@ -52,6 +52,10 @@ if productVersion == "development": - productVersion = "rawhide" +@@ -72,6 +72,10 @@ productVersion = trim_product_version_for_ui(productVersion) + def distributionText(): + if '(' in productName and ')' in productName: + return _("%(productName)s %(productVersion)s INSTALLATION") % \ + {"productName": productName.split()[0], "productVersion": productVersion} + - return _("%(productName)s %(productVersion)s INSTALLATION") % \ - {"productName": productName, "productVersion": productVersion} - + return _("%(productName)s %(productVersion)s INSTALLATION") % { + "productName": productName.upper(), + "productVersion": productVersion.upper() diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py -index c1ac605..dc8d9e6 100644 +index a33934c634..42e6237ec7 100644 --- a/pyanaconda/ui/gui/spokes/welcome.py +++ b/pyanaconda/ui/gui/spokes/welcome.py -@@ -39,7 +39,7 @@ from pyanaconda import flags - from pyanaconda import geoloc - from pyanaconda.core.i18n import _, C_ +@@ -37,7 +37,8 @@ from pyanaconda.product import distributionText, isFinal, productName, productVe + from pyanaconda import flags + from pyanaconda.core.i18n import _ from pyanaconda.core.util import ipmi_abort --from pyanaconda.core.constants import DEFAULT_LANG, WINDOW_TITLE_TEXT -+from pyanaconda.core.constants import DEFAULT_LANG, WINDOW_TITLE_TEXT, shortProductName +-from pyanaconda.core.constants import DEFAULT_LANG, WINDOW_TITLE_TEXT, TIMEZONE_PRIORITY_LANGUAGE ++from pyanaconda.core.constants import DEFAULT_LANG, WINDOW_TITLE_TEXT, \ ++ TIMEZONE_PRIORITY_LANGUAGE, shortProductName from pyanaconda.modules.common.constants.services import TIMEZONE, LOCALIZATION - + from pyanaconda.modules.common.util import is_module_available from pyanaconda.anaconda_loggers import get_module_logger -@@ -238,7 +238,7 @@ class WelcomeLanguageSpoke(LangLocaleHandler, StandaloneSpoke): +@@ -204,7 +205,7 @@ class WelcomeLanguageSpoke(StandaloneSpoke, LangLocaleHandler): welcomeLabel = self.builder.get_object("welcomeLabel") welcomeLabel.set_text(_("WELCOME TO %(name)s %(version)s.") % @@ -53,4 +70,3 @@ index c1ac605..dc8d9e6 100644 languageEntry = self.builder.get_object("languageEntry") -- 2.7.4 - diff --git a/recipes-installer/anaconda/files/0062-Mount-var-volatile-during-install.patch b/recipes-installer/anaconda/files/0062-Mount-var-volatile-during-install.patch index 99e327f..ed7c28d 100644 --- a/recipes-installer/anaconda/files/0062-Mount-var-volatile-during-install.patch +++ b/recipes-installer/anaconda/files/0062-Mount-var-volatile-during-install.patch @@ -9,51 +9,32 @@ caused systemd's journalctl failed to record boot log. Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/storage/fsset.py | 9 +++++++++ - 1 file changed, 9 insertions(+) + pyanaconda/modules/storage/devicetree/fsset.py | 7 +++++++ + 1 file changed, 7 insertions(+) -diff --git a/pyanaconda/storage/fsset.py b/pyanaconda/storage/fsset.py -index 6aa71a1..2addc56 100644 ---- a/pyanaconda/storage/fsset.py -+++ b/pyanaconda/storage/fsset.py -@@ -221,6 +221,7 @@ class FSSet(object): - self._sysfs = None - self._proc = None - self._devshm = None -+ self._volatile = None - self._usb = None - self._selinux = None - self._run = None -@@ -262,6 +263,12 @@ class FSSet(object): - return self._devshm - - @property -+ def volatile(self): -+ if not self._volatile: -+ self._volatile = NoDevice(fmt=get_format("tmpfs", device="tmpfs", mountpoint="/var/volatile")) -+ return self._volatile -+ -+ @property - def usb(self): - if not self._usb: - self._usb = NoDevice(fmt=get_format("usbfs", device="usbfs", mountpoint="/proc/bus/usb")) -@@ -510,6 +517,7 @@ class FSSet(object): - """ - devices = list(self.mountpoints.values()) + self.swap_devices - devices.extend([self.dev, self.devshm, self.devpts, self.sysfs, -+ self.volatile, - self.proc, self.selinux, self.usb, self.run]) - if isinstance(_platform, EFI): - devices.append(self.efivars) -@@ -572,6 +580,7 @@ class FSSet(object): - """ - devices = list(self.mountpoints.values()) + self.swap_devices - devices.extend([self.dev, self.devshm, self.devpts, self.sysfs, -+ self.volatile, - self.proc, self.usb, self.selinux, self.run]) - if isinstance(_platform, EFI): - devices.append(self.efivars) +diff --git a/pyanaconda/modules/storage/devicetree/fsset.py b/pyanaconda/modules/storage/devicetree/fsset.py +index dc4dab34f..ba66f529e 100644 +--- a/pyanaconda/modules/storage/devicetree/fsset.py ++++ b/pyanaconda/modules/storage/devicetree/fsset.py +@@ -131,6 +131,13 @@ def get_system_filesystems(devicetree): + mountpoint="/sys/fs/selinux" + ) + ), ++ NoDevice( ++ fmt=get_format( ++ "tmpfs", ++ device="tmpfs", ++ mountpoint="/var/volatile" ++ ) ++ ), + NoDevice( + fmt=get_format( + "usbfs", -- 2.7.4 diff --git a/recipes-installer/anaconda/files/0063-update-fstab-by-appending.patch b/recipes-installer/anaconda/files/0063-update-fstab-by-appending.patch index 056f44f..4a01326 100644 --- a/recipes-installer/anaconda/files/0063-update-fstab-by-appending.patch +++ b/recipes-installer/anaconda/files/0063-update-fstab-by-appending.patch @@ -10,15 +10,19 @@ to keep original tmpfs partitions. Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/storage/fsset.py | 2 +- + pyanaconda/modules/storage/devicetree/fsset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/pyanaconda/storage/fsset.py b/pyanaconda/storage/fsset.py -index 2addc56..7716e7d 100644 ---- a/pyanaconda/storage/fsset.py -+++ b/pyanaconda/storage/fsset.py -@@ -652,7 +652,7 @@ class FSSet(object): +diff --git a/pyanaconda/modules/storage/devicetree/fsset.py b/pyanaconda/modules/storage/devicetree/fsset.py +index dc4dab34f..0569bcb95 100644 +--- a/pyanaconda/modules/storage/devicetree/fsset.py ++++ b/pyanaconda/modules/storage/devicetree/fsset.py +@@ -649,7 +649,7 @@ class FSSet(object): # /etc/fstab fstab_path = os.path.normpath("%s/etc/fstab" % sysroot) fstab = self.fstab() diff --git a/recipes-installer/anaconda/files/0064-users.py-Fix-multilib-user-creation-error.patch b/recipes-installer/anaconda/files/0064-users.py-Fix-multilib-user-creation-error.patch index 1b1b6aa..a54a6a1 100644 --- a/recipes-installer/anaconda/files/0064-users.py-Fix-multilib-user-creation-error.patch +++ b/recipes-installer/anaconda/files/0064-users.py-Fix-multilib-user-creation-error.patch @@ -18,66 +18,74 @@ Do the same thing to `groupadd' and `useradd' Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Update for anaconda 32. The source code has been moved from users.py to +core/users.py. Update accordingly. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 38 on 20231107. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/users.py | 12 ++++++------ + pyanaconda/core/users.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -diff --git a/pyanaconda/users.py b/pyanaconda/users.py -index 7139d5f..4bbb9fd 100644 ---- a/pyanaconda/users.py -+++ b/pyanaconda/users.py -@@ -206,13 +206,13 @@ class Users(object): - if self._getgrnam(group_name, root): - raise ValueError("Group %s already exists" % group_name) +diff --git a/pyanaconda/core/users.py b/pyanaconda/core/users.py +index 25a6076a0d..f31a04acc7 100644 +--- a/pyanaconda/core/users.py ++++ b/pyanaconda/core/users.py +@@ -258,12 +258,12 @@ def create_group(group_name, gid=None, root=None): + if _getgrnam(group_name, root): + raise ValueError("Group %s already exists" % group_name) + +- args = ["-R", root] ++ args = [] + if gid is not None: + args.extend(["-g", str(gid)]) -- args = ["-R", root] -+ args = [] - if kwargs.get("gid") is not None: - args.extend(["-g", str(kwargs["gid"])]) + args.append(group_name) +- status = util.execWithRedirect("groupadd", args) ++ status = util.execWithRedirect("groupadd", args, root=root) - args.append(group_name) - with self._ensureLoginDefs(root): -- status = util.execWithRedirect("groupadd", args) -+ status = util.execWithRedirect("groupadd", args, root=root) + if status == 4: + raise ValueError("GID %s already exists" % gid) +@@ -355,7 +355,7 @@ def create_user(username, password=False, is_crypted=False, lock=False, + if check_user_exists(username, root): + raise ValueError("User %s already exists" % username) - if status == 4: - raise ValueError("GID %s already exists" % kwargs.get("gid")) -@@ -258,7 +258,7 @@ class Users(object): - if self.checkUserExists(user_name, root): - raise ValueError("User %s already exists" % user_name) +- args = ["-R", root] ++ args = [] -- args = ["-R", root] -+ args = [] + # Split the groups argument into a list of (username, gid or None) tuples + # the gid, if any, is a string since that makes things simpler +@@ -422,7 +422,7 @@ def create_user(username, password=False, is_crypted=False, lock=False, + args.extend(["-c", gecos]) - # Split the groups argument into a list of (username, gid or None) tuples - # the gid, if any, is a string since that makes things simpler -@@ -333,7 +333,7 @@ class Users(object): + args.append(username) +- status = util.execWithRedirect("useradd", args) ++ status = util.execWithRedirect("useradd", args, root=root) - args.append(user_name) - with self._ensureLoginDefs(root): -- status = util.execWithRedirect("useradd", args) -+ status = util.execWithRedirect("useradd", args, root=root) + if status == 4: + raise ValueError("UID %s already exists" % uid) +@@ -478,7 +478,7 @@ def set_user_password(username, password, is_crypted, lock, root="/"): + password = "!" + password + log.info("user account %s locked", username) - if status == 4: - raise ValueError("UID %s already exists" % kwargs.get("uid")) -@@ -390,7 +390,7 @@ class Users(object): - password = "!" + password - log.info("user account %s locked", username) +- proc = util.startProgram(["chpasswd", "-R", root, "-e"], stdin=subprocess.PIPE) ++ proc = util.startProgram(["chpasswd", "-e"], root=root, stdin=subprocess.PIPE) + proc.communicate(("%s:%s\n" % (username, password)).encode("utf-8")) + if proc.returncode != 0: + raise OSError("Unable to set password for new user: status=%s" % proc.returncode) +@@ -486,7 +486,7 @@ def set_user_password(username, password, is_crypted, lock, root="/"): + # Reset sp_lstchg to an empty string. On systems with no rtc, this + # field can be set to 0, which has a special meaning that the password + # must be reset on the next login. +- util.execWithRedirect("chage", ["-R", root, "-d", "", username]) ++ util.execWithRedirect("chage", ["-d", "", username], root=root) -- proc = util.startProgram(["chpasswd", "-R", root, "-e"], stdin=subprocess.PIPE) -+ proc = util.startProgram(["chpasswd", "-e"], root=root, stdin=subprocess.PIPE) - proc.communicate(("%s:%s\n" % (username, password)).encode("utf-8")) - if proc.returncode != 0: - raise OSError("Unable to set password for new user: status=%s" % proc.returncode) -@@ -398,7 +398,7 @@ class Users(object): - # Reset sp_lstchg to an empty string. On systems with no rtc, this - # field can be set to 0, which has a special meaning that the password - # must be reset on the next login. -- util.execWithRedirect("chage", ["-R", root, "-d", "", username]) -+ util.execWithRedirect("chage", [ "-d", "", username], root=root) - def setRootPassword(self, password, isCrypted=False, isLocked=False, algo=None, root="/"): - return self.setUserPassword("root", password, isCrypted, isLocked, algo, root) + def set_root_password(password, is_crypted=False, lock=False, root="/"): -- 2.7.4 diff --git a/recipes-installer/anaconda/files/0065-bootloader.py-fix-UEFI-multilib-installation.patch b/recipes-installer/anaconda/files/0065-bootloader.py-fix-UEFI-multilib-installation.patch index 5c0080b..70be36f 100644 --- a/recipes-installer/anaconda/files/0065-bootloader.py-fix-UEFI-multilib-installation.patch +++ b/recipes-installer/anaconda/files/0065-bootloader.py-fix-UEFI-multilib-installation.patch @@ -19,39 +19,52 @@ Imporve the fix which is compatible with OE Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Replace util.getSysroot() with conf.target.system_root. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Replace the last util.getSysroot() with conf.target.system_root, and +rebase since 0052-invoke-grub-install-to-generate-efi-filesystem.patch +updated. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/bootloader/efi.py | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - -diff --git a/pyanaconda/bootloader/efi.py b/pyanaconda/bootloader/efi.py -index 6199b51..b2413a0 100644 ---- a/pyanaconda/bootloader/efi.py -+++ b/pyanaconda/bootloader/efi.py -@@ -137,10 +137,25 @@ class EFIBase(object): + pyanaconda/modules/storage/bootloader/efi.py | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/pyanaconda/modules/storage/bootloader/efi.py b/pyanaconda/modules/storage/bootloader/efi.py +index a61c884f05..819b9f82a6 100644 +--- a/pyanaconda/modules/storage/bootloader/efi.py ++++ b/pyanaconda/modules/storage/bootloader/efi.py +@@ -136,10 +136,24 @@ class EFIBase(object): f.write('grub-mkimage -c /tmp/load.cfg $@ search_fs_uuid\n') - os.chmod(util.getSysroot() + "/tmp/grub-mkimage-wrapper.sh", 0o755) + os.chmod(conf.target.system_root + "/tmp/grub-mkimage-wrapper.sh", 0o755) + if self._is_32bit_firmware: -+ if os.path.exists(util.getSysroot()+"/usr/lib/grub/i386-efi"): ++ if os.path.exists(conf.target.system_root + "/usr/lib/grub/i386-efi"): + mod_path = "/usr/lib/grub/i386-efi" + else: + raise BootLoaderError("GRUB2 32-bit libdir not eixst") -+ + else: -+ if os.path.exists(util.getSysroot()+"/usr/lib64/grub/x86_64-efi"): ++ if os.path.exists(conf.target.system_root + "/usr/lib64/grub/x86_64-efi"): + mod_path = "/usr/lib64/grub/x86_64-efi" -+ elif os.path.exists(util.getSysroot()+"/usr/lib/grub/x86_64-efi"): ++ elif os.path.exists(conf.target.system_root + "/usr/lib/grub/x86_64-efi"): + mod_path = "/usr/lib/grub/x86_64-efi" + else: + raise BootLoaderError("GRUB2 64-bit libdir not eixst") + - rc = util.execInSysroot("grub-install", ["--removable", - "--efi-directory=/boot/efi/", - "--boot-directory=%s" % self.config_dir, - "--grub-mkimage=/tmp/grub-mkimage-wrapper.sh", -+ "--directory=%s" % mod_path, - "/boot/efi/" - ]) + rc = util.execWithRedirect("grub-install", + ["--removable", "--efi-directory=/boot/efi/", + "--boot-directory=%s" % self.config_dir, + "--grub-mkimage=/tmp/grub-mkimage-wrapper.sh", ++ "--directory=%s" % mod_path, + "/boot/efi/"], + root=conf.target.system_root) if rc: -- 2.7.4 diff --git a/recipes-installer/anaconda/files/0066-fix-calling-grub-mkconfig-failed.patch b/recipes-installer/anaconda/files/0066-fix-calling-grub-mkconfig-failed.patch index d02335d..5458dca 100644 --- a/recipes-installer/anaconda/files/0066-fix-calling-grub-mkconfig-failed.patch +++ b/recipes-installer/anaconda/files/0066-fix-calling-grub-mkconfig-failed.patch @@ -12,24 +12,32 @@ Make sure the existence of /etc/machine-id for Yocto Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebased for anaconda 39 on 20240403. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/bootloader/grub2.py | 6 ++++-- + pyanaconda/modules/storage/bootloader/grub2.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -diff --git a/pyanaconda/bootloader/grub2.py b/pyanaconda/bootloader/grub2.py -index 80b026a..447b4bf 100644 ---- a/pyanaconda/bootloader/grub2.py -+++ b/pyanaconda/bootloader/grub2.py -@@ -337,8 +337,10 @@ class GRUB2(BootLoader): +diff --git a/pyanaconda/modules/storage/bootloader/grub2.py b/pyanaconda/modules/storage/bootloader/grub2.py +index 52116bcee..441f89e73 100644 +--- a/pyanaconda/modules/storage/bootloader/grub2.py ++++ b/pyanaconda/modules/storage/bootloader/grub2.py +@@ -344,8 +344,10 @@ class GRUB2(BootLoader): if self.default is not None: - machine_id_path = util.getSysroot() + "/etc/machine-id" + machine_id_path = conf.target.system_root + "/etc/machine-id" if not os.access(machine_id_path, os.R_OK): - log.error("failed to read machine-id, default entry not set") - return + # Make sure the new system has a machine-id, it won't boot without it + # (and nor will some of the subsequent commands) + log.info("Generating machine ID") -+ util.execInSysroot("systemd-machine-id-setup", []) ++ util.execWithRedirect("systemd-machine-id-setup", [], root=conf.target.system_root) with open(machine_id_path, "r") as fd: machine_id = fd.readline().strip() diff --git a/recipes-installer/anaconda/files/0068-disable-chronyd.patch b/recipes-installer/anaconda/files/0068-disable-chronyd.patch deleted file mode 100644 index 0e72e2e..0000000 --- a/recipes-installer/anaconda/files/0068-disable-chronyd.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 2df5d760d88810da16a597c3f95ca8ef3abef2e7 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia <hongxu.jia@windriver.com> -Date: Mon, 1 Jul 2019 11:19:21 +0800 -Subject: [PATCH] disable chronyd - -There is no chronyd services provides, the systemd in Yocto -has its own ntp - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> ---- - pyanaconda/core/configuration/system.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pyanaconda/core/configuration/system.py b/pyanaconda/core/configuration/system.py -index 9b7ef96..9dfbadd 100644 ---- a/pyanaconda/core/configuration/system.py -+++ b/pyanaconda/core/configuration/system.py -@@ -99,7 +99,7 @@ class SystemSection(Section): - @property - def can_set_time_synchronization(self): - """Can we run the NTP daemon?""" -- return self._is_boot_iso or self._is_booted_os -+ return False - - @property - def can_activate_keyboard(self): --- -2.7.4 - diff --git a/recipes-installer/anaconda/files/0068-not-install-chrony-unintentionally.patch b/recipes-installer/anaconda/files/0068-not-install-chrony-unintentionally.patch new file mode 100644 index 0000000..4051cb2 --- /dev/null +++ b/recipes-installer/anaconda/files/0068-not-install-chrony-unintentionally.patch @@ -0,0 +1,25 @@ +Not install chrony unintentionally. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- + pyanaconda/modules/timezone/timezone.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyanaconda/modules/timezone/timezone.py b/pyanaconda/modules/timezone/timezone.py +index b5d5f7b3e..14e3e0619 100644 +--- a/pyanaconda/modules/timezone/timezone.py ++++ b/pyanaconda/modules/timezone/timezone.py +@@ -188,7 +188,7 @@ class TimezoneService(KickstartService): + requirements = [] + + # Add ntp service requirements. +- if self._ntp_enabled: ++ if False: + requirements.append( + Requirement.for_package(NTP_PACKAGE, reason="Needed to run NTP service.") + ) +-- +2.7.4 + diff --git a/recipes-installer/anaconda/files/0069-disable-location-detection-based-on-IP-address.patch b/recipes-installer/anaconda/files/0069-disable-location-detection-based-on-IP-address.patch deleted file mode 100644 index 26cc50a..0000000 --- a/recipes-installer/anaconda/files/0069-disable-location-detection-based-on-IP-address.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 4146f8d052dc2ad7c81beaba76d95dd95696370e Mon Sep 17 00:00:00 2001 -From: Hongxu Jia <hongxu.jia@windriver.com> -Date: Mon, 8 Apr 2019 13:56:52 +0800 -Subject: [PATCH 2/2] disable location detection based on IP address - -It network is not working, it failed. - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> ---- - pyanaconda/geoloc.py | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/pyanaconda/geoloc.py b/pyanaconda/geoloc.py -index 12059ce..dc332f7 100644 ---- a/pyanaconda/geoloc.py -+++ b/pyanaconda/geoloc.py -@@ -482,6 +482,9 @@ class FedoraGeoIPProvider(GeolocationBackend): - return "Fedora GeoIP" - - def _refresh(self): -+ pass -+ -+ def __refresh(self): - try: - reply = self._session.get(self.API_URL, timeout=constants.NETWORK_CONNECTION_TIMEOUT, verify=True) - if reply.status_code == requests.codes.ok: --- -2.7.4 - diff --git a/recipes-installer/anaconda/files/0070-remove-unsupported-icon-from-main-page-and-tweak-ico.patch b/recipes-installer/anaconda/files/0070-remove-unsupported-icon-from-main-page-and-tweak-ico.patch new file mode 100644 index 0000000..e9cf9d1 --- /dev/null +++ b/recipes-installer/anaconda/files/0070-remove-unsupported-icon-from-main-page-and-tweak-ico.patch @@ -0,0 +1,91 @@ +From cc5272a2946aa99d0442059581336c08d042bf8e Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Sat, 31 Aug 2019 13:20:26 +0800 +Subject: [PATCH] remove unsupported icon from main page and tweak icon layout + +Since the pages of Keyboard, Language Support, Network & Host Name +is not supported, remove icons from main page + +Exchange column SYSTEM and column LOCALIZATION, then the icon will +have enough space to layout correctly + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Update context for anaconda 32. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- + pyanaconda/ui/categories/localization.py | 2 +- + pyanaconda/ui/categories/system.py | 2 +- + pyanaconda/ui/gui/spokes/keyboard.py | 2 ++ + pyanaconda/ui/gui/spokes/language_support.py | 2 ++ + pyanaconda/ui/gui/spokes/network.py | 2 ++ + 5 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/pyanaconda/ui/categories/localization.py b/pyanaconda/ui/categories/localization.py +index 8aeddb3f8..a46eb162d 100644 +--- a/pyanaconda/ui/categories/localization.py ++++ b/pyanaconda/ui/categories/localization.py +@@ -31,4 +31,4 @@ class LocalizationCategory(SpokeCategory): + + @staticmethod + def get_sort_order(): +- return 100 ++ return 300 +diff --git a/pyanaconda/ui/categories/system.py b/pyanaconda/ui/categories/system.py +index c8b9e9f3c..96a7f0953 100644 +--- a/pyanaconda/ui/categories/system.py ++++ b/pyanaconda/ui/categories/system.py +@@ -31,4 +31,4 @@ class SystemCategory(SpokeCategory): + + @staticmethod + def get_sort_order(): +- return 300 ++ return 100 +diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py +index 0071c3925..15d976b5d 100644 +--- a/pyanaconda/ui/gui/spokes/keyboard.py ++++ b/pyanaconda/ui/gui/spokes/keyboard.py +@@ -294,6 +294,8 @@ class KeyboardSpoke(NormalSpoke): + @classmethod + def should_run(cls, environment, data): + """Should the spoke run?""" ++ return False ++ + if not is_module_available(LOCALIZATION): + return False + +diff --git a/pyanaconda/ui/gui/spokes/language_support.py b/pyanaconda/ui/gui/spokes/language_support.py +index d2f3edfa6..de9950a5b 100644 +--- a/pyanaconda/ui/gui/spokes/language_support.py ++++ b/pyanaconda/ui/gui/spokes/language_support.py +@@ -66,6 +66,8 @@ class LangsupportSpoke(NormalSpoke, LangLocaleHandler): + @classmethod + def should_run(cls, environment, data): + """Should the spoke run?""" ++ return False ++ + if not is_module_available(LOCALIZATION): + return False + +diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py +index 3cae5b448..1322bc515 100644 +--- a/pyanaconda/ui/gui/spokes/network.py ++++ b/pyanaconda/ui/gui/spokes/network.py +@@ -1469,6 +1469,8 @@ class NetworkSpoke(FirstbootSpokeMixIn, NormalSpoke): + @classmethod + def should_run(cls, environment, data): + """Should the spoke run?""" ++ return False ++ + if not FirstbootSpokeMixIn.should_run(environment, data): + return False + +-- +2.7.4 diff --git a/recipes-installer/anaconda/files/0071-disable-payloads-flatpak-ostree.patch b/recipes-installer/anaconda/files/0071-disable-payloads-flatpak-ostree.patch new file mode 100644 index 0000000..d5dfa1f --- /dev/null +++ b/recipes-installer/anaconda/files/0071-disable-payloads-flatpak-ostree.patch @@ -0,0 +1,33 @@ +Remove payloads flatpak and rpmostree which are not supported by oe. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- + pyanaconda/anaconda.py | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/pyanaconda/anaconda.py b/pyanaconda/anaconda.py +index ba93a098ac..a4be1b5d16 100644 +--- a/pyanaconda/anaconda.py ++++ b/pyanaconda/anaconda.py +@@ -81,10 +81,7 @@ class Anaconda(object): + # Get the type of the DBus payload module if any. + payload_type = self._get_dbus_payload_type() + +- if payload_type == PAYLOAD_TYPE_RPM_OSTREE: +- from pyanaconda.payload.rpmostreepayload import RPMOSTreePayload +- payload = RPMOSTreePayload() +- elif self.opts.liveinst: ++ if self.opts.liveinst: + from pyanaconda.payload.live import LiveOSPayload + payload = LiveOSPayload() + elif payload_type == PAYLOAD_TYPE_LIVE_IMAGE: diff --git a/recipes-installer/anaconda/files/0072-fix-sshd-config.patch b/recipes-installer/anaconda/files/0072-fix-sshd-config.patch new file mode 100644 index 0000000..4fce807 --- /dev/null +++ b/recipes-installer/anaconda/files/0072-fix-sshd-config.patch @@ -0,0 +1,42 @@ +The default config files are located in /etc/default in oe-core. Update to make +the checkbox 'Allow root SSH login with password' work. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- + pyanaconda/modules/users/installation.py | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/pyanaconda/modules/users/installation.py b/pyanaconda/modules/users/installation.py +index 36fbae0b1..e389cec09 100644 +--- a/pyanaconda/modules/users/installation.py ++++ b/pyanaconda/modules/users/installation.py +@@ -160,7 +160,7 @@ class SetSshKeysTask(Task): + class ConfigureRootPasswordSSHLoginTask(Task): + """Optionally add an override allowing root to login with password over SSH.""" + +- CONFIG_PATH = "etc/ssh/sshd_config.d/01-permitrootlogin.conf" ++ CONFIG_PATH = "etc/default/sshd-permitrootlogin" + + def __init__(self, sysroot, password_allowed): + """Create a new root password SSH login configuration task. +@@ -186,7 +186,13 @@ class ConfigureRootPasswordSSHLoginTask(Task): + f.write( + '# This file has been generated by the Anaconda Installer.\n' + '# Allow root to log in using ssh. Remove this file to opt-out.\n' +- 'PermitRootLogin yes\n' ++ 'SSHD_OPTS="-oPermitRootLogin=yes"\n' + ) + else: + log.debug("Not adding an override allowing root login with password via SSH.") ++ with open(os.path.join(self._sysroot, self.CONFIG_PATH), "wt") as f: ++ f.write( ++ '# This file has been generated by the Anaconda Installer.\n' ++ '# Disallow root to log in using ssh. Remove this file to opt-out.\n' ++ 'SSHD_OPTS="-oPermitRootLogin=no"\n' ++ ) diff --git a/recipes-installer/anaconda/files/0075-pyanaconda-payload-Fix-xserver-detection.patch b/recipes-installer/anaconda/files/0075-pyanaconda-payload-Fix-xserver-detection.patch new file mode 100644 index 0000000..9b87505 --- /dev/null +++ b/recipes-installer/anaconda/files/0075-pyanaconda-payload-Fix-xserver-detection.patch @@ -0,0 +1,40 @@ +From 95e60867b3172eb64e3f720a3457923f70ea820c Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Mon, 1 Jul 2019 11:24:13 +0800 +Subject: [PATCH] pyanaconda: payload: Fix xserver detection + +When installing an image that has graphical interface, +/etc/systemd/system/default.target will point to multi-user.target +instead of graphical.target. + +To fix this, use the right rpm query to detect the presence of xserver. + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Update context for anaconda 32. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- + pyanaconda/modules/services/installation.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pyanaconda/modules/services/installation.py b/pyanaconda/modules/services/installation.py +index ead5b02fa2..9dc85b7982 100644 +--- a/pyanaconda/modules/services/installation.py ++++ b/pyanaconda/modules/services/installation.py +@@ -218,8 +218,8 @@ class ConfigureSystemdDefaultTargetTask(Task): + else: + ts = rpm.TransactionSet(conf.target.system_root) + +- if ts.dbMatch("provides", 'service(graphical-login)').count(): +- log.debug("A package with provides == service(graphical-login) is installed, " ++ if ts.dbMatch("provides", 'xserver-xorg').count(): ++ log.debug("A package with provides == xserver-xorg is installed, " + "using graphical.target.") + self._default_target = GRAPHICAL_TARGET + +-- +2.7.4 + diff --git a/recipes-installer/anaconda/files/0001-limit-product-name-less-then-30-chars.patch b/recipes-installer/anaconda/files/0076-limit-product-name-less-then-30-chars.patch index 7123f19..be9a1fd 100644 --- a/recipes-installer/anaconda/files/0001-limit-product-name-less-then-30-chars.patch +++ b/recipes-installer/anaconda/files/0076-limit-product-name-less-then-30-chars.patch @@ -8,20 +8,24 @@ Previously 40 is still too long, which broke gui window layout Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 34. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - pyanaconda/storage/root.py | 2 +- + pyanaconda/modules/storage/devicetree/root.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/pyanaconda/storage/root.py b/pyanaconda/storage/root.py -index a321899..4e3b7aa 100644 ---- a/pyanaconda/storage/root.py -+++ b/pyanaconda/storage/root.py -@@ -160,7 +160,7 @@ def get_release_string(): - if os.access(filename, os.R_OK): - (rel_name, rel_ver) = _release_from_os_release(filename) +diff --git a/pyanaconda/modules/storage/devicetree/root.py b/pyanaconda/modules/storage/devicetree/root.py +index 1af402e2d..b375e9164 100644 +--- a/pyanaconda/modules/storage/devicetree/root.py ++++ b/pyanaconda/modules/storage/devicetree/root.py +@@ -174,7 +174,7 @@ def get_release_string(chroot): + except ValueError: + pass - return rel_arch, rel_name, rel_ver -+ return rel_arch, rel_name[0:30], rel_ver ++ return rel_arch, rel_name[:30], rel_ver def _release_from_redhat_release(fn): diff --git a/recipes-installer/anaconda/files/0078-anaconda.py-use-Fedora-as-default-product.patch b/recipes-installer/anaconda/files/0078-anaconda.py-use-Fedora-as-default-product.patch new file mode 100644 index 0000000..aa00c5a --- /dev/null +++ b/recipes-installer/anaconda/files/0078-anaconda.py-use-Fedora-as-default-product.patch @@ -0,0 +1,37 @@ +From 8d761383e0bdb9ce0d4c3f4efe1d14ffc0e06ba4 Mon Sep 17 00:00:00 2001 +From: Kai Kang <kai.kang@windriver.com> +Date: Mon, 2 Aug 2021 16:25:42 +0800 +Subject: [PATCH] anaconda.py: use 'Fedora' as default product + +It used to use 'Fedora' as default product in Anaconda 32. But it +changed to get from /etc/os-release file. Set it with 'Fedora' directly +for oe. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- + anaconda.py | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/anaconda.py b/anaconda.py +index 2b3b42d19a..441309d816 100755 +--- a/anaconda.py ++++ b/anaconda.py +@@ -208,8 +208,7 @@ if __name__ == "__main__": + ) + else: + conf.set_from_detected_profile( +- util.get_os_release_value("ID"), +- util.get_os_release_value("VARIANT_ID"), ++ 'fedora' + ) + + conf.set_from_files() +-- +2.25.1 + diff --git a/recipes-installer/anaconda/files/0079-find-live-os-image-for-oe.patch b/recipes-installer/anaconda/files/0079-find-live-os-image-for-oe.patch new file mode 100644 index 0000000..4a81da4 --- /dev/null +++ b/recipes-installer/anaconda/files/0079-find-live-os-image-for-oe.patch @@ -0,0 +1,43 @@ +The path of live os image in oe is hardcoded in anaconda-init. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 37. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Add mount option 'noload' to resolve mount error for F39. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +--- + pyanaconda/modules/payloads/source/live_os/initialization.py | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/pyanaconda/modules/payloads/source/live_os/initialization.py b/pyanaconda/modules/payloads/source/live_os/initialization.py +index 50de78a087..02656e3da7 100644 +--- a/pyanaconda/modules/payloads/source/live_os/initialization.py ++++ b/pyanaconda/modules/payloads/source/live_os/initialization.py +@@ -49,10 +49,7 @@ class DetectLiveOSImageTask(Task): + + :return: a path of a block device or None + """ +- block_device = \ +- self._check_block_device("/dev/mapper/live-base") or \ +- self._check_block_device("/dev/mapper/live-osimg-min") or \ +- self._check_mount_point("/run/rootfsbase") ++ block_device = '/dev/loop3' + + if not block_device: + raise SourceSetupError("No Live OS image found!") +@@ -157,7 +154,7 @@ class SetUpLiveOSSourceTask(SetUpMountTask): + device_path, + self._target_mount, + fstype="auto", +- options="ro" ++ options="ro,noload" + ) + except OSError as e: + raise SourceSetupError(str(e)) from e diff --git a/recipes-installer/anaconda/files/0080-customize-live-image-for-oe.patch b/recipes-installer/anaconda/files/0080-customize-live-image-for-oe.patch new file mode 100644 index 0000000..19d3b40 --- /dev/null +++ b/recipes-installer/anaconda/files/0080-customize-live-image-for-oe.patch @@ -0,0 +1,58 @@ + Customize live image for oe: + + * disable ssl verification + * customize repo path + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Rebase for anaconda 39 on 20240304. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +--- + pyanaconda/core/constants.py | 2 +- + pyanaconda/modules/common/structures/live_image.py | 2 +- + pyanaconda/modules/payloads/source/cdrom/cdrom.py | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/pyanaconda/core/constants.py b/pyanaconda/core/constants.py +index 3b7756698f..873e840cf3 100644 +--- a/pyanaconda/core/constants.py ++++ b/pyanaconda/core/constants.py +@@ -49,7 +49,7 @@ MOUNT_DIR = "/media/realroot" + DRACUT_ISODIR = "/run/install/source" + DRACUT_REPO_DIR = "/run/install/repo" + ISO_DIR = MOUNT_DIR + "/isodir" +-SOURCES_DIR = MOUNT_DIR + "/sources" ++SOURCES_DIR = "/run/install/sources" + + # Names of repositories. + BASE_REPO_NAME = "anaconda" +diff --git a/pyanaconda/modules/common/structures/live_image.py b/pyanaconda/modules/common/structures/live_image.py +index b47e6252c5..6b3d37862e 100644 +--- a/pyanaconda/modules/common/structures/live_image.py ++++ b/pyanaconda/modules/common/structures/live_image.py +@@ -30,7 +30,7 @@ class LiveImageConfigurationData(DBusData): + self._url = "" + self._proxy = "" + self._checksum = "" +- self._ssl_verification_enabled = True ++ self._ssl_verification_enabled = False + + @property + def url(self) -> Str: +diff --git a/pyanaconda/modules/payloads/source/cdrom/cdrom.py b/pyanaconda/modules/payloads/source/cdrom/cdrom.py +index f1def79791..dd6c3fa13c 100644 +--- a/pyanaconda/modules/payloads/source/cdrom/cdrom.py ++++ b/pyanaconda/modules/payloads/source/cdrom/cdrom.py +@@ -93,7 +93,7 @@ class CdromSourceModule(PayloadSourceBase, MountingSourceMixin, RPMSourceMixin): + + def generate_repo_configuration(self): + """Generate RepoConfigurationData structure.""" +- return RepoConfigurationData.from_directory(self.mount_point) ++ return RepoConfigurationData.from_directory(self.mount_point + '/Packages') + + def set_up_with_tasks(self): + """Set up the installation source. diff --git a/recipes-installer/anaconda/files/0081-always-write-fstab-after-install.patch b/recipes-installer/anaconda/files/0081-always-write-fstab-after-install.patch new file mode 100644 index 0000000..9735d60 --- /dev/null +++ b/recipes-installer/anaconda/files/0081-always-write-fstab-after-install.patch @@ -0,0 +1,59 @@ +From e39c2490c93943dd2cd47aeaeeb828fada41158f Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Mon, 11 Oct 2021 16:52:15 +0800 +Subject: [PATCH] always write fstab after install + +We should write the storage after doing the installation +which always writes fstab after instal, make sure the generated +/etc/fstab not overwritten by the one from package install. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 37. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- + pyanaconda/installation.py | 18 +++++------------- + 1 file changed, 5 insertions(+), 13 deletions(-) + +diff --git a/pyanaconda/installation.py b/pyanaconda/installation.py +index 782859360c..0ce48bca8c 100644 +--- a/pyanaconda/installation.py ++++ b/pyanaconda/installation.py +@@ -351,10 +351,6 @@ class RunInstallationTask(InstallationTask): + ) + early_storage.append_dbus_tasks(STORAGE, storage_proxy.InstallWithTasks()) + +- if payload.type == PAYLOAD_TYPE_DNF: +- conf_task = storage_proxy.WriteConfigurationWithTask() +- early_storage.append_dbus_tasks(STORAGE, [conf_task]) +- + installation_queue.append(early_storage) + + # Run %pre-install scripts with the filesystem mounted and no packages +@@ -405,15 +401,11 @@ class RunInstallationTask(InstallationTask): + )) + installation_queue.append(payload_install) + +- # for some payloads storage is configured after the payload is installed +- if payload.type != PAYLOAD_TYPE_DNF: +- late_storage = TaskQueue( +- "Late storage configuration", +- _("Configuring storage") +- ) +- conf_task = storage_proxy.WriteConfigurationWithTask() +- late_storage.append_dbus_tasks(STORAGE, [conf_task]) +- installation_queue.append(late_storage) ++ # Always write configuration at late storage ++ late_storage = TaskQueue("Late storage configuration", _("Configuring storage")) ++ conf_task = storage_proxy.WriteConfigurationWithTask() ++ late_storage.append_dbus_tasks(STORAGE, [conf_task]) ++ installation_queue.append(late_storage) + + # Do bootloader. + bootloader_proxy = STORAGE.get_proxy(BOOTLOADER) +-- +2.27.0 + diff --git a/recipes-installer/anaconda/files/0082-fix-grub-efi-boot-failure.patch b/recipes-installer/anaconda/files/0082-fix-grub-efi-boot-failure.patch new file mode 100644 index 0000000..de9b4e3 --- /dev/null +++ b/recipes-installer/anaconda/files/0082-fix-grub-efi-boot-failure.patch @@ -0,0 +1,57 @@ +From 7fbf9968ec5ed62e60872b28e495e26c797f1e50 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Mon, 11 Oct 2021 17:07:20 +0800 +Subject: [PATCH] fix grub efi boot failure + +- Tweak efi_dir according to oe-core's EFI layout + +- Drop grub-mkrelpath which is not necessary for oe-core's EFI layout + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase for anaconda 39 on 20240304. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +--- + pyanaconda/modules/storage/bootloader/efi.py | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/pyanaconda/modules/storage/bootloader/efi.py b/pyanaconda/modules/storage/bootloader/efi.py +index 305d9228c7..f6ca7327ca 100644 +--- a/pyanaconda/modules/storage/bootloader/efi.py ++++ b/pyanaconda/modules/storage/bootloader/efi.py +@@ -55,6 +55,16 @@ class EFIBase(object): + value = '64' + return value + ++ @property ++ def _config_dir(self): ++ """ Full path to configuration directory. """ ++ return self._efi_config_dir ++ ++ @property ++ def config_file(self): ++ """ Full path to configuration file. """ ++ return "%s/grub/%s" % (self.config_dir, self._config_file) ++ + def efibootmgr(self, *args, **kwargs): + if not conf.target.is_hardware: + log.info("Skipping efibootmgr for image/directory install.") +@@ -221,11 +231,6 @@ class EFIGRUB(EFIBase, GRUB2): + if fs_uuid is None: + raise BootLoaderError("Could not get stage2 filesystem UUID") + +- grub_dir = util.execWithCapture("grub-mkrelpath", [grub_dir], +- root=conf.target.system_root) +- if not grub_dir: +- raise BootLoaderError("Could not get GRUB directory path") +- + fd.write("search --no-floppy --fs-uuid --set=dev %s\n" % fs_uuid) + fd.write("set prefix=($dev)%s\n" % grub_dir) + fd.write("export $prefix\n") +-- +2.27.0 + diff --git a/recipes-installer/anaconda/files/0083-reset-default-autopart-type.patch b/recipes-installer/anaconda/files/0083-reset-default-autopart-type.patch new file mode 100644 index 0000000..00a6d17 --- /dev/null +++ b/recipes-installer/anaconda/files/0083-reset-default-autopart-type.patch @@ -0,0 +1,33 @@ +It introduced a new variable default_scheme to replace the old one +DEFAULT_AUTOPART_TYPE. Both of the default values are 'LVM'. But it is +overridden by 'BTRFS' in fedora.conf which is used as default profile for OE. +Because it fails to create home directory for new users, reset to use 'LVM' to +fix the issue and for backward compatile as well. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +Update file path for anaconda 37. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +--- + data/profile.d/fedora.conf | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/data/profile.d/fedora.conf b/data/profile.d/fedora.conf +index d4fe6d0f26..73c3123a36 100644 +--- a/data/profile.d/fedora.conf ++++ b/data/profile.d/fedora.conf +@@ -14,10 +14,6 @@ default_on_boot = FIRST_WIRED_WITH_LINK + [Bootloader] + efi_dir = fedora + +-[Storage] +-default_scheme = BTRFS +-btrfs_compression = zstd:1 +- + [User Interface] + help_directory = /usr/share/anaconda/help/fedora + custom_stylesheet = /usr/share/anaconda/pixmaps/fedora.css diff --git a/recipes-installer/anaconda/files/0084-conf-system-not-livecd.patch b/recipes-installer/anaconda/files/0084-conf-system-not-livecd.patch new file mode 100644 index 0000000..df2bba2 --- /dev/null +++ b/recipes-installer/anaconda/files/0084-conf-system-not-livecd.patch @@ -0,0 +1,24 @@ +Though anaconda is booted with option `--method=livecd`, it does NOT boot a +real live cd environment. Set it with False for oe. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +--- + pyanaconda/core/configuration/system.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyanaconda/core/configuration/system.py b/pyanaconda/core/configuration/system.py +index 3e539dbed1..1716ea1a0e 100644 +--- a/pyanaconda/core/configuration/system.py ++++ b/pyanaconda/core/configuration/system.py +@@ -48,7 +48,7 @@ class SystemSection(Section): + @property + def _is_live_os(self): + """Are we running in the live OS?""" +- return self._type is SystemType.LIVE_OS ++ return False + + @property + def _is_booted_os(self): diff --git a/recipes-installer/anaconda/files/0085-catch-all-exceptions-for-screensaver-inhibition.patch b/recipes-installer/anaconda/files/0085-catch-all-exceptions-for-screensaver-inhibition.patch new file mode 100644 index 0000000..60dfb65 --- /dev/null +++ b/recipes-installer/anaconda/files/0085-catch-all-exceptions-for-screensaver-inhibition.patch @@ -0,0 +1,16 @@ + pyanaconda/screensaver.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyanaconda/screensaver.py b/pyanaconda/screensaver.py +index dfa3191f04..e8d428ea86 100644 +--- a/pyanaconda/screensaver.py ++++ b/pyanaconda/screensaver.py +@@ -94,7 +94,7 @@ def inhibit_screensaver(): + ) + session_proxy = SCREENSAVER.get_proxy() + inhibit_id = session_proxy.Inhibit("anaconda", "Installing") +- except DBusError as e: ++ except Exception as e: + log.warning("Unable to inhibit the screensaver: %s", e) + + diff --git a/recipes-installer/anaconda/files/81-add-env-file-for-sshd.ks b/recipes-installer/anaconda/files/81-add-env-file-for-sshd.ks new file mode 100644 index 0000000..5b6d382 --- /dev/null +++ b/recipes-installer/anaconda/files/81-add-env-file-for-sshd.ks @@ -0,0 +1,3 @@ +%post +sed -i '/^ExecStart=/iEnvironmentFile=-/etc/default/sshd-permitrootlogin' /lib/systemd/system/sshd@.service +%end diff --git a/recipes-installer/anaconda/files/fedora.css b/recipes-installer/anaconda/files/fedora.css new file mode 100644 index 0000000..5c0a466 --- /dev/null +++ b/recipes-installer/anaconda/files/fedora.css @@ -0,0 +1,37 @@ +/* Anaconda gtk style overrides for Fedora */ + +/* vendor-specific colors */ +@define-color fedora #51a2da; + +/* logo and sidebar classes */ + +/* The sidebar consists of three parts: a background, a logo, and a product logo, + * rendered in that order. The product logo is empty by default and is intended + * to be overridden by a stylesheet in product.img. + */ +.logo-sidebar { + background-image: url('/usr/share/anaconda/pixmaps/sidebar-bg.png'); + background-color: @fedora; + background-repeat: no-repeat; +} + +/* Add a logo to the sidebar */ +.logo { + background-image: url('/usr/share/anaconda/pixmaps/sidebar-logo.png'); + background-position: 50% 10%; + background-repeat: no-repeat; + background-color: transparent; +} + +/* This is a placeholder to be filled by a product-specific logo. */ +.product-logo { + background-image: none; + background-color: transparent; +} + +AnacondaSpokeWindow #nav-box { + background-color: @fedora; + background-image: url('/usr/share/anaconda/pixmaps/topbar-bg.png'); + background-repeat: repeat; + color: white; +} diff --git a/recipes-installer/anaconda/python3-anaconda_30.25.6.bb b/recipes-installer/anaconda/python3-anaconda_30.25.6.bb deleted file mode 100755 index 2a99ee5..0000000 --- a/recipes-installer/anaconda/python3-anaconda_30.25.6.bb +++ /dev/null @@ -1,158 +0,0 @@ -SUMMARY = "The anaconda package" -DESCRIPTION = "The anaconda package" -HOMEPAGE = "http://fedoraproject.org/wiki/Anaconda" -LICENSE = "GPLv2" -SECTION = "devel" - -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" - -DEPENDS = "e2fsprogs gettext libarchive \ - pango python3 rpm \ - " - -DEPENDS += "libxklavier glade libxml2-native \ - gdk-pixbuf-native \ - " - -S = "${WORKDIR}/git" - -RDEPENDS_${PN} = "e2fsprogs e2fsprogs-e2fsck e2fsprogs-mke2fs \ - e2fsprogs-tune2fs e2fsprogs-resize2fs \ - ntfsprogs xfsprogs btrfs-tools nfs-utils-client \ - parted dosfstools gzip libarchive lvm2 \ - squashfs-tools openssh python3 python3-misc \ - python3-modules python3-dbus python3-pyparted \ - python3-pykickstart \ - dmidecode python3-meh python3-libreport localedef \ - python3-pygobject python3-rpm grub usermode tigervnc \ - tzdata tzdata-misc tzdata-posix tzdata-right tzdata-africa \ - tzdata-americas tzdata-antarctica tzdata-arctic tzdata-asia \ - tzdata-atlantic tzdata-australia tzdata-europe tzdata-pacific \ - keybinder module-init-tools dnf util-linux efibootmgr \ - ca-certificates isomd5sum \ - btrfs-tools ntfs-3g iproute2 mdadm shadow chkconfig \ - util-linux-swaponoff util-linux-uuidgen python3-blivet \ - xrandr glibc-charmaps glibc-localedatas \ - python3-pytz python3-langtable libpwquality \ - python3-ntplib libgnomekbd libtimezonemap \ - procps rsync glibc-utils python3-pid \ - python3-ordered-set python3-wrapt python3-coverage \ - python3-requests-file python3-requests-ftp \ - python3-blivetgui librsvg librsvg-gtk bash \ - python3-systemd python3-pydbus python3-simpleline \ - python3-productmd \ - " - -RDEPENDS_${PN} += "networkmanager \ - network-manager-applet \ -" - -SRC_URI = "git://github.com/rhinstaller/anaconda;protocol=https;branch=f30-release \ - file://81-edit-sudoers.ks \ - file://81-systemd-preset-all.ks \ - file://0001-do-not-build-po-and-doc.patch \ - file://0002-do-not-load-the-system-wide-Xresources.patch \ - file://0003-tweak-iso-mount-dir-and-kernel-name.patch \ - file://0004-customize-default-option-for-OE.patch \ - file://0006-livepayload-fix-mount-install-tree-failed.patch \ - file://0007-dnfpayload.py-customize-for-OE.patch \ - file://0009-dynamic-detect-workable-locale.patch \ - file://0010-reboot-unconditionally.patch \ - file://0011-disable-audit.patch \ - file://0012-bootloader.py-Change-grub2-settings-to-match-oe-core.patch \ - file://0013-tweak-detect-kernel-version.patch \ - file://0016-kickstart-not-support-Authselect-Firewall-Firstboot.patch \ - file://0017-invisible-help-button.patch \ - file://0018-disable-non-implemented-functions.patch \ - file://0019-support-UEFI-boot.patch \ - file://0022-fix-quoted-empty-string-failed.patch \ - file://0023-do-not-support-ISO-hold-by-hard-drive-partitions.patch \ - file://0024-fix-cannot-stat-usr-share-gettext-gettext.h.patch \ - file://0025-tweak-bootloader-fs-type.patch \ - file://0026-support-timezone-setting.patch \ - file://0027-disable-ntp-support.patch \ - file://0028-do-not-support-manually-set-time.patch \ - file://0029-support-user-account-creation.patch \ - file://0030-detect-existence-of-Xorg.patch \ - file://0031-fix-write-network-conf-failed-while-liveinst.patch \ - file://0033-text-repository-setting-do-not-support-local-ISO-fil.patch \ - file://0034-text-repository-setting-support-http-proxy.patch \ - file://0035-set-keyboard-xlayouts-with-us-by-default.patch \ - file://0036-do-not-support-network-setting-for-now.patch \ - file://0037-tweak-boot-storage-sanity-check.patch \ - file://0038-support-to-get-kickstart-from-network.patch \ - file://0039-support-authentication-for-kickstart.patch \ - file://0040-support-downloading-file-from-http-ftp-server-to-tar.patch \ - file://0041-live-install-supports-kickstart.patch \ - file://0042-support-initramfs-boot.patch \ - file://0043-fix-hang-while-installed-system-reboot.patch \ - file://0044-fix-installed-system-boot-from-encrypt-fs-failed.patch \ - file://0045-installation-destination-disable-iSCSI-network-disks.patch \ - file://0046-update-region-while-city-changes.patch \ - file://0047-remove-incorrect-prefix-of-addon-repo-url.patch \ - file://0048-fix-write-sysconfig-network-failed.patch \ - file://0049-pyanaconda-ui-gui-utils.py-tweak-mouse-arrow.patch \ - file://0050-tweak-search-location-of-new-kernel-pkg.patch \ - file://0051-always-write-fstab-after-install.patch \ - file://0052-invoke-grub-install-to-generate-efi-filesystem.patch \ - file://0053-do-not-support-closest-mirror.patch \ - file://0054-tweak-MAX_TREEINFO_DOWNLOAD_RETRIES.patch \ - file://0055-tweak-time-setting.patch \ - file://0056-Add-dracut-args-for-home-to-bootloader.patch \ - file://0057-do-not-customize-window-theme.patch \ - file://0058-tweak-product-short-name.patch \ - file://0059-disable-dmraid.patch \ - file://0060-tweak-shebang-of-bash.patch \ - file://0061-Tweak-label-name.patch \ - file://0062-Mount-var-volatile-during-install.patch \ - file://0063-update-fstab-by-appending.patch \ - file://0064-users.py-Fix-multilib-user-creation-error.patch \ - file://0065-bootloader.py-fix-UEFI-multilib-installation.patch \ - file://0066-fix-calling-grub-mkconfig-failed.patch \ - file://0068-disable-chronyd.patch \ - file://0069-disable-location-detection-based-on-IP-address.patch \ - file://0001-pyanaconda-payload-Fix-xserver-detection.patch \ - file://0001-limit-product-name-less-then-30-chars.patch \ - " - -SRCREV = "5c492721676257d239ebc38fbacafc96f944f856" - -FILES_${PN}-dbg += "${libexecdir}/anaconda/.debug ${PYTHON_SITEPACKAGES_DIR}/pyanaconda/.debug" -FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/pyanaconda/_isys.a" -FILES_${PN} = "/lib ${libdir} ${sysconfdir} ${bindir} ${sbindir} ${libexecdir} \ - ${datadir}/anaconda ${datadir}/applications ${datadir}/glade \ - ${PYTHON_SITEPACKAGES_DIR}/pyanaconda ${PYTHON_SITEPACKAGES_DIR}/log_picker \ - ${datadir}/themes \ -" -FILES_${PN}-misc = "/usr/lib" -PACKAGES += "${PN}-misc" -RDEPENDS_${PN}-misc += "bash python3-core" - -EXTRA_OECONF += "--disable-selinux \ - --with-sysroot=${PKG_CONFIG_SYSROOT_DIR} \ -" - -inherit distro_features_check -REQUIRED_DISTRO_FEATURES = "systemd x11" - -inherit autotools-brokensep gettext python3native pkgconfig gobject-introspection - -do_configure_prepend() { - ( cd ${S}; STAGING_DATADIR_NATIVE=${STAGING_DATADIR_NATIVE} ${S}/autogen.sh --noconfigure) -} - -do_install_append() { - install -m 644 ${WORKDIR}/81-edit-sudoers.ks ${D}${datadir}/anaconda/post-scripts - install -m 644 ${WORKDIR}/81-systemd-preset-all.ks ${D}${datadir}/anaconda/post-scripts - install -m 644 ${S}/widgets/src/resources/*.svg ${D}${datadir}/anaconda/pixmaps - install -m 644 ${S}/widgets/src/resources/*.png ${D}${datadir}/anaconda/pixmaps -} - -python __anonymous () { - if not bb.utils.contains("PACKAGE_CLASSES", "package_rpm", True, False, d): - raise bb.parse.SkipPackage('Anaconda requires RPM packages to be the default in PACKAGE_CLASSES.') -} - -COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)' -COMPATIBLE_HOST_armv7a = 'null' -COMPATIBLE_HOST_armv7ve = 'null' diff --git a/recipes-installer/anaconda/python3-anaconda_39.32.6.bb b/recipes-installer/anaconda/python3-anaconda_39.32.6.bb new file mode 100755 index 0000000..518d596 --- /dev/null +++ b/recipes-installer/anaconda/python3-anaconda_39.32.6.bb @@ -0,0 +1,195 @@ +SUMMARY = "The anaconda package" +DESCRIPTION = "The anaconda package" +HOMEPAGE = "http://fedoraproject.org/wiki/Anaconda" +LICENSE = "GPL-2.0-only" +SECTION = "devel" + +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +DEPENDS = "gdk-pixbuf-native e2fsprogs gettext glade libxklavier rpm" + +SRC_URI = "git://github.com/rhinstaller/anaconda.git;protocol=https;branch=fedora-39 \ + file://fedora.css \ + file://81-edit-sudoers.ks \ + file://81-systemd-preset-all.ks \ + file://81-add-env-file-for-sshd.ks \ + file://0001-do-not-build-po-and-doc.patch \ + file://0002-do-not-load-the-system-wide-Xresources.patch \ + file://0003-tweak-iso-mount-dir-and-kernel-name.patch \ + file://0004-customize-default-option-for-OE.patch \ + file://0007-dnfpayload.py-customize-for-OE.patch \ + file://0009-dynamic-detect-workable-locale.patch \ + file://0010-reboot-unconditionally.patch \ + file://0012-bootloader.py-Change-grub2-settings-to-match-oe-core.patch \ + file://0013-tweak-detect-kernel-version.patch \ + file://0016-kickstart-not-support-Authselect-Firewall-Firstboot.patch \ + file://0017-invisible-help-button.patch \ + file://0018-disable-non-implemented-functions.patch \ + file://0019-support-UEFI-boot.patch \ + file://0022-fix-quoted-empty-string-failed.patch \ + file://0023-do-not-support-ISO-hold-by-hard-drive-partitions.patch \ + file://0024-fix-cannot-stat-usr-share-gettext-gettext.h.patch \ + file://0025-tweak-bootloader-fs-type.patch \ + file://0026-support-timezone-setting.patch \ + file://0028-do-not-support-manually-set-time.patch \ + file://0030-detect-existence-of-Xorg.patch \ + file://0033-text-repository-setting-do-not-support-local-ISO-fil.patch \ + file://0034-text-repository-setting-support-http-proxy.patch \ + file://0036-do-not-support-network-setting-for-now.patch \ + file://0038-support-to-get-kickstart-from-network.patch \ + file://0039-support-authentication-for-kickstart.patch \ + file://0042-support-initramfs-boot.patch \ + file://0044-fix-installed-system-boot-from-encrypt-fs-failed.patch \ + file://0045-installation-destination-disable-iSCSI-network-disks.patch \ + file://0046-update-region-while-city-changes.patch \ + file://0048-fix-write-sysconfig-network-failed.patch \ + file://0049-pyanaconda-ui-gui-utils.py-tweak-mouse-arrow.patch \ + file://0052-invoke-grub-install-to-generate-efi-filesystem.patch \ + file://0053-do-not-support-closest-mirror.patch \ + file://0054-tweak-MAX_TREEINFO_DOWNLOAD_RETRIES.patch \ + file://0055-tweak-time-setting.patch \ + file://0056-Add-dracut-args-for-home-to-bootloader.patch \ + file://0057-do-not-customize-window-theme.patch \ + file://0058-tweak-product-short-name.patch \ + file://0060-tweak-shebang-of-bash.patch \ + file://0061-Tweak-label-name.patch \ + file://0062-Mount-var-volatile-during-install.patch \ + file://0063-update-fstab-by-appending.patch \ + file://0064-users.py-Fix-multilib-user-creation-error.patch \ + file://0065-bootloader.py-fix-UEFI-multilib-installation.patch \ + file://0066-fix-calling-grub-mkconfig-failed.patch \ + file://0068-not-install-chrony-unintentionally.patch \ + file://0070-remove-unsupported-icon-from-main-page-and-tweak-ico.patch \ + file://0071-disable-payloads-flatpak-ostree.patch \ + file://0072-fix-sshd-config.patch \ + file://0075-pyanaconda-payload-Fix-xserver-detection.patch \ + file://0076-limit-product-name-less-then-30-chars.patch \ + file://0078-anaconda.py-use-Fedora-as-default-product.patch \ + file://0079-find-live-os-image-for-oe.patch \ + file://0080-customize-live-image-for-oe.patch \ + file://0081-always-write-fstab-after-install.patch \ + file://0082-fix-grub-efi-boot-failure.patch \ + file://0083-reset-default-autopart-type.patch \ + file://0084-conf-system-not-livecd.patch \ + file://0085-catch-all-exceptions-for-screensaver-inhibition.patch \ + " + +SRCREV = "1a4aed721074ddcd84df88089024378c894ec65e" + +S = "${WORKDIR}/git" + +inherit autotools-brokensep features_check gettext gobject-introspection python3native pkgconfig +REQUIRED_DISTRO_FEATURES = "systemd x11 opengl" + +EXTRA_OECONF += "--disable-selinux \ + --disable-webui \ + --with-sysroot=${PKG_CONFIG_SYSROOT_DIR} \ + " + +do_configure:prepend() { + ( cd ${S}; STAGING_DATADIR_NATIVE=${STAGING_DATADIR_NATIVE} ${S}/autogen.sh --noconfigure) +} + +do_install:append() { + mkdir -p ${D}${datadir}/anaconda/post-scripts + install -m 644 ${WORKDIR}/81-edit-sudoers.ks ${D}${datadir}/anaconda/post-scripts + install -m 644 ${WORKDIR}/81-systemd-preset-all.ks ${D}${datadir}/anaconda/post-scripts + install -m 644 ${WORKDIR}/81-add-env-file-for-sshd.ks ${D}${datadir}/anaconda/post-scripts + install -m 644 ${S}/widgets/src/resources/*.svg ${D}${datadir}/anaconda/pixmaps + install -m 644 ${S}/widgets/src/resources/*.png ${D}${datadir}/anaconda/pixmaps + install -m 644 ${WORKDIR}/fedora.css ${D}${datadir}/anaconda/pixmaps +} + +python __anonymous () { + if not bb.utils.contains("PACKAGE_CLASSES", "package_rpm", True, False, d): + raise bb.parse.SkipPackage('Anaconda requires RPM packages to be the default in PACKAGE_CLASSES.') +} + +COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)' +COMPATIBLE_HOST:armv7a = 'null' +COMPATIBLE_HOST:armv7ve = 'null' + +FILES:${PN}-dbg += "${libexecdir}/anaconda/.debug ${PYTHON_SITEPACKAGES_DIR}/pyanaconda/.debug" +FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/pyanaconda/_isys.a" +FILES:${PN} = "\ + ${PYTHON_SITEPACKAGES_DIR}/pyanaconda \ + ${bindir} \ + ${datadir}/anaconda \ + ${datadir}/applications \ + ${datadir}/glade \ + ${datadir}/polkit-1 \ + ${datadir}/themes \ + ${libdir} \ + ${libexecdir} \ + ${sbindir} \ + ${sysconfdir} \ + " + +PACKAGES += "${PN}-misc" +FILES:${PN}-misc = "/usr/lib" + +RDEPENDS:${PN}-misc += "bash python3-core" + +RDEPENDS:${PN} = "bash \ + btrfs-tools \ + ca-certificates \ + chrony \ + dmidecode \ + dnf \ + dosfstools \ + e2fsprogs \ + e2fsprogs-e2fsck \ + e2fsprogs-mke2fs \ + e2fsprogs-resize2fs \ + e2fsprogs-tune2fs \ + efibootmgr \ + glibc-charmaps \ + glibc-localedatas \ + glibc-utils \ + grub \ + gzip \ + iproute2 \ + isomd5sum \ + keybinder \ + libarchive \ + libgnomekbd \ + libpwquality \ + librsvg-gtk \ + libtimezonemap \ + libxkbcommon \ + localedef \ + mdadm \ + network-manager-applet \ + nfs-utils-client \ + ntfs-3g \ + ntfsprogs \ + openssh \ + procps \ + python3-blivetgui \ + python3-core \ + python3-coverage \ + python3-dasbus \ + python3-langtable \ + python3-libreport \ + python3-meh \ + python3-ntplib \ + python3-ordered-set \ + python3-productmd \ + python3-pytz \ + python3-requests-file \ + python3-requests-ftp \ + python3-simpleline \ + python3-systemd \ + python3-wrapt \ + python3-zoneinfo \ + rsync \ + squashfs-tools \ + tigervnc \ + tzdata \ + usermode \ + util-linux \ + util-linux-swaponoff \ + util-linux-uuidgen \ + xfsprogs \ + xrandr \ + " diff --git a/recipes-installer/images/core-image-anaconda-initramfs.bb b/recipes-installer/images/core-image-anaconda-initramfs.bb index 8f2dc3b..b0890eb 100644 --- a/recipes-installer/images/core-image-anaconda-initramfs.bb +++ b/recipes-installer/images/core-image-anaconda-initramfs.bb @@ -16,7 +16,7 @@ IMAGE_INSTALL = "\ ${CUSTOMIZE_LOGOS} \ python3-anaconda \ anaconda-init \ - ${@['', 'packagegroup-installer-x11-anaconda'][bool(d.getVar('XSERVER', True))]} \ + ${@['', 'packagegroup-installer-x11-anaconda'][bool(d.getVar('XSERVER'))]} \ packagegroup-core-boot \ packagegroup-core-ssh-openssh \ " diff --git a/recipes-installer/images/core-image-anaconda.bb b/recipes-installer/images/core-image-anaconda.bb index 39f2d1d..d249947 100644 --- a/recipes-installer/images/core-image-anaconda.bb +++ b/recipes-installer/images/core-image-anaconda.bb @@ -14,20 +14,20 @@ CUSTOMIZE_LOGOS ??= "yocto-compat-logos" IMAGE_INSTALL = "\ packagegroup-core-boot \ packagegroup-core-ssh-openssh \ - ${@['', 'packagegroup-installer-x11-anaconda'][bool(d.getVar('XSERVER', True))]} \ + ${@['', 'packagegroup-installer-x11-anaconda'][bool(d.getVar('XSERVER'))]} \ python3-anaconda \ anaconda-init \ kernel-modules \ ${CUSTOMIZE_LOGOS} \ - dhcp-client \ + dhcpcd \ ldd \ rng-tools \ " IMAGE_LINGUAS = "en-us en-gb" # Generate live image -IMAGE_FSTYPES_remove = "wic wic.bmap" -IMAGE_FSTYPES_append = " iso" +IMAGE_FSTYPES:remove = "live wic wic.bmap" +IMAGE_FSTYPES:append = " iso" IMAGE_ROOTFS_EXTRA_SPACE =" + 102400" diff --git a/recipes-installer/initrdscripts/files/umountfs b/recipes-installer/initrdscripts/files/umountfs index f01adea..4792110 100644 --- a/recipes-installer/initrdscripts/files/umountfs +++ b/recipes-installer/initrdscripts/files/umountfs @@ -3,6 +3,9 @@ umountfs_enabled() { } umountfs_run() { + # Make sure /run/media is fully populated + udevadm settle + # Umount other media for anaconda for dir in `awk '/\/dev.* \/run\/media/{print $2}' /proc/mounts`; do umount $dir diff --git a/recipes-installer/initrdscripts/initramfs-live-boot_1.0.bbappend b/recipes-installer/initrdscripts/initramfs-live-boot_1.0.bbappend index 4a644ad..95ec283 100644 --- a/recipes-installer/initrdscripts/initramfs-live-boot_1.0.bbappend +++ b/recipes-installer/initrdscripts/initramfs-live-boot_1.0.bbappend @@ -1,5 +1,5 @@ -FILESEXTRAPATHS_append_anaconda := ":${THISDIR}/files" +FILESEXTRAPATHS:append:anaconda := ":${THISDIR}/files" -SRC_URI_append_anaconda = " \ +SRC_URI:append:anaconda = " \ file://init-live.sh \ " diff --git a/recipes-installer/initrdscripts/initramfs-module-setup-live_1.0.bbappend b/recipes-installer/initrdscripts/initramfs-module-setup-live_1.0.bbappend index 07d9726..6be120d 100644 --- a/recipes-installer/initrdscripts/initramfs-module-setup-live_1.0.bbappend +++ b/recipes-installer/initrdscripts/initramfs-module-setup-live_1.0.bbappend @@ -1,18 +1,18 @@ -FILESEXTRAPATHS_append_anaconda := ":${THISDIR}/files" +FILESEXTRAPATHS:append:anaconda := ":${THISDIR}/files" -SRC_URI_append_anaconda = " \ +SRC_URI:append:anaconda = " \ file://union-fs \ file://realroot \ file://umountfs \ " -do_install_append_anaconda() { +do_install:append:anaconda() { install -m 0755 ${WORKDIR}/union-fs ${D}/init.d/91-union-fs install -m 0755 ${WORKDIR}/realroot ${D}/init.d/92-realroot install -m 0755 ${WORKDIR}/umountfs ${D}/init.d/93-umountfs } -FILES_${PN}_append_anaconda = " \ +FILES:${PN}:append:anaconda = " \ /init.d/91-union-fs \ /init.d/92-realroot \ /init.d/93-umountfs \ diff --git a/recipes-installer/logos/yocto-compat-logos.bb b/recipes-installer/logos/yocto-compat-logos.bb index 32594bc..c5d1875 100644 --- a/recipes-installer/logos/yocto-compat-logos.bb +++ b/recipes-installer/logos/yocto-compat-logos.bb @@ -1,5 +1,5 @@ DESCRIPTION = "Yocto project compatible logos for branding" -LICENSE = "GPLv2" +LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" SRC_URI = "file://sidebar-logo.png \ @@ -12,7 +12,7 @@ S = "${WORKDIR}" inherit allarch -FILES_${PN} = "${datadir}/anaconda" +FILES:${PN} = "${datadir}/anaconda" do_install() { install -d ${D}/${datadir}/anaconda/boot diff --git a/recipes-installer/packagegroups/packagegroup-installer-x11-anaconda.bb b/recipes-installer/packagegroups/packagegroup-installer-x11-anaconda.bb index 87c57c9..85c70ab 100644 --- a/recipes-installer/packagegroups/packagegroup-installer-x11-anaconda.bb +++ b/recipes-installer/packagegroups/packagegroup-installer-x11-anaconda.bb @@ -2,12 +2,14 @@ DESCRIPTION = "Tasks for desktop X11 applications to support anaconda" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" -inherit packagegroup distro_features_check +PACKAGE_ARCH = "${TUNE_PKGARCH}" + +inherit packagegroup features_check REQUIRED_DISTRO_FEATURES = "x11" XSERVER ??= "" -RDEPENDS_packagegroup-installer-x11-anaconda = "\ +RDEPENDS:packagegroup-installer-x11-anaconda = "\ dbus \ xinput-calibrator \ xserver-nodm-init \ @@ -18,7 +20,7 @@ RDEPENDS_packagegroup-installer-x11-anaconda = "\ xset \ settings-daemon \ xrandr \ - libsdl \ + libsdl2 \ metacity \ adwaita-icon-theme \ pango \ diff --git a/recipes-installer/python3-dasbus/python3-dasbus_1.6.bb b/recipes-installer/python3-dasbus/python3-dasbus_1.6.bb new file mode 100644 index 0000000..5e76cb5 --- /dev/null +++ b/recipes-installer/python3-dasbus/python3-dasbus_1.6.bb @@ -0,0 +1,14 @@ +SUMMARY = "Dasbus is a DBus library written in Python 3, based on GLib and inspired by pydbus." +HOMEPAGE = "https://dasbus.readthedocs.io" +SECTION = "devel" +LICENSE = "LGPL-2.1-only" +LIC_FILES_CHKSUM = "file://LICENSE;md5=1803fa9c2c3ce8cb06b4861d75310742" + +SRC_URI = "git://github.com/rhinstaller/dasbus.git;protocol=https;branch=master" +SRCREV = "63b22fe4a7b2f98739279b2a4c6107eebd8d5a58" + +S = "${WORKDIR}/git" + +inherit setuptools3 + +RDEPENDS:${PN} = "python3-pygobject" diff --git a/recipes-installer/python3-productmd/files/add-wrlinux-version-pattern.patch b/recipes-installer/python3-productmd/files/add-wrlinux-version-pattern.patch new file mode 100644 index 0000000..bb1f49c --- /dev/null +++ b/recipes-installer/python3-productmd/files/add-wrlinux-version-pattern.patch @@ -0,0 +1,21 @@ +Add a distro version check pattern which allows a character in distro version +string, such as 10.20.21a.0. + +Upstream-Status: Inappropriate [distro specific] + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +diff --git a/productmd/treeinfo.py b/productmd/treeinfo.py +index 58429f9..6d9fb80 100644 +--- a/productmd/treeinfo.py ++++ b/productmd/treeinfo.py +@@ -171,7 +171,8 @@ class BaseProduct(productmd.common.MetadataBase): + def _validate_version(self): + self._assert_type("version", list(six.string_types)) + if re.match(r'^\d', self.version): +- self._assert_matches_re("version", [r"^\d+(\.\d+)*$"]) ++ patterns = [r"^\d+(\.\d+)*$", r"^\d+\.\d+\.\d+[a-zA-Z]?\.\d+"] ++ self._assert_matches_re("version", patterns) + + def _validate_short(self): + self._assert_type("short", list(six.string_types)) diff --git a/recipes-installer/python3-productmd/python3-productmd_1.21.bb b/recipes-installer/python3-productmd/python3-productmd_1.21.bb index 3579d0b..2a5273c 100644 --- a/recipes-installer/python3-productmd/python3-productmd_1.21.bb +++ b/recipes-installer/python3-productmd/python3-productmd_1.21.bb @@ -3,10 +3,12 @@ related to composes and installation media" DESCRIPTION = "Product, compose and installation media metadata library" HOMEPAGE = "http://productmd.readthedocs.io/en/latest/" SECTION = "devel" -LICENSE = "LGPLv2.1" +LICENSE = "LGPL-2.1-only" LIC_FILES_CHKSUM = "file://LICENSE;md5=768997ba510a952bef1775c50bc22b00" -SRC_URI = "git://github.com/release-engineering/productmd;protocol=https;" +SRC_URI = "git://github.com/release-engineering/productmd;protocol=https;branch=master \ + file://add-wrlinux-version-pattern.patch \ + " SRCREV = "a8268944c8a6064697ccb4d24e52dc666ab03ed4" S = "${WORKDIR}/git" inherit setuptools3 diff --git a/recipes-installer/python3-simpleline/python3-simpleline_1.3.bb b/recipes-installer/python3-simpleline/python3-simpleline_1.9.0.bb index dcf7e1d..5ff8f81 100644 --- a/recipes-installer/python3-simpleline/python3-simpleline_1.3.bb +++ b/recipes-installer/python3-simpleline/python3-simpleline_1.9.0.bb @@ -3,12 +3,11 @@ DESCRIPTION = "This is a text UI framework originally which \ was a part of the Anaconda installer project." HOMEPAGE = "https://github.com/rhinstaller/python-simpleline" SECTION = "devel" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=5f4f48e95324081879552f19cd16c54a" +LICENSE = "LGPL-3.0-only" +LIC_FILES_CHKSUM = "file://LICENSE.md;md5=8350171b4e0d605dd7f117e75eb5b4cd" -SRC_URI = "git://github.com/rhinstaller/python-simpleline;protocol=https;" -SRCREV = "1c21ffdeda9eed27e5ad8ec16aee467f8daecd50" +SRC_URI = "git://github.com/rhinstaller/python-simpleline;protocol=https;branch=master" +SRCREV = "cf7a049623432acbdb8ec23eeadbfa666761e109" S = "${WORKDIR}/git" -inherit setuptools3 - +inherit setuptools3_legacy diff --git a/recipes-installersupport/packagegroups/packagegroup-anaconda-support.bb b/recipes-installersupport/packagegroups/packagegroup-anaconda-support.bb index 7bb91df..ea5e2f7 100644 --- a/recipes-installersupport/packagegroups/packagegroup-anaconda-support.bb +++ b/recipes-installersupport/packagegroups/packagegroup-anaconda-support.bb @@ -2,9 +2,12 @@ DESCRIPTION = "Packages required by target build to help the installation" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +# kernel-image renamed to kernel-image-5.10.82-yocto-standard +PACKAGE_ARCH = "${TUNE_PKGARCH}" + inherit packagegroup -RDEPENDS_${PN} = " \ +RDEPENDS:${PN} = " \ sudo \ kernel-image \ kernel-modules \ @@ -16,8 +19,7 @@ RDEPENDS_${PN} = " \ lvm2-udevrules \ util-linux-mount \ util-linux-switch-root \ - init-ifupdown \ - libuser \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libuser', '', d)} \ dracut \ cryptsetup \ sed \ @@ -30,5 +32,3 @@ RDEPENDS_${PN} = " \ " COMPATIBLE_HOST = '(x86_64.*|i.86.*)-(linux.*|freebsd.*)' -COMPATIBLE_HOST_armv7a = 'null' -COMPATIBLE_HOST_armv7ve = 'null' diff --git a/recipes-kernel/linux/files/crypt.cfg b/recipes-kernel/linux/files/crypt.cfg index ca1cec3..1f7fe73 100644 --- a/recipes-kernel/linux/files/crypt.cfg +++ b/recipes-kernel/linux/files/crypt.cfg @@ -1,4 +1,3 @@ CONFIG_CRYPTO_AES_NI_INTEL=m -CONFIG_CRYPTO_AES_X86_64=m CONFIG_CRYPTO_USER_API=m CONFIG_CRYPTO_USER_API_SKCIPHER=m diff --git a/recipes-kernel/linux/files/efivarfs.cfg b/recipes-kernel/linux/files/efivarfs.cfg new file mode 100644 index 0000000..4e151f1 --- /dev/null +++ b/recipes-kernel/linux/files/efivarfs.cfg @@ -0,0 +1 @@ +CONFIG_EFIVAR_FS=y diff --git a/recipes-kernel/linux/files/efivarfs.scc b/recipes-kernel/linux/files/efivarfs.scc new file mode 100644 index 0000000..63f311b --- /dev/null +++ b/recipes-kernel/linux/files/efivarfs.scc @@ -0,0 +1 @@ +kconf non-hardware efivarfs.cfg diff --git a/recipes-kernel/linux/files/efivars.cfg b/recipes-kernel/linux/files/efivars.cfg deleted file mode 100644 index b9206d9..0000000 --- a/recipes-kernel/linux/files/efivars.cfg +++ /dev/null @@ -1 +0,0 @@ -CONFIG_EFI_VARS=y diff --git a/recipes-kernel/linux/files/efivars.scc b/recipes-kernel/linux/files/efivars.scc deleted file mode 100644 index 25bd34d..0000000 --- a/recipes-kernel/linux/files/efivars.scc +++ /dev/null @@ -1 +0,0 @@ -kconf non-hardware efivars.cfg diff --git a/recipes-kernel/linux/files/ide.cfg b/recipes-kernel/linux/files/ide.cfg deleted file mode 100644 index 9d973ce..0000000 --- a/recipes-kernel/linux/files/ide.cfg +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_BLK_DEV_IDEDMA_SFF=y -CONFIG_BLK_DEV_IDEPCI=y -CONFIG_IDEPCI_PCIBUS_ORDER=y -CONFIG_BLK_DEV_PIIX=y -CONFIG_BLK_DEV_IDEDMA=y diff --git a/recipes-kernel/linux/files/ide.scc b/recipes-kernel/linux/files/ide.scc deleted file mode 100644 index 81e57f5..0000000 --- a/recipes-kernel/linux/files/ide.scc +++ /dev/null @@ -1 +0,0 @@ -kconf non-hardware ide.cfg diff --git a/recipes-kernel/linux/files/liveinstall.cfg b/recipes-kernel/linux/files/liveinstall.cfg index 37c9f47..6794674 100644 --- a/recipes-kernel/linux/files/liveinstall.cfg +++ b/recipes-kernel/linux/files/liveinstall.cfg @@ -2,4 +2,3 @@ CONFIG_ISO9660_FS=y CONFIG_BLK_DEV_LOOP=y CONFIG_SQUASHFS=y CONFIG_SQUASHFS_XATTR=y -# CONFIG_BLK_DEV_PIIX is not set diff --git a/recipes-support/lvm2/lvm2_%.bbappend b/recipes-support/lvm2/lvm2_%.bbappend new file mode 100644 index 0000000..30457d6 --- /dev/null +++ b/recipes-support/lvm2/lvm2_%.bbappend @@ -0,0 +1,5 @@ +LVM2_ANACONDA = "${@bb.utils.contains('DISTRO', 'anaconda', 'lvm2_anaconda.inc', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'anaconda-support', 'lvm2_anaconda.inc', '', d)} \ + " + +require ${LVM2_ANACONDA} diff --git a/recipes-support/lvm2/lvm2_anaconda.inc b/recipes-support/lvm2/lvm2_anaconda.inc new file mode 100644 index 0000000..bb1f0b8 --- /dev/null +++ b/recipes-support/lvm2/lvm2_anaconda.inc @@ -0,0 +1,2 @@ +PACKAGECONFIG:append:class-target = ' thin-provisioning-tools' +PACKAGECONFIG:append:class-target:anaconda = ' dbus' diff --git a/recipes-support/multipath-tools/multipath-tools_%.bbappend b/recipes-support/multipath-tools/multipath-tools_%.bbappend index 5bd2b03..5ce6b3c 100644 --- a/recipes-support/multipath-tools/multipath-tools_%.bbappend +++ b/recipes-support/multipath-tools/multipath-tools_%.bbappend @@ -1,6 +1,6 @@ -SYSTEMD_AUTO_ENABLE_anaconda = "disable" +SYSTEMD_AUTO_ENABLE:anaconda = "disable" -do_install_append_anaconda () { +do_install:append:anaconda () { install -d ${D}${sysconfdir}/multipath install -m 0644 ${WORKDIR}/multipath.conf.example \ ${D}${sysconfdir}/multipath.conf |