chromiumos/platform/init.git
15 months agoThis adds an upstart job that will upload interesting metrics to UMA 50/65750/6 master
Greg Spencer [Tue, 13 Aug 2013 22:28:00 +0000 (15:28 -0700)]
This adds an upstart job that will upload interesting metrics to UMA
every time that the login screen is made visible.

Currently it only uploads metrics related to the
logout-to-login-visible process, so that we can start collecting data
on this path in order to optimize it.

CQ-DEPEND=CL:65753
BUG=chromium:271068
TEST=On device, logged in, logged out, logged in again, and saw
all histograms on chrome://histograms (after waiting for histograms
to update)

Change-Id: Id8f752c423c1943ed23cb133c239ba8d7acf7be9
Reviewed-on: https://gerrit.chromium.org/gerrit/65750
Tested-by: Greg Spencer <gspencer@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Greg Spencer <gspencer@chromium.org>

16 months agoPreserve CRX Cache init files during factory wipe. 96/65996/6
Don Garrett [Thu, 15 Aug 2013 22:21:11 +0000 (15:21 -0700)]
Preserve CRX Cache init files during factory wipe.

There is a directory of CRX files being added to stateful that we want to
preserve during factory wipe. This directory will be about 20M initially, but
may grow over time.

Add the new directory to the PRESERVED_FILES list.

BUG=chromium:259595
TEST=Manually create files to preserve (including non-matching files).
     echo factory > /mnt/stateful_partition/factory_install_reset
     reboot
     Inspect to verify matching files preserved, non-matching not preserved.

     Repeat without import_extensions directory, to ensure normal operation.

     Repeat for 'safe' with powerwash_count present.

Change-Id: Ic930efb6d1b18d15c1083a2af5151774c645a9c6
Reviewed-on: https://gerrit.chromium.org/gerrit/65996
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>

16 months agodate-proxy-watcher: PAC proxy format to tlsdated 83/65883/2
Will Drewry [Wed, 14 Aug 2013 19:27:06 +0000 (14:27 -0500)]
date-proxy-watcher: PAC proxy format to tlsdated

Translate Chrome's PAC format to tlsdated proxy format:
  DIRECT -> none
  PROXY host:port -> http://host:port
  SOCKS host:port -> socks4://host:port
  SOCKS5 host:port -> socks5://host:port
  HTTPS host:port -> https://host:port

At present, the emitted proxy "host:port" does not match the expected
format in tlsdated.conf and lacks scheme annotation. This breaks tlsdated
proxy use.

BUG=chromium:271644
TEST=merged onto a Aug1 build. Restarted date watcher and updated the proxy in OOBE.  tlsdated was restarted properly with -x http://blah and -x socks://blagh
     tested http with a local squid proxy and I was able to get the correct time.

Change-Id: I50f2317da0e022ac7be82773e0c8bcc9b129f121
Reviewed-on: https://gerrit.chromium.org/gerrit/65883
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Tested-by: Will Drewry <wad@chromium.org>
Commit-Queue: Will Drewry <wad@chromium.org>

16 months ago[+] Platform.DiskUsage.NumUserHomeDirectories 87/65187/2
Alexander Alekseev [Tue, 6 Aug 2013 13:08:09 +0000 (17:08 +0400)]
[+] Platform.DiskUsage.NumUserHomeDirectories

BUG=chromium:263022
TEST=Manually tested

Change-Id: I8e288531dcd00c3668d0a929fb5dbdc99baf4dcc
Reviewed-on: https://gerrit.chromium.org/gerrit/65187
Tested-by: Alexander Alekseev <alemate@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Alexander Alekseev <alemate@chromium.org>

16 months agoRevert "chromeos_startup: change stateful discovery to work for UBI too" 11/65111/3
Stéphane Marchesin [Thu, 8 Aug 2013 03:52:02 +0000 (20:52 -0700)]
Revert "chromeos_startup: change stateful discovery to work for UBI too"

This reverts commit 592a2b79da989aed52cee3661cc7b7c859e7f9d7

I'm reverting because this breaks the chromeos-install on daisy and
spring (install, reboot, it goes to recovery mode).

BUG=chromium:269803

Change-Id: I809993a6dd6d22ee11b5788da9703d38e9e8db9d
Reviewed-on: https://gerrit.chromium.org/gerrit/65111
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>

16 months agoRestore code to create /tmp/firmware-boot-time . 70/64970/5
Alexander Alekseev [Wed, 7 Aug 2013 18:53:10 +0000 (22:53 +0400)]
Restore code to create /tmp/firmware-boot-time .

CL fixes firmware_DevScreenTimeout and platform_BootPerf autotest and
HostWorker class.

BUG=chrome-os-partner:21656, chromium:141757
TEST=Manually tested

Change-Id: I7d66807afc20cf22297b3d7ca9877044ca1e7c42
Reviewed-on: https://gerrit.chromium.org/gerrit/64970
Tested-by: Alexander Alekseev <alemate@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Alexander Alekseev <alemate@chromium.org>

16 months agochromeos_startup: change stateful discovery to work for UBI too 47/63947/12
Liam McLoughlin [Wed, 31 Jul 2013 19:59:23 +0000 (12:59 -0700)]
chromeos_startup: change stateful discovery to work for UBI too

Some of the card readers on ARM devices don't always correctly report
the removable status: crbug.com/197978

Currently all devices that exhibit that behaviour have filesystem
types that are identical for both USB/installed, so this code
should still work.

BUG=chromium:267589
TEST=Boot on both UBI device and normal SSD device

Change-Id: I9bfcdcb6685c2859be32f286353118befee872e9
Reviewed-on: https://gerrit.chromium.org/gerrit/63947
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Liam McLoughlin <lmcloughlin@chromium.org>

16 months agoReport chromium boot UMA stats from init script. 03/63603/6 stabilize-4512.B
Alexander Alekseev [Mon, 29 Jul 2013 15:49:06 +0000 (19:49 +0400)]
Report chromium boot UMA stats from init script.

BUG=chromium:141757
TEST=Manually tested

Change-Id: I81482ad3538d20bb999814889a76df0862328b60
Reviewed-on: https://gerrit.chromium.org/gerrit/63603
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Alexander Alekseev <alemate@chromium.org>
Commit-Queue: Alexander Alekseev <alemate@chromium.org>

16 months agoTry swapon several times to work around races 29/63629/3
Luigi Semenzato [Mon, 29 Jul 2013 21:12:46 +0000 (14:12 -0700)]
Try swapon several times to work around races

For security reasons, swapon for /dev/zram0 fails if other processes
hold the device open.  Instead of trying to resolve the races, we
try swapon multiple times.

Also, change the UMA stat to the actual swap value rather than
the expected value.  This will help detect problems in the future.

BUG=chromium:265568
TEST=verified that race cannot be reproduced

Change-Id: Ie30894169f773647fdc5ee61c6d357f31bc14ae6
Reviewed-on: https://gerrit.chromium.org/gerrit/63629
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Commit-Queue: Sonny Rao <sonnyrao@chromium.org>

16 months agokillers: make term_process a bit more robust 07/63707/3 firmware-pit-4482.B
Daniel Kurtz [Wed, 31 Jul 2013 03:32:11 +0000 (11:32 +0800)]
killers: make term_process a bit more robust

This patch makes the behavior of "term_process()" a bit more robust by:

 * Killing all processes that match the requested regex right away.
   Previously only the oldest would be killed first, and the others would
   be killed later in the for loop.

 * Wait longer for the SIGTERM to take affect.  The only known use of this
   function is to kill the X server in ui.conf post-stop.  On some
   machines with very slow LCD panels, X can take > 1 seconds to
   terminate.  During that time it is stuck in an ioctl, so...

 * Also wait for SIGKILL to complete before exiting.
   If a process was stuck in an ioctl and couldn't SIGTERM quickly, it
   might still be in that same ioctl and can't SIGKILL quickly either.

 * Log some messages if processes die too slowly.
   Process should die when we kill them. But if they don't, it is nice to
   have a record of it.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium:265804
TEST=Revert: https://gerrit.chromium.org/gerrit/57290 from kernel-next
   On link, run a restart ui loop.
   => Xorg should never crash.
   => /var/log/xorg/Xorg.0.log.old should always end in:
  Server terminated successfully (0). Closing log file.

Change-Id: I316d9cf21f9568c6928a6acebc4997b4681fcf6c
Reviewed-on: https://gerrit.chromium.org/gerrit/63707
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
16 months agostartup_utils: create unencrypted var when needed 27/63527/2
Kees Cook [Fri, 26 Jul 2013 23:50:52 +0000 (16:50 -0700)]
startup_utils: create unencrypted var when needed

The /mnt/stateful_partition/var directory should only exist on devices
without encrypted stateful. This moves the creation to the mount helper
instead.

BUG=chromium:261811
TEST=butterfly build, no stateful var after reboot

Change-Id: I75d9b5f250d9a19ac3236589810bf4c8a14b5161
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63527
Reviewed-by: Chris Masone <cmasone@chromium.org>
16 months agoReport some additional metrics on disk usage. 79/63079/7 factory-pit-4471.B
antrim [Tue, 23 Jul 2013 19:13:59 +0000 (23:13 +0400)]
Report some additional metrics on disk usage.

BUG=chromium:247371

TEST=Leave a bit lesser than 1GB free on stateful partition, reboot
device, see that metrics have appeared.

Change-Id: I9cd435e1d793a1d613967ace766be343b803932d
Reviewed-on: https://gerrit.chromium.org/gerrit/63079
Tested-by: Denis Kuznetsov <antrim@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Nikita Kostylev <nkostylev@chromium.org>
Commit-Queue: Denis Kuznetsov <antrim@chromium.org>

16 months agoPreserve cryptohome-managed enrollment data across powerwash. 13/63313/2 factory-4455.B
Chris Sosa [Thu, 25 Jul 2013 02:31:26 +0000 (19:31 -0700)]
Preserve cryptohome-managed enrollment data across powerwash.

If this file exists, this file contains the necessary encyrpted data necessary
to maintain enrollment across a powerwash.

BUG=chromium:241313
TEST=Ran it with the .epb

Change-Id: I68a3e055626c7482695e1b4855a485ad14c53926
Reviewed-on: https://gerrit.chromium.org/gerrit/63313
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>

17 months agoUse 'expect fork' when starting avahi-daemon 92/60792/2 factory-pit-4390.B firmware-falco_peppy-4389.B firmware-leon-4389.26.B firmware-wolf-4389.24.B stabilize-4443.B
David Zeuthen [Tue, 2 Jul 2013 19:19:37 +0000 (12:19 -0700)]
Use 'expect fork' when starting avahi-daemon

We need to wait for avahi-daemon to fork otherwise e.g. 'start avahi'
returns immediately, i.e. before the daemon is ready to serve. This is
a problem for Avahi-using programs - such as p2p-server - that assumes
(and rightly so) that Avahi is running and operational when its
Upstart job has been started. This CL fixes this problem by simply

  1. Requesting avahi-daemon to fork by passing the --daemonize option
  2. Instructing Upstart to wait for avahi-daemon to fork

BUG=None
TEST=Manually tested

Change-Id: I122ec1bb4d7bef77377dd80ced50c0e647a25cbf
Reviewed-on: https://gerrit.chromium.org/gerrit/60792
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
17 months agoPreserve the rollback-version file as part of powerwash. 24/59524/5
Chris Sosa [Fri, 21 Jun 2013 05:11:53 +0000 (22:11 -0700)]
Preserve the rollback-version file as part of powerwash.

Also as part of this CL I am saving and preserving the log of clobber-state.

BUG=chromium:252589
TEST=Ran powerwash after an AU rollback and check file was preserved and
other files were preseved if file was missing.

Change-Id: Ifebc168b41c42347995e0e10c825d2cdc06c9aa0
Reviewed-on: https://gerrit.chromium.org/gerrit/59524
Commit-Queue: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
17 months agoremove unused udhcpc.conf script 16/59816/2
Chris Masone [Mon, 24 Jun 2013 19:37:39 +0000 (12:37 -0700)]
remove unused udhcpc.conf script

We use shill and real dhcp now, so we don't need this
upstart script on embedded builds anymore.

BUG=chromium:243253
TEST=emerge-daisy-drm chromeos-init still works
STATUS=Fixed

Change-Id: Ibe60317f1adefcead052ac6f0d6545e4c187b810
Reviewed-on: https://gerrit.chromium.org/gerrit/59816
Commit-Queue: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
18 months agoRevert "init: Adds field trial for progressive scan in shill." 09/59609/2
Wade Guthrie [Fri, 21 Jun 2013 21:13:35 +0000 (14:13 -0700)]
Revert "init: Adds field trial for progressive scan in shill."

We want to roll this out differently so we'll revert it just now.

This reverts commit 85bd178aa6d2902a0d8a6aaced2b191d2f46a9bb

Change-Id: I6990e768add9d34532cd1f9a5c7bc7e51f97f91b
Reviewed-on: https://gerrit.chromium.org/gerrit/59609
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Wade Guthrie <wdg@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Wade Guthrie <wdg@google.com>
Reviewed-by: Wade Guthrie <wdg@google.com>
Tested-by: Wade Guthrie <wdg@google.com>
18 months agoinit: Divert mist log messages to /var/log/net.log 85/59185/2
Ben Chan [Wed, 19 Jun 2013 05:40:58 +0000 (22:40 -0700)]
init: Divert mist log messages to /var/log/net.log

BUG=chromium:251578
TEST=Verified that all log messages from mist are sent to
/var/log/net.log and only those severer than warnings are sent to
/var/log/messages.

Change-Id: I0933f63b7ced74727a4d598bcb24d8a8d0b00620
Reviewed-on: https://gerrit.chromium.org/gerrit/59185
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>

18 months agoinit: Remove clean-shutdown job. 43/57543/6
Daniel Erat [Mon, 3 Jun 2013 19:21:18 +0000 (12:21 -0700)]
init: Remove clean-shutdown job.

Remove the clean-shutdown upstart job and update the cromo
job to stop "on starting pre-shutdown".

BUG=chromium:246313
TEST=manual: after updating syslog to not get stopped
     prematurely, cromo's clean exit is logged in net.log
CQ-DEPEND=Iaabd3219313cf5d2490141e2abefa74cc5384fc2

Change-Id: Id6949b90111f1aed5196a07566611c7fe58d36f0
Reviewed-on: https://gerrit.chromium.org/gerrit/57543
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>

18 months agoUse seccomp filter policy for 'netfilter-queue-helper'. 86/57986/3 factory-4290.B factory-pit-4280.B factory-spring-4262.B stabilize-4255.B stabilize-4287.B
Jorge Lucangeli Obes [Fri, 7 Jun 2013 21:17:46 +0000 (14:17 -0700)]
Use seccomp filter policy for 'netfilter-queue-helper'.

BUG=chromium:224082
TEST=restart netfilter-queue, use mcancan.c from pstew@.
CQ-DEPEND=I16f92c0cfc23a0735dede2a2eaf779d50a48e362

Change-Id: I0e0fd12d7ba03231ebef31a80775ec9ce2a586dd
Reviewed-on: https://gerrit.chromium.org/gerrit/57986
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Jorge Lucangeli Obes <jorgelo@chromium.org>

18 months agolightup_screen: Use the new 'backlight_tool' to configure backlights. 05/57805/3
Hung-Te Lin [Thu, 6 Jun 2013 18:05:31 +0000 (11:05 -0700)]
lightup_screen: Use the new 'backlight_tool' to configure backlights.

The "backlight_tool" provides a better and unified way to control panel
backlight, and is better than hard-coding /sys/class files.

BUG=chromium:244616
TEST=manually installed on a Lumpy and executed "lightup_screen", seeing
     back light brightened.

Change-Id: Iebcf8e767498dc6674ae7bb4937e7f9da5ccc090
Reviewed-on: https://gerrit.chromium.org/gerrit/57805
Reviewed-by: Rong Chang <rongchang@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
18 months agoinit: Adds field trial for progressive scan in shill. 88/57288/6
repo sync [Wed, 22 May 2013 18:27:30 +0000 (11:27 -0700)]
init: Adds field trial for progressive scan in shill.

BUG=chromium:240456
TEST=manual:
  * on chrome box, rm /home/chronos/.progressive_scan*
  * reboot
  * verify that the file /home/chronos/.progressive_scan_finch exists
    and contains one of: c, x, 1, 2, 3, or 4 (it'll be 'x' 95% of the
    time)

Change-Id: Ib1f683e64692f0e9e5bd7d3bb60625ccd50a79dc
Reviewed-on: https://gerrit.chromium.org/gerrit/57288
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Wade Guthrie <wdg@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
Commit-Queue: Wade Guthrie <wdg@chromium.org>

18 months agochromeos-boot-alert: Fix cached VPD data file path. 97/57197/2
Hung-Te Lin [Fri, 31 May 2013 07:32:20 +0000 (15:32 +0800)]
chromeos-boot-alert: Fix cached VPD data file path.

The cached VPD file path has been changed a while.
chromeos-boot-alert was using live system data (vpd -i) which is slower.
With this patch we can gain 2~5 seconds improvements.

BUG=chromium:244616
TEST=chromeos-boot-alert leave_dev # alert appears without extra delay.

Change-Id: I8273678da7dd2a3949c797a790953471e0a21567
Reviewed-on: https://gerrit.chromium.org/gerrit/57197
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>

18 months agoembedded-init: Remove unused chromeos_startup. 70/56170/3
Darin Petkov [Wed, 22 May 2013 09:43:27 +0000 (11:43 +0200)]
embedded-init: Remove unused chromeos_startup.

The embedded init ebuild installs the regular chromeos_startup now
which is identical to the embedded one.

BUG=chromium:221343
TEST=Build and boot daisy-drm dev image.
CQ-DEPEND=Id08592bfe8abcc06b2539acb401ca8da6229c803

Change-Id: I88fc39bd927c530bec46f996449d5039e1158058
Reviewed-on: https://gerrit.chromium.org/gerrit/56170
Commit-Queue: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
18 months agoinit: Mount /var and /home/chronos through a startup library function. 16/56016/4
Darin Petkov [Tue, 21 May 2013 12:21:34 +0000 (14:21 +0200)]
init: Mount /var and /home/chronos through a startup library function.

For regular Chrome OS, the function invokes mount-encrypted. For embedded, the
function simply bind-mounts the directories. This CL makes the relevant code
paths in regular and embedded chromeos_startup identical.

BUG=chromium:220499
TEST=build and boot lumpy and check that /var and /home/chronos are mounted from
encrypted stateful; build and boot daisy-drm and check that /var and
/home/chronos are simply bind-mounted on stateful.
CQ-DEPEND=I503a39a6b9906efbf8844a405d56d4a25ee2b560

Change-Id: If30101009086b37a47115a3b95b5ac9e8efaeed5
Reviewed-on: https://gerrit.chromium.org/gerrit/56016
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>

18 months agoembedded-init: Delete unused chromeos_shutdown. 80/56180/2
Darin Petkov [Wed, 22 May 2013 10:55:04 +0000 (12:55 +0200)]
embedded-init: Delete unused chromeos_shutdown.

BUG=chromium:241757
TEST=See dependent CL.
CQ-DEPEND=I304db211617c3ae1e4abfef1fe65a64c6a8c1e61

Change-Id: I7c189f90c681877e00e5da7016f81ba825b8f8af
Reviewed-on: https://gerrit.chromium.org/gerrit/56180
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>

19 months agoinit: Increase ambient-light-related logging for powerd. 67/56267/2
Daniel Erat [Wed, 22 May 2013 17:31:49 +0000 (10:31 -0700)]
init: Increase ambient-light-related logging for powerd.

BUG=chromium:242275
TEST=manual: AmbientLightHandler messages appear in log

Change-Id: I7f42c23c34763978d3ae8d78aa64e97be09ee184
Reviewed-on: https://gerrit.chromium.org/gerrit/56267
Commit-Queue: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
19 months agoinit: Use mount_or_fail in embedded startup just like regular. 65/51465/4
Darin Petkov [Thu, 16 May 2013 13:26:20 +0000 (15:26 +0200)]
init: Use mount_or_fail in embedded startup just like regular.

BUG=chromium:221343
TEST=built and booted daisy-drm, checked mounts

Change-Id: I0f7f334d223b70c370bc001bbeb1b7131d83aa66
Reviewed-on: https://gerrit.chromium.org/gerrit/51465
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>

19 months agoinit: Copy dev-mode switch code from regular chromeos_startup to embedded. 20/56020/2
Darin Petkov [Tue, 21 May 2013 13:17:43 +0000 (15:17 +0200)]
init: Copy dev-mode switch code from regular chromeos_startup to embedded.

The code is copied as is.

BUG=chromium:242488
TEST=Built a dev daisy-drm image, booted in dev mode with no
issues. Built a base daisy-drm image, booted in dev mode, saw stateful
being wiped (with a console message about missing pv) followed up by a
reboot -- on reboot, /mnt/stateful_partition/.developer_mode exists.

Change-Id: I9db620a6d388ee959e9f5900fe7fb5b80a9de733
Reviewed-on: https://gerrit.chromium.org/gerrit/56020
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>

19 months agoMove ui-related upstart jobs to login_manager repo 48/55848/2
Chris Masone [Mon, 20 May 2013 19:35:23 +0000 (12:35 -0700)]
Move ui-related upstart jobs to login_manager repo

These should live next to the code they manage.  This facilitates
extracting a whole system daemon from a build using USE flags.

CQ-DEPEND=I34c627aed6d9b3d2ec28185f73a65ce88b0991c2
CQ-DEPEND=I1660adc31123cbd4eacdfc08dda07fbb959ad0b4

BUG=chromium:242234
TEST=building this package should not install these files.

Change-Id: I76f78eca0546304017640a7205109484efca2125
Reviewed-on: https://gerrit.chromium.org/gerrit/55848
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
19 months agoMove shill-specific functionality to separate upstart jobs 09/55809/3
Chris Masone [Mon, 20 May 2013 19:31:42 +0000 (12:31 -0700)]
Move shill-specific functionality to separate upstart jobs

It's more correct to have shill-related functionality that happens at
the start and end of user sessions live in dedicated upstart jobs.
This will also allow us to move login.conf and logout.conf into
the login_manager repo, where they can be included (or not) with the
software whose lifetime they manage.

BUG=chromium:242234
TEST=sign in, run '/usr/local/lib/flimflam/test/profiles list' to see that the default and user profiles are pushed; then, sign out and run the same to confirm that only the default is left.

Change-Id: I2b501d74a263b95139cc169949510e983ba43752
Reviewed-on: https://gerrit.chromium.org/gerrit/55809
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Chris Masone <cmasone@chromium.org>

19 months agoinit: Run the OOBE code as part of embedded chromeos_startup. 57/51457/3
Darin Petkov [Thu, 16 May 2013 12:45:53 +0000 (14:45 +0200)]
init: Run the OOBE code as part of embedded chromeos_startup.

The code is identical to the one in regular startup. The slow down on
daisy-drm due to running dump_vpd_log seems to be less than 0.5
seconds.

BUG=chromium:241382
TEST=built and booted daisy-drm

Change-Id: Id6709147b9748eab10faf01355984558c927c7b4
Reviewed-on: https://gerrit.chromium.org/gerrit/51457
Commit-Queue: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
19 months agoinit: Copy previously removed code from regular startup back into embedded. 41/51441/2
Darin Petkov [Thu, 16 May 2013 09:03:33 +0000 (11:03 +0200)]
init: Copy previously removed code from regular startup back into embedded.

This is a step towards eliminating the differences between regular and
embedded startup so that they can be unified. The code is copied from
init/chromeos_startup without any modifications.

BUG=chromium:221343
TEST=booted daisy-drm image, ensured chromeos_startup runs to
completion by checking for bootstat's post-startup stamp.

Change-Id: I5452182d41b50c951728fb89001c7ab73c3f77f2
Reviewed-on: https://gerrit.chromium.org/gerrit/51441
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>

19 months agoinit: Mount debugfs with debugfs-access as group. 45/51445/3
Darin Petkov [Thu, 16 May 2013 11:06:58 +0000 (13:06 +0200)]
init: Mount debugfs with debugfs-access as group.

This was changed recently in the regular chromeos_startup (CL:45554),
so propagate the change in embedded.

BUG=chromium:221343
TEST=built and booted daisy-drm, checked that debugfs is mounted
correctly.

Change-Id: I836739a2583d4ed39c480c91a7e04bf1dcfaab60
Reviewed-on: https://gerrit.chromium.org/gerrit/51445
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>

19 months agoinit: Run ureadahead as an upstart job. 19/51119/3
Darin Petkov [Tue, 14 May 2013 12:15:46 +0000 (14:15 +0200)]
init: Run ureadahead as an upstart job.

ureadahead is controlled by a separate upstart job now
(ureadahead.conf). Certain build targets (e.g., embedded) may choose
to not install the job to prevent ureadahead from running.

ureadahead.conf is added to chromeos-init rather than
ureadahead.ebuild (despite the comment in init/README) because it
depends on the "startup" job which is considered an internal
chromeos-init dependency.

Since only ureadahead and 'cros_installer postinst' (the latter
removes the old ureadahead pack files) need access to
/var/lib/ureadahead, changed its permissions from 0755 to 0700. Note
that the pack files are root-only accessible already anyway.

bootperf on lumpy, 10 cycles:

Before:

 time  s%     dt  s%  event
 1502  1%  +1502  1%  startup
 1873  2%   +371  7%  startup_done
 2693  2%   +820  4%  x_started
 2749  2%    +56 21%  chrome_exec
 3178  2%   +429 15%  chrome_main
 5006  1%  +1828  1%  login
 6971  1%  +1965  2%  network

After:

 time  s%     dt  s%  event
 1526  2%  +1526  2%  startup
 1920  3%   +394 13%  startup_done
 2734  2%   +814  5%  x_started
 2795  2%    +61 20%  chrome_exec
 3191  3%   +396 15%  chrome_main
 5020  2%  +1829  3%  login
 7622 20%  +2602 57%  network

BUG=chromium:240660
TEST=Tested manually on lumpy, looked at boot times before and after,
deleted /var/lib/ureadahead and checked that pack files were
regenerated on reboot. Built and booted daisy-drm image, checked that
/var/lib/ureadahead and /etc/init/ureadahead are not present.

Change-Id: I44abf395bf41ec25b697c1f373e633e18bc7891b
Reviewed-on: https://gerrit.chromium.org/gerrit/51119
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>

19 months agoinit: Initialize kernel sysctl in chromeos_startup. 14/51114/3
Darin Petkov [Tue, 14 May 2013 10:30:51 +0000 (12:30 +0200)]
init: Initialize kernel sysctl in chromeos_startup.

This CL along with its dependent CL makes the following changes:

- Invoke 'sysctl -p' as part of chromeos_startup -- both regular and
  embedded. This guarantees that the new kernel settings will apply to
  all boot processes.

- Remove procps.conf from regular targets. This init script is not
  installed on embedded targets (but probably should have been).

- Remove explicit setting of /proc/sys/fs/suid_dumpable to 2 from
  chromeos_startup. This setting is now enforced by /etc/sysctl.conf
  which is installed by chromeos-base.ebuild (see dependent CL).

bootperf on lumpy, 10 cycles:

Before:

 time  s%     dt  s%  event
 1537  2%  +1537  2%  startup
 1910  2%   +373  6%  startup_done
 2746  2%   +836  4%  x_started
 2802  2%    +56 12%  chrome_exec
 3173  2%   +371  7%  chrome_main
 5040  1%  +1867  2%  login
 7041  1%  +2001  2%  network

After:

 time  s%     dt  s%  event
 1528  3%  +1528  3%  startup
 1935  6%   +407 19%  startup_done
 2765  7%   +830 10%  x_started
 2826  6%    +61 35%  chrome_exec
 3272  4%   +446 13%  chrome_main
 5127  3%  +1855  1%  login
 7112  5%  +1985 11%  network

BUG=chromium:240646
TEST=Tested manually on lumpy, cat /proc/sys/fs/suid_dumpable shows 2,
kill -SEGV dbus-daemon generates a crash dump. Built and booted
successfully a daisy-drm image, inspected /proc/sys/fs/suid_dumpable.

CQ-DEPEND=I753cd1e49860564e31984730b7b1be6f5df62b09

Change-Id: Ia2024cd0cfbe1e4b51b42225c3a22e1660067bc4
Reviewed-on: https://gerrit.chromium.org/gerrit/51114
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>

19 months agoFix cron-lite to run jobs when requested, not every 5 minutes. 75/51175/4
J. Richard Barnette [Tue, 14 May 2013 20:57:57 +0000 (13:57 -0700)]
Fix cron-lite to run jobs when requested, not every 5 minutes.

BUG=chromium:240851
TEST=boot, wait to see that the unit didn't rotate logs every 5 minutes

Change-Id: Ic12ecd875b973edac823e64961834e1cd56fdaa7
Reviewed-on: https://gerrit.chromium.org/gerrit/51175
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
19 months agocron-lite: fix bashism redirection 63/50863/2 factory-4128.B factory-spring-4131.B
Mike Frysinger [Fri, 10 May 2013 19:14:02 +0000 (15:14 -0400)]
cron-lite: fix bashism redirection

The "&>" operator is a bashism and doesn't work in dash.  Use the
portable form to silence stderr & stdout.

BUG=None
TEST=trybots

Change-Id: Id77fc3f65d2280bd4b3f83067a0f16295c9c6221
Reviewed-on: https://gerrit.chromium.org/gerrit/50863
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
19 months agoavahi: prepend iptables rules instead of appending them 05/50705/2
David Zeuthen [Thu, 9 May 2013 21:32:58 +0000 (14:32 -0700)]
avahi: prepend iptables rules instead of appending them

... otherwise traffic is going to NFQUEUE because of this rule

  # Send incoming UDP traffic (which has not passed any other rules) to the
  # user-space filter to test whether it was a reply to outgoing DIAL protocol
  # traffic.
  iptables -A INPUT -p udp -j NFQUEUE --queue-num ${NETFILTER_INPUT_NFQUEUE}

recently added to /etc/init/iptables.conf.

BUG=None
TEST=Verified that incoming UDP packets for port 5353 are passed to avahi-daemon

Change-Id: Icd1c9db3b659d6f17a1f095df1d97ac3e1d1420f
Reviewed-on: https://gerrit.chromium.org/gerrit/50705
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
19 months agodrop +x bits on upstart init scripts 05/50405/2
Mike Frysinger [Sat, 26 Jan 2013 05:21:53 +0000 (00:21 -0500)]
drop +x bits on upstart init scripts

These files do not need to be +x to work.  The
emerge process installs them with 644 perms too.

BUG=None
TEST=None

Change-Id: Ie6a454e76d572870f02cd25b60ee6e8e01722f2f
Reviewed-on: https://gerrit.chromium.org/gerrit/50405
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
19 months agoStart the warning collector daemon. 14/49514/3
Luigi Semenzato [Tue, 30 Apr 2013 20:43:08 +0000 (13:43 -0700)]
Start the warning collector daemon.

BUG=chromium:227080
TEST=manually tested
CQ-DEPEND=I6a4010acad0ffe20c702bb0fc455e3da7cdf3ac1
Change-Id: Iffdd7adec5ac8176f95162681bc1485773482a8e
Reviewed-on: https://gerrit.chromium.org/gerrit/49514
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>

19 months agoAdd Upstart file for avahi 85/49685/6 release-R28-4100.B stabilize-4100.38.B toolchainB
David Zeuthen [Tue, 30 Apr 2013 23:42:25 +0000 (16:42 -0700)]
Add Upstart file for avahi

Note that this job is not started automatically on boot. Programs
using Avahi are expected to explicitly arrange for this to happen via
e.g. "start avahi".

BUG=chromium:234371
TEST=Checked that Avahi isn't started on boot and "start avahi" starts it

Change-Id: Ib699a7c59088939147cae31947ce287d72d20ff5
Reviewed-on: https://gerrit.chromium.org/gerrit/49685
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
Reviewed-by: David Zeuthen <zeuthen@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
19 months agoinit: Diverting WiMAX manager log messages to /var/log/net.log 06/49706/2
Ben Chan [Wed, 1 May 2013 03:11:49 +0000 (20:11 -0700)]
init: Diverting WiMAX manager log messages to /var/log/net.log

BUG=chromium:237077
TEST=Verified that all log messages from wimax-manager are sent to
/var/log/net.log and only those severer than warnings are sent to
/var/log/messages.

Change-Id: Ie1c762fa29b1bbab642ad63257e8e8675d23a96e
Reviewed-on: https://gerrit.chromium.org/gerrit/49706
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
19 months agoinit: Update for power_supply_info and backlight_tool. 63/49663/2
Daniel Erat [Tue, 30 Apr 2013 18:36:52 +0000 (11:36 -0700)]
init: Update for power_supply_info and backlight_tool.

This updates references to power_supply_info and
backlight_tool; the binaries previously had hyphens in their
names rather than underscores.

BUG=chromium:236858
TEST=built an image and checked that backlight level is set
     correctly before boot splash screen is shown

Change-Id: I9c2a5722dd8fa740fca22b27d8c87ee3821aead8
Reviewed-on: https://gerrit.chromium.org/gerrit/49663
Commit-Queue: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
19 months agoshill: Remove "--push" argument 04/48604/3 stabilize-4068.0.B
Paul Stewart [Fri, 19 Apr 2013 01:25:41 +0000 (18:25 -0700)]
shill: Remove "--push" argument

shill no longer requires the "--push" argument to be passed to it.
Remove the init script code to generate it.

CQ-DEPEND=CL:48605
BUG=chromium:231858
TEST=Manual: Restart shill while logged in and ensure shill still
has the user profile loaded.  Modified version of network_ShillInitScripts

Change-Id: I0a61c3ad2c756c5c4f0365b57760d3936bdc1d70
Reviewed-on: https://gerrit.chromium.org/gerrit/48604
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>

20 months agoinit: shill.conf: load cfg80211 in pre-start 29/47829/6 stabilize-4008.0.B stabilize-4035.0.B
mukesh agrawal [Tue, 9 Apr 2013 22:31:06 +0000 (15:31 -0700)]
init: shill.conf: load cfg80211 in pre-start

As of CL:44770, shill will attempt to resolve the netlink message type for
"nl80211" in Daemon::Start. If that can't be resolved, shill will abort.

The "nl80211" message type is registered by cfg80211. So load cfg80211 in the
pre-start stanza of shill.conf. Note that after first boot, cfg80211 will
usually be loaded earlier, via preload-network.conf.

BUG=chromium:221118
TEST=manual

Manual testing
--------------
1. boot system
2. mount / -oremount,rw
3. edit /etc/init/shill.conf, adding
     lsmod > /home/root/lsmod-post-modprobe
   after
     modprobe cfg80211
4. rm /var/log/messages
5. rm /var/lib/preload-network-drivers
6. reboot
7. grep cfg80211 /home/root/lsmod-post-modprobe
   -> should match
8. grep "Received crash notification for shill" /var/log/messages
   -> should NOT match
9. reboot
10. grep cfg80211 /home/root/lsmod-post-modprobe
    -> should match
11. grep "Received crash notification for shill" /var/log/messages
    -> should NOT match
12. mount / -oremount,rw
13. mv /lib/modules/3.4.0/kernel/net/wireless/cfg80211.ko \
       /lib/modules/3.4.0/kernel/net/wireless/cfg80211-disabled.ko
14. reboot
15. grep cfg80211 /home/root/lsmod-post-modprobe
    -> should NOT match
16. grep "Received crash notification for shill" /var/log/messages
    -> should match
17. grep "Failed to load cfg80211" /var/log/messages
    -> should match

Change-Id: I9219cd8ce3613c2a1ddd89ca0379a44fdd1d253e
Reviewed-on: https://gerrit.chromium.org/gerrit/47829
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
20 months agoAllow wpa_supplicant debug verbosity args 00/47800/5
Jason Abele [Wed, 10 Apr 2013 23:04:20 +0000 (16:04 -0700)]
Allow wpa_supplicant debug verbosity args

If extra verbose logging is enabled temporarily, and wpa_supplicant
crashes, the extra verbosity will be lost.  This change allows extra
verbose logging to be maintained across wpa_supplicant crashes via
environment args to upstart.

TEST=stop wpasupplicant; start wpasupplicant WPA_DEBUG="excessive";
wpa_debug; pkill -f wpa; wpa_debug
BUG=None
Change-Id: I2dd63ac06d04524174dbcf4294a2adddd66da72b
Signed-off-by: Jason Abele <jabele@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47800
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
20 months agoEnable zram by default. 02/46402/15
Luigi Semenzato [Mon, 25 Mar 2013 15:34:43 +0000 (08:34 -0700)]
Enable zram by default.

This change enables zram by default for all platforms.
It still allows manual control of zram from crosh.

Before this change, zram was not enabled if the file
/home/chronos/.swap_enabled was missing.  Now it is
enabled with default swap size if the file is missing
or empty.  It is disabled if the file indicates a
size of "0".  Otherwise the content of the file
specifies the size.

The default swap size is 1.5 x RAM size, but it
can be overridden by /etc/default/zram_size.sh.

Before this change goes in, we also need to either end
the zram field trial, or change it to behave correctly
with the new defaults.

BUG=chromium:218338
TEST=manually tested

Change-Id: If6a208e317864fb25e1e6181f57910d6b8e2593e
Reviewed-on: https://gerrit.chromium.org/gerrit/46402
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
20 months agoEnd zram field trial. 04/46404/5
Luigi Semenzato [Mon, 25 Mar 2013 16:25:48 +0000 (09:25 -0700)]
End zram field trial.

This ends the zram field trial and cleans up if needed.

BUG=chromium:218559
TEST=manually tested

Change-Id: I7a02cd580b63869b49a543f497f777ba738c13d0
Reviewed-on: https://gerrit.chromium.org/gerrit/46404
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
20 months agoinit : powerd.conf - Fix permissions for /proc/acpi/wakeup 65/46665/2
Benson Leung [Wed, 27 Mar 2013 20:04:30 +0000 (13:04 -0700)]
init : powerd.conf - Fix permissions for /proc/acpi/wakeup

This is used by touch-control to disable acpi wake for touch devices.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium:224396
TEST=Test on Pixel from a remote SSH session...
1. watch -n 0.1 cat /proc/acpi/wakeup
2. Close and open the lid while in guest mode.

Check that when the system suspends, this is the state of the wakeups:
TPAD      S3    *disabled  pnp:00:00
TSCR      S3    *disabled  pnp:00:01

Change-Id: If375d48063569dc8fa928e417773e75c8434c1ed
Reviewed-on: https://gerrit.chromium.org/gerrit/46665
Reviewed-by: Daniel Erat <derat@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
20 months agoinit: shill: Determine push argument from profile dirs 59/46359/4
Paul Stewart [Sat, 23 Mar 2013 17:23:37 +0000 (10:23 -0700)]
init: shill: Determine push argument from profile dirs

Determine the arguments to the "--push" flag by enumerating
the user profile directory instead of using a hard-coded
"~chronos/shill".  This will allow pushing multiple user
profiles.

CQ-DEPEND=CL:46358
BUG=chromium:223106
TEST=Run network_ShillInitScripts autotest + Manual, restart
shill wihle logged in an noting (a) the --push argument is
passed to shill, and "list-profiles" lists the user profile
as loaded.   While logged in and shill is running, cd into
/var/run/shill/user_profiles.  Add a couple of profiles using
commands of the form "ln -s $(readlink chronos) user001".
After "restart shill", note that shill is running with a
"--push" argument that lists all the added profiles.  Confirm
using "list-profiles" that each of these profiles were
successfully loaded into shill.

Change-Id: I913f052ee6ba85a1a05c3db2c416c8205d8792a2
Reviewed-on: https://gerrit.chromium.org/gerrit/46359
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
20 months ago[init] mount debugfs with logs-access as group 54/45554/5
Elly Fong-Jones [Fri, 15 Mar 2013 13:56:22 +0000 (09:56 -0400)]
[init] mount debugfs with logs-access as group

CQ-DEPEND=I3c74ca9e33d4c14d74ad091e8250572d0c72557d
BUG=chromium-os:35122
TEST=adhoc
build, boot, ls -ald /sys/kernel/debug

Change-Id: I8f362ab9e6c2c39e597577abcc73c0c8f699b6e3
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45554

21 months agoinit: Add verbose logging for powerd backlight code. 65/45865/3
Daniel Erat [Tue, 26 Feb 2013 20:53:44 +0000 (12:53 -0800)]
init: Add verbose logging for powerd backlight code.

BUG=chromium-os:38922
TEST=manual: looked at logs
TBR=rharrison@chromium.org

Change-Id: Ib8ccd9d94ae2c45aea03b1dc1da654051bfb2f42
Reviewed-on: https://gerrit.chromium.org/gerrit/45865
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>

21 months agoinit: fix typo in preload-network script 39/45939/2
mukesh agrawal [Tue, 19 Mar 2013 22:39:59 +0000 (15:39 -0700)]
init: fix typo in preload-network script

The previous version used inconsistent names for the variable
that tracked the module. This meant that the module name would
never be written to the cache file.

Note that I considered using shell features that cause errors
when using an uninitialized variable (i.e. ${foo:?ERROR}), but
I don't think that would accomplish much. (The code is run
from init, so no one would notice the error message anyway.)

BUG=chromium:221075
TEST=manual (see below)

Manual testing
--------------
 1. use a link, in dev mode
 2. rm /var/lib/preload-network-drivers
 3. reboot
 4. wait for login prompt
 5. connect to wifi
 6. cat /var/lib/preload-network-drivers
    -> this should say "ath9k_btcoex"
 7. reboot
 8. wait for login prompt
 9. connect to wifi
10. grep "phy0: ASPM" /var/log/messages | tail -2
    -> observe that the last line has a kernel timestamp
       approximately 2 seconds early than the first line.
       e.g.
       <syslog header> [    6.729392] ath: phy0: ASPM ...
       <syslog header> [    4.723810] ath: phy0: ASPM ...

Change-Id: Ic2e99ec275aca3fb57b8933938e7d86ee8c7a0be
Reviewed-on: https://gerrit.chromium.org/gerrit/45939
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
21 months agoCreate chrome_renderers cgroups. 43/45443/3 stabilize-3881.0.B
Andrew Bresticker [Thu, 14 Mar 2013 17:47:46 +0000 (10:47 -0700)]
Create chrome_renderers cgroups.

After https://gerrit.chromium.org/gerrit/42025 cgroup mounting was
moved to cgroups.conf, but then nothing was actually creating the
chrome_renderers cgroups.  If these do not exist when Chrome starts,
it will assume that cgroups are disabled and there will be no
throttling of background tabs.

BUG=chromium:190796
TEST=Open multiple tabs, verify that chrome_renderers/foreground/tasks
and chrome_renderers/background/tasks are non-empty.

Change-Id: I62de5875f31bdc3e3918790a7c1017f8b0524976
Reviewed-on: https://gerrit.chromium.org/gerrit/45443
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Queue: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
21 months agodbus: regenerate machine-id on every boot 67/45167/4 factory-spring-3842.B
David Zeuthen [Tue, 12 Mar 2013 01:43:29 +0000 (18:43 -0700)]
dbus: regenerate machine-id on every boot

BUG=chromium-os:39749
TEST=Manually verified

Change-Id: I980db84dae69edae330044cb42eae6ebffea4235
Signed-off-by: David Zeuthen <zeuthen@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45167
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
21 months agoAdd embedded upstart job to emit login-prompt-visible 47/45347/3
Chris Masone [Wed, 13 Mar 2013 21:43:24 +0000 (14:43 -0700)]
Add embedded upstart job to emit login-prompt-visible

The login-prompt-visible upstart signal is normally emitted by the
browser when it's got the sign-in UI up on the screen.  Embedded
devices don't have the browser or, at least so far, the standard
sign-in UI.  Therefore, we need to emit this when the terminal is
ready to go instead.

BUG=chromium:189662
TEST=build_packages --board daisy-drm, check for /build/daisy-drm/etc/init/login-prompt-visible.conf

Change-Id: Iaa4ef079e33848445b0b4d8de7b13509fc07bdd1
Reviewed-on: https://gerrit.chromium.org/gerrit/45347
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Chris Masone <cmasone@chromium.org>

21 months agoMake power the owner of dark resume sysfs files 73/43873/3 firmware-spring-3833.B
Derek Basehore [Sat, 23 Feb 2013 00:30:09 +0000 (16:30 -0800)]
Make power the owner of dark resume sysfs files

Powerd needs to modify dark_resume_active and dark_resume_source files. To allow
powerd to do thise without any help from setuid, make these files owned by the
power group.

BUG=chromium-os:39284
TEST=Suspend system

Change-Id: I03e3fed29b157855310718508178c40303ab4ce0
Reviewed-on: https://gerrit.chromium.org/gerrit/43873
Reviewed-by: Daniel Erat <derat@chromium.org>
Commit-Queue: Derek Basehore <dbasehore@chromium.org>
Tested-by: Derek Basehore <dbasehore@chromium.org>
21 months agoembedded/udhcpc: fix dns not working 29/45029/2
Mandeep Singh Baines [Sun, 10 Mar 2013 00:51:39 +0000 (16:51 -0800)]
embedded/udhcpc: fix dns not working

We need to touch /var/run/resolv.conf or the realpath check
in the udcpc script will fail.

BUG=chromium-os:39223
TEST=ping www.google.com

Change-Id: I03a2b134a5dc66fee1ee7ca3a2bedda37ddc4be5
Reviewed-on: https://gerrit.chromium.org/gerrit/45029
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mandeep Singh Baines <msb@chromium.org>
Tested-by: Mandeep Singh Baines <msb@chromium.org>
21 months agoRe-generate /tmp/machine-info on ui restart. 90/44090/4
Mattias Nissler [Fri, 22 Feb 2013 17:59:19 +0000 (18:59 +0100)]
Re-generate /tmp/machine-info on ui restart.

This is needed when the device doesn't have an owner yet, but the user
has started a guest session. After logging out, the device may still go
through enterprise enrollment, and that requires the serial number to be
available in /tmp/machine-info.

Bootperf on a Lumpy:

Before:

(on 50 cycles):
 time  s%     dt  s%  event
 1529  4%  +1529  4%  startup
 1955  5%   +426 21%  startup_done
 2849  4%   +894  8%  x_started
 2906  4%    +57 37%  chrome_exec
 3803  6%   +897 22%  chrome_main
 5435  3%  +1632  9%  login
 5867  2%   +432 36%  network

After:

(on 42 cycles):
 time  s%     dt  s%  event
 1459  2%  +1459  2%  startup
 1905  7%   +446 28%  startup_done
 2874  7%   +969 14%  x_started
 2927  7%    +53  8%  chrome_exec
 3719  4%   +792 24%  chrome_main
 5356  3%  +1637  9%  login
 5888  2%   +532 24%  network

BUG=chromium-os:26681
TEST=Enterprise-enrollment works after entering a guest session and coming back to the login screen.

Change-Id: Icb9af7a58e9fc09afbb01f424ad4930b839ae935
Reviewed-on: https://gerrit.chromium.org/gerrit/44090
Commit-Queue: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Mattias Nissler <mnissler@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
21 months ago[syslog] pre-create /var/log/tlsdate.log 47/44947/2 firmware-spring-3824.4.B firmware-spring-3824.55.B firmware-spring-3824.84.B firmware-spring-3824.B
Elly Fong-Jones [Fri, 8 Mar 2013 19:31:00 +0000 (14:31 -0500)]
[syslog] pre-create /var/log/tlsdate.log

BUG=chromium-os:39247
TEST=adhoc
stop syslog, merge this change, rm /var/log/tlsdate.log, start syslog
see that /var/log/tlsdate.log is now owned by syslog

Change-Id: I03108a56041a475378d00ec8e697a3eb6720ff18
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44947
Reviewed-by: Will Drewry <wad@chromium.org>
21 months agoAutotest: Stumpy autoreboot comments. 37/44537/3
Simran Basi [Mon, 4 Mar 2013 19:10:02 +0000 (11:10 -0800)]
Autotest: Stumpy autoreboot comments.

Added comments regarding the re-calling of autoreboot on the first
boot as a try job is ran.

BUG=chromium-os:39381
TEST=None

Change-Id: Id352bfd31c5993d9c72ac0ba0c63d47b74cc828f
Reviewed-on: https://gerrit.chromium.org/gerrit/44537
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
21 months agoRe-add stateful usage metric that was removed. 38/44738/3
Chris Sosa [Wed, 6 Mar 2013 19:21:38 +0000 (11:21 -0800)]
Re-add stateful usage metric that was removed.

This is a near copy of the original code which was unintentially
removed in https://codereview.chromium.org/6575030/diff/1/chromeos-cleanup-disk.

BUG=chromium-os:39467
TEST=Tested locally with dash and stateful set to another var. Testing on device.

Change-Id: I5bc6396dc568564dbbbf409bb474a7e5b2b5ea17
Reviewed-on: https://gerrit.chromium.org/gerrit/44738
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>

21 months agoinit: update preload-network script for ath9k_btcoex 89/43989/3
mukesh agrawal [Tue, 26 Feb 2013 00:06:39 +0000 (16:06 -0800)]
init: update preload-network script for ath9k_btcoex

Previously, the logic for finding the module for a network
device assumed that the driver output by ethtool had the
same name as the module that provided it.

While this is normally the case, it is not true for ath9k_btcoex.
In that case, the driver name is "ath9k", but the module name
is "ath9k_btcoex".

Update the logic to use the /sys entry for the network device,
which provides the name of the module.

BUG=chromium-os:38958
TEST=manual (see below)

Manual testing
--------------
 1. use a link, in dev mode
 2. rm /var/lib/preload-network-drivers
 3. reboot
 4. wait for login prompt
 5. connect to wifi
 6. cat /var/lib/preload-network-drivers
    -> this should say "ath9k_btcoex"
 7. reboot
 8. wait for login prompt
 9. connect to wifi
10. grep "phy0: ASPM" /var/log/messages | tail -2
    -> observe that the last line has a kernel timestamp
       approximately 2 seconds early than the first line.
       e.g.
       <syslog header> [    6.729392] ath: phy0: ASPM ...
       <syslog header> [    4.723810] ath: phy0: ASPM ...

Change-Id: Ieeb86475ec24b12122cd1dbe7dcb3ec7e8d34614
Reviewed-on: https://gerrit.chromium.org/gerrit/43989
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
21 months ago[init] override tlsdated proxy as needed 06/44406/3
Elly Fong-Jones [Fri, 1 Mar 2013 19:34:06 +0000 (14:34 -0500)]
[init] override tlsdated proxy as needed

BUG=chromium-os:38801
TEST=adhoc
$ stop tlsdated
$ start tlsdated
Check /var/log/tlsdate.log for a successful connect
$ stop tlsdated
$ echo 'socks5://bad.host:12345' > /var/run/proxy
$ start tlsdated
Check /var/log/tlsdate.log for an unsuccessful connect

Change-Id: Ic01498e8d6cb18400cd4a20a00e5f3d528c460af
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44406
Reviewed-by: Will Drewry <wad@chromium.org>
21 months agocgroups: add a directory for managing the freezer hierarchy 54/44254/2
Mandeep Singh Baines [Thu, 28 Feb 2013 00:14:48 +0000 (16:14 -0800)]
cgroups: add a directory for managing the freezer hierarchy

We will be using freezer to quiesce the system on display off.

BUG=chromium-os:39330
TEST=Started top via ctrl-alt-t, froze it and thawed it.

localhost ~ # cd /sys/fs/cgroup/
localhost cgroup # ls
cpu  freezer
localhost freezer # mkdir mygroup
localhost freezer # cd mygroup/
localhost mygroup # ps -ef | grep top
chronos   3301  3206  1 16:10 pts/1    00:00:00 top -s
root      3331  2441  0 16:10 pts/0    00:00:00 grep --colour=auto top
localhost mygroup # echo 3301 > tasks
localhost mygroup # echo FROZEN > freezer.state
localhost mygroup # echo THAWED > freezer.state

Change-Id: Ia86cf0ab1a94112cea5898e7e58d72120f7d89cd
Reviewed-on: https://gerrit.chromium.org/gerrit/44254
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Tested-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Commit-Queue: Mandeep Singh Baines <msb@chromium.org>

21 months agoinit: Start multicast netfilter queue 89/43789/6
Paul Stewart [Fri, 15 Feb 2013 22:24:07 +0000 (14:24 -0800)]
init: Start multicast netfilter queue

Start a service to allow incoming multicast replies to be accepted
for specific outgoing network traffic.

(Originally by pstew@chromium.org)

CQ-DEPEND=CL:43455,CL:44283
BUG=chromium-os:38605
TEST=Reboot; ensure "iptables --list" shows appropriate NFQUEUE endpoints.
Ensure "netfilter-queue-helper" task is running under minijail.

Change-Id: I21ba79fe1685a33d55b5023b059ef65516f43272
Reviewed-on: https://gerrit.chromium.org/gerrit/43789
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Queue: Jorge Lucangeli Obes <jorgelo@chromium.org>

21 months agoembedded/udhcpc: add dhcp support 43/44143/7
Mandeep Singh Baines [Wed, 27 Feb 2013 00:28:59 +0000 (16:28 -0800)]
embedded/udhcpc: add dhcp support

To enable automated testing and remote development, we're
adding udhcpc support until shill is ready.

BUG=chromium-os:39223
TEST=I can now reboot and re-connect without physical access.

Change-Id: I47806aed08debaf503a0d908a11c0f3bca9acbd5
Reviewed-on: https://gerrit.chromium.org/gerrit/44143
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mandeep Singh Baines <msb@chromium.org>
Tested-by: Mandeep Singh Baines <msb@chromium.org>
21 months ago[init] add tlsdate logging 45/44045/3
Elly Fong-Jones [Tue, 26 Feb 2013 15:50:04 +0000 (10:50 -0500)]
[init] add tlsdate logging

Logging from tlsdate now goes to a separate log file called
/var/log/tlsdate.log instead of into the ether.

CQ-DEPEND=Id762beeaa614372ef9ceba0e62522b4b02d151a4
BUG=chromium-os:39247
TEST=adhoc
restart tlsdated; you should see a bunch of tlsdate output in
/var/log/tlsdate.log
To test log rotation, run:
for x in `seq 1 256`; do logger -t tlsdate looooooooooooooooooooooooooooog; done
a few times; you should see a message in /var/log/messages about rotating logs,
and a file called /var/log/tlsdate.log.1 containing older logs.

Change-Id: I83629d0784dd983f47afc3307e81c48c3fdd274d
Reviewed-on: https://gerrit.chromium.org/gerrit/44045
Commit-Queue: Elly Jones <ellyjones@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Tested-by: Elly Jones <ellyjones@chromium.org>
21 months agoCreate a directory in which Chrome can store a reboot request 77/44077/3
Bartosz Fabianowski [Tue, 26 Feb 2013 20:31:58 +0000 (21:31 +0100)]
Create a directory in which Chrome can store a reboot request

When an automatic reboot is scheduled, Chrome needs to persist
the reboot request in a file so that if the Chrome process
crashes, the request is not lost. The file needs to reside in
a tmpfs so that once the reboot does occur, the file is
guaranteed to be destroyed and no reboot loop can occur.

BUG=chromium-os:36400
TEST=Manual; directory is created and has the right permissions

Change-Id: I9a251caaa5562b61d4564ed9f69385a65dea16c3
Reviewed-on: https://gerrit.chromium.org/gerrit/44077
Tested-by: Bartosz Fabianowski <bartfab@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
Commit-Queue: Bartosz Fabianowski <bartfab@chromium.org>

21 months agoembedded/chromeos_startup: add dev image support 16/44016/3
Mandeep Singh Baines [Tue, 26 Feb 2013 05:25:02 +0000 (21:25 -0800)]
embedded/chromeos_startup: add dev image support

BUG=chromium-os:39191
TEST=/usr/local is now mounted correctly.

Change-Id: I92daffda7663b9f18fb741bf32a6dedb14b962db
Reviewed-on: https://gerrit.chromium.org/gerrit/44016
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Queue: Mandeep Singh Baines <msb@chromium.org>

21 months agoopenssh-server: also work if sshd is in /usr/local 15/44015/3
Mandeep Singh Baines [Tue, 26 Feb 2013 05:23:22 +0000 (21:23 -0800)]
openssh-server: also work if sshd is in /usr/local

openssh is not part of the base cros_embedded image.

BUG=chromium-os:39191
TEST=I can now ssh into a cros_embedded device.

Change-Id: Ia3aa88a6e472c08c63ba2b716cb2d00b6a7c956b
Reviewed-on: https://gerrit.chromium.org/gerrit/44015
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Queue: Mandeep Singh Baines <msb@chromium.org>

21 months agoinit: Clean up power manager directory permissions. 71/43971/2
Daniel Erat [Mon, 25 Feb 2013 22:47:16 +0000 (14:47 -0800)]
init: Clean up power manager directory permissions.

This removes the chronos user's ability to write to powerd's
preferences dir and removes some old code that deleted
powerd.LATEST in case it was still owned by the chronos
user.

Unrelatedly, it removes a deprecated --use_state_controller
flag that's now on by default.

BUG=chromium-os:38732,chromium:173849
TEST=manual: permissions are set correctly

Change-Id: I74ac291dc1bea92f9bf48e7f06f5b4f57fd0d049
Reviewed-on: https://gerrit.chromium.org/gerrit/43971
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>

21 months ago[init] tlsdate: use correct root cert set 91/43891/2
Elly Fong-Jones [Mon, 25 Feb 2013 14:45:53 +0000 (09:45 -0500)]
[init] tlsdate: use correct root cert set

We should use the Google root set (since we talk to Google), not the
whole-internet root set.

BUG=chromium-os:39140
TEST=platform_TLSDateActual

Change-Id: I8b19469b9cdb6c9b10a4d088503d281e7ed744eb
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43891
Reviewed-by: Will Drewry <wad@chromium.org>
21 months agoAdd embedded-init directory with embedded devices init scripts 56/43656/9
Anush Elangovan [Wed, 20 Feb 2013 23:32:11 +0000 (15:32 -0800)]
Add embedded-init directory with embedded devices init scripts

Add an embedded version of chromeos_startup and shutdown.
Also, add in an embedded-specific 'boot-services' upstart script

CQ-DEPEND=Ib4537239e6e171f00d4ec9a9c2c7f926b45ca476

BUG=chromium-os:38575, chromium-os:38576
TEST=build_packages and build_image for daisy-drm.  Boot, ctrl-alt-F2 and sign in at the shell prompt

Change-Id: I50ae921b92d50d664d4c4d980bdea7f45fc05414
Reviewed-on: https://gerrit.chromium.org/gerrit/43656
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Anush Elangovan <anush@google.com>
Commit-Queue: Chris Masone <cmasone@chromium.org>

22 months agoinit: Fix the wording on the developer transition screen 89/43489/3
Hung-Te Lin [Mon, 18 Feb 2013 04:53:20 +0000 (12:53 +0800)]
init: Fix the wording on the developer transition screen

To provide correct instruction for devices using virtual developer switch (also
known as keyboard-controlled recovery), we should determine developer switch
type before showing enter_dev message.

BUG=chromium-os:38884
TEST=manual: chromeos-boot-alert enter_dev /dev/tty
     # see enter_dev1 (data 'will' be cleared...) on ZGB,
     # enter_dev1_virtual (data 'has' been cleared...) on Link.

Change-Id: Ib20eee6cd02c92ce95eb51cf7b9e3fbcbe800389
Reviewed-on: https://gerrit.chromium.org/gerrit/43489
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>

22 months agoRemove dead code relating to the legacy window manager from ui.conf 40/42840/2 stabilize-3701.30.0 stabilize-3701.30.0b stabilize-bluetooth-smart
J. Richard Barnette [Thu, 7 Feb 2013 02:19:48 +0000 (18:19 -0800)]
Remove dead code relating to the legacy window manager from ui.conf

BUG=None
TEST=boot and log in

Change-Id: I5fde1a1bec2982966ee20bce05ecd0905b9dea44
Reviewed-on: https://gerrit.chromium.org/gerrit/42840
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>

22 months agochromeos_startup: mount debugfs with strict mode 53/42653/2
Kees Cook [Tue, 5 Feb 2013 21:40:36 +0000 (13:40 -0800)]
chromeos_startup: mount debugfs with strict mode

This changes the debugfs mount to be available only to the root user and
the debugd group. Anything running as chronos should be run through
debugd.

BUG=chromium-os:23758
TEST=link build, things appear to be working
CQ-DEPEND=I4a37f3bd13da0ced916bde8038de16ebc3504d5e,I2da4ace404216fb452f7eebd281c4289e3ec1ef9

Change-Id: I8a0c2049ed40d6e7b251218c5b403ecb61da9347
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42653
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
22 months agoinit: Remove references to window manager and screen locker. 21/42821/2
Daniel Erat [Thu, 7 Feb 2013 00:14:06 +0000 (16:14 -0800)]
init: Remove references to window manager and screen locker.

This removes references to processes that are no longer with
us.

BUG=none
TEST=manual: image still boots

Change-Id: I16c121d4620ea150f011b3f9b4e35e93c749ade4
Reviewed-on: https://gerrit.chromium.org/gerrit/42821
Commit-Queue: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
22 months agoinit: Pass --use_state_controller to powerd. 05/42505/2
Daniel Erat [Sat, 2 Feb 2013 20:04:58 +0000 (12:04 -0800)]
init: Pass --use_state_controller to powerd.

This sets powerd's --use_state_controller flag to turn on
some new code.  It also uses --vmodule to enable verbose
logging from that code.

BUG=chromium-os:38281,chromium:173849
TEST=manual
CQ-DEPEND=I302f09017853cc2ef0d1210719c3f1fe1cf274c2

Change-Id: I0a409b03b559866f8e8db2e871dd05cf99cb3d7e
Reviewed-on: https://gerrit.chromium.org/gerrit/42505
Reviewed-by: Simon Que <sque@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
22 months agoinit: Create /var/spool/power_manager/root directory. 47/42547/2
Daniel Erat [Mon, 4 Feb 2013 17:16:08 +0000 (09:16 -0800)]
init: Create /var/spool/power_manager/root directory.

This creates a new directory for power-manager-related state
files written by root that must persist across reboots.

BUG=chromium-os:38484
TEST=manual: directory is created and owned by root

Change-Id: Ie15381391720ffdf5780b4cae85d15730b3fd811
Reviewed-on: https://gerrit.chromium.org/gerrit/42547
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>

22 months agoDivert VPN-related messages to /var/log/net.log. 89/42389/2 stabilize-3658.0.0
Darin Petkov [Thu, 31 Jan 2013 15:30:07 +0000 (16:30 +0100)]
Divert VPN-related messages to /var/log/net.log.

This patch adds log output from the following processes to net.log:

- openvpn
- openvpn-script
- l2tpipsec_vpn
- pppd
- nss-get-cert

BUG=chromium-os:38131
TEST=Connected to VPN, inspected /var/log/net.log for messages coming
from the 'openvpn' process.

Change-Id: Ie75f61904579399d9f8e1ed7ca5d180531ceb88d
Reviewed-on: https://gerrit.chromium.org/gerrit/42389
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Wade Guthrie <wdg@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>

22 months ago[init] fix date_proxy early exit 90/39590/6
Elly Fong-Jones [Wed, 12 Dec 2012 17:04:12 +0000 (12:04 -0500)]
[init] fix date_proxy early exit

date_proxy was exiting early and in an unclean way, causing upstart to spawn it
again, which caused it to spawn new copies of its helper program, which would
then hang around forever. There are two causes of exits:

1. 'restart tlsdate' instead of 'restart tlsdated' causes us to exit because
this script is set +e, and
2. reading from the fifo returns eof when the writer end closes the fifo.

To solve 2, we have the writer end keep the fifo open for as long as it's
running by doing its logic in a subshell with stdout to the fifo.

BUG=chromium-os:36729
TEST=adhoc

Change-Id: I1275bee9f48aa342b669911e09f92c9eddd2e752
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39590
Reviewed-by: Kees Cook <keescook@chromium.org>
22 months agoStart swap-exp.conf earlier so Chrome can start trial 29/42029/3
Luigi Semenzato [Fri, 25 Jan 2013 19:28:28 +0000 (11:28 -0800)]
Start swap-exp.conf earlier so Chrome can start trial

Before this CL, swap-exp.conf runs after the Chrome code that
starts the field trial, so the experiment misses the first boot
session (which could be quite long).

The execution time of the script is small, and it is negligible
after the initial setup, so impact on boot time is acceptable.

BUG=chromium-os:37583
TEST=manual
BRANCH=none

Change-Id: I8f2fb3625389995f72eae01a1c31a78243b47145
Reviewed-on: https://gerrit.chromium.org/gerrit/42029
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>

22 months ago[chromeos-init] mount debugfs no{dev,exec,suid} 44/41844/3
Elly Fong-Jones [Wed, 23 Jan 2013 19:55:42 +0000 (14:55 -0500)]
[chromeos-init] mount debugfs no{dev,exec,suid}

Autotest update at <https://gerrit.chromium.org/gerrit/#/c/41845>

BUG=chromium-os:32632
TEST=platform_FilePerms,adhoc
build, boot, 'mount | grep debugfs'

Change-Id: Icaf245fb319315020127a2529f42d73e7d9e5b1f
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41844

22 months agoMake swap-exp a task to eliminate races, + extra fix 79/41779/3
Luigi Semenzato [Tue, 22 Jan 2013 23:16:14 +0000 (15:16 -0800)]
Make swap-exp a task to eliminate races, + extra fix

When swap-exp.conf is not a task, it can execute in parallel with
swap.conf, leading to races.

In addition, remove the code that makes swap-exp run only when
NOT in developer mode.  I have observed hang situations that may
be attributed to crossystem, but they are hard to reproduce.
The UMA histogram site already filters out devices in dev mode,
so it is not necessary to do it here.

BUG=chromium-os:38112
TEST=manually tested
BRANCH=none

Change-Id: If4cb843f2e3889759608a2d65f44c4194d6d32d9
Reviewed-on: https://gerrit.chromium.org/gerrit/41779
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
22 months agoCreate an empty /var/run/user_policy when ui starts. 18/41718/2
Joao da Silva [Mon, 21 Jan 2013 14:17:49 +0000 (15:17 +0100)]
Create an empty /var/run/user_policy when ui starts.

BUG=chromium:163318
TEST=start ui; an empty /var/run/user_policy is created.

Change-Id: I34c96f3e5c9dc46b1ad1a053e7ba611b65e8c070
Reviewed-on: https://gerrit.chromium.org/gerrit/41718
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Queue: Joao da Silva <joaodasilva@chromium.org>
Tested-by: Joao da Silva <joaodasilva@chromium.org>
23 months agoinit: Remove powerm.conf. 77/41577/2
Daniel Erat [Thu, 17 Jan 2013 17:41:35 +0000 (09:41 -0800)]
init: Remove powerm.conf.

BUG=chromium-os:36804
TEST=manual: built an image
CQ-DEPEND=I41658fb2dc6f2abb82acb950894a21fee1505001
CQ-DEPEND=Ie4b92ea3817405f1b9aa7372bac08122ab30c486

Change-Id: I4640da16879af6d5b54ade0acf1957e112a78153
Reviewed-on: https://gerrit.chromium.org/gerrit/41577
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>

23 months agolockbox-cache.conf: add a task to emit a lockbox cache 38/41538/10
Will Drewry [Wed, 16 Jan 2013 22:07:38 +0000 (16:07 -0600)]
lockbox-cache.conf: add a task to emit a lockbox cache

In order to make the lockbox data accessible as early as possible,
we can verify using the NVRAM data collected by mount-encrypted staged
in /tmp/lockbox.nvram.  This task uses that file and generates a
file in /var/run/lockbox which contains a cache of the install_attributes.pb
iff the file validated against the boot-time nvram data.

In the cases of VMs or non-chrome firmware and there is no NVRAM file,
we just pretend that the lockbox is validated.

BUG=chromium-os:37367
TEST=emerges and runs lockbox-cache as soon as possible generating the
cache when it is legit, but adding a byte to the lockbox content shows
it doesn't regenerate.

Change-Id: I8616095b54b44ea392630dad00769d5fcc383119
Reviewed-on: https://gerrit.chromium.org/gerrit/41538
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Will Drewry <wad@chromium.org>
Tested-by: Will Drewry <wad@chromium.org>
23 months agoinit: Don't set capabilities for powerd. 47/41247/2
Daniel Erat [Tue, 15 Jan 2013 00:24:48 +0000 (16:24 -0800)]
init: Don't set capabilities for powerd.

Setting the CAP_SYS_TTY_CONFIG capability on powerd via
minijail0 prevents powerd_setuid_helper from being able to
call setuid(0) later.  VT-locking will instead be moved from
powerd to powerd_setuid_helper.

BUG=chromium-os:36804
TEST=manual: powerd_setuid_helper no longer fails on
     setuid(0)
CQ-DEPEND=I41b95799d71e63b7e4967b7faf0b2f34b7cadbfb

Change-Id: Icc0e88fd6fdd40176c0ac4d933365cc498347ab8
Reviewed-on: https://gerrit.chromium.org/gerrit/41247
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>

23 months agoReland "init: Minor changes needed to move suspending..." 12/41212/2
Daniel Erat [Mon, 14 Jan 2013 16:09:40 +0000 (08:09 -0800)]
Reland "init: Minor changes needed to move suspending..."

This reverts commit d847af62, relanding de883380:

powerd needs to be able to open /dev/tty0 with WR_ONLY at
startup.  This is permitted with the existing udev
configuration, but udev needs to be triggered earlier.

This change also grants the CAP_SYS_TTY_CONFIG capability to
powerd so it can make VT_LOCKSWITCH and VT_UNLOCKSWITCH
ioctls.

It also creates a /var/run/power_manager/root directory for
power-management-related processes running as root to use.

BUG=chromium-os:36804
TEST=powerd is able to suspend the system
CQ-DEPEND=I9bbd56002d830f897e6ae72f225f729c781c0817

Change-Id: Icf950099f6cd24faf06d9e5611389c8cfcb37a2d
Reviewed-on: https://gerrit.chromium.org/gerrit/41212
Commit-Queue: Daniel Erat <derat@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
23 months agoRevert "init: Minor changes needed to move suspending to powerd." 95/41195/2
Brian Harring [Mon, 14 Jan 2013 05:29:00 +0000 (21:29 -0800)]
Revert "init: Minor changes needed to move suspending to powerd."

This reverts commit de883380b7c876e67b6e73bfb723a3e05cde94e9

Specifically reverts CL:40417.

Pulling this since it's part of the CQ cycle for CL:40573, which is exposing new paths in autotest (which are broke, but the fixed code would still fail this test best I can tell).

BUG=chromium-os:37843, chromium-os:36804
TEST=n/a

Change-Id: Idefb0d02d7454139c41ef2e31819bb50dd1a8113
Reviewed-on: https://gerrit.chromium.org/gerrit/41195
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
23 months agoinit: Minor changes needed to move suspending to powerd. 17/40417/6
Daniel Erat [Thu, 3 Jan 2013 01:27:23 +0000 (17:27 -0800)]
init: Minor changes needed to move suspending to powerd.

powerd needs to be able to open /dev/tty0 with WR_ONLY at
startup.  This is permitted with the existing udev
configuration, but udev needs to be triggered earlier.

This change also grants the CAP_SYS_TTY_CONFIG capability to
powerd so it can make VT_LOCKSWITCH and VT_UNLOCKSWITCH
ioctls.

It also creates a /var/run/power_manager/root directory for
power-management-related processes running as root to use.

BUG=chromium-os:36804
TEST=powerd is able to suspend the system
CQ-DEPEND=I8b889cddb21cbadd2515ca028169077a47b7dc80

Change-Id: I8e921d6721947b64aac30110dbd86364ede52122
Reviewed-on: https://gerrit.chromium.org/gerrit/40417
Commit-Queue: Daniel Erat <derat@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
23 months agoDisable launching 'date-proxy-watcher' automatically. 30/41130/2
Jorge Lucangeli Obes [Fri, 11 Jan 2013 18:12:27 +0000 (10:12 -0800)]
Disable launching 'date-proxy-watcher' automatically.

BUG=chromium-os:37780
TEST=gmerge chromeos-init, reboot, no zombie minijail0 processes.

Change-Id: I1df47812f0339698fbff4388a9b52f03dc6887fa
Reviewed-on: https://gerrit.chromium.org/gerrit/41130
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: Jorge Lucangeli Obes <jorgelo@chromium.org>

23 months agoinit: Run laptop_mode after resuming. 42/41042/2 factory-3536.B
Daniel Erat [Thu, 10 Jan 2013 05:43:01 +0000 (21:43 -0800)]
init: Run laptop_mode after resuming.

This creates a "laptop-mode-resume" job that runs
"laptop_mode auto" in response to system-resumed, a new
signal that will be emitted by the powerd_suspend script.
It also renames the existing "power" job to
"laptop-mode-boot".

BUG=chromium-os:36804
TEST=manual: verified from /var/log/messages that
     laptop_mode runs at boot and when system-resumed is
     emitted

Change-Id: I7101891851cae88338e5a6b76b7676cc3de95dc1
Reviewed-on: https://gerrit.chromium.org/gerrit/41042
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>

23 months agoAdd zram field trial (/etc/init) with correct file owners 99/40999/2
Luigi Semenzato [Thu, 10 Jan 2013 04:45:19 +0000 (20:45 -0800)]
Add zram field trial (/etc/init) with correct file owners

This adds the zram (compressed swap) field trial (experiment).
It consists of three CLs: this one, one CL in crosh (to opt-out
of the experiment when manually enabling zram), and one CL in
Chrome to set up the UMA stuff.

The experiment groups are selected by hashing the MAC address
of the wifi adapter on the device.  Ideally we would assign
users to groups, because we believe that the presence of compressed
swap may change the usage pattern.  Unfortunately it is difficult
to turn swap off without rebooting, so we settle for device-based
groups as an approximation.

This replaces #40354, which had to be reverted because it
created files owned by root in /home/chronos.

BUG=chromium-os:37583
TEST=manual testing for a number of combinations (not all)

Change-Id: I618a4726b6b8f2e7dfe681a7516b480d1f10f177
Reviewed-on: https://gerrit.chromium.org/gerrit/40999
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>

23 months agoRevert "Add zram field trial (/etc/init)." 94/40994/2
Daniel Kurtz [Thu, 10 Jan 2013 03:53:03 +0000 (11:53 +0800)]
Revert "Add zram field trial (/etc/init)."

This reverts commit 10faa157595454d1cd946b5aadb5b2bc39310ebf.

Unfortunately, it broke all canaries.

security_ProfilePermissions.login            [ FAILED ]
security_ProfilePermissions.login              FAIL: Bad permissions found on cryptohome files
security_ProfilePermissions.BWSI             [ FAILED ]
security_ProfilePermissions.BWSI               FAIL: Bad permissions found on cryptohome files

BUG=chromium-os:37747
TEST=security_ProfilePermissions

Change-Id: I30109c642bbc4da0633fb91a19c7b4f1dac5c104
Reviewed-on: https://gerrit.chromium.org/gerrit/40994
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
23 months agoinit: Diverting modem manager log messages to /var/log/net.log 75/40975/2
Ben Chan [Wed, 9 Jan 2013 23:18:36 +0000 (15:18 -0800)]
init: Diverting modem manager log messages to /var/log/net.log

BUG=chromium-os:37740
TEST=Verified that all log messages from cromo and ModemManager are sent
to /var/log/net.log and only those severer than warnings are sent to
/var/log/messages.

Change-Id: Ibd88205507227a822508856bce154cf5b0778f09
Reviewed-on: https://gerrit.chromium.org/gerrit/40975
Reviewed-by: Wade Guthrie <wdg@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
23 months agoAdd zram field trial (/etc/init). 54/40354/10
Luigi Semenzato [Thu, 3 Jan 2013 00:56:37 +0000 (16:56 -0800)]
Add zram field trial (/etc/init).

This adds the zram (compressed swap) field trial (experiment).
It consists of three CLs: this one, one CL in crosh (to opt-out
of the experiment when manually enabling zram), and one CL in
Chrome to set up the UMA stuff.

The experiment groups are selected by hashing the MAC address
of the wifi adapter on the device.  Ideally we would assign
users to groups, because we believe that the presence of compressed
swap may change the usage pattern.  Unfortunately it is difficult
to turn swap off without rebooting, so we settle for device-based
groups as an approximation.

More details in the code.

BUG=chromium-os:37583
TEST=manual testing for a number of combinations (not all)

Change-Id: I457601a3b96464c2bc4e2fdbd305ca2e9bec1fbb
Reviewed-on: https://gerrit.chromium.org/gerrit/40354
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
23 months agoPowerwash: Collect Stats 71/39971/7
Simran Basi [Wed, 19 Dec 2012 20:42:42 +0000 (12:42 -0800)]
Powerwash: Collect Stats

When the device is powerwashed, keep track of how many times it's been
powerwashed sequentially (i.e. in between complete recoveries of the
device and inbetween switching to/from dev mode.).

After every powerwash send to metrics the number of times it's been done
on this device.

BUG=chromium-os:37110
TEST=Tested on stumpy and verified the stats end up in about:histograms
     and the count increases on each powerwash.

Change-Id: I92344fb7e70ac2a6190a0954b6298849d4608897
Reviewed-on: https://gerrit.chromium.org/gerrit/39971
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>