{"id":129,"date":"2013-11-01T19:26:55","date_gmt":"2013-11-01T19:26:55","guid":{"rendered":"http:\/\/blog.ignoranthack.me\/?p=129"},"modified":"2014-04-19T14:45:48","modified_gmt":"2014-04-19T14:45:48","slug":"how-i-learned-to-stop-worrying-and-love-the-powderkeg-freebsd","status":"publish","type":"post","link":"http:\/\/blog.ignoranthack.me\/?p=129","title":{"rendered":"How I learned to stop worrying and love the powderkeg.  #FreeBSD"},"content":{"rendered":"<p>FreeBSD has grown up a lot in this release cycle.\u00a0 The most useful tool from the 10.0\/11.0 world in a long time, poudriere (powder keg in French) has made my ports usage almost trivial now.<\/p>\n<p>More or less, poudriere is a tool that allows you to build ports packages compatible with the new PKGNG format without contaminating your working system.\u00a0 It uses a series of jails and build environments to do what a lot of more savvy FreeBSD developers and engineers have been doing for years.<\/p>\n<p>Even using portmaster to maintain my systems seems archaic in comparison, not to mention error prone.\u00a0 More or less, my 3 or 4 systems have been converted to use themselves as a repository for packages and they build their own packages.\u00a0 This is a bit redundant to be honest, and it makes the most sense to use one host as a repository and have your other machines pull in packages from it.\u00a0 My implementation is due to running 11-current and being having machines I control on very different and restrictive networks.<\/p>\n<p>poudriere setup for 11-current (head builds)<\/p>\n<p>Start by install poudriere from ports or a package that you can get your hands on.\u00a0 Then command poudriere to setup its basejail on FreeBSD SVN HEAD:<\/p>\n<p>poudriere jail -c -j 11-amd64 -v head -a amd64 -m svn<\/p>\n<p>This will create a jail on your local machine based on SVN head at the time of execution (yes, its going to compile everything from source and will take a while, get a cup of coffee, perhaps a sandwich).\u00a0 The thing is, your machine is still available for other things while this is going on.\u00a0 You are not going to crash X or other applications while this is happening.\u00a0 Its building a separate jail for the purpose of creating packages.<\/p>\n<p>Once its build, you can update your jail world trivially via:<\/p>\n<p>poudriere jail -u -j 11-amd64<\/p>\n<p>Now, grab the ports tree via:<\/p>\n<p>poudriere ports -c<\/p>\n<p>Updates to your ports tree via portsnap are easy with a :<\/p>\n<p>poudriere ports -u<\/p>\n<p>At this point, you are ready to configure poudriere to build your package via the &#8220;bulk&#8221; command.\u00a0 I copied \/usr\/local\/etc\/poudriere.conf.sample to \/usr\/local\/etc\/poudriere.conf and made exactly one change to the default settings.\u00a0 I use ZFS ( which I highly recommend, see my post on the Bacon of Filesystems ) and my ZPOOL is a different name than the default.<\/p>\n<p>Creating your list of ports for your builds is a trial and error endeavor to be honest.\u00a0 I suspect, there are easier ways to do it, but I determined my list below based on the list I had installed already and some questions to various mailing lists.\u00a0 I created a \/usr\/local\/etc\/myports file with the following in it as a list of ports that I want built.\u00a0 Poudriere will build all required dependencies for me, build-time and run-time and create nice little packages for me.<\/p>\n<p>x11\/xorg<br \/>\nx11\/xdm<br \/>\nx11\/xsm<br \/>\nx11-wm\/xfce4<br \/>\nx11\/xfce4-screenshooter-plugin<br \/>\nx11\/xscreensaver<br \/>\nshells\/bash<br \/>\nwww\/firefox<br \/>\nwww\/linux-f10-flashplugin11<br \/>\nwww\/nspluginwrapper<br \/>\ngraphics\/evince<br \/>\nnet-im\/finch<br \/>\neditors\/vim<br \/>\nsysutils\/tmux<br \/>\ncomms\/amtterm<br \/>\nports-mgmt\/dialog4ports<br \/>\nports-mgmt\/pkg<br \/>\nports-mgmt\/poudriere<br \/>\njava\/openjdk7<br \/>\neditors\/vim-lite<br \/>\nsysutils\/synergy-devel<br \/>\ndevel\/git<br \/>\nemulators\/qemu-devel<\/p>\n<p>At this point, I was read to do the build run via:<\/p>\n<p>poudriere bulk -f \/usr\/local\/etc\/myports -j 11-amd64<\/p>\n<p>This builds all the things for me, caching packages when needed for reuse.\u00a0 Very handy for me to be honest.<\/p>\n<p>Setting up the pkg repo couldn&#8217;t be simpler either.\u00a0 I copied \/usr\/local\/etc\/pkg.conf.sample to \/usr\/local\/etc\/pkg.conf and made a single change to point the system to use the locally build packages in a locally generated repo:<\/p>\n<p>PACKAGESITE\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 : file:\/\/\/usr\/local\/poudriere\/data\/packages\/11-amd64-default<\/p>\n<p>The final step was to initialize my repository via:<\/p>\n<p>pkg repo \/usr\/local\/poudriere\/data\/packages\/11-amd64-default<\/p>\n<p>I then updated my system via the newly built packages:<\/p>\n<p>pkg update<\/p>\n<p>pkg upgrade -f<\/p>\n<p>This refreshed all the packages on my system with ones that are cleanly built by poudriere.\u00a0 This allowed me to now audit what I had installed and to see what I could remove or what else I needed to have built:<\/p>\n<p>pkg version -R<\/p>\n<p>Anything with a &#8220;=&#8221; means that it comes from the repository and is up to date.\u00a0 Anything with a &#8220;?&#8221; means it comes from an unknown source.\u00a0\u00a0 I learned I had a lot of dependencies installed for builds that I didn&#8217;t need for runtime cases:<\/p>\n<p>pkg autoremove<\/p>\n<p>Many, many, many thanks to the FreeBSD portmgr team (portmgr@freebsd.org), Baptiste Daroussin, Bryan Drewery and the others who have deadlifted the FreeBSD ports system into the future. Now I can look at whats left and I have never been more content with FreeBSD ports.\u00a0 *boom*<\/p>\n<p>*edit* reference to poudriere official docs and such:<\/p>\n<p>https:\/\/fossil.etoilebsd.net\/poudriere\/doc\/trunk\/doc\/index.wiki<\/p>\n<p>*edit* after pkg-1.2.1 release.<\/p>\n<p>The pkg.conf config and locations have moved around and become incompatible with this blog post.\u00a0 You&#8217;ll want to do two things if you are using this as a guide for updates:<\/p>\n<p>1.\u00a0 Disable the FreeBSD repo configuration in \/etc\/pkg\/FreeBSD.conf<\/p>\n<p>2. Move your local repo config to \/etc\/pkg\/my_repo.conf and give it the following syntax:<\/p>\n<blockquote><p>me: {<br \/>\nurl: file:\/\/\/usr\/local\/poudriere\/data\/packages\/11-amd64-default,<br \/>\nsignature_type: none,<br \/>\nenabled: yes<br \/>\n}<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>FreeBSD has grown up a lot in this release cycle.\u00a0 The most useful tool from the 10.0\/11.0 world in a long time, poudriere (powder keg in French) has made my ports usage almost trivial now. More or less, poudriere is a tool that allows you to build ports packages compatible with the new PKGNG format [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"_share_on_mastodon":"0"},"categories":[2],"tags":[],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/posts\/129"}],"collection":[{"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=129"}],"version-history":[{"count":7,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/posts\/129\/revisions"}],"predecessor-version":[{"id":180,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/posts\/129\/revisions\/180"}],"wp:attachment":[{"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=129"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}