Recipe for Linux-based MagicHD Video Server Computer

  • Optiplex 790 with AMD graphics card
  • base netinst install of buster - deselect everything from tasksel
    • NOTE: Needed buster (instead of stretch) due to needing mesa update to address AMD r600 GPU bug: https://bugs.freedesktop.org/show_bug.cgi?id=99349
    • hostname videoserver – domain lighting.lcl (rename later to videoserver1/2/3/4)
    • 120 GB SSD - 110 GB root, 10 GB swap
    • ext4 root (discard, noatime)
  • > /etc/motd
  • apt-get --no-install-recommends install aptitude
  • aptitude install ssh (this will pull in xauth, but that's okay)
  • aptitude install net-tools man-db less fbset screen rsync psmisc file patch ethtool strace tcpdump vim bzip2 xz-utils
  • aptitude --without-recommends install dnsutils
  • adduser tdobes adm
  • adduser tdobes systemd-journal
  • aptitude install dbus
  • sed -i -e 's/^deb.* main$/& contrib non-free/g' /etc/apt/sources.list
  • aptitude update && aptitude forget-new
  • aptitude install intel-microcode
  • aptitude install firmware-amd-graphics # for AMD GPU
  • aptitude install ifplugd
  • sed -i -e 's/^INTERFACES=""/INTERFACES="eno1"/g' /etc/default/ifplugd
  • sed -i -e 's/^allow-hotplug eno1/#allow-hotplug eno1/g' /etc/network/interfaces
  • mkdir -p /etc/systemd/system/ssh.socket.d
    echo '[Socket]' > /etc/systemd/system/ssh.socket.d/port-2222.conf
    echo 'ListenStream=2222' >> /etc/systemd/system/ssh.socket.d/port-2222.conf
    systemctl disable ssh.service && systemctl enable ssh.socket
  • mkdir -p /etc/systemd/system/getty\@tty1.service.d
    echo '[Service]' > /etc/systemd/system/getty\@tty1.service.d/noclear.conf
    echo 'TTYVTDisallocate=no' >> /etc/systemd/system/getty\@tty1.service.d/noclear.conf
  • sed -i -e 's/^GRUB_CMDLINE_LINUX_DEFAULT="quiet"$/GRUB_CMDLINE_LINUX_DEFAULT="quiet panic=5"/g' /etc/default/grub && update-grub
  • systemctl mask keyboard-setup.service
    systemctl mask console-setup.service
    systemctl mask rc-local.service
  • aptitude --without-recommends install irqbalance
  • aptitude install lsof memtest86+ parted time sysstat
  • aptitude install unattended-upgrades
  • dpkg-reconfigure -plow unattended-upgrades # select “Yes”, and select default at origin screen
  • aptitude install lm-sensors
  • aptitude install xserver-xorg-video-ati xserver-xorg-video-amdgpu xserver-xorg-input-evdev
  • aptitude install xserver-xorg-video-ati xserver-xorg-video-amdgpu xserver-xorg-video-modesetting xserver-xorg-input-libinput
  • aptitude install xinit xinput xdotool x11vnc unclutter x11-xserver-utils
  • aptitude install libglu1-mesa libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxslt1.1 libgl1-mesa-glx # prereqs for magicq
  • aptitude install pulseaudio # prereq for magicq; surprisingly, deps are reasonable under stretch (VA stuff might be useful for magichd)
  • aptitude install libarchive13 # another dep for magicq which frustratingly is not listed in the deb
  • aptitude install dbus-x11 # another dep for magichd which frustratingly is not listed in the deb
  • wget -q http://repo.magicq.co.uk/magicq.co.uk.gpg -O - | apt-key add -
  • echo deb http://repo.magicq.co.uk/magicq/ magicq main > /etc/apt/sources.list.d/magicq.list
  • aptitude update && aptitude forget-new
  • # uhm… WTF? Apparently, the MagicQ repo is just broken, and isn't being signed with the correct keys. We have to resort to wget and installing manually. This sucks the big one.
  • wget http://repo.magicq.co.uk/magicq/pool/main/m/magicq/magicq_1.7.8.1_amd64.deb # installing beta version due to weird debug overlay in stable version?!?
  • dpkg -i magicq_*_amd64.deb # installing beta version due to weird debug overlay in stable version?!?
  • dpkg -i magicq-beta_*_amd64.deb
  • aptitude markauto libglu1-mesa libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxslt1.1 libgl1-mesa-glx pulseaudio # mark as auto-installed deps for magicq
  • aptitude install ffmpeg && ln -s /usr/bin/ffmpeg /opt/magicq/ffmpeg # I guess this is a dep for magichd? It seems to reference /opt/magicq/ffmpeg, but there's nothing there.
  • aptitude --without-recommends install icewm menu && aptitude markauto menu # argh - icewm isn't in buster due to some sort of dev breakage
  • aptitude --without-recommends install blackbox # temporary replacement for icewm
  • adduser --shell /bin/bash --gecos "Lightboard" --disabled-password lightboard
  • adduser lightboard audio # allow magicq access to MIDI sequencer
  • echo '[Unit]' > /etc/systemd/system/startx\@.service
    echo 'Description=Start Xorg for %I' >> /etc/systemd/system/startx\@.service
    echo >> /etc/systemd/system/startx\@.service
    echo '[Service]' >> /etc/systemd/system/startx\@.service
    echo 'ExecStart=-/usr/bin/startx -- :0 -nolisten tcp vt2' >> /etc/systemd/system/startx\@.service
    echo 'User=%I' >> /etc/systemd/system/startx\@.service
    echo 'Type=simple' >> /etc/systemd/system/startx\@.service
    echo 'Restart=always' >> /etc/systemd/system/startx\@.service
    echo 'RestartSec=1' >> /etc/systemd/system/startx\@.service
    echo 'StartLimitInterval=10s' >> /etc/systemd/system/startx\@.service
    echo 'StartLimitBurst=10' >> /etc/systemd/system/startx\@.service
    echo >> /etc/systemd/system/startx\@.service
    echo '[Install]' >> /etc/systemd/system/startx\@.service
    echo 'WantedBy=multi-user.target' >> /etc/systemd/system/startx\@.service
    systemctl enable startx\@lightboard.service
  • echo '[Unit]' > /etc/systemd/system/magichd.service
    echo 'Description=magichd' >> /etc/systemd/system/magichd.service
    echo 'After=startx@lightboard.service' >> /etc/systemd/system/magichd.service
    echo 'Requires=startx@lightboard.service' >> /etc/systemd/system/magichd.service
    echo >> /etc/systemd/system/magichd.service
    echo '[Service]' >> /etc/systemd/system/magichd.service
    echo 'ExecStart=-/usr/local/bin/startmagichdfullscreen.sh' >> /etc/systemd/system/magichd.service
    echo 'User=lightboard' >> /etc/systemd/system/magichd.service
    echo 'Environment=DISPLAY=:0' >> /etc/systemd/system/magichd.service
    echo 'Restart=always' >> /etc/systemd/system/magichd.service
    echo 'RestartSec=1' >> /etc/systemd/system/magichd.service
    echo 'StartLimitInterval=10s' >> /etc/systemd/system/magichd.service
    echo 'StartLimitBurst=10' >> /etc/systemd/system/magichd.service
    echo >> /etc/systemd/system/magichd.service
    echo '[Install]' >> /etc/systemd/system/magichd.service
    echo 'WantedBy=multi-user.target' >> /etc/systemd/system/magichd.service
    
    systemctl enable magichd.service
  • sed -i -e 's/^allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
  • sed -i -e 's/^use-ssh-agent$/#use-ssh-agent/g' /etc/X11/Xsession.options
  • sed -i 's/START_UNCLUTTER="true"/START_UNCLUTTER="false"/g' /etc/default/unclutter
  • mkdir ~lightboard/.vnc
    x11vnc -storepasswd **PASSWORD** ~lightboard/.vnc/passwd
    chown -R lightboard:lightboard ~lightboard/.vnc
    chmod 0600 ~lightboard/.vnc/passwd
    
    echo '#!/bin/sh' > /usr/local/bin/lightboard-xsession.sh
    echo >> /usr/local/bin/lightboard-xsession.sh
    echo 'pkill -9 x11vnc' >> /usr/local/bin/lightboard-xsession.sh
    echo >> /usr/local/bin/lightboard-xsession.sh
    echo 'x11vnc -q -usepw -N -ncache 0 -shared -forever &' >> /usr/local/bin/lightboard-xsession.sh
    echo >> /usr/local/bin/lightboard-xsession.sh
    echo 'xset s off #disable screensaver' >> /usr/local/bin/lightboard-xsession.sh
    echo 'xset dpms 0 0 0 #disable automatic power saving' >> /usr/local/bin/lightboard-xsession.sh
    echo 'unclutter -grab -idle 2 & #daemon to auto-hide mouse' >> /usr/local/bin/lightboard-xsession.sh
    echo >> /usr/local/bin/lightboard-xsession.sh
    echo '#SHELL=/bin/bash xterm &' >> /usr/local/bin/lightboard-xsession.sh
    echo >> /usr/local/bin/lightboard-xsession.sh
    #echo "exec icewm" >> /usr/local/bin/lightboard-xsession.sh # temporary replacement of icewm with blackbox
    echo "exec blackbox" >> /usr/local/bin/lightboard-xsession.sh # temporary replacement of icewm with blackbox
    chmod +x /usr/local/bin/lightboard-xsession.sh
    ln -s /usr/local/bin/lightboard-xsession.sh /home/lightboard/.xsession
    
    echo '#!/bin/sh' > /usr/local/bin/startmagichdfullscreen.sh
    echo >> /usr/local/bin/startmagichdfullscreen.sh
    echo "/bin/sh -c 'xdotool search --sync --name ^MagicHD$ && sleep 2 && xdotool search --sync --name ^MagicHD$ windowactivate --sync key --delay 100 alt+v key t' &" >> /usr/local/bin/startmagichdfullscreen.sh
    echo "exec /opt/magicq/runmagichd.sh" >> /usr/local/bin/startmagichdfullscreen.sh
    chmod +x /usr/local/bin/startmagichdfullscreen.sh
  • echo needs_root_rights=yes >> /etc/X11/Xwrapper.config # see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856351
  • mkdir /home/lightboard/Documents
    chown lightboard:lightboard /home/lightboard/Documents
  • mkdir -p /opt/magicq/update/show/media && scp -pr tdobes@software.mcp.lcl:/mnt/software/ChamSys\\\ MagicQ/demo_media/20131130/* /opt/magicq/update/show/media/ # transfer over demo media
  • clone to multiple machines, rename to videoserver1/2/3/4 (update /etc/hostname and /etc/hosts), update artnet universe (6/7/8/9)
computer/magichd_video_server.txt · Last modified: 2018/03/12 15:19 by tdobes
Recent changes RSS feed Driven by DokuWiki Valid XHTML 1.0 Valid CSS