Bug 13081

Summary: host-e2fsprogs attempts to create udev rules.d on build host if not exists
Product: buildroot Reporter: Christian Stewart <christian>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: buildroot
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:
Attachments: hacky fix for e2fs progs writing to host system

Description Christian Stewart 2020-07-18 02:47:34 UTC
If the /usr/lib/udev path does not exist on the build host, the "installdirs-udev" step of the "install-progs-recursive" step of host-e2fsprogs host-install in Buildroot attempts to create it.

This is a leak out of the Buildroot host dir structure.

Log output:

making install in po
if test "e2fsprogs" = "gettext-tools"; then \
  /bin/mkdir -p /home/paralin/repos/skiff-configs/skiff/workspaces/desktop/host/share/gettext/po; \
  for file in Makefile.in.in remove-potcdate.sin quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot   Makevars.t
emplate; do \
    /usr/bin/install -c -m 644 ./$file \
               a    /home/paralin/repos/skiff-configs/skiff/workspaces/desktop/host/share/gettext/po/$file; \
  done; \
  for file in Makevars; do \
    rm -f /home/paralin/repos/skiff-configs/skiff/workspaces/desktop/host/share/gettext/po/$file; \
  done; \
else \
  : ; \
fi
making install in scrub
       :MKDIR_P /usr/lib/udev/rules.d
/bin/mkdir: cannot create directory '/usr/lib/udev': Permission denied
make[5]: *** [Makefile:420: installdirs-udev] Error 1
make[4]: *** [Makefile:433: install-progs-recursive] Error 1
make[3]: *** [package/pkg-generic.mk:280: /home/paralin/repos/skiff-configs/skiff/workspaces/desktop/build/host-e2fsprogs-1.45.6/.stamp_host_insta
lled] Error 2
Comment 1 Christian Stewart 2020-07-18 02:49:18 UTC
Seems like the /usr/lib/systemd/system path also leaks:

making install in scrub
        MKDIR_P /usr/lib/udev/rules.d
       iMKDIR_P /usr/lib/systemd/system
/bin/mkdir: cannot create directory '/usr/lib/systemd/system': Permission denied
Comment 2 Christian Stewart 2020-07-18 06:21:18 UTC
Created attachment 8536 [details]
hacky fix for e2fs progs writing to host system
Comment 3 Christian Stewart 2020-07-18 06:21:25 UTC
The attached patch disables e2fsprogs scrub utilities by removing them from the Makefile.in. This fixes the build on systems where the paths it tries to mkdir -p do not already exist. But, a better patch is probably needed for upstream.