Set your configuration parameters in the "config" file, then run
-./raise.sh
+./raise.sh build
-Go and grab a coffee. When the script completes, you'll have a full
-Xen system installation under DESTDIR and a deb or rpm package
-(depending on your distro) containing all the necessary binaries.
+Reply to questions and go and grab a coffee. When the script completes, you'll
+have a full Xen system installation under DESTDIR and a deb or rpm package
+(depending on your distro) containing all the necessary binaries in the raisin
+directory.
raise.sh takes care of:
- installing them under DESTDIR (the "dist" sub-directory by default)
- creating a deb or rpm package with all the content
-raise.sh can optionally perform the installation under / and fully
+raise.sh can also perform the installation under / and fully
configure the system for you. If you want this behaviour run
-./raise.sh -i
+./raise.sh install
+./raise.sh configure
raise.sh performs the installation by installing the deb or rpm package,
hence it can be easily uninstalled by unraise.sh or manually by the
source config
source common-functions.sh
-help() {
- echo "Usage: ./build.sh <options>"
+_help() {
+ echo "Usage: ./build.sh <options> <command>"
echo "where options are:"
echo " -n | --no-deps Do no install build-time dependencies"
echo " -v | --verbose Verbose"
echo " -y | --yes Do not ask questions and continue"
- echo " -i | --install Install under / and configure the system (needs sudo)"
+ echo "where commands are:"
+ echo " build Build the components enabled in config"
+ echo " install Install binaries under / (requires sudo)"
+ echo " configure Configure the system (requires sudo)"
}
+_build() {
+ if [[ $YES != "y" ]]
+ then
+ echo "Do you want Raisin to automatically install build time dependencies for you? (y/n)"
+ while read answer
+ do
+ if [[ "$answer" = "n" ]]
+ then
+ NO_DEPS=1
+ break
+ elif [[ "$answer" = "y" ]]
+ then
+ break
+ fi
+ done
+ fi
+
+ mkdir -p "$INST_DIR" &>/dev/null
+ install_dependencies git
+ if [[ $DISTRO = "Fedora" ]]
+ then
+ install_dependencies rpm-build
+ fi
+ # build and install under $DESTDIR
+ for_each_component clean
+ for_each_component build
+
+ build_package xen-system
+}
+
+_install() {
+ install_package xen-system
+}
+
+_configure() {
+ if [[ $YES != "y" ]]
+ then
+ echo "Proceeding we'll make changes to the running system,"
+ echo "are you sure that you want to continue? (y/n)"
+ while read answer
+ do
+ if [[ "$answer" = "n" ]]
+ then
+ exit 0
+ elif [[ "$answer" = "y" ]]
+ then
+ break
+ fi
+ done
+ fi
+
+ for_each_component configure
+}
# start execution
common_init
# parameters check
-INST=0
-export NO_DEPS=0
export VERBOSE=0
export YES="n"
-while [[ $# -ge 1 ]]
+export NO_DEPS=0
+while [[ $# -gt 1 ]]
do
- if [[ "$1" = "-n" || "$1" = "--no-deps" ]]
- then
- NO_DEPS=1
- shift 1
- elif [[ "$1" = "-v" || "$1" = "--verbose" ]]
+ if [[ "$1" = "-v" || "$1" = "--verbose" ]]
then
VERBOSE=1
shift 1
- elif [[ "$1" = "-i" || "$1" = "--install" ]]
- then
- INST=1
- shift 1
elif [[ "$1" = "-y" || "$1" = "--yes" ]]
then
YES="y"
shift 1
else
- help
+ _help
exit 1
fi
done
-if [[ $YES != "y" && $NO_DEPS -eq 0 ]]
-then
- echo "Do you want Raisin to automatically install build time dependencies for you? (y/n)"
- while read answer
- do
- if [[ "$answer" = "n" ]]
- then
- NO_DEPS=1
- break
- elif [[ "$answer" = "y" ]]
- then
- break
- fi
- done
-fi
-
-
-mkdir -p "$INST_DIR" &>/dev/null
-install_dependencies git
-if [[ $DISTRO = "Fedora" ]]
-then
- install_dependencies rpm-build
-fi
-
-# build and install under $DESTDIR
-for_each_component clean
-for_each_component build
-
-build_package xen-system
-
-if [[ -z "$INST" || "$INST" -eq 0 ]]
-then
- exit 0
-elif [[ -z "$YES" || "$YES" != "y" ]]
-then
- echo "Proceeding we'll make changes to the running system,"
- echo "Installing the components we built and configuring the system"
- echo "(requires sudo)."
- echo "Are you sure that you want to continue? (y/n)"
- while read answer
- do
- if [[ "$answer" = "n" ]]
- then
- exit 0
- elif [[ "$answer" = "y" ]]
- then
- break
- fi
- done
-fi
+case "$1" in
+ "build" | "install" | "configure" )
+ COMMAND=$1
+ ;;
+ *)
+ _help
+ exit 1
+ ;;
+esac
-install_package xen-system
+_$COMMAND
-# configure
-for_each_component configure