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

Side by Side Diff: src/scripts/customize_rootfs.sh

Issue 554056: Some changes to be able to build an armel-based rootfs. (Closed)
Patch Set: Removed blank line. Created 10 years, 11 months 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
« no previous file with comments | « src/scripts/build_image.sh ('k') | src/scripts/install_packages.sh » ('j') | 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 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2009 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 customize the root file system after packages have been installed. 7 # Script to customize the root file system after packages have been installed.
8 # 8 #
9 # NOTE: This script should be called by build_image.sh. Do not run this 9 # NOTE: This script should be called by build_image.sh. Do not run this
10 # on your own unless you know what you are doing. 10 # on your own unless you know what you are doing.
11 11
12 # Load common constants. This should be the first executable line. 12 # Load common constants. This should be the first executable line.
13 # The path to common.sh should be relative to your script's location. 13 # The path to common.sh should be relative to your script's location.
14 . "$(dirname "$0")/common.sh" 14 . "$(dirname "$0")/common.sh"
15 15
16 # Script must be run inside the chroot 16 # Script must be run inside the chroot
17 assert_inside_chroot 17 assert_inside_chroot
18 18
19 # Flags 19 # Flags
20 DEFINE_string target "x86" \ 20 DEFINE_string arch "x86" \
21 "The target architecture to build for. One of { x86, arm }." 21 "The target architecture to build for. One of { x86, arm }."
22 DEFINE_string root "" \ 22 DEFINE_string root "" \
23 "The root file system to customize." 23 "The root file system to customize."
24 24
25 # Parse command line 25 # Parse command line
26 FLAGS "$@" || exit 1 26 FLAGS "$@" || exit 1
27 eval set -- "${FLAGS_ARGV}" 27 eval set -- "${FLAGS_ARGV}"
28 28
29 # Die on any errors. 29 # Die on any errors.
30 set -e 30 set -e
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 # make a mountpoint for stateful partition 137 # make a mountpoint for stateful partition
138 sudo mkdir -p "$ROOT_FS_DIR"/mnt/stateful_partition 138 sudo mkdir -p "$ROOT_FS_DIR"/mnt/stateful_partition
139 sudo chmod 0755 "$ROOT_FS_DIR"/mnt 139 sudo chmod 0755 "$ROOT_FS_DIR"/mnt
140 sudo chmod 0755 "$ROOT_FS_DIR"/mnt/stateful_partition 140 sudo chmod 0755 "$ROOT_FS_DIR"/mnt/stateful_partition
141 141
142 # Copy everything from the rootfs_static_data directory to the corresponding 142 # Copy everything from the rootfs_static_data directory to the corresponding
143 # place on the filesystem. Note that this step has to occur after we've 143 # place on the filesystem. Note that this step has to occur after we've
144 # installed all of the packages. 144 # installed all of the packages.
145 TMP_STATIC=$(mktemp -d) 145 TMP_STATIC=$(mktemp -d)
146 sudo cp -r "${SRC_ROOT}/rootfs_static_data/common/." "$TMP_STATIC" 146 sudo cp -r "${SRC_ROOT}/rootfs_static_data/common/." "$TMP_STATIC"
147 # TODO: Copy additional target-platform-specific subdirectories. 147 # TODO: Copy additional arch-platform-specific subdirectories.
148 sudo chmod -R a+rX "$TMP_STATIC/." 148 sudo chmod -R a+rX "$TMP_STATIC/."
149 sudo cp -r "$TMP_STATIC/." "$ROOT_FS_DIR" 149 sudo cp -r "$TMP_STATIC/." "$ROOT_FS_DIR"
150 sudo rm -rf "$TMP_STATIC" 150 sudo rm -rf "$TMP_STATIC"
151 151
152 # Fix issue where alsa-base (dependency of alsa-utils) is messing up our sound 152 # Fix issue where alsa-base (dependency of alsa-utils) is messing up our sound
153 # drivers. The stock modprobe settings worked fine. 153 # drivers. The stock modprobe settings worked fine.
154 # TODO: Revisit when we have decided on how sound will work on chromeos. 154 # TODO: Revisit when we have decided on how sound will work on chromeos.
155 ! sudo rm "${ROOT_FS_DIR}/etc/modprobe.d/alsa-base.conf" 155 ! sudo rm "${ROOT_FS_DIR}/etc/modprobe.d/alsa-base.conf"
156 156
157 # Remove unneeded fonts. 157 # Remove unneeded fonts.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/network/interfaces" 253 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/network/interfaces"
254 auto lo 254 auto lo
255 iface lo inet loopback 255 iface lo inet loopback
256 EOF 256 EOF
257 257
258 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/resolv.conf" 258 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/resolv.conf"
259 # Use the connman dns proxy. 259 # Use the connman dns proxy.
260 nameserver 127.0.0.1 260 nameserver 127.0.0.1
261 EOF 261 EOF
262 sudo chmod a-wx "${ROOT_FS_DIR}/etc/resolv.conf" 262 sudo chmod a-wx "${ROOT_FS_DIR}/etc/resolv.conf"
OLDNEW
« no previous file with comments | « src/scripts/build_image.sh ('k') | src/scripts/install_packages.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698