Mailinglist Archive: yast-commit (883 mails)

< Previous Next >
[yast-commit] r57974 - /trunk/storage/storage/src/modules/StorageProposal.ycp
  • From: aschnell@xxxxxxxxxxxxxxxx
  • Date: Thu, 09 Jul 2009 12:15:37 -0000
  • Message-id: <E1MOsXJ-0007Da-P1@xxxxxxxxxxxxxxxx>
Author: aschnell
Date: Thu Jul 9 14:15:37 2009
New Revision: 57974

URL: http://svn.opensuse.org/viewcvs/yast?rev=57974&view=rev
Log:
- work on proposal encryption

Modified:
trunk/storage/storage/src/modules/StorageProposal.ycp

Modified: trunk/storage/storage/src/modules/StorageProposal.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/StorageProposal.ycp?rev=57974&r1=57973&r2=57974&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/StorageProposal.ycp (original)
+++ trunk/storage/storage/src/modules/StorageProposal.ycp Thu Jul 9 14:15:37
2009
@@ -171,6 +171,35 @@
}


+ map EncryptDevices(map<string, map> target, string vg)
+ {
+ if (!GetProposalLvm() || !GetProposalEncrypt())
+ return target;
+
+ list<string> devices = target[vg, "devices_add"]:[];
+ y2milestone("devices:%1", devices);
+
+ // go through target map and set enc_type and password for all devices
used by
+ // our volume group
+ target = mapmap(string disk_device, map data, target, {
+ list<map> partitions = data["partitions"]:[];
+ partitions = maplist(map partition, partitions, {
+ string part_device = partition["device"]:"";
+ if (contains(devices, part_device))
+ {
+ partition["enc_type"] = `luks;
+ Storage::UpdateClassified(part_device, proposal_password);
+ }
+ return partition;
+ });
+ data["partitions"] = partitions;
+ return $[ disk_device : data ];
+ });
+
+ return target;
+ }
+
+
list<string> NoProposeDisks()
{
if (no_propose_disks == nil)
@@ -3836,6 +3865,7 @@
}
y2milestone( "get_proposal_vm vkey %1", vg );
ret["target",vg_key] = modify_vm( vg, opts, size(r)==0 );
+ ret["target"] = EncryptDevices(ret["target"]:$[], vg_key);
ret["target",ddev] = disk;
ret["target"] = Storage::SpecialBootHandling( ret["target"]:$[] );
y2milestone( "get_proposal_vm sol:%1", disk );
@@ -3848,8 +3878,8 @@
{
map ret = $[];
string vg = GetProposalVM();
- y2milestone("get_inst_prop vg:%1 lvm:%2 home:%3", vg,
- GetProposalLvm(), GetProposalHome());
+ y2milestone("get_inst_prop vg:%1 home:%2 lvm:%3 encypt:%4", vg,
+ GetProposalHome(), GetProposalLvm(), GetProposalEncrypt());
if( size(vg)==0 )
{
if( has_flex_proposal() )
@@ -3861,6 +3891,7 @@
{
y2milestone( "target:%1", target );
ret = get_inst_prop_vm( target, vg );
+ ret["target"] = EncryptDevices(ret["target"]:$[], "/dev/" + vg);
}
y2milestone("get_inst_prop ret:%1", ret);
return ret;

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages