make_netboot: Revise to work with Depthcharge.
The 'make_netboot.sh' was designed for U-Boot, but all active projects
today are all using depthcharge. So, it should be safe to deprecate the
U-Boot logic:
- The firmware name should be image.net.bin (Depthcharge) instead of
nv_image*.bin (U-Boot style)
- The copied kernel should be named as "vmlinuz", by Depthcharge's
default configuration.
BUG=None
TEST=./make_netboot.sh --board gale;
boot vmlinuz image.
Change-Id: I7a98045873030ae3c7ff53b158b02f9d024f655e
Reviewed-on: https://chromium-review.googlesource.com/411586
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Wei-Han Chen <stimim@chromium.org>
diff --git a/make_netboot.sh b/make_netboot.sh
index 63f6420..c7734fe 100755
--- a/make_netboot.sh
+++ b/make_netboot.sh
@@ -43,16 +43,12 @@
mkdir -p netboot
# Get netboot firmware.
-# TODO(nsanders): Set default IP here when userspace
-# env modification is available.
-# TODO(nsanders): ARM generic doesn't build chromeos-u-boot package.
-# When ARM generic goes away, delete the test.
-if ls "${SYSROOT}"/firmware/nv_image-*.bin >/dev/null 2>&1; then
- echo "Copying netboot firmware nv_image-*.bin"
- cp -v "${SYSROOT}"/firmware/nv_image-*.bin "netboot"
+FIRMWARE_PATH="/firmware/image.net.bin"
+if [ -f "${SYSROOT}${FIRMWARE_PATH}" ]; then
+ echo "Copying netboot firmware ${FIRMWARE_PATH}..."
+ cp -v "${SYSROOT}${FIRMWARE_PATH}" netboot/
else
- echo "Skipping netboot firmware: " \
- "${SYSROOT}/firmware/nv_image-*.bin not present?"
+ echo "Skipping netboot firmware: ${SYSROOT}${FIRMWARE_PATH} not present?"
fi
# Create temporary emerge root
@@ -69,17 +65,12 @@
emerge_custom_kernel ${temp_build_path}
# Place kernel image under 'netboot'
-echo "Generating netboot kernel vmlinux.uimg/vmlinux.bin"
-if [ "${ARCH}" = "arm" ]; then
- cp "${temp_build_path}"/boot/vmlinux.uimg netboot/
- cp netboot/vmlinux.uimg netboot/vmlinux.bin
+KERNEL_PATH="/boot/vmlinuz"
+if [ -f "${temp_build_path}${KERNEL_PATH}" ]; then
+ echo "Generating netboot kernel ${KERNEL_PATH}"
+ cp -v "${temp_build_path}${KERNEL_PATH}" netboot/
else
- # 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 x86 -O linux -T kernel -n "Linux kernel" -C none \
- -d "${temp_build_path}"/boot/vmlinuz \
- -a 0x03000000 -e 0x03000000 netboot/vmlinux.uimg
- cp "${temp_build_path}"/boot/vmlinuz netboot/vmlinux.bin
+ echo "No ${KERNEL_PATH} found in your board."
fi
sudo rm -rf "${temp_build_path}"