调用 hassio_install 脚本时传递给 bash 的 -m 选项是什么?

What is the -m option passed to bash when invoking the hassio_install script for?

curl -sL https://raw.githubusercontent.com/home-assistant/hassio-build/master/install/hassio_install \
    | <b>bash -s – -m raspberrypi3</b>

上述命令中突出显示的文本有什么作用?它显然是特定于 Raspberry Pi 3,但我想弄清楚是否可以修改它以适用于另一个硬件平台。

-m 根本不会被 bash 解释或理解,而是由您的 hassio_install 脚本解释或理解。

case $arg in
    -m|--machine)
        MACHINE=
        shift
        ;;

...稍后用作:

HOMEASSISTANT_DOCKER="$DOCKER_REPO/$MACHINE-homeassistant"

也就是说,当使用 -m raspberrypi3 调用时,代码会查找名为 raspberrypi3-homeassistant 的存储库,如在 https://hub.docker.com/r/homeassistant/raspberrypi3-homeassistant/

中找到的

您可以通过浏览推断其他可用的名称https://hub.docker.com/u/homeassistant/

来自 bash(1) 手册页:

   -s        If the -s option is present, or if no arguments remain  after
             option  processing,  then commands are read from the standard
             input.  This option allows the positional  parameters  to  be
             set when invoking an interactive shell.

[...]

   --        A  --  signals the end of options and disables further option
             processing.  Any arguments after the -- are treated as  file‐
             names and arguments.  An argument of - is equivalent to --.

因此 -m 和所有后续参数都传递给下载的脚本。