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 "${PGM_NAME} 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 "${PGM_NAME} 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 test -z "`which wine`"; then
319 echo "!!! ERROR !!! - 'wine' was not found."
321 echo "This version of ${PGM_NAME} 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 libwine.so (Windows VST support)"
397 # we need to add libwine to ardour's LD_LIBRARY_PATH
398 # libwine itself includes paths to the various system-components
399 # which may be different on each platform.
401 # There's some chicken/egg here: ardour.exe.so is linked against libwine.so
402 # at build-time. wine/wineloader assumes a windows-application (which does not use libwine
403 # directly) and does not set up the LD path to libwine itself. the application terminates
404 # (missing libs) before it even starts..
406 # wine itself does not provide means to find the location of libwine.
407 # /usr/bin/wine is usually shell-script and libwine.so can be found in
408 # various places on different distros.
410 # if this check were quick and easy.. it should be done in the startup-script, but it's not
411 # so here we go... (updating wine may require re-installing ardour)
413 # on recent Ubuntu wine does load both:
414 # /usr/lib/i386-linux-gnu/libwine.so.1
416 # /usr/lib/x86_64-linux-gnu/libwine.so.1
417 # so we need to work around this (thanks).
418 # (this hack break 64bit LinuxVST builds, but we don't do those anyway)
421 LD_DEBUG=files wine `pwd`/${BUNDLE_DIR}/lib/ardour-vst-scanner.exe.so 2>&1 \
422 | grep -e "calling init:.*libwine" \
423 | sed 's/^.*calling init: //' \
424 | grep -v x86_64-linux-gnu \
427 if ! test -f "$LIBWINE"; then
429 echo "!!! ERROR !!! - 'libwine.so*' was not found."
431 read -p "Press ENTER to exit installer:" BLAH
434 echo "Using: $LIBWINE"
435 # this replaces/overwrites the bundled libwine
436 cp -L "$LIBWINE" `pwd`/${BUNDLE_DIR}/lib/libwine.so.1
439 #################################################
440 # Check if system libs are OK (libc, etc)
441 #################################################
444 echo "Checking system libs to see if they are compatible with ${PGM_NAME}."
448 LD_PATH=`pwd`/${BUNDLE_DIR}/lib
451 LDD_RESULT=$(LD_LIBRARY_PATH=${LD_PATH} ldd ${BUNDLE_DIR}/bin/${PGM_NAME_LOWER}-* 2>&1 > /dev/null | grep -v "no version information")
453 if [ -n "$LDD_RESULT" ];
460 LIB_FILES=$(find ${BUNDLE_DIR}/lib -name "*.so")
462 for path in $LIB_FILES
464 LDD_RESULT=$(LD_LIBRARY_PATH=${LD_PATH} ldd $path 2>&1 > /dev/null | grep -v "no version information")
465 if [ -n "$LDD_RESULT" ];
472 if test "T" = $LIB_ERROR;
475 echo "!!! ERROR !!! - Missing library detected!"
476 echo "This system does not have the correct libs to run ${PGM_NAME}."
477 echo "Installation will not complete. Please use a compatible distro."
479 read -p "Press ENTER to exit installer:" BLAH
483 ################################
484 # Setup derived variables
485 ################################
486 PGM_VERSION=$(echo ${BUNDLE_DIR} | cut -d- -f2)
487 PGM_BUILDTYPE=$(echo ${BUNDLE_DIR} | cut -d- -f3)
489 if [ -z ${PGM_BUILDTYPE} ];
491 PGM_FULL_NAME="${PGM_NAME}-${PGM_VERSION}"
492 ICON_NAME="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}" #no dash between name and version since dash seperates vendor from program
493 MENU_FILE="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}.desktop" #no dash between name and version since dash seperates vendor from program
494 DESKTOP_LINK_FILE="${PGM_NAME}_${PGM_VERSION}.desktop"
496 PGM_FULL_NAME="${PGM_NAME}-${PGM_VERSION}-${PGM_BUILDTYPE}"
497 ICON_NAME="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}" #no dash between name and version since dash seperates vendor from program
498 MENU_FILE="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}.desktop" #no dash between name and version since dash seperates vendor from program
499 DESKTOP_LINK_FILE="${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}.desktop"
502 PGM_EXEC_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/${PGM_EXEC_FILE}"
503 ICON_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/share/resources"
504 MENU_FILE_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/share"
506 ################################
507 # Install bundle and Menu/Link
508 ################################
510 # uninstall any older versions
511 UNINSTALLERS=$(find ${INSTALL_DEST_BASE} -maxdepth 1 -type f -name "${PGM_NAME}-*.uninstall.sh")
512 if [ ! -z "$UNINSTALLERS" ];
514 for i in $UNINSTALLERS; do
516 echo "Found existing ${PGM_NAME} installation."
518 ANSWER=$(VaildateYesNoQuestion "Do you want to run the uninstaller ${i} ?")
520 if test "y" = $ANSWER;
523 echo "Running uninstaller $i"
535 echo "Installing ${PGM_NAME} ${PGM_VERSION} in ${INSTALL_DEST_BASE}"
538 # Copy the new version in the install directory
539 ${SUPER} mkdir ${INSTALL_DEST_BASE}/${PGM_FULL_NAME}
540 ${SUPER} cp -Rf ${BUNDLE_DIR}/* ${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/
542 # write the desktop/menu file
543 echo "[Desktop Entry]" > /tmp/${MENU_FILE}
544 echo "Encoding=UTF-8" >> /tmp/${MENU_FILE}
545 echo "Version=1.0" >> /tmp/${MENU_FILE}
546 echo "Type=Application" >> /tmp/${MENU_FILE}
547 echo "Terminal=false" >> /tmp/${MENU_FILE}
548 echo "Exec=${PGM_EXEC_PATH}" >> /tmp/${MENU_FILE}
549 if [ -z ${PGM_BUILDTYPE} ];
551 echo "Name=${PGM_NAME}-${PGM_VERSION}" >> /tmp/${MENU_FILE}
553 echo "Name=${PGM_NAME}-${PGM_VERSION}-${PGM_BUILDTYPE}" >> /tmp/${MENU_FILE}
555 echo "Icon=${ICON_NAME}" >> /tmp/${MENU_FILE}
556 echo "Comment=Digital Audio Workstation" >> /tmp/${MENU_FILE}
557 echo "Categories=AudioVideo;AudioEditing;Audio;Recorder;" >> /tmp/${MENU_FILE}
559 chmod ugo+rx /tmp/${MENU_FILE}
560 ${SUPER} mv /tmp/${MENU_FILE} ${MENU_FILE_PATH}/.
562 # install the Menu, Link, and Icon(s)
563 if [ "T" = ${HAS_XDG} ];
565 echo "Adding ${PGM_NAME} to the applications menu"
566 ${SUPER} xdg-icon-resource install --context apps --size 16 ${ICON_PATH}/${PGM_NAME}-icon_16px.png ${ICON_NAME}
567 ${SUPER} xdg-icon-resource install --context apps --size 22 ${ICON_PATH}/${PGM_NAME}-icon_22px.png ${ICON_NAME}
568 ${SUPER} xdg-icon-resource install --context apps --size 32 ${ICON_PATH}/${PGM_NAME}-icon_32px.png ${ICON_NAME}
569 ${SUPER} xdg-icon-resource install --context apps --size 48 ${ICON_PATH}/${PGM_NAME}-icon_48px.png ${ICON_NAME}
570 ${SUPER} xdg-icon-resource install --context apps --size 256 ${ICON_PATH}/${PGM_NAME}-icon_256px.png ${ICON_NAME}
572 if [ -e ${ICON_PATH}/${PGM_NAME}_icon.svg -a -d /usr/share/icons/hicolor/scalable/apps ];
574 ${SUPER} cp -f ${ICON_PATH}/${PGM_NAME}_icon.svg /usr/share/icons/hicolor/scalable/apps/${ICON_NAME}.svg
577 ${SUPER} xdg-desktop-menu install ${MENU_FILE_PATH}/${MENU_FILE}
578 ${SUPER} xdg-desktop-menu forceupdate --mode system # Some systems need an extra kick
581 echo "Creating a desktop link for ${PGM_NAME} in ${USER_DESKTOP_DIR}"
582 cp ${MENU_FILE_PATH}/${MENU_FILE} ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
583 chmod ugo+rwx ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
586 echo "Creating a desktop link for ${PGM_NAME} in ${USER_DESKTOP_DIR}"
587 cp ${MENU_FILE_PATH}/${MENU_FILE} ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
588 chmod ugo+rwx ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
592 echo "Copying uninstall script to ${INSTALL_DEST_BASE}"
595 ${SUPER} cp -f ${BUNDLE_DIR}/bin/*.uninstall.sh ${INSTALL_DEST_BASE}/.
597 # Create link to the program in user bin
600 echo "Creating link ${PGM_NAME}${MAJOR_VERSION} in ${USER_BIN_DIR}"
603 if [ -d "${USER_BIN_DIR}" ]; then
604 if [ -e "${USER_BIN_DIR}/${PGM_NAME}${MAJOR_VERSION}" ]; then
605 ${SUPER} rm -f ${USER_BIN_DIR}/${PGM_NAME}${MAJOR_VERSION}
609 ${SUPER} ln -sf ${PGM_EXEC_PATH} ${PGM_NAME}${MAJOR_VERSION}
613 echo "Can not create link because ${USER_BIN_DIR} does not exist"
616 ###########################
617 # Check Jack and qjackctl
618 ###########################
621 echo "Checking to see if Jack is installed"
626 if which jackd > /dev/null; then
628 echo "Jack already present"
629 elif which jackdbus > /dev/null; then
631 echo "jackdbus was found but not jackd. Jack version compatibility check cannot be performed."
636 echo "The program Jack is missing from this system. Jack is a required component of $PGM_NAME."
639 ANSWER=$(VaildateYesNoQuestion "Install jack using system software repository?")
641 if test "y" = $ANSWER;
643 echo "Attempting to install Jack"
644 SystemInstall "jackd"
649 read -p "Press ENTER to continue:" BLAH
656 # Check to see if Jack is new enough to operate correctly.
658 if [ "t" = ${JACK_INSTALLED} ];
661 JACK_VER_STRING=$(jackd --version | grep -e "jackd.*protocol")
662 JACK_NAME=$(echo $JACK_VER_STRING | awk '{print $1}')
663 JACK_VERSION=$(echo $JACK_VER_STRING | awk '{print $3}')
664 JACK_VERSION_MAJOR=$(echo $JACK_VERSION | awk 'BEGIN{FS="."}{print $1}')
665 JACK_VERSION_MIDDLE=$(echo $JACK_VERSION | awk 'BEGIN{FS="."}{print $2}')
666 JACK_VERSION_MINOR=$(echo $JACK_VERSION | awk 'BEGIN{FS="."}{print $3}')
668 if [ "jackd" = ${JACK_NAME} ];
670 if [ ${JACK_VERSION_MAJOR} -eq 0 ];
672 if [ ${JACK_VERSION_MIDDLE} -eq 121 ];
674 if [ ${JACK_VERSION_MINOR} -ge 3 ];
678 elif [ ${JACK_VERSION_MIDDLE} -gt 121 ];
682 elif [ ${JACK_VERSION_MAJOR} -gt 0 ];
686 elif [ "jackdmp" = ${JACK_NAME} ];
688 if [ ${JACK_VERSION_MAJOR} -eq 1 ];
690 if [ ${JACK_VERSION_MIDDLE} -eq 9 ];
692 if [ ${JACK_VERSION_MINOR} -ge 8 ];
696 elif [ ${JACK_VERSION_MIDDLE} -gt 9 ];
700 elif [ ${JACK_VERSION_MAJOR} -gt 1 ];
706 if [ "t" = ${JACK_VERSION_OK} ];
709 echo "Jack Version Check OK (${JACK_VER_STRING})"
713 echo "!!! WARNING !!! - The version of Jack on this system is too old!"
714 echo "Using an old version of Jack is not recommended. Please update"
715 echo "Jack for best results."
717 echo "System Jack version:"
718 echo " ${JACK_VER_STRING}"
720 echo "Recommended minimum versions:"
721 echo " Jack1 - 0.121.3"
722 echo " Jack2 - 1.9.8"
724 read -p "Press ENTER to continue:" BLAH
728 if ! which qjackctl > /dev/null;
731 echo "The program QjackCtl is missing from this system."
732 echo "QjackCtl is an extremely useful tool for any system that runs JACK applications like $PGM_NAME."
733 echo "We recommend that you install it."
736 ANSWER=$(VaildateYesNoQuestion "Install QjackCtl using system software repository?")
738 if test "y" = $ANSWER;
740 echo "Attempting to install QjackCtl"
741 SystemInstall "qjackctl"
746 read -p "Press ENTER to continue:" BLAH
752 ########################
754 ########################
756 USER_GROUP_ADJUSTED="f"
758 if ! ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -a > /dev/null";
761 echo "System failed the quick sanity check... Looking for the cause"
763 if ! ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -rt > /dev/null";
766 echo "System does not allow realtime for the current user... Looking for a solution"
768 if ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -hasaudiogroup > /dev/null";
770 if ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -memberaudiogroup > /dev/null 2>&1";
772 ## This is an odd case. We have an audio group and are a member.
774 echo "!!! WARNING !!! - The current user can not execute realtime processes."
775 echo "This will adversely affect audio latency."
776 echo "This system has an audio group and the user is a member. If jack was"
777 echo "just installed, a simple log out/in may fix this."
779 echo "For best results, please correct this on your system."
780 echo "(Hint: check /etc/security/limits.conf or /etc/security/limits.d/)"
782 read -p "Press ENTER to continue:" BLAH
784 # Not a member of an audio group. Try to fix it.
786 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" ";
788 # add user to audio group
790 echo "Adding user ${USER_NAME} to the audio group."
791 echo "This should allow you to run realtime tasks. Please re-login for this change to take affect."
793 read -p "Press ENTER to continue:" BLAH
795 if ${SUPER} usermod -a -G audio ${USER_NAME};
797 USER_GROUP_ADJUSTED="t"
800 echo "!!! ERROR !!! - Not able to add user to the audio group (usermod failed)!"
802 echo "Please add yourself to the audio group and re-login"
804 read -p "Press ENTER to continue:" BLAH
807 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" ";
809 # add user to jackuser group
811 echo "Adding user ${USER_NAME} to the jackuser group."
812 echo "This should allow you to run realtime tasks. Please re-login for this change to take affect."
814 read -p "Press ENTER to continue:" BLAH
816 if ${SUPER} usermod -a -G jackuser ${USER_NAME};
818 USER_GROUP_ADJUSTED="t"
821 echo "!!! ERROR !!! - Not able to add user to the jackuser group."
823 echo "Please add yourself to the audio group and re-login"
825 read -p "Press ENTER to continue:" BLAH
832 # No audio group found on this system!
834 echo "!!! WARNING !!! - The system does not seem to have an audio group (audio or jackuser)."
836 echo "We will not attempt to fix this. Please configure your system to allow"
837 echo "non-root users to execute realtime tasks."
839 read -p "Press ENTER to continue:" BLAH
843 if ! ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -freqscaling > /dev/null";
846 echo "!!! WARNING !!! - Your system seems to use frequency scaling."
847 echo "This can have a serious impact on audio latency."
848 echo "For best results turn it off, e.g. by choosing the 'performance' governor."
850 read -p "Press ENTER to continue:" BLAH
853 if [ "f" = $USER_GROUP_ADJUSTED ];
855 if ! ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -memlock > /dev/null";
858 echo "!!! WARNING !!! - You are not allowed to lock memory."
860 echo "We will not attempt to fix this. Please configure your system to allow"
861 echo "non-root users to execute lock memory."
863 read -p "Press ENTER to continue:" BLAH
869 ########################
871 ########################
875 rm -rf ${BUNDLE_DIR}/
878 echo "!!! Install Complete !!!"
880 if [ "t" = $USER_GROUP_ADJUSTED ];
882 echo "You will need to logout and then login again for all changes to be complete"
886 read -p "Press ENTER to exit installer:" BLAH