issue with in official image

Started by thom_nic, January 18, 2017, 11:42:28 pm

Previous topic - Next topic


January 18, 2017, 11:42:28 pm Last Edit: April 18, 2017, 08:45:03 pm by thom_nic
Following the instructions for building the image, you're writing out `` using a heredoc, however the contents containing shell vars are being interpreted in the host shell instead of being written out to the script.  Thus the resulting script looks like this:

# Set strings
mkdir strings/0x409
echo  > strings/0x409/serialnumber
echo  > strings/0x409/manufacturer
echo  > strings/0x409/product

# Create configuration
mkdir configs/c.1
mkdir configs/c.1/strings/0x409
echo "120" > configs/c.1/MaxPower
echo  > configs/c.1/strings/0x409/configuration

# Creating functions
mkdir functions/acm.usb0

# Associate function with comfiguration
ln -s functions/acm.usb0 configs/c.1

# Enable UDC
echo  > UDC

Note all the `echo` lines that should be echoing a value from a variable are just echoing an empty string.  Should want to fix this in the next release of the official image. 


February 03, 2017, 10:58:01 pm #1 Last Edit: April 18, 2017, 08:44:18 pm by thom_nic
I realized the issue is the first line:

cat << __EOF__ > /usr/bin/

The heredoc delimiter must be quoted to disable immediate evaluation of the contents, like so:

cat <<"__EOF__" > /usr/bin/


February 03, 2017, 11:38:43 pm #2 Last Edit: April 18, 2017, 08:44:11 pm by thom_nic
Also the very first line reads


instead of