Clean-up of extlinux and dd preparing for ext4

BUG=chromium-os:14756
TEST=ran it on cr48 and Latitiude 13

Change-Id: I3c46337f0e4741786ec980100cdebc24fdc02ef9
Reviewed-on: http://gerrit.chromium.org/gerrit/3093
Reviewed-by: Paul Taysom <taysom@google.com>
Tested-by: Paul Taysom <taysom@google.com>
This commit is contained in:
Paul Taysom 2011-06-22 16:49:35 -07:00
parent 93b6effb0b
commit 0737a550b9
2 changed files with 2 additions and 31 deletions

View File

@ -1,4 +1,3 @@
#!/bin/bash
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved. # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
@ -574,8 +573,9 @@ zero_free_space() {
info "Zeroing freespace in ${fs_mount_point}" info "Zeroing freespace in ${fs_mount_point}"
# dd is a silly thing and will produce a "No space left on device" message # dd is a silly thing and will produce a "No space left on device" message
# that cannot be turned off and is confusing to unsuspecting victims. # that cannot be turned off and is confusing to unsuspecting victims.
( sudo dd if=/dev/zero of="${fs_mount_point}/filler" oflag=sync bs=4096 \ ( sudo dd if=/dev/zero of="${fs_mount_point}/filler" bs=4096 \
|| true ) 2>&1 |grep -v "No space left on device" || true ) 2>&1 |grep -v "No space left on device"
sudo sync
sudo rm -f "${fs_mount_point}/filler" sudo rm -f "${fs_mount_point}/filler"
sudo sync sudo sync
} }
@ -709,7 +709,6 @@ create_base_image() {
--arch=${ARCH} \ --arch=${ARCH} \
--to="${ROOT_FS_DIR}"/boot \ --to="${ROOT_FS_DIR}"/boot \
--boot_args="${FLAGS_boot_args}" \ --boot_args="${FLAGS_boot_args}" \
--install \
${enable_rootfs_verification} ${enable_rootfs_verification}
# Don't test the factory install shim # Don't test the factory install shim

View File

@ -32,9 +32,6 @@ get_default_board
# Flags. # Flags.
DEFINE_string arch "x86" \ DEFINE_string arch "x86" \
"The boot architecture: arm or x86. (Default: x86)" "The boot architecture: arm or x86. (Default: x86)"
# TODO(wad) once extlinux is dead, we can remove this.
DEFINE_boolean install ${FLAGS_FALSE} \
"Controls whether extlinux is run on 'to'. (Default: false)"
DEFINE_string to "/tmp/boot" \ DEFINE_string to "/tmp/boot" \
"Path to populate with bootloader templates (Default: /tmp/boot)" "Path to populate with bootloader templates (Default: /tmp/boot)"
DEFINE_string usb_disk /dev/sdb3 \ DEFINE_string usb_disk /dev/sdb3 \
@ -74,35 +71,10 @@ verity_common="${verity_common} dm_verity.dev_wait=${dev_wait}"
# Populate the x86 rootfs to support legacy and EFI bios config templates. # Populate the x86 rootfs to support legacy and EFI bios config templates.
# The templates are used by the installer to populate partition 12 with # The templates are used by the installer to populate partition 12 with
# the correct bootloader configuration. # the correct bootloader configuration.
# While we transition to that model, extlinux.conf will still be used
# on the root filesystem.
if [[ "${FLAGS_arch}" == "x86" ]]; then if [[ "${FLAGS_arch}" == "x86" ]]; then
# Setup extlinux configuration.
# TODO: For some reason the /dev/disk/by-uuid is not being generated by udev # TODO: For some reason the /dev/disk/by-uuid is not being generated by udev
# in the initramfs. When we figure that out, switch to root=UUID=${UUID}. # in the initramfs. When we figure that out, switch to root=UUID=${UUID}.
sudo mkdir -p ${FLAGS_to} sudo mkdir -p ${FLAGS_to}
# TODO(adlr): use initramfs for booting.
cat <<EOF | sudo dd of="${FLAGS_to}"/extlinux.conf 2>/dev/null
DEFAULT chromeos-usb
PROMPT 0
TIMEOUT 0
label chromeos-usb
menu label chromeos-usb
kernel vmlinuz
append ${common_args} root=/dev/sdb3 i915.modeset=1 cros_legacy
label chromeos-hd
menu label chromeos-hd
kernel vmlinuz
append ${common_args} root=HDROOT i915.modeset=1 cros_legacy
EOF
# Make partition bootable and label it.
# TODO(wad) remove this after we've transitioned everyone to syslinux.
if [[ ${FLAGS_install} -eq ${FLAGS_TRUE} ]]; then
sudo extlinux -z --install "${FLAGS_to}"
fi
# /boot/syslinux must be installed in partition 12 as /syslinux/. # /boot/syslinux must be installed in partition 12 as /syslinux/.
SYSLINUX_DIR="${FLAGS_to}/syslinux" SYSLINUX_DIR="${FLAGS_to}/syslinux"