[2019-08-13 10:43] Shengjing Zhu <z...@debian.org>
> > [2019-08-11 22:54] Shengjing Zhu <z...@debian.org>
> > > This C patch works for me. But I have another approach now.
> > >
> > > Add following script as /usr/bin/execlineb
> > >
> > > #!/usr/lib/execline/bin/execlineb -S0
> > > /usr/lib/execline/bin/importas -D
> > > /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PATH PATH
> > > /usr/lib/execline/bin/export PATH /usr/lib/execline/bin:${PATH}
> > > /usr/lib/execline/bin/exec -a $0 /usr/lib/execline/bin/execlineb $@
> > >
> > > What do you think?
> >
> > Good, very good. But it will only work on Linux. kFreeBSD does not
> > permit scripts (not ELF binaries) to be used as interpreters.
>
> The first time to know that. But execline currently is only
> (successfully) built on linux.

Okay. Probably you want set 'arch: linux-any' then or re-write
/usr/bin/execlineb script in C, like this:

int main(int argc, char **argv)
{
        char *new_argv[argc + 20];
        new_argv[0] = "/usr/lib/execline/bin/importas";
        new_argv[1] = "/usr/lib/execline/bin/importas";
        new_argv[2] = "-D";
        // etc.
        memcpy(new_argv + ?, argv, argc * sizeof(char*));
        execv(new_argv[0], new_argv);
}

I do not have strong opinion, I only use Linux kernel.
-- 
Note, that I send and fetch email in batch, once in a few days.
Please, mention in body of your reply when you add or remove recepients.

Reply via email to