#1112 pungi-legacy: expose lorax's --rootfs-size argument
Merged 5 years ago by lsedlar. Opened 5 years ago by fepitre.
fepitre/pungi legacy-rootfs  into  master

file modified
+5
@@ -331,6 +331,11 @@ 

              help='Which files are the release notes -- GPL EULA')

          parser.add_argument("--nomacboot", action="store_true", dest="nomacboot",

                              help='disable setting up macboot as no hfs support ')

+ 

+         parser.add_argument(

+             "--rootfs-size", dest="rootfs_size", action=SetConfig, default=False,

+             help='Size of root filesystem in GiB. If not specified, use lorax default value')

+ 

          parser.add_argument(

              "--pungirc", dest="pungirc", default='~/.pungirc', action=SetConfig,

              help='Read pungi options from config file ')

file modified
+1
@@ -65,6 +65,7 @@ 

          self.set('pungi', 'resolve_deps', "True")

          self.set('pungi', 'no_dvd', "False")

          self.set('pungi', 'nomacboot', "False")

+         self.set('pungi', 'rootfs_size', "False")

  

          # if missing, self.read() is a noop, else change 'defaults'

          if pungirc:

file modified
+6 -2
@@ -138,8 +138,6 @@ 

                                      self.config.get('pungi', 'variant'),

                                      self.tree_arch)

  

- 

- 

      def doLoggerSetup(self):

          """Setup our logger"""

  
@@ -302,6 +300,9 @@ 

  

          self.fulltree_excludes = set(self.ksparser.handler.fulltree_excludes)

  

+         # rootfs image size

+         self.rootfs_size = self.config.get('pungi', 'rootfs_size')

+ 

      def _add_yum_repo(self, name, url, mirrorlist=False, groups=True,

                        cost=1000, includepkgs=None, excludepkgs=None,

                        proxy=None):
@@ -1570,6 +1571,9 @@ 

          except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):

              pass

  

+         if self.rootfs_size:

Actually this is not correct. Since the value is initialized to "False" as a string, this will always be evaluated. All other options that use booleans have explicit check. I'll add it here before merging.

+             cmd.extend(["--rootfs-size", self.rootfs_size])

+ 

          # Allow the output directory to exist.

          cmd.append("--force")

  

rebased onto c2280b6

5 years ago

pretty please pagure-ci rebuild

5 years ago

Looks good to me. :thumbsup:

Actually this is not correct. Since the value is initialized to "False" as a string, this will always be evaluated. All other options that use booleans have explicit check. I'll add it here before merging.

Commit 86314fd fixes this pull-request

Pull-Request has been merged by lsedlar

5 years ago

Indeed, I should have improved it a little bit but you already merged it?

I rebased it to latest master and modified the line to add != "False".
See https://pagure.io/pungi/c/86314fd

Oh great. I was also thinking to directly put -1 instead of "False" and testing if self.rootfs_size > 0. Anyway, several working solutions.