1#!/bin/sh 2# 3# $NetBSD: listsrcdirs,v 1.18 2014/08/11 22:13:56 justin Exp $ 4# 5 6# 7# This script echoes the NetBSD source directories useful for 8# rump kernels. 9# Feed the output to whichever method you use to obtain NetBSD sources, e.g. 10# 11# ./listsrcdirs | xargs cvs -d anoncvs@anoncvs.netbsd.org:/cvsroot -z3 co -P 12# 13# Note: after making changes, test that "sh listsrcdirs all | sort | uniq -d" 14# returns an empty set. 15# 16 17# default echomode (for compat) 18em='sys posix' 19 20# everything we support 21all='sys posix usr' 22 23# mini-getopt (so that we don't have to with getopt vs. getopts 24cvsmode=false 25if [ "${1}" = "-c" ]; then 26 cvsmode=true 27 shift 28fi 29 30[ ! -z "${*}" ] && em="${*}" 31[ "$em" = all ] && em="${all}" 32for x in ${em}; do 33 for y in ${all}; do 34 [ $x = $y ] && continue 2 35 done 36 echo invalid specifier $x 37 exit 1 38done 39 40iswanted () 41{ 42 43 for x in ${em}; do 44 if [ "$x" = "$1" ]; then 45 return 0 46 fi 47 done 48 return 1 49} 50 51lsrc () 52{ 53 54 what=$1 55 pfx=$2 56 shift 2 57 58 iswanted ${what} && for arg in $* ; do echo src${pfx}${arg} ; done 59} 60 61ARCHS="amd64 i386 x86 arm evbarm sparc sparc64 powerpc evbppc mips evbmips aarch64 evbarm64" 62ARCHS_EXTRA="arm/arm32 Makefile" 63 64# sources necessary for building rump kernel components. This list 65# depends on TOOLS_BUILDRUMP=yes. 66lsrc sys / build.sh Makefile Makefile.inc 67lsrc sys / tools common include share/mk 68lsrc sys /etc/ Makefile.params master.passwd group 69lsrc sys /lib/lib c util 70lsrc sys /external/bsd/ flex mdocml byacc 71lsrc sys /external/cddl/ osnet 72lsrc sys /external/historical/ nawk 73lsrc sys /bin/ cat 74lsrc sys /usr.bin/ make xinstall config mktemp sed tsort 75lsrc sys /usr.bin/ lorder join cksum m4 mkdep Makefile.inc 76lsrc sys /usr.bin/ rpcgen rump_wmd 77lsrc sys /usr.bin/ stat 78lsrc sys /usr.sbin/ mtree 79 80# sources hosted in the NetBSD tree that are required/useful 81# when targeting POSIX-y platforms 82lsrc posix /lib/lib rump rumpdev rumpnet rumpvfs 83lsrc posix /lib/lib rumpuser rumpclient rumphijack 84lsrc posix /usr.bin/ rump_server rump_allserver shmif_dumpbus 85 86# assorted userspace sources, mostly for configuration & diagnostics 87lsrc usr /lib/lib crypt ipsec m npf pci prop 88lsrc usr /lib/lib pthread rmt y z 89lsrc usr /libexec/ ld.elf_so 90lsrc usr /bin/ chmod cp dd df ed ln ls mkdir mv pax 91lsrc usr /bin/ rm rmdir 92lsrc usr /sbin/ cgdconfig chown 93lsrc usr /sbin/ disklabel dump 94lsrc usr /sbin/ fsck fsck_ext2fs fsck_ffs fsck_msdos 95lsrc usr /sbin/ ifconfig mknod 96lsrc usr /sbin/ modstat mount 97lsrc usr /sbin/ mount_ext2fs mount_ffs mount_msdos mount_tmpfs 98lsrc usr /sbin/ newfs newfs_ext2fs newfs_msdos 99lsrc usr /sbin/ ping ping6 raidctl reboot 100lsrc usr /sbin/ rndctl route setkey sysctl umount 101lsrc usr /usr.bin/ kdump ktrace 102lsrc usr /usr.sbin/ arp dumpfs ndp npf pcictl vnconfig 103lsrc usr /usr.sbin/ wlanctl 104lsrc usr /external/bsd/ libpcap tcpdump wpa 105lsrc usr /crypto/ Makefile.openssl 106lsrc usr /crypto/dist/ ipsec-tools 107lsrc usr /crypto/external/bsd/ openssl 108 109 110# If -c is given, use CVS syntax to exclude large subdirectories 111# of sys. Otherwise just do it wholesale. 112if ${cvsmode}; then 113 iswanted sys && echo \!src/sys/arch src/sys 114 115 # pick a few useful archs, namely those mentioned in buildrump.sh 116 for arch in ${ARCHS}; do 117 lsrc sys /sys/arch/${arch}/ include ${arch} Makefile 118 done 119 for extra in ${ARCHS_EXTRA}; do 120 lsrc sys /sys/arch/ ${extra} 121 done 122else 123 lsrc sys / sys 124fi 125