Andrea,
I think the commands look OK, but I'd rather see it broken out as a seperate subroutine, making it more modular and flexible. See the attached patch as an indicator, and search for 'XXX -AR-' for placeholders. I think it'll all make sense, but lemme know if it doesn't.
Cheers!
-Brian
Andrea Righi wrote:
Hi,
I like to proceed step by step for the LVM stuff... this is a little patch that add the pvcreate commands during the partitioning. Not yet tested!
------------------------------------------------------------------------
--- lib/SystemImager/Server.pm~ 2005-01-19 10:48:07.254387544 +0100
+++ lib/SystemImager/Server.pm 2005-01-19 10:48:33.677370640 +0100
@@ -751,6 +751,12 @@
$cmd = "parted -s -- $devfs_dev set $m $flag on || shellout\n";
print $out "echo $cmd";
print $out "$cmd";
+ if ($flag eq "lvm") {
+ # Initialize the partition for use by LVM. -AR-
+ $cmd = "pvcreate $part || shellout\n";
+ print $out "echo $cmd";
+ print $out "$cmd";
+ }
}
}
}
-- ------------------------------------------------------ Brian Elliott Finley Mobile: 630.631.6621 gpg --keyserver wwwkeys.pgp.net --recv-keys 10F8EE52 ------------------------------------------------------
Index: etc/autoinstallscript.template
===================================================================
RCS file: /cvsroot/systemimager/systemimager/etc/autoinstallscript.template,v
retrieving revision 1.17
diff -u -p -r1.17 autoinstallscript.template
--- etc/autoinstallscript.template 17 Apr 2004 14:47:53 -0000 1.17
+++ etc/autoinstallscript.template 19 Jan 2005 21:34:54 -0000
@@ -95,6 +95,9 @@ modprobe ext3
modprobe jfs
modprobe xfs
+# XXX -AR-
+##DO_LVM_STUFF_OR_SIMILAR##
+
### BEGIN swap and filesystem creation commands ###
##CREATE_FILESYSTEMS##
### END swap and filesystem creation commands ###
Index: lib/SystemImager/Server.pm
===================================================================
RCS file: /cvsroot/systemimager/systemimager/lib/SystemImager/Server.pm,v
retrieving revision 1.91
diff -u -p -r1.91 Server.pm
--- lib/SystemImager/Server.pm 15 Dec 2004 15:46:11 -0000 1.91
+++ lib/SystemImager/Server.pm 19 Jan 2005 21:34:54 -0000
@@ -34,6 +34,7 @@ $VERSION="SYSTEMIMAGER_VERSION_STRING";
# _imageexists
# _in_script_add_standard_header_stuff
# _read_partition_info_and_prepare_parted_commands
+# _read_partition_info_and_prepare_lvm_commands XXX -AR-
# _write_boel_devstyle_entry
# _write_elilo_conf
# _write_out_mkfs_commands
@@ -1448,6 +1449,9 @@ sub create_autoinstall_script{
last SWITCH;
}
+ # XXX -AR- add switch for LVM stuff here
+ # if (/^\s*${delim}DO_LVM_STUFF_OR_SIMILAR${delim}\s*$/) {
+
if (/^\s*${delim}CREATE_FILESYSTEMS${delim}\s*$/) {
_write_out_mkfs_commands( $MASTER_SCRIPT,
$image_dir,
