This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding files to support command line testing of image creation
Adding the below listed files for successful image creation and testing on command line with make Signed-off-by: Vinay Potluri <[email protected]>
- Loading branch information
1 parent
76798d7
commit 5e16347
Showing
5 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# This is a finalize script that is run by clr-distro-factory to support | ||
# user's requirement for conversion / compression of images before exporting. | ||
# ex: <image_name>-finalize.sh | ||
|
||
set -e | ||
|
||
SCRIPT_DIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") | ||
|
||
if (( ${#} != 1 )); then | ||
echo "${0}: Must receive exactly one file path." >&2 | ||
exit 1 | ||
fi | ||
|
||
if [[ ! -s "${1}" ]]; then | ||
echo "${0}: Invalid input: '${1}' is empty." >&2 | ||
exit 1 | ||
fi | ||
|
||
file_ext="${1##*.}" | ||
|
||
if [[ "${file_ext}" == "iso" ]]; then | ||
echo "${1}" | ||
else | ||
"${SCRIPT_DIR}/task-compress-image.sh" "${1}" "${1}.xz" >&2 | ||
rm -rf "${1}" >&2 | ||
echo "${1}.xz" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# This is a post install script that is run from the config after the image | ||
# has been created by clr-installer for images with special requirements | ||
# ex: <image_name>-post.sh | ||
|
||
set -e | ||
|
||
SCRIPT_DIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") | ||
|
||
# Delay booting to give user a change to change boot params | ||
"${SCRIPT_DIR}"/task-wait-to-boot.sh "${1}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# This is a task script that can be executed to perform specific tasks | ||
# which are common between various images. | ||
# Task scripts can be called commonly from post & finalize scripts. | ||
# ex: task-<job_name>.sh | ||
|
||
set -e | ||
|
||
if (( ${#} < 1 )); then | ||
echo "${0}: Insufficient number of arguments." >&2 | ||
exit 1 | ||
fi | ||
|
||
if ! xz -q -T0 --stdout "${1}" > "${2:-${1}.xz}"; then | ||
echo "${0}: Unable to compress file ${1}." >&2 | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# This is a task script that can be executed to perform specific tasks | ||
# which are common between various images. | ||
# Task scripts can be called commonly from post & finalize scripts. | ||
# ex: task-<job_name>.sh | ||
|
||
#!/bin/bash | ||
|
||
# Have the installer image wait 5 seconds before launch | ||
# Useful for users to change the boot command for debug | ||
|
||
echo "timeout 5" >> "${1}/boot/loader/loader.conf" | ||
|
||
exit 0 |