Bug 8811 - rp-pppoe - generated scripts commands use HOST pathnames, not necessarily TARGET
Summary: rp-pppoe - generated scripts commands use HOST pathnames, not necessarily TARGET
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-21 22:43 UTC by Lonnie Abelbeck
Modified: 2016-10-24 21:43 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lonnie Abelbeck 2016-03-21 22:43:29 UTC
Hi,

When building with CentOS 7 as the host, for files scripts/*.in, the @ID@ gets mapped to /bin/id instead of /usr/bin/id since rp-pppoe uses the host paths, not necessarily for the target.

Here is our fix...

In package/rp-pppoe/rp-pppoe.mk:
--
+define RP_PPPOE_SET_TARGET_COMMAND_PATHS
+	find $(@D)/scripts/ -name "*.in" | xargs sed -i \
+		-e 's:@ID@:/usr/bin/id:g' \
+		-e 's:@SETSID@:/usr/bin/setsid:g' \
+		-e 's:@ECHO@:/bin/echo:g' \
+		-e 's:@PPPD@:/usr/sbin/pppd:g'
+endef
+RP_PPPOE_POST_PATCH_HOOKS += RP_PPPOE_SET_TARGET_COMMAND_PATHS
--

You may ask why not eliminate the fully defined paths, but for @SETSID@ it is tested with -x in the script so it needs a full pathname.  The rest may not need a full pathname.

I think this fix is the lesser of the evils, and is easily tweaked if needed.

Lonnie