Re: [PATCH] copy kickstarts into sysroot (#743135)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

everything looks fine, but wouldn't it be better to have the
99anaconda-copy-ks.sh script somewhere in the share dir, and just copy
it to the installroot, instead of writing it out?

On Mon, 2011-10-03 at 17:18 -0700, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl@xxxxxxxxxx>
> 
> The installer no longer has access to the initrd's root. We need to
> copy any needed files over to /sysroot before switching root. This
> copies *.cfg and *.ks files.
> ---
>  src/pylorax/installtree.py |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/src/pylorax/installtree.py b/src/pylorax/installtree.py
> index eaea98b..58c1503 100644
> --- a/src/pylorax/installtree.py
> +++ b/src/pylorax/installtree.py
> @@ -546,13 +546,24 @@ class LoraxInstallTree(BaseLoraxClass):
>          logger.debug("compressing")
>          rc = compressed.wait()
>  
> +    def write_copy_ks(self, fname):
> +        """ Write pre-pivot script to copy kickstarts into /sysroot/
> +        """
> +        with open(fname, "w") as f:
> +            f.write("#!/bin/sh\n"
> +                    "cp /*ks /*cfg /sysroot/ 2> /dev/null\n")
> +
>      def make_dracut_initramfs(self):
>          for kernel in self.kernels:
> +            copy_ks = "/tmp/99anaconda-copy-ks.sh"
> +            self.write_copy_ks(joinpaths(self.root, copy_ks))
> +
>              outfile = "/tmp/initramfs.img" # inside the chroot
>              logger.debug("chrooting into installtree to create initramfs.img")
>              subprocess.check_call(["chroot", self.root, "/sbin/dracut",
>                                     "--noprefix", "--nomdadmconf", "--nolvmconf",
>                                     "--xz", "--modules", "base dmsquash-live",
> +                                   "--include", copy_ks, "/lib/dracut/hooks/pre-pivot",
>                                     outfile, kernel.version])
>              # move output file into installtree workdir
>              dstdir = joinpaths(self.workdir, "dracut-%s" % kernel.version)

-- 
Martin Gracik <mgracik@xxxxxxxxxx>

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux