Tuesday, March 17, 2009

Ports management in FreeBSD

After re-installing FreeBSD 7.1 for testing numerous time, I decided to not use portupgrade anymore. I have decided to switch to a non-db backend system with bpkg and portmaster for my ports management. Bpkg is da bomb, you can do all types of queries on installed/not-installed ports. My favorite is "bpkg -p $1 | egrep '^[a-z]'". I have added it as a function called "sp" to my .zshrc file. With the output I can just copy and paste to a portmaster line, now that's super easy. Be sure to check out all the options for bpkg.

My server install of FreeBSD

Well, after trying a few test install of FreeBSD 7.1, I have finally decided to stick with this one. This will be my network management headless server. This system will not have X installed so I have added "WITHOUT_X11=yes" to my /etc/rc.conf file to make sure nothing X will be installed. I always make sure before I install a port just in case it has some type of X dependencies.

Also, I will be testing out jails on this server. I'll keep notes and create a blog entry.

Checking a script for Bashisms on FreeBSD

First you need to read the web page DashAsBinSh. It will explain a lot.

1. Then install 'archivers/dpkg' from ports.
2. Then download the deb package from the bottom of this page - devscripts
---- I picked the x86 package.
3. Then unarchive the downloaded deb packed to a temporary directory,
---- dpkg -X devscripts_2.10.26ubuntu15_i386.deb tempdirname.
4. The files that are needed are
---- tempdir/usr/bin/checkbashisms
---- tempdir/usr/share/man/man1/checkbashisms.1.gz
5. copy these files to the appropiate location in /usr/local
6. Now you can delete the packges installed by step 1, just be sure they aren't need by other packages
---- devel/p5-ExtUtils-CBuilder
---- devel/p5-ExtUtils-ParseXS
---- textproc/p5-YAML
---- devel/p5-Module-Build
---- devel/p5-Term-ReadKey
---- textproc/libtext-charwidth-perl
---- textproc/libtext-wrapi18n-perl
---- textproc/p5-SGMLSpm
---- textproc/po4a
---- devel/patch
---- sysutils/coreutils
---- archivers/dpkg