diff options
Diffstat (limited to 'projects/cros-scripts/install')
-rwxr-xr-x | projects/cros-scripts/install/cros-kernel-prepare | 13 | ||||
-rwxr-xr-x | projects/cros-scripts/install/cros-medium-setup | 13 |
2 files changed, 15 insertions, 11 deletions
diff --git a/projects/cros-scripts/install/cros-kernel-prepare b/projects/cros-scripts/install/cros-kernel-prepare index 00f90234..1af05bd2 100755 --- a/projects/cros-scripts/install/cros-kernel-prepare +++ b/projects/cros-scripts/install/cros-kernel-prepare @@ -21,9 +21,10 @@ VBPUBK="vbpubk" ARCH="arch" CMDLINE="cmdline" BOOTLOADER="bootloader" -KERNEL_ITS="kernel.its" -KERNEL_FIT="kernel.fit" -KERNEL_IMAGE="kernel.img" +KERNEL="kernel" +ITS="its" +FIT="fit" +IMG="img" usage() { printf "$executable [action] [kernel files|kernel image] [medium]\n" >&2 @@ -51,9 +52,9 @@ pack() { local arch=$( cat "$arch_path" ) local cmdline_path="$kernel_files_path/$CMDLINE-$medium" local bootloader_path="$kernel_files_path/$BOOTLOADER" - local kernel_its_path="$kernel_files_path/$KERNEL_ITS" - local kernel_fit_path="$kernel_files_path/$KERNEL_FIT" - local kernel_image_path="$kernel_files_path/$KERNEL_IMAGE" + local kernel_its_path="$kernel_files_path/$KERNEL.$ITS" + local kernel_fit_path="$kernel_files_path/$KERNEL.$FIT" + local kernel_image_path="$kernel_files_path/$KERNEL-$medium.$IMG" mkimage -f "$kernel_its_path" "$kernel_fit_path" futility vbutil_kernel --pack "$kernel_image_path" --version 1 --arch "$arch" --keyblock "$VBOOT_KEYS_PATH/kernel.$KEYBLOCK" --signprivate "$VBOOT_KEYS_PATH/kernel_data_key.$VBPRIVK" --config "$cmdline_path" --vmlinuz "$kernel_fit_path" --bootloader "$bootloader_path" diff --git a/projects/cros-scripts/install/cros-medium-setup b/projects/cros-scripts/install/cros-medium-setup index 1f8c956b..ffb4d894 100755 --- a/projects/cros-scripts/install/cros-medium-setup +++ b/projects/cros-scripts/install/cros-medium-setup @@ -21,7 +21,8 @@ DEVICE="device" VENDOR="vendor" MODEL="model" NAME="name" -KERNEL_IMAGE="kernel.img" +KERNEL="kernel" +IMG="img" KERNEL_MODULES="modules/lib" KERNEL_PARTITION_INDEX=1 ROOTFS_PARTITION_INDEX=2 @@ -31,7 +32,7 @@ GPT_SIZE=34 KERNEL_SIZE=16384 usage() { - printf "$executable [action] [storage] [rootfs tarball|kernel files]\n" >&2 + printf "$executable [action] [storage] [rootfs tarball|kernel files] [medium]\n" >&2 printf "\nActions:\n" >&2 printf " partitions - Setup partitions on storage\n" >&2 @@ -206,10 +207,11 @@ rootfs() { kernel() { local storage_path=$1 local kernel_files_path=$2 + local medium=$3 local storage_kernel_path=$( storage_partition_path "$storage_path" "$KERNEL_PARTITION_INDEX" ) local storage_rootfs_path=$( storage_partition_path "$storage_path" "$ROOTFS_PARTITION_INDEX" ) - local kernel_image_path="$kernel_files_path/$KERNEL_IMAGE" + local kernel_image_path="$kernel_files_path/$KERNEL-$medium.$IMG" local kernel_modules_path="$kernel_files_path/$KERNEL_MODULES" local storage_rootfs_mount_path @@ -267,6 +269,7 @@ cros_medium_setup() { local storage_path=$2 local rootfs_tarball_path=$3 local kernel_files_path=$3 + local medium=$4 set -e @@ -294,14 +297,14 @@ cros_medium_setup() { rootfs "$storage_path" "$rootfs_tarball_path" ;; "kernel") - if [ -z "$kernel_files_path" ] + if [ -z "$kernel_files_path" ] || [ -z "$medium" ] then usage exit 1 fi requirements "udisksctl" "rsync" - kernel "$storage_path" "$kernel_files_path" + kernel "$storage_path" "$kernel_files_path" "$medium" ;; *) usage |