Preconditions/Environment ------------------------- Using image built with Yocto 2.1.1 (jethro branch) Build target is intel-corei7-64 from meta-intel Installing image on Sony Vaio with SanDisk 256GB SSD Triggering Action/Cause ----------------------- Run install.sh Expectation ----------- The image is installed Actual Result ------------- Install script fails with "./install.sh: line 131: arithmetic syntax error". This is the line referenced: swap_size=$((disk_size*swap_ratio/100)) Adding printouts of $disk_size and $swap_ratio shows that $swap_ratio is set correctly, but $disk_size is set to this: SanDisk 256061 $disk_size is set several lines prior by this line: disk_size=$(parted ${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//") On this test system, "parted /dev/sda unit mb print" returns the following: Model: ATA SanDisk SD6SN1M2 (scsi) Disk /dev/sda: 256061MB ...snip... It looks like "Disk" being in the model specification line is causing the manufacturer name to be captured by "grep Disk" when this was not intended. Executing the entire command that is supposed to be setting $disk_size$ confirms this: $ parted /dev/sda unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//" SanDisk 256061 < blank line > The end result is that the $disk_size variable contains a string with alphabetic characters, rather than just numbers, resulting in the arithmetic syntax error when it is used in a calculation. Reproducibility --------------- 5/5, assuming SanDisk HDD/SSD is used. Other Notes --------------- The same command is used in multiple scripts to set $disk_size, so this issue likely affects all of them. install.sh was just used as an example.
There appears to be a fix for this issue in master and krogoth, I will propose this as a backport for jethro. You can see the patch here: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=3ce7d8cdc8537fef07efc2d3f6b540faab1819e4 If you are working from a GIT branch for jethro, you might try to cherry pick: git cherry-pick 3ce7d8cd
Thanks for the info. Given that the fix is present in a newer release than we're using, I would be fine with this being closed. It sounds like just completing our Krogoth upgrade will resolve it.
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=jethro&id=2ff9d30dac1d0734547b0793bd5d1efb00d00f4e