summaryrefslogtreecommitdiffstats
path: root/installer/OpenSLX/OSSetup/Distro/Debian_3_1.pm
blob: 7f390bc10a3fb8cf95421be8022020879d1657a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Copyright (c) 2006, 2007 - OpenSLX GmbH
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
#
# If you have any feedback please consult http://openslx.org/feedback and
# send your suggestions, praise, or complaints to feedback@openslx.org
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
# Debian_3_1.pm
#    - provides Debian-3.1-specific overrides of the OpenSLX OSSetup API.
# -----------------------------------------------------------------------------
package OpenSLX::OSSetup::Distro::Debian_3_1;

use strict;
use warnings;

use base qw(OpenSLX::OSSetup::Distro::Debian);

use OpenSLX::Basics;
use OpenSLX::Utils;

################################################################################
### implementation
################################################################################
sub preSystemInstallationHook
{
    my $self = shift;
    
    $self->SUPER::preSystemInstallationHook();

    # when the kernel package is being configured, it insists on trying to
    # create an initrd, which neither works nor makes sense in our environment.
    #
    # in order to circumvent this problem, we manually install initrd-tools 
    # (which contains mkinitrd) ...
    $self->{engine}->{'meta-packager'}->installPackages('initrd-tools');
    # ... and replace /usr/sbin/mkinitrd with a dummy, in order to skip the 
    # initrd-creation.
    rename('/usr/sbin/mkinitrd', '/usr/sbin/_mkinitrd');
    spitFile('/usr/sbin/mkinitrd', "#! /bin/sh\ntouch \$2\n");
    chmod 0755, '/usr/sbin/mkinitrd';
}

sub postSystemInstallationHook
{
    my $self = shift;

    # restore /usr/sbin/mkinitrd
    rename('/usr/sbin/_mkinitrd', '/usr/sbin/mkinitrd');
    $self->SUPER::postSystemInstallationHook();
}

1;