summaryrefslogtreecommitdiff
path: root/buildlive
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2016-07-04 17:34:58 +0800
committerIru Cai <mytbk920423@gmail.com>2016-08-02 12:16:59 +0800
commit46a58cb3730000fec238a698ea169cc4d0aa05d7 (patch)
tree67457c14508dbd35d2d125e1abc068c7a6286bca /buildlive
parente9066c5c8c676c3ef6028ed4e16b2e723caa1a58 (diff)
downloadliveusb-builder-46a58cb3730000fec238a698ea169cc4d0aa05d7.tar.xz
main buildlive scripts
Diffstat (limited to 'buildlive')
-rwxr-xr-xbuildlive69
1 files changed, 69 insertions, 0 deletions
diff --git a/buildlive b/buildlive
new file mode 100755
index 0000000..757c51a
--- /dev/null
+++ b/buildlive
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+set -e
+
+DISTROLIST=()
+ROOTPATH=
+DEVNAME=
+
+. functions.sh
+
+msg() {
+ echo -e "$1" >&2
+}
+
+errmsg() {
+ msg "\x1b[1;31m$1\x1b[0m"
+}
+
+usage() {
+ msg "$0 --root=<rootpath> --dev=<devname> [distro 1] [distro 2] ..."
+}
+
+while [[ -n "$1" ]]
+do
+ case "$1" in
+ --root=*)
+ ROOTPATH=${1/--root=}
+ msg "Files will be copy to $ROOTPATH"
+ ;;
+ --dev=*)
+ DEVNAME=${1/--dev=}
+ msg "Boot sector will be written to $DEVNAME"
+ ;;
+ *=*)
+ usage
+ exit 1
+ ;;
+ *)
+ if [ -d "distro/$1" ]
+ then
+ DISTROLIST=(${DISTROLIST[@]} "$1")
+ else
+ errmsg "directory distro/$1 not found"
+ exit 1
+ fi
+ ;;
+ esac
+ shift
+done
+
+for i in ${DISTROLIST[@]}
+do
+ process_distro "$i"
+ if [ -f "isofiles/$ISOFILE" ]; then
+ CKSUM=$(sha256sum "isofiles/$ISOFILE" | cut -d' ' -f1)
+ if [[ $CKSUM == $SHA256 ]]; then
+ msg "$ISOFILE ok."
+ else
+ errmsg "$ISOFILE checksum bad!"
+ exit 1
+ fi
+ else
+ errmsg "File isofiles/$ISOFILE not found!"
+ exit 1
+ fi
+
+ install
+done
+