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 ####
36 ########################
37 # Function Definitions
38 ########################
40 VaildateYesNoQuestion ()
47 until test "y" = $INPUT_OK;
50 read -p "$1 [y/n]: " USER_INPUT
53 if [ ! -z $USER_INPUT ];
55 if [ "Y" = $USER_INPUT -o "y" = $USER_INPUT -o "n" = $USER_INPUT -o "N" = $USER_INPUT ];
62 echo $USER_INPUT | tr '[:upper:]' '[:lower:]'
69 # Determine which software install app to use and then install requested package
72 if which yum > /dev/null;
74 ${SUPER} yum -y install $1
80 echo "!!! ERROR !!! yum install failed for an unknown reason."
81 echo "Please install package $1 after this installer completes."
85 elif which apt-get > /dev/null;
87 ${SUPER} apt-get -y install $1
93 echo "!!! ERROR !!! apt-get install failed for an unknown reason."
94 echo "Please install package $1 after this installer completes."
100 echo "!!! ERROR !!! - Not able to detect which software install tool to use (yum or apt-get)."
101 echo "Please install package $1 using the system software install tool."
110 ########################################################################
112 ########################################################################
115 # If you double click a script, some systems don't get the PWD correct.
116 # Force it to be correct
117 PKG_PATH=$(dirname "$(readlink -f "$0")")
121 echo "Welcome to the ${PGM_NAME} installer"
123 echo "${PGM_NAME} will be installed for user ${USER_NAME} in ${INSTALL_DEST_BASE}"
125 #############################
126 # Check for root privileges
127 #############################
132 if [ "$(id -u)" != "0" ]; then
134 if ! which sudo > /dev/null;
137 echo "Sudo installed failed, attempting to install using su"
138 echo "Please enter root password below"
141 if ! su -s $THE_SHELL -c "./.stage2.run";
146 echo "This installer requires root privileges. It is currently not"
147 echo "running as root AND an attempt to use su failed."
149 echo "Please correct this by installing and configuring sudo or running"
150 echo "the installer as root (su -s $THE_SHELL -c)."
152 read -p "Press ENTER to exit installer:" BLAH
157 sudo -k # make sudo forget about cached credentials
163 echo "Attempting to install using su"
164 echo "Please enter root password below"
167 if ! su -s $THE_SHELL -c "./.stage2.run";
172 echo "This installer requires root privileges. It is currently not"
173 echo "running as root AND an attempt to use both sudo and su failed."
175 echo "Please correct this by installing and configuring sudo or running"
176 echo "the installer as root (su -s $THE_SHELL -c)."
178 read -p "Press ENTER to exit installer:" BLAH
185 # The quoting reqired for the su sanityCheck method does not work when used without
186 # su. Using sh -c in the normal case gets around that, but is a bit of a hack.
189 NORM_USER="su -l $USER_NAME -s $THE_SHELL -c"
192 ###############################
193 # Check for install destination
194 ###############################
196 if test -n "$CALL_MKDIR"; then
197 ${SUPER} mkdir -p "$INSTALL_DEST_BASE"
200 if [ ! -d ${INSTALL_DEST_BASE} ];
203 echo "!!! ERROR !!! - Installation location ${INSTALL_DEST_BASE} does not exist!"
204 echo "Installation will not complete."
206 read -p "Press ENTER to exit installer:" BLAH
211 ############################
212 # Determine processor type
213 ############################
216 i[3456789]86|x86|i86pc)
217 echo "Architecture is x86"
221 echo "Architecture is x86_64"
226 echo "!!! ERROR !!! - Unknown architecture `uname -m`"
228 read -p "Press ENTER to exit installer:" BLAH
237 if test -n "$MULTABI_BUNDLE"; then
238 if ${NORM_USER} "${PKG_PATH}/.gcc-glibmm-abi-check --fail --gcc4 > /dev/null"; then
251 # We have to check the current folder and the INSTALL_DEST_BASE just
252 # in case they are on different devices
253 echo "Checking for required disk space"
255 if [ ! -e .${PGM_NAME}_${ARCH}${ABI}-*.size ]; then
257 echo "!!! ERROR !!! Can't locate .size file for ${ARCH}${ABI} bundle."
258 echo "This package is broken or does not support ${ARCH}${ABI}."
260 read -p "Press ENTER to exit installer:" BLAH
263 REQUIRED_BYTES=$(cat .${PGM_NAME}_${ARCH}${ABI}-*.size)
265 #Installer needs 2x the space since the bundle is unpacked locally and then copied
266 REQUIRED_BYTES=$(($REQUIRED_BYTES + $REQUIRED_BYTES))
268 #Check space in current folder
269 FREE_BYTES=$(df -P -B 1 "${PKG_PATH}" | grep / | awk '{print $4}')
271 if [ ${FREE_BYTES} -le ${REQUIRED_BYTES} ] ; then
273 echo "!!! ERROR !!! - Insufficient disk space in ${PKG_PATH}"
274 echo "Install requires ${REQUIRED_BYTES} bytes and"
275 echo "there is only ${FREE_BYTES} bytes of free space"
277 read -p "Press ENTER to exit installer:" BLAH
281 #Check space in INSTALL_DEST_BASE
282 FREE_BYTES=$(df -P -B 1 ${INSTALL_DEST_BASE} | grep / | awk '{print $4}')
284 if [ ${FREE_BYTES} -le ${REQUIRED_BYTES} ] ; then
286 echo "!!! ERROR !!! - Insufficient disk space in ${INSTALL_DEST_BASE}"
287 echo "Install requires ${REQUIRED_BYTES} bytes and"
288 echo "there is only ${FREE_BYTES} bytes of free space"
290 read -p "Press ENTER to exit installer:" BLAH
295 #############################
296 # Determine C11 stdlibc++ ABI
297 #############################
299 if test -z "$ABI"; then
300 if %REPLACE_GCC5%; then
301 # Ardour was compiled with gcc5, warn on gcc4 systems
302 if ! ${NORM_USER} "${PKG_PATH}/.gcc-glibmm-abi-check --gcc5 > /dev/null"; then
304 echo "WARNING: GCC4/5 libstdc++ ABI Mismatch"
306 echo "${PGM_NAME} was compiled with gcc5, your system uses an older version of the"
307 echo "standard c++ library. Plugins on your system may not load or plugin-UIs"
308 echo "may cause crashes."
310 ANSWER=$(VaildateYesNoQuestion "Continue anyway?")
311 if test "n" = $ANSWER; then
316 # Ardour was compiled with gcc4, warn on gcc5 systems
317 if ! ${NORM_USER} "${PKG_PATH}/.gcc-glibmm-abi-check --gcc4 > /dev/null"; then
319 echo "WARNING: GCC4/5 libstdc++ ABI Mismatch"
321 echo "${PGM_NAME} was compiled with gcc4, your system uses a newer version of the"
322 echo "standard c++ library. Plugins on your system may not load or plugin-UIs"
323 echo "may cause crashes."
325 ANSWER=$(VaildateYesNoQuestion "Continue anyway?")
326 if test "n" = $ANSWER; then
333 if %REPLACE_WINE%; then
334 if test -z "`which wine`"; then
336 echo "!!! ERROR !!! - 'wine' was not found."
338 echo "This version of ${PGM_NAME} with Windows VST support requires wine."
339 echo "https://www.winehq.org/"
341 read -p "Press ENTER to exit installer:" BLAH
346 #####################
348 #####################
350 FILESYSTEM_TYPE=$(df -P -T "${PKG_PATH}" | grep / | awk '{print $2}')
351 echo "Bundle is on ${FILESYSTEM_TYPE} filesystem"
353 # untar the correct bundle for us to install
354 echo "Unpacking bundle for $ARCH${ABI}"
356 if [ ! -e ${PGM_NAME}_${ARCH}${ABI}-*.tar ]; then
358 echo "!!! ERROR !!! Can't locate ${ARCH}${ABI} bundle file."
360 read -p "Press ENTER to exit installer:" BLAH
364 if ! tar -xf ${PGM_NAME}_${ARCH}${ABI}-*.tar; then
366 echo "!!! ERROR !!! Can't unpack ${ARCH}${ABI} bundle file."
368 read -p "Press ENTER to exit installer:" BLAH
371 echo "Bundle unpacked"
374 BUNDLE_DIR=$(basename `find -maxdepth 1 -type d -name "${PGM_NAME}_${ARCH}-*"`)
377 #######################
378 # Check for xdg utils
379 #######################
381 #load the file that contains the translated names of the users directories
382 if [ -e /home/${USER_NAME}/.config/user-dirs.dirs ]; then
383 . /home/${USER_NAME}/.config/user-dirs.dirs
386 if [ "$(id -u)" != "0" ]; then
387 USER_DESKTOP_DIR=${XDG_DESKTOP_DIR:-$HOME/Desktop}
389 #running as root with su makes this more difficult
390 DESKTOP_FOLDER=$(echo ${XDG_DESKTOP_DIR:-$HOME/Desktop} | awk -F/ '{print $NF}')
391 USER_DESKTOP_DIR="/home/${USER_NAME}/${DESKTOP_FOLDER}"
394 XDG_MENU_VER=$(xdg-desktop-menu --version 2> /dev/null)
395 if [ -z "$XDG_MENU_VER" ];
397 echo "System does not have xdg-desktop-menu installed"
401 XDG_ICON_VER=$(xdg-icon-resource --version 2> /dev/null)
402 if [ -z "$XDG_ICON_VER" ];
404 echo "System does not have xdg-icon-resource installed"
408 #################################################
410 #################################################
411 if %REPLACE_WINE%; then
413 echo "Searching libwine.so (Windows VST support)"
414 # we need to add libwine to ardour's LD_LIBRARY_PATH
415 # libwine itself includes paths to the various system-components
416 # which may be different on each platform.
418 # There's some chicken/egg here: ardour.exe.so is linked against libwine.so
419 # at build-time. wine/wineloader assumes a windows-application (which does not use libwine
420 # directly) and does not set up the LD path to libwine itself. the application terminates
421 # (missing libs) before it even starts..
423 # wine itself does not provide means to find the location of libwine.
424 # /usr/bin/wine is usually shell-script and libwine.so can be found in
425 # various places on different distros.
427 # if this check were quick and easy.. it should be done in the startup-script, but it's not
428 # so here we go... (updating wine may require re-installing ardour)
430 # on recent Ubuntu wine does load both:
431 # /usr/lib/i386-linux-gnu/libwine.so.1
433 # /usr/lib/x86_64-linux-gnu/libwine.so.1
434 # so we need to work around this (thanks).
435 # (this hack break 64bit LinuxVST builds, but we don't do those anyway)
438 LD_DEBUG=files wine `pwd`/${BUNDLE_DIR}/lib/ardour-vst-scanner.exe.so 2>&1 \
439 | grep -e "calling init:.*libwine" \
440 | sed 's/^.*calling init: //' \
441 | grep -v x86_64-linux-gnu \
444 if ! test -f "$LIBWINE"; then
446 echo "!!! ERROR !!! - 'libwine.so*' was not found."
448 read -p "Press ENTER to exit installer:" BLAH
451 echo "Using: $LIBWINE"
452 # this replaces/overwrites the bundled libwine
453 cp -L "$LIBWINE" `pwd`/${BUNDLE_DIR}/lib/libwine.so.1
456 #################################################
457 # Check if system libs are OK (libc, etc)
458 #################################################
461 echo "Checking system libs to see if they are compatible with ${PGM_NAME}."
465 LD_PATH=`pwd`/${BUNDLE_DIR}/lib
468 LDD_RESULT=$(LD_LIBRARY_PATH=${LD_PATH} ldd ${BUNDLE_DIR}/bin/${PGM_NAME_LOWER}-* 2>&1 > /dev/null | grep -v "no version information")
470 if [ -n "$LDD_RESULT" ];
477 LIB_FILES=$(find ${BUNDLE_DIR}/lib -name "*.so")
479 for path in $LIB_FILES
481 LDD_RESULT=$(LD_LIBRARY_PATH=${LD_PATH} ldd $path 2>&1 > /dev/null | grep -v "no version information")
482 if [ -n "$LDD_RESULT" ];
489 if test "T" = $LIB_ERROR;
492 echo "!!! ERROR !!! - Missing library detected!"
493 echo "This system does not have the correct libs to run ${PGM_NAME}."
494 echo "Installation will not complete. Please use a compatible distro."
496 read -p "Press ENTER to exit installer:" BLAH
500 ################################
501 # Setup derived variables
502 ################################
503 PGM_VERSION=$(echo ${BUNDLE_DIR} | cut -d- -f2)
504 PGM_BUILDTYPE=$(echo ${BUNDLE_DIR} | cut -d- -f3)
506 if [ -z ${PGM_BUILDTYPE} ];
508 PGM_FULL_NAME="${PGM_NAME}-${PGM_VERSION}"
509 ICON_NAME="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}" #no dash between name and version since dash seperates vendor from program
510 MENU_FILE="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}.desktop" #no dash between name and version since dash seperates vendor from program
511 DESKTOP_LINK_FILE="${PGM_NAME}_${PGM_VERSION}.desktop"
513 PGM_FULL_NAME="${PGM_NAME}-${PGM_VERSION}-${PGM_BUILDTYPE}"
514 ICON_NAME="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}" #no dash between name and version since dash seperates vendor from program
515 MENU_FILE="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}.desktop" #no dash between name and version since dash seperates vendor from program
516 DESKTOP_LINK_FILE="${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}.desktop"
519 PGM_EXEC_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/${PGM_EXEC_FILE}"
520 ICON_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/share/resources"
521 MENU_FILE_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/share"
523 ################################
524 # Install bundle and Menu/Link
525 ################################
527 # uninstall any older versions
528 UNINSTALLERS=$(find ${INSTALL_DEST_BASE} -maxdepth 1 -type f -name "${PGM_NAME}-*.uninstall.sh")
529 if [ ! -z "$UNINSTALLERS" ];
531 for i in $UNINSTALLERS; do
533 echo "Found existing ${PGM_NAME} installation."
535 ANSWER=$(VaildateYesNoQuestion "Do you want to run the uninstaller ${i} ?")
537 if test "y" = $ANSWER;
540 echo "Running uninstaller $i"
552 echo "Installing ${PGM_NAME} ${PGM_VERSION} in ${INSTALL_DEST_BASE}"
555 # Copy the new version in the install directory
556 ${SUPER} mkdir ${INSTALL_DEST_BASE}/${PGM_FULL_NAME}
557 ${SUPER} cp -Rf ${BUNDLE_DIR}/* ${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/
559 # write the desktop/menu file
560 echo "[Desktop Entry]" > /tmp/${MENU_FILE}
561 echo "Encoding=UTF-8" >> /tmp/${MENU_FILE}
562 echo "Version=1.0" >> /tmp/${MENU_FILE}
563 echo "Type=Application" >> /tmp/${MENU_FILE}
564 echo "Terminal=false" >> /tmp/${MENU_FILE}
565 echo "Exec=${PGM_EXEC_PATH}" >> /tmp/${MENU_FILE}
566 if [ -z ${PGM_BUILDTYPE} ];
568 echo "Name=${PGM_NAME}-${PGM_VERSION}" >> /tmp/${MENU_FILE}
570 echo "Name=${PGM_NAME}-${PGM_VERSION}-${PGM_BUILDTYPE}" >> /tmp/${MENU_FILE}
572 echo "Icon=${ICON_NAME}" >> /tmp/${MENU_FILE}
573 echo "Comment=Digital Audio Workstation" >> /tmp/${MENU_FILE}
574 echo "Categories=AudioVideo;AudioEditing;Audio;Recorder;" >> /tmp/${MENU_FILE}
576 chmod ugo+rx /tmp/${MENU_FILE}
577 ${SUPER} mv /tmp/${MENU_FILE} ${MENU_FILE_PATH}/.
579 # install the Menu, Link, and Icon(s)
580 if [ "T" = ${HAS_XDG} ];
582 echo "Adding ${PGM_NAME} to the applications menu"
583 ${SUPER} xdg-icon-resource install --context apps --size 16 ${ICON_PATH}/${PGM_NAME}-icon_16px.png ${ICON_NAME}
584 ${SUPER} xdg-icon-resource install --context apps --size 22 ${ICON_PATH}/${PGM_NAME}-icon_22px.png ${ICON_NAME}
585 ${SUPER} xdg-icon-resource install --context apps --size 32 ${ICON_PATH}/${PGM_NAME}-icon_32px.png ${ICON_NAME}
586 ${SUPER} xdg-icon-resource install --context apps --size 48 ${ICON_PATH}/${PGM_NAME}-icon_48px.png ${ICON_NAME}
587 ${SUPER} xdg-icon-resource install --context apps --size 256 ${ICON_PATH}/${PGM_NAME}-icon_256px.png ${ICON_NAME}
589 if [ -e ${ICON_PATH}/${PGM_NAME}_icon.svg -a -d /usr/share/icons/hicolor/scalable/apps ];
591 ${SUPER} cp -f ${ICON_PATH}/${PGM_NAME}_icon.svg /usr/share/icons/hicolor/scalable/apps/${ICON_NAME}.svg
594 ${SUPER} xdg-desktop-menu install ${MENU_FILE_PATH}/${MENU_FILE}
595 ${SUPER} xdg-desktop-menu forceupdate --mode system # Some systems need an extra kick
598 echo "Creating a desktop link for ${PGM_NAME} in ${USER_DESKTOP_DIR}"
599 cp ${MENU_FILE_PATH}/${MENU_FILE} ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
600 chmod ugo+rwx ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
603 echo "Creating a desktop link for ${PGM_NAME} in ${USER_DESKTOP_DIR}"
604 cp ${MENU_FILE_PATH}/${MENU_FILE} ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
605 chmod ugo+rwx ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
609 echo "Copying uninstall script to ${INSTALL_DEST_BASE}"
612 ${SUPER} cp -f ${BUNDLE_DIR}/bin/*.uninstall.sh ${INSTALL_DEST_BASE}/.
614 # Create link to the program in user bin
617 echo "Creating link ${PGM_NAME}${MAJOR_VERSION} in ${USER_BIN_DIR}"
620 if [ -d "${USER_BIN_DIR}" ]; then
621 if [ -e "${USER_BIN_DIR}/${PGM_NAME}${MAJOR_VERSION}" ]; then
622 ${SUPER} rm -f ${USER_BIN_DIR}/${PGM_NAME}${MAJOR_VERSION}
626 ${SUPER} ln -sf ${PGM_EXEC_PATH} ${PGM_NAME}${MAJOR_VERSION}
630 echo "Can not create link because ${USER_BIN_DIR} does not exist"
633 ###########################
634 # Check Jack and qjackctl
635 ###########################
638 echo "Checking to see if Jack is installed"
643 if which jackd > /dev/null; then
645 echo "Jack already present"
646 elif which jackdbus > /dev/null; then
648 echo "jackdbus was found but not jackd. Jack version compatibility check cannot be performed."
653 echo "The program Jack is missing from this system. Jack is a required component of $PGM_NAME."
656 ANSWER=$(VaildateYesNoQuestion "Install jack using system software repository?")
658 if test "y" = $ANSWER;
660 echo "Attempting to install Jack"
661 SystemInstall "jackd"
666 read -p "Press ENTER to continue:" BLAH
673 # Check to see if Jack is new enough to operate correctly.
675 if [ "t" = ${JACK_INSTALLED} ];
678 JACK_VER_STRING=$(jackd --version | grep -e "jackd.*protocol")
679 JACK_NAME=$(echo $JACK_VER_STRING | awk '{print $1}')
680 JACK_VERSION=$(echo $JACK_VER_STRING | awk '{print $3}')
681 JACK_VERSION_MAJOR=$(echo $JACK_VERSION | awk 'BEGIN{FS="."}{print $1}')
682 JACK_VERSION_MIDDLE=$(echo $JACK_VERSION | awk 'BEGIN{FS="."}{print $2}')
683 JACK_VERSION_MINOR=$(echo $JACK_VERSION | awk 'BEGIN{FS="."}{print $3}')
685 if [ "jackd" = ${JACK_NAME} ];
687 if [ ${JACK_VERSION_MAJOR} -eq 0 ];
689 if [ ${JACK_VERSION_MIDDLE} -eq 121 ];
691 if [ ${JACK_VERSION_MINOR} -ge 3 ];
695 elif [ ${JACK_VERSION_MIDDLE} -gt 121 ];
699 elif [ ${JACK_VERSION_MAJOR} -gt 0 ];
703 elif [ "jackdmp" = ${JACK_NAME} ];
705 if [ ${JACK_VERSION_MAJOR} -eq 1 ];
707 if [ ${JACK_VERSION_MIDDLE} -eq 9 ];
709 if [ ${JACK_VERSION_MINOR} -ge 8 ];
713 elif [ ${JACK_VERSION_MIDDLE} -gt 9 ];
717 elif [ ${JACK_VERSION_MAJOR} -gt 1 ];
723 if [ "t" = ${JACK_VERSION_OK} ];
726 echo "Jack Version Check OK (${JACK_VER_STRING})"
730 echo "!!! WARNING !!! - The version of Jack on this system is too old!"
731 echo "Using an old version of Jack is not recommended. Please update"
732 echo "Jack for best results."
734 echo "System Jack version:"
735 echo " ${JACK_VER_STRING}"
737 echo "Recommended minimum versions:"
738 echo " Jack1 - 0.121.3"
739 echo " Jack2 - 1.9.8"
741 read -p "Press ENTER to continue:" BLAH
745 if ! which qjackctl > /dev/null;
748 echo "The program QjackCtl is missing from this system."
749 echo "QjackCtl is an extremely useful tool for any system that runs JACK applications like $PGM_NAME."
750 echo "We recommend that you install it."
753 ANSWER=$(VaildateYesNoQuestion "Install QjackCtl using system software repository?")
755 if test "y" = $ANSWER;
757 echo "Attempting to install QjackCtl"
758 SystemInstall "qjackctl"
763 read -p "Press ENTER to continue:" BLAH
769 ########################
771 ########################
773 USER_GROUP_ADJUSTED="f"
775 if ! ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -a > /dev/null";
778 echo "System failed the quick sanity check... Looking for the cause"
780 if ! ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -rt > /dev/null";
783 echo "System does not allow realtime for the current user... Looking for a solution"
785 if ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -hasaudiogroup > /dev/null";
787 if ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -memberaudiogroup > /dev/null 2>&1";
789 ## This is an odd case. We have an audio group and are a member.
791 echo "!!! WARNING !!! - The current user can not execute realtime processes."
792 echo "This will adversely affect audio latency."
793 echo "This system has an audio group and the user is a member. If jack was"
794 echo "just installed, a simple log out/in may fix this."
796 echo "For best results, please correct this on your system."
797 echo "(Hint: check /etc/security/limits.conf or /etc/security/limits.d/)"
799 read -p "Press ENTER to continue:" BLAH
801 # Not a member of an audio group. Try to fix it.
803 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" ";
805 # add user to audio group
807 echo "Adding user ${USER_NAME} to the audio group."
808 echo "This should allow you to run realtime tasks. Please re-login for this change to take affect."
810 read -p "Press ENTER to continue:" BLAH
812 if ${SUPER} usermod -a -G audio ${USER_NAME};
814 USER_GROUP_ADJUSTED="t"
817 echo "!!! ERROR !!! - Not able to add user to the audio group (usermod failed)!"
819 echo "Please add yourself to the audio group and re-login"
821 read -p "Press ENTER to continue:" BLAH
824 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" ";
826 # add user to jackuser group
828 echo "Adding user ${USER_NAME} to the jackuser group."
829 echo "This should allow you to run realtime tasks. Please re-login for this change to take affect."
831 read -p "Press ENTER to continue:" BLAH
833 if ${SUPER} usermod -a -G jackuser ${USER_NAME};
835 USER_GROUP_ADJUSTED="t"
838 echo "!!! ERROR !!! - Not able to add user to the jackuser group."
840 echo "Please add yourself to the audio group and re-login"
842 read -p "Press ENTER to continue:" BLAH
849 # No audio group found on this system!
851 echo "!!! WARNING !!! - The system does not seem to have an audio group (audio or jackuser)."
853 echo "We will not attempt to fix this. Please configure your system to allow"
854 echo "non-root users to execute realtime tasks."
856 read -p "Press ENTER to continue:" BLAH
860 if ! ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -freqscaling > /dev/null";
863 echo "!!! WARNING !!! - Your system seems to use frequency scaling."
864 echo "This can have a serious impact on audio latency."
865 echo "For best results turn it off, e.g. by choosing the 'performance' governor."
867 read -p "Press ENTER to continue:" BLAH
870 if [ "f" = $USER_GROUP_ADJUSTED ];
872 if ! ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -memlock > /dev/null";
875 echo "!!! WARNING !!! - You are not allowed to lock memory."
877 echo "We will not attempt to fix this. Please configure your system to allow"
878 echo "non-root users to execute lock memory."
880 read -p "Press ENTER to continue:" BLAH
886 ########################
888 ########################
892 rm -rf ${BUNDLE_DIR}/
895 echo "!!! Install Complete !!!"
897 if [ "t" = $USER_GROUP_ADJUSTED ];
899 echo "You will need to logout and then login again for all changes to be complete"
903 read -p "Press ENTER to exit installer:" BLAH