Jan Včelák | 9 Aug 2012 10:28
Picon
Favicon
Gravatar

configuration files created by Anaconda exclusively

Hello list,

I would like to know your opinion on the concept of configuration files  
creating exclusively by Anaconda. I will talk about grub (rhbz#830114),
but I mean this in general. I think there are more packages "affected".

I recently switched my BIOS from legacy to EFI mode and therefore needed to 
replace grub by grub2-efi. As I do not like garbage in /etc, I removed all 
grub configuration files (rpm -qca grub\*) before uninstalling the old 
package. Unfortunately /etc/default/grub is just a %shadow file and it is 
created by Anaconda during installation. Not by any grub\* package.

That file is essential for generating grub.cfg. So you have to either dive 
into documentation and guess what options should be there, or dig into 
Anaconda source codes and search for some template. 

I think this concept is not ideal. I believe grub should create it's own 
configuration file and Anaconda should alter it or append own changes.

I want all packages to provider implicit configuration files which can be used 
at least as a template if you delete them (un)intentionally.

Do you have any convincing arguments for/against this idea?

Jan
--

-- 
devel mailing list
devel <at> lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Przemek Klosowski | 9 Aug 2012 16:39
Favicon

Re: configuration files created by Anaconda exclusively

On 08/09/2012 04:28 AM, Jan Včelák wrote:

> I recently switched my BIOS from legacy to EFI mode and therefore needed to
> replace grub by grub2-efi. As I do not like garbage in /etc, I removed all
> grub configuration files (rpm -qca grub\*) before uninstalling the old
> package. Unfortunately /etc/default/grub is just a %shadow file and it is
> created by Anaconda during installation. Not by any grub\* package.

On my BIOS-based F17 that was upgraded from earlier Fedora install, 
/etc/default/grub is owned by the package grub2-tools, so your problem 
appears to be solved moving forward, because grub2 is taking over. I 
think you are saying that old grub-based systems may not register this 
file in any package---but I just checked on a RHEL 5 and 6 series that 
they don't have this file at all. Is it possible that an unconnected 
/etc/default/grub was a transitory thing that appeared briefly sometime 
after F12 and is fixed by F17/grub2?
--

-- 
devel mailing list
devel <at> lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Simone Caronni | 9 Aug 2012 17:23
Picon
Gravatar

Re: configuration files created by Anaconda exclusively

Hello,

On 9 August 2012 16:39, Przemek Klosowski <przemek.klosowski <at> nist.gov> wrote:
> On my BIOS-based F17 that was upgraded from earlier Fedora install,
> /etc/default/grub is owned by the package grub2-tools, so your problem
> appears to be solved moving forward, because grub2 is taking over. I think
> you are saying that old grub-based systems may not register this file in any
> package---but I just checked on a RHEL 5 and 6 series that they don't have
> this file at all. Is it possible that an unconnected /etc/default/grub was a
> transitory thing that appeared briefly sometime after F12 and is fixed by
> F17/grub2?

Well it's kinda different. I had messed up grub files and the only
thing I could do was look at a new installation where the files were
not touched.
There's no way you can get the default config from packages or
sources; only an anaconda install creates the "default" files. The
owner of those files is grub2 and they're both marked as %ghost [1].

%attr(0644,root,root) %ghost %config(noreplace) %{_sysconfdir}/default/grub
%ghost %config(noreplace) /boot/%{name}/grub.cfg

I had messed up configuration files on my laptop because I upgraded
through rawhide in f15 time and then tested Xen [2].
grub2-mkconfig does produce a different grub.cfg config file compared
to the Anaconda's one and the grubby "changes" for installing kernels
produce even different entries for menuentries than the 2 other.

So, making a recap what has happened in my situation:

(Continue reading)

Jan Vcelak | 9 Aug 2012 21:34
Picon
Favicon
Gravatar

Re: configuration files created by Anaconda exclusively

> I offer my help to "improve" the situation by testing or providing
> patches if involved parties would like to.

This is great! I can try to identify other "base" packages with the
same problem. There should not be many.

The question is, what is the best solution. If the configuration file
should be created in the correct location, even with probably
non-functional content which needs some manual changes. Or place a
template file somewhere else, for example into /usr/share/package.
I would be good with both of these solutions.

And we still do not know if'Anaconda people and other involved people
will agree.
--

-- 
devel mailing list
devel <at> lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Adam Williamson | 9 Aug 2012 21:48
Picon
Favicon
Gravatar

Re: configuration files created by Anaconda exclusively

On Thu, 2012-08-09 at 15:34 -0400, Jan Vcelak wrote:
> > I offer my help to "improve" the situation by testing or providing
> > patches if involved parties would like to.
> 
> This is great! I can try to identify other "base" packages with the
> same problem. There should not be many.
> 
> The question is, what is the best solution. If the configuration file
> should be created in the correct location, even with probably
> non-functional content which needs some manual changes. Or place a
> template file somewhere else, for example into /usr/share/package.
> I would be good with both of these solutions.
> 
> And we still do not know if'Anaconda people and other involved people
> will agree.

The reason anaconda writes /etc/default/grub is that it can actually
contain different things depending on the install config. Most notably,
the default timeout can change depending on whether you're installing a
single-boot or dual-boot system; the intent is that the timeout is 0 for
a single-boot system but 5s or 10s or something for dual-boot. I think
this might have broken in recent releases, but it's the intent, at
least.

It also writes different values for serial console installations, and
can configure a bootloader password.

See pyanaconda/bootloader.py , around line 1730 (that's in the f17
branch) - write_defaults(self) .

(Continue reading)

Scott Schmit | 10 Aug 2012 01:45
Picon

Re: configuration files created by Anaconda exclusively

On Thu, Aug 09, 2012 at 12:48:02PM -0700, Adam Williamson wrote:
> The reason anaconda writes /etc/default/grub is that it can actually
> contain different things depending on the install config. Most notably,
> the default timeout can change depending on whether you're installing a
> single-boot or dual-boot system; the intent is that the timeout is 0 for
> a single-boot system but 5s or 10s or something for dual-boot. I think
> this might have broken in recent releases, but it's the intent, at
> least.
> 
> It also writes different values for serial console installations, and
> can configure a bootloader password.
> 
> See pyanaconda/bootloader.py , around line 1730 (that's in the f17
> branch) - write_defaults(self) .

Is there some reason this can't be refactored into a standalone
executable that is included in one of the grub* packages?

-- 
Scott Schmit
Attachment (smime.p7s): application/x-pkcs7-signature, 4104 bytes
--

-- 
devel mailing list
devel <at> lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Jan Vcelak | 9 Aug 2012 21:19
Picon
Favicon
Gravatar

Re: configuration files created by Anaconda exclusively

> On my BIOS-based F17 that was upgraded from earlier Fedora install,
> /etc/default/grub is owned by the package grub2-tools, so your
> problem
> appears to be solved moving forward, because grub2 is taking over.

The file is owned by grub2-tools but marked as %ghost (not %shadow,
sorry). Which means that it need not to be created by the package.

http://www.rpm.org/max-rpm-snapshot/s1-rpm-inside-files-list-directives.html#S3-RPM-INSIDE-FLIST-GHOST-DIRECTIVE
--

-- 
devel mailing list
devel <at> lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Reindl Harald | 9 Aug 2012 16:42
Favicon

Re: configuration files created by Anaconda exclusively


Am 09.08.2012 10:28, schrieb Jan Včelák:
> I recently switched my BIOS from legacy to EFI mode and therefore needed to 
> replace grub by grub2-efi. As I do not like garbage in /etc, I removed all 
> grub configuration files (rpm -qca grub\*) before uninstalling the old 
> package. Unfortunately /etc/default/grub is just a %shadow file and it is 
> created by Anaconda during installation. Not by any grub\* package.

i do not believe this because i upgraded a lot of machines which was
originally installed in 2008 with Fedora 9 via "yum distro-sync"
to F16 and they all have "/etc/default/grub"

--

-- 
devel mailing list
devel <at> lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Jan Vcelak | 9 Aug 2012 21:22
Picon
Favicon
Gravatar

Re: configuration files created by Anaconda exclusively

> > I recently switched my BIOS from legacy to EFI mode and therefore
> > needed to
> > replace grub by grub2-efi. As I do not like garbage in /etc, I
> > removed all
> > grub configuration files (rpm -qca grub\*) before uninstalling the
> > old
> > package. Unfortunately /etc/default/grub is just a %shadow file and
> > it is
> > created by Anaconda during installation. Not by any grub\* package.
> 
> i do not believe this because i upgraded a lot of machines which was
> originally installed in 2008 with Fedora 9 via "yum distro-sync"
> to F16 and they all have "/etc/default/grub"

I deleted it. It is not installed by any grub* pakcage so I cannot
easily recreate it. That's what I do not like.
--

-- 
devel mailing list
devel <at> lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Ian Pilcher | 9 Aug 2012 17:54
Picon

Re: configuration files created by Anaconda exclusively

+1 to Jan's point.  It should be possible to recover a critical file (or
at least a skeleton thereof) by reinstalling the owning RPM.

-- 
========================================================================
Ian Pilcher                                         arequipeno <at> gmail.com
"If you're going to shift my paradigm ... at least buy me dinner first."
========================================================================

--

-- 
devel mailing list
devel <at> lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Gmane