Introduction to FreeNAS
Development

John Hixson
john@ixsystems.com
iXsystems, Inc.
A bit about me
●
●

BSD geek that does geeky BSD things
Maintains jail, plugin, and directory service
systems on FreeNAS

...
A bit about iXsystems
●

Corporate sponsor of PC-BSD

●

Corporate sponsor of FreeNAS

●

Employ several FreeBSD committer...
What this talk will cover
●

What FreeNAS is

●

Adding a feature to the UI

●

Adding software to the operating system

●...
What FreeNAS is:
●

100% free and open source network attached
storage operating system

●

Built on FreeBSD and ZFS

●

C...
A quick look at FreeNAS
Adding a feature to the UI
●

Add service entry for the feature

●

Create feature model, form and view

●

Make the middl...
Adding a feature to the UI
➔

Add service entry for the feature

●

Create feature model, form and view

●

Make the middl...
class Migration(SchemaMigration):
def forwards(self, orm):
....
p = orm.Ponies()
p.save()
s = orm.Services()
s.srv_service...
Adding a feature to the UI
●

Add service entry for the feature

➔

Create feature model, form and view

●

Make the middl...
class Ponies(Model):
class Meta:
verbose_name = _(u"Ponies")
verbose_name_plural = _(u"Ponies")
class FreeAdmin:
deletable...
class PoniesForm(ModelForm):
class Meta:
fields = '__all__'
model = models.Ponies
def core(request):
....
return render(request, 'services/core.html', {
...
'ponies': ponies,
})
def servicesToggleView(req...
Adding a feature to the UI
●

Add service entry for the feature

●

Create feature model, form and view

➔

Make the middl...
class notifier:
....
def _started_ponies(self):
self._system("/usr/sbin/service ponies status")
def _start_ponies(self):
s...
Adding a feature to the UI
●

Add service entry for the feature

●

Create feature model, form and view

●

Make the middl...
exit 0
Adding a feature to the UI
●

Add service entry for the feature

●

Create feature model, form and view

●

Make the middl...
ponies_on = false;
toggle_ponies = function(obj, onSuccess) {
if (ponies_on == false) {
BrowserPonies.start();
ponies_on =...
Let's see the newly added feature
Adding software to the system
●

Add sound driver to kernel config

●

Add mp3 program to NanoBSD config

●

Build images
...
Adding audio to FreeNAS
➔

Add sound driver to kernel config

●

Add mp3 program to NanoBSD config

●

Build images

●

Up...
...

add_nano_modules 
sound sound/driver/ich sound/driver/hda
Adding audio to FreeNAS
●

Add sound driver to kernel config

➔

Add mp3 program to NanoBSD config

●

Build images

●

Up...
...

add_port audio/mpg123
Adding audio to FreeNAS
●

Add sound driver to kernel config

●

Add mp3 program to NanoBSD config

➔

Build images

●

Up...
[root@freenas /mnt/vol0/git/freenas]# make
No git repo choice is set. Please use "make gitexternal" to build as an externa...
Adding audio to FreeNAS
●

Add sound driver to kernel config

●

Add mp3 program to NanoBSD config

●

Build images

➔

Up...
FreeNAS with audio
Debugging
●

Logging

●

/var/log/messages

●

/var/log/nginx-*

●

/var/log/debug.log

●

settings.py: DEBUG = True

●

f...
How to get involved
●

FreeNAS always needs help!

●

Patches can be submitted

●

Pull requests on github can be made

●
...
Where to get the code
●
●

●

●

FreeNAS source code is hosted on GitHub
git clone http://github.com/freenas/freenas.git
f...
Resources
●

Website: http://www.freenas.org

●

Docs: http://doc.freenas.org

●

Forum: http://forums.freenas.org

●

Bug...
Conclusion
●

FreeNAS is 100% open source

●

FreeNAS is very powerful

●

●

●

FreeNAS can be extended and customized to...
Questions?
Introduction to FreeNAS development by John Hixson
Upcoming SlideShare
Loading in...5
×

Introduction to FreeNAS development by John Hixson

1,091

Published on

At SCALE 12x, John Hixson, Senior Software Developer at iXsystems, gave a his talk, "Introduction to FreeNAS development". FreeNAS has been around for several years now but development on it has been by very few people. Even with corporate sponsorshipt and a team of full time developers, outside interest has been minimal. Not a week goes by when a bug report or feature request is not filed. Documentation on how to develop on FreeNAS simply does not exist. Currently, the only way to come up to speed on FreeNAS development is to obtain the source code, read through it, modify it and verify it works. The goal of this paper is to create a simple FreeNAS application to demonstrate some of the common methods used when dealing with FreeNAS development, as well as showcase some of the API.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,091
On Slideshare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Introduction to FreeNAS development by John Hixson

  1. 1. Introduction to FreeNAS Development John Hixson john@ixsystems.com iXsystems, Inc.
  2. 2. A bit about me ● ● BSD geek that does geeky BSD things Maintains jail, plugin, and directory service systems on FreeNAS ● Occasional committer to PC-BSD ● Hacks on FreeBSD once in a blue moon ● All my time goes into FreeNAS!
  3. 3. A bit about iXsystems ● Corporate sponsor of PC-BSD ● Corporate sponsor of FreeNAS ● Employ several FreeBSD committers ● ● Sponsor several open source conferences every year Contribute heavily to FreeBSD
  4. 4. What this talk will cover ● What FreeNAS is ● Adding a feature to the UI ● Adding software to the operating system ● How to contribute
  5. 5. What FreeNAS is: ● 100% free and open source network attached storage operating system ● Built on FreeBSD and ZFS ● CIFS, NFS, AFP, iSCSI, etc ● Over 6 million downloads to date
  6. 6. A quick look at FreeNAS
  7. 7. Adding a feature to the UI ● Add service entry for the feature ● Create feature model, form and view ● Make the middleware aware of feature ● Add a startup / shutdown script for the feature ● Javascript to toggle feature on and off
  8. 8. Adding a feature to the UI ➔ Add service entry for the feature ● Create feature model, form and view ● Make the middleware aware of feature ● Add a startup / shutdown script for the feature ● Javascript to toggle feature on and off
  9. 9. class Migration(SchemaMigration): def forwards(self, orm): .... p = orm.Ponies() p.save() s = orm.Services() s.srv_service = 'ponies' s.srv_enable = False s.save()
  10. 10. Adding a feature to the UI ● Add service entry for the feature ➔ Create feature model, form and view ● Make the middleware aware of feature ● Add a startup / shutdown script for the feature ● Javascript to toggle feature on and off
  11. 11. class Ponies(Model): class Meta: verbose_name = _(u"Ponies") verbose_name_plural = _(u"Ponies") class FreeAdmin: deletable = False
  12. 12. class PoniesForm(ModelForm): class Meta: fields = '__all__' model = models.Ponies
  13. 13. def core(request): .... return render(request, 'services/core.html', { ... 'ponies': ponies, }) def servicesToggleView(request, formname): form2namemap = { .... 'ponies_toggle': 'ponies', } ....
  14. 14. Adding a feature to the UI ● Add service entry for the feature ● Create feature model, form and view ➔ Make the middleware aware of feature ● Add a startup / shutdown script for the feature ● Javascript to toggle feature on and off
  15. 15. class notifier: .... def _started_ponies(self): self._system("/usr/sbin/service ponies status") def _start_ponies(self): self._system("/usr/sbin/service ponies start") def _stop_ponies(self): self._system("/usr/sbin/service ponies stop") def _restart_ponies(self): self._system("/usr/sbin/service ponies restart")
  16. 16. Adding a feature to the UI ● Add service entry for the feature ● Create feature model, form and view ● Make the middleware aware of feature ➔ Add a startup / shutdown script for the feature ● Javascript to toggle feature on and off
  17. 17. exit 0
  18. 18. Adding a feature to the UI ● Add service entry for the feature ● Create feature model, form and view ● Make the middleware aware of feature ● Add a startup / shutdown script for the feature ➔ Javascript to toggle feature on and off
  19. 19. ponies_on = false; toggle_ponies = function(obj, onSuccess) { if (ponies_on == false) { BrowserPonies.start(); ponies_on = true; } else { BrowserPonies.stop(); ponies_on = false; } return toggle_service(obj, onSuccess); }
  20. 20. Let's see the newly added feature
  21. 21. Adding software to the system ● Add sound driver to kernel config ● Add mp3 program to NanoBSD config ● Build images ● Upgrade system
  22. 22. Adding audio to FreeNAS ➔ Add sound driver to kernel config ● Add mp3 program to NanoBSD config ● Build images ● Upgrade system
  23. 23. ... add_nano_modules sound sound/driver/ich sound/driver/hda
  24. 24. Adding audio to FreeNAS ● Add sound driver to kernel config ➔ Add mp3 program to NanoBSD config ● Build images ● Upgrade system
  25. 25. ... add_port audio/mpg123
  26. 26. Adding audio to FreeNAS ● Add sound driver to kernel config ● Add mp3 program to NanoBSD config ➔ Build images ● Upgrade system
  27. 27. [root@freenas /mnt/vol0/git/freenas]# make No git repo choice is set. Please use "make gitexternal" to build as an external developer or "make gitinternal" to build as an iXsystems internal developer. You only need to do this once. *** [git-verify] Error code 1 Stop in /mnt/vol0/git/freenas. [root@freenas /mnt/vol0/git/freenas]# make git-external You are set up for external (github) development. You can use the standard make targets (e.g. build or release) now.
  28. 28. Adding audio to FreeNAS ● Add sound driver to kernel config ● Add mp3 program to NanoBSD config ● Build images ➔ Upgrade system
  29. 29. FreeNAS with audio
  30. 30. Debugging ● Logging ● /var/log/messages ● /var/log/nginx-* ● /var/log/debug.log ● settings.py: DEBUG = True ● freenas-debug ● Javascript debuggers in web browsers
  31. 31. How to get involved ● FreeNAS always needs help! ● Patches can be submitted ● Pull requests on github can be made ● Documentation can be contributed ● Bugs can be filed ● Use cases can be documented ● Help with translations
  32. 32. Where to get the code ● ● ● ● FreeNAS source code is hosted on GitHub git clone http://github.com/freenas/freenas.git freenas Must be built on FreeBSD or PC-BSD 9.2 system with a full development environment README file at root of checkout contains build requirements and instructions
  33. 33. Resources ● Website: http://www.freenas.org ● Docs: http://doc.freenas.org ● Forum: http://forums.freenas.org ● Bugs: http://bugs.freenas.org ● Email: http://lists.freenas.org ● IRC channel on freenode
  34. 34. Conclusion ● FreeNAS is 100% open source ● FreeNAS is very powerful ● ● ● FreeNAS can be extended and customized to fit your needs Demonstrating a simple application will hopefully give those interested that extra kick to do so! Everyone can contribute to FreeNAS!
  35. 35. Questions?
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×