Creation of PBI/Plugin

Status
Not open for further replies.

dschoorisse

Cadet
Joined
Nov 5, 2014
Messages
4
Hi,

Sorry for this long post, but I'm trying to be as specific as possible.

TL;DR...
Trying to create PBI's in PCBSD9. Simple ones will build, bigger/complex ports fail due to dependencies.


From here on you can see everything I've done. The real problem is described at the bottom, see 'The Problem'.

I'm trying to understand how to create plugins for FreeNAS, but I'm having much difficulties with it. I've read the documentation available at:

http://olddoc.freenas.org/index.php/Creating_your_own_PBIs
http://www.freenas.org/whats-new/2013/04/freenas-plugins-everything-you-ever-wanted-to-know.html
https://forums.freenas.org/index.php?threads/creating-pbis-for-freenas-9-1-rc1-rc2.13981/

In my understanding a PBI is a packaged jail containing the software, all it's dependencies, intall scripts, icons etc... A FreeNAS plugin is a standard PBI, extended with some special FreeNAS features.

Because a FreeNAS plugin is an extended PBI, first things first; the first thing to try is to create a standard PCBSD jail. I've tried this in different ways, which are all failing (with the software I would like to package).

Create on FreeNAS host
I've managed to install the 'pbi_*' utilities on my FreeNAS host (don't remember exactly how). However, the pbi_makeport utility needs the ports tree available at /usr/ports.

When I try to fetch the ports and extract I get an error:
Code:
#portsnap fetch
#portsnap: command not found


When I try to install portsnap more errors are thrown:
Code:
# sudo pkg install portsnap
# sudo pkg install portsnap
Updating local repository catalogue...
pkg: file:///usr/ports/packages/meta.txz: No such file or directory
pkg: repository local has no meta file, using default settings
pkg: file:///usr/ports/packages/digests.txz: No such file or directory
pkg: Unable to update repository local
All repositories are up-to-date.
pkg: Repository local cannot be opened. 'pkg update' required
pkg: No packages available to install matching 'portsnap' have been found in the repositories


Running sudo pkg update does not fix this:
Code:
# sudo pkg update
Updating local repository catalogue...
pkg: file:///usr/ports/packages/meta.txz: No such file or directory
pkg: repository local has no meta file, using default settings
pkg: file:///usr/ports/packages/digests.txz: No such file or directory
pkg: Unable to update repository local


I have to give up on the idea of creating PBI's on the FreeNAS host. Next.

Create on PCBSD10.x (most recent)
The EasyPBI program was changed in this OS version. The output seems to be not a .PBI file anymore, but a meta-file to allow the user to create it on the fly. No option for FreeNAS.

Create on PCBSD9.1
At this point I thought 'Because Freenas is based on FreeBSD9.x, let's try it with PCBSD9.1' (as pointed out in this post). I've installed it in a VM. This way looks the most promising, but it's still not working. At least, not in a useful way.

The creation of the module (the meta information needed for the creation of the PBI) with EasyPBI is working now. Building the PBI from the module fails, wether I'm using EasyPBI or I'm using the CLI tool pbi_makeport directly.

Problem:
The PCBSD mirror URL for 9.1 is changed from
ftp.pcbsd.org/pub/mirror to ftp.pcbsd.org/pub/archived

As 'quick and dirty fix' I hardcoded this change in the pbi_makeport script (relevant section starts at line 6864). Fetching the packages is working now.

After this little hack I tried to build an PBI, succesfully!
  1. Create a module in EasyPBI (for this test I used misc/hello)
  2. Build the PBI from this module
This is working, a PBI is created without errors (file size ~18MB).

However, when I'm trying with a package useful in real life (Deluge, SabNZBD (yes, I know it's already available, pure for educational use), Seafile) I'm blown away by all the errors.

The problem:
When creating a PBI for Deluge for example I receive the error:

Code:
...
===>  Building for fusefs-kmod-0.3.9.p1_2
===> fuse_module (all)
"/usr/share/mk/bsd.kmod.mk", line 12: "can't find kernel source tree"
...


I've already extracted the sources from src.txz to /usr/src... When I
manually inspect the script in bsd.kmod.mk everything is in place and should
work (however this is clearly not the case).

Any ideas?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949

dschoorisse

Cadet
Joined
Nov 5, 2014
Messages
4
Thanks for your reply Joshua. I hadn't seen the post you mention in your reply. I will try this, thanks!
 
Status
Not open for further replies.
Top