def doConfiguration(storage, payload, ksdata, instClass): willWriteNetwork = not flags.flags.imageInstall and not flags.flags.dirInstall willRunRealmd = ksdata.realm.discovered # configure base, create users, configure addons, initramfs, post-install step_count = 5 # network, maybe if willWriteNetwork: step_count += 1 # if a realm was discovered, # increment the counter as the # real joining step will be executed if willRunRealmd: step_count += 1 progress_init(step_count) # Now run the execute methods of ksdata that require an installed system # to be present first. with progress_report(_("Configuring installed system")): ksdata.authconfig.execute(storage, ksdata, instClass) ksdata.selinux.execute(storage, ksdata, instClass) ksdata.firstboot.execute(storage, ksdata, instClass) ksdata.services.execute(storage, ksdata, instClass) ksdata.keyboard.execute(storage, ksdata, instClass) ksdata.timezone.execute(storage, ksdata, instClass) ksdata.lang.execute(storage, ksdata, instClass) ksdata.firewall.execute(storage, ksdata, instClass) ksdata.xconfig.execute(storage, ksdata, instClass) ksdata.skipx.execute(storage, ksdata, instClass) if willWriteNetwork: with progress_report(_("Writing network configuration")): ksdata.network.execute(storage, ksdata, instClass) # Creating users and groups requires some pre-configuration. with progress_report(_("Creating users")): createLuserConf(iutil.getSysroot(), algoname=getPassAlgo(ksdata.authconfig.authconfig)) u = Users() ksdata.rootpw.execute(storage, ksdata, instClass, u) ksdata.group.execute(storage, ksdata, instClass, u) ksdata.user.execute(storage, ksdata, instClass, u) ksdata.sshkey.execute(storage, ksdata, instClass, u) with progress_report(_("Configuring addons")): ksdata.addons.execute(storage, ksdata, instClass, u) with progress_report(_("Generating initramfs")): payload.recreateInitrds() # Work around rhbz#1200539, grubby doesn't handle grub2 missing initrd with /boot on btrfs # So rerun writing the bootloader if this is live and /boot is on btrfs boot_on_btrfs = isinstance( storage.mountpoints.get("/boot", storage.mountpoints.get("/")), BTRFSDevice) if flags.flags.livecdInstall and boot_on_btrfs \ and (not ksdata.bootloader.disabled and ksdata.bootloader != "none"): writeBootLoader(storage, payload, instClass, ksdata) if willRunRealmd: with progress_report(_("Joining realm: %s") % ksdata.realm.discovered): ksdata.realm.execute(storage, ksdata, instClass) with progress_report(_("Running post-installation scripts")): runPostScripts(ksdata.scripts) # setup kexec reboot if requested if flags.flags.kexec: setup_kexec() # Write the kickstart file to the installed system (or, copy the input # kickstart file over if one exists). _writeKS(ksdata) progress_complete()
def doConfiguration(storage, payload, ksdata, instClass): willWriteNetwork = not flags.flags.imageInstall and not flags.flags.dirInstall willRunRealmd = ksdata.realm.discovered # configure base, create users, configure addons, initramfs, post-install step_count = 5 # network, maybe if willWriteNetwork: step_count += 1 # if a realm was discovered, # increment the counter as the # real joining step will be executed if willRunRealmd: step_count += 1 progress_init(step_count) # Now run the execute methods of ksdata that require an installed system # to be present first. with progress_report(N_("Configuring installed system")): ksdata.authconfig.execute(storage, ksdata, instClass) ksdata.selinux.execute(storage, ksdata, instClass) ksdata.firstboot.execute(storage, ksdata, instClass) ksdata.services.execute(storage, ksdata, instClass) ksdata.keyboard.execute(storage, ksdata, instClass) ksdata.timezone.execute(storage, ksdata, instClass) ksdata.lang.execute(storage, ksdata, instClass) ksdata.firewall.execute(storage, ksdata, instClass) ksdata.xconfig.execute(storage, ksdata, instClass) ksdata.skipx.execute(storage, ksdata, instClass) if willWriteNetwork: with progress_report(N_("Writing network configuration")): ksdata.network.execute(storage, ksdata, instClass) # Creating users and groups requires some pre-configuration. with progress_report(N_("Creating users")): u = Users() ksdata.rootpw.execute(storage, ksdata, instClass, u) ksdata.group.execute(storage, ksdata, instClass, u) ksdata.user.execute(storage, ksdata, instClass, u) ksdata.sshkey.execute(storage, ksdata, instClass, u) with progress_report(N_("Configuring addons")): ksdata.addons.execute(storage, ksdata, instClass, u) with progress_report(N_("Generating initramfs")): payload.recreateInitrds() # Work around rhbz#1200539, grubby doesn't handle grub2 missing initrd with /boot on btrfs # So rerun writing the bootloader if this is live and /boot is on btrfs boot_on_btrfs = isinstance(storage.mountpoints.get("/boot", storage.mountpoints.get("/")), BTRFSDevice) if flags.flags.livecdInstall and boot_on_btrfs \ and (not ksdata.bootloader.disabled and ksdata.bootloader != "none"): writeBootLoader(storage, payload, instClass, ksdata) if willRunRealmd: with progress_report(N_("Joining realm: %s") % ksdata.realm.discovered): ksdata.realm.execute(storage, ksdata, instClass) with progress_report(N_("Running post-installation scripts")): runPostScripts(ksdata.scripts) # setup kexec reboot if requested if flags.flags.kexec: setup_kexec() # Write the kickstart file to the installed system (or, copy the input # kickstart file over if one exists). if flags.flags.nosave_output_ks: # don't write the kickstart file to the installed system if this has # been disabled by the nosave option log.warning("Writing of the output kickstart to installed system has been disabled" " by the copy_kickstarts option.") else: _writeKS(ksdata) progress_complete()
def doConfiguration(storage, payload, ksdata, instClass): from pyanaconda.kickstart import runPostScripts willWriteNetwork = not flags.flags.imageInstall and not flags.flags.dirInstall willRunRealmd = ksdata.realm.discovered # configure base, create users, configure addons, initramfs, post-install step_count = 5 # network, maybe if willWriteNetwork: step_count += 1 # if a realm was discovered, # increment the counter as the # real joining step will be executed if willRunRealmd: step_count += 1 progress_init(step_count) # Now run the execute methods of ksdata that require an installed system # to be present first. with progress_report(_("Configuring installed system")): ksdata.authconfig.execute(storage, ksdata, instClass) ksdata.selinux.execute(storage, ksdata, instClass) ksdata.firstboot.execute(storage, ksdata, instClass) ksdata.services.execute(storage, ksdata, instClass) ksdata.keyboard.execute(storage, ksdata, instClass) ksdata.timezone.execute(storage, ksdata, instClass) ksdata.lang.execute(storage, ksdata, instClass) ksdata.firewall.execute(storage, ksdata, instClass) ksdata.xconfig.execute(storage, ksdata, instClass) ksdata.skipx.execute(storage, ksdata, instClass) if willWriteNetwork: with progress_report(_("Writing network configuration")): ksdata.network.execute(storage, ksdata, instClass) # Creating users and groups requires some pre-configuration. with progress_report(_("Creating users")): createLuserConf(iutil.getSysroot(), algoname=getPassAlgo(ksdata.authconfig.authconfig)) u = Users() ksdata.rootpw.execute(storage, ksdata, instClass, u) ksdata.group.execute(storage, ksdata, instClass, u) ksdata.user.execute(storage, ksdata, instClass, u) with progress_report(_("Configuring addons")): ksdata.addons.execute(storage, ksdata, instClass, u) with progress_report(_("Generating initramfs")): payload.recreateInitrds(force=True) if willRunRealmd: with progress_report(_("Joining realm: %s") % ksdata.realm.discovered): ksdata.realm.execute(storage, ksdata, instClass) with progress_report(_("Running post-installation scripts")): runPostScripts(ksdata.scripts) # setup kexec reboot if requested if flags.flags.kexec: setup_kexec() # Write the kickstart file to the installed system (or, copy the input # kickstart file over if one exists). _writeKS(ksdata) progress_complete()
def doConfiguration(storage, payload, ksdata, instClass): willWriteNetwork = not flags.flags.imageInstall and not flags.flags.dirInstall willRunRealmd = ksdata.realm.discovered # configure base, create users, configure addons, initramfs, post-install step_count = 5 # network, maybe if willWriteNetwork: step_count += 1 # if a realm was discovered, # increment the counter as the # real joining step will be executed if willRunRealmd: step_count += 1 if ksdata.snapshot and ksdata.snapshot.has_snapshot(SNAPSHOT_WHEN_POST_INSTALL): step_count += 1 progress_init(step_count) # Now run the execute methods of ksdata that require an installed system # to be present first. with progress_report(_("Configuring installed system")): ksdata.authconfig.execute(storage, ksdata, instClass) ksdata.selinux.execute(storage, ksdata, instClass) ksdata.firstboot.execute(storage, ksdata, instClass) ksdata.services.execute(storage, ksdata, instClass) ksdata.keyboard.execute(storage, ksdata, instClass) ksdata.timezone.execute(storage, ksdata, instClass) ksdata.lang.execute(storage, ksdata, instClass) ksdata.firewall.execute(storage, ksdata, instClass) ksdata.xconfig.execute(storage, ksdata, instClass) ksdata.skipx.execute(storage, ksdata, instClass) if willWriteNetwork: with progress_report(_("Writing network configuration")): ksdata.network.execute(storage, ksdata, instClass) # Creating users and groups requires some pre-configuration. with progress_report(_("Creating users")): createLuserConf(iutil.getSysroot(), algoname=getPassAlgo(ksdata.authconfig.authconfig)) u = Users() ksdata.rootpw.execute(storage, ksdata, instClass, u) ksdata.group.execute(storage, ksdata, instClass, u) ksdata.user.execute(storage, ksdata, instClass, u) ksdata.sshkey.execute(storage, ksdata, instClass, u) with progress_report(_("Configuring addons")): ksdata.addons.execute(storage, ksdata, instClass, u, payload) with progress_report(_("Generating initramfs")): payload.recreateInitrds(force=True) if willRunRealmd: with progress_report(_("Joining realm: %s") % ksdata.realm.discovered): ksdata.realm.execute(storage, ksdata, instClass) with progress_report(_("Running post-installation scripts")): runPostScripts(ksdata.scripts) # setup kexec reboot if requested if flags.flags.kexec: setup_kexec() # Write the kickstart file to the installed system (or, copy the input # kickstart file over if one exists). if flags.flags.nosave_output_ks: # don't write the kickstart file to the installed system if this has # been disabled by the nosave option log.warning("Writing of the output kickstart to installed system has been disabled" " by the nosave option.") else: _writeKS(ksdata) # write out the user interaction config file screen_access.sam.write_out_config_file() if ksdata.snapshot and ksdata.snapshot.has_snapshot(SNAPSHOT_WHEN_POST_INSTALL): with progress_report(N_("Creating snapshots")): ksdata.snapshot.execute(storage, ksdata, instClass) progress_complete()
def doConfiguration(storage, payload, ksdata, instClass): willWriteNetwork = not flags.flags.imageInstall and not flags.flags.dirInstall willRunRealmd = ksdata.realm.discovered # configure base, create users, configure addons, initramfs, post-install step_count = 5 # network, maybe if willWriteNetwork: step_count += 1 # if a realm was discovered, # increment the counter as the # real joining step will be executed if willRunRealmd: step_count += 1 progress_init(step_count) # Now run the execute methods of ksdata that require an installed system # to be present first. with progress_report(N_("Configuring installed system")): ksdata.authconfig.execute(storage, ksdata, instClass) ksdata.selinux.execute(storage, ksdata, instClass) ksdata.firstboot.execute(storage, ksdata, instClass) ksdata.services.execute(storage, ksdata, instClass) ksdata.keyboard.execute(storage, ksdata, instClass) ksdata.timezone.execute(storage, ksdata, instClass) ksdata.lang.execute(storage, ksdata, instClass) ksdata.firewall.execute(storage, ksdata, instClass) ksdata.xconfig.execute(storage, ksdata, instClass) ksdata.skipx.execute(storage, ksdata, instClass) if willWriteNetwork: with progress_report(N_("Writing network configuration")): ksdata.network.execute(storage, ksdata, instClass) # Creating users and groups requires some pre-configuration. with progress_report(N_("Creating users")): u = Users() ksdata.rootpw.execute(storage, ksdata, instClass, u) ksdata.group.execute(storage, ksdata, instClass, u) ksdata.user.execute(storage, ksdata, instClass, u) ksdata.sshkey.execute(storage, ksdata, instClass, u) with progress_report(N_("Configuring addons")): ksdata.addons.execute(storage, ksdata, instClass, u, payload) with progress_report(N_("Generating initramfs")): payload.recreateInitrds() # This works around 2 problems, /boot on BTRFS and BTRFS installations where the initrd is # recreated after the first writeBootLoader call. This reruns it after the new initrd has # been created, fixing the kernel root and subvol args and adding the missing initrd entry. boot_on_btrfs = isinstance(storage.mountpoints.get("/"), BTRFSDevice) if flags.flags.livecdInstall and boot_on_btrfs \ and (not ksdata.bootloader.disabled and ksdata.bootloader != "none"): writeBootLoader(storage, payload, instClass, ksdata) if willRunRealmd: with progress_report( N_("Joining realm: %s") % ksdata.realm.discovered): ksdata.realm.execute(storage, ksdata, instClass) with progress_report(N_("Running post-installation scripts")): runPostScripts(ksdata.scripts) # setup kexec reboot if requested if flags.flags.kexec: setup_kexec() # Write the kickstart file to the installed system (or, copy the input # kickstart file over if one exists). if flags.flags.nosave_output_ks: # don't write the kickstart file to the installed system if this has # been disabled by the nosave option log.warning( "Writing of the output kickstart to installed system has been disabled" " by the nosave option.") else: _writeKS(ksdata) # Write out the user interaction config file. # # But make sure it's not written out in the image and directory installation mode, # as that might result in spokes being inadvertedly hidden when the actual installation # startes from the generate image or directory contents. if flags.flags.imageInstall: log.info( "Not writing out user interaction config file due to image install mode." ) elif flags.flags.dirInstall: log.info( "Not writing out user interaction config file due to directory install mode." ) else: screen_access.sam.write_out_config_file() progress_complete()
def doConfiguration(storage, payload, ksdata, instClass): willWriteNetwork = not flags.flags.imageInstall and not flags.flags.dirInstall willRunRealmd = ksdata.realm.discovered # configure base, create users, configure addons, initramfs, post-install step_count = 5 # network, maybe if willWriteNetwork: step_count += 1 # if a realm was discovered, # increment the counter as the # real joining step will be executed if willRunRealmd: step_count += 1 progress_init(step_count) # Now run the execute methods of ksdata that require an installed system # to be present first. with progress_report(N_("Configuring installed system")): ksdata.authconfig.execute(storage, ksdata, instClass) ksdata.selinux.execute(storage, ksdata, instClass) ksdata.firstboot.execute(storage, ksdata, instClass) ksdata.services.execute(storage, ksdata, instClass) ksdata.keyboard.execute(storage, ksdata, instClass) ksdata.timezone.execute(storage, ksdata, instClass) ksdata.lang.execute(storage, ksdata, instClass) ksdata.firewall.execute(storage, ksdata, instClass) ksdata.xconfig.execute(storage, ksdata, instClass) ksdata.skipx.execute(storage, ksdata, instClass) if willWriteNetwork: with progress_report(N_("Writing network configuration")): ksdata.network.execute(storage, ksdata, instClass) # Creating users and groups requires some pre-configuration. with progress_report(N_("Creating users")): u = Users() ksdata.rootpw.execute(storage, ksdata, instClass, u) ksdata.group.execute(storage, ksdata, instClass, u) ksdata.user.execute(storage, ksdata, instClass, u) ksdata.sshkey.execute(storage, ksdata, instClass, u) with progress_report(N_("Configuring addons")): ksdata.addons.execute(storage, ksdata, instClass, u, payload) with progress_report(N_("Generating initramfs")): payload.recreateInitrds() # This works around 2 problems, /boot on BTRFS and BTRFS installations where the initrd is # recreated after the first writeBootLoader call. This reruns it after the new initrd has # been created, fixing the kernel root and subvol args and adding the missing initrd entry. boot_on_btrfs = isinstance(storage.mountpoints.get("/"), BTRFSDevice) if flags.flags.livecdInstall and boot_on_btrfs \ and (not ksdata.bootloader.disabled and ksdata.bootloader != "none"): writeBootLoader(storage, payload, instClass, ksdata) if willRunRealmd: with progress_report(N_("Joining realm: %s") % ksdata.realm.discovered): ksdata.realm.execute(storage, ksdata, instClass) with progress_report(N_("Running post-installation scripts")): runPostScripts(ksdata.scripts) # setup kexec reboot if requested if flags.flags.kexec: setup_kexec() # Write the kickstart file to the installed system (or, copy the input # kickstart file over if one exists). if flags.flags.nosave_output_ks: # don't write the kickstart file to the installed system if this has # been disabled by the nosave option log.warning("Writing of the output kickstart to installed system has been disabled" " by the nosave option.") else: _writeKS(ksdata) # Write out the user interaction config file. # # But make sure it's not written out in the image and directory installation mode, # as that might result in spokes being inadvertedly hidden when the actual installation # startes from the generate image or directory contents. if flags.flags.imageInstall: log.info("Not writing out user interaction config file due to image install mode.") elif flags.flags.dirInstall: log.info("Not writing out user interaction config file due to directory install mode.") else: screen_access.sam.write_out_config_file() progress_complete()