perkin.org.uk - Creating local SmartOS packages









Search Preview

Creating local SmartOS packages

perkin.org.uk
Jonathan Perkin about me · rss · twitter · github
.org.uk > perkin.org.uk

SEO audit: Content analysis

Language Error! No language localisation is found.
Title Creating local SmartOS packages
Text / HTML ratio 48 %
Frame Excellent! The website does not use iFrame solutions.
Flash Excellent! The website does not have any flash contents.
Keywords cloud » package SmartOS packages information file pkgin memory files basic Jan Dec Jun pkgsrc Memory RSS tools pkg_info simply create
Keywords consistency
Keyword Content Title Description Headings
» 52
package 30
SmartOS 27
packages 16
information 15
file 13
Headings
H1 H2 H3 H4 H5 H6
2 0 4 3 0 0
Images We found 0 images on this web page.

SEO Keywords (Single)

Keyword Occurrence Density
» 52 2.60 %
package 30 1.50 %
SmartOS 27 1.35 %
packages 16 0.80 %
information 15 0.75 %
file 13 0.65 %
pkgin 11 0.55 %
memory 11 0.55 %
files 10 0.50 %
basic 10 0.50 %
Jan 9 0.45 %
Dec 8 0.40 %
Jun 7 0.35 %
pkgsrc 7 0.35 %
Memory 6 0.30 %
RSS 6 0.30 %
tools 6 0.30 %
pkg_info 6 0.30 %
simply 6 0.30 %
create 6 0.30 %

SEO Keywords (Two Word)

Keyword Occurrence Density
2013 » 18 0.90 %
2012 » 14 0.70 %
the package 14 0.70 %
2011 » 11 0.55 %
on SmartOS 10 0.50 %
Jan 2013 6 0.30 %
Memory RSS 6 0.30 %
Jun 2011 6 0.30 %
you can 5 0.25 %
A nodejspowered 4 0.20 %
8bit CPU 4 0.20 %
CPU part 4 0.20 %
memory information 4 0.20 %
» SmartOS 4 0.20 %
Dec 2013 4 0.20 %
basic memory 4 0.20 %
of the 4 0.20 %
used and 4 0.20 %
» A 4 0.20 %
nodejspowered 8bit 4 0.20 %

SEO Keywords (Three Word)

Keyword Occurrence Density Possible Spam
Jun 2011 » 6 0.30 % No
Jan 2013 » 6 0.30 % No
» pkgsrc on 4 0.20 % No
Dec 2013 » 4 0.20 % No
2013 » A 4 0.20 % No
» A nodejspowered 4 0.20 % No
A nodejspowered 8bit 4 0.20 % No
nodejspowered 8bit CPU 4 0.20 % No
8bit CPU part 4 0.20 % No
basic memory information 4 0.20 % No
basic information about 3 0.15 % No
memory information on 3 0.15 % No
information on SmartOS 3 0.15 % No
a SmartOS machine 3 0.15 % No
pkgsrc on SmartOS 3 0.15 % No
2013 » pkgsrc 3 0.15 % No
On SmartOS this 3 0.15 % No
SmartOS this is 3 0.15 % No
Jan 2012 » 3 0.15 % No
» How to 3 0.15 % No

SEO Keywords (Four Word)

Keyword Occurrence Density Possible Spam
Dec 2013 » A 4 0.20 % No
2013 » A nodejspowered 4 0.20 % No
» A nodejspowered 8bit 4 0.20 % No
A nodejspowered 8bit CPU 4 0.20 % No
nodejspowered 8bit CPU part 4 0.20 % No
2013 » pkgsrc on 3 0.15 % No
» pkgsrc on SmartOS 3 0.15 % No
On SmartOS this is 3 0.15 % No
basic memory information on 3 0.15 % No
memory information on SmartOS 3 0.15 % No
total memory size used 2 0.10 % No
size used and free 2 0.10 % No
the output of uname 2 0.10 % No
ie the output of 2 0.10 % No
memory size used and 2 0.10 % No
» What's new in 2 0.10 % No
the total memory size 2 0.10 % No
used and free The 2 0.10 % No
on a SmartOS machine 2 0.10 % No
memory on a SmartOS 2 0.10 % No

Internal links in - perkin.org.uk

about me
About Me
rss
Jonathan Perkin
Reducing RAM usage in pkgin
Reducing RAM usage in pkgin
Building packages at scale
Building packages at scale
A node.js-powered 8-bit CPU - part four
A node.js-powered 8-bit CPU - part four
A node.js-powered 8-bit CPU - part three
A node.js-powered 8-bit CPU - part three
A node.js-powered 8-bit CPU - part two
A node.js-powered 8-bit CPU - part two
A node.js-powered 8-bit CPU - part one
A node.js-powered 8-bit CPU - part one
MDB support for Go
MDB support for Go
Distributed chrooted pkgsrc bulk builds
Distributed chrooted pkgsrc bulk builds
pkgsrc on SmartOS - creating new packages
pkgsrc on SmartOS - creating new packages
Installing SVR4 packages on SmartOS
Installing SVR4 packages on SmartOS
SmartOS is Not GNU/Linux
SmartOS is Not GNU/Linux
SmartOS development preview dataset
SmartOS development preview dataset
pkgsrc on SmartOS - fixing broken builds
pkgsrc on SmartOS - fixing broken builds
pkgsrc on SmartOS - zone creation and basic builds
pkgsrc on SmartOS - zone creation and basic builds
Multi-architecture package support in SmartOS
Multi-architecture package support in SmartOS
Solaris portability - cfmakeraw()
Solaris portability - cfmakeraw()
Solaris portability - flock()
Solaris portability - flock()
SmartOS and the global zone
SmartOS and the global zone
Setting up Samba on SmartOS
Setting up Samba on SmartOS
Creating local SmartOS packages
Creating local SmartOS packages
7,000 binary packages for OSX Lion
7,000 binary packages for OSX Lion
9,000 packages for SmartOS and illumos
9,000 packages for SmartOS and illumos
Goodbye Oracle, Hello Joyent!
Goodbye Oracle, Hello Joyent!
SmartOS global zone tweaks
SmartOS global zone tweaks
Automated VirtualBox SmartOS installs
Automated VirtualBox SmartOS installs
iptables script for Debian / Ubuntu
iptables script for Debian / Ubuntu
New site design
New site design
Set up anonymous FTP upload on Oracle Linux
Set up anonymous FTP upload on Oracle Linux
Kickstart Oracle Linux in VirtualBox
Kickstart Oracle Linux in VirtualBox
Kickstart Oracle Linux from Ubuntu
Kickstart Oracle Linux from Ubuntu
Last day at MySQL
Last day at MySQL
Installing OpenBSD with softraid
Installing OpenBSD with softraid
Create VirtualBox VM from the command line
Create VirtualBox VM from the command line
Creating chroots for fun and MySQL testing
Creating chroots for fun and MySQL testing
Graphing memory usage during an MTR run
Graphing memory usage during an MTR run
Fix input box keybindings in Firefox
Fix input box keybindings in Firefox
How to lose weight
How to lose weight
How to fix stdio buffering
How to fix stdio buffering
Fix Firefox URL double click behaviour
Fix Firefox URL double click behaviour
SSH via HTTP proxy in OSX
SSH via HTTP proxy in OSX
How to build MySQL releases
How to build MySQL releases
ZFS and NFS vs OSX
ZFS and NFS vs OSX
pkgsrc on Solaris
pkgsrc on Solaris
Jumpstart from OSX
Jumpstart from OSX
Set up local caching DNS server on OSX 10.4
Set up local caching DNS server on OSX 10.4

Perkin.org.uk Spined HTML


Creating local SmartOS packages Jonathan Perkin well-nigh me · rss · twitter · github Creating local SmartOS packages Aug 23, 2012 tags: pkgin, pkgsrc, smartos Ok, so you have a SmartOS machine set up, and are using pkgin to install packages. Now you may want to moreover handle your local software using the same tools, so that you can take wholesomeness of hands installing and upgrading packages. This post describes how you can do this. We will be creating a hypothetical package meminfo, containing a script of the same name which prints vital memory information, and just unbearable metadata for it to be understood by the packaging tools. This guide assumes you are running a standard dataset which includes packaging tools in /opt/local/sbin, that is: $ /opt/local/sbin/pkg_info should requite you a list of currently installed packages. Files to install First, let’s start in a wipe directory, and then create a files sub-directory which will hold the files we want to package. The files in this directory will be installed relative to the packaging prefix, which for most SmartOS installs will be /opt/local. $ mkdir package $ cd package $ mkdir -p files/bin Now we create the meminfo script. You will probably just reprinting your binaries into place at this stage. $ vi files/bin/meminfo #!/usr/bin/bash # # This is just a subset of 'sm-summary' from the 'smtools' package. # SM_UUID=$(zonename); SM_ID=$(zoneadm list -p | awk -F: '{ print $1 }'); SM_MEMCAP=$(kstat -p -c zone_caps -n lockedmem_zone_${SM_ID} -s value | awk '{print $2/1024/1024 }'); SM_MEMUSED=$(prstat -Z -s rss 1 1 | awk -v zone=${SM_UUID} '$8 ~ zone { printf("%d", $4 ) }'); SM_MEMFREE=$(echo "${SM_MEMCAP}-${SM_MEMUSED}" | bc); cat <<EOF Memory (RSS) Cap ${SM_MEMCAP}M Memory (RSS) Used ${SM_MEMUSED}M Memory (RSS)Self-ruling${SM_MEMFREE}M EOF Ensure the script is executable! $ chmod +x files/bin/meminfo Finally for this part, generate a packlist file which simply contains a list of files we want packaged, relative to the files directory: $ (cd files; find * -type f -or -type l | sort) >packlist The packlist file supports many directives which are lines whence with @<cmd>. These let you do things such as transpiration file permissions once the file has been installed. See the ‘PACKING LIST DETAILS’ section of pkg_create(1) for increasingly information. Package metadata In order to successfully create a package, we need a few metadata files which describe the package. build-info This file contains vital information well-nigh the package, and is primarily used to ensure that the package can be installed on the target machine. The minimum information required is: MACHINE_ARCH. On SmartOS this is either i386 or x86_64 depending upon whether you chose a base/smartos or base64/smartos64 dataset. Attempting to install a package intended for one tracery with package tools built for a variegated tracery will work due to SmartOS stuff worldly-wise to run both 32-bit and 64-bit applications, but you will get warnings when installing. OPSYS. On SmartOS this is SunOS, i.e. the output of uname -s. OS_VERSION. On SmartOS this is 5.11, i.e. the output of uname -r. PKGTOOLS_VERSION. An integer describing the version of the pkg_install tools required to understand this package. At the current time pkgsrc sets a wiring version of 20091115 so just use this. The easiest way to generate this file is simply to get it from an existing package, for example: $ pkg_info -X pkg_install \ | egrep '^(MACHINE_ARCH|OPSYS|OS_VERSION|PKGTOOLS_VERSION)' >build-info $ cat build-info MACHINE_ARCH=i386 OPSYS=SunOS OS_VERSION=5.11 PKGTOOLS_VERSION=20091115 scuttlebutt This is a short string describing the package which is shown in the default pkg_info or pkgin list output. Keep this short, preferably under 60 characters, so that it displays correctly in 80-column terminals. $ reverberate "Show vital memory information on SmartOS" >comment unravelment This is a longer multi-line unravelment of the package which is output by pkg_info <package name> or pkgin pkg-descr <package name>. Format this to 80-columns. $ cat >description <<EOF meminfo prints vital information well-nigh misogynist memory on a SmartOS machine, listing the total memory size, used, and free. The information provided should be understood in light of how memory is used and reported on SmartOS, for increasingly information refer to: http://wiki.smartos.org/display/DOC/About+Memory+Usage+and+Capping EOF So we should now have: build-info # vital package information scuttlebutt # one-line scuttlebutt unravelment # multi-line scuttlebutt files/bin/meminfo # the file we wish to package packlist # package listing Create the package We now have unbearable information to create a vital package. The magic invocation to perform the operation is: $ pkg_create -B build-info -c scuttlebutt -d unravelment -f packlist \ -I /opt/local -p files -U meminfo-1.0.tgz The -B, -c, -d and -f arguments simply pull in the metadata files we’ve written. The -I treatise specifies the destination prefix. As we are creating a package outside of this prefix we need to tell pkg_create of the ultimate destination. The -p treatise is used in conjunction with -I to tell pkg_create where our files to be packaged can be found. The -U treatise ways we should just create the package, and not register it. And finally, we provide the package file. The packaging tools understand version numbers, so we can just provide the file name and it will determine the package name and version from that. To verify the package, you can run: $ pkg_info -X meminfo-1.0.tgz PKGNAME=meminfo-1.0 COMMENT=Show vital memory information on SmartOS MACHINE_ARCH=i386 OPSYS=SunOS OS_VERSION=5.11 PKGTOOLS_VERSION=20091115 FILE_NAME=meminfo-1.0.tgz FILE_SIZE=922 DESCRIPTION=meminfo prints vital information well-nigh misogynist memory on a SmartOS machine, DESCRIPTION=listing the total memory size, used, and free. The information provided DESCRIPTION=should be understood in light of how memory is used and reported on SmartOS, DESCRIPTION=for increasingly information refer to: DESCRIPTION= DESCRIPTION=http://wiki.smartos.org/display/DOC/About+Memory+Usage+and+Capping Installing For a single machine, you can now simply install the package with: $ pkg_add meminfo-1.0.tgz If you want to publish the package so that it is misogynist to pkgin you need to create a pkg_summary file and put it slantingly the package for download. This file is usually compressed to speed things up, and pkgin supports both .gz and .bz2. $ pkg_info -X meminfo-1.0.tgz | gzip -9 >pkg_summary.gz For example purposes I will simply use file://, but of undertow you can use http:// instead if you put the packages and pkg_summary file somewhere accessible: $ mkdir /var/tmp/packages $ cp meminfo-1.0.tgz pkg_summary.gz /var/tmp/packages Add this repository to pkgin and reload: $ reverberate "file:///var/tmp/packages" >>/opt/local/etc/pkgin/repositories.conf $ sudo pkgin -fy up Now the package should show up: $ pkgin avail | grep meminfo meminfo-1.0 Show vital memory information on SmartOS and be installable: $ sudo pkgin -y install meminfo $ /opt/local/bin/meminfo Memory (RSS) Cap 8192M Memory (RSS) Used 92M Memory (RSS)Self-ruling8100M This covers the nuts and should be unbearable to get started. As mentioned, there are many other options available, and I suggest that if you need spare functionality you take a squint at the pkg_create transmission page, or simply use pkg_info -X on increasingly complicated packages to see what they do. Share this post on Twitter, HackerNews, Facebook or Google+ All Posts 16 Jul 2015 » Reducing RAM usage in pkgin 03 Mar 2015 » pkgsrc-2014Q4: LTS, signed packages, and increasingly 06 Oct 2014 » Building packages at scale 04 Dec 2013 » A node.js-powered 8-bit CPU - part four 03 Dec 2013 » A node.js-powered 8-bit CPU - part three 02 Dec 2013 » A node.js-powered 8-bit CPU - part two 01 Dec 2013 » A node.js-powered 8-bit CPU - part one 21 Nov 2013 » MDB support for Go 30 Jul 2013 » What's new in pkgsrc-2013Q2 24 Jul 2013 » Distributed chrooted pkgsrc zillion builds 07 Jun 2013 » pkgsrc on SmartOS - creating new packages 15 Apr 2013 » What's new in pkgsrc-2013Q1 19 Mar 2013 » Installing SVR4 packages on SmartOS 27 Feb 2013 » SmartOS is Not GNU/Linux 18 Feb 2013 » SmartOS minutiae preview dataset 17 Jan 2013 » pkgsrc on SmartOS - fixing wrenched builds 15 Jan 2013 » pkgsrc on SmartOS - zone megacosm and vital builds 10 Jan 2013 » Multi-architecture package support in SmartOS 09 Jan 2013 » Solaris portability - cfmakeraw() 08 Jan 2013 » Solaris portability - flock() 06 Jan 2013 » pkgsrc-2012Q4 illumos packages now misogynist 23 Nov 2012 » SmartOS and the global zone 24 Oct 2012 » Setting up Samba on SmartOS 10 Oct 2012 » pkgsrc-2012Q3 packages for illumos 23 Aug 2012 » Creating local SmartOS packages 10 Jul 2012 » 7,000 binary packages for OSX Lion 09 Jul 2012 » 9,000 packages for SmartOS and illumos 07 May 2012 » Goodbye Oracle, Hello Joyent! 13 Apr 2012 » SmartOS global zone tweaks 12 Apr 2012 » Automated VirtualBox SmartOS installs 30 Mar 2012 » iptables script for Debian / Ubuntu 20 Feb 2012 » New site diamond 11 Jan 2012 » Set up unrecognized FTP upload on Oracle Linux 09 Jan 2012 » Kickstart Oracle Linux in VirtualBox 09 Jan 2012 » Kickstart Oracle Linux from Ubuntu 22 Dec 2011 » Last day at MySQL 15 Dec 2011 » Installing OpenBSD with softraid 21 Sep 2011 » Create VirtualBox VM from the writ line 14 Sep 2011 » Creating chroots for fun and MySQL testing 30 Jun 2011 » Graphing memory usage during an MTR run 29 Jun 2011 » Fix input box keybindings in Firefox 24 Jun 2011 » How to lose weight 23 Jun 2011 » How to fix stdio buffering 13 Jun 2011 » Serving multiple DNS search domains in IOS DHCP 13 Jun 2011 » Fix Firefox URL double click behaviour 20 Apr 2011 » SSH via HTTP proxy in OSX 09 Nov 2010 » How to build MySQL releases 29 Apr 2010 » 'apt-get' and 5,000 packages for Solaris10/x86 16 Sep 2009 » ZFS and NFS vs OSX 12 Sep 2009 » pkgsrc on Solaris 09 Dec 2008 » Jumpstart from OSX 31 Dec 2007 » Set up local caching DNS server on OSX 10.4