Skip to content

Commit

Permalink
Switch to netbsd-8 by default.
Browse files Browse the repository at this point in the history
There are a number of other changes too:
- fetch from nycdn, via https (but searching for the release is via FTP)
- make.bash now takes arguments: arch and release branch.
  Example for -current: ./make.bash amd64 HEAD
- no longer install any packages by default. I may revisit this in the
  future when py-google-compute-engine becomes usable.
  • Loading branch information
bsiegert committed Sep 21, 2017
1 parent 48b9d34 commit f04d615
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
6 changes: 3 additions & 3 deletions make.bash
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
set -e -x

ANITA_VERSION=1.42
ARCH=amd64
RELEASE=8.0_2017Q2
ARCH=${1:-amd64}
RELEASE=${2:-netbsd-8}

# Must use GNU tar. On NetBSD, tar is BSD tar and gtar is GNU.
TAR=tar
Expand All @@ -29,7 +29,7 @@ if which gsha1sum > /dev/null; then
SHA1SUM=gsha1sum
fi

WORKDIR=work-NetBSD-${ARCH}
WORKDIR=work-${RELEASE}-${ARCH}

# Remove WORKDIR unless -k (keep) is given.
if [ "$1" != "-k" ]; then
Expand Down
17 changes: 7 additions & 10 deletions mkvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
import ftplib
import sys

def find_latest_release(arch):
def find_latest_release(branch, arch):
"""Find the latest NetBSD-current release for the given arch.
Returns:
the full path to the release.
"""
conn = ftplib.FTP('nyftp.netbsd.org')
conn.login()
conn.cwd('/pub/NetBSD-daily/HEAD')
conn.cwd('/pub/NetBSD-daily/%s' % branch)
releases = conn.nlst()
releases.sort(reverse=True)
for r in releases:
Expand All @@ -24,19 +24,17 @@ def find_latest_release(arch):
next
has_arch = [a for a in archs if a.endswith(arch)]
if has_arch:
return "ftp://nyftp.netbsd.org/pub/NetBSD-daily/HEAD/%s/" % has_arch[0]
return "https://nycdn.netbsd.org/pub/NetBSD-daily/%s/%s/" % (branch, has_arch[0])


arch = sys.argv[1]
release = sys.argv[2]
branch = sys.argv[2]

commands = [
"""cat > /etc/ifconfig.vioif0 << EOF
!/usr/pkg/sbin/dhcpcd vioif0
!route add default \`ifconfig vioif0 | awk '/inet / { print \$2 }' | sed 's/[0-9]*$/1/'\` -ifp vioif0
!dhcpcd vioif0
EOF""",
"dhcpcd",
"env PKG_PATH=https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/%s/%s/All/ pkg_add dhcpcd" % (arch, release),
"""ed /etc/fstab << EOF
H
%s/wd0/sd0/
Expand All @@ -47,9 +45,8 @@ def find_latest_release(arch):


a = anita.Anita(
# TODO(bsiegert) use latest
anita.URL("https://cdn.NetBSD.org/pub/NetBSD/NetBSD-7.1/%s/" % arch),
workdir="work-NetBSD-%s" % arch,
anita.URL(find_latest_release(branch, arch)),
workdir="work-%s-%s" % (branch, arch),
disk_size="4G",
memory_size = "1G",
persist=True)
Expand Down

0 comments on commit f04d615

Please sign in to comment.