Change-Id: Ic738cc7ec486a4d565d26feeead6c419e424cac5
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
# Syntax is:
# * install_iserial $ID $IMAGE_MOUNTPOINT
+# * unpack_image $IMAGE... $IMAGE_UNPACKED
#
# Author: Aleksander Mistewicz <a.mistewicz@samsung.com>
sudo ln -s /usr/lib/systemd/system/iserial.service \
"${IMAGE_MOUNTPOINT}/etc/systemd/system/multi-user.target.wants/iserial.service"
}
+
+unpack_image() {
+ test $# -ge 2 || die "Too few arguments!"
+ eval DESTINATION=\$$#
+ test -d "${DESTINATION}" || mkdir -p "${DESTINATION}"
+
+ while [ $# -ge 2 ]; do
+ IMAGE="$1"
+ test -f "${IMAGE}" || die "The image does not exist or is not a regular file: ${IMAGE}!"
+ tar xvf "${IMAGE}" -C "${DESTINATION}" || die "tar: extracting files from archive failed!"
+ shift
+ done
+}