summaryrefslogtreecommitdiff
path: root/utility/crossystem.c
Commit message (Collapse)AuthorAgeFilesLines
* nvstorage: Add kernel max rollforward NV storage fieldRandall Spangler2017-11-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This just adds the kernel_max_rollforward field to the nvstorage libraries and crossystem. The firmware does not use it yet; that's coming in a subsequent CL. 16 of the fields's 32 bits are taken from unused bytes of the kernel field. This has no effect on existing usage. BUG=chromium:783997 BRANCH=none TEST=make runtests Also manual testing. In a root shell: crossystem kernel_max_rollforward --> Should default to 0 crossystem kernel_max_rollforward=0xfffffffe crossystem kernel_max_rollforward --> Should be 0xfffffffe (Note that setting it to 0xffffffff is indistinguishable from the -1 value that the crossystem library uses to indicate error, so 0xffffffff isn't actually usable as a max rollforward limit. But 0xfffffffe is, and if we ever get so close to the limit that we need to use 0xffffffff, something has already gone horribly wrong with our versioning strategy...) Change-Id: I008f412e6ed3c0b59beb9881268585af69d1ff2e Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/765572 Reviewed-by: Julius Werner <jwerner@chromium.org>
* crossystem: support standard --help flagMike Frysinger2017-09-221-1/+2
| | | | | | | | | | | | BUG=chromium:765499 TEST=unittests pass BRANCH=None Change-Id: I5c5118c44897d89e5116a9fce49bacbf16704dd8 Reviewed-on: https://chromium-review.googlesource.com/668658 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* crossystem: Remove defunct sw_wpsw_boot fieldstabilize-9765.7.Bstabilize-9765.39.BJulius Werner2017-07-181-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | The sw_wpsw_boot field only ever worked correctly on some platforms. It also isn't used anywhere in the codebase (only other reference is a comment about how it doesn't always work in factory_installer.sh), and it's no longer clear what it was meant for in the first place (b/35510092 hints at needing it for some planned feature that was never implemented). Let's get rid of it to avoid confusing people. If userspace tools need to know the software write-protect state, they can instead run flashrom directly. For feedback reports, this output is already included in the "verified boot" section. BRANCH=none BUG=chromium:508269,chromium:742685 TEST=none Change-Id: I8975b1e2c8e604b4cb48d092c13b923b4db2d207 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/575389 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* crossystem: add phase_enforcement fieldAaron Durbin2016-12-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Provide 'phase_enforcement' field that indicates if a system should have its full security features enabled while in the factory. The backend implementation currently is only for x86 using chromeos_acpi. On reef: $ grep ^ /sys/devices/platform/chromeos_acpi/GPIO.*/* /sys/devices/platform/chromeos_acpi/GPIO.2/GPIO.0:4 /sys/devices/platform/chromeos_acpi/GPIO.2/GPIO.1:1 /sys/devices/platform/chromeos_acpi/GPIO.2/GPIO.2:10 /sys/devices/platform/chromeos_acpi/GPIO.2/GPIO.3:INT3452:00 BUG=chrome-os-partner:59951 BRANCH=None TEST=Tested on reef with accompanying coreboot patches and flipping internal pulls to see the correct setting. Change-Id: Id5401d795cff8874a038f2456121549713a11237 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/418899 Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* Detect and report VM environment in crossystemNicolas Norvez2016-08-101-0/+1
| | | | | | | | | | | | | | | | | | Add "inside_vm" command to crossystem. x86: If there is no HWID and mainfw_type is "nonchrome", report that the host is a VM. If HWID is present, it's not a VM. ARM: Detection not implemented and so far no ARM VMs exist, always report that the system is not a VM BUG=chromium:632303 TEST=emerge-cyan vboot_reference and test binary on cyan QEMU and HW BRANCH=none Change-Id: I18f5cb24b68e51f3097d9aafd9f0db0e610d322a Reviewed-on: https://chromium-review.googlesource.com/367240 Commit-Ready: Nicolas Norvez <norvez@chromium.org> Tested-by: Nicolas Norvez <norvez@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Support doing battery cut-off in firmware stage.Hung-Te Lin2016-04-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new crossystem value "battery_cutoff_request" to indicate that next reboot should cut-off battery and shutdown during firmware stage. This request is primarily for factories to ship devices in an safe state. Previously we have done same thing by running "ectool battery-cutoff" but that creates a problem which "ectool" (and the one to request for cut-off) must live in developer mode while the device must be shipped in normal mode. The mode transition was solved by setting "disable_dev_request=1", but that flag is may get lost on x86 systems (having NV storage in CMOS) when the battery is cut-off . From the experience from Ryu, such settings (dev mode transition and battery cut-off) should be done together inside firmware execution so we can create a new flag, battery_cutoff_request, to finalize device properly. BRANCH=none BUG=chromium:601705 TEST=emerge-chell depthcharge vboot_reference chromeos-bootimage crossystem battery_cutoff_request=1 # Unplug AC adapter reboot # See device rebooted and then shutdown immediately. # Press power button and system won't boot. # Attach AC adapter and now system boots. CQ-DEPEND=CL:337596,CL:338193 Change-Id: I73ccae15b337cd65786106646546c67c155b8fa6 Reviewed-on: https://chromium-review.googlesource.com/337602 Commit-Ready: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
* vboot2: Add try RO software sync flagMary Ruthven2016-01-061-0/+1
| | | | | | | | | | | | | | This flag will be used by the firmware updater to indicate that RO software sync should be attempted. BUG=chrome-os-partner:48703 BRANCH=None TEST=make runtests Change-Id: I42090ac47da45c724e66334648ab447ad3c21178 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/320621 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* crossystem: Remove savedmem_base and savedmem_size fieldsstabilize-7647.74.Bstabilize-7647.72.Bstabilize-7647.32.Bstabilize-7628.Brelease-R48-7647.BJulius Werner2015-11-091-2/+0
| | | | | | | | | | | | | | | | | | | I don't even know what this is. It seems to have marked some kind of debug buffer provided by H2C BIOS on pre-Daisy Chromebooks and has not been touched since it was copied in here when crossystem was first added. I can't find any references in our codebase so I doubt anybody would miss it. Let's remove it so the '(error)' fields returned there on any modern Chromebook stop confusing our vendors. BRANCH=None BUG=chromium:551715 TEST=Built for Falco and Jerry. Change-Id: Ie2baec536b50bb192eb4cd3e48df212cce53561a Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/311346 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
* crossystem: Remove platform_family fieldJulius Werner2015-11-091-1/+0
| | | | | | | | | | | | | | | | | This field doesn't seem to be used for anyone and it keeps adding work for people trying to bring up new platforms. If we ever needed something like this again, we'd probably prefer to have it in mosys now anyway. Let's get rid of it. BRANCH=None BUG=chromium:551715 TEST=Built for Falco and Jerry. Change-Id: I6b96e255968fdd22a345d4a75bfdc1e79d3f5896 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/311345 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
* Add NV flag to default boot legacy OSMary Ruthven2015-10-131-0/+2
| | | | | | | | | | | | | | | | In developer mode, this option will make the system try to boot into a legacy OS first after the 30 second timeout. This removes the need to press a key during boot to try legacy mode and the need to remove the write protect screw to boot legacy as default. BUG=chromium:310697 BRANCH=none TEST=make runtests Change-Id: I9a9f64c14ad015e21d08eec36e8fc187189cd2f2 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/304077 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* vboot2: Support reboot requested by secdataRandall Spangler2015-09-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a TPM goes from the disabled state to the enabled state, it must reboot after being enabled, before it can be initialized. In vboot1, TLCL was part of vboot and this was handled internally. In vboot2, the caller must set a context flag, so that vboot can decide whether to allow the reboot, or whether to go directly to recovery mode. This check is necessary to handle the following cases: 1) The device is booting normally, but the TPM needs a reboot. This should simply reboot, without going to recovery mode. 2) The device is booting in recovery mode, but the TPM needs a reboot. If this is the first time it asked us, allow the reboot. 3) The TPM asked for a reboot last time, so we did. And it's still asking. Don't reboot, because that runs the risk that whatever is wrong won't be fixed next boot either, and we'll get stuck in a reboot loop that will prevent recovery. Boot into recovery mode. Add a new NvStorage bit to track whether the TPM requested a reboot on the previous boot. That's better than what we did in vboot1, where we used a special recovery request. Vboot1 couldn't track getting stuck in a reboot loop in normal mode, only in recovery mode. The new code can catch both. BUG=chrome-os-partner:45462 BRANCH=ryu TEST=make runtests Change-Id: I2ee54af107275ccf64a6cb41132b7a0fc02bb983 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/300572 Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* crossystem: Revise description of sw_wpsw_boot.release-R45-7262.BHung-Te Lin2015-07-091-1/+1
| | | | | | | | | | | | | | | | The sw_wpsw_boot was made for some feature that was almost never completed, and only makes sense on Baytrail platforms. To prevent confusion we should address that in the crossystem description. BRANCH=none BUG=chromium:508269 TEST=make test Change-Id: I1fbc7a0e9e8c1f8503ae8ae9dfb6e80c8da892e3 Reviewed-on: https://chromium-review.googlesource.com/284425 Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org>
* crossystem: Deprecate ddr-typeDavid Hendricks2015-04-071-1/+0
| | | | | | | | | | | | | | | | | AFAICT this property is not really used by anything. All factory scripts that need detailed memory info get it from mosys. Most platforms display "unknown" which causes confusion whenever a bug is filed to support crossystem on a new platform. BUG=chrome-os-partner:36176 BRANCH=none TEST=no more "unknown" ddr-type shown in crossystem output on speedy Signed-off-by: David Hendricks <dhendrix@chromium.org> Change-Id: I97e66c362e9d88c843128a411512d5a76ac5f87d Reviewed-on: https://chromium-review.googlesource.com/263982 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* crossystem: provide a way to clear wipeout requeststabilize-6915.BVadim Bendebury2015-03-261-1/+1
| | | | | | | | | | | | | | | For test purposes it should be possible to clear the wipeout request raised by firmware. BRANCH=none BUG=chrome-os-partner:36059 TEST=verified that crossystem wipeout_request=0 changes the bit from 1 to 0, and wipeout_request=1 does not change it from 0 to 1. Change-Id: Ic45ec03ed3e40e6fee4244804b8c231ee88af95b Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/262466 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* vboot_reference: crossystem: add the "tpm_attack" commandLuigi Semenzato2015-03-211-2/+6
| | | | | | | | | | | | | | | | | | | This commands reads/sets a bit in the kernel-reserved area of the vboot context nvram. The bit can also be set by the driver during execution of a TPM command, to check if the command is interrupted by a panic or power loss. Under some circumstances, this correlates with the TPM assuming it is under attack. BUG=chromium:431360 TEST=try "crossystem tpm_attack" and variations BRANCH=none Change-Id: I87215d5a0becfb5c01e0b69867a339bfe6fd0b68 Reviewed-on: https://chromium-review.googlesource.com/261339 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Luigi Semenzato <semenzato@chromium.org> Tested-by: Luigi Semenzato <semenzato@chromium.org>
* vboot: allow firmware to signal a wipeout requestVadim Bendebury2015-03-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | It has become necessary to be able to "factory reset" certain devices on firmware request. The best mechanism for this is NVRAM, as the request needs to be detected very early in the boot process, before other means of communications with the upper layers are available. A previously unused NVRAM bit (bit 0x08 at offset zero) is taken for this purpose. A new flag is introduced to allow the firmware to signal the need to assert this bit. A new variable name/parameter ('wipeout_request') added to crossystem to provide user space access to the setting of the dedicated NVRAM bit. BRANCH=storm BUG=chrome-os-partner:37219 TEST=with all the patches applied, on storm, holding the recovery button at startup for 10 seconds, causes 'crossystem wipeout_request' to report '1'. Change-Id: If1f6f061ce5b3f357b92aaa74cb129671dc30446 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/259857 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* crossystem: Add fw_prev_tried and fw_prev_result to output valuesJulius Werner2015-01-311-0/+2
| | | | | | | | | | | | | | | | | | CL:221230 added the new NVRAM fields fw_prev_tried and fw_prev_result. It also provided support in the crossystem library to decode these values, but it forgot to add them to the table of allowed crossystem options so they actually cannot be queried by the command line tool. Fix that since this information is useful to debug failures after updating. BRANCH=R41 BUG=chrome-os-partner:36183 TEST=make runtests VBOOT2=1. cros deployed onto Jerry and confirmed fw_prev_tried and fw_prev_result are correct. Change-Id: I8bad7266379d959f5370b7ebeefbbba939c5de06 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/245143 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add nvstorage / crossystem support for new vboot2 fieldsRandall Spangler2014-06-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows testing vboot2. These fields are ignored by original vboot firmware. BUG=chromium:370082 BRANCH=none TEST=manual crossystem -> fw_tried=A, fw_result=unknown, fw_try_next=A crossystem fw_tried=B echo $? -> 1 crossystem -> fw_tried=A, fw_result=unknown, fw_try_next=A crossystem fw_try_next=B crossystem -> fw_tried=A, fw_result=unknown, fw_try_next=B crossystem fw_try_next=beats_me echo $? -> 1 crossystem -> fw_tried=A, fw_result=unknown, fw_try_next=B crossystem fw_try_next=A crossystem -> fw_tried=A, fw_result=unknown, fw_try_next=A crossystem fw_result=trying crossystem -> fw_tried=A, fw_result=trying, fw_try_next=A crossystem fw_result=bupkis echo $? -> 1 crossystem -> fw_tried=A, fw_result=trying, fw_try_next=A crossystem fw_result=success crossystem -> fw_tried=A, fw_result=success, fw_try_next=A crossystem fw_result=failure crossystem -> fw_tried=A, fw_result=failure, fw_try_next=A crossystem fw_result=unknown crossystem -> fw_tried=A, fw_result=unknown, fw_try_next=A crossystem -> fw_try_count = 0, fwb_tries = 0 crossystem fw_try_count=6 crossystem -> fw_try_count = 6, fwb_tries = 6 crossystem fwb_tries=0 crossystem -> fw_try_count = 0, fwb_tries = 0 Change-Id: I1532f3384f8c05de2a7ff3f35abcc35d18049491 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/205475
* vboot2: add a flag to indicate firmware was selected by vboot2Daisuke Nojiri2014-06-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | TEST=Done manually on Nyan: localhost ~ # sudo /tmp/crossystem fw_vboot2 0 localhost ~ # sudo /tmp/crossystem fw_vboot2=1 localhost ~ # sudo /tmp/crossystem fw_vboot2 0 # reboot with vboot2 firmware localhost ~ # /tmp/crossystem fw_vboot2 1 BUG=none BRANCH=none Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I6ed553c48bdfebf07393f6f5f46832a60971314a Reviewed-on: https://chromium-review.googlesource.com/205664 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
* Use the TPM to back up some of the nvram fieldsBill Richardson2014-06-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use a few bytes of battery-backed nvram to save some flags across reboots. However if the battery discharges completely, these flags are lost. There aren't any security issues with that since they reset to safe values, but some of the flags are used to configure how the system boots in dev-mode. If a dev-mode user has completely replaced ChromeOS with some other OS, then she often needs to set the dev_boot_usb and/or dev_boot_legacy flags as well in order to boot it using Ctrl-U or Ctrl-L. If the battery dies, then those flags are cleared, and the only way to make the Chromebook boot again is by going through recovery, which wipes the disk. This change uses a new NV space in the TPM to back up some of the nvram flags. These nvram fields will be backed up: block_devmode dev_boot_legacy dev_boot_signed_only dev_boot_usb fwupdate_tries loc_idx Because writing to the TPM space is slow and limited to an unspecified but finite number of cycles, we only back up the fields when specifically requested by the new backup_nvram_request flag. This flag will be set by crossystem whenever it is used to change any of the fields listed above. The backup will be attempted at the NEXT boot (because the TPM is locked after booting), and the backup_nvram_request flag will be cleared if the backup was successfull. Note that this CL is for Top of Trunk only. The firmware will create the required TPM spaces on systems that have never been booted, but we don't yet have a secure or reliable method to update existing systems. FYI, on Link, determining that the TPM's backup NV space doesn't exist adds about 6ms to the boot time. If it does exist, the backup_nvram_request flag is cleared automatically so it won't check until it's set again. BUG=chromium:362105 BRANCH=ToT (only!) TEST=manual Testing this is a long and involved process. Read on... First, there are host-side tests for it. In the chroot: cd src/platform/ec make runtests Second, to test on a completely NEW system that was first booted with a BIOS that contains this CL, do this: Enter dev-mode Use crossystem to set values for the fields listed above Confirm that "backup_nvram_request" is set to 1 Reboot Use crossystem to confirm that "backup_nvram_request" is now 0 Remove the battery and the AC Reattach either battery or AC so it will boot again Use crossystem to confirm that the backed up fields are still good, while the others have been reset to default values Switch to normal mode Remove the battery and the AC Reattach either battery or AC so it will boot again Look at the bios info in chrome://system to see what crossystem says Confirm that the dev_boot_* flags are all 0, while the others are restored Third, to set things up to test this on an existing system (I used Link), you have update the BIOS, delete both the Kernel and Firmware NV spaces in the TPM, then reboot so that the BIOS will create the Backup, Kernel, and Firmware spaces. It will only do that if they're all missing. Open it up, disable write-protect, attach a servo, etc. Switch to dev-mode, log in. Run make_dev_firmware.sh Reboot in recovery mode, and insert a USB stick with a test image on it. NOTE: In order to fiddle with the TPM, we'll *always* have to boot in recovery mode, since that's the only time the TPM is left unlocked. That's NOT the same as pressing Ctrl-U at the scary boot screen. The rest of these steps assume you've booted in recovery mode and are running from the test image on the USB stick. Run make_dev_ssd.sh --remove_rootfs_verification --recovery_key Reboot (recovery mode) Run mv /etc/init/tcsd.conf /etc/init/tcsd.conf.disabled Reboot (recovery mode). Run "tpmc getvf". It should say deactivated 0 disableForceClear 0 physicalPresence 1 physicalPresenceLock 0 bGlobalLock 0 Run "tpmc geto". It should say Owned: no Now you'll need to build the "tpm-nvtool" utility. In the chroot: cd src/third_party/tpm/nvtool make Copy that to the DUT, in /usr/local/bin. Now run tcsd tpm-nvtool --list | grep Index You may see a number of spaces, but you should at least see these: # NV Index 0x00001007 # NV Index 0x00001008 Run tpm_takeownership It will prompt you for two passwords (and confirm each one). Respond with something you can remember like "google". Run tpm-nvtool --release --index 0x1007 --owner_password "google" tpm-nvtool --release --index 0x1008 --owner_password "google" Verify that it worked with tpm-nvtool --list | grep Index Power off. Using servo, flash the new BIOS that has this CL in it. Power on, normally this time (not recovery mode). If all goes well, it should create the correct NV spaces and boot into the SSD. Copy tpm-nvtool into this image too, and run tpm-nvtool --list | grep Index You should now see at least these spaces: # NV Index 0x00001007 # NV Index 0x00001008 # NV Index 0x00001009 Now you're ready to test the backup/recover feature. Change-Id: I00031fa0774720147327e2ae0f37e26b34b86341 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/202138 Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
* Add an nvram flag to block the use of dev modestabilize-swanky-5841.55.Bstabilize-gnawty-5841.84.Bstabilize-5841.83.Bstabilize-5841.76.Bstabilize-5828.0.Brelease-R36-5841.Bfirmware-tricky-5829.Bfirmware-mccloud-5827.BBill Richardson2014-05-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, this does nothing. It just sets a flag that nothing looks at. Don't get all wound up - we haven't abandoned our principles. This will eventually be used to allow enterprise-enrolled customers to prevent unauthorized use of developer mode in the Chrome OS devices that THEY OWN. This is not Google deciding to turn a feature off, it's allowing the OWNER to control the use of the feature. In some situations, the owner can be held liable for what others do with the owner's equipment. This will help the owner avoid those situations while their device is out of their immediate control. BUG=none BRANCH=ToT TEST=manual Set the flag with: crossystem block_devmode=1 Clear it with: crossystem block_devmode=0 Retrieve the value ("0" or "1") like so: val=$(crossystem block_devmode) echo "the flag is $val" or just test it directly like so: if crossystem 'block_devmode?1' ; then echo "devmode is blocked" else echo "devmode is allowed" fi It should be persistent across reboots. Change-Id: I097f15b307e1c3a2a9db595e9495028a2eea6309 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/197771 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Make crossystem.h more polite and more useful.test-4980.Btest-4824.Bstabilize-R33-4982.Bstabilize-5062.Bstabilize-4920.6.Brelease-R32-4920.Bfirmware-bolt_kirby-4979.Bfactory-panther-4920.23.BJ. Richard Barnette2013-10-311-6/+3
| | | | | | | | | | | | | | | | | | | This adds a VB_MAX_STRING_PROPERTY for callers that don't want to guess at how big to make their buffers. Additionally, it changes the size parameter to VbGetPropertyString() from int to size_t. BUG=None TEST=compile the code BRANCH=none Change-Id: I22809d48e13b535593cb22a56444e2dcb27791a5 Reviewed-on: https://chromium-review.googlesource.com/175039 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Richard Barnette <jrbarnette@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
* Add a "debug_build" query to crossystem.J. Richard Barnette2013-10-231-1/+2
| | | | | | | | | | | | | | | | | Querying "debug_build" allows the caller to determine whether the image has requested debug, independent of the setting of the dev_mode switch. BUG=chromium:308678 BRANCH=none TEST=use the new command option on both base and dev images Change-Id: I369f26d75156f2e88d9f6f467efbf8f633e78bda Reviewed-on: https://chromium-review.googlesource.com/174107 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Richard Barnette <jrbarnette@chromium.org> Reviewed-by: Will Drewry <wad@chromium.org> Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
* Rename files and defines to simplify makefile.Randall Spangler2013-01-111-0/+292
BUG=chromium-os:26317 BRANCH=none TEST=manual sudo emerge vboot_reference emerge-link vboot_reference chromeos-u-boot chromeos-installer emerge-daisy vboot_reference chromeos-u-boot chromeos-installer Signed-off-by: Randall Spangler <rspangler@chromium.org> Change-Id: I8c55ca40f3f0cacf08530ab63c886fe351bcee8e Reviewed-on: https://gerrit.chromium.org/gerrit/41152