Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Side by Side Diff: update_kernel.sh

Issue 5974003: update_kernel: add support for modules and firmware (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 # Script to update the kernel on a live running ChromiumOS instance. 7 # Script to update the kernel on a live running ChromiumOS instance.
8 8
9 # Load common constants. This should be the first executable line. 9 # Load common constants. This should be the first executable line.
10 # The path to common.sh should be relative to your script's location. 10 # The path to common.sh should be relative to your script's location.
11 11
12 . "$(dirname $0)/common.sh" 12 . "$(dirname $0)/common.sh"
13 . "$(dirname $0)/remote_access.sh" 13 . "$(dirname $0)/remote_access.sh"
14 14
15 DEFINE_string board "" "Override board reported by target" 15 DEFINE_string board "" "Override board reported by target"
16 DEFINE_string partition "" "Override kernel partition reported by target" 16 DEFINE_string partition "" "Override kernel partition reported by target"
17 DEFINE_boolean modules false "Update modules on target"
18 DEFINE_boolean firmware false "Update firmware on target"
17 19
18 function cleanup { 20 function cleanup {
19 cleanup_remote_access 21 cleanup_remote_access
20 rm -rf "${TMP}" 22 rm -rf "${TMP}"
21 } 23 }
22 24
23 # Ask the target what the kernel partition is 25 # Ask the target what the kernel partition is
24 function learn_partition() { 26 function learn_partition() {
25 [ -n "${FLAGS_partition}" ] && return 27 [ -n "${FLAGS_partition}" ] && return
26 remote_sh cat /proc/cmdline 28 remote_sh cat /proc/cmdline
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 --vmlinuz /build/${FLAGS_board}/boot/vmlinuz" 69 --vmlinuz /build/${FLAGS_board}/boot/vmlinuz"
68 70
69 ./enter_chroot.sh -- ${cmd} 71 ./enter_chroot.sh -- ${cmd}
70 72
71 learn_partition 73 learn_partition
72 74
73 remote_cp_to new_kern.bin /tmp 75 remote_cp_to new_kern.bin /tmp
74 76
75 remote_sh dd if=/tmp/new_kern.bin of="${FLAGS_partition}" 77 remote_sh dd if=/tmp/new_kern.bin of="${FLAGS_partition}"
76 78
79 if [[ ${FLAGS_modules} -eq ${FLAGS_TRUE} ]]; then
80 echo "copying modules"
81 cmd="tar -C /build/${FLAGS_board}/lib/modules -cjf new_modules.tar ."
82 ./enter_chroot.sh -- ${cmd}
83
84 remote_cp_to new_modules.tar /tmp/
85
86 remote_sh mount -o remount,rw /
87 remote_sh tar -C /lib/modules -xjf /tmp/new_modules.tar
88 fi
89
90 if [[ ${FLAGS_firmware} -eq ${FLAGS_TRUE} ]]; then
91 echo "copying firmware"
92 cmd="tar -C /build/${FLAGS_board}/lib/firmware -cjf new_firmware.tar ."
93 ./enter_chroot.sh -- ${cmd}
94
95 remote_cp_to new_firmware.tar /tmp/
96
97 remote_sh mount -o remount,rw /
98 remote_sh tar -C /lib/firmware -xjf /tmp/new_firmware.tar
99 fi
100
77 remote_reboot 101 remote_reboot
78 102
79 remote_sh uname -r -v 103 remote_sh uname -r -v
80 104
81 info "old kernel: ${old_kernel}" 105 info "old kernel: ${old_kernel}"
82 106
83 info "new kernel: ${REMOTE_OUT}" 107 info "new kernel: ${REMOTE_OUT}"
84 } 108 }
85 109
86 main $@ 110 main $@
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698