On Fri, Mar 04, 2011 at 11:56:06AM +0100, Benoît Burnichon wrote:
> Hi all,
>
> I need to install replace a line for a targetinstall rule of a package.
>
> I need to be able to install a file with something like (a udev rule):
> KERNEL=="mydev", SUBSYSTEM=="myusb", SYMLINK+="opt"
>
> I tried the following call to install_replace:
> $(call install_replace,@OPT_DEVICE_SYMLINK_LINE@,"KERNEL==\"mydev\",
> SUBSYSTEM==\"mysub\", SYMLINK+=\"opt\"")
>
> When I do so, I get an error while trying to replace.
>
> What should I do to add quotes in the destination file?
There are multiple issues here:
1. $(call ...) uses ',' to separate argument. Something like this should help:
foo :=foo, bar, baz
$(call install_replace, foo, /etc/bar,@OPT_FOO@,$(foo))
2. a shell script platform-XXX/state/foo.cmds is created. Make sure
everything properly quoted here:
ptxd_install_replace '/etc/bar' '@OPT_FOO@' 'foo, bar, baz'
3. sed is used to actually replace the stuff:
scripts/lib/ptxd_make_xpkg_pkg.sh:
sed -i -e "s,${placeholder},${value},g" "${dirs[@]/%/${dst}}"
You need to escape the ',' for this to work. Not tested, so I'm not sure
if you need one or more \ for this.
Regards,
Michael
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
--
ptxdist mailing list
[email protected]