mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-29 14:16:31 +00:00
added pigz/unpigz support
This commit is contained in:
parent
c1f26915fc
commit
7272504004
3
build.sh
3
build.sh
@ -11,6 +11,7 @@ board=$1
|
|||||||
target=${*:2}
|
target=${*:2}
|
||||||
cd $(dirname $0)
|
cd $(dirname $0)
|
||||||
basedir=$(pwd)
|
basedir=$(pwd)
|
||||||
|
gzip=$(which pigz || which gzip)
|
||||||
|
|
||||||
if [ "$board" == "all" ]; then
|
if [ "$board" == "all" ]; then
|
||||||
boards=$(ls $basedir/configs/*_defconfig | grep -oE '\w+_defconfig$' | cut -d '_' -f 1)
|
boards=$(ls $basedir/configs/*_defconfig | grep -oE '\w+_defconfig$' | cut -d '_' -f 1)
|
||||||
@ -45,7 +46,7 @@ elif [ "$target" == "mkrelease" ]; then
|
|||||||
date=$(date +%Y%m%d)
|
date=$(date +%Y%m%d)
|
||||||
mv $basedir/motioneyeos-$board.img $basedir/motioneyeos-$board-$date.img
|
mv $basedir/motioneyeos-$board.img $basedir/motioneyeos-$board-$date.img
|
||||||
rm -f $basedir/motioneyeos-$board-$date.img.gz
|
rm -f $basedir/motioneyeos-$board-$date.img.gz
|
||||||
gzip $basedir/motioneyeos-$board-$date.img
|
$gzip $basedir/motioneyeos-$board-$date.img
|
||||||
elif [ -n "$target" ]; then
|
elif [ -n "$target" ]; then
|
||||||
make O=$outputdir $target
|
make O=$outputdir $target
|
||||||
else
|
else
|
||||||
|
@ -5,7 +5,7 @@ function usage() {
|
|||||||
echo "Usage: $0 [options...]" 1>&2
|
echo "Usage: $0 [options...]" 1>&2
|
||||||
echo ""
|
echo ""
|
||||||
echo "Available options:"
|
echo "Available options:"
|
||||||
echo " <-i image_file> - indicates the path to the image file (e.g. -i /home/user/Download/motioneyeos.img.gz)"
|
echo " <-i image_file> - indicates the path to the image file (e.g. -i /home/user/Download/file.img.gz)"
|
||||||
echo " <-d sdcard_dev> - indicates the path to the sdcard block device (e.g. -d /dev/mmcblk0)"
|
echo " <-d sdcard_dev> - indicates the path to the sdcard block device (e.g. -d /dev/mmcblk0)"
|
||||||
echo " [-n ssid:psk] - sets the wireless network name and key (e.g. -n mynet:mykey1234)"
|
echo " [-n ssid:psk] - sets the wireless network name and key (e.g. -n mynet:mykey1234)"
|
||||||
echo " [-s ip/cidr:gw:dns] - sets a static IP configuration instead of DHCP (e.g. -s 192.168.1.101/24:192.168.1.1:8.8.8.8)"
|
echo " [-s ip/cidr:gw:dns] - sets a static IP configuration instead of DHCP (e.g. -s 192.168.1.101/24:192.168.1.1:8.8.8.8)"
|
||||||
@ -16,7 +16,7 @@ if [ -z "$1" ]; then
|
|||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $(id -u) -ne 0 ]]; then echo "Please run as root"; exit 1; fi
|
if [[ $(id -u) -ne 0 ]]; then echo "please run as root"; exit 1; fi
|
||||||
|
|
||||||
function msg() {
|
function msg() {
|
||||||
echo ":: $1"
|
echo ":: $1"
|
||||||
@ -68,9 +68,11 @@ if ! [ -f $DISK_IMG ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
gunzip=$(which unpigz || which gunzip)
|
||||||
|
|
||||||
if [[ $DISK_IMG == *.gz ]]; then
|
if [[ $DISK_IMG == *.gz ]]; then
|
||||||
msg "decompressing the gzipped image"
|
msg "decompressing the gzipped image"
|
||||||
gunzip -c $DISK_IMG > ${DISK_IMG::-3}
|
$gunzip -c $DISK_IMG > ${DISK_IMG::-3}
|
||||||
DISK_IMG=${DISK_IMG::-3}
|
DISK_IMG=${DISK_IMG::-3}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user