Commit 56b7927a authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch...

Merge branch '5735-option-for-command-line-in-argonaut-fuse-should-come-from-fusiondirectory' into '1.3-dev'

Resolve "argonaut-fuse should adapt command line options to FAI version"

See merge request argonaut/argonaut!93
parents df869240 8f215de6
......@@ -5,7 +5,7 @@
# Copyright (c) 2005,2006,2007 by Jan-Marek Glogowski <glogow@fbihome.de>
# Copyright (c) 2008 by Cajus Pollmeier <pollmeier@gonicus.de>
# Copyright (c) 2008,2009, 2010 by Jan Wenzel <wenzel@gonicus.de>
# Copyright (C) 2011-2016 FusionDirectory project
# Copyright (C) 2011-2018 FusionDirectory project
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -52,8 +52,9 @@ sub get_module_settings {
return argonaut_get_generic_settings(
'argonautFuseFAIConfig',
{
'fai_flags' => "argonautFuseFaiFlags",
'nfs_root' => "argonautFuseNfsRoot",
'fai_version' => "argonautFuseFaiVersion",
'fai_flags' => "argonautFuseFaiFlags",
'nfs_root' => "argonautFuseNfsRoot",
},
$main::config,$main::config->{'client_ip'}
);
......@@ -64,9 +65,7 @@ sub get_pxe_config {
my ($filename) = shift || return;
my $settings = get_module_settings();
my $nfs_root = $settings->{'nfs_root'};
my $nfs_opts = "";
my $fai_flags = $settings->{'fai_flags'};
my $union = "aufs";
my $mac = argonaut_get_mac_pxe($filename);
my $result = undef;
......@@ -123,18 +122,21 @@ sub get_pxe_config {
my $output;
my $valid_status = 1;
# Set cmdline
# Add NFS options and root, if available
my $nfsroot_cmdline = (defined $nfs_root && ($nfs_root ne ''));
$infos->{'cmdline'} .= " nfsroot=$nfs_root" if( $nfsroot_cmdline );
if (defined $nfs_opts && ($nfs_opts ne '')) {
$infos->{'cmdline'} .= ' nfsroot=' if( ! $nfsroot_cmdline );
$infos->{'cmdline'} .= ",$nfs_opts";
$infos->{'cmdline'} .= " ip=dhcp";
if ($settings->{'fai_version'} < 5) {
$infos->{'cmdline'} .= " nfsroot=$nfs_root";
$infos->{'cmdline'} .= " root=/dev/nfs boot=live union=aufs";
} else {
$infos->{'cmdline'} .= " root=".$main::config->{'client_ip'}.":".$nfs_root." rootovl";
}
$infos->{'cmdline'} .= " FAI_ACTION=${main::default_mode}";
if ($infos->{'status'} =~ /^(install|install-init)$/) {
$infos->{'kernel'} = 'kernel '.$infos->{'kernel'};
$infos->{'cmdline'} .= " ip=dhcp root=/dev/nfs boot=live union=$union"
. " FAI_ACTION=${main::default_mode} FAI_FLAGS=${fai_flags}";
$infos->{'cmdline'} .= " FAI_FLAGS=${fai_flags}";
} elsif ($infos->{'status'} =~ /^(error:|installing:)/) {
# If we had an error, show an error message
# The only difference is to install is "faierror" on cmdline
......@@ -142,8 +144,7 @@ sub get_pxe_config {
$faierror .= (split( ':', $infos->{'status'} ))[1];
$infos->{'kernel'} = 'kernel '.$infos->{'kernel'};
$infos->{'cmdline'} .= " ip=dhcp root=/dev/nfs boot=live union=$union"
. " FAI_ACTION=${main::default_mode} FAI_FLAGS=${fai_flags} faierror:${faierror}";
$infos->{'cmdline'} .= " FAI_FLAGS=${fai_flags} faierror:${faierror}";
} elsif ($infos->{'status'} eq 'softupdate') {
# Softupdate has to be run by the client, so do a localboot
$infos->{'kernel'} = 'localboot 0';
......@@ -161,8 +162,7 @@ sub get_pxe_config {
}
my $noreboot = join( ',', @sysflags );
$infos->{'kernel'} = 'kernel '.$infos->{'kernel'};
$infos->{'cmdline'} .= " ip=dhcp root=/dev/nfs boot=live union=$union"
. " FAI_ACTION=${main::default_mode} FAI_FLAGS=${noreboot} ";
$infos->{'cmdline'} .= " FAI_FLAGS=${noreboot} ";
} elsif ($infos->{'status'} eq 'localboot') {
$infos->{'kernel'} = 'localboot 0';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment