summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2014-12-07 20:36:27 +0100
committerYuval Adam <yuv.adm@gmail.com>2014-12-07 20:36:27 +0100
commit18629123dc583cd51149cbced14c4af00e06fd33 (patch)
tree384ad26146d528e4826b06a0998fab7301d838eb
parentd49b58cca74c4d8133f1b58a2a5cf8dee46e9e00 (diff)
Split packages, testing and flags
-rwxr-xr-xliveusb/build.sh42
-rw-r--r--liveusb/packages-test.x86_641
-rw-r--r--liveusb/packages.x86_641
3 files changed, 42 insertions, 2 deletions
diff --git a/liveusb/build.sh b/liveusb/build.sh
index 24ac2f0..ba3d3fe 100755
--- a/liveusb/build.sh
+++ b/liveusb/build.sh
@@ -2,6 +2,7 @@
set -e -u
+# global settings
iso_name=amenthes
iso_label="AMENTHES"
install_dir=arch
@@ -9,9 +10,22 @@ arch=$(uname -m)
work_dir=work
out_dir=out
+# args
+testing=false
+
+# other paths
pacman_conf=${work_dir}/pacman.conf
script_path=$(readlink -f ${0%/*})
+_usage() {
+ echo "usage ${0} [options]"
+ echo
+ echo " General options:"
+ echo " -t Enable testing packages (use for development ONLY)"
+ echo " -h This help message"
+ exit ${1}
+}
+
# Helper function to run make_*() only one time per architecture.
run_once() {
if [[ ! -e ${work_dir}/build.${1}_${arch} ]]; then
@@ -34,7 +48,13 @@ make_basefs() {
# Additional packages (airootfs)
make_packages() {
- mkarchiso -v -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" -p "$(grep -h -v ^# ${script_path}/packages.x86_64)" install
+ local _packages
+ if [ "$testing" = true ]; then
+ _packages=$(grep -h -v ^# ${script_path}/packages{,-test}.x86_64)
+ else
+ _packages=$(grep -h -v ^# ${script_path}/packages.x86_64)
+ fi
+ mkarchiso -v -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" -p "${_packages}" install
}
# Copy mkinitcpio archiso hooks and build initramfs (airootfs)
@@ -91,6 +111,26 @@ make_iso() {
mkarchiso -v -w "${work_dir}" -D "${install_dir}" -L "${iso_label}" -o "${out_dir}" iso "${iso_name}-${arch}.iso"
}
+if [[ ${EUID} -ne 0 ]]; then
+ echo "This script must be run as root."
+ _usage 1
+fi
+if [[ ${arch} != x86_64 ]]; then
+ echo "This script needs to be run on x86_64"
+ _usage 1
+fi
+
+while getopts 'th' arg; do
+ case "${arg}" in
+ t) testing=true ;;
+ h) _usage 0 ;;
+ *)
+ echo "Invalid argument '${arg}'"
+ _usage 1
+ ;;
+ esac
+done
+
mkdir -p ${work_dir}
run_once make_pacman_conf
diff --git a/liveusb/packages-test.x86_64 b/liveusb/packages-test.x86_64
new file mode 100644
index 0000000..a956da1
--- /dev/null
+++ b/liveusb/packages-test.x86_64
@@ -0,0 +1 @@
+virtualbox-guest-utils
diff --git a/liveusb/packages.x86_64 b/liveusb/packages.x86_64
index 5e68f85..4c40b91 100644
--- a/liveusb/packages.x86_64
+++ b/liveusb/packages.x86_64
@@ -1,3 +1,2 @@
-virtualbox-guest-utils
xorg-server
lxde