From 77838eab1f8f770c86cb9a9e3db3d95ccb9f32de Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sat, 2 Feb 2008 22:46:35 +0000 Subject: * switched config-demuxer over to internal generation of initramfs * obsoleted mkdxsinitrd git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1511 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/slxconfig-demuxer | 85 +-------------------------------------------- 1 file changed, 1 insertion(+), 84 deletions(-) (limited to 'config-db') diff --git a/config-db/slxconfig-demuxer b/config-db/slxconfig-demuxer index 364b8f53..d91e5b46 100755 --- a/config-db/slxconfig-demuxer +++ b/config-db/slxconfig-demuxer @@ -78,8 +78,6 @@ my ( # number of (system-specific) client configurations written $initramfsCount, # number of initramfs that were created - $makeInitRamFS, - # generate initial ramfs internally (new style) @targetSystems, # systems to create initramfs for, defaults to all systems $helpReq, @@ -93,7 +91,6 @@ if ($> != 0) { GetOptions( 'dhcp-export-type=s' => \$dhcpType, - 'makeinitramfs' => \$makeInitRamFS, 'dry-run' => \$dryRun, 'help|?' => \$helpReq, 'man' => \$manReq, @@ -511,82 +508,6 @@ sub writePXEMenus return; } -sub generateInitialRamFS -{ - my $info = shift; - my $pxeVendorOSPath = shift; - - my $vendorOS = $info->{'vendor-os'}; - - my $osExportEngine = instantiateClass("OpenSLX::OSExport::Engine"); - $osExportEngine->initializeFromExisting($info->{export}->{name}); - - vlog(1, _tr('generating initialramfs %s/initramfs', $pxeVendorOSPath)); - my $cmd = "$openslxConfig{'base-path'}/bin/mkdxsinitrd "; - my $attrs = $info->{attrs} || {}; - if ($attrs->{ramfs_nicmods}) { - $cmd .= qq[-n "$attrs->{ramfs_nicmods}" ]; - } - my $fsMods = $attrs->{ramfs_fsmods} || ''; - $fsMods .= ' ' . join(' ', $osExportEngine->requiredFSMods()); - if ($fsMods) { - $cmd .= qq[-f "$fsMods" ]; - } - if ($attrs->{ramfs_miscmods}) { - $cmd .= qq[-m "$attrs->{ramfs_miscmods}" ]; - } - my $rootPath = "$openslxConfig{'private-path'}/stage1/$vendorOS->{name}"; - $cmd .= "-i $pxeVendorOSPath/$info->{'initramfs-name'} -r $rootPath "; - - # pass in system name: - $cmd .= "-S $info->{name} "; - - # pass on theme, if any - my $theme = $attrs->{'theme::splash'} || ''; - if (length $theme) { - $cmd .= "-s $theme "; - } - - my $activePlugins = $info->{'active-plugins'}; - if ($activePlugins) { - $cmd .= '-p ' . join(',', @$activePlugins) . ' '; - } - - # always use dhclient instead of the busybox-provided dhcp-client - # (since the latter is unable to fetch NIS-stuff): - $cmd .= "-d "; - - # generate initramfs-setup file (with settings relevant for initramfs only): - my $initramfsAttrFile = "$tempPath/initramfs-setup"; - my $initramfsAttrs = { - attrs => { - 'host_name' => 'slx-client', # just to have something at all - 'ramfs_fsmods' => $attrs->{'ramfs_fsmods'} || '', - 'ramfs_nicmods' => $attrs->{'ramfs_nicmods'} || '', - 'ramfs_screen' => $attrs->{'ramfs_screen'} || '', - 'rootfs' => $info->{'export-uri'} || '', - }, - }; - writeAttributesToFile($initramfsAttrs, $initramfsAttrFile); - # and pass the generated initramfs-setup file to mkdxsinitrd: - $cmd .= "-c $initramfsAttrFile "; - - # ... set kernel version ... - my $kernelFile = basename(followLink($info->{'kernel-file'})); - $kernelFile =~ m[-(.+)$]; - my $kernelVersion = $1; - $cmd .= "-k $kernelVersion "; - - # ... add version info ... - my $slxver = `slxversion`; - chomp $slxver; - $ENV{'SLX_VERSION'} = $slxver; - - # ... finally invoke mkdxsinitrd: - slxsystem($cmd) unless $dryRun; - return; -} - sub makeInitRamFS { my $info = shift; @@ -643,11 +564,7 @@ sub writeSystemPXEFiles vlog(1, _tr('copying kernel %s to %s', $kernelFile, $targetKernel)); slxsystem(qq[cp -p "$kernelFile" "$targetKernel"]) unless $dryRun; } - if ($makeInitRamFS) { - makeInitRamFS($info, $pxeVendorOSPath); - } else { - generateInitialRamFS($info, $pxeVendorOSPath); - } + makeInitRamFS($info, $pxeVendorOSPath); $initramfsCount++; return; } -- cgit v1.2.3-55-g7522