Dash:
[t2.git] / package / develop / t2-debug / test_rootfsbin.sh
blob7969a60e8d0af0147f2f56a32aaf58f3ab5ba798
1 #!/bin/sh
3 # --- T2-COPYRIGHT-NOTE-BEGIN ---
4 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
5 #
6 # T2 SDE: package/.../t2-debug/test_rootfsbin.sh
7 # Copyright (C) 2004 - 2005 The T2 SDE Project
8 # Copyright (C) 1998 - 2003 ROCK Linux Project
9 #
10 # More information can be found in the files COPYING and README.
12 # This program is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; version 2 of the License. A copy of the
15 # GNU General Public License can be found in the file COPYING.
16 # --- T2-COPYRIGHT-NOTE-END ---
18 # List binaries which should in in /bin and /sbin and are not there.
20 # Output format:
21 # Bin-Name <Tab> Should-Be <Tab> { "Not Found" | Current-Location }
23 bin_fhs='cat chgrp chmod chown cp date dd df dmesg echo ed false
24 kill ln login ls mkdir mknod more mount mv ps pwd rm rmdir
25 sed setserial sh stty su sync true umount uname
26 tar gzip gunzip zcat cpio domainname hostname netstat ping
27 sleep bzip2 bunzip2 bzcat'
29 bin_rock='bash sleep sync sort xargs grep cut skill snice find'
31 sbin_fhs='clock getty init update mkswap swapon swapoff telinit
32 fastboot fasthalt halt reboot shutdown ifconfig route
33 fdisk fsck fsck.ext2 fsck.ext3 mkfs mkfs.ext2 badblocks dumpe2fs
34 e2fsck mke2fs mklost+found tune2fs lilo ctrlaltdel kbdrate'
36 sbin_rock='devfsd'
38 for mode in bin sbin ; do
39 for bin in `eval "echo \\$${mode}_fhs \\$${mode}_rock"` ; do
40 found_dir=""
41 for dir in {,/usr,/usr/local}/{,s}bin /usr/{local/,}games ; do
42 [ -f $dir/$bin ] && found_dir=$dir
43 done
44 if [ -z "$found_dir" ] ; then
45 echo -e "$bin\t/$mode\tNot Found"
46 elif [ "$found_dir" != "/$mode" ] ; then
47 echo -e "$bin\t/$mode\t$found_dir"
49 done
50 done
52 exit 0