chromiumos/platform/image-burner.git
8 months agoFix imageburner unittests under asan 49/64749/3 master release-R30-4537.B stabilize-4512.B
Toni Barzic [Tue, 6 Aug 2013 04:33:33 +0000 (21:33 -0700)]
Fix imageburner unittests under asan

BUG=chromium:263045,chromium:261351
TEST=run unittests under asan; verified chrome://imageburner still works

Change-Id: I2117361965f43627143dc577aab7f73fe74a2390
Reviewed-on: https://gerrit.chromium.org/gerrit/64749
Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
Commit-Queue: Toni Barzic <tbarzic@chromium.org>
Tested-by: Toni Barzic <tbarzic@chromium.org>
9 months agoimage_burner: USE scoped_ptr<char[]> for array. 47/61747/2 factory-4455.B factory-pit-4471.B firmware-pit-4482.B stabilize-4443.B
Yunlian Jiang [Fri, 12 Jul 2013 20:56:17 +0000 (13:56 -0700)]
image_burner: USE scoped_ptr<char[]> for array.

I saw  ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs operator delete)
on 0x600400001e90 when running ASan with it.
This patch fix this problem.

BUG=None
TEST=FEATURES="test" emerge-lumpy chromeos-imageburner

Change-Id: Ia55570cbe9400e855a67a797509039bcba5c3c6d
Reviewed-on: https://gerrit.chromium.org/gerrit/61747
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
9 months agoFix imageburner target file path validation to better support SD cards. 46/60946/2
Tim Song [Wed, 3 Jul 2013 23:47:32 +0000 (16:47 -0700)]
Fix imageburner target file path validation to better support SD cards.

On some platforms, SD cards are mounted at /dev/mmcblk* rather than
/dev/sd* as currently expected. We replace prefix checking of the file
path to instead use regexes.

BUG=chromium:232897
TEST=unit tests and manual
Change-Id: Id26f96c9ba35bb7988f03c1dd7cac1ec79d6fc2d
Reviewed-on: https://gerrit.chromium.org/gerrit/60946
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
Commit-Queue: Tim Song <tengs@chromium.org>
Tested-by: Tim Song <tengs@chromium.org>
10 months agoGet rid of image_burner_tester 59/58459/2 factory-4290.B factory-pit-4280.B factory-pit-4390.B firmware-falco_peppy-4389.B firmware-leon-4389.26.B firmware-wolf-4389.24.B release-R29-4319.B stabilize-4287.B
Toni Barzic [Wed, 12 Jun 2013 23:18:45 +0000 (16:18 -0700)]
Get rid of image_burner_tester

and while here, fix two missing returns.

BUG=chromium:221781
TEST=image burner unittests; verified chrome://imageburner not broken

Change-Id: Ie185d7c692b2da4584954953ab4b681c487c3415
Reviewed-on: https://gerrit.chromium.org/gerrit/58459
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: Toni Barzic <tbarzic@chromium.org>
Tested-by: Toni Barzic <tbarzic@chromium.org>
12 months agoimageburner: Calculate gmock/gtest library dependencies programatically 21/46421/5 factory-4128.B factory-spring-4131.B factory-spring-4262.B release-R27-3912.B release-R28-4100.B stabilize-3912.79.B stabilize-4008.0.B stabilize-4035.0.B stabilize-4068.0.B stabilize-4100.38.B stabilize-4255.B stabilize-spring-4100.53.B toolchainA toolchainB
Gaurav Shah [Sun, 24 Mar 2013 22:55:50 +0000 (15:55 -0700)]
imageburner: Calculate gmock/gtest library dependencies programatically

(gmock/gtest doesn't generate pkg-config metadata, calculating lib
 dependencies this way makes it easier to upgrade gmock/gtest packages.)

BUG=chromium:211445
TEST=build and run tests for package using gtest 1.6

Change-Id: I11e552297e5d5b99ee8387b0388b1f51ffb0d616
Reviewed-on: https://gerrit.chromium.org/gerrit/46421
Reviewed-by: <tbarzic@google.com>
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Queue: Gaurav Shah <gauravsh@chromium.org>

13 months agoBuild against libchrome-180609 01/44201/2 factory-spring-3842.B firmware-spring-3824.4.B firmware-spring-3824.55.B firmware-spring-3824.84.B firmware-spring-3824.B firmware-spring-3833.B stabilize-3881.0.B
Chris Masone [Wed, 27 Feb 2013 19:07:03 +0000 (11:07 -0800)]
Build against libchrome-180609

BUG=chromium-os:38932
TEST=build, unit tests
STATUS=Fixed

Change-Id: Ic3edabfcd1d1486edd497e58baca01eae90c72c4
Reviewed-on: https://gerrit.chromium.org/gerrit/44201
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Chris Masone <cmasone@chromium.org>

23 months agoAdd unistd.h to make gcc 4.7 can compile factory-2268.16.B factory-2305.B factory-2338.B factory-2368.B factory-2394.B factory-2460.B factory-2475.B factory-2569.B factory-2717.B factory-2723.14.B factory-2846.B factory-2848.B factory-2914.B factory-2985.B factory-2993.B factory-3004.B factory-3536.B firmware-butterfly-2788.B firmware-link-2348.B firmware-link-2695.2.B firmware-link-2695.B firmware-parrot-2685.B firmware-snow-2695.90.B firmware-snow-2695.B firmware-stout-2817.B release-R20-2268.B release-R21-2465.B release-R22-2723.B release-R23-2913.B release-R25-3428.B release-R26-3701.B stabilize stabilize-3428.110.0 stabilize-3428.149 stabilize-3428.149.B stabilize-3428.193 stabilize-3658.0.0 stabilize-3701.30.0 stabilize-3701.30.0b stabilize-3701.46.B stabilize-3701.81.B stabilize-bluetooth-smart stabilize-daisy stabilize-link stabilize-link-2913.278 stabilize2 toolchain-3428.65.B toolchain-3701.42.B
Yunlian Jiang [Wed, 2 May 2012 18:07:47 +0000 (11:07 -0700)]
Add unistd.h to make gcc 4.7 can compile

BUG=None
TEST=compile pass

Change-Id: I6353902cbdffc3397b5c5a3eafac667481514bbf
Reviewed-on: https://gerrit.chromium.org/gerrit/21649
Reviewed-by: <tbarzic@google.com>
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
Commit-Ready: Yunlian Jiang <yunlian@chromium.org>

2 years agoupdate to newer libbase
Mike Frysinger [Wed, 11 Apr 2012 18:49:44 +0000 (14:49 -0400)]
update to newer libbase

BUG=chromium-os:25872
TEST=`emerge-x86-alex chromeos-imageburner` works
TEST=`cros_run_unit_tests --board=x86-alex -p chromeos-imageburner` passed

Change-Id: I3ad0704cdc893e40c3ced494b1edfb49b7cf822d
Reviewed-on: https://gerrit.chromium.org/gerrit/20009
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2 years ago[image-burner] add OWNERS
Elly Jones [Fri, 6 Apr 2012 19:23:00 +0000 (15:23 -0400)]
[image-burner] add OWNERS

TEST=None
BUG=chromium-os:22007

Change-Id: Idfb7ee235256d7b8bd18e2d46ec2cd6917f779b2
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/19771
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
2 years agoconvert to SLOT-ed libbase factory-1987.B release-R19-2046.B
Mike Frysinger [Thu, 8 Mar 2012 19:13:19 +0000 (14:13 -0500)]
convert to SLOT-ed libbase

This includes a couple of fixes:
 - use the right compiler flag names
 - execute pkg-config twice total, and not once per compile
 - build against SLOT-ed libbase
 - drop link info that was just for libbase as that handles
   things all by itself now without bothering external users

BUG=chromium-os:16623
TEST=`emerge-x86-alex chromeos-imageburner` works
TEST=`cros_run_unit_tests --board x86-alex -p chromeos-imageburner` works

Change-Id: I51680c036d14eb9eac14b4fc615be5deb6b941ea
Reviewed-on: https://gerrit.chromium.org/gerrit/17600
Reviewed-by: Ryo Hashimoto <hashimoto@chromium.org>
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2 years ago[imageburner] refactor makefile release-R18-1660.B
Elly Jones [Wed, 18 Jan 2012 22:21:36 +0000 (17:21 -0500)]
[imageburner] refactor makefile

Refactor the Makefile to reduce dummy variable use, generally clean it up. Also,
use libchromeos.pc instead of hardcoding library dependencies.

BUG=chromium-os:24959
TEST=build

Change-Id: I57c612f2b4903f1e63795dad2af7b3603238bc0c
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/14404
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2 years agoFix mulfunctioning signal ratio limit.
Ryo Hashimoto [Tue, 17 Jan 2012 12:58:32 +0000 (21:58 +0900)]
Fix mulfunctioning signal ratio limit.

Limit by amount instead of number of calls.

BUG=chromium-os:25125
TEST=gmerge chromeos-imageburn

Change-Id: Ib26e15838a2453ff61361290b9f0ba298924d9b0
Reviewed-on: https://gerrit.chromium.org/gerrit/14283
Tested-by: Ryo Hashimoto <hashimoto@chromium.org>
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
2 years agoChanging BurnWriter Open function so it fails if the file we are opening does not... 0.14.811.B 0.15.877.B 780.B factory-1020.B factory-1235.B factory-1284.B factory-1412.B factory-980.B firmware-881-u-boot-v1 firmware-kiev-2.112.B firmware-u-boot-v1 firmware-uboot_v2-1299.B release-1011.B release-R16-1193.B release-R17-1412.B test-982.B
tbarzic [Tue, 21 Jun 2011 20:34:26 +0000 (13:34 -0700)]
Changing BurnWriter Open function so it fails if the file we are opening does not exist

Previously, target file would be created if it didn't exist.

Also, for both BurnWriter and BurnReader, in Open function we now check if they
had previously opened file. We close the file if that is the case.

BUG=None
TEST=Run image_burner_tester with no device attached and check it fails.
     var/log/image_burner.log should contain ERROR:
     Couldn't open target path /dev/sdb: no souch path or directory (or something similar).

Change-Id: Iea2e97a46fb5f6ba553be8d43c5e82d330f0e335
Reviewed-on: http://gerrit.chromium.org/gerrit/2936
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Tested-by: Toni Barzic <tbarzic@chromium.org>
2 years agoRefactoring image burn service and adding some unittests.
tbarzic [Fri, 10 Jun 2011 03:27:58 +0000 (20:27 -0700)]
Refactoring image burn service and adding some unittests.

Mostly extracting existing logic to separate interfaces:
FileWriter, FileReader, SignalSender

Also, we don't asume that boot device is on /dev/sda

TEST=Run unittests for imageburner;
     On ChromeOS: /usr/sbin/image_burner_tester (needs root device to be on sda,
                      and a removable device on sdb (which gets destroyed)).

BUG=chromium-os:16318

Change-Id: I58d4191ddb3c793cd2ca840ed533c00187e33e26
Reviewed-on: http://gerrit.chromium.org/gerrit/2705
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Tested-by: Toni Barzic <tbarzic@chromium.org>
2 years agoMaking imageburn service async + removing unmounting + nicer error setting 0.13.587.B
tbarzic [Thu, 12 May 2011 22:48:25 +0000 (15:48 -0700)]
Making imageburn service async + removing unmounting + nicer error setting

BUG=chromium-os:15322,chromium-os:12226
TEST=Make sure imageburner works, insert removable device after
     reboot and run ./usr/sbin/image_burner_tester from shell
     (this will erase your device)

Change-Id: I03b737ae7439e71cb2fb98f576e5555a1fb8eaf5
Reviewed-on: http://gerrit.chromium.org/gerrit/896
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Tested-by: Toni Barzic <tbarzic@chromium.org>
2 years ago[image-burner] Roll forward to new libchrome 0.13.558.B
Chris Masone [Thu, 12 May 2011 22:43:32 +0000 (15:43 -0700)]
[image-burner] Roll forward to new libchrome

BUG=chromium-os:14304
TEST=build, unit tests

Change-Id: I9b32600077aae9c0154cabfe3241443da73b882a
Reviewed-on: http://gerrit.chromium.org/gerrit/818
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
3 years agoMove lbase after lcrosapi. 0.11.241.B 0.11.257.B 0.11.257.B90 0.12.362.B 0.12.369.B 0.12.392.B 0.12.433.B 0.12.433.B109 0.12.433.B62 0.13.434.B 0.13.509.B 11.1.241.B
Steven Bennetts [Wed, 23 Feb 2011 23:37:11 +0000 (15:37 -0800)]
Move lbase after lcrosapi.
crosapi now depends on base for Time::Now().

Change-Id: I3b3df169b028455c71bf6a815ae8bb7d6bc788c1

BUG=none
TEST=make sure image-burner builds on all platforms.

Review URL: http://codereview.chromium.org/6551022

3 years agoUse chromeos::IsBootDevicePath.
Achuith Bhandarkar [Tue, 25 Jan 2011 22:31:29 +0000 (14:31 -0800)]
Use chromeos::IsBootDevicePath.

Cleanup.

BUG=chromium-os:6788
TEST=none

Change-Id: I7de901f3e00c2c35bfcf78eacda4185f07b81dec

Review URL: http://codereview.chromium.org/6357012

3 years agoFix security issue with imageburn service.
Achuith Bhandarkar [Thu, 21 Oct 2010 00:29:30 +0000 (17:29 -0700)]
Fix security issue with imageburn service.

Rename UnmountPartition to UnmountAndValidatePartition.
BurnImageTimeoutCallback should be private.
Rewrite UnmountPartition to ensure that target destination is a valid removable partition before allowing the burn.
Handle the case where the USB drive is unpartitioned.
Call FreeMountStatus to fix a minor leak.

BUG=7019
TEST=image_burner_tester

Change-Id: I6c846e6614a0447f88c326843d5a2462fffbfab6

Review URL: http://codereview.chromium.org/3735007

3 years agoRemove ownership of org.chromium.ImageBurner from chronos.
Satoru Takabayashi [Fri, 8 Oct 2010 03:31:45 +0000 (12:31 +0900)]
Remove ownership of org.chromium.ImageBurner from chronos.

chronos should not own the service.

Change-Id: I4a23caab5b4fafc6b1cb9584cd714a7e87446954

BUG=chromium-os:7187
TEST=sudo gmerge chromeos-imageburner; reboot; confirmed that chrome://imageburner worked as before.

Review URL: http://codereview.chromium.org/3582011

3 years agoAdd inherit-review-settings-ok
Ken Mixter [Wed, 15 Sep 2010 01:11:16 +0000 (18:11 -0700)]
Add inherit-review-settings-ok

Change-Id: I8b85420a5dab2571d730cb2fde4160e9f330e2c5

Remove -lcrash

Change-Id: I1734fee6bd98e3e9a216ddd759f217e0258d38ff

BUG=5870
TEST=build_packages

Review URL: http://codereview.chromium.org/3426003

3 years agoDbus service for burning image to usb key
Toni Barzic [Fri, 20 Aug 2010 00:44:24 +0000 (17:44 -0700)]
Dbus service for burning image to usb key

TEST: Download chromeos image (in .gz format ) to location home/chronos/Downloads/chromeos_image/chromeos_image.bin.gz
Run application /usr/sbin/image_burner_tester.
This should burn downloaded image to USB key on /dev/sdb (all information on the key will be lost).
During burning progress information should be displayed.

Review URL: http://codereview.chromium.org/3015065

3 years agoAdd LICENSE file
J. Richard Barnette [Thu, 5 Aug 2010 21:13:48 +0000 (14:13 -0700)]
Add LICENSE file

3 years agoinitial repo
Zelidrag Hornung [Sat, 31 Jul 2010 00:29:56 +0000 (17:29 -0700)]
initial repo