New commits:
commit 9e4828438e910a2457a762e0e3d1e0d45c4c75d8
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>
scripts/mksystem.sh: unify opts & usage info
The usage info is being unified across all of the cauldron scripts.
This includes unifying the options a little as well. The
options/arguments may be unified further, so this is not necessarily
final.
commit 2b67af6fbe21917ac87c85ce79e891883df3f487
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>
scripts/mkrelease.sh: unify opts & usage info
The usage info is being unified across all of the cauldron scripts.
This includes unifying the options a little as well. The
options/arguments may be unified further, so this is not necessarily
final.
commit bd0365214f61a8bbe554e27133c3a0d3e2af172f
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>
scripts/mkiso.sh: unify opts & usage info
The usage info is being unified across all of the cauldron scripts.
This includes unifying the options a little as well. The
options/arguments may be unified further, so this is not necessarily
final.
commit ea315235f9364a03053bfb1d4a5e2bd92a75f33a
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>
scripts/cleaniso.sh: unify opts & usage info
The usage info is being unified across all of the cauldron scripts.
This includes unifying the options a little as well. The
options/arguments may be unified further, so this is not necessarily
final.
commit 42447f4b251a7ae3f373fd9faddfa689690e95fb
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>
scripts/cauldronchr.sh: unify opts & usage info
The usage info is being unified across all of the cauldron scripts.
This includes unifying the options a little as well. The
options/arguments may be unified further, so this is not necessarily
final.
commit 7791d39a144ea66655b5748e46e7d23eeb85b4e4
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>
scripts/add-sauce.sh: unify opts & usage info
The usage info is being unified across all of the cauldron scripts.
This includes unifying the options a little as well. The
options/arguments may be unified further, so this is not necessarily
final.
function usage() {
cat << EndUsage
-Usage: $0 [-f] -i|-s /path/to/target
-Adds the cauldron team files to the given chroot
-Use -i for an iso target, -s for the system tarball
+Usage: $(basename $0) [-ofh] -i|-s /path/to/target
+
+Adds the cauldron team files to the given chroot.
+This script requires superuser privileges.
+
+Required:
+ -i Use for "iso" targets
+
+ -s Use for "system" targets
+
+Options:
+ -f Forces the script to add the files to the target directory, even
if
+ that directory is not detected to be a proper chroot environment.
+
+ -o Forces overwriting files in the target directory
+
+ -h Shows this help information
EndUsage
exit 1
} >&2
-while getopts ":fis" Option
+while getopts ":fhios" Option
do
case $Option in
f ) FORCE=true ;;
i ) TYPE="iso" ;;
+ o ) OVERWRITE="a" ;;
s ) TYPE="system" ;;
- * ) usage ;;
+ h ) usage ;;
+ * ) echo "Unrecognized option." >&2 && usage ;;
esac
done
-shift $((OPTIND - 1))
+shift $(($OPTIND - 1))
+function usage() {
+ cat << EndUsage
+Usage: $(basename $0) [-h] [-d /path/to/target] [CHROOT_CMD]
+Chroots to target with mounts taken care of (proc, dev, etc.).
+This script requires superuser privileges.
+
+Options:
+ -d /path/to/target
+ The target directory you would like to chroot to. Defaults to
+ current working directory.
+
+ -h Shows this help information
+
+ CHROOT_CMD
+ Any arbitrary command you wish to run inside the chroot. Note that
+ you must specify an absolute path or the command will not likely
be
+ found (a way around this would be to either set the path as part
of
+ the command to execute, or to set the command to be /bin/bash -l
+ some_command_without_abs_path). Defaults to "/bin/bash -l".
+EndUsage
+ exit 1
+} >&2
+
# dir to chroot to is either $1 or $CWD
-while getopts ":d:" Option
+while getopts ":d:h" Option
do
case $Option in
d ) CHROOT_DIR="$OPTARG" ;;
- * ) ;;
+ h ) usage ;;
+ * ) echo "Unrecognized option." >&2 && usage ;;
esac
done
shift $(($OPTIND - 1))
diff --git a/scripts/cleaniso.sh b/scripts/cleaniso.sh
index 9d63760..3c10948 100755
--- a/scripts/cleaniso.sh
+++ b/scripts/cleaniso.sh
@@ -6,26 +6,33 @@ CLEANALL=false
CLEANERS="$(dirname $0)/../data/cleaners"
- For each cleaner specified as an argument, cleans the
- files and directories listed therein from iso_chroot.
- A cleaner is the ouput of 'gaze install \$SPELL' minus
- whatever you don't want removed. If -a is specified,
- it will use all cleaners found in the cauldron cleaner dir.
- USAGE
+For each cleaner specified as an argument, cleans the files and
+directories listed therein from iso_chroot. A cleaner is the ouput of
+'gaze install \$SPELL' minus whatever you don't want removed. This
+script requires superuser privileges.
+
+Options:
+ -a Run on all cleaner files in the cauldron cleaner
+ directory. If this option is specified, any arguments
+ provided beyond iso_chroot are ignored.
+
+ -h Shows this help information
+EndUsage
exit 1
} >&2
-while getopts ":a" Option
+while getopts ":ah" Option
do
case $Option in
a ) CLEANALL=true ;;
- * ) ;;
+ h ) usage ;;
+ * ) echo "Unrecognized option." >&2 && usage ;;
esac
done
-shift $((OPTIND - 1))
+shift $(($OPTIND - 1))
# Check to make sure we have the right number of arguments
# taking the option flag into account
diff --git a/scripts/mkiso.sh b/scripts/mkiso.sh
index 40760ee..6b1d8f3 100755
--- a/scripts/mkiso.sh
+++ b/scripts/mkiso.sh
@@ -3,11 +3,41 @@
COMPRESS="no"
KEEP=
+function usage() {
+ cat << EndUsage
+Usage: $(basename $0) [-hu] /path/to/target ISO_VERSION
+
+Generates a bootable iso9660 iso file using /path/to/target. The output file
is
+named ISO_VERSION. Also creates metadata information appropriate to the iso
+(publisher, preparer, volume_id, etc.). Uses ISO_VERSION for the volume_id
+field. This script requires superuser privileges.
+
+Required:
+ /path/to/target
+ The target directory you would like to chroot to. Defaults to
+ current working directory.
+
+ ISO_VERSION
+ A string that specifies the filename of the iso output file.
+ you must specify an absolute path or the command will not likely
be
+ found (a way around this would be to either set the path as part
of
+ the command to execute, or to set the command to be /bin/bash -l
+ some_command_without_abs_path). Defaults to "/bin/bash -l".
+Options:
+ -u Change ownership of output files to $UID:$GID
+
+ -h Shows this help information
+EndUsage
+ exit 1
+} >&2
+
while getopts "z" Options
do
case $Options in
- "z") COMPRESS="yes"
- "k") KEEP="-k"
+ k ) KEEP="-k" ;;
+ z ) COMPRESS=true ;;
+ h ) usage ;;
+ * ) echo "Unrecognized option" >&2 && usage ;;
esac
done
shift $(($OPTIND - 1))
diff --git a/scripts/mkrelease.sh b/scripts/mkrelease.sh
index a69b9c6..38bcc35 100755
--- a/scripts/mkrelease.sh
+++ b/scripts/mkrelease.sh
@@ -3,17 +3,46 @@
TARGET=$1
VERSION=$2
+function usage() {
+ cat << EndUsage
+Usage: $(basename $0) [-h] /path/to/target VERSION
+
+Creates an official release ISO from /path/to/target for the ISO
+version specified as VERSION. This script requires superuser
+privileges.
+
+Required:
+ /path/to/target
+ The target directory you would like to make a releasable
+ ISO from.
+
+ VERSION
+ A string which describes the version of the ISO to
+ release. Since this script is for making official
+ releases, the string will be prepended with smgl-,
+ resulting in smgl-VERSION.iso for the final ISO output.
+
+Options:
+ -u chown output files to $UID:$GID
+
+ -h Shows this help information
+EndUsage
+ exit 1
+} >&2
+
+while getopts ":h" Option
+do
+ case $Option in
+ h ) usage ;;
+ * ) echo "Unrecognized option." >&2 && usage ;;
+ esac
+done
+shift $(($OPTIND - 1))
+
[[ $# -lt 2 ]] && usage