blob: 72d9087d50e86b162956b2f193c8566b0bac7560 (
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
# Copyright (c) 2006-2008 - 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/
# -----------------------------------------------------------------------------
# MakeInitialRamFS::Engine::PrebootCD.pm
# - provides driver engine for MakeInitialRamFS API, implementing the
# preboot behaviour applicable for CDs.
# -----------------------------------------------------------------------------
package OpenSLX::MakeInitRamFS::Engine::PrebootCD;
use strict;
use warnings;
use base qw(OpenSLX::MakeInitRamFS::Engine::Base);
use File::Find;
use OpenSLX::Basics;
use OpenSLX::Utils;
################################################################################
### implementation methods
################################################################################
sub _collectCMDs
{
my $self = shift;
$self->{CMDs} = [];
$self->_setupBuildPath();
$self->_writeInitramfsSetup();
$self->_writeSlxSystemConf();
$self->_copyUclibcRootfs();
$self->{distro}->applyChanges($self);
$self->_copyKernelModules();
$self->_createInitRamFS();
return;
}
sub _setupBuildPath
{
my $self = shift;
my $buildPath = "$openslxConfig{'temp-path'}/slx-initramfs";
$self->addCMD("rm -rf $buildPath");
my @stdFolders = qw(
bin
dev
etc
lib
mnt
proc
root
sbin
sys
tmp
var/lib
var/run
);
$self->addCMD(
'mkdir -p ' . join(' ', map { "$buildPath/$_"; } @stdFolders)
);
$self->{'build-path'} = $buildPath;
return;
}
sub _copyUclibcRootfs
{
my $self = shift;
my $uclibcRootfs = "$openslxConfig{'base-path'}/share/uclib-rootfs";
my @excludes = qw(
);
# exclude strace unless this system is in debug mode
if (!$self->{'debug-level'}) {
push @excludes, 'strace';
}
my $exclOpts = join ' ', map { "--exclude $_" } @excludes;
$self->addCMD("rsync $exclOpts -rlpt $uclibcRootfs/ $self->{'build-path'}");
return 1;
}
1;
|