Skip to content

Instantly share code, notes, and snippets.

@dreamcat4
Last active December 8, 2018 12:49
Show Gist options
  • Save dreamcat4/1ca69c7f1d215eafcfa7 to your computer and use it in GitHub Desktop.
Save dreamcat4/1ca69c7f1d215eafcfa7 to your computer and use it in GitHub Desktop.

Revisions

  1. dreamcat4 revised this gist Aug 11, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ums.md
    Original file line number Diff line number Diff line change
    @@ -70,7 +70,7 @@ This dependancy requires the kernel module `linux.ko` to be loaded into memory.
    kldstat | grep linux.ko

    # If linux.ko isn't loaded, add it to the list of modules to load during Finch startup
    sysrc "kldload_modules=$(sysrc -n kldload_modules) linux"
        sysrc "kldload_modules=$(sysrc -n kldload_modules 2&> /dev/null) linux"

    # Load it now
    service kldload restart
  2. dreamcat4 revised this gist Jul 29, 2014. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions ums.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,3 @@
    NOTICE: universal-media-server hasn't quite been released yet in FreeBSD's public pkg repositories. It is due out on 23-July-2014.

    ## UMS How-To

    How to install Universal Media Server. Most of these commands can just be copy-pasted.
  3. dreamcat4 revised this gist Jul 22, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions ums.md
    Original file line number Diff line number Diff line change
    @@ -81,15 +81,15 @@ This dependancy requires the kernel module `linux.ko` to be loaded into memory.
    sysrc kldload_modules | grep linux
    kldstat | grep linux.ko

    # Log back in to our jail
    qjail console "$jailname"

    ## Configure, Start UMS4

    [mfs]:http://dreamcat4.github.io/finch/mounting-filesystems/

    At this point, you may now wish to consult [Mounting Filesystems][mfs]. And first sort out your media locations so they get mounted inside of the UMS jail.

    # Log back in to our jail
    qjail console "$jailname"

    # Edit the UMS configuration file
    nano /var/db/universal-media-server/UMS.conf

  4. dreamcat4 revised this gist Jul 21, 2014. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion ums.md
    Original file line number Diff line number Diff line change
    @@ -93,9 +93,12 @@ At this point, you may now wish to consult [Mounting Filesystems][mfs]. And firs
    # Edit the UMS configuration file
    nano /var/db/universal-media-server/UMS.conf

    # Configure the media folders. Specify a comma-separated list of absolute path names
    # To make UMS aware of your Media folders, add this line you your "UMS.conf" configuration file
    folders = /path/to/folder1,/path/to/folder2,etc

    # Other UMS settings are documented in the sample config file
    cat /var/db/universal-media-server/UMS.conf.sample

    # Enable UMS4 rc.d service
    sysrc universal_media_server_enable=YES

  5. dreamcat4 revised this gist Jul 21, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions ums.md
    Original file line number Diff line number Diff line change
    @@ -6,10 +6,10 @@ How to install Universal Media Server. Most of these commands can just be copy-p

    ## Update Finch

    Update finch to version 1.24 or newer.
    Update finch to version 1.25 or newer.

    # Finch users should first update to get the latest fixes
    [ "$(echo "$(finch --shortver) >= 1.24" | bc)" = 1 ] || sudo finch update -y
    [ "$(echo "$(finch --shortver) >= 1.25" | bc)" = 1 ] || sudo finch update -y

    # Enter the finch chroot environment, as root
    sudo finch chroot
  6. dreamcat4 revised this gist Jul 20, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions ums.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    NOTICE: universal-media-server hasn't quite been released yet in FreeBSD's public pkg repositories. It is due out on 23-July-2014.

    ## UMS How-To

    How to install Universal Media Server. Most of these commands can just be copy-pasted.
  7. dreamcat4 created this gist Jul 20, 2014.
    106 changes: 106 additions & 0 deletions ums.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,106 @@
    ## UMS How-To

    How to install Universal Media Server. Most of these commands can just be copy-pasted.

    ## Update Finch

    Update finch to version 1.24 or newer.

    # Finch users should first update to get the latest fixes
    [ "$(echo "$(finch --shortver) >= 1.24" | bc)" = 1 ] || sudo finch update -y

    # Enter the finch chroot environment, as root
    sudo finch chroot

    ## Create a new jail

    # Read the page "jail-ip-addresses" before choosing a jail IP address
    jail_ip="192.168.1.214"

    # Set a matching ip address for the jail's 'lo0' ifconfig device (for localhost)
    jail_loopback="lo0|127.0.0.214"

    # Give an appropriate server name to your jail
    jailname="ums"

    # Create a basic jail, with local console access
    qjail create -4 "$jail_ip,$jail_loopback" "$jailname"

    # Enable unix sockets
    qjail config -k "$jailname"

    ## Login to the jail

    # Start the jail
    qjail start "$jailname"

    # Login to our new jail as root
    qjail console "$jailname"

    ## Install UMS4

    # Set jail's hostname in /etc/hosts file
    echo "127.0.0.1 $(hostname)" >> /etc/hosts

    # Update local pkgng database, to avoid 'failed checksum' for 'pkg install'
    pkg update -f

    # Install dependancies from pkgng
    ASSUME_ALWAYS_YES=YES pkg install ffmpeg mplayer vlc

    # Install mencoder dependancy
    cd /usr/ports/multimedia/mencoder && BATCH=YES make install

    # Install UMS from pkgng
    ASSUME_ALWAYS_YES=YES pkg install universal-media-server


    ## (optional) Install "linux-tsmuxer" transcoder dependancy

    This dependancy requires the kernel module `linux.ko` to be loaded into memory. Unfortunatly NAS4Free users don't have this kernel module provided for them. You guys will have to ask Zoon to add it to the distribution for you.

    # Install 'linux-tsmuxer' from pkgng
    ASSUME_ALWAYS_YES=YES pkg install linux-tsmuxer

    # Exit from the jail
    exit

    # Check if linux.ko is already being loaded
    sysrc kldload_modules | grep linux
    kldstat | grep linux.ko

    # If linux.ko isn't loaded, add it to the list of modules to load during Finch startup
    sysrc "kldload_modules=$(sysrc -n kldload_modules) linux"

    # Load it now
    service kldload restart

    # Check that 'linux.ko' was successfully loaded
    sysrc kldload_modules | grep linux
    kldstat | grep linux.ko

    ## Configure, Start UMS4

    [mfs]:http://dreamcat4.github.io/finch/mounting-filesystems/

    At this point, you may now wish to consult [Mounting Filesystems][mfs]. And first sort out your media locations so they get mounted inside of the UMS jail.

    # Log back in to our jail
    qjail console "$jailname"

    # Edit the UMS configuration file
    nano /var/db/universal-media-server/UMS.conf

    # Configure the media folders. Specify a comma-separated list of absolute path names
    folders = /path/to/folder1,/path/to/folder2,etc

    # Enable UMS4 rc.d service
    sysrc universal_media_server_enable=YES

    # Start UMS4
    service universal-media-server start

    # UMS4 should now appear to connected DLNA clients / media renderers in your Local Network

    # Or browse the web-interface on TCP port 9001 of the jail's IP address.
    fetch -o - http://${jail_ip}:9001