aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/contrib/ddimage
AgeCommit message (Collapse)Author
2016-05-06ddimage: if 'pv' is installed, use itChristopher Larson
This gives us a progress bar for the image write, which is quite helpful. See https://www.ivarch.com/programs/pv.shtml. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-05-28ddimage: Support Mac OSDarren Hart
Update the ddimage script to allow it to work on Mac OS too. The biggest difference is sysfs vs diskutil and in the syntax of the stat command between Mac OS and Linux, unfortunately. Workarounds using ls, cut, and columns got really fragile really quickly. Relying on stat and switching on uname seemed the more robust solution. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Cc: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-18scripts/contrib/*: fix arithmetic bashismPaul Eggleton
Apparently $[...] isn't valid in dash, so use $((...)) instead for mkefidisk.sh and ddimage that both start with $!/bin/sh. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-06-10ddimage: fix incompatibility with dashHongxu Jia
On systems with dash as /bin/sh there were failures while invoking ddimage. Fix to let it work with both bash and dash shells. [YOCTO #4617] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-09-20Replace "echo -e" with "printf" to have the same behavior in dash or bashAndrei Gherzan
oe-core removed the prerequisite to have sh as bash. POSIX doesn't define any options and furthermore allows 'echo -e' to be the default behavior. This means that in dash 'echo -e' will actually print '-e' and interpret backslashes by default. We use instead 'printf' builtin command with or without '\n' to simulate 'echo -e' or 'echo -n'. 'printf' needs format while 'echo' can be used without any arguments. So 'echo >' was replaced by 'printf "" >'. 'echo' without '-n' flag adds a new line by default so to keep the same behavior of two new lines while using 'echo "\n"', 'printf "\n\n"' is used. [YOCTO #3138] Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-22ddimage: Add script for writing images to boot mediaDarren Hart
Fixes [YOCTO #1806] Standard practice is to use the Linux "dd" command to write images to boot media. This can be error prone and the results of sloppy usage can be disastrous. Locating the device you want to use is a clumsy process, especially on a headless build system. The ddimage script does the following: o Check the image and device exist o Check the device is writable o Compare the device to a blacklist and abort if it's listed Blacklist defaults to "/dev/sda" o Display useful identifying information about the image and device o Prompt the user before commencing the write The output looks something like this: $ sudo ~/bin/ddimage tmp/deploy/images/core-image-sato-fri2-noemgd.hddimg /dev/sdk Image details ============= image: `tmp/deploy/images/core-image-sato-fri2-noemgd.hddimg' -> `core-image-sato-fri2-noemgd-20111202214038.hddimg' size: 318568448 bytes modified: 2011-12-02 13:45:05.298897861 -0800 type: x86 boot sector, code offset 0x58, OEM-ID "SYSLINUX", sectors/cluster 16, root entries 512, Media descriptor 0xf8, sectors/FAT 152, heads 64, hidden sectors 32, sectors 622204 (volumes > 32 MB) , serial number 0x4ed946e0, label: "boot ", FAT (16 bit) Device details ============== device: /dev/sdk vendor: Kingston model: DT 101 G2 Write tmp/deploy/images/core-image-sato-fri2-noemgd.hddimg to /dev/sdk [y/N]? y Writing image... 303+1 records in 303+1 records out 318568448 bytes (319 MB) copied, 53.6766 s, 5.9 MB/s Signed-off-by: Darren Hart <dvhart@linux.intel.com> CC: Dexuan Cui <dexuan.cui@intel.com> CC: Joshua Lock <josh@linux.intel.com> CC: Kishore K Bodke <kishore.k.bodke@intel.com>