Skip to content

Install

macmpi edited this page Nov 6, 2025 · 3 revisions

OpenRC service / Alpine install

Installing & configuring:

On Alpine, package can be installed from community repository (edge branch if not available in specific release):
apk add xg_multi
Alternatively files may be installed manually:
install -m755 xg_multi /usr/bin/xg_multi
install -m755 services/openrc/xg_multi.initd /etc/init.d/xg_multi
install -m644 services/openrc/xg_multi.confd /etc/conf.d/xg_multi

After device is connected to host via USB cable, xg_multi may be run from command-line (check options) with admin privileges:
xg_multi

Network settings for the interface (typically usb0) can then be configured with setup-interfaces (or setup-alpine) on Alpine, or manually (exemple below with static IPv4):

cat <<-EOF1 >>/etc/network/interfaces && cat <<-EOF2 >/etc/resolv.conf
	auto usb0
	iface usb0 inet static
	    address 10.42.0.2/24
	    gateway 10.42.0.1

EOF1
	nameserver 1.1.1.1
	nameserver 1.0.0.1
EOF2
rc-service networking restart

Running as a boot service:

Eventually set default parameters editing /etc/conf.d/xg_multi

Start service:
rc-service xg_multi start

Enable service at boot:
rc-update add xg_multi boot

To leverage serial connection for console login at boot, user may choose to either:

  • modify /etc/inittab and add ttyGS0::respawn:/sbin/getty -L 115200 ttyGS0 vt100
  • install agetty as follows:
    apk add agetty
    ln -s /etc/init.d/agetty /etc/init.d/agetty.ttyGS0
    rc-update add agetty.ttyGS0 boot

Systemd service

Installing & configuring:

Files may be installed manually:
install -m755 xg_multi /usr/bin/xg_multi
install -m755 services/systemd/xg_multi.service /usr/lib/systemd/system/xg_multi.service
install -m644 services/systemd/xg_multi.default /etc/default/xg_multi
systemctl daemon-reload

After device is connected to host via USB cable, xg_multi may be run from command-line (check options) with admin privileges:
xg_multi

Network settings for the interface (typically usb0) can then be configured (exemple below with static IPv4):
nmcli con add con-name "gadget" ifname usb0 type ethernet ip4 10.42.0.2/24 gw4 10.42.0.1
nmcli con mod "gadget" ipv4.dns "1.1.1.1,1.0.0.1"
nmcli con up "gadget"

Running as a boot service:

Eventually set default parameters editing /etc/default/xg_multi

Start service:
service xg_multi start

Enable services at boot:
systemctl enable xg_multi
and eventually for console:
systemctl enable serial-getty@ttyGS0

Clone this wiki locally