From 2995760db483205ffb74561cef2b2b182dc2a819 Mon Sep 17 00:00:00 2001 From: ading2210 Date: Wed, 20 Dec 2023 22:09:41 -0800 Subject: [PATCH] better naming for build utils --- build.sh | 3 +-- build_image.sh => image_utils.sh | 14 +++++++++----- patch_initramfs.sh | 17 ----------------- 3 files changed, 10 insertions(+), 24 deletions(-) rename build_image.sh => image_utils.sh (94%) delete mode 100755 patch_initramfs.sh diff --git a/build.sh b/build.sh index 920e1ae..22aad82 100755 --- a/build.sh +++ b/build.sh @@ -7,8 +7,7 @@ if [ "$DEBUG" ]; then set -x fi -. ./patch_initramfs.sh -. ./build_image.sh +. ./image_utils.sh . ./shim_utils.sh print_help() { diff --git a/build_image.sh b/image_utils.sh similarity index 94% rename from build_image.sh rename to image_utils.sh index 5dcf7ef..76b0122 100755 --- a/build_image.sh +++ b/image_utils.sh @@ -1,10 +1,5 @@ #!/bin/bash -set -e -if [ "$DEBUG" ]; then - set -x -fi - create_loop() { local loop_device=$(losetup -f) losetup -P $loop_device "${1}" @@ -128,4 +123,13 @@ create_image() { fallocate -l "${total_size}M" "${image_path}" partition_disk $image_path $bootloader_size +} + +patch_initramfs() { + local initramfs_path=$(realpath $1) + + rm "${initramfs_path}/init" -f + cp -r bootloader/* "${initramfs_path}/" + + find ${initramfs_path}/bin -name "*" -exec chmod +x {} \; } \ No newline at end of file diff --git a/patch_initramfs.sh b/patch_initramfs.sh deleted file mode 100755 index 7d0cf01..0000000 --- a/patch_initramfs.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -#patch the shim initramfs to add the bootloader - -set -e -if [ "$DEBUG" ]; then - set -x -fi - -patch_initramfs() { - local initramfs_path=$(realpath $1) - - rm "${initramfs_path}/init" -f - cp -r bootloader/* "${initramfs_path}/" - - find ${initramfs_path}/bin -name "*" -exec chmod +x {} \; -}