diff --git a/build_image b/build_image index f155bf9413..d55ef34bae 100755 --- a/build_image +++ b/build_image @@ -125,17 +125,11 @@ if should_build_image ${CHROMEOS_FACTORY_INSTALL_SHIM_NAME}; then BASE_PACKAGE="chromeos-base/chromeos-installshim" - # On x86/amd64, we boot the factory install shim from an SD card using - # initramfs for our root. On ARM, we boot the factory install shim over the - # network, so we don't require initramfs, but we do require fbconsole to fix - # a display driver bug. - if [ "${ARCH}" = "x86" -o "${ARCH}" = "amd64" ] ; then - export USE="${USE} initramfs vfat" - fi - # CONFIG_BLK_DEV_RAM is disabled by default. - # But tftp install needs it to mount rootfs in ram + export USE="${USE} initramfs vfat" + + # On ARM, fbconsole is required to fix a display driver bug. if [ "${ARCH}" = "arm" ] ; then - export USE="${USE} fbconsole blkdevram" + export USE="${USE} fbconsole" fi fi diff --git a/make_netboot.sh b/make_netboot.sh index d7a0fd15b0..08416943d1 100755 --- a/make_netboot.sh +++ b/make_netboot.sh @@ -94,44 +94,40 @@ else fi # Get netboot kernel. +echo "Building kernel" + +# Create temporary emerge root +temp_build_path="$(mktemp -d bk_XXXXXXXX)" +if ! [ -d "${temp_build_path}" ]; then + echo "Failed to create temporary directory." + exit 1 +fi + +# Emerge network boot kernel +# We don't want to build whole install shim everytime we run this script, +# and thus we only build kernel here. If this script is run against install +# shim with different kernel version, this might not work. But as we don't +# upgrade kernel so often, this is probably fine. +export USE='vfat blkdevram fbconsole' +export EMERGE_BOARD_CMD="emerge-${FLAGS_board}" +emerge_custom_kernel ${temp_build_path} + +# Generate kernel uImage +echo "Generating netboot kernel vmlinux.uimg" + if [ "${ARCH}" = "arm" ]; then - # Currently we don't use initramfs for ARM. Someday we would probably want - # initramfs for USB factory installation. - # TODO: Converge build processes of ARM and x86. - echo "Generating netboot kernel vmlinux.uimg" - cp "r/boot/vmlinux.uimg" "netboot" + cp "${temp_build_path}"/boot/vmlinux.uimg netboot/ else - echo "Building kernel" - - # Create temporary emerge root - temp_build_path="$(mktemp -d bk_XXXXXXXX)" - if ! [ -d "${temp_build_path}" ]; then - echo "Failed to create temporary directory." - exit 1 - fi - - # Emerge network boot kernel - # We don't want to build whole install shim everytime we run this script, - # and thus we only build kernel here. If this script is run against install - # shim with different kernel version, this might not work. But as we don't - # upgrade kernel so often, this is probably fine. - export USE='vfat blkdevram fbconsole' - export EMERGE_BOARD_CMD="emerge-${FLAGS_board}" - emerge_custom_kernel ${temp_build_path} - - # Generate kernel uImage - echo "Generating netboot kernel vmlinux.uimg" - # U-boot put kernel image at 0x100000. We load it at 0x3000000 because # 0x3000000 is safe enough not to overlap with image at 0x100000. mkimage -A "${MKIMAGE_ARCH}" -O linux -T kernel -n "Linux kernel" -C none \ -d "${temp_build_path}"/boot/vmlinuz \ -a 0x03000000 -e 0x03000000 netboot/vmlinux.uimg - - # Clean up temporary emerge root - sudo rm -rf "${temp_build_path}" fi +# Clean up temporary emerge root +sudo rm -rf "${temp_build_path}" + echo "Add lsb-factory" # Copy factory config file. # TODO(nsanders): switch this to u-boot env var config.