Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need to do sed to replace ${D} string in do_install()

I am doing a yocto recipe:

do_install () {
  install -d -m 755 ${D}/opt/intel
  sed -i 's/\/opt\/intel/\/TEST_PATH/' silent.cfg
}

This will work, but I want to replace TEST_PATH to ${D} in the recipe, the follows will bitbake fail:

do_install () {
  install -d -m 755 ${D}/opt/intel
  sed -i 's/\/opt\/intel/${D}/' silent.cfg
}

error:

sed: -e expression #1, char 17: unknown option to `s'
like image 702
Mark Kang Avatar asked Oct 15 '25 07:10

Mark Kang


1 Answers

I dont know about the yocto aspect, which I am assuming replaces ${D} for you, but in sed the substitute command can use any delimiter, not just /. For example, if your variable ${D} doesn't contain a colon : you could use that:

sed -i 's:/opt/intel:${D}:' silent.cfg
like image 129
meuh Avatar answered Oct 18 '25 05:10

meuh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!