Jump to content

Arch Linux on Rpi2 with MBS


AlwinHummels

Recommended Posts

AlwinHummels

Raspberry Pi 2

SD Card Creation
Replace sdX in the following instructions with the device name for the SD card as it appears on your computer.

Start fdisk to partition the SD card:
fdisk /dev/sdX
At the fdisk prompt, delete old partitions and create a new one:
Type o. This will clear out any partitions on the drive.
Type p to list partitions. There should be no partitions left.
Type n, then p for primary, 1 for the first partition on the drive, press ENTER to accept the default first sector, then type +100M for the last sector.
Type t, then c to set the first partition to type W95 FAT32 (LBA).
Type n, then p for primary, 2 for the second partition on the drive, and then press ENTER twice to accept the default first and last sector.
Write the partition table and exit by typing w.
Create and mount the FAT filesystem:
mkfs.vfat /dev/sdX1
mkdir boot
mount /dev/sdX1 boot
Create and mount the ext4 filesystem:
mkfs.ext4 /dev/sdX2
mkdir root
mount /dev/sdX2 root
Download and extract the root filesystem (as root, not via sudo):
wget http://archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz
bsdtar -xpf ArchLinuxARM-rpi-2-latest.tar.gz -C root
sync
Move boot files to the first partition:
mv root/boot/* boot
Unmount the two partitions:
umount boot root
Insert the SD card into the Raspberry Pi, connect ethernet, and apply 5V power.
Use the serial console or SSH to the IP address given to the board by your router. The default root password is 'root'.

 
Then: 
 

pacman -Syy
pacman -Syu
pacman -S sudu
pacman -Sy wget
pacman -Sy base-devel
cd /root
mkdir aur
cd aur

 
 

wget https://aur.archlinux.org/packages/me/mediabrowser-server/mediabrowser-server.tar.gz
tar -xvf mediabrowser-server.tar.gz

 

then make the --asroot fix
 
 

nano /usr/bin/makepkg
 
Add asroot to OPT_LONG (line 3366). Just search for "OPT_LONG".
 
OPT_LONG=('allsource' 'check' 'clean' 'cleanbuild' 'config:' 'force' 'geninteg'
          'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'noarchive' 'nobuild'
          'nocolor' 'nocheck' 'nodeps' 'noextract' 'noprepare' 'nosign' 'pkg:' 'repackage'
          'rmdeps' 'sign' 'skipchecksums' 'skipinteg' 'skippgpcheck' 'source' 'syncdeps'
          'verifysource' 'version' 'asroot')
Remove EUID check (line 3577). Just search for "EUID".
 
if (( ! INFAKEROOT )); then
    if (( EUID == 0 )); then
        #error "$(gettext "Running %s as root is not allowed as it can cause permanent,\n\
#catastrophic damage to your system.")" "makepkg"
        #exit 1 # $E_USER_ABORT
        plain "$(gettext "Running as root restored by Orc ;)")"
    fi
 
Save
cd mediabrowser-server
nano PKGBUILD (add the armv7h to the list)
makepkg -s
 
systemctl enable mediabrowser-server.service
 
systemctl start mediabrowser-server.service

now MBS works but can't find any of my shares from NAS

Hope someone can help me around to get this working my Synology NAS works with SAMBA (SMB2)

 

I've installed samba by:

pacman -S samba

cp /etc/samba/smb.conf.default /etc/samba/smb.conf

But then I'm lost

Edited by AlwinHummels
Link to comment
Share on other sites

thefirstofthe300

If you don't plan to make anything on the RPi available via Samba, this wiki article section should explain everything you need to know about samba for your use case: https://wiki.archlinux.org/index.php/Samba#Client_configuration.

 

If you have any questions after reading the above, feel free to ask! I am happy to help.

Link to comment
Share on other sites

AlwinHummels

If you don't plan to make anything on the RPi available via Samba, this wiki article section should explain everything you need to know about samba for your use case: https://wiki.archlinux.org/index.php/Samba#Client_configuration.

 

If you have any questions after reading the above, feel free to ask! I am happy to help.

Followed that but shares wont work only manual share 

mount -t cifs //192.168.0.***/music /mnt/music -o user=[username]

works after typing the password but when I use the

mount -t cifs //192.168.0.***/music /mnt/music -o user=[username],password=[password]

Gives me a list with options ???

My password contains special characters maybe that's the issue but cant fix it right now. manually mount works  when i use the first option.

I dont know how to use fstab

Edited by AlwinHummels
Link to comment
Share on other sites

thefirstofthe300

You only want to use the fstab to mount the shares if the shares will ALWAYS be available to the Pi. If they aren't available, the Pi will go into recovery mode at boot because it thinks that it hasn't mounted the filesystems necessary for the system to work.

 

That being said, if you do have the option of using fstab (the Pi will always have access to the Samba shares), just add the following line to the end of your /etc/fstab

//SERVER-IP/path/to/folder/to/mount /path/to/mountpoint cifs username=username,password=password 0 0

After adding the above to your fstab, run "sudo mount -a" to make sure that the fstab isn't borked. You should be able to see the files on the share in the mountpoint after running the above.

 

If you password has special characters in it, you probably aren't able to use the password when mounting on the command line because you haven't escaped the special characters. To escape special characters, simply put a backslash (\) before each special character. I don't think you need to escape special characters in the fstab though.

 

I hope this helped!

  • Like 1
Link to comment
Share on other sites

AlwinHummels

Thanks the fstab works fine now missed a # on the first line so that gives me the error and didn't know the command mount -a ,

do I have to enter it each time after reboot?

 

thanks a lot. 

Edited by AlwinHummels
Link to comment
Share on other sites

thefirstofthe300

If it is in the fstab, it will be persistent through rebooting. That is the point of putting it in the fstab.

Link to comment
Share on other sites

AlwinHummels

If it is in the fstab, it will be persistent through rebooting. That is the point of putting it in the fstab.

I thought so but every time I reboot my mounts are gone and appears again untill I give the command mount -a

Edited by AlwinHummels
Link to comment
Share on other sites

thefirstofthe300

I thought so but every time I reboot my mounts are gone and appears again untill I give the command mount -a

 

I wonder if the mount is failing due to not having any networking yet. That would certainly explain why issuing mount -a causes it to mount again.

 

Try this for the fstab entry

//SERVER-IP/path/to/folder/to/mount /path/to/mountpoint cifs username=username,password=password,noauto,x-systemd.automount,x-systemd.device-timeout=15 0 0

The above will use systemd to automatically mount the shares when they are accessed. I don't know how this will play out with MB but it should allow networking to come up before attempting to mount the shares. Also, if the shares don't mount try increasing 15 to something larger. That number is how many seconds systemd will wait before timing out the mount attempt.

Link to comment
Share on other sites

AlwinHummels

Thanks will try this tomorow

 

Thanks again now it starts up automatically. You were very helpful for me and I have learned some more about Linux :P  

Edited by AlwinHummels
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
MSattler

Is there an easy way to do this with one of the Linux USB boot drive tools?  My only linux box right now does not have a MicroSD/SD drive.

 

Thanks!

Link to comment
Share on other sites

thefirstofthe300

Is there an easy way to do this with one of the Linux USB boot drive tools?  My only linux box right now does not have a MicroSD/SD drive.

 

Thanks!

 

I am not sure what you mean by "do this". Mount a Samba share via fstab?

Link to comment
Share on other sites

MSattler

I am not sure what you mean by "do this". Mount a Samba share via fstab?

 

Sorry, should of been more direct, meaning configuring the initial SD boot disk to boot Arch.

 

Thanks!

Link to comment
Share on other sites

thefirstofthe300

Unetbootin is a good, cross-platform tool that will allow you to create bootable USB drives.

 

If you are asking how to install Arch, the best place to look is the installation guide on the Arch wiki.

Edited by DaBungalow
Link to comment
Share on other sites

  • 2 weeks later...
pbridge

The good news I've got this up and running predominantly thanks to AlwinHummels guide and DaBungalow for auto mounting (thanks), the only step missed was to install the compiled package [pacman -U newfile.pkg.tar.xz]

 

I also installed the smbclient [pacman -Sy smbclient] and set the NAS share to Automount when accessed, then to prevent transcoding used Path Substitution. 

 

​All works well although does take longer to scan the library but it is just a Pi2.

 

Now for my minor issue, I use the Media Browser Classic client (and when I first access media browser it takes a long time to log on and initially it isn't populated) after about 2-3 mins after log out and back in all is well. I'm using the Beta version 3.0.257 as I believe this has more tolerance to network delay. The Pi remains on all the time and not aware of any sleep setting that kicks in over night. 

 

Any suggestions? 

Link to comment
Share on other sites

ali3n0id

Sorry to butt in but is there a ..deb file or perhaps a guide to get this working inside Raspbian - I can only find Arch specific files on here?

Link to comment
Share on other sites

thefirstofthe300

This is because the Arch PKGBUILD allows for the server to be installed on ARM device without much extra effort. As far as deb packages go, you will have to get some help from the deb maintainer: @.

  • Like 1
Link to comment
Share on other sites

hurricanehrndz

I can try and enable the arm builders for the debs and see what happens. I will put it on my list of things to do. 

  • Like 1
Link to comment
Share on other sites

ali3n0id

Awesome thanks guys, eager to try it on the Pi2. I had a go at installing dependencies but it was a bit of a mess.

Update me when you have a second

Link to comment
Share on other sites

  • 3 weeks later...
pbridge

Looking for  little help, I have it all working with WIFI. My issue is every time there is WIFI activity a small square icon appears on the PI's screen. Any idea how to turn this off? It only happens for wifi.

Link to comment
Share on other sites

jabbera

Looking for  little help, I have it all working with WIFI. My issue is every time there is WIFI activity a small square icon appears on the PI's screen. Any idea how to turn this off? It only happens for wifi.

Your power supply or USB cable can't handle powering the pi plus the wifi. Get a new power supply or a powered USB hub for your wifi adapter.

 

http://www.raspberrypi.org/forums/viewtopic.php?f=29&t=82373

Link to comment
Share on other sites

pbridge

Thanks jabbera, feel bit stupid now. I thought it was my install. Just tried different cable and no coloured square. 

Link to comment
Share on other sites

  • 1 month later...
marlin9800

I am sorry to bring this thread up, but I have hit the wall. Thank you so much to AlwinHummels for your guide (the guide on http://emby.media/downloads/linux-server/ did not work at all), I was able to follow it and get to the last steps, enable and start the service (and it was going so well!!!!!)

[root@alarmpi mediabrowser-server]# systemctl enable mediabrowser-server.service
Failed to execute operation: No such file or directory
[root@alarmpi mediabrowser-server]# systemctl start mediabrowser-server.service
Failed to start mediabrowser-server.service: Unit mediabrowser-server.service failed to load: No such file or directory.

The only step that I didn't do was (I am not sure if that was a typo, meant to be sudo; couldn't find any mention anywhere of sudu and arch):

[root@alarmpi mediabrowser-server]# pacman -S sudu
error: target not found: sudu

Everything else appared to work great, at the end of makepkg -s I got a nice green message saying Mediabrowser 3....something something was sucssful (with no further instructions).

 

I've never used Arch before so I read up on 'systemctl' and confirmed that mediabrowser-service.service was not on the list of services. I would appear that MBS wasn't installed (since there isn't a service file for it) but I sat here and watched for the 5+ mins while it ran though, ended with 0 errors and 117 warning.

Edited by marlin9800
Link to comment
Share on other sites

thefirstofthe300

I assume you are using the arch package and if so, the package was renamed to emby-server and the service to emby-server.service.

 

If that still doesn't work, let me know.

Link to comment
Share on other sites

marlin9800

I assume you are using the arch package and if so, the package was renamed to emby-server and the service to emby-server.service.

 

If that still doesn't work, let me know.

 

I am using the Mediabrowser Server linked in AlwinHummels post.

[root@alarmpi mediabrowser-server]# ls -l
total 61484
-rw-r--r-- 1 root root 49586803 May  9 00:02 3.0.5518.7.tar.gz
-rwxr-xr-x 1 root root     1448 May  8 23:44 PKGBUILD
-rwxr-xr-x 1 root root      148 Nov 10 05:04 mediabrowser-server
-rw-r--r-- 1 root root 13339920 May  9 00:09 mediabrowser-server-3.0.5518.7-1-armv7h.pkg.tar.xz
-rwxr-xr-x 1 root root      119 Nov 10 04:40 mediabrowser-server.conf
-rwxr-xr-x 1 root root     2347 Mar 15 03:20 mediabrowser-server.install
-rwxr-xr-x 1 root root      387 Nov 29 21:17 mediabrowser-server.service
drwxr-xr-x 3 root root     4096 May  9 00:02 pkg
drwxr-xr-x 3 root root     4096 May  9 00:02 src

Contains of the extracted file.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...