Obtaining NetBSD source code

grab-binary | grab-source | kernel | cross | world | tweaks

Introduction

you can avoid grabbing all the sources if all you need to do, is to rebuild the kernel of the NetBSD release version that you are running. in that case, syssrc will be enough.

Requirements

check for latest release

rel=10.0

make sure you’ve got those available

export PKG_PATH="http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/$rel/All/"
pkg_add wget
pkg_add screen

grab the release sources

rel=10.0_RC5

grab kernel source

wget http://cdn.netbsd.org/pub/NetBSD/NetBSD-$rel/source/sets/syssrc.tgz
# http://nycdn.netbsd.org/pub/NetBSD-daily/netbsd-9/latest/source/sets/syssrc.tgz

and in case you’re not running that release…

wget http://cdn.netbsd.org/pub/NetBSD/NetBSD-$rel/source/sets/gnusrc.tgz
wget http://cdn.netbsd.org/pub/NetBSD/NetBSD-$rel/source/sets/sharesrc.tgz
wget http://cdn.netbsd.org/pub/NetBSD/NetBSD-$rel/source/sets/src.tgz

note for older releases, you need to point to archives

ftp -a ftp://$mirror/pub/NetBSD-archive/NetBSD-$ver/source/sets/syssrc.tgz
ftp -a ftp://$mirror/pub/NetBSD-archive/NetBSD-$ver/source/sets/src.tgz
ftp -a ftp://$mirror/pub/NetBSD-archive/NetBSD-$ver/source/sets/sharesrc.tgz
ftp -a ftp://$mirror/pub/NetBSD-archive/NetBSD-$ver/source/sets/gnusrc.tgz

Extract the release sources

netbsd

progress -zf syssrc.tgz tar xf - -C /
rm -f syssrc.tgz

and in case you’re not running that release…

progress -zf src.tgz tar xf - -C /
progress -zf sharesrc.tgz tar xf - -C /
progress -zf gnusrc.tgz tar xf - -C /
rm -f src.tgz
rm -f sharesrc.tgz
rm -f gnusrc.tgz

gnu/linux

slackpkg install libarchive

bsdtar xzf syssrc.tgz -C /var/tmp/
bsdtar xzf gnusrc.tgz -C /var/tmp/
bsdtar xzf sharesrc.tgz -C /var/tmp/
bsdtar xzf src.tgz -C /var/tmp/
rm -f syssrc.tgz
rm -f gnusrc.tgz
rm -f sharesrc.tgz
rm -f src.tgz

current by cvs

export CVSROOT="anoncvs@anoncvs.fr.NetBSD.org:/cvsroot"
export CVS_RSH="ssh"
cvs -q -z9 checkout src

cd /usr/src/
cvs -q -z9 up -dP

current by tarball

cd /var/tmp/
mirror=https://...

wget $mirror/pub/NetBSD/NetBSD-current/tar_files/src.tar.gz

Resources

https://www.netbsd.org/docs/pkgsrc/tools.html

https://www.netbsd.org/docs/guide/en/chap-build.html

https://www.netbsd.org/docs/guide/en/chap-kernel.html


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun