#3585 kiwi: Make /dev mounting by magic
Merged a year ago by tkopecek. Opened a year ago by ignatenkobrain.
ignatenkobrain/koji mount_dev  into  master

file modified
+5 -4
@@ -65,6 +65,8 @@ 

              opts['scratch'] = False

          if not opts.get('optional_arches'):

              opts['optional_arches'] = []

+         if not buildconfig['extra'].get('mock.new_chroot', True):

+             opts['mount_dev'] = True

          self.opts = opts

  

          # get configuration
@@ -304,10 +306,9 @@ 

                  desc_url, desc_path, opts=None):

          self.opts = opts

          build_tag = target_info['build_tag']

-         if opts.get('bind_dev'):

-             bind_opts = {'dirs': {'/dev': '/dev'}}

-         else:

-             bind_opts = None

+         bind_opts = {'dirs': {}}

+         if self.opts.get('mount_dev'):

+             bind_opts['dirs']['/dev'] = '/dev'

          broot = BuildRoot(self.session, self.options,

                            tag=build_tag,

                            arch=arch,

file modified
-4
@@ -30,9 +30,6 @@ 

      parser.add_option("--type", help="Override default build type from description")

      parser.add_option("--make-prep", action="store_true", default=False,

                        help="Run 'make prep' in checkout before starting the build")

-     parser.add_option("--bind-dev", action="store_true", default=False,

-                       help="e.g. images using device-mapper needs /dev mounted in kiwi env, "

-                            "while others can fail in such env.")

      parser.add_option("--can-fail", action="store", dest="optional_arches",

                        metavar="ARCH1,ARCH2,...", default="",

                        help="List of archs which are not blocking for build "
@@ -55,7 +52,6 @@ 

          'target': target,

          'desc_url': scm,

          'desc_path': path,

-         'bind_dev': options.bind_dev,

      }

      if options.scratch:

          kwargs['scratch'] = True

file modified
+1 -3
@@ -17,7 +17,7 @@ 

  @export

  def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile=None,

                scratch=False, priority=None, make_prep=False, repos=None, release=None,

-               type=None, bind_dev=False):

+               type=None):

      context.session.assertPerm('image')

      for i in [desc_url, desc_path, profile, release]:

          if i is not None:
@@ -52,8 +52,6 @@ 

          opts['release'] = release

      if optional_arches:

          opts['optional_arches'] = optional_arches

-     if bind_dev:

-         opts['bind_dev'] = bind_dev

      if repos:

          opts['repos'] = repos

      if make_prep:

no initial comment

cc @tkopecek @ngompa

See commit message for some background.

Makes sense to me - we can squeze it to 1.31 so we don't even introduce --bind-dev @ngompa?

Wait, this doesn't make sense. Why doesn't Mock's nspawn mode expose device-mapper? We need it for building images with livemedia-creator too... @praiskup @msuchy

I'd rather just fix Mock so that we expose the device-mapper device like we do for btrfs-control

@ngompa @ignatenkobrain so, do we now think (after mock merged Neals' code) that we should revert #3568 ?

@ngompa @ignatenkobrain so, do we now think (after mock merged Neals' code) that we should revert #3568 ?

Yes.

Pull-Request has been closed by tkopecek

a year ago

@tkopecek I think it is still wrong…

  1. Mounting /dev by koji breaks nspawn so if anything, it has to be removed
  2. The code in mock does not make kiwi builds working anyway =(

Pull-Request has been reopened by tkopecek

a year ago

Makes sense. I've tested old/new chroot vs. non/dm image and it needs this patch + mock's patch. Then I was able to build all four of them.

Commit de2df16 fixes this pull-request

Pull-Request has been merged by tkopecek

a year ago