#138 don't bind-mount /dev for LiveMediaTask (RHBZ #1315541)
Merged 7 years ago by mikem. Opened 7 years ago by adamwill.
adamwill/koji live-no-dev  into  master

file modified
+9 -6
@@ -2483,6 +2483,9 @@ 

  # Other chroot-based image handlers should inherit this.

  class ImageTask(BaseTaskHandler):

      Methods = []

+     # default to bind mounting /dev, but allow subclasses to change

+     # this

+     bind_opts = {'dirs' : {'/dev' : '/dev',}}

  

      def makeImgBuildRoot(self, buildtag, repoinfo, arch, inst_group):

          """
@@ -2497,14 +2500,11 @@ 

          @returns: a buildroot object

          """

  

-         # Here we configure mock to bind mount a set of /dev directories

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

-         if os.path.exists('/selinux'):

-             bind_opts['dirs']['/selinux'] = '/selinux'

          rootopts = {'install_group': inst_group,

                      'setup_dns': True,

-                     'repo_id': repoinfo['id'],

-                     'bind_opts' : bind_opts}

+                     'repo_id': repoinfo['id']}

+         if self.bind_opts:

+             rootopts['bind_opts'] = self.bind_opts

  

          broot = BuildRoot(self.session, self.options, buildtag, arch, self.id, **rootopts)

          broot.workdir = self.workdir
@@ -2932,6 +2932,9 @@ 

  

      Methods = ['createLiveMedia']

      _taskWeight = 1.5

+     # For livemedia-creator we do not want to bind mount /dev, see

+     # https://bugzilla.redhat.com/show_bug.cgi?id=1315541

+     bind_opts = {}

  

      def genISOManifest(self, image, manifile):

          """

This is an alternative to https://pagure.io/koji/pull-request/137
which keeps the /dev bind mount for ApplianceTask and LiveCDTask,
only dropping it for LiveMediaTask. It seems from the test we
ran that appliance-creator may still need it, at least for the
present - some of the createAppliance tasks seemed to hang their
builders.

Note I don't have a test koji deployment so I have not tested this, please check it for obvious errors :)

this will break things horribly. if bind_opts exists koji turns off mocks internal dev setup. you will end up without /dev completely

uh, what? I know it does. But that's why I made sure the other two cases don't pass it.

for the record, we did the F25 Alpha 1 compose with this patch and it seems to have worked fine, all lives and appliances worked.

Commit d7e8570 fixes this pull-request

Pull-Request has been merged by mikem@redhat.com

7 years ago

well, except it incorrectly attributes the change to you, not me. but never mind.

@adamwill I authored the merge commit, you authored the commit that was merged. Just gotta look at the history.

https://pagure.io/koji/c/c72090b1ffba737a5c32ec42644d0893ca61bc5a

sorry, my bad, I only looked at the link - didn't notice it was a merge commit.

Metadata