Talk:Setup-storage

From FAIWiki
Revision as of 21:51, 19 March 2012 by ThomasNeumann (talk | contribs) (typo: wrote disk1:3 instead of disk1.3)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
and in /srv/fai/config/store/setup-storage you need to have line 77 as follows
  unshift @INC, "/var/lib/fai/config/store/lib";

Have you considered this instead?

use lib ""/var/lib/fai/config/store/lib";


Which will then allow you to have an entire FAI:: namespace down that path? Unless you wrap the 'unshift' into a BEGIN{} block, it happens at run-time (which is too late), not compile time like 'use lib'. BEGIN blocks are ugly and tough to debug, where as 'use lib' falls into the natural order/perly of doing things.

It might even be better to put the config-store libs in a central place that all of FAI can find them, possibly in /usr/lib/fai, which gets rolled into the NFSROOT. You can then do things like:

 use FindBin;
 use lib dirname(abs_path($FindBin::RealScript)) . "/../lib";
 use lib "$FindBin/../lib";
 use FAI::Config::Store;
 my $bin = $FindBin::Bin;

if you needed to. This allows for an FAI/ subdir some place relative where the script running lives, and provides a location for an entire FAI:: namespace.

Additionally, in setup-storage, there is the following:

 require "init.pm";
 require "volumes.pm";
 require "parser.pm";
 require "sizes.pm";
 require "commands.pm";
 require "fstab.pm";
 require "exec.pm";

Which seems to be an attempt to get around the fact that the 'unshift @INC' is a runtime operator. If the unshift were converted to a "use lib", all the requires could be converted to 'use' statements as well, and all this would happen at compile time where it's supposed to.

Just some thoughts.

-- PaulLussier

preserve option

could anybody give me the right trasformation of this configuration to the new format

disk_config hda
primary  -              preserve1
primary  -              preserve2
primary  /             100-         rw,errors=remount-ro ; boot -j ext3 
logical  swap          128         sw                   

especially i don't understand the preserves

thanks a lot


disk sda / hda

Is there a reason why all the examples use

disk_config hda

or

disk_config sda

instead of the more generic (and probably more generally applicable)

disk_config disk1

(specific partitions can be addressed as 'disk1.3')