Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requesting support for grub 'module' statements #10

Closed
trevor-vaughan opened this issue Sep 3, 2015 · 4 comments
Closed

Requesting support for grub 'module' statements #10

trevor-vaughan opened this issue Sep 3, 2015 · 4 comments
Labels
enhancement New feature or request

Comments

@trevor-vaughan
Copy link
Contributor

First, thanks for providing this module, it has been quite useful.

We're pushing forward with using trusted boot in grub and now find ourselves in need of the 'module' portion of the grub configuration.

An example of this usage can be found at https://fedoraproject.org/wiki/Features/Trusted_Boot.

As far as I can tell, the kernel line detection needs to go from just a kernel line to a kernel line followed by a module (somewhere) that contains the kernel specification line.

@raphink raphink added the enhancement New feature or request label Sep 8, 2015
@raphink
Copy link
Member

raphink commented Sep 8, 2015

@trevor-vaughan what kind of Puppet code would you expect to write, and what kind of changes should that produce (ideally in the Augeas tree)?

@trevor-vaughan
Copy link
Contributor Author

That's a really good question.

I suppose that I would really like management of the 80% of the grub.conf stack since right now it's either use the 'kernel_parameter' type or just hack something together by hand.

Globals

  • default
  • timeout
  • password
  • fallback

Perhaps these could be a grub_config type?

grub_config { 'default':  value => 0 }
grub_config { 'timeout': value => 10 }
grub_config { 'password': value => $1$stuff... }
grub_config { 'fallback': value => [1] }

Individual entries (title being $name):

  • kernel + options
    ** module + module....
  • initrd
  • chainloader
  • root/rootnoverify

In theory, this could be a 'grub_entry' type that has all available options and ignores the ones that are not specified.

grub_entry { 'default':
  # Make this the fallback
  order => 1,
  root => 'hd(0,0)',
  kernel => '/boot/vmlinuz',
  kernel_options => ['stuff', 'and', 'things']
  initrd => '/boot/initrd'
}
grub_entry { 'tboot':
  # Make this the default
  order => 0,
  root => 'hd(0,0)',
  kernel => '/boot/tboot.tgz',
  modules => {
     '/boot/vmlinuz' => ['option1','option2','option3'],
    '/boot/initrd' => ['option1','option2','option3']
  }

Thinking about the Augeas Tree (not my strong suit) it would probably go something like this:

/boot/grub/grub.conf/
  /password=[String]
  /default=[Integer]
  /timeout=[Integer]
  /entry[*]/
    /title=[String]
   /root=[String] (or rootnoverify)
   /kernel=[String]
     /option[*]=[String]
   /module[*]
      /name=[String]
     /option[*]=[String]
   /initrd=[String] (Can't be present if modules are defined)
   /chainloader=[String]

Of course, you'd also want to make sure that this can either be additive (add options, etc...) or authoritative (nuke the entire segment and replace it).

The issue is the magic that's done by the RPMs and when installing the new grub entries. Might have to pick apart the kernel installer scripts to see how they're doing what they're doing. It may be as simple as a fallback or copy the entities on the last entry.

I would also suggest letting the user always have a fallback of the stock system kernel. So, when you set the initial entry, take that one and make sure it's automatically at the tail of the fallback list just in case. This should be able to be disabled for those users that like to live on the edge/have strict policies about boot capabilities.

@raphink
Copy link
Member

raphink commented Sep 9, 2015

So a new type altogether. Your examples only mention Grub 1 configuration. How would this map to Grub 2 (which I personally wish never existed ;-))?

@trevor-vaughan
Copy link
Contributor Author

Unfortunately, it wouldn't map to grub2.

This actually should be easier since you only need to mess about with /etc/default/grub.

There are, however, a stupid number of options that appear to be able to go into that file. And, of course, there is the 40_custom rule set.

This applies to RHEL-based systems, I'm not sure about the others. That may be the true issue.

And, of course, you'll have to run the grub2-mkconfig script after editing all files.

trevor-vaughan added a commit to trevor-vaughan/augeasproviders_grub that referenced this issue Feb 24, 2016
This patch adds support for grub_menuentry which provides the ability to
manage individual Menu entries for both GRUB Legacy and GRUB2.

Testing has been focused on Linux-based operating systems and it is
possible that features may be missing for chainloaded operating systems.

Support for managing GRUB2 users has also been added. This compares
against the *running* configuration, not what is saved in the
compilation files in grub.d.

The following custom types were created:
  * grub_config => Manages global GRUB settings
  * grub_menuentry => Manages GRUB menuentries
  * grub_user => Manages GRUB2 users

Fixes voxpupuli#10
trevor-vaughan added a commit to trevor-vaughan/augeasproviders_grub that referenced this issue Feb 24, 2016
This patch adds support for grub_menuentry which provides the ability to
manage individual Menu entries for both GRUB Legacy and GRUB2.

Testing has been focused on Linux-based operating systems and it is
possible that features may be missing for chainloaded operating systems.

Support for managing GRUB2 users has also been added. This compares
against the *running* configuration, not what is saved in the
compilation files in grub.d.

The following custom types were created:
  * grub_config => Manages global GRUB settings
  * grub_menuentry => Manages GRUB menuentries
  * grub_user => Manages GRUB2 users

Fixes voxpupuli#10
trevor-vaughan added a commit to trevor-vaughan/augeasproviders_grub that referenced this issue Feb 25, 2016
This patch adds support for grub_menuentry which provides the ability to
manage individual Menu entries for both GRUB Legacy and GRUB2.

Testing has been focused on Linux-based operating systems and it is
possible that features may be missing for chainloaded operating systems.

Support for managing GRUB2 users has also been added. This compares
against the *running* configuration, not what is saved in the
compilation files in grub.d.

The following custom types were created:
  * grub_config => Manages global GRUB settings
  * grub_menuentry => Manages GRUB menuentries
  * grub_user => Manages GRUB2 users

Fixes voxpupuli#10
trevor-vaughan added a commit to trevor-vaughan/augeasproviders_grub that referenced this issue Mar 3, 2016
This patch adds support for grub_menuentry which provides the ability to
manage individual Menu entries for both GRUB Legacy and GRUB2.

Testing has been focused on Linux-based operating systems and it is
possible that features may be missing for chainloaded operating systems.

Support for managing GRUB2 users has also been added. This compares
against the *running* configuration, not what is saved in the
compilation files in grub.d.

The following custom types were created:
  * grub_config => Manages global GRUB settings
  * grub_menuentry => Manages GRUB menuentries
  * grub_user => Manages GRUB2 users

Fixes voxpupuli#10
trevor-vaughan added a commit to trevor-vaughan/augeasproviders_grub that referenced this issue Mar 3, 2016
This patch adds support for grub_menuentry which provides the ability to
manage individual Menu entries for both GRUB Legacy and GRUB2.

Testing has been focused on Linux-based operating systems and it is
possible that features may be missing for chainloaded operating systems.

Support for managing GRUB2 users has also been added. This compares
against the *running* configuration, not what is saved in the
compilation files in grub.d.

The following custom types were created:
  * grub_config => Manages global GRUB settings
  * grub_menuentry => Manages GRUB menuentries
  * grub_user => Manages GRUB2 users

Fixes voxpupuli#10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants