Bug 654905 - Please provide the possibility of shadow mounts (mount --bind) for buildroot
Summary: Please provide the possibility of shadow mounts (mount --bind) for buildroot
Status: CONFIRMED
Alias: None
Product: openSUSE.org
Classification: openSUSE
Component: BuildService (show other bugs)
Version: unspecified
Hardware: All SUSE Other
: P5 - None : Enhancement (vote)
Target Milestone: ---
Assignee: Adrian Schröter
QA Contact: Adrian Schröter
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-19 12:58 UTC by Dr. Werner Fink
Modified: 2010-11-29 06:38 UTC (History)
2 users (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dr. Werner Fink 2010-11-19 12:58:30 UTC
Preamble: it is very difficult to avoid the buildroot string within
the resulting binaries of TeXLive (dumped formats). Currently I run

  # Avoid build root string in format
  ROOT=/tmp/=
  TEXMFCNF=${ROOT}%{_texcnfdir}/web2c//
  ln -sf %{buildroot} ${ROOT}
  export ROOT TEXMFCNF

  [... huge section making the rest of TeXLive ...]

  # Clean out the maps and formats
  if test -n "$ROOT" -a -d "$ROOT" ; then
      SLASH=$(echo "$ROOT" | tr '[[:print:]]' '/')
      for match in $(grep -rl $ROOT ${ROOT}) ; do
          mv -v $match ${match}.tmp
          case "$match" in
          *.map)
              sed "s@$ROOT@@g" < ${match}.tmp > $match
              ;;
          *.fmt|*.base)
              sed "s@$ROOT@$SLASH@g" < ${match}.tmp > $match
              ;;
          *)
              echo $match 1>&2
              exit 1
          esac
          rm -v ${match}.tmp
      done
      unset match SLASH
  fi

... to avoid this I'd like to have the possibility of mounting
directories below buildroot into the above root/chroot enviroment

 %{buildroot}/usr/lib/texmf   -> /usr/lib/texmf
 %{buildroot}/usr/share/texmf -> /usr/share/texmf
 %{buildroot}/etc/texmf       -> /etc/texmf
 %{buildroot}/var/lib/texmf   -> /var/lib/texmf
 %{buildroot}/var/cache/texmf -> /var/cache/texmf

this would allow me to skip the time consuming rewrite of
all the binaries above. This without become root access.

One possible solution would my own package to do the mounts
with the help of a BuildRequire ... or to create and/or
append /etc/fstab to allow `user' to be able to do such mounts
Comment 1 Dr. Werner Fink 2010-11-19 15:18:44 UTC
Just played around and found that the line

/usr/src/packages/BUILDROOT/texlive-bin-2010-1.i386/usr/share/texmf /usr/share/texmf none rbind,user 0 0

in /etc/fstab will allow user abuild to mount and umount with

   mount /usr/share/texmf
   [... work ...]
   umount /usr/share/texmf