[LEDE-DEV] Makefile question

Yousong Zhou yszhou4tech at gmail.com
Mon Feb 13 22:25:28 PST 2017


On 14 February 2017 at 10:51, Philip Prindeville
<philipp_subx at redfish-solutions.com> wrote:
>
>> On Feb 12, 2017, at 10:04 PM, Yousong Zhou <yszhou4tech at gmail.com> wrote:
>>
>> On 13 February 2017 at 11:23, Philip Prindeville
>> <philipp_subx at redfish-solutions.com> wrote:
>>>
>>>> On Feb 11, 2017, at 8:29 PM, David Lang <david at lang.hm> wrote:
>>>>
>>>> On Sat, 11 Feb 2017, Philip Prindeville wrote:
>>>>
>>>>>> This can't eliminate the /etc/rc.d/S* files as it only adds files, and it's not as flexibile as adding a user or changing a password (as it would just let you replace the /etc/passwd, /etc/shadow files, not modify them).
>>>>>>
>>>>>> If you look for where the /files/* are copied into the filesystem, that is probably the place you would want to add your scripting hooks.
>>>>>
>>>>> Good idea.  I’ll look there.
>>>>
>>>> Once you find this, may I suggest that you create /scripts/* and contribute the infrastructure to support it back upstream?
>>>>
>>>> I have seen a lot of people wanting to do similar things.
>>>
>>>
>>> Surprisingly, I’m still trying to find in the Makefiles where $(topdir)/files/ gets copied over…
>>>
>>> -Philip
>>
>> It's prepare_rootfs doing this job at the moment.
>>
>>                yousong
>
>
> Hi Yousong,
>
> I’ve been working on both OpenWRT and LEDE and needed to get some hooks working in OpenWRT so I focused on that first.
>
> These are the changes I made, but I couldn’t get it to work.
>
> Was wondering if anyone can run with this.
>
> Part of the problem is making package/Makefile recurse with additional arguments and a different working directory…  When I try to do this, the submake of package/Makefile gets run without inherited variables like $(INCLUDE_DIR), etc.

package/Makefile was included by $(TOPDIR)/Makefile which included
$(TOPDIR)/rules.mk first and that's where was INCLUDE_DIR defined but
not exported.

>
> Also odd is even though the top of package/Makefile says:
>
> curdir:=package
>
> when it recurses $(curdir) retains some other value like “target” or “toolchain”.  Not sure why.
>

No idea how this happened as I do not yet have time to check the patch
in details.  Does it take these values in a random way?

The other thing is if it's just about pre/post hooks, then I guess the
Build/IncludeOverlay mechanism should already fulfil most (if not all)
of your needs.

                yousong



More information about the Lede-dev mailing list