MCPcopy
hub / github.com/containers/toolbox / configureRPM

Function configureRPM

src/cmd/initContainer.go:769–789  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

767}
768
769func configureRPM() error {
770 if !utils.PathExists("/usr/lib/rpm/macros.d") {
771 return nil
772 }
773
774 logrus.Debug("Configuring RPM to ignore bind mounts")
775
776 var builder strings.Builder
777 builder.WriteString("# Written by Toolbx\n")
778 builder.WriteString("# https://containertoolbx.org/\n")
779 builder.WriteString("\n")
780 builder.WriteString("%_netsharedpath /dev:/media:/mnt:/proc:/sys:/tmp:/var/lib/flatpak:/var/lib/libvirt\n")
781
782 rpmConfigString := builder.String()
783 rpmConfigBytes := []byte(rpmConfigString)
784 if err := ioutil.WriteFile("/usr/lib/rpm/macros.d/macros.toolbox", rpmConfigBytes, 0644); err != nil {
785 return fmt.Errorf("failed to configure RPM to ignore bind mounts: %w", err)
786 }
787
788 return nil
789}
790
791func configureUsers(targetUserUid int, targetUser, targetUserHome, targetUserShell string, homeLink bool) error {
792 if homeLink {

Callers 1

initContainerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…