3 ####################################
6 # Ardour/Mixbus bundle installer
9 ###################################
11 MAJOR_VERSION="%REPLACE_MAJOR_VERSION%"
13 PGM_NAME="%REPLACE_PGM%"
14 PGM_VENDOR="%REPLACE_VENDOR%"
15 PGM_EXEC_FILE="%REPLACE_EXE%${MAJOR_VERSION}"
19 if test -z "$INSTALL_DEST_BASE"; then
20 INSTALL_DEST_BASE="/opt"
26 USER_BIN_DIR="/usr/local/bin"
28 PGM_NAME_LOWER=$(echo $PGM_NAME | tr '[:upper:]' '[:lower:]')
32 #### Global Variables ####
35 ########################
36 # Function Definitions
37 ########################
39 VaildateYesNoQuestion ()
46 until test "y" = $INPUT_OK;
49 read -p "$1 [y/n]: " USER_INPUT
52 if [ ! -z $USER_INPUT ];
54 if [ "Y" = $USER_INPUT -o "y" = $USER_INPUT -o "n" = $USER_INPUT -o "N" = $USER_INPUT ];
61 echo $USER_INPUT | tr '[:upper:]' '[:lower:]'
68 # Determine which software install app to use and then install requested package
71 if which yum > /dev/null;
73 ${SUPER} yum -y install $1
79 echo "!!! ERROR !!! yum install failed for an unknown reason."
80 echo "Please install package $1 after this installer completes."
84 elif which apt-get > /dev/null;
86 ${SUPER} apt-get -y install $1
92 echo "!!! ERROR !!! apt-get install failed for an unknown reason."
93 echo "Please install package $1 after this installer completes."
99 echo "!!! ERROR !!! - Not able to detect which software install tool to use (yum or apt-get)."
100 echo "Please install package $1 using the system software install tool."
109 ########################################################################
111 ########################################################################
114 # If you double click a script, some systems don't get the PWD correct.
115 # Force it to be correct
116 PKG_PATH=$(dirname "$(readlink -f "$0")")
120 echo "Welcome to the ${PGM_NAME} installer"
122 echo "${PGM_NAME} will be installed for user ${USER_NAME} in ${INSTALL_DEST_BASE}"
124 #############################
125 # Check for root privileges
126 #############################
131 if [ "$(id -u)" != "0" ]; then
133 if ! which sudo > /dev/null;
136 echo "Sudo installed failed, attempting to install using su"
137 echo "Please enter root password below"
140 if ! su -s $THE_SHELL -c "./.stage2.run";
145 echo "This installer requires root privileges. It is currently not"
146 echo "running as root AND an attempt to use su failed."
148 echo "Please correct this by installing and configuring sudo or running"
149 echo "the installer as root (su -s $THE_SHELL -c)."
151 read -p "Press ENTER to exit installer:" BLAH
156 sudo -k # make sudo forget about cached credentials
162 echo "Attempting to install using su"
163 echo "Please enter root password below"
166 if ! su -s $THE_SHELL -c "./.stage2.run";
171 echo "This installer requires root privileges. It is currently not"
172 echo "running as root AND an attempt to use both sudo and su failed."
174 echo "Please correct this by installing and configuring sudo or running"
175 echo "the installer as root (su -s $THE_SHELL -c)."
177 read -p "Press ENTER to exit installer:" BLAH
184 # The quoting reqired for the su sanityCheck method does not work when used without
185 # su. Using sh -c in the normal case gets around that, but is a bit of a hack.
188 NORM_USER="su -l $USER_NAME -s $THE_SHELL -c"
191 ###############################
192 # Check for install destination
193 ###############################
195 if test -n "$CALL_MKDIR"; then
196 ${SUPER} mkdir -p "$INSTALL_DEST_BASE"
199 if [ ! -d ${INSTALL_DEST_BASE} ];
202 echo "!!! ERROR !!! - Installation location ${INSTALL_DEST_BASE} does not exist!"
203 echo "Installation will not complete."
205 read -p "Press ENTER to exit installer:" BLAH
210 ############################
211 # Determine processor type
212 ############################
215 i[3456789]86|x86|i86pc)
216 echo "Architecture is x86"
220 echo "Architecture is x86_64"
225 echo "!!! ERROR !!! - Unknown architecture `uname -m`"
227 read -p "Press ENTER to exit installer:" BLAH
236 # We have to check the current folder and the INSTALL_DEST_BASE just
237 # in case they are on different devices
238 echo "Checking for required disk space"
240 if [ ! -e .${PGM_NAME}_${ARCH}-*.size ]; then
242 echo "!!! ERROR !!! Can't locate .size file for ${ARCH} bundle."
243 echo "This package is broken or does not support ${ARCH}."
245 read -p "Press ENTER to exit installer:" BLAH
248 REQUIRED_BYTES=$(cat .${PGM_NAME}_${ARCH}-*.size)
250 #Installer needs 2x the space since the bundle is unpacked locally and then copied
251 REQUIRED_BYTES=$(($REQUIRED_BYTES + $REQUIRED_BYTES))
253 #Check space in current folder
254 FREE_BYTES=$(df -P -B 1 "${PKG_PATH}" | grep / | awk '{print $4}')
256 if [ ${FREE_BYTES} -le ${REQUIRED_BYTES} ] ; then
258 echo "!!! ERROR !!! - Insufficient disk space in ${PKG_PATH}"
259 echo "Install requires ${REQUIRED_BYTES} bytes and"
260 echo "there is only ${FREE_BYTES} bytes of free space"
262 read -p "Press ENTER to exit installer:" BLAH
266 #Check space in INSTALL_DEST_BASE
267 FREE_BYTES=$(df -P -B 1 ${INSTALL_DEST_BASE} | grep / | awk '{print $4}')
269 if [ ${FREE_BYTES} -le ${REQUIRED_BYTES} ] ; then
271 echo "!!! ERROR !!! - Insufficient disk space in ${INSTALL_DEST_BASE}"
272 echo "Install requires ${REQUIRED_BYTES} bytes and"
273 echo "there is only ${FREE_BYTES} bytes of free space"
275 read -p "Press ENTER to exit installer:" BLAH
280 #############################
281 # Determine C11 stdlibc++ ABI
282 #############################
284 if %REPLACE_GCC5%; then
285 # Ardour was compiled with gcc5, warn on gcc4 systems
286 if ! ${NORM_USER} "${PKG_PATH}/.gcc-glibmm-abi-check --gcc5 > /dev/null"; then
288 echo "WARNING: GCC4/5 libstdc++ ABI Mismatch"
290 echo "Ardour was compiled with gcc5, your system uses an older version of the"
291 echo "standard c++ library. Plugins on your system may not load or plugin-UIs"
292 echo "may cause crashes."
294 ANSWER=$(VaildateYesNoQuestion "Continue anyway?")
295 if test "n" = $ANSWER; then
300 # Ardour was compiled with gcc4, warn on gcc5 systems
301 if ! ${NORM_USER} "${PKG_PATH}/.gcc-glibmm-abi-check --gcc4 > /dev/null"; then
303 echo "WARNING: GCC4/5 libstdc++ ABI Mismatch"
305 echo "Ardour was compiled with gcc4, your system uses a newer version of the"
306 echo "standard c++ library. Plugins on your system may not load or plugin-UIs"
307 echo "may cause crashes."
309 ANSWER=$(VaildateYesNoQuestion "Continue anyway?")
310 if test "n" = $ANSWER; then
316 if %REPLACE_WINE%; then
317 if -z "`which wine`"; then
319 echo "!!! ERROR !!! - 'wine' was not found."
321 echo "This version of Ardour with Windows VST support requires wine."
322 echo "https://www.winehq.org/"
324 read -p "Press ENTER to exit installer:" BLAH
329 #####################
331 #####################
333 FILESYSTEM_TYPE=$(df -P -T "${PKG_PATH}" | grep / | awk '{print $2}')
334 echo "Bundle is on ${FILESYSTEM_TYPE} filesystem"
336 # untar the correct bundle for us to install
337 echo "Unpacking bundle for $ARCH"
339 if [ ! -e ${PGM_NAME}_${ARCH}-*.tar.bz2 ]; then
341 echo "!!! ERROR !!! Can't locate ${ARCH} bundle file."
343 read -p "Press ENTER to exit installer:" BLAH
347 if ! tar -xjf ${PGM_NAME}_${ARCH}-*.tar.bz2; then
349 echo "!!! ERROR !!! Can't unpack ${ARCH} bundle file."
351 read -p "Press ENTER to exit installer:" BLAH
354 echo "Bundle unpacked"
357 BUNDLE_DIR=$(basename `find -maxdepth 1 -type d -name "${PGM_NAME}_${ARCH}-*"`)
360 #######################
361 # Check for xdg utils
362 #######################
364 #load the file that contains the translated names of the users directories
365 if [ -e /home/${USER_NAME}/.config/user-dirs.dirs ]; then
366 . /home/${USER_NAME}/.config/user-dirs.dirs
369 if [ "$(id -u)" != "0" ]; then
370 USER_DESKTOP_DIR=${XDG_DESKTOP_DIR:-$HOME/Desktop}
372 #running as root with su makes this more difficult
373 DESKTOP_FOLDER=$(echo ${XDG_DESKTOP_DIR:-$HOME/Desktop} | awk -F/ '{print $NF}')
374 USER_DESKTOP_DIR="/home/${USER_NAME}/${DESKTOP_FOLDER}"
377 XDG_MENU_VER=$(xdg-desktop-menu --version 2> /dev/null)
378 if [ -z "$XDG_MENU_VER" ];
380 echo "System does not have xdg-desktop-menu installed"
384 XDG_ICON_VER=$(xdg-icon-resource --version 2> /dev/null)
385 if [ -z "$XDG_ICON_VER" ];
387 echo "System does not have xdg-icon-resource installed"
391 #################################################
393 #################################################
394 if %REPLACE_WINE%; then
396 echo "Searching for libwine.so (Windows VST support)"
398 # we need to add libwine to ardour's LD_LIBRARY_PATH
399 # libwine itself includes paths to the various system-components
400 # which may be different on each platform.
402 # There's some chicken/egg here: ardour.exe.so is linked against libwine.so
403 # at build-time. wine/wineloader assumes a windows-application (which does not use libwine
404 # directly) and does not set up the LD path to libwine itself. the application terminates
405 # (missing libs) before it even starts..
407 # wine itself does not provide means to find the location of libwine.
408 # /usr/bin/wine is usually shell-script and libwine.so can be found in
409 # various places on different distros.
411 # if this check were quick and easy.. it should be done in the startup-script, but it's not
412 # so here we go... (updating wine may require re-installing ardour)
415 LD_DEBUG=files wine `pwd`/${BUNDLE_DIR}/lib/ardour-vst-scanner.exe.so 2>&1 \
416 | grep -e "calling init:.*libwine" \
417 | sed 's/^.*calling init: //' \
420 if ! test -f "$LIBWINE"; then
422 echo "!!! ERROR !!! - 'libwine.so*' was not found."
424 read -p "Press ENTER to exit installer:" BLAH
427 # this replaces/overwrites the bundled libwine
428 cp -L "$LIBWINE" `pwd`/${BUNDLE_DIR}/lib/libwine.so.1
431 #################################################
432 # Check if system libs are OK (libc, etc)
433 #################################################
436 echo "Checking system libs to see if they are compatible with ${PGM_NAME}."
440 LD_PATH=`pwd`/${BUNDLE_DIR}/lib
443 LDD_RESULT=$(LD_LIBRARY_PATH=${LD_PATH} ldd ${BUNDLE_DIR}/bin/${PGM_NAME_LOWER}-* 2>&1 > /dev/null | grep -v "no version information")
445 if [ -n "$LDD_RESULT" ];
452 LIB_FILES=$(find ${BUNDLE_DIR}/lib -name "*.so")
454 for path in $LIB_FILES
456 LDD_RESULT=$(LD_LIBRARY_PATH=${LD_PATH} ldd $path 2>&1 > /dev/null | grep -v "no version information")
457 if [ -n "$LDD_RESULT" ];
464 if test "T" = $LIB_ERROR;
467 echo "!!! ERROR !!! - Missing library detected!"
468 echo "This system does not have the correct libs to run ${PGM_NAME}."
469 echo "Installation will not complete. Please use a compatible distro."
471 read -p "Press ENTER to exit installer:" BLAH
475 ################################
476 # Setup derived variables
477 ################################
478 PGM_VERSION=$(echo ${BUNDLE_DIR} | cut -d- -f2)
479 PGM_BUILDTYPE=$(echo ${BUNDLE_DIR} | cut -d- -f3)
481 if [ -z ${PGM_BUILDTYPE} ];
483 PGM_FULL_NAME="${PGM_NAME}-${PGM_VERSION}"
484 ICON_NAME="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}" #no dash between name and version since dash seperates vendor from program
485 MENU_FILE="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}.desktop" #no dash between name and version since dash seperates vendor from program
486 DESKTOP_LINK_FILE="${PGM_NAME}_${PGM_VERSION}.desktop"
488 PGM_FULL_NAME="${PGM_NAME}-${PGM_VERSION}-${PGM_BUILDTYPE}"
489 ICON_NAME="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}" #no dash between name and version since dash seperates vendor from program
490 MENU_FILE="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}.desktop" #no dash between name and version since dash seperates vendor from program
491 DESKTOP_LINK_FILE="${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}.desktop"
494 PGM_EXEC_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/${PGM_EXEC_FILE}"
495 ICON_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/share/icons"
496 MENU_FILE_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/share"
498 ################################
499 # Install bundle and Menu/Link
500 ################################
502 # uninstall any older versions
503 UNINSTALLERS=$(find ${INSTALL_DEST_BASE} -maxdepth 1 -type f -name "${PGM_NAME}*.uninstall.sh")
504 if [ ! -z "$UNINSTALLERS" ];
506 for i in $UNINSTALLERS; do
508 echo "Found existing ${PGM_NAME} installation."
510 ANSWER=$(VaildateYesNoQuestion "Do you want to run the uninstaller ${i} ?")
512 if test "y" = $ANSWER;
515 echo "Running uninstaller $i"
527 echo "Installing ${PGM_NAME} ${PGM_VERSION} in ${INSTALL_DEST_BASE}"
530 # Copy the new version in the install directory
531 ${SUPER} mkdir ${INSTALL_DEST_BASE}/${PGM_FULL_NAME}
532 ${SUPER} cp -Rf ${BUNDLE_DIR}/* ${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/
534 # write the desktop/menu file
535 echo "[Desktop Entry]" > /tmp/${MENU_FILE}
536 echo "Encoding=UTF-8" >> /tmp/${MENU_FILE}
537 echo "Version=1.0" >> /tmp/${MENU_FILE}
538 echo "Type=Application" >> /tmp/${MENU_FILE}
539 echo "Terminal=false" >> /tmp/${MENU_FILE}
540 echo "Exec=${PGM_EXEC_PATH}" >> /tmp/${MENU_FILE}
541 if [ -z ${PGM_BUILDTYPE} ];
543 echo "Name=${PGM_NAME}-${PGM_VERSION}" >> /tmp/${MENU_FILE}
545 echo "Name=${PGM_NAME}-${PGM_VERSION}-${PGM_BUILDTYPE}" >> /tmp/${MENU_FILE}
547 echo "Icon=${ICON_NAME}" >> /tmp/${MENU_FILE}
548 echo "Comment=Digital Audio Workstation" >> /tmp/${MENU_FILE}
549 echo "Categories=AudioVideo;AudioEditing;Audio;Recorder;" >> /tmp/${MENU_FILE}
551 chmod ugo+rx /tmp/${MENU_FILE}
552 ${SUPER} mv /tmp/${MENU_FILE} ${MENU_FILE_PATH}/.
554 # install the Menu, Link, and Icon(s)
555 if [ "T" = ${HAS_XDG} ];
557 echo "Adding ${PGM_NAME} to the applications menu"
558 ${SUPER} xdg-icon-resource install --context apps --size 16 ${ICON_PATH}/${PGM_NAME_LOWER}_icon_16px.png ${ICON_NAME}
559 ${SUPER} xdg-icon-resource install --context apps --size 22 ${ICON_PATH}/${PGM_NAME_LOWER}_icon_22px.png ${ICON_NAME}
560 ${SUPER} xdg-icon-resource install --context apps --size 32 ${ICON_PATH}/${PGM_NAME_LOWER}_icon_32px.png ${ICON_NAME}
561 ${SUPER} xdg-icon-resource install --context apps --size 48 ${ICON_PATH}/${PGM_NAME_LOWER}_icon_48px.png ${ICON_NAME}
562 ${SUPER} xdg-icon-resource install --context apps --size 256 ${ICON_PATH}/${PGM_NAME_LOWER}_icon_256px.png ${ICON_NAME}
564 if [ -e ${ICON_PATH}/${PGM_NAME_LOWER}_icon.svg -a -d /usr/share/icons/hicolor/scalable/apps ];
566 ${SUPER} cp -f ${ICON_PATH}/${PGM_NAME_LOWER}_icon.svg /usr/share/icons/hicolor/scalable/apps/${ICON_NAME}.svg
569 ${SUPER} xdg-desktop-menu install ${MENU_FILE_PATH}/${MENU_FILE}
570 ${SUPER} xdg-desktop-menu forceupdate --mode system # Some systems need an extra kick
573 echo "Creating a desktop link for ${PGM_NAME} in ${USER_DESKTOP_DIR}"
574 cp ${MENU_FILE_PATH}/${MENU_FILE} ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
575 chmod ugo+rwx ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
578 echo "Creating a desktop link for ${PGM_NAME} in ${USER_DESKTOP_DIR}"
579 cp ${MENU_FILE_PATH}/${MENU_FILE} ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
580 chmod ugo+rwx ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
584 echo "Copying uninstall script to ${INSTALL_DEST_BASE}"
587 ${SUPER} cp -f ${BUNDLE_DIR}/bin/*.uninstall.sh ${INSTALL_DEST_BASE}/.
589 # Create link to the program in user bin
592 echo "Creating link ${PGM_NAME}${MAJOR_VERSION} in ${USER_BIN_DIR}"
595 if [ -d "${USER_BIN_DIR}" ]; then
596 if [ -e "${USER_BIN_DIR}/${PGM_NAME}${MAJOR_VERSION}" ]; then
597 ${SUPER} rm -f ${USER_BIN_DIR}/${PGM_NAME}${MAJOR_VERSION}
601 ${SUPER} ln -sf ${PGM_EXEC_PATH} ${PGM_NAME}${MAJOR_VERSION}
605 echo "Can not create link because ${USER_BIN_DIR} does not exist"
608 ###########################
609 # Check Jack and qjackctl
610 ###########################
613 echo "Checking to see if Jack is installed"
618 if which jackd > /dev/null; then
620 echo "Jack already present"
621 elif which jackdbus > /dev/null; then
623 echo "jackdbus was found but not jackd. Jack version compatibility check cannot be performed."
628 echo "The program Jack is missing from this system. Jack is a required component of $PGM_NAME."
631 ANSWER=$(VaildateYesNoQuestion "Install jack using system software repository?")
633 if test "y" = $ANSWER;
635 echo "Attempting to install Jack"
636 SystemInstall "jackd"
641 read -p "Press ENTER to continue:" BLAH
648 # Check to see if Jack is new enough to operate correctly.
650 if [ "t" = ${JACK_INSTALLED} ];
653 JACK_VER_STRING=$(jackd --version | grep -e "jackd.*protocol")
654 JACK_NAME=$(echo $JACK_VER_STRING | awk '{print $1}')
655 JACK_VERSION=$(echo $JACK_VER_STRING | awk '{print $3}')
656 JACK_VERSION_MAJOR=$(echo $JACK_VERSION | awk 'BEGIN{FS="."}{print $1}')
657 JACK_VERSION_MIDDLE=$(echo $JACK_VERSION | awk 'BEGIN{FS="."}{print $2}')
658 JACK_VERSION_MINOR=$(echo $JACK_VERSION | awk 'BEGIN{FS="."}{print $3}')
660 if [ "jackd" = ${JACK_NAME} ];
662 if [ ${JACK_VERSION_MAJOR} -eq 0 ];
664 if [ ${JACK_VERSION_MIDDLE} -eq 121 ];
666 if [ ${JACK_VERSION_MINOR} -ge 3 ];
670 elif [ ${JACK_VERSION_MIDDLE} -gt 121 ];
674 elif [ ${JACK_VERSION_MAJOR} -gt 0 ];
678 elif [ "jackdmp" = ${JACK_NAME} ];
680 if [ ${JACK_VERSION_MAJOR} -eq 1 ];
682 if [ ${JACK_VERSION_MIDDLE} -eq 9 ];
684 if [ ${JACK_VERSION_MINOR} -ge 8 ];
688 elif [ ${JACK_VERSION_MIDDLE} -gt 9 ];
692 elif [ ${JACK_VERSION_MAJOR} -gt 1 ];
698 if [ "t" = ${JACK_VERSION_OK} ];
701 echo "Jack Version Check OK (${JACK_VER_STRING})"
705 echo "!!! WARNING !!! - The version of Jack on this system is too old!"
706 echo "Using an old version of Jack is not recommended. Please update"
707 echo "Jack for best results."
709 echo "System Jack version:"
710 echo " ${JACK_VER_STRING}"
712 echo "Recommended minimum versions:"
713 echo " Jack1 - 0.121.3"
714 echo " Jack2 - 1.9.8"
716 read -p "Press ENTER to continue:" BLAH
720 if ! which qjackctl > /dev/null;
723 echo "The program QjackCtl is missing from this system."
724 echo "QjackCtl is an extremely useful tool for any system that runs JACK applications like $PGM_NAME."
725 echo "We recommend that you install it."
728 ANSWER=$(VaildateYesNoQuestion "Install QjackCtl using system software repository?")
730 if test "y" = $ANSWER;
732 echo "Attempting to install QjackCtl"
733 SystemInstall "qjackctl"
738 read -p "Press ENTER to continue:" BLAH
744 ########################
746 ########################
748 USER_GROUP_ADJUSTED="f"
750 if ! ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -a > /dev/null";
753 echo "System failed the quick sanity check... Looking for the cause"
755 if ! ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -rt > /dev/null";
758 echo "System does not allow realtime for the current user... Looking for a solution"
760 if ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -hasaudiogroup > /dev/null";
762 if ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -memberaudiogroup > /dev/null 2>&1";
764 ## This is an odd case. We have an audio group and are a member.
766 echo "!!! WARNING !!! - The current user can not execute realtime processes."
767 echo "This will adversely affect audio latency."
768 echo "This system has an audio group and the user is a member. If jack was"
769 echo "just installed, a simple log out/in may fix this."
771 echo "For best results, please correct this on your system."
772 echo "(Hint: check /etc/security/limits.conf or /etc/security/limits.d/)"
774 read -p "Press ENTER to continue:" BLAH
776 # Not a member of an audio group. Try to fix it.
778 if ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -hasgroup audio > /dev/null && find /etc/security -type f -name "*.conf" | xargs grep -q "^@audio.*rtprio" ";
780 # add user to audio group
782 echo "Adding user ${USER_NAME} to the audio group."
783 echo "This should allow you to run realtime tasks. Please re-login for this change to take affect."
785 read -p "Press ENTER to continue:" BLAH
787 if ${SUPER} usermod -a -G audio ${USER_NAME};
789 USER_GROUP_ADJUSTED="t"
792 echo "!!! ERROR !!! - Not able to add user to the audio group (usermod failed)!"
794 echo "Please add yourself to the audio group and re-login"
796 read -p "Press ENTER to continue:" BLAH
799 elif ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -hasgroup jackuser > /dev/null && find /etc/security -type f -name "*.conf" | xargs grep -q "^@jackuser.*rtprio" ";
801 # add user to jackuser group
803 echo "Adding user ${USER_NAME} to the jackuser group."
804 echo "This should allow you to run realtime tasks. Please re-login for this change to take affect."
806 read -p "Press ENTER to continue:" BLAH
808 if ${SUPER} usermod -a -G jackuser ${USER_NAME};
810 USER_GROUP_ADJUSTED="t"
813 echo "!!! ERROR !!! - Not able to add user to the jackuser group."
815 echo "Please add yourself to the audio group and re-login"
817 read -p "Press ENTER to continue:" BLAH
824 # No audio group found on this system!
826 echo "!!! WARNING !!! - The system does not seem to have an audio group (audio or jackuser)."
828 echo "We will not attempt to fix this. Please configure your system to allow"
829 echo "non-root users to execute realtime tasks."
831 read -p "Press ENTER to continue:" BLAH
835 if ! ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -freqscaling > /dev/null";
838 echo "!!! WARNING !!! - Your system seems to use frequency scaling."
839 echo "This can have a serious impact on audio latency."
840 echo "For best results turn it off, e.g. by chosing the 'performance' governor."
842 read -p "Press ENTER to continue:" BLAH
845 if [ "f" = $USER_GROUP_ADJUSTED ];
847 if ! ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -memlock > /dev/null";
850 echo "!!! WARNING !!! - You are not allowed to lock memory."
852 echo "We will not attempt to fix this. Please configure your system to allow"
853 echo "non-root users to execute lock memory."
855 read -p "Press ENTER to continue:" BLAH
861 ########################
863 ########################
867 rm -rf ${BUNDLE_DIR}/
870 echo "!!! Install Complete !!!"
872 if [ "t" = $USER_GROUP_ADJUSTED ];
874 echo "You will need to logout and then login again for all changes to be complete"
878 read -p "Press ENTER to exit installer:" BLAH