Bug 151501

Summary: cloning the bootloader does not work
Product: [openSUSE] SUSE Linux 10.1 Reporter: Uwe Gansert <ug>
Component: AutoYaSTAssignee: Uwe Gansert <ug>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Critical    
Priority: P5 - None CC: aj, bugproxy, jsrain, kukuk, stefan.fent
Version: Beta 3.5internal   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: y2log file

Description Uwe Gansert 2006-02-16 14:21:11 UTC
If I create a reference profile with autoyast ("yast2 autoyast" -> Tools -> create Reference Profile), in the bootloader section of the resulting profile, "active" is set to: <active...>false</active>.
With that configuration I can't boot the installed system. If I set that to true and do an installation, then everything is fine.
I'll attach a y2log
Comment 1 Uwe Gansert 2006-02-16 14:23:13 UTC
Created attachment 68842 [details]
y2log file
Comment 2 Uwe Gansert 2006-03-02 14:59:39 UTC
just for information. If we don't fix that, we can't keep the "cloning at the end of a manual installation" feature.

I don't know how important that is for SL10.1 but I think it's a blocker for SLES.

Comment 3 Thorsten Kukuk 2006-03-02 15:08:42 UTC
Higher Severity, it is very important for SLES.
Comment 4 Stefan Fent 2006-03-03 09:18:35 UTC
Uwe, do you mean this part:

[...]
<bootloader>
    <activate config:type="boolean">false</activate>
    <global>
[...]

right?
(I'm not really common with autoYaST)
Comment 5 Stefan Fent 2006-03-03 09:25:33 UTC
The autoyast documentation doesn't even mention this tag, so I'm guessing this is to activate the bootloader partition?
Comment 6 Uwe Gansert 2006-03-03 09:35:29 UTC
yes, that's the tag that I mean. I don't know what that tag is doing. I can't know all tags of all yast modules. That would make me an expert on nearly everything yast can configure :) The yast module developer should know what that tag is for.

Comment 7 Stefan Fent 2006-03-08 16:31:12 UTC
Philipp, here is what I found out so far:
YaST2 autoyast apparently executes completely differntn code than yast2 bootloader does. yast2 bootloader uses a lot of Storage:: code which yast2 autoyast doesn't.
Therefore, bootloader device is nil as well.
Comment 8 Philipp Thomas 2006-03-14 15:43:52 UTC
The "bootloader device nil" is gone. But there is a different bug here that's not
autoyast specific but seems to be a generic bootloader bug.
Comment 9 Joachim Plack 2006-03-14 16:27:51 UTC
activate is not set, because device-map is nil in the autoyast case.
looks like there might be a problem in perl-Bootloader getDeviceMap
Look into Core/GRUB.pm.

Also default section is not read properly in my test case here.

Does Bootloader::ReadOrProposeIfNeeded() work right?
Comment 10 Uwe Gansert 2006-03-21 09:16:41 UTC
*** Bug 159570 has been marked as a duplicate of this bug. ***
Comment 11 Andreas Jaeger 2006-04-04 07:59:30 UTC
Any progress here?
Comment 12 Philipp Thomas 2006-04-04 09:28:10 UTC
Yes, but not nearly enough.
Comment 13 Olaf Dabrunz 2006-04-07 19:44:19 UTC
od and pth:

When we started "yast2 bootloader" and looked at the state of the "Activating
Bootloader Partition" checkbox, it was left unchecked.

The root problem here is that yast2 does not store the state of all user
selections. In the case of grub, there is no "activate" flag to store in the
menu.lst file. So yast2-bootloader has no way to find out that "activate" is
wanted, unless the user tells him by checking the checkbox.

So this works for lilo (which knows the "activate" flag), but does not work for
grub.

So either
    - we find a good place where yast2-bootloader can store and retrieve the
      state of the activate flag for the grub case, or 
    - we find out how to come to a better proposal for the "activate" flag when
      autoyast is collecting information from yast2-bootloader.


One way to remember this may be a comment in menu.lst:

# YaST2 stored user setting: activate

We then could decide when this flag will be honoured: everytime or only for
autoyast.

We need someone to help us decide this.
Comment 14 Uwe Gansert 2006-04-10 08:28:07 UTC
I don't know too much about that stuff but is there really no way to read the information from the running system?
"fdisk -l" for example shows the activated partition. 

Comment 15 Stefan Fent 2006-04-10 08:58:03 UTC
Why not use the information provided by getTargetMap? it tells wether a partition has a bootable flag or not.
Comment 16 Olaf Dabrunz 2006-04-10 12:13:58 UTC
To answer the question in the two previous comments first:

The activate flag tells yast2-bootloader (and lilo) to activate the boot
partition device (whatever device this may be).

It is impossible to find out from the disk only whether the user wanted the
activate flag to be changed or not. lilo.conf contains the flag, menu.lst
does not.


But after sleeping a few nights (during weekend) over this, I realized that
the real problem here is somthing different:

The yast2-bootloader code has been changed for 9.1 to return a configuration
to autoyast that is compatible with a different disk setup on the target
system which will be installed with the resulting autoyast.xml:

-------------------------------------------------------------------
Thu May 27 16:35:45 CEST 2004 - jsrain@suse.cz

- don't display device name if user selected to activate boot
  loader partition ot replace MBR with generic code when preparing
  AutoYaST  profile, as the device names aren't known (#41258)
- [...]

-------------------------------------------------------------------

and

-------------------------------------------------------------------
Tue Feb  4 13:50:29 CET 2003 - jsrain@suse.de

- updates of autoinstallation

-------------------------------------------------------------------


Originally, autoyast was used to
    a) collect setup information from the current system
    b) display this to the user and let him edit the information
    c) apply this setup to the target system during installation.


The target system could be quite different from the system used to collect
the setup information. This means that the disk setup (bootloader device,
activate flag, probably also partitioning) could not be used on the target
system. In effect, the user would have to provide this information manually
in step b) above.

Thus, with the changes documented in the changelog entries above, the
information about the bootloader device and other disk-specific information
was filtered out or not even collected from the disk anymore.

For the new "Clone system" functionality, the expectations are different:

    - the target system is expected to be very similar or (almost) identical
      to the original system
    - autoyast is expected to provide a copy of the configuration of the
      original system, rather then a more or less rough template.


We would need to find out what kind of configuration information
yast2-bootloader is supposed to return to autoyast.

I would suggest to provide an additional flag to the rest of yast that
specifies more exactly whether autoyast wants a

    - malleable setup information template or a
    - clone of the setup information.

The parts of yast who need to base decisions on this information could then
evaluate this flag.

Adding visnov and jsrain to Cc.

jsrain, ug - does this make sense to you and sound OK from your experience and
             from the technical stuff?

visnov, sf, ... - any comments & how/where/who does this in yast?
Comment 17 Olaf Dabrunz 2006-04-10 12:18:09 UTC
ug, it would be good if you could provide feature ids, so we could check
what is really requested of us.
Comment 18 Uwe Gansert 2006-04-10 12:53:59 UTC
the feature id is #264

About the cloning. From my point of view, the reference profile should be as close as possible to the currently installed system. For example, the cloning of the partitioning was so close to the current system, that even the cylinder borders were cloned (I changed that, because I think it's too strict and useless but it was invented that way). So the idea of the autoyast reference profile has always been "create a profile, that makes it possible to install THIS machine again without user interaction". If the user wants to use that profile to install a different machine, he should take care that he changes the stuff that must be changed (partition sizes for example).

Even if you would say "we don't know if the user wants to activate the boot partition" the yast2-bootloader behaves wrong, because it explicitly says "false" to the activate flag. It says "don't activate it".

I read the changelog entry and if the bootloader can autodetect stuff during the installation by itself, then it might be okay not to provide that information in the cloned autoyast profile at all but in this case the information in the profile is simply wrong.

Comment 19 Olaf Dabrunz 2006-04-11 14:40:59 UTC
yast2-bootloader will now pass the activate flag and the loader_device to
AutoYaST after reading the information from the disk.

The activate flag may still be a problem in one case: it will be "false"
when the bootloader is in MBR and some partition is already activated.

Does it make sense to leave it like that or should the activate flag
_always_ be set to "true"?
Comment 20 Uwe Gansert 2006-04-11 14:58:32 UTC
@Olaf
since we just talked about that, you already know that I think this solution is fine. :)
Thanx.

Comment 21 Olaf Dabrunz 2006-04-11 15:23:25 UTC
The fix is in yast2-bootloader-2.13.43.

Please test.
Comment 22 Uwe Gansert 2006-04-12 12:17:24 UTC
*** Bug 165459 has been marked as a duplicate of this bug. ***
Comment 23 Olaf Dabrunz 2006-04-12 12:36:43 UTC
*** Bug 164586 has been marked as a duplicate of this bug. ***
Comment 24 LTC BugProxy 2006-04-19 17:30:03 UTC
----- Additional Comments From ameet@us.ibm.com(prefers email via ameet@austin.ibm.com)  2006-04-19 13:25 EDT -------
SuSE,

This is still failing for us on SLES10 beta 10.  The YaST logs are in Novell 164586. 
Comment 25 LTC BugProxy 2006-04-20 06:50:42 UTC
Olaf - doesn't appear to be fixed in beta10.
Comment 26 Stefan Fent 2006-04-20 12:35:54 UTC
First, the second part of bug #164586 >= comment #12 is a different problem:
Grub finds everything needed, and starts the kernel.
But the root=/dev/hda5 is wrong.
Where does it come from? did you change the partitioning in the xml-file?
If yes, you _have_ to change this as well.

Not activating a partition is correct in this case, as grub is written to MBR,
as it can't be booted from a extended partition.
And this is done, as the kernel is started.


 
Comment 27 Uwe Gansert 2006-04-20 13:08:37 UTC
Which info do you need from me?
Comment 28 Stefan Fent 2006-04-20 13:36:27 UTC
Sorry, I meant Glen...
Comment 29 LTC BugProxy 2006-04-27 11:29:58 UTC
----- Additional Comments From zhanx@cn.ibm.com  2006-04-27 07:24 EDT -------
Could anyone let me know when this defect will be fixed? Thank you. 
Comment 30 LTC BugProxy 2006-04-28 02:16:09 UTC
------- Additional Comments From hanpt@cn.ibm.com  2006-04-27 21:54 EDT -------
(In reply to comment #26)
> Ping,
> 
> SuSE is looking for an answer to these questions in comment #22:
> 
> But the root=/dev/hda5 is wrong.
> Where does it come from? did you change the partitioning in the xml-file?
> If yes, you _have_ to change this as well.
We use the xml-file generated by manually install. It seems that the
"roo=/dev/hda5" is generated by the autoyast itself. We hadn't modified the
xml-file anymore. 
Comment 31 LTC BugProxy 2006-04-28 18:11:38 UTC
I think all the info is provided, right?  The autoyast file is attached.
Comment 32 LTC BugProxy 2006-04-28 18:12:37 UTC
And this got bumped one slot to blocker on the LTC side.
Comment 33 Andreas Jaeger 2006-05-02 12:07:38 UTC
Glen, the original problem is fixed.  I consider your bug a different issue and I do not consider this a blocker for SUSE Linux 10.1.

If you disagree with the non-blocker, file a new bug against SLES10, but this bug will be CRITICAL only.
Comment 34 Stefan Fent 2006-05-04 12:54:47 UTC
Finally found the problem, and reproduced it: 
Your setup:
/dev/hda1 swap
/dev/hda2 extended partition
/dev/hda5 /

autoyast changes this to:
/dev/hda1 swap
/dev/hda2 /

With root=/dev/hda5 in the bootloader configuration, the kernel doesn't find the 
root filesystem.

So this is a autoyast partitioning problem.



Comment 35 Stefan Fent 2006-05-04 13:36:56 UTC
Uwe, your fix in the autoyast.xml did the trick, works now.
Comment 36 Uwe Gansert 2006-05-04 13:45:35 UTC
fixed (#170597)