| OLD | NEW |
| 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. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 "${ROOT_FS_DIR}"/etc/group | 77 "${ROOT_FS_DIR}"/etc/group |
| 78 done | 78 done |
| 79 | 79 |
| 80 sudo mkdir -p "${ROOT_FS_DIR}/home/${ADD_USER}" | 80 sudo mkdir -p "${ROOT_FS_DIR}/home/${ADD_USER}" |
| 81 sudo chown 1000.1000 "${ROOT_FS_DIR}/home/${ADD_USER}" | 81 sudo chown 1000.1000 "${ROOT_FS_DIR}/home/${ADD_USER}" |
| 82 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/sudoers" conv=notrunc oflag=append | 82 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/sudoers" conv=notrunc oflag=append |
| 83 %adm ALL=(ALL) ALL | 83 %adm ALL=(ALL) ALL |
| 84 $ADD_USER ALL=(ALL) ALL | 84 $ADD_USER ALL=(ALL) ALL |
| 85 EOF | 85 EOF |
| 86 sudo chmod 0440 "${ROOT_FS_DIR}/etc/sudoers" | 86 sudo chmod 0440 "${ROOT_FS_DIR}/etc/sudoers" |
| 87 echo "# Allow chronos user to renice processes so that chrome will adjust tab pr
iorities" | \ |
| 88 sudo dd of="${ROOT_FS_DIR}/etc/security/limits.conf" conv=notrunc oflag=append |
| 89 echo "chronos hard nice 0" | \ |
| 90 sudo dd of="${ROOT_FS_DIR}/etc/security/limits.conf" conv=notrunc oflag=append |
| 87 | 91 |
| 88 # Set CHROMEOS_VERSION_DESCRIPTION here (uses vars set in chromeos_version.sh) | 92 # Set CHROMEOS_VERSION_DESCRIPTION here (uses vars set in chromeos_version.sh) |
| 89 # Was removed from chromeos_version.sh which can also be run outside of chroot | 93 # Was removed from chromeos_version.sh which can also be run outside of chroot |
| 90 # where CHROMEOS_REVISION is set | 94 # where CHROMEOS_REVISION is set |
| 91 # We have to set (in build_image.sh) and use REAL_USER due to many nested | 95 # We have to set (in build_image.sh) and use REAL_USER due to many nested |
| 92 # chroots which lose $USER state. | 96 # chroots which lose $USER state. |
| 93 . "${SCRIPTS_DIR}/chromeos_version.sh" | 97 . "${SCRIPTS_DIR}/chromeos_version.sh" |
| 94 if [ ${CHROMEOS_OFFICIAL:-0} = 1 ]; then | 98 if [ ${CHROMEOS_OFFICIAL:-0} = 1 ]; then |
| 95 export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Official Buil
d ${CHROMEOS_REVISION:?})" | 99 export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Official Buil
d ${CHROMEOS_REVISION:?})" |
| 96 elif [ "$REAL_USER" = "chrome-bot" ] | 100 elif [ "$REAL_USER" = "chrome-bot" ] |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/network/interfaces" | 250 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/network/interfaces" |
| 247 auto lo | 251 auto lo |
| 248 iface lo inet loopback | 252 iface lo inet loopback |
| 249 EOF | 253 EOF |
| 250 | 254 |
| 251 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/resolv.conf" | 255 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/resolv.conf" |
| 252 # Use the connman dns proxy. | 256 # Use the connman dns proxy. |
| 253 nameserver 127.0.0.1 | 257 nameserver 127.0.0.1 |
| 254 EOF | 258 EOF |
| 255 sudo chmod a-wx "${ROOT_FS_DIR}/etc/resolv.conf" | 259 sudo chmod a-wx "${ROOT_FS_DIR}/etc/resolv.conf" |
| OLD | NEW |