diff options
Diffstat (limited to 'beagle/debian-rfs/usr/share/insserv')
9 files changed, 832 insertions, 0 deletions
diff --git a/beagle/debian-rfs/usr/share/insserv/check-archive-initd-scripts b/beagle/debian-rfs/usr/share/insserv/check-archive-initd-scripts new file mode 100755 index 0000000..e2948da --- /dev/null +++ b/beagle/debian-rfs/usr/share/insserv/check-archive-initd-scripts @@ -0,0 +1,275 @@ +#!/usr/bin/perl +# +# Check the consistency of all init.d scripts in the archive. Run +# this on bellini.debian.org. + +use warnings; +use strict; +use File::Basename; + +my $warn = 1; + +my $basedir = "/org/lintian.debian.org/laboratory/binary"; + +my @scripts = @ARGV; +@scripts = <$basedir/*/init.d/*> unless (@scripts); + +my %scriptinfo; +my %provides; + +my @virts = qw($local_fs $remote_fs $syslog $time $named + $portmap $network $all + $mail-transport-agent $x-font-server + $null $x-display-manager + ); +my @harddepheaders = qw(required-start required-stop); +my @softdepheaders = qw(should-start + should-stop x-start-before x-stop-after); +my $lsbheaders = "Provides|Required-Start|Required-Stop|Default-Start|Default-Stop"; +my $optheaders = "x-start-before|x-stop-after|should-start|should-stop"; + +for my $virt (@virts) { + $provides{$virt} = ['insserv/etc/insserv.conf']; +} + +# Ignore obsolete scripts, as these are unlikely to cause problems. +for my $old (qw(glibc evms raid2 ldm sdm)) { + $provides{$old} = ['obsolete']; +} + +# First pass to load the database +for my $initdscript (@scripts) { + next if $initdscript =~ m%/rc|/rcS|/README%; + my %lsbinfo = parse_lsb_header($initdscript); + $scriptinfo{$initdscript} = \%lsbinfo; + next unless ($lsbinfo{'found'}); + + my %checked; + for my $provide (split(/[ ,\t]+/, $lsbinfo{provides})) { + if (exists $provides{$provide}) { + push(@{$provides{$provide}}, $initdscript) + } else { + $provides{$provide} = [$initdscript]; + } + $checked{$provide} = 1; + } +} + +for my $provide (sort keys %provides) { + if (1 < scalar @{$provides{$provide}}) { + my %script; + map { $script{basename($_)} = 1; } @{$provides{$provide}}; + if (1 < scalar keys %script) { + error(sprintf("scripts %s provide duplicate '%s'", + join(",", short_name(@{$provides{$provide}})), + $provide)); + } + } +} + +# Second pass, to see which dependencies are missing +for my $initdscript (@scripts) { + next unless ($scriptinfo{$initdscript}->{'found'}); + my $short = short_name($initdscript); + my %checked; + my @hardmissing = (); + for my $header (@harddepheaders) { + my $list = $scriptinfo{$initdscript}->{$header}; + next unless defined $list; + for my $facility (split(/[ ,\t]+/, $list)) { + next if exists $checked{$facility}; + $checked{$facility} = 1; + push(@hardmissing, $facility) + unless exists $provides{$facility}; + } + } + error("script $short depend on non-existing provides: " + . join(" ", @hardmissing)) if (@hardmissing); + my @softmissing = (); + for my $header (@softdepheaders) { + my $list = $scriptinfo{$initdscript}->{$header}; + next unless defined $list; + for my $facility (split(/[ ,\t]+/, $list)) { + next if exists $checked{$facility}; + $checked{$facility} = 1; + push(@softmissing, $facility) + unless exists $provides{$facility}; + } + } + warning("script $short relate to non-existing provides: " + . join(" ", @softmissing)) if (@softmissing); + + if (exists $checked{'$syslog'} + && $scriptinfo{$initdscript}->{'default-start'} =~ m/s/i) { + error("script $short depend on \$syslog and start from rcS.d/"); + } + if (!exists $checked{'$remote_fs'} + && !exists $checked{'$syslog'} + && $scriptinfo{$initdscript}->{'need_remote_fs'} + && $scriptinfo{$initdscript}->{'default-start'} =~ m/s/i) { + warning("script $short possibly missing dependency on \$remote_fs"); + } elsif (!exists $checked{'$local_fs'} + && !exists $checked{'$remote_fs'} + && !exists $checked{'$syslog'} + && $scriptinfo{$initdscript}->{'need_local_fs'} + && $scriptinfo{$initdscript}->{'default-start'} =~ m/s/i) { + warning("script $short possibly missing dependency on \$local_fs"); + } + + if (!exists $checked{'$local_fs'} + && $scriptinfo{$initdscript}->{'need_syslog'}) { + warning("script $short possibly missing dependency on \$syslog"); + } + + my %provided; + for my $provide (split(/[ ,\t]+/, + $scriptinfo{$initdscript}->{provides})) { + $provided{$provide} = 1; + if ($provide =~ m/\$/) { + error("script $short provide virtual facility $provide"); + } + } + + my $basename = basename($initdscript, ".sh"); + info("script $short does not provide its own name") + unless exists $provided{$basename}; + + # Detect common problems with runlevel settings. + my @startrl = sort split(/\s+/, lc($scriptinfo{$initdscript}->{'default-start'})); + my @stoprl = sort split(/\s+/, lc($scriptinfo{$initdscript}->{'default-stop'})); + + unless ( @startrl || @stoprl) { + error("script $short do not start or stop in any runlevels"); + } + # Scripts starting in rcS.d/ normally do not stop or only stop + # during hald and shutdown. + elsif ((array_equal(['s'], \@startrl) && array_equal([], \@stoprl)) + || ( array_equal(['s'], \@startrl) + && array_equal(['0','6'], \@stoprl))) { + # OK + } else { + # Most scripts either start in rcS.d, or in runlevels 2-5 + if (!array_equal(['2', '3', '4', '5'], \@startrl) && + !array_equal(['s'], \@startrl) && + (!array_equal([], \@startrl) && @stoprl)) { + # Some obvious errors (runlevels 2-5 are equivalent in Debian) + if (array_equal(['3', '5'], \@startrl) + || array_equal(['3', '4', '5'], \@startrl)) { + error("script $short have inconsistent start runlevels: ", + join(" ", @startrl)); + } else { + warning("script $short does not start in the usual runlevels: ", + join(" ", @startrl)); + } + } + + # And most scripts stop in runlevel (1) runlevels (0, 1, 6), + # only starts or only stops in (0) or (6). + if (!array_equal(['0', '1', '6'], \@stoprl) && + !array_equal(['1'], \@stoprl) && + !array_equal(['0', '6'], \@stoprl) && + !(array_equal(['0'], \@stoprl) && !@startrl) && + !(array_equal(['6'], \@stoprl) && !@startrl) && + !(array_equal([], \@stoprl) && @startrl)) { + warning("script $short does not stop in the usual runlevels: ", + join(" ", @stoprl)); + } + } +} + +exit 0; + +sub parse_lsb_header { + my $initdscript = shift; + my $short = short_name($initdscript); + my %lsbinfo; + unless (open(INIT, "<", $initdscript)) { + error("script $short is unreadable"); + return (); + } + my $inheader = 0; + while (<INIT>) { +# print; + chomp; + if (m/^\#\#\# BEGIN INIT INFO\s*$/) { + $lsbinfo{'found'} = 1; + $inheader = 1; + } + $inheader = 0 if (m/\#\#\# END INIT INFO$/); + if ($inheader + && m/^\# ($lsbheaders|$optheaders):\s*(\S?.*)$/i) { +# print "$1\n"; + $lsbinfo{lc($1)} = $2; + } + s/\#.*$//; # Remove comments + $lsbinfo{'need_remote_fs'} = 1 if m%/usr/s?bin/%; + $lsbinfo{'need_local_fs'} = 1 if m%/var/%; + + # Detect the use of tools resting in /usr/ + $lsbinfo{'need_remote_fs'} = 1 if m%awk%; + $lsbinfo{'need_remote_fs'} = 1 if m%which%; + } + close(INIT); + + # When running on bellini.debian.org, check if $syslog is needed + my $objdumpinfo = dirname($initdscript) . "/../objdump-info"; + if ( -f $objdumpinfo) { + print "Checking for syslog symbol\n"; + if (open(OBJDUMP, "<", $objdumpinfo)) { + while (<OBJDUMP>) { + $lsbinfo{'need_syslog'} = 1 if /GLIBC.* syslog/; + } + close OBJDUMP; + } + } + + # Check that all the required headers are present + if (!$lsbinfo{'found'}) { + error("script $short is missing LSB header"); + } else { + for my $key (split(/\|/, lc($lsbheaders))) { + if (!exists $lsbinfo{$key}) { + error("script $short missing LSB keyword '$key'"); + } + } + } + return %lsbinfo +} + +sub short_name { + my @scripts; + for my $script ( @_ ) { + my $copy = $script; + $copy =~ s%$basedir/%%g; + push @scripts, $copy; + } + if (wantarray) { + return @scripts; + } else { + return $scripts[0]; + } +} + +sub array_equal { + my ($a1, $a2) = @_; + return 0 if (scalar @{$a1} != scalar @{$a2}); + + my $i = 0; + while ($i < scalar @{$a1}) { + return 0 if $a1->[$i] ne $a2->[$i]; + $i++; + } + return 1; +} + +sub info { + print "info: @_\n"; +} + +sub warning { + print "warning: @_\n" if $warn; +} + +sub error { + print "error: @_\n"; +} diff --git a/beagle/debian-rfs/usr/share/insserv/check-initd-order b/beagle/debian-rfs/usr/share/insserv/check-initd-order new file mode 100755 index 0000000..e7d0ef6 --- /dev/null +++ b/beagle/debian-rfs/usr/share/insserv/check-initd-order @@ -0,0 +1,425 @@ +#!/usr/bin/perl +# +# Author: Petter Reinholdtsen +# Date: 2005-08-21 +# +# Read LSM init.d headers in SysV init.d scripts, and verify correct +# start order for all runlevels. It can also provide a graph. +# +# To generate a graph, run it like this +# +# check-initd-order -g > initorder.dotty && dotty initorder.dotty + +use strict; +use warnings; + +my $rcbase = "/etc"; + +my $overridepath = "/usr/share/insserv/overrides"; +my $hostoverridepath = "/etc/insserv/overrides"; + +my $debug = 0; +my $errors = 0; + +my %rcmap = + ( + 'B' => 'rc.boot', + 'S' => 'rcS.d', + '1' => 'rc1.d', + '2' => 'rc2.d', + '3' => 'rc3.d', + '4' => 'rc4.d', + '5' => 'rc5.d', + '6' => 'rc6.d', + ); + +my %sysmap; + +my %provideslist; +my %scriptorder; +my %opts; + +# Used to draw graphs +my %gotrevdeps; +my %allprovides; + +while($#ARGV >= 0 && ($_ = $ARGV[0]) =~ /^-/) { + shift @ARGV; + if (/^-([cdgko])$/) { $opts{$1}++; next } + if (/^-b$/) { $rcbase = shift; next } + if (/^-h|--help$/) { &usage; } + &usage("unknown option"); +} + +load_sysmap("$rcbase/insserv.conf"); + +$debug = $opts{'d'}; +my $useoverrides = $opts{'o'} ? 0 : 1; + +if ($opts{'g'}) { + graph_generate(); + exit 0; +} + +check_bootorder(); +exit $errors > 0 ? 1 : 0; + +sub usage { + print STDERR "check-initd-order: error: @_\n" if ($#_ >= 0); + print STDERR <<EOF; +usage: check-initd-order [-cdgko] [-b basedir] + -b basedir (default /etc) + -d enable debug output + -o do not load override files + -k use shutdown (reboot) sequence instead of boot sequence + -g generate graph + -c use combined boot and shutdown sequence (only for graphs) +EOF + exit 1; +} + +# Simple basename implementatin to avoid dependin on File::Basename +# from perl-modules +sub basename { + my $path = shift; + $path =~ s%^.*/([^/]+)$%$1%; + return $path; +} + +sub error { + print STDERR "error: ", @_; + $errors++; +} + +# Map packages to system metapackages. These dependencies should +# probably be more complex +sub load_sysmap { + my $filename = shift; + unless (open(CONF, "<", "$filename")) { + print STDERR "error: unable to load $filename"; + return; + } + while (<CONF>) { + chomp; + s/\#.*$//; + next if m/^\s*$/; + if (m/^(\$\S+)\s+(\S.*\S*)\S*$/) { + my $virt = $1; + for my $dep (split(/\s+/, $2)) { + $dep =~ s/^\+//g; + $sysmap{$dep} = $virt; + } + } + } + close(CONF); +} + +sub graph_addnode { + my ($isstopseq, $lsbinforef) = @_; + my %lsbinfo = %{$lsbinforef}; + + unless ($lsbinfo{'provides'}) { + error "File ". $lsbinfo{'file'} . " is missing the provides header\n"; + $lsbinfo{'provides'} = $lsbinfo{'file'}; + $lsbinfo{'provides'} =~ s/^[SK]\d{2}//; + } + + my $key = $opts{'k'} ? 'stop' : 'start'; + my $revkey = $opts{'k'} ? 'stop-after' : 'start-before'; + my @provides = split(/\s+/, $lsbinfo{'provides'}); + for my $name (@provides) { + if (exists $sysmap{$name}) { + graph_addnode($isstopseq, + {'provides' => $sysmap{$name}, + "required-$key" => $name}); + } + } + + if (1 < @provides) { + my @providescopy = @provides; + my $lastprovide = shift @providescopy; + for my $provide (@providescopy) { + graph_addnode($isstopseq, + {'provides' => $lastprovide, + "required-$key" => $provide}); + graph_addnode($isstopseq, + {'provides' => $provide, + "required-$key" => $lastprovide}); + } + } + + for my $provide (@provides) { + my $provideesc = $provide; $provideesc =~ s/"/\\"/g; + my %deps = + ( + "required-$key" => 'blue', + "should-$key" => 'springgreen', + "$revkey" => 'yellow' + ); + + for $key (keys %deps) { + if (exists $lsbinfo{$key} && $lsbinfo{$key}) { + my @depends = split(/\s+/, $lsbinfo{$key}); + + my $dependonall = 0; + for my $pkg (@depends) { + $dependonall = 1 if ($pkg eq '$all'); + } + + for my $pkg (@depends) { + my $pkgesc = $pkg; $pkgesc =~ s/"/\\"/g; + my $color = $deps{$key}; + if ($revkey eq $key) { + print "\"$provideesc\" -> \"$pkgesc\"[color=$color] ;\n"; + $gotrevdeps{$pkg} = 1 unless $dependonall; + } else { + print "\"$pkgesc\" -> \"$provideesc\"[color=$color] ;\n"; + $gotrevdeps{$provide} = 1 unless $dependonall; + } + } + } + } + + print "\"$provideesc\" [shape=box];\n" unless $allprovides{$provide}; + $allprovides{$provide} = 1; + } +} + +sub graph_generate_mode { + my ($isstopseq) = @_; + my @dirs = $isstopseq ? $rcmap{6} : ($rcmap{S}, $rcmap{2}); + for my $rcdir (@dirs) { + chdir "$rcbase/$rcdir/."; + my @scripts = $isstopseq ? <K*> : <S*>; + for my $script (@scripts) { + my $lsbinforef = load_lsb_tags("$rcbase/$rcdir/$script", + $useoverrides); + + unless (defined $lsbinforef) { + error "LSB header missing in $rcbase/$rcdir/$script\n"; + $script =~ s/^[SK]\d{2}//; + $lsbinforef = {'provides' => $script, + 'required-start' => '$remote_fs $syslog', + 'required-stop' => '$remote_fs $syslog'}; + } + graph_addnode($isstopseq, $lsbinforef); + } + } + # Mark all packages without any reverse dependencies as depending + # on $all + for my $provide (keys %allprovides) { + next unless (exists $gotrevdeps{$provide}); + my $lsbinforef = {'provides' => '$all', + 'required-start' => "$provide", + 'required-stop' => "$provide"}; + graph_addnode($isstopseq, $lsbinforef); + } +} + +sub graph_generate { + print "# Generating graph\n"; + print <<EOF; +digraph packages { +rankdir=LR; +concentrate=true; +EOF + if ($opts{'c'}) { + graph_generate_mode(); + graph_generate_mode(1); + } else { + graph_generate_mode($opts{'k'}); + } + print <<EOF; +} +EOF +} + +sub check_deps { + my ($lsbinforef, $tag, $order, $bootorder, $headername, $required) = @_; + my %lsbinfo = %{$lsbinforef}; + my $name = $lsbinfo{'file'}; + if ($lsbinfo{$headername}) { + my @depends = split(/\s+/, $lsbinfo{$headername}); + for my $dep (@depends) { + if (! $required && exists $provideslist{$dep}) { + unless (exists $scriptorder{$tag}{$dep} + and ("S" eq $tag + ? $scriptorder{$tag}{$dep} < $bootorder + : $scriptorder{$tag}{$dep} > $bootorder)) { + my $deporder; + if (exists $scriptorder{$tag}{$dep}) { + $deporder = $scriptorder{$tag}{$dep} + } else { + $deporder = exists $provideslist{$dep} ? $provideslist{$dep} : "?"; + } + error(sprintf("Incorrect order %s@%s %s %s%s\n", + $dep, $deporder, 'S' eq $tag ? '>' : '<', + $name, $order)); + } + } + } + } +} + +sub check_bootorder { + my $bootorder = 0; + my @dirs = $opts{'k'} ? $rcmap{6} : ($rcmap{S}, $rcmap{2}); + my @scripts; + for my $rcdir (@dirs) { + push(@scripts, $opts{'k'} ? <$rcbase/$rcdir/K*> : <$rcbase/$rcdir/S*>); + } + + if ($opts{'k'}) { + $scriptorder{'K'}{'$all'} = 1; + } else { + # Calculate script order for the script before the scripts + # with the last boot sequence number. + my $tmpbootorder = 0; + my $allorder = 0; + my $maxorder = 0; + my $maxbootorder = 0; + for my $scriptpath (@scripts) { + my $script = $scriptpath; + $script =~ s%^.*/([^/]+)$%$1%; + $tmpbootorder++; + my ($tag, $order, $name) = $script =~ m/^(.)(\d{2})(.+)$/; + if ($order > $maxorder) { + $allorder = $maxbootorder; + $maxbootorder = $tmpbootorder; + $maxorder = $order; + } + + my $lsbinforef = load_lsb_tags($scriptpath, + $useoverrides); + + if (exists $lsbinforef->{'provides'} + && $lsbinforef->{'provides'}) { + for my $provide (split(/\s+/, $lsbinforef->{'provides'})) { + $provideslist{$provide} = $order; + } + } else { + $provideslist{$script} = $order; + } + } + $scriptorder{'S'}{'$all'} = $allorder; + } + for my $scriptpath (@scripts) { + my $script = $scriptpath; + $script =~ s%^.*/([^/]+)$%$1%; + $bootorder++; + my ($tag, $order, $name) = $script =~ m/^(.)(\d{2})(.+)$/; + + $scriptorder{$tag}{$name} = $bootorder; + $scriptorder{$tag}{$sysmap{$name}} = $bootorder + if (exists $sysmap{$name}); + +# print "$script\n"; +# print "T: $tag O: $order N: $name\n"; + my $lsbinforef = load_lsb_tags($scriptpath, + $useoverrides); + + unless (defined $lsbinforef) { + error "LSB header missing in $scriptpath\n"; + next; + } + my %lsbinfo = %{$lsbinforef}; + + if (exists $lsbinfo{'provides'} && $lsbinfo{'provides'}) { + for my $provide (split(/\s+/, $lsbinfo{'provides'})) { + $scriptorder{$tag}{$provide} = $bootorder; + $scriptorder{$tag}{$sysmap{$provide}} = $bootorder + if (exists $sysmap{$provide}); + } + } else { + error "no LSB header provides value in script $scriptpath\n"; + } + + if ('S' eq $tag) { + check_deps($lsbinforef, $tag, $order, $bootorder, 'required-start', 1); + check_deps($lsbinforef, $tag, $order, $bootorder, 'should-start', 0); +# check_deps($lsbinforef, 'K', $order, $bootorder, 'start-before', 0); + } + if ('K' eq $tag) { + check_deps($lsbinforef, $tag, $order, $bootorder, 'required-stop', 1); + check_deps($lsbinforef, $tag, $order, $bootorder, 'should-stop', 0); +# check_deps($lsbinforef, 'S', $order, $bootorder, 'stop-after', 0); + } + } +} + +sub load_lsb_tags { + my ($initfile, $useoverrides) = @_; + my $lsbinforef = load_lsb_tags_from_file($initfile); + + if ($useoverrides) { + # Try override file + $initfile = readlink($initfile) if (-l $initfile); + my $basename = basename($initfile); + + # Only read shipped override file when initscript does not + # contain LSB tags. + if (! defined($lsbinforef) && -f "$overridepath/$basename") { + print STDERR "Override $overridepath/$basename\n" if $debug; + $lsbinforef = load_lsb_tags_from_file("$overridepath/$basename"); + } + + # Always read the host override in $hostoverridepath. + if (-f "$hostoverridepath/$basename") { + print STDERR "Override $hostoverridepath/$basename\n" if $debug; + $lsbinforef = load_lsb_tags_from_file("$hostoverridepath/$basename"); + } + + } + return $lsbinforef; +} + +sub load_lsb_tags_from_file { + my ($file) = @_; + print STDERR "Loading $file\n" if $debug; + ### BEGIN INIT INFO + # Provides: xdebconfigurator + # Required-Start: $syslog + # Required-Stop: $syslog + # Default-Start: 2 3 4 5 + # Default-Stop: 1 6 + # Short-Description: Genererate xfree86 configuration at boot time + # Description: Preseed X configuration and use dexconf to + # genereate a new configuration file. + ### END INIT INFO + unless (open(FILE, "<$file")) { + warn "error: Unable to read $file"; + return; + } + my $found = 0; + my ($provides, $requiredstart, $requiredstop, $shouldstart, $shouldstop); + my ($startbefore, $stopafter); + while (<FILE>) { + chomp; + $found = 1 if (m/\#\#\# BEGIN INIT INFO/); + next unless $found; + last if (m/\#\#\# END INIT INFO/); + + $provides = $1 if (m/^\# provides:\s+(\S*.*\S+)\s*$/i); + $requiredstart = $1 if (m/^\# required-start:\s+(\S*.*\S+)\s*$/i); + $requiredstop = $1 if (m/^\# required-stop:\s+(\S*.*\S+)\s*$/i); + $shouldstart = $1 if (m/^\# should-start:\s+(\S*.*\S+)\s*$/i); + $shouldstop = $1 if (m/^\# should-stop:\s+(\S*.*\S+)\s*$/i); + $startbefore = $1 if (m/^\# X-Start-Before:\s+(\S*.*\S+)\s*$/i); + $stopafter = $1 if (m/^\# X-Stop-After:\s+(\S*.*\S+)\s*$/i); + } + close(FILE); + + return undef unless ($found); + +# print "Provides: $provides\n" if $provides; + return { + 'provides' => $provides, + 'required-start' => $requiredstart, + 'required-stop' => $requiredstop, + 'should-start' => $shouldstart, + 'should-stop' => $shouldstop, + 'start-before' => $startbefore, + 'stop-after' => $stopafter, + 'file' => $file, + }; +} diff --git a/beagle/debian-rfs/usr/share/insserv/make-testsuite b/beagle/debian-rfs/usr/share/insserv/make-testsuite new file mode 100755 index 0000000..262b37d --- /dev/null +++ b/beagle/debian-rfs/usr/share/insserv/make-testsuite @@ -0,0 +1,41 @@ +#!/bin/sh +# +# Extract key information from the current to try to generate a test +# suite script to demonstrate detected bugs. + +echo 'set +C' +echo "cat <<'EOF' > \$insconf" +grep -v '#' /etc/insserv.conf |grep -v '^$' +echo "EOF" +echo 'set -C' +echo + +for f in /etc/init.d/*; do + name=$(basename $f) + case $name in + README|rc|rcS|skeleton) + ;; + *) + echo "addscript $name <<'EOF'" + sed -n -r '/^### BEGIN INIT INFO/, /END INIT INFO/p' < $f + echo "EOF" + echo + ;; + esac +done + +echo 'cd $tmpdir/etc' +echo 'mkdir rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d rcS.d' +cd /etc +for f in rc?.d/*; do + case $f in + */README) + ;; + *) + echo ln -s $(readlink $f) $f + ;; + esac +done + +echo +echo list_rclinks diff --git a/beagle/debian-rfs/usr/share/insserv/overrides/devfsd b/beagle/debian-rfs/usr/share/insserv/overrides/devfsd new file mode 100644 index 0000000..ed36858 --- /dev/null +++ b/beagle/debian-rfs/usr/share/insserv/overrides/devfsd @@ -0,0 +1,8 @@ +### BEGIN INIT INFO +# Provides: devfsd +# Required-Start: mountdevsubfs +# Required-Stop: reboot +# Default-Start: S 1 2 3 4 5 +# Default-Stop: 0 6 +### END INIT INFO +# Reported to BTS as bug #324671 diff --git a/beagle/debian-rfs/usr/share/insserv/overrides/hotplug b/beagle/debian-rfs/usr/share/insserv/overrides/hotplug new file mode 100644 index 0000000..9e7b8d1 --- /dev/null +++ b/beagle/debian-rfs/usr/share/insserv/overrides/hotplug @@ -0,0 +1,7 @@ +### BEGIN INIT INFO +# Provides: hotplug +# Required-Start: mountdevsubfs checkroot $local_fs +# Required-Stop: $local_fs +# Default-Start: S +# Default-Stop: 0 6 +### END INIT INFO diff --git a/beagle/debian-rfs/usr/share/insserv/overrides/hotplug-net b/beagle/debian-rfs/usr/share/insserv/overrides/hotplug-net new file mode 100644 index 0000000..6f612d3 --- /dev/null +++ b/beagle/debian-rfs/usr/share/insserv/overrides/hotplug-net @@ -0,0 +1,7 @@ +### BEGIN INIT INFO +# Provides: hotplug-net +# Required-Start: $local_fs ifupdown +# Required-Stop: $local_fs +# Default-Start: S +# Default-Stop: 0 6 +### END INIT INFO diff --git a/beagle/debian-rfs/usr/share/insserv/overrides/initrd-tools.sh b/beagle/debian-rfs/usr/share/insserv/overrides/initrd-tools.sh new file mode 100644 index 0000000..2f4a800 --- /dev/null +++ b/beagle/debian-rfs/usr/share/insserv/overrides/initrd-tools.sh @@ -0,0 +1,7 @@ +### BEGIN INIT INFO +# Provides: initrd-tools +# Required-Start: mountdevsubfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +### END INIT INFO diff --git a/beagle/debian-rfs/usr/share/insserv/overrides/modutils b/beagle/debian-rfs/usr/share/insserv/overrides/modutils new file mode 100644 index 0000000..dacdc4f --- /dev/null +++ b/beagle/debian-rfs/usr/share/insserv/overrides/modutils @@ -0,0 +1,8 @@ +### BEGIN INIT INFO +# Provides: modutils +# Required-Start: checkroot +# Required-Stop: +# Default-Start: S +# Default-Stop: +### END INIT INFO +# Reported to BTS as #335311 diff --git a/beagle/debian-rfs/usr/share/insserv/seq-changes b/beagle/debian-rfs/usr/share/insserv/seq-changes new file mode 100755 index 0000000..4610bec --- /dev/null +++ b/beagle/debian-rfs/usr/share/insserv/seq-changes @@ -0,0 +1,54 @@ +#! /bin/bash +# Script from Frans Pop + +set -e + +if [ -z "$1" ]; then + echo "Usage: insserv-seq-changes /var/lib/insserv/<old bootscripts tarball>" + exit 1 +fi + +oldtar="$(tar tzf $1)" +for i in S $(seq 0 6); do + echo "Runlevel $i" + new="$(cd /etc/rc$i.d; ls -1 [KS]* | sort | nl)" + old="$(echo "$oldtar" | grep "^rc$i.d/[KS]" | cut -d/ -f2 | sort | nl)" + case $i in + S|0|6) + old="$(echo "$old" | sed -r "s/[KS][0-9]+//")" + new="$(echo "$new" | sed -r "s/[KS][0-9]+//")" + ;; + *) + old="$(echo "$old" | sed -r "s/([KS])[0-9]+/\1_/")" + new="$(echo "$new" | sed -r "s/([KS])[0-9]+/\1_/")" + ;; + esac + echo "$new" | while read num cmd; do + oldnum=$(echo "$old" | grep "[[:space:]]$cmd$" | awk '{print $1}') + if [ "$oldnum" ]; then + diff=$(($num - $oldnum)) + else + oldnum="---" + diff="" + fi + if [ ${#cmd} -ge 16 ]; then + echo -e "$cmd\t$num\t$oldnum\t$diff" + elif [ ${#cmd} -ge 8 ]; then + echo -e "$cmd\t\t$num\t$oldnum\t$diff" + else + echo -e "$cmd\t\t\t$num\t$oldnum\t$diff" + fi + done + echo "$old" | while read num cmd; do + if ! echo "$new" | grep -q "[[:space:]]$cmd$"; then + if [ ${#cmd} -ge 16 ]; then + echo -e "$cmd\t---\t$oldnum" + elif [ ${#cmd} -ge 8 ]; then + echo -e "$cmd\t\t---\t$oldnum" + else + echo -e "$cmd\t\t\t---\t$oldnum" + fi + fi + done + echo +done |
