Bug#335230: [#335230] How to actually support EVMS in an initrd

2005-10-23 Thread Mattia Dongili
On Sat, Oct 22, 2005 at 10:01:02PM +0200, Sven Luther wrote:
 On Sat, Oct 22, 2005 at 09:47:12PM +0200, Marco Amadori wrote:
  Alle 21:18, sabato 22 ottobre 2005, Steinar H. Gunderson ha scritto:
  
   EVMS support in yaird should not be difficult to add for someone who
   already knows yaird. Basically, what you need to do is:
  
  We need a perl hacker.
 
 Mattia, maybe you would like to jump in here too ? I hope i am not abusing by
 asking you that :)

Oh, well, I'd really like to :) Only problem I have is that I don't have
any EVMS system available. I'm going to see if I have enough spare HW
parts to build a pc and set it up but it might take some time...
And to avoid stepping on anybody's feet, Erik, aren't you interested? As
I see you are the author of yaird :)

Anyway having a good written guidance I could still provide perl code
to play with.

-- 
mattia
:wq!


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#335230: [#335230] How to actually support EVMS in an initrd

2005-10-23 Thread Erik van Konijnenburg
On Sun, Oct 23, 2005 at 01:07:26PM +0200, Mattia Dongili wrote:
 On Sat, Oct 22, 2005 at 10:01:02PM +0200, Sven Luther wrote:
  On Sat, Oct 22, 2005 at 09:47:12PM +0200, Marco Amadori wrote:
   Alle 21:18, sabato 22 ottobre 2005, Steinar H. Gunderson ha scritto:
   
EVMS support in yaird should not be difficult to add for someone who
already knows yaird. Basically, what you need to do is:
   
   We need a perl hacker.
  
  Mattia, maybe you would like to jump in here too ? I hope i am not abusing 
  by
  asking you that :)
 
 Oh, well, I'd really like to :) Only problem I have is that I don't have
 any EVMS system available. I'm going to see if I have enough spare HW
 parts to build a pc and set it up but it might take some time...
 And to avoid stepping on anybody's feet, Erik, aren't you interested? As
 I see you are the author of yaird :)

Yep, I'm interested; plan to participate in discussions, test and merge results
in next release.  However, that doesn't mean I'm the only one who can talk
about the use of perl in yaird.  If you and Marco come up with something
good, i don't consider that stepping on my feet ...

Regards,
Erik




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#335230: [#335230] How to actually support EVMS in an initrd

2005-10-23 Thread Sven Luther
On Sun, Oct 23, 2005 at 01:07:26PM +0200, Mattia Dongili wrote:
 On Sat, Oct 22, 2005 at 10:01:02PM +0200, Sven Luther wrote:
  On Sat, Oct 22, 2005 at 09:47:12PM +0200, Marco Amadori wrote:
   Alle 21:18, sabato 22 ottobre 2005, Steinar H. Gunderson ha scritto:
   
EVMS support in yaird should not be difficult to add for someone who
already knows yaird. Basically, what you need to do is:
   
   We need a perl hacker.
  
  Mattia, maybe you would like to jump in here too ? I hope i am not abusing 
  by
  asking you that :)
 
 Oh, well, I'd really like to :) Only problem I have is that I don't have
 any EVMS system available. I'm going to see if I have enough spare HW
 parts to build a pc and set it up but it might take some time...
 And to avoid stepping on anybody's feet, Erik, aren't you interested? As
 I see you are the author of yaird :)

Well, Marco could test it for you, maybe ? 

 Anyway having a good written guidance I could still provide perl code
 to play with.

Indeed, there is some provided earlier in this thread, i believe.

Friendly,

Sven Luther



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#335230: [#335230] How to actually support EVMS in an initrd

2005-10-23 Thread Marco Amadori
Alle 13:07, domenica 23 ottobre 2005, hai scritto:

   We need a perl hacker.
  Mattia, maybe you would like to jump in here too ? I hope i am not
  abusing by asking you that :)
 Oh, well, I'd really like to :) Only problem I have is that I don't have
 any EVMS system available.

Can be simulated using a live cd that supports EVMS, like latest ubuntu live 
cds, booting cd from qemu using loops devices to simulate your testing 
harddisk config. 

 I'm going to see if I have enough spare HW 
 parts to build a pc and set it up but it might take some time...

Of course you can also debootstrap a debian system in a partitioned mounted 
loop and test there, I know that could be slower than a real hardware system. 

 Anyway having a good written guidance I could still provide perl code
 to play with.

A guide to write EVMS yaird support:

The right way to start is to add sid sources to apt and then with apt-get 
source yaird we are done.
In the directory yaird-0.1?/perl/ there is the main Plan.pm that checks for 
right way to handle the root device in this function at nearly 80:

sub addDevicePlan ($$$) {
my ($actions, $device, $working) = @_;

my $name = $device-name;
for my $w (@{$working}) {
if ($w eq $device) {
Base::fatal (loop detected: $name\n);
}
}

my $ok = 0;
$ok || ($ok = tryParent ($actions,$device,[$device,@{$working}]));
$ok || ($ok = tryEvms ($actions,$device,[$device,@{$working}]));
$ok || ($ok = tryDmCrypt ($actions,$device,[$device,@{$working}]));
$ok || ($ok = tryLvm ($actions,$device,[$device,@{$working}]));
$ok || ($ok = tryRaid ($actions,$device,[$device,@{$working}]));
$ok || ($ok = tryHardware ($actions,$device,[$device,@{$working}]));
if (! $ok) {
Base::fatal (unsupported device required: $name);
}
Base::debug (device: completed $name);
}

The sub tryEvms in not already in place.
Yaird perl code gives some functions to handle device string to extract 
relevant parts. If the sub tryEvms need to use some tools to check for evms 
compliance, a new EvmsTab.pm and EvmsDev.pm should be added with similar 
roles as RaidDev.pm and RaidTab.pm.

This is for the what code should be added part

Now which tools we have:

evms_activate: to start evms volumes (at boot)

evms_query: can query a device at run time to have informations useful to know 
which plugins are needed in order to boot the device and the evms version.

evms_gather_info : gives a lot of output on underlying evms system.

Problem: the entire /lib/evms/2.5.3 is 1.6 Mb, but not all files are needed in 
order to boot. But this is a minor thing right now, we can copy all 
dir /lib/evms/$VER/ in the image and we are happy. From Base.pm there is an 
addTree and an addLibrary functions that should be merged in another 
addTreeLibrary that works for putting all evms plugins on the image.

Doing thing well we should be use evms_query to gather some info, let me 
explane with an example:

my target root device from fstab is /dev/evms/lvm2/safe/root64 

# evms_query objects /dev/evms/lvm2/sicuro/root64 | xargs -i evms_query 
plugins \{\} | sort | uniq

gives me :
DosSegMgr
LocalDskMgr
LVM2
MDRaid5RegMgr

that on my system correspond to libraries:
/lib/evms/2.5.3/dos-1.1.14.so
/lib/evms/2.5.3/disk-1.2.11.so
/lib/evms/2.5.3/lvm2-1.0.3.so
/lib/evms/2.5.3/md-1.1.18.so

This gives 708 Kb instead of 1.6 Mb.

If we need to know device numbers we could use evms_query 
info /dev/evms/lvm2/sicuro/usr64 | grep Device or similar to have them.

N.B. If the file /etc/evms.conf differs from default it should be copied also 
on the image because compatibility volumes could need it to proper showing up 
(the relevant part of this config file is the last device_size_prompt = no 
part).

After this step we should also look at debian-installer, we could look after 
to provide a gtk-directfb port for evms-gui or add evms support to partman, 
we will see. :-)

If I missed any fundamental part please correct me.

Thats all I can do for now, I should learn perl more to help more...

-- 
ESC:wq


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#335230: [#335230] How to actually support EVMS in an initrd

2005-10-23 Thread Mattia Dongili
On Sun, Oct 23, 2005 at 02:36:29PM +0200, Marco Amadori wrote:
 Alle 13:07, domenica 23 ottobre 2005, hai scritto:
[... system setup suggestions ...]

My old PII is definitely dead, I'm going with the qemu option, but it's
taking quite long. Will see if this week I manage to get a spare PC to
play with at work.

  Anyway having a good written guidance I could still provide perl code
  to play with.
 
 A guide to write EVMS yaird support:

Thanks for the insight. I'm also digging into the code, to better get
it. I'll try to submit some code or question if needed during the week.

thanks
-- 
mattia
:wq!


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#335230: [#335230] How to actually support EVMS in an initrd

2005-10-22 Thread Steinar H. Gunderson
Just thought I'd take my EVMS maintainer hat on and try to add some
constructive input to this:

EVMS support in yaird should not be difficult to add for someone who already
knows yaird. Basically, what you need to do is:

 - If root= is not /dev/evms/*, _do not do anything in the initrd_. If you
   do, you _will_ break root mounting for anybody _not_ using root on EVMS.
 - Make sure /dev/ is writable, and mkdir /dev/evms.
 - modprobe -q dm-mapper to load the devmapper module. You might also want
   to modprobe raid0/raid5 if the system in question needs that for /.
 - Run /sbin/evms_activate (from the “evms” package). It will do partition
   discovery and mknod the appropriate devices in /dev/evms.

That's it :-)

/* Steinar */
-- 
Homepage: http://www.sesse.net/



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#335230: [#335230] How to actually support EVMS in an initrd

2005-10-22 Thread Sven Luther
On Sat, Oct 22, 2005 at 09:18:44PM +0200, Steinar H. Gunderson wrote:
 Just thought I'd take my EVMS maintainer hat on and try to add some
 constructive input to this:
 
 EVMS support in yaird should not be difficult to add for someone who already
 knows yaird. Basically, what you need to do is:
 
  - If root= is not /dev/evms/*, _do not do anything in the initrd_. If you
do, you _will_ break root mounting for anybody _not_ using root on EVMS.
  - Make sure /dev/ is writable, and mkdir /dev/evms.
  - modprobe -q dm-mapper to load the devmapper module. You might also want
to modprobe raid0/raid5 if the system in question needs that for /.
  - Run /sbin/evms_activate (from the “evms” package). It will do partition
discovery and mknod the appropriate devices in /dev/evms.
 
 That's it :-)
 
 /* Steinar */

Thanks for providing this info, let's hope it will help bring support of evms
to yaird soonishly :)

Friendly,

Sven Luther




Bug#335230: [#335230] How to actually support EVMS in an initrd

2005-10-22 Thread Marco Amadori
Alle 21:18, sabato 22 ottobre 2005, Steinar H. Gunderson ha scritto:

 EVMS support in yaird should not be difficult to add for someone who
 already knows yaird. Basically, what you need to do is:

We need a perl hacker.

Code speaking, I'm not a perl hacker, too bad, but I understood that, looking 
at yaird coding style a new file EvmsTab.pm should be added to sources that 
does what you are saying. A new function tryEvms should be added to Plan.pm.

  - If root= is not /dev/evms/*, _do not do anything in the initrd_. If you
do, you _will_ break root mounting for anybody _not_ using root on EVMS.

This is done with the should-be-added-line 88 in Plan.pm:

$ok || ($ok = tryEvms ($actions,$device,[$device,@{$working}]));

  - Make sure /dev/ is writable, and mkdir /dev/evms.

Translate this in perl plz :-)

  - modprobe -q dm-mapper to load the devmapper module. You might also want
to modprobe raid0/raid5 if the system in question needs that for /.

the module name is the same as lvm: dm-mod
to query for info on device found in fstab we can use evms_query, it reports 
also the plugins from /lib/evms/version/ that should be copied.

# evms_query info sdc9 #my root partition btw
Name: sdc9
Type: Segment
Data Type: Data
Device Number: 253,17
Size (sectors): 835317
Plugin: DosSegMgr

  - Run /sbin/evms_activate (from the “evms” package). It will do partition
discovery and mknod the appropriate devices in /dev/evms.

First if the root device is /dev/evms/lvm2 also vgchange -a y should be 
launched before that, right?

-- 
ESC:wq



Bug#335230: [#335230] How to actually support EVMS in an initrd

2005-10-22 Thread Steinar H. Gunderson
On Sat, Oct 22, 2005 at 09:47:12PM +0200, Marco Amadori wrote:
  - Make sure /dev/ is writable, and mkdir /dev/evms.
 Translate this in perl plz :-)

Well, the make sure part depends on how yaird works. You may have to mount
a tmpfs over /dev/evms if the initrd is read-only. (This is during _boot_
time, BTW; running /sbin/evms_activate at yaird time will help you nothing.)

  - Run /sbin/evms_activate (from the “evms” package). It will do partition
discovery and mknod the appropriate devices in /dev/evms.
 First if the root device is /dev/evms/lvm2 also vgchange -a y should be 
 launched before that, right?

No, that should not be required. You can use compatibility LVM2 volumes
with EVMS without needing the traditional LVM userspace.

BTW, I'm a bit unsure if critical is the right severity for this bug.

/* Steinar */
-- 
Homepage: http://www.sesse.net/



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#335230: [#335230] How to actually support EVMS in an initrd

2005-10-22 Thread Erik van Konijnenburg
On Sat, Oct 22, 2005 at 09:54:54PM +0200, Steinar H. Gunderson wrote:
 On Sat, Oct 22, 2005 at 09:47:12PM +0200, Marco Amadori wrote:
   - Make sure /dev/ is writable, and mkdir /dev/evms.
  Translate this in perl plz :-)
 
 Well, the make sure part depends on how yaird works. You may have to mount
 a tmpfs over /dev/evms if the initrd is read-only. (This is during _boot_
 time, BTW; running /sbin/evms_activate at yaird time will help you nothing.)

Agreed.

Note: the initramfs generated by yaird has a writable /dev at an
early stage.

As an aside: there will be one case where the tryEvms() function will need
to enable a disk even though root is not evms: the case where swap
is used for swsusp, swap is on evms and root is not.

--erik


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#335230: [#335230] How to actually support EVMS in an initrd

2005-10-22 Thread Sven Luther
On Sat, Oct 22, 2005 at 09:47:12PM +0200, Marco Amadori wrote:
 Alle 21:18, sabato 22 ottobre 2005, Steinar H. Gunderson ha scritto:
 
  EVMS support in yaird should not be difficult to add for someone who
  already knows yaird. Basically, what you need to do is:
 
 We need a perl hacker.

Mattia, maybe you would like to jump in here too ? I hope i am not abusing by
asking you that :)

Friendly,

Sven Luther



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]