Re: mondorestore command not found

Bruno Cornec <[email protected]>
Newsgroups gmane.linux.mondo.devel
Message-ID <[email protected]>
Hello Stanislav,

Sorry to come back that late, I've been way too busy before :-(

Stanislav Tokoš said on Fri, Aug 18, 2017 at 01:45:03PM +0200:
>>Bruno Cornec said on Fri, Aug 18, 2017 at 12:06:19PM +0200:
>>I'm still looking at your patch on mr-make-me-bootable, which I'm 
>>not sure to understand. Could you explain to me the issue you 
>>encountered and the rationale of the fix please ?
>Sure.
>
>1. We don't need for cycling. Boot partition for each machine is only  one.
>-       for p in "$activepart"; do
>-               # First desactivate active partitions (coming from 
>previous usage)

In fact, I've seen cases where multiple lines were tagged as bootable. I know this should not arrive, but that did arrive (even to me) so the loop is there to avoid that.
So as I don't think it hurts, I'd prefer to keep it as a safety.

>2. echo -en "${cmd}a\n$partno\np\nw\n" is replaced by echo -en 
>"a\n$partno\nw\n"
>This command is same for mark or unmark boot partition. For that 
>reason I removed
>cmd variable and piping to mr-parted2fdisk two times. It is the 
>easiest for debugging and
>working for the each test case scenario without problem. I have 
>already test it.

I think that the fact we need to mmaintain the previous lines changes the logic here as well.
Also in your patch I see:
+    if [ "$activepart" != "" ] ; then
+        erase_partno=`echo $activepart | sed -e 's/^.*[^0-9]\([0-9]*\)$/\1/'`
+       echo -en "a\n$erase_partno\nw\n" | mr-parted2fdisk $drive >> $LOGFILE 2>> $LOGFILE

You can't assume that the partiion format is ^.*[^0-9]\([0-9]*\)$
Some devices are /dev/cciss/c0d0p1 e.g. that would fail here.

>3. added condition for missing $dummy variable
>
>+    elif [ ! "$dummy" ] ; then
>+       echo -en "a\n$partno\nw\n" | mr-parted2fdisk $drive >> 
>$LOGFILE 2>> $LOGFILE

That test is in my code currently.
Also the goal was to have a single call to mr-parted2fdisk to try to do everyting in one operation.
And again I'm not sure this patch fixes something that the current code doesn't handle correctly, but if you have a use case, I'd like to have it !

>PS: What about svn access? Is it possible access it? I am not able 
>checkout it. Thanks for your

Can you try:
http://trac.mondorescue.org/wiki/ContributingToMondoRescue and let me know if that doesn't work ? It's working for me.

Best regards,
Bruno.
-- 
HPE EMEA EG FLOSS Technology Strategist http://www.hpe.com/engage/opensource
Open Source Profession, WW Linux Community Lead    http://github.com/bcornec   
FLOSS projects:    http://mondorescue.org         http://project-builder.org
Musique ancienne?   http://www.musique-ancienne.org  http://www.medieval.org

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.