aboutsummaryrefslogtreecommitdiffstats
path: root/INSTALL
diff options
context:
space:
mode:
Diffstat (limited to 'INSTALL')
-rw-r--r--INSTALL/common.d/10_base11
-rwxr-xr-xINSTALL/tools/scripts_yocto/mksdcard17
2 files changed, 23 insertions, 5 deletions
diff --git a/INSTALL/common.d/10_base b/INSTALL/common.d/10_base
index e429e65..5cff36b 100644
--- a/INSTALL/common.d/10_base
+++ b/INSTALL/common.d/10_base
@@ -1,5 +1,16 @@
#!/bin/bash
+# set bash as default shell for /bin/sh
+diverter=$(dpkg-divert --listpackage /bin/sh)
+[[ "$diverter" == "dash" ]] && {
+ # inspired by dash postinstall
+ dpkg-divert --package dash --remove /bin/sh
+ dpkg-divert --package bash --divert /bin/sh.distrib --add /bin/sh
+ [[ -e /bin/sh ]] && cp -dp /bin/sh /bin/sh.distrib
+ ln -sf bash /bin/sh.tmp
+ mv -f /bin/sh.tmp /bin/sh
+}
+
# add backports and testing repositories
echo "deb http://http.debian.net/debian jessie-backports main contrib" >>/etc/apt/sources.list
diff --git a/INSTALL/tools/scripts_yocto/mksdcard b/INSTALL/tools/scripts_yocto/mksdcard
index 306ec87..c895f3d 100755
--- a/INSTALL/tools/scripts_yocto/mksdcard
+++ b/INSTALL/tools/scripts_yocto/mksdcard
@@ -19,22 +19,29 @@
set -e
usage() {
- echo "Usage: $0 <image .rootfs.tar.bz2> <output image file or dir> [size in GB]" >&2
+ echo "Usage: $0 <image.rootfs.tar.*> [output_file_or_dir [size_in_GB]]" >&2
echo "<image tarball> is usually located in \$builddir/tmp/deploy/images" >&2
exit 1
}
IMGTAR=$1
-[[ ! -f $IMGTAR ]] && { echo "Invalid image archive" >&2; usage; }
+[[ ! -f $IMGTAR ]] && { echo "Image file not found." >&2; usage; }
-OUTPUT=$2
+if [[ $IMGTAR =~ ^.*\.(rootfs.tar\..*)$ ]]; then
+ ext=${BASH_REMATCH[1]}
+ IMGBASE=$(basename $IMGTAR .$ext)
+else
+ echo "Invalid image archive (not a tarball?)" >&2; usage;
+fi
+
+OUTPUT=${2:-.}
if [[ -z $OUTPUT ]]; then
echo "Invalid output file/dir." >&2
usage
elif [[ -d $OUTPUT ]]; then
# output is a dir, use input file for name
- OUTPUT=$OUTPUT/$(basename $IMGTAR .rootfs.tar.bz2).raw
+ OUTPUT=$OUTPUT/$IMGBASE.raw
fi
@@ -76,7 +83,7 @@ make_image() {
sudo mkdir $tmpd
sudo mount $loop $tmpd
echo "Extracting image tarball..."
- sudo tar pjxf $imgtar -C $tmpd --xattrs-include='*'
+ sudo tar pxf $imgtar -C $tmpd --xattrs-include='*'
echo "Detected machine $machine"
case $machine in
porter)