Allow custom image filename
This commit is contained in:
parent
7fbfdda31e
commit
08405eb792
1
build.sh
1
build.sh
|
@ -144,6 +144,7 @@ fi
|
||||||
|
|
||||||
export USE_QEMU="${USE_QEMU:-0}"
|
export USE_QEMU="${USE_QEMU:-0}"
|
||||||
export IMG_DATE="${IMG_DATE:-"$(date +%Y-%m-%d)"}"
|
export IMG_DATE="${IMG_DATE:-"$(date +%Y-%m-%d)"}"
|
||||||
|
export IMG_FILENAME="${IMG_FILENAME:-"${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}"}"
|
||||||
|
|
||||||
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
export SCRIPT_DIR="${BASE_DIR}/scripts"
|
export SCRIPT_DIR="${BASE_DIR}/scripts"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
IMG_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img"
|
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}.img"
|
||||||
|
|
||||||
IMGID="$(dd if="${IMG_FILE}" skip=440 bs=1 count=4 2>/dev/null | xxd -e | cut -f 2 -d' ')"
|
IMGID="$(dd if="${IMG_FILE}" skip=440 bs=1 count=4 2>/dev/null | xxd -e | cut -f 2 -d' ')"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
IMG_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img"
|
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}.img"
|
||||||
INFO_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.info"
|
INFO_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}.info"
|
||||||
|
|
||||||
on_chroot << EOF
|
on_chroot << EOF
|
||||||
/etc/init.d/fake-hwclock stop
|
/etc/init.d/fake-hwclock stop
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
IMG_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img"
|
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}.img"
|
||||||
|
|
||||||
unmount_image "${IMG_FILE}"
|
unmount_image "${IMG_FILE}"
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
IMG_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img"
|
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}.img"
|
||||||
NOOBS_DIR="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}"
|
NOOBS_DIR="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}"
|
||||||
unmount_image "${IMG_FILE}"
|
unmount_image "${IMG_FILE}"
|
||||||
|
|
||||||
mkdir -p "${STAGE_WORK_DIR}"
|
mkdir -p "${STAGE_WORK_DIR}"
|
||||||
cp "${WORK_DIR}/export-image/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img" "${STAGE_WORK_DIR}/"
|
cp "${WORK_DIR}/export-image/${IMG_FILENAME}.img" "${STAGE_WORK_DIR}/"
|
||||||
|
|
||||||
rm -rf "${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}"
|
rm -rf "${NOOBS_DIR}"
|
||||||
|
|
||||||
PARTED_OUT=$(parted -s "${IMG_FILE}" unit b print)
|
PARTED_OUT=$(parted -s "${IMG_FILE}" unit b print)
|
||||||
BOOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^ 1'| xargs echo -n \
|
BOOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^ 1'| xargs echo -n \
|
||||||
|
|
Loading…
Reference in New Issue
Block a user