diff options
author | Sebastian Schmelzer | 2010-09-02 17:50:49 +0200 |
---|---|---|
committer | Sebastian Schmelzer | 2010-09-02 17:50:49 +0200 |
commit | 416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5 (patch) | |
tree | 4715f7d742fec50931017f38fe6ff0a89d4ceccc /boot-env/OpenSLX/MakeInitRamFS/Engine/Preboot.pm | |
parent | Fix for the problem reported on the list (sed filter forgotten for the (diff) | |
download | core-416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5.tar.gz core-416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5.tar.xz core-416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5.zip |
change dir structure
Diffstat (limited to 'boot-env/OpenSLX/MakeInitRamFS/Engine/Preboot.pm')
-rw-r--r-- | boot-env/OpenSLX/MakeInitRamFS/Engine/Preboot.pm | 143 |
1 files changed, 0 insertions, 143 deletions
diff --git a/boot-env/OpenSLX/MakeInitRamFS/Engine/Preboot.pm b/boot-env/OpenSLX/MakeInitRamFS/Engine/Preboot.pm deleted file mode 100644 index aecfd00f..00000000 --- a/boot-env/OpenSLX/MakeInitRamFS/Engine/Preboot.pm +++ /dev/null @@ -1,143 +0,0 @@ -# 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::Preboot.pm -# - provides driver engine for MakeInitialRamFS API, implementing the -# base of all preboot variants. -# ----------------------------------------------------------------------------- -package OpenSLX::MakeInitRamFS::Engine::Preboot; - -use strict; -use warnings; - -use base qw(OpenSLX::MakeInitRamFS::Engine::Base); - -use OpenSLX::Basics; -use OpenSLX::Utils; - -################################################################################ -### implementation methods -################################################################################ -sub _collectCMDs -{ - my $self = shift; - - $self->{CMDs} = []; - - $self->_setupBuildPath(); - - $self->_writeInitramfsSetup(); - $self->_writeSlxSystemConf(); - - $self->_copyUclibcRootfs(); - $self->_copyPrebootSpecificFiles(); - - $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 _writeInitramfsSetup -{ - my $self = shift; - - # generate initramfs-setup file containing attributes that are - # relevant for the initramfs only (before there's a root-FS) - - # this override adds the name of the client such that the booting - # system has an ID to use for accessing the corresponding boot environment - # on the server - my $initramfsAttrs = { - 'host_name' => 'slx-client', # just to have something at all - 'ramfs_miscmods' => $self->{attrs}->{ramfs_miscmods} || '', - 'ramfs_nicmods' => $self->{attrs}->{ramfs_nicmods} || '', - 'ramfs_firmmods' => $self->{attrs}->{ramfs_firmmods} || '', - 'preboot_id' => $self->{'preboot-id'} || '', - 'boot_uri' => $self->{'boot-uri'} || '', - }; - my $content = "# attributes set by slxconfig-demuxer:\n"; - foreach my $attr (keys %$initramfsAttrs) { - $content .= qq[$attr="$initramfsAttrs->{$attr}"\n]; - } - $self->addCMD( { - file => "$self->{'build-path'}/etc/initramfs-setup", - content => $content - } ); - - 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; -} - -sub _copyPrebootSpecificFiles -{ - my $self = shift; - - # write secondary rootfs-layer (including init) on top of base layer - my $prebootRootfs - = "$openslxConfig{'base-path'}/share/boot-env/preboot/uclib-rootfs"; - $self->addCMD("rsync -rlpt $prebootRootfs/ $self->{'build-path'}"); - - return 1; -} - -1; |