build: Update fontconfig to fall back on Droid.

This fixes monospace fonts in Chrome.  This change also
moves some static files out of customize_rootfs.sh.

BUG=237

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

git-svn-id: svn://chrome-svn/chromeos/trunk@303 06c00378-0e64-4dae-be16-12b19f9950a1
This commit is contained in:
derat@google.com 2009-11-21 18:01:05 +00:00
parent c0c8c69143
commit a9948c6336
2 changed files with 23 additions and 91 deletions

View File

@ -66,8 +66,11 @@ ROOT_FS_IMG="${OUTPUT_DIR}/rootfs.image"
MBR_IMG="${OUTPUT_DIR}/mbr.image" MBR_IMG="${OUTPUT_DIR}/mbr.image"
OUTPUT_IMG="${OUTPUT_DIR}/usb.img" OUTPUT_IMG="${OUTPUT_DIR}/usb.img"
# These paths are relative to SCRIPTS_DIR.
ROOTFS_PACKAGE_INSTALL_SCRIPT="install_packages.sh" ROOTFS_PACKAGE_INSTALL_SCRIPT="install_packages.sh"
ROOTFS_CUSTOMIZE_SCRIPT="customize_rootfs.sh" ROOTFS_CUSTOMIZE_SCRIPT="customize_rootfs.sh"
ROOTFS_STATIC_DATA="${SRC_ROOT}/rootfs_static_data"
ROOTFS_SETUP_DIR="/tmp/chromeos_setup" ROOTFS_SETUP_DIR="/tmp/chromeos_setup"
SETUP_DIR="${ROOT_FS_DIR}/${ROOTFS_SETUP_DIR}" SETUP_DIR="${ROOT_FS_DIR}/${ROOTFS_SETUP_DIR}"
@ -182,6 +185,7 @@ mkdir -p "$SETUP_DIR"
mkdir -p "${SETUP_DIR}/local_packages" mkdir -p "${SETUP_DIR}/local_packages"
cp "${SCRIPTS_DIR}/${ROOTFS_PACKAGE_INSTALL_SCRIPT}" "$SETUP_DIR" cp "${SCRIPTS_DIR}/${ROOTFS_PACKAGE_INSTALL_SCRIPT}" "$SETUP_DIR"
cp "${SCRIPTS_DIR}/${ROOTFS_CUSTOMIZE_SCRIPT}" "$SETUP_DIR" cp "${SCRIPTS_DIR}/${ROOTFS_CUSTOMIZE_SCRIPT}" "$SETUP_DIR"
cp -r "$ROOTFS_STATIC_DATA" "$SETUP_DIR"
cp "$FLAGS_pkglist" "${SETUP_DIR}/package-list-prod.txt" cp "$FLAGS_pkglist" "${SETUP_DIR}/package-list-prod.txt"
cp "${FLAGS_build_root}/x86/local_packages"/* "${SETUP_DIR}/local_packages" cp "${FLAGS_build_root}/x86/local_packages"/* "${SETUP_DIR}/local_packages"

View File

@ -10,20 +10,25 @@
set -e set -e
SETUP_DIR=$(dirname $0)
# Read options from the config file created by build_image.sh. # Read options from the config file created by build_image.sh.
echo "Reading options..." echo "Reading options..."
cat "$(dirname $0)/customize_opts.sh" cat "${SETUP_DIR}/customize_opts.sh"
. "$(dirname $0)/customize_opts.sh" . "${SETUP_DIR}/customize_opts.sh"
FULLNAME="ChromeOS User" if [ ${CHROMEOS_OFFICIAL:-0} = 1 ]; then
FULLNAME="Google Chrome OS User"
else
FULLNAME="Chromium OS User"
fi
USERNAME="chronos" USERNAME="chronos"
ADMIN_GROUP="admin" ADMIN_GROUP="admin"
DEFGROUPS="adm,dialout,cdrom,floppy,audio,dip,video" DEFGROUPS="adm,dialout,cdrom,floppy,audio,dip,video"
ADMIN_USERNAME="chronosdev" ADMIN_USERNAME="chronosdev"
CRYPTED_PASSWD_FILE="/trunk/src/scripts/shared_user_passwd.txt" CRYPTED_PASSWD_FILE="/trunk/src/scripts/shared_user_passwd.txt"
if [ -f $CRYPTED_PASSWD_FILE ] if [ -f $CRYPTED_PASSWD_FILE ]; then
then
echo "Using password from $CRYPTED_PASSWD_FILE" echo "Using password from $CRYPTED_PASSWD_FILE"
CRYPTED_PASSWD=$(cat $CRYPTED_PASSWD_FILE) CRYPTED_PASSWD=$(cat $CRYPTED_PASSWD_FILE)
else else
@ -37,8 +42,7 @@ fi
# Set CHROMEOS_VERSION_DESCRIPTION here (uses vars set in chromeos_version.sh) # Set CHROMEOS_VERSION_DESCRIPTION here (uses vars set in chromeos_version.sh)
# Was removed from chromeos_version.sh which can also be run outside of chroot # Was removed from chromeos_version.sh which can also be run outside of chroot
# where CHROMEOS_REVISION is set # where CHROMEOS_REVISION is set
if [ ${CHROMEOS_OFFICIAL:-0} = 1 ] if [ ${CHROMEOS_OFFICIAL:-0} = 1 ]; then
then
export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Official Build ${CHROMEOS_REVISION:?})" export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Official Build ${CHROMEOS_REVISION:?})"
else else
export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Developer Build - $(date)-$USER)" export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Developer Build - $(date)-$USER)"
@ -64,13 +68,6 @@ CHROMEOS_AUSERVER=$CHROMEOS_VERSION_AUSERVER
CHROMEOS_DEVSERVER=$CHROMEOS_VERSION_DEVSERVER CHROMEOS_DEVSERVER=$CHROMEOS_VERSION_DEVSERVER
EOF EOF
# Set the default X11 cursor theme to inherit our cursors.
mkdir -p /usr/share/icons/default
cat <<EOF > /usr/share/icons/default/index.theme
[Icon Theme]
Inherits=chromeos-cursors
EOF
# Turn user metrics logging on for official builds only. # Turn user metrics logging on for official builds only.
if [ ${CHROMEOS_OFFICIAL:-0} -eq 1 ]; then if [ ${CHROMEOS_OFFICIAL:-0} -eq 1 ]; then
touch /etc/send_metrics touch /etc/send_metrics
@ -91,93 +88,24 @@ sudo mkdir -p "$ROOTFS_DIR"/mnt/stateful_partition
sudo chmod 0755 "$ROOTFS_DIR"/mnt sudo chmod 0755 "$ROOTFS_DIR"/mnt
sudo chmod 0755 "$ROOTFS_DIR"/mnt/stateful_partition sudo chmod 0755 "$ROOTFS_DIR"/mnt/stateful_partition
# If we don't create generic udev rules, then udev will try to save the # Copy everything from the rootfs_static_data directory to the corresponding
# history of various devices (i.e. always associate a given device and MAC # place on the filesystem. Note that this step has to occur after we've
# address with the same wlan number). As we use a keyfob across different # installed all of the packages but before we remove the setup dir.
# machines the ethN and wlanN keep changing. chmod -R a+rX "${SETUP_DIR}/rootfs_static_data/."
cat <<EOF >> /etc/udev/rules.d/70-persistent-net.rules cp -r "${SETUP_DIR}/rootfs_static_data/common/." /
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # TODO: Copy additional target-platform-specific subdirectories.
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
EOF
# Fix issue where alsa-base (dependency of alsa-utils) is messing up our sound # Fix issue where alsa-base (dependency of alsa-utils) is messing up our sound
# drivers. The stock modprobe settings worked fine. # drivers. The stock modprobe settings worked fine.
# TODO: Revisit when we have decided on how sound will work on chromeos. # TODO: Revisit when we have decided on how sound will work on chromeos.
rm /etc/modprobe.d/alsa-base.conf rm /etc/modprobe.d/alsa-base.conf
# -- Remove unneeded fonts and set default gtk font -- # Remove unneeded fonts.
UNNEEDED_FONTS_TYPES=$(ls -d /usr/share/fonts/* | grep -v truetype) UNNEEDED_FONTS_TYPES=$(ls -d /usr/share/fonts/* | grep -v truetype)
UNNEEDED_TRUETYPE_FONTS=$(ls -d /usr/share/fonts/truetype/* | grep -v ttf-droid) UNNEEDED_TRUETYPE_FONTS=$(ls -d /usr/share/fonts/truetype/* | grep -v ttf-droid)
for i in $UNNEEDED_FONTS_TYPES $UNNEEDED_TRUETYPE_FONTS for i in $UNNEEDED_FONTS_TYPES $UNNEEDED_TRUETYPE_FONTS; do
do
rm -rf "$i" rm -rf "$i"
done done
# set default gtk font:
cat <<EOF > /etc/gtk-2.0/gtkrc
gtk-font-name="DroidSans 8"
EOF
# -- Some boot performance customizations --
# Setup our xorg.conf. This allows us to avoid HAL overhead.
# TODO: Per-device xorg.conf rather than in this script.
cat <<EOF > /etc/X11/xorg.conf
Section "ServerFlags"
Option "AutoAddDevices" "false"
Option "DontZap" "false"
EndSection
Section "InputDevice"
Identifier "Keyboard1"
Driver "kbd"
Option "AutoRepeat" "250 30"
Option "XkbRules" "xorg"
Option "XkbModel" "pc104"
Option "CoreKeyboard"
EndSection
Section "InputDevice"
Identifier "Mouse1"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Protocol" "auto-dev"
Option "SHMConfig" "on"
Option "CorePointer"
Option "MinSpeed" "0.2"
Option "MaxSpeed" "0.5"
Option "AccelFactor" "0.002"
Option "HorizScrollDelta" "100"
Option "VertScrollDelta" "100"
Option "HorizEdgeScroll" "0"
Option "VertEdgeScroll" "1"
Option "TapButton1" "1"
Option "TapButton2" "2"
Option "MaxTapTime" "180"
Option "FingerLow" "24"
Option "FingerHigh" "50"
EndSection
# Everything after this point was added to include support for USB as a
# secondary mouse device.
Section "InputDevice"
Identifier "USBMouse"
Driver "mouse"
Option "Device" "/dev/input/mice" # multiplexed HID mouse input device
Option "Protocol" "IMPS/2"
Option "ZAxisMapping" "4 5" # support a wheel as buttons 4 and 5
Option "Emulate3Buttons" "true" # just in case it is a 2 button
EndSection
# Defines a non-default server layout which pulls in the USB Mouse as a
# secondary input device.
Section "ServerLayout"
Identifier "DefaultLayout"
# Screen "DefaultScreen"
InputDevice "Mouse1" "CorePointer"
InputDevice "USBMouse" "AlwaysCore"
InputDevice "Keyboard1" "CoreKeyboard"
EndSection
EOF
# The udev daemon takes a long time to start up and settle so we defer it until # The udev daemon takes a long time to start up and settle so we defer it until
# after X11 has been started. In order to be able to mount the root file system # after X11 has been started. In order to be able to mount the root file system