Skip to content

Instantly share code, notes, and snippets.

@AlainODea
Last active December 26, 2015 15:49
Show Gist options
  • Save AlainODea/7175825 to your computer and use it in GitHub Desktop.
Save AlainODea/7175825 to your computer and use it in GitHub Desktop.
Creating an x86_64 (64-bit) SmartOS PKGSRC 2013Q3 build system
#!/usr/bin/env bash
sdc-createmachineandwait 17c98640-1fdb-11e3-bf51-3708ce78e75a g3-highcpu-1.75-smartos
#!/usr/bin/env bash
image_uuid=$1
package=$2
sdc-createmachine --dataset $image_uuid --package $package --name alain.odea-$(uuid) |
json -a id |
while read uuid
do
while [ "$(sdc-getmachine $uuid | json -ga state)" != "running" ]
do
echo waiting for $uuid
done
echo $(sdc-getmachine $uuid | json -ga ips[0])
done
#!/usr/bin/env bash
rm -Rf /opt/local /var/db/pkgin
curl -s http://pkgsrc.joyent.com/packages/SmartOS/bootstrap/bootstrap-2013Q3-x86_64.tar.gz |
gzcat |
(cd /; tar -xpf -)
pkgin -y up && pkgin -y ug && pkgin -y in git build-essential url2pkg pkgdiff pkglint createbuildlink
mkdir /content
pushd /content
# this takes quite a while (1.23GB repo)
git clone git://github.com/joyent/pkgsrc.git
pushd pkgsrc
# pick 2013Q3 as the stable release base
git checkout joyent/release/2013Q3
# get pkgsrc-wip
git submodule init
git submodule update
mkdir -p /content/{distfiles,packages}
cat > /opt/local/etc/mk.conf <<'EOF'
.ifdef BSD_PKG_MK # begin pkgsrc settings
ABI= 64
PKGSRC_COMPILER= gcc
GCCBASE= /opt/local/gcc47
PKG_DBDIR= /opt/local/pkg
LOCALBASE= /opt/local
VARBASE= /var
PKG_TOOLS_BIN= /opt/local/sbin
PKGINFODIR= info
PKGMANDIR= man
PREFER_PKGSRC= yes
PREFER_NATIVE= libexecinfo solaris-pam terminfo
TOOLS_PLATFORM.install?= /opt/local/bin/bsdinstall
TOOLS_PLATFORM.awk?= /opt/local/bin/nawk
TOOLS_PLATFORM.sed?= /opt/local/bin/nbsed
TOOLS_PLATFORM.sh?= /usr/bin/bash
DISTDIR= /content/distfiles
PACKAGES= /content/packages
WRKOBJDIR= /var/tmp/pkgsrc-build
#
ALLOW_VULNERABLE_PACKAGES= yes
SKIP_LICENSE_CHECK= yes
#
MAKE_JOBS= 8
#
FETCH_USING= curl
#
# Adjust BINPKG_SITES, depending upon the dataset chosen, it should be the URL
# from /opt/local/etc/pkgin/repositories.conf without the trailing 'All'.
BINPKG_SITES= http://pkgsrc.joyent.com/packages/SmartOS/2013Q3/x86_64/
DEPENDS_TARGET= bin-install
.endif # end pkgsrc settings
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment