找回密码
 -注册-
查看: 2449|回复: 6
打印 上一主题 下一主题

尝试在达菲Daphile测试版系统安装Roon Bridge x86_64

[复制链接]
跳转到指定楼层
1
发表于 2024-6-21 12:23 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式 来自 广东广州
本帖最后由 feifenspace 于 2024-6-21 14:32 编辑

1、把代码保存为roonbridge-installer-linuxx64.sh
vi roonbridge-installer-linuxx64.sh
粘贴代码保存
2、确保你的脚本是正确的且具有执行权限。你可以使用以下命令来确保脚本具有执行权限:
chmod +x roonbridge-installer-linuxx64.sh
3、如果你想安装RoonBridge,请使用以下命令:
sudo ./roonbridge-installer-linuxx64.sh install





  1. #!/bin/bash

  2. # blow up on non-zero exit code
  3. set -e

  4. # these are replaced by build.sh
  5. PACKAGE_NAME=RoonBridge
  6. ARCH=x64
  7. PACKAGE_URL=https://download.roonlabs.net/builds/RoonBridge_linuxx64.tar.bz2
  8. PACKAGE_FILE=${PACKAGE_NAME}_linux${ARCH}.tar.bz2
  9. PACKAGE_NAME_LOWER=$(echo "$PACKAGE_NAME" | tr "[A-Z]" "[a-z]")

  10. TMPDIR=$(mktemp -d)
  11. MACHINE_ARCH=$(uname -m)
  12. OK=0

  13. CLEAN_EXIT=0

  14. # for colorization
  15. ESC_SEQ="\033["
  16. COL_RESET=$ESC_SEQ"39;49;00m"
  17. COL_RED=$ESC_SEQ"31;01m"
  18. COL_GREEN=$ESC_SEQ"32;01m"
  19. COL_YELLOW=$ESC_SEQ"33;01m"
  20. COL_BLUE=$ESC_SEQ"34;01m"
  21. COL_MAGENTA=$ESC_SEQ"35;01m"
  22. COL_CYAN=$ESC_SEQ"36;01m"
  23. COL_BOLD=$ESC_SEQ"1m"

  24. function hr {
  25.     echo -e "${COL_BOLD}--------------------------------------------------------------------------------------${COL_RESET}"
  26. }

  27. function clean_up {
  28.     rm -Rf $TMPDIR
  29.     if [ x$CLEAN_EXIT != x1 ]; then
  30.         echo ""
  31.         hr
  32.         echo ""
  33.         echo -e "${COL_BOLD}${COL_RED}The $PACKAGE_NAME installer did not complete successfully.${COL_RESET}"
  34.         echo ""
  35.         echo "If you are not sure how to proceed, please check out:"
  36.         echo ""
  37.         echo " - Roon Labs Community            https://community.roonlabs.com/c/support"
  38.         echo " - Roon Labs Knowledge Base       https://kb.roonlabs.com/LinuxInstall"
  39.         echo ""
  40.         hr
  41.         echo ""
  42.     fi
  43. }
  44. trap clean_up EXIT

  45. function install {
  46.     #
  47.     # Print banner/message
  48.     #
  49.     echo ""
  50.     hr
  51.     echo ""
  52.     echo -e "${COL_BOLD}Welcome to the $PACKAGE_NAME installer${COL_RESET}"
  53.     echo ""
  54.     echo "This installer sets up $PACKAGE_NAME to run on linux with the following settings:"
  55.     echo ""
  56.     echo " - $PACKAGE_NAME will be installed in /opt/$PACKAGE_NAME"
  57.     echo " - $PACKAGE_NAME's data will be stored in /var/roon/$PACKAGE_NAME"
  58.     echo " - $PACKAGE_NAME will be configured to run as a system service"
  59.     echo " - $PACKAGE_NAME will run as root"
  60.     echo ""
  61.     echo "These settings are suitable for turning a dedicated or semi-dedicated device"
  62.     echo "into an appliance that runs $PACKAGE_NAME"
  63.     echo ""
  64.     echo "If you want customize how $PACKAGE_NAME is installed, see:"
  65.     echo ""
  66.     echo "   http://kb.roonlabs.com/LinuxInstall"
  67.     echo ""
  68.     hr
  69.     echo ""


  70.     #
  71.     # Check for linux (in case someone runs on OS X, Cygwin, BSD, etc)
  72.     #
  73.     case $(uname -s) in
  74.         Linux)
  75.             ;;
  76.         *)
  77.             echo -e "${COL_RED}${COL_BOLD}Error:${COL_RESET} This package is intended for Linux platforms. It is not compatible with your machine. Exiting."
  78.             exit 1
  79.             ;;
  80.     esac

  81.     #
  82.     # Check for proper architecture
  83.     #
  84.     case "$MACHINE_ARCH" in
  85.         armv7*)
  86.             if [ x$ARCH = xarmv7hf ]; then OK=1; fi
  87.             ;;
  88.         aarch64*)
  89.             if [ x$ARCH = xarmv8 ]; then OK=1; fi
  90.             if [ x$ARCH = xarmv7hf ]; then OK=1; fi
  91.             ;;
  92.         x86_64*)
  93.             if [ x$ARCH = xx64 ]; then OK=1; fi
  94.             ;;
  95.         i686*)
  96.             if [ x$ARCH = xx86 ]; then OK=1; fi
  97.             ;;
  98.     esac

  99.     #
  100.     # Check for root privileges
  101.     #
  102.     if [ x$UID != x0 ]; then
  103.         echo ""
  104.         echo -e "${COL_RED}${COL_BOLD}Error:${COL_RESET} This installer must be run with root privileges. Exiting."
  105.         echo ""
  106.         exit 2
  107.     fi

  108.     #
  109.     # Check for curl (used for downloading files)
  110.     #
  111.     if ! command -v curl &> /dev/null
  112.     then
  113.         echo "curl could not be found, installing..."
  114.         emerge --ask net-misc/curl
  115.     fi

  116.     #
  117.     # Check for tar (used for extracting files)
  118.     #
  119.     if ! command -v tar &> /dev/null
  120.     then
  121.         echo "tar could not be found, installing..."
  122.         emerge --ask app-arch/tar
  123.     fi

  124.     #
  125.     # Check for proper architecture
  126.     #
  127.     if [ x$OK != x1 ]; then
  128.         echo ""
  129.         echo -e "${COL_RED}${COL_BOLD}Error:${COL_RESET} This package is intended for $ARCH platforms. It is not compatible with your machine. Exiting."
  130.         echo ""
  131.         exit 3
  132.     fi

  133.     function confirm_n {
  134.         while true; do
  135.             read -p "$1 [y/N] " yn
  136.             case $yn in
  137.                 [Yy]* )
  138.                     break
  139.                     ;;
  140.                 "")
  141.                     CLEAN_EXIT=1
  142.                     echo ""
  143.                     echo "Ok. Exiting."
  144.                     echo ""
  145.                     exit 4
  146.                     ;;
  147.                 [Nn]* )
  148.                     CLEAN_EXIT=1
  149.                     echo ""
  150.                     echo "Ok. Exiting."
  151.                     echo ""
  152.                     exit 4
  153.                     ;;
  154.                 * ) echo "Please answer yes or no.";;
  155.             esac
  156.         done
  157.     }

  158.     function confirm {
  159.         while true; do
  160.             read -p "$1 [Y/n] " yn
  161.             case $yn in
  162.                 "")
  163.                     break
  164.                     ;;
  165.                 [Yy]* )
  166.                     break
  167.                     ;;
  168.                 [Nn]* )
  169.                     CLEAN_EXIT=1
  170.                     echo ""
  171.                     echo "Ok. Exiting."
  172.                     echo ""
  173.                     exit 4
  174.                     ;;
  175.                 * ) echo "Please answer yes or no.";;
  176.             esac
  177.         done
  178.     }

  179.     #
  180.     # Double-check with user that this is what they want
  181.     #
  182.     confirm "Do you want to install $PACKAGE_NAME on this machine?"

  183.     echo ""
  184.     echo "Downloading $PACKAGE_FILE to $TMPDIR/$PACKAGE_FILE"
  185.     echo ""
  186.     curl -L -# -o "$TMPDIR/$PACKAGE_FILE" "$PACKAGE_URL"

  187.     echo ""
  188.     echo -n "Unpacking ${PACKAGE_FILE}..."
  189.     cd $TMPDIR
  190.     tar xf "$PACKAGE_FILE"
  191.     echo "Done"

  192.     if [ ! -d "$TMPDIR/$PACKAGE_NAME" ]; then
  193.         echo "Missing directory: $TMPDIR/$PACKAGE_NAME. This indicates a broken package."
  194.         exit 5
  195.     fi

  196.     if [ ! -f "$TMPDIR/$PACKAGE_NAME/check.sh" ]; then
  197.         echo "Missing $TMPDIR/$PACKAGE_NAME/check.sh. This indicates a broken package."
  198.         exit 5
  199.     fi

  200.     $TMPDIR/$PACKAGE_NAME/check.sh

  201.     if [ -e /opt/$PACKAGE_NAME ]; then
  202.         hr
  203.         echo ""
  204.         echo -e "${COL_RED}${COL_BOLD}Warning:${COL_RESET} The /opt/$PACKAGE_NAME directory already exists."
  205.         echo ""
  206.         echo "This usually indicates that $PACKAGE_NAME was installed previously on this machine."
  207.         echo ""
  208.         confirm_n "Do you want to remove /opt/$PACKAGE_NAME and proceed with the install?"
  209.         echo ""
  210.         rm -rf /opt/$PACKAGE_NAME
  211.     fi

  212.     if [ -e /etc/systemd/system/$PACKAGE_NAME.service ]; then
  213.         hr
  214.         echo ""
  215.         echo -e "${COL_RED}${COL_BOLD}Warning:${COL_RESET} The /etc/systemd/system/$PACKAGE_NAME.service file already exists."
  216.         echo ""
  217.         echo "This usually indicates that $PACKAGE_NAME was installed previously on this machine."
  218.         echo ""
  219.         confirm_n "Do you want to remove /etc/systemd/system/$PACKAGE_NAME.service and proceed with the install?"
  220.         echo ""
  221.         systemctl stop $PACKAGE_NAME || true
  222.         rm -rf /etc/systemd/system/$PACKAGE_NAME.service
  223.         systemctl daemon-reload
  224.     fi

  225.     if [ -e /etc/init.d/$PACKAGE_NAME ]; then
  226.         hr
  227.         echo ""
  228.         echo -e "${COL_RED}${COL_BOLD}Warning:${COL_RESET} The /etc/init.d/$PACKAGE_NAME file already exists."
  229.         echo ""
  230.         echo "This usually indicates that $PACKAGE_NAME was installed previously on this machine."
  231.         echo ""
  232.         confirm_n "Do you want to remove /etc/init.d/$PACKAGE_NAME and proceed with the install?"
  233.         echo ""
  234.         /etc/init.d/$PACKAGE_NAME stop || true
  235.         rm -rf /etc/init.d/$PACKAGE_NAME
  236.     fi

  237.     echo ""
  238.     echo "Copying files to /opt/$PACKAGE_NAME..."
  239.     cp -pR $TMPDIR/$PACKAGE_NAME /opt

  240.     #
  241.     # set up OpenRC service
  242.     #
  243.     SERVICE_FILE=/etc/init.d/${PACKAGE_NAME_LOWER}

  244.     echo ""
  245.     echo "Stopping service ${PACKAGE_NAME_LOWER} if it exists..."
  246.     /etc/init.d/$PACKAGE_NAME_LOWER stop || true

  247.     cat > $SERVICE_FILE << END_OPENRC
  248. #!/sbin/openrc-run

  249. name="${PACKAGE_NAME}"
  250. description="Roon Bridge Service"
  251. command="/opt/${PACKAGE_NAME}/start.sh"
  252. pidfile="/var/run/${PACKAGE_NAME_LOWER}.pid"
  253. command_background="yes"

  254. depend() {
  255.     need net
  256. }
  257. END_OPENRC

  258.     echo "wrote out OpenRC service file"
  259.     chmod +x ${SERVICE_FILE}

  260.     echo ""
  261.     echo "Adding service ${PACKAGE_NAME_LOWER} to default runlevel..."
  262.     rc-update add ${PACKAGE_NAME_LOWER} default

  263.     echo ""
  264.     echo "Starting service ${PACKAGE_NAME_LOWER}..."
  265.     rc-service ${PACKAGE_NAME_LOWER} start
  266.     echo "Service Started"

  267.     CLEAN_EXIT=1

  268.     echo ""
  269.     hr
  270.     echo ""
  271.     echo -e "${COL_GREEN}${COL_BOLD}All Done!${COL_RESET}"
  272.     echo ""
  273.     echo "$PACKAGE_NAME has been installed and started."
  274.     echo ""
  275.     hr
  276.     echo ""

  277. }

  278. function uninstall {
  279.     #
  280.     # Print banner/message
  281.     #
  282.     echo ""
  283.     hr
  284.     echo ""
  285.     echo -e "${COL_BOLD}Welcome to the $PACKAGE_NAME uninstaller${COL_RESET}"
  286.     echo ""
  287.     hr
  288.     echo ""


  289.     #
  290.     # Check for linux (in case someone runs on OS X, Cygwin, BSD, etc)
  291.     #
  292.     case $(uname -s) in
  293.         Linux)
  294.             ;;
  295.         *)
  296.             echo -e "${COL_RED}${COL_BOLD}Error:${COL_RESET} This package is intended for Linux platforms. It is not compatible with your machine. Exiting."
  297.             exit 1
  298.             ;;
  299.     esac

  300.     #
  301.     # Check for proper architecture
  302.     #
  303.     case "$MACHINE_ARCH" in
  304.         armv7*)
  305.             if [ x$ARCH = xarmv7hf ]; then OK=1; fi
  306.             ;;
  307.         aarch64*)
  308.             if [ x$ARCH = xarmv8 ]; then OK=1; fi
  309.             if [ x$ARCH = xarmv7hf ]; then OK=1; fi
  310.             ;;
  311.         x86_64*)
  312.             if [ x$ARCH = xx64 ]; then OK=1; fi
  313.             ;;
  314.         i686*)
  315.             if [ x$ARCH = xx86 ]; then OK=1; fi
  316.             ;;
  317.     esac

  318.     #
  319.     # Check for root privileges
  320.     #
  321.     if [ x$UID != x0 ]; then
  322.         echo ""
  323.         echo -e "${COL_RED}${COL_BOLD}Error:${COL_RESET} This installer must be run with root privileges. Exiting."
  324.         echo ""
  325.         exit 2
  326.     fi

  327.     #
  328.     # Check for proper architecture
  329.     #
  330.     if [ x$OK != x1 ]; then
  331.         echo ""
  332.         echo -e "${COL_RED}${COL_BOLD}Error:${COL_RESET} This package is intended for $ARCH platforms. It is not compatible with your machine. Exiting."
  333.         echo ""
  334.         exit 3
  335.     fi

  336.     function confirm_n {
  337.         while true; do
  338.             read -p "$1 [y/N] " yn
  339.             case $yn in
  340.                 [Yy]* )
  341.                     break
  342.                     ;;
  343.                 "")
  344.                     CLEAN_EXIT=1
  345.                     echo ""
  346.                     echo "Ok. Exiting."
  347.                     echo ""
  348.                     exit 4
  349.                     ;;
  350.                 [Nn]* )
  351.                     CLEAN_EXIT=1
  352.                     echo ""
  353.                     echo "Ok. Exiting."
  354.                     echo ""
  355.                     exit 4
  356.                     ;;
  357.                 * ) echo "Please answer yes or no.";;
  358.             esac
  359.         done
  360.     }

  361.     function confirm {
  362.         while true; do
  363.             read -p "$1 [Y/n] " yn
  364.             case $yn in
  365.                 "")
  366.                     break
  367.                     ;;
  368.                 [Yy]* )
  369.                     break
  370.                     ;;
  371.                 [Nn]* )
  372.                     CLEAN_EXIT=1
  373.                     echo ""
  374.                     echo "Ok. Exiting."
  375.                     echo ""
  376.                     exit 4
  377.                     ;;
  378.                 * ) echo "Please answer yes or no.";;
  379.             esac
  380.         done
  381.     }

  382.     #
  383.     # Double-check with user that this is what they want
  384.     #
  385.     confirm "Do you want to uninstall $PACKAGE_NAME from this machine?"

  386.     if [ -e /opt/$PACKAGE_NAME ]; then
  387.         echo ""
  388.         echo "Stopping service ${PACKAGE_NAME_LOWER} if it exists..."
  389.         /etc/init.d/$PACKAGE_NAME_LOWER stop || true

  390.         echo ""
  391.         echo "Removing /opt/$PACKAGE_NAME..."
  392.         rm -rf /opt/$PACKAGE_NAME
  393.     fi

  394.     if [ -e /etc/init.d/$PACKAGE_NAME_LOWER ]; then
  395.         echo ""
  396.         echo "Removing service ${PACKAGE_NAME_LOWER}..."
  397.         rc-update del ${PACKAGE_NAME_LOWER} default || true
  398.         rm -f /etc/init.d/${PACKAGE_NAME_LOWER}
  399.     fi

  400.     CLEAN_EXIT=1

  401.     echo ""
  402.     hr
  403.     echo ""
  404.     echo -e "${COL_GREEN}${COL_BOLD}All Done!${COL_RESET}"
  405.     echo ""
  406.     echo "$PACKAGE_NAME has been uninstalled."
  407.     echo ""
  408.     hr
  409.     echo ""

  410. }

  411. if [[ "$1" == "install" ]]; then
  412.     install
  413. elif [[ "$1" == "uninstall" ]]; then
  414.     uninstall
  415. else
  416.     echo "Usage: $0 [install|uninstall]"
  417.     exit 1
  418. fi

复制代码


2
发表于 2024-6-21 13:49 | 只看该作者 来自 广东广州
成功了没?
回复

使用道具 举报

3
 楼主| 发表于 2024-6-21 20:42 | 只看该作者 来自 广东广州

成功了的,不可以跟达菲同时共用一个声卡,做roon的桥要关闭达菲的声卡,如果有双声卡就可以应该达菲跟roon桥同时不影响,


回复

使用道具 举报

4
发表于 2024-6-24 10:26 | 只看该作者 来自 广东
feifenspace 发表于 2024-6-21 20:42
成功了的,不可以跟达菲同时共用一个声卡,做roon的桥要关闭达菲的声卡,如果有双声卡就可以应该达菲跟ro ...

谢谢分享,有机会试一下
回复

使用道具 举报

5
发表于 2024-7-20 10:06 | 只看该作者 来自 广东广州
想装,可是看不懂,有没有简单一点的操作,想勾选普通插件的那种
回复

使用道具 举报

6
发表于 2024-7-20 10:36 来自手机 | 只看该作者 来自 北京
dandanlan 发表于 2024-7-20 10:06
想装,可是看不懂,有没有简单一点的操作,想勾选普通插件的那种

roon可以推给squzzebox设备,这个方式应该也可以推给daphile。不是很必要装roonbridge。
回复

使用道具 举报

7
发表于 2024-7-21 13:41 | 只看该作者 来自 上海
prodomo 发表于 2024-7-20 10:36
roon可以推给squzzebox设备,这个方式应该也可以推给daphile。不是很必要装roonbridge。

没错!!!我就是这么用的,用古老的台式音响来播放歌曲。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | -注册-

本版积分规则

Archiver|手机版|粤icp备09046054号|耳机网-耳机大家坛

粤公网安备 44030602000598号 耳机大家坛、www.erji.net、网站LOGO图形均为注册商标

GMT+8, 2024-11-27 05:35

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表