summaryrefslogtreecommitdiffstats
path: root/lib/OpenSLX/ConfigFolder.pm
diff options
context:
space:
mode:
authorOliver Tappe2008-03-20 01:04:16 +0100
committerOliver Tappe2008-03-20 01:04:16 +0100
commita0ce0340d0f95514008cfac751fe58748bbadd88 (patch)
tree844bb9e015f2fbcd83de54c3a63dd027b1218211 /lib/OpenSLX/ConfigFolder.pm
parent* fixed several bugs with respect to the listing of plugins (as part of a system (diff)
downloadcore-a0ce0340d0f95514008cfac751fe58748bbadd88.tar.gz
core-a0ce0340d0f95514008cfac751fe58748bbadd88.tar.xz
core-a0ce0340d0f95514008cfac751fe58748bbadd88.zip
* Switched indent used in Perl-code and settings files from tabs to 4 spaces.
May need some manual corrections here and there, but should basically be ok. git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1658 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'lib/OpenSLX/ConfigFolder.pm')
-rw-r--r--lib/OpenSLX/ConfigFolder.pm116
1 files changed, 58 insertions, 58 deletions
diff --git a/lib/OpenSLX/ConfigFolder.pm b/lib/OpenSLX/ConfigFolder.pm
index 99289881..e8c3ee8f 100644
--- a/lib/OpenSLX/ConfigFolder.pm
+++ b/lib/OpenSLX/ConfigFolder.pm
@@ -9,7 +9,7 @@
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
# ConfigFolder.pm
-# - provides utility functions for generation of configuration folders
+# - provides utility functions for generation of configuration folders
# -----------------------------------------------------------------------------
package OpenSLX::ConfigFolder;
@@ -23,8 +23,8 @@ $VERSION = 1.01;
@ISA = qw(Exporter);
@EXPORT = qw(
- &createConfigFolderForDefaultSystem
- &createConfigFolderForSystem
+ &createConfigFolderForDefaultSystem
+ &createConfigFolderForSystem
);
################################################################################
@@ -35,68 +35,68 @@ use OpenSLX::Utils;
sub createConfigFolderForDefaultSystem
{
- my $result = 0;
- my $defaultConfigPath = "$openslxConfig{'private-path'}/config/default";
- if (!-e "$defaultConfigPath/initramfs") {
- slxsystem("mkdir -p $defaultConfigPath/initramfs");
- $result = 1;
- }
- if (!-e "$defaultConfigPath/rootfs") {
- slxsystem("mkdir -p $defaultConfigPath/rootfs");
- $result = 1;
- }
+ my $result = 0;
+ my $defaultConfigPath = "$openslxConfig{'private-path'}/config/default";
+ if (!-e "$defaultConfigPath/initramfs") {
+ slxsystem("mkdir -p $defaultConfigPath/initramfs");
+ $result = 1;
+ }
+ if (!-e "$defaultConfigPath/rootfs") {
+ slxsystem("mkdir -p $defaultConfigPath/rootfs");
+ $result = 1;
+ }
- # create default pre-/postinit scripts for us in initramfs:
- my $preInitFile = "$defaultConfigPath/initramfs/preinit.local";
- if (!-e $preInitFile) {
- my $preInit = unshiftHereDoc(<<' END-of-HERE');
- #!/bin/sh
- #
- # This script allows the local admin to extend the
- # capabilities at the beginning of the initramfs (stage3).
- # The toolset is rather limited and you have to keep in mind
- # that stage4 rootfs has the prefix '/mnt'.
- END-of-HERE
- spitFile($preInitFile, $preInit);
- slxsystem("chmod u+x $preInitFile");
- $result = 1;
- }
+ # create default pre-/postinit scripts for us in initramfs:
+ my $preInitFile = "$defaultConfigPath/initramfs/preinit.local";
+ if (!-e $preInitFile) {
+ my $preInit = unshiftHereDoc(<<' END-of-HERE');
+ #!/bin/sh
+ #
+ # This script allows the local admin to extend the
+ # capabilities at the beginning of the initramfs (stage3).
+ # The toolset is rather limited and you have to keep in mind
+ # that stage4 rootfs has the prefix '/mnt'.
+ END-of-HERE
+ spitFile($preInitFile, $preInit);
+ slxsystem("chmod u+x $preInitFile");
+ $result = 1;
+ }
- my $postInitFile = "$defaultConfigPath/initramfs/postinit.local";
- if (!-e $postInitFile) {
- my $postInit = unshiftHereDoc(<<' END-of-HERE');
- #!/bin/sh
- #
- # This script allows the local admin to extend the
- # capabilities at the end of the initramfs (stage3).
- # The toolset is rather limited and you have to keep in mind
- # that stage4 rootfs has the prefix '/mnt'.
- # But you may use some special slx-functions available via
- # inclusion: '. /etc/functions' ...
- END-of-HERE
- spitFile($postInitFile, $postInit);
- slxsystem("chmod u+x $postInitFile");
- $result = 1;
- }
- return $result;
+ my $postInitFile = "$defaultConfigPath/initramfs/postinit.local";
+ if (!-e $postInitFile) {
+ my $postInit = unshiftHereDoc(<<' END-of-HERE');
+ #!/bin/sh
+ #
+ # This script allows the local admin to extend the
+ # capabilities at the end of the initramfs (stage3).
+ # The toolset is rather limited and you have to keep in mind
+ # that stage4 rootfs has the prefix '/mnt'.
+ # But you may use some special slx-functions available via
+ # inclusion: '. /etc/functions' ...
+ END-of-HERE
+ spitFile($postInitFile, $postInit);
+ slxsystem("chmod u+x $postInitFile");
+ $result = 1;
+ }
+ return $result;
}
sub createConfigFolderForSystem
{
- my $systemName = shift || confess "need to pass in system-name!";
+ my $systemName = shift || confess "need to pass in system-name!";
- my $result = 0;
- my $systemConfigPath
- = "$openslxConfig{'private-path'}/config/$systemName/default";
- if (!-e "$systemConfigPath/initramfs") {
- slxsystem("mkdir -p $systemConfigPath/initramfs");
- $result = 1;
- }
- if (!-e "$systemConfigPath/rootfs") {
- slxsystem("mkdir -p $systemConfigPath/rootfs");
- $result = 1;
- }
- return $result;
+ my $result = 0;
+ my $systemConfigPath
+ = "$openslxConfig{'private-path'}/config/$systemName/default";
+ if (!-e "$systemConfigPath/initramfs") {
+ slxsystem("mkdir -p $systemConfigPath/initramfs");
+ $result = 1;
+ }
+ if (!-e "$systemConfigPath/rootfs") {
+ slxsystem("mkdir -p $systemConfigPath/rootfs");
+ $result = 1;
+ }
+ return $result;
}
1;