1 1.1 lukem #!/bin/sh 2 1.1 lukem # 3 1.1 lukem # $NetBSD: sysdb,v 1.1 2000/03/10 11:53:24 lukem Exp $ 4 1.1 lukem # 5 1.1 lukem 6 1.1 lukem # PROVIDE: databases 7 1.1 lukem # REQUIRE: systemfs 8 1.1 lukem 9 1.1 lukem . /etc/rc.subr 10 1.1 lukem . /etc/rc.conf 11 1.1 lukem 12 1.1 lukem name="sysdb" 13 1.1 lukem start_cmd="sysdb_start" 14 1.1 lukem stop_cmd=":" 15 1.1 lukem 16 1.1 lukem sysdb_start() 17 1.1 lukem { 18 1.1 lukem # Build ps databases. If this kernel supports 19 1.1 lukem # machdep.booted_kernel, use that to build the KVM db so dmesg 20 1.1 lukem # will run work when we boot /netbsd.new, etc. 21 1.1 lukem # 22 1.1 lukem echo "Building databases..." 23 1.1 lukem sysctl machdep 2>/dev/null | grep -q booted_kernel 24 1.1 lukem if [ $? -eq 0 ] ; then 25 1.1 lukem kvm_mkdb `sysctl -n machdep.booted_kernel` || kvm_mkdb /netbsd 26 1.1 lukem else 27 1.1 lukem kvm_mkdb /netbsd 28 1.1 lukem fi 29 1.1 lukem dev_mkdb 30 1.1 lukem } 31 1.1 lukem 32 1.1 lukem run_rc_command "$1" 33