diff options
Diffstat (limited to 'move/tools')
| -rwxr-xr-x | move/tools/busy-files | 25 | ||||
| -rw-r--r-- | move/tools/busy-files-accesses | 34 | ||||
| -rw-r--r-- | move/tools/check-fc-cache.pl | 27 | ||||
| -rwxr-xr-x | move/tools/fix-fc-cache.pl | 21 | ||||
| -rw-r--r-- | move/tools/kernel-nfsd.patch | 61 | ||||
| -rwxr-xr-x | move/tools/nfs-accesses | 67 | ||||
| -rwxr-xr-x | move/tools/scan-etc.pl | 41 | 
7 files changed, 0 insertions, 276 deletions
| diff --git a/move/tools/busy-files b/move/tools/busy-files deleted file mode 100755 index 7426e785a..000000000 --- a/move/tools/busy-files +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/perl - -use MDK::Common; - -my @pids = grep { $_ ne $$ && /^(\d+)$/ } all('/proc'); - -my @l = map { -    grep { -	$_ && !m!^(/proc/|/dev/|pipe:|socket:)!; -    } map { readlink($_) } "/proc/$_/exe", glob_("/proc/$_/fd/*"); -} @pids; - -push @l, grep { $_ } map { (split)[5] } map { cat_("/proc/$_/maps") } @pids; - -if ($ARGV[0] eq '--totem') { -    @l = grep { m!/(image(_boot)?|cdrom)/! } @l; -    $ARGV[0] = '--server'; -} -foreach (uniq @l) { -    if ($ARGV[0] eq '--server') { -	s!/image(_always|_boot|_totem)?/!/tmp/live_tree/!; -	s!/cdrom/live_tree!/tmp/live_tree!; -    } -    print "$_\n"; -} diff --git a/move/tools/busy-files-accesses b/move/tools/busy-files-accesses deleted file mode 100644 index 241b68405..000000000 --- a/move/tools/busy-files-accesses +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/perl - -use MDK::Common; -use Getopt::Long; - -GetOptions('no-link' => \ (my $no_link),  -	   'no-dir' => \ (my $no_dir), -	   'full-dirs=s', \ (my $full_dirs), -	   'already-have=s', \ (my $already_have), -); - -if ($full_dirs) { -    my @l = map { chomp_(MDK::Common::File::cat_or_die($_)) } split(' ', $full_dirs); -    $full_dirs = '/tmp/live_tree(' . join('|', map { quotemeta } @l) . ')/'; -} -if ($already_have) { -    my @l = map { chomp_(MDK::Common::File::cat_or_die($_)) } split(' ', $already_have); -    $already_have = '(' . join('|', map { quotemeta } @l) . ')'; -} - -my ($file_list) = @ARGV; -foreach my $file (cat_($file_list)) { -    chomp $file; - -    $file =~ m!/tmp/live_tree! or next; -    $already_have && $file =~ /^$already_have$/ and next; - -    if (-l $file ? !$no_link : -d $file ? !$no_dir : 1) { -	my $s = $full_dirs && $file =~ /^$full_dirs/ ? "/tmp/live_tree$1" : $file; -	push @l, $s; -    } -} - -print "$_\n" foreach sort(uniq(@l)); diff --git a/move/tools/check-fc-cache.pl b/move/tools/check-fc-cache.pl deleted file mode 100644 index 42902835f..000000000 --- a/move/tools/check-fc-cache.pl +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/perl - -# check if files are more recent (fc-cache will slow down starting of drakx) - -use MDK::Common; - -sub stat_ { -    my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat $_[0]; -    max($mtime, $ctime); -} - -my $prefix = $ARGV[0] || '/tmp/live_tree'; - -my @conf = cat_("$prefix/etc/fonts/fonts.conf"); - -foreach my $line (@conf) { -    while ($line =~ m|<dir>([^<]+)</dir|g) { -        my $dir = $1; -        $dir =~ m|^/| or next; -        print "dir $prefix$dir\n"; -        foreach my $d (chomp_(`find $prefix$dir -type d 2>/dev/null`)) { -            my $ref = stat_("$d/fonts.cache-1"); -            stat_($_) > $ref and print "\t$_\n" foreach glob("$d/*"); -        } -    } -} - diff --git a/move/tools/fix-fc-cache.pl b/move/tools/fix-fc-cache.pl deleted file mode 100755 index 720c94141..000000000 --- a/move/tools/fix-fc-cache.pl +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/perl - -# touch fontconfig cache files so that fc-cache will not slow down starting of drakx - -use MDK::Common; - -my ($prefix) = @ARGV or die "usage: $0 <prefix>\n"; - -my @conf = cat_("$prefix/etc/fonts/fonts.conf"); - -print "touching fontconfig cache files...\n"; -foreach my $line (@conf) { -    while ($line =~ m|<dir>([^<]+)</dir|g) { -        my $dir = $1; -        $dir =~ m|^/| or next; -        foreach my $d (chomp_(`find $prefix$dir -type d 2>/dev/null`)) { -            touch "$d/fonts.cache-1"; -        } -    } -} - diff --git a/move/tools/kernel-nfsd.patch b/move/tools/kernel-nfsd.patch deleted file mode 100644 index a169edb14..000000000 --- a/move/tools/kernel-nfsd.patch +++ /dev/null @@ -1,61 +0,0 @@ ---- linux-2.6.3/fs/nfsd/vfs.c.pix	2004-02-18 04:57:29.000000000 +0100 -+++ linux-2.6.3/fs/nfsd/vfs.c	2004-04-05 15:56:35.423508058 +0200 -@@ -444,6 +444,41 @@ -  -  -  -+static unsigned int i2a(char* dest,unsigned int x) { -+  register unsigned int tmp=x; -+  register unsigned int len=0; -+  if (x>=100) { *dest++=tmp/100+'0'; tmp=tmp%100; ++len; } -+  if (x>=10) { *dest++=tmp/10+'0'; tmp=tmp%10; ++len; } -+  *dest++=tmp+'0'; -+  return len+1; -+} -+ -+static char *inet_ntoa_r(struct in_addr in,char* buf) { -+  unsigned int len; -+  unsigned char *ip=(unsigned char*)∈ -+  len=i2a(buf,ip[0]); buf[len]='.'; ++len; -+  len+=i2a(buf+ len,ip[1]); buf[len]='.'; ++len; -+  len+=i2a(buf+ len,ip[2]); buf[len]='.'; ++len; -+  len+=i2a(buf+ len,ip[3]); buf[len]=0; -+  return buf; -+} -+ -+static char *inet_ntoa(struct in_addr in) { -+  static char buf[20]; -+  return inet_ntoa_r(in,buf); -+} -+ -+static void printk_debug_file_access(struct svc_rqst *rqstp, struct dentry *dentry) { -+  printk("nfsd (%s): ", inet_ntoa(rqstp->rq_addr.sin_addr)); -+  while (1) { -+    if (dentry == dentry->d_parent) break; -+    printk("%s/", dentry->d_name.name); -+    dentry = dentry->d_parent; -+  } -+  printk("\n"); -+} -+ -+ - /* -  * Open an existing file or directory. -  * The access argument indicates the type of open (read/write/lock) -@@ -502,6 +537,8 @@ - 	} else if (access & MAY_WRITE) - 		put_write_access(inode); -  -+	if (err == 0) printk_debug_file_access(rqstp, dentry); -+ - out_nfserr: - 	if (err) - 		err = nfserrno(err); -@@ -1156,6 +1193,7 @@ - 		goto out_nfserr; - 	*lenp = err; - 	err = 0; -+	printk_debug_file_access(rqstp, dentry); - out: - 	return err; -  diff --git a/move/tools/nfs-accesses b/move/tools/nfs-accesses deleted file mode 100755 index f27de0d37..000000000 --- a/move/tools/nfs-accesses +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/perl - -use MDK::Common; -use Getopt::Long; - -my $first_file; -my $log_file = '/var/log/kernel/warnings'; - -GetOptions('no-link' => \ (my $no_link),  -	   'no-dir' => \ (my $no_dir), -	   'full-dirs=s', \ (my $full_dirs), -	   'ip=s' => \ (my $wanted_ip), -	   'log-file=s' => \$log_file, -	   'first-file=s' => \ (my $first_file), -	   'from-time=s', => \ (my $from_time), -	   'already-have=s', \ (my $already_have), -	  ); - -my @skipped_dirs = ( -		    '/usr/share/fonts',  -		    '/lib/modules/2.4.22-21mdk', -		    '/usr/X11R6/lib/modules/extensions', -		    '/usr/X11R6/lib/X11/fonts', -		    '/usr/lib/kbd/keymaps', -		    '/usr/share/locale', -		    '/etc/skel', -		    ); - -my $skipped_dirs = '/tmp/live_tree(' . join('|', map { quotemeta } @skipped_dirs) . ')/'; -if ($full_dirs) { -    my @l = chomp_(map { MDK::Common::File::cat_or_die($_) } split(' ', $full_dirs)); -    $full_dirs = '/tmp/live_tree(' . join('|', map { quotemeta } @l) . ')/'; -} -if ($already_have) { -    my @l = map { chomp_(MDK::Common::File::cat_or_die($_)) } split(' ', $already_have); -    $already_have = '(' . join('|', map { quotemeta } @l) . ')'; -} - -open(my $F, "tac $log_file |"); - -my @l; -while (<$F>) { -    my ($time, $ip, $rfile) = /(\d+:\d+:\d+).*kernel: nfsd \((.*?)\): (.*)/ or next;  - -    if ($wanted_ip) { -	$wanted_ip eq $ip or next; -    } else { -	warn "choosing $ip\n"; -	$wanted_ip = $ip; -    } -    my $file = join('/', '', reverse split('/', $rfile)); - -    last if $file =~ m!/tmp/live_tree/move/(devices|symlinks)!; -    last if $from_time && $time le $from_time; - -    $already_have && $file =~ /^$already_have$/ and next; - -    if ($file !~ /^$skipped_dirs/) { -	if (-l $file ? !$no_link : -d $file ? !$no_dir : 1) { -	    my $s = $full_dirs && $file =~ /^$full_dirs/ ? "/tmp/live_tree$1" : $file; -	    unshift @l, $s; -	} -    } -    last if $first_file && ($file eq "/tmp/live_tree$first_file" || $rfile eq $first_file); -} - -print "$_\n" foreach sort(uniq(@l)); diff --git a/move/tools/scan-etc.pl b/move/tools/scan-etc.pl deleted file mode 100755 index 66415d4de..000000000 --- a/move/tools/scan-etc.pl +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/perl - -# To be used replacing move::init handling of etc files with: -# -#    system("cp -a /image/etc /"); -#    symlinkf "/proc/mounts", "/etc/mtab"; -#    system("find /etc -type f > /tmp/filelist"); -#    touch '/dummy'; -#    m|^/var| && !-d $_ and mkdir_p $_ foreach chomp_(cat_('/image/move/directories-to-create')); -#    sleep 2; -#    goto meuh; - -use MDK::Common; - -sub stat_ { -    my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat $_[0]; -    [ $atime, max($mtime, $ctime) ]; -} - -our $reference = (stat_('/dummy'))->[0]; - -our @old_filelist = chomp_(cat_("/tmp/filelist")); -foreach (chomp_(`find /etc -type f`)) { -    if (!member($_, @old_filelist)) { -        push @new, $_; -    } else { -        $times = stat_($_); -        $times->[0] > $reference and push @read, $_; -        $times->[1] > $reference and push @wrote, $_; -    } -} - -print "read:\n"; -print "\t$_\n" foreach sort @read; - -print "wrote:\n"; -print "\t$_\n" foreach sort @wrote; - -print "new:\n"; -print "\t$_\n" foreach sort @new; - | 
