Permanently adding packages to unRAID 4.1


19 posts in this topic Last Reply

Recommended Posts

Here’s how to permanently add Slackware packages to youy unRAID 4.1 distro.

 

1. Boot you unRAID box

2. From your Windows box, map a drive to a disk share on the unRAID (I’ll use /mnt/disk1 as an example) and also open a terminal window to unRaid with telnet.

 

The program cpio is not installed in the unRAID 4.1 distro.  Test it by the command “cpio -h” and you will find that the command does not exist.  Good.

 

Step 1:  you must download and install cpio. Go to  http://packages.slackware.it/package.php?q=12.0/cpio-2.5-i486-3 and download it via Windows, and save the .tgz file to the unRAID share.  Then in the terminal window, install it with:

    installpkg /mnt/disk1/cpio-2.5-i486-3

 

Congrats.  You installed cpio, but it is installed to the RAM file system, and it will disappear when you reboot.  So far so good.

 

Step 2: You have to set up a place to store the uncompressed bzroot so you can modify it.  I use the directory “bz-mod”

   mkdir /mnt/disk1/bz-mod
   cd /mnt/disk1/bz-mod
   zcat /boot/bzroot | cpio -i -d -H newc --no-absolute-filenames

 

You have now exploded the bzroot image back into the native files.  Congrats.

 

You must also install the cpio package a second time, this time to the /bz-mod. 

    ROOT=/mnt/disk1/bz-mod installpkg /mnt/disk1/cpio-2.5-i486-3

 

The “ROOT=” part is very important as it tells installpkg to install it to /mnt/disk1/bz-mod and not to the current root.

 

Congrats.  You made your first permanent mod to the bzroot image by adding cpio to it.  Now go download more Slackware 12 packages and save the tgz files to the unRAID share on /mnt/disk1.

 

Step 3:  Install the other packages with:

    ROOT=/mnt/disk1/bz-mod  installpkg /mnt/disk1/<package file>

 

/mnt/disk1/bz-mod is the root for the bzroot image.  Now is also the time to edit any scripts or config files, such as '/etc/hosts', as you wish in the /mnt/disk1/bz-mod directory... i.e. to edit the permanent '/etc/hosts' file, you edit /mnt/disk1/bz-mod/etc/hosts .

 

Step 4:  When finished installing packages, rebuild the boot initramfs filesystem image:

   cd /mnt/disk1/bz-mod
   find . | cpio -o -H newc | gzip > /boot/test.gz
   sync
   ls -la /boot

You should have a shiny new file called “test.gz” on the flash drive.

 

Now modify the “append” line in your /boot/syslinux.cfg file to read:

 

append initrd=test.gz rootdelay=10

 

(You can always change it back to boot the original bzroot file instead)

 

Reboot and test it out.  Try the command “cpio -h” now, and you should get the help text for the command.

 

Now many packages have dependencies.  Such as if you install PHP, you will need to also install libxml2.  I’ll start a list of packages that I install, and the dependencies.

 

If you want to install more packages, just repeat Step 3 and Step 4.

 

Some common packages and their dependencies:

==============================

cpio none

wget none

php yes:  libxml2

perl-5.8.8-i486-4    yes:  glibc-solibs-2.5-i486-4

links-0.98-i386-2.tgz    none

 

 

Link to post

I just want to say thank you, and express my strong appreciation for the added value you bring to the unRAID community.  I'm DOS and Windows based, and have very little experience with Linux, and this is *very* helpful.

 

I'd like to suggest that knowledgeable Linux users such as yourself post in this thread some recommendations as to useful packages: why they are useful, links to download locations, and links to further info such as installation, usage, complete syntax, dependencies, security concerns, stability and compatibility concerns.

 

I'm guessing this method of unpacking and repacking may make it easy to do things like change the telnet password, from 'root' to something of our choosing?

 

Thank you again.

Rob

 

Link to post

Thank you, and you are very welcome.

 

Tom has implemented a great application with unRAID, so the credit goes to him... particularly how he has made it easy for a non-Linux person to get it going (such as using a DOS partition on the flash and syslinux, instead of grub or LILO.)  That brings a LOT more people into the unRAID world.

 

UnRAID is very lean... which is good as it is intended to be run in RAM.  So don’t “wondoze” it by adding crap.  Every time I am asked to “fix” a windows box, the first thing I see is a task bar loaded with crapola... weatherbug, MSM messenger, screensavers, etc.

 

Think of unRAID as an extended hike in the mountains.  You don’t want to add anything to the backpack that isn’t worth its weight carried on your back for 200 miles.  So don’t add packages you don’t need.

 

There are some relatively light but very useful packages like wget.  Others are incredibly useful, but weigh a ton.  Some or only useful to some people, and useless to others (like MySQL).  I’m a PHP and Perl programmer, so I want those, but many people will not.  I also use wget, so I want that.  I don’t do much FTP, so I don’t want that, but OTOH, it can be MUCH faster than SAMBA.... so I might do it just for use when I have large blocks of data to copy (such as copying an 800GB Encase image).  OTOH, I really want TrueCrypt (encrypted disk partitions) and Asterisk (VOIP telephone management).  TrueCrypt would likely be of value to a lot of people.  Asterisk would not.  Your mileage will vary.

 

Some packages have to be compiled for your OS.  That’s a killer, as in order to compile source code, you need to add a ton of libraries and stuff to the system, just to get the compiler to run and compile your source.  I have done it on unRAID, but it was not pretty.  The better way is to compile it on a full development system, and then copy the binaries and support files by hand, and edit the rc scripts as needed.  That is a frustrating, painstaking PITA.

 

Some really need to be linked into the kernel, like lm_sensors package that will let you monitor CPU temp, etc.  (Tom.... Pretty please??)

 

The procedure I posted to edit the bzroot file is a kludge.  The real way to add packages to unRAID it is have a real, fully installed Linux development system, and the initramfs tools, which is (presumptively) how unRAID is developed and distroed in the first place.  But only the developer of the application has that.  We, in the field, have to make do with patching the initramfs file (bzroot).  That process has limitations.

 

If all you want to do is customize your own hosts file, and add a couple of useful light packages like wget, then you’re ok.  You can also do most, if not all of that, via the go script, just re-installing the packages every time unRAID boots.  Some things, like adding more user accounts and putting a password on the root account, are prime candidates for the procedure I posted.  Sonicos' previous post explains how to do that.

 

The Achilles heel of Linux is running out of memory.  It get’s real ugly when that happens.  That’s why Linux installation generally have a section of disk set aside just for swap space.

 

If you want to add larger packages, or do a lot of file writes to unRAID, you should install a swap file.  I suspect that a future version will have the ability to enable swap built in, since that makes the system much more stable, and some of the specifically requested features (security, writable user shares) are memory hogs that can run a Lunix system into the ground if there is no swap space.  Run the Linux ‘top’ command on your unRAID box and see how much free ram you have, and note how it changes when unRAID is under heavy writing.

 

Adding a swap partition is REALLY easy, and just about ANY old spare drive bigger than 2 GB you have laying around will work.  If enough people are interested, I’ll post instructions on how to do it.

 

As for what packages are useful, easy/hard to install on unRAID, if people will post results of what packages they have successfully added, I’ll edit the original post to reflect the new information.

Link to post

That is fantastic!!

 

I will use this method to package the things I use (wget, ssh, rsync, passwords) into the bzroot directly and clear out my go script. I'll just have to remember what changes I've made to it so I know what to update on future unRAID versions!

Link to post
  • 8 months later...
  • 1 year later...

Hey I performed those steps two times trying to install some packages and now I have bzroot and bzroot2 folders on my disk1 that are impossible to be deleted How to delete them?

To delete any file in linux you need "write" permission on the folder it is in, not the files themselves.

 

Joe L.

Link to post

Hey I performed those steps two times trying to install some packages and now I have bzroot and bzroot2 folders on my disk1 that are impossible to be deleted How to delete them?

To delete any file in linux you need "write" permission on the folder it is in, not the files themselves.

 

Joe L.

 

Good job Joe!  Now that guy can finally relax after two years of desperation.  ;) 

 

 

Link to post

You can use the ftp link with a web browser though.

I tried that first and get "Error 550"

Right. The web browser can't expand "*". Cut that URL down to the diretory, and find cpio in the listing.

ftp://slackware.osuosl.org/pub/slackware/slackware-current/slackware/a/

(note, I didn't post a link with the full file name, because those names change frequently with the versions, and that will break the link)

 

BTW I'm running unRaid 4.5.3

Well then you should have the wget command. I just tried it again, on 4.5.3, and it works.

Copy the whole line from here, and paste it in your telnet session:

wget ftp://slackware.osuosl.org/pub/slackware/slackware-current/slackware/a/cpio-*.t?z

 

Link to post

Well then you should have the wget command. I just tried it again, on 4.5.3, and it works.

Copy the whole line from here, and paste it in your telnet session:

wget ftp://slackware.osuosl.org/pub/slackware/slackware-current/slackware/a/cpio-*.t?z

 

Thanks, it works now..

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.