Commit Graph

14 Commits

Author SHA1 Message Date
Kees Cook
43a3213f33 update_kernel: use $TMP for generated outputs
"new_kern.bin" was being generated in the current directory and not
being cleaned up. Additionally, without this change, it is not safe to
run update_kernel.sh concurrently to separate devices.

BUG=None
TEST=Updated a kernel on a running VM, verified /tmp/update_kernel.* was
 created and used for generated outputs.

Change-Id: I27cd236ee9d38263dcca361ce063078a13b11864
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/10240
Reviewed-by: Olof Johansson <olofj@chromium.org>
2011-10-19 11:05:33 -07:00
Kees Cook
7d7d2ef0f0 update_kernel: update the syslinux partition too
The KVM examples boot from the syslinux partiton, so update the kernel
that lives there too.

BUG=None
TEST=correctly updated a kernel in a VM

Change-Id: I1526064f85d6c9233696590e9e746bc91bcd6d2a
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/10239
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
2011-10-19 10:13:58 -07:00
Brian Harring
d5d5dbffa1 Fix/standardize exiting if common.sh can't be found
The problem here is that most were doing their exiting w/in a subshell;
exit within a subshell kills the subshell, not the parent.  Not all scripts
were using set -e (which would pick up the failing subshell); as such
just rewriting them to remove the potential via eliminateing the subshelling.

Beyond that, removed a couple of custom (working, although non-standard)
approaches, and removed a duplicate common.sh sourc'ing w/in mk_memento_images.sh

TEST=force 'find_common_sh' to fail, note the scripts fails to exit
BUG=none

Change-Id: Ia1108a091a6399ad6aedd3cade4a107f4411686c
Reviewed-on: http://gerrit.chromium.org/gerrit/3905
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2011-07-22 12:06:59 -07:00
Taylor Hutt
60da642e64 Fix regression in 'update_kernel.sh' for Tegra2 boards.
This 'update_kernel.sh' script gratuitiously broke on ARM targets
because the bootloader file has been changed to 'bootloader.bin' from
its previous name.

TEST=Used the script with a small kernel change to my Arthur board.
BUG=none

Change-Id: I146f08256543ffe2c4c52995625b26a1b3f28318
Reviewed-on: http://gerrit.chromium.org/gerrit/1989
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Taylor Hutt <thutt@chromium.org>
Tested-by: Taylor Hutt <thutt@chromium.org>
2011-06-02 14:28:42 -07:00
Mandeep Singh Baines
981555b638 update_kernel.sh: don't assume pwd
The script used to assume that you were running it from src/scripts.

That assumption has now been removed.

BUG=none
TEST=After this change I can run update_kernel.sh from anywhere.

Change-Id: I2676e1c16f5682d06be48e99c915660e4cb35be8
Reviewed-on: http://gerrit.chromium.org/gerrit/1933
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Mandeep Singh Baines <msb@chromium.org>
2011-06-01 21:06:05 -07:00
Tom Wai-Hong Tam
6b50a07f59 Support signing kernel in update_kernel script.
This CL is separated from http://gerrit.chromium.org/gerrit/#change,1104 which
is depends on the UUID replacement. In order to make update_kernel not break on
officail ChromeOS firmware, this CL just signs the kernel and use the original
cmdline approach, i.e. /dev/${devname}${rootpart}.

TEST=./update_kernel --remote IP
BUG=none

Change-Id: I6a194da0ebb0b3f5a442b62ffb76186909eb4321
Reviewed-on: http://gerrit.chromium.org/gerrit/1538
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
2011-05-25 02:30:09 -07:00
Olof Johansson
8488f5a3c5 update_kernel: be smarter
Auto-detect use of verity, and if verity is not used, copy over modules and firmware.

Also, while I was at it, I added a --noreboot argument.

And also copy over vmlinux.uimg on ARM if on non-verity.

Change-Id: Ida9d3fbf4f342db65ebd0002a8b1a528440ea7fe

BUG=chromium-os:13321
TEST=Build kernel, try updating on x86 and ARM, both with and without verity

Review URL: http://codereview.chromium.org/6881029
2011-04-20 17:27:37 -07:00
Mandeep Singh Baines
e39579a9d0 update_kernel: fix to be not rely on kernel command-line
This script recently stopped working when we changed the kernel cmdline.

Fix to be more robust by using rootdev instead.

BUG=12780
TEST=Updated my kernel.

Change-Id: I033f670c5db821863441ea1546c382fce3436c01

Review URL: http://codereview.chromium.org/6628027
2011-03-04 15:58:57 -08:00
Greg Spencer
798d75f3be This starts to fix the scripts so that they load from /usr/lib/crosutils
from within the chroot.

It also fixes a number of style issues.

It changes the meaning of cros_workon "list-all" to list all available
packages, and adds "list-live" to list all live packages.

It changes things that load chromeos-common.sh from the installer to
load it from /usr/lib/installer.

BUG=chromium-os:4230
TEST=synced, rebuilt chroot, made packages, made images, built chrome
from source, and wrote an image to a USB stick.

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

Change-Id: I90c34420af1a64020402bafef8e9e77f56837c02
2011-02-01 22:04:49 -08:00
Olof Johansson
f53fa0d5f8 update_kernel: first cut at arm support
Change-Id: I5dc22223559d3cdad357530af66c14115da63c89

BUG=n0ne
TEST=update_kernel to seaboard (and mario for regression test)

Review URL: http://codereview.chromium.org/6031005
2011-01-26 13:06:46 -08:00
Mandeep Singh Baines
2f3b5fc537 update_kernel.sh: modify to work inside chroot
BUG=n0ne
TEST=Successfully updated a kernel.

Change-Id: If168c47cca4b5b794d95c9b839b17bff3f96ed9c

Review URL: http://codereview.chromium.org/6249004
2011-01-14 14:20:12 -08:00
Olof Johansson
5a46bfb321 update_kernel: add support for modules and firmware
Change-Id: I7b38b5f9656bd21f6c88c5385c1aa0c526f48294
Signed-off-by: Olof Johansson <olofj@chromium.org>

BUG=n0ne
TEST=build kernel and firmware, update a mario

Review URL: http://codereview.chromium.org/5974003
2010-12-22 12:14:21 -08:00
Doug Anderson
ebe1baa4ba Fixed update_kernel.sh not to put an extra set of quotes w/ enter_chroot.
This change is in preparation for the new sudo, which corrects how
parameters are passed to subcommands.

Change-Id: I34d09d2716fbef137d02748a2934459a8a10d693

BUG=chromium-os:7072
TEST=Ran modified "update_kernel.sh" w/ old sudo and new sudo.

Review URL: http://codereview.chromium.org/5859002
2010-12-15 13:56:09 -08:00
Mandeep Singh Baines
a63cd2d648 Create a new command update_kernel.sh
This command can be used to update the kernel of a ChromiumOS target.

Much thanks to snanda for the inspiration and instructions.

BUG=9864
TEST=Verified that it works.

Change-Id: I66f7d940e0dc59b0e1a50409a7155fe0ba7157fe

Review URL: http://codereview.chromium.org/5550001
2010-12-02 11:58:26 -08:00