Johnny Hughes
2014-Oct-03 10:57 UTC
[CentOS-virt] Automate running grub-bootxen.sh for kernel installs in Xen4CentOS
We need a way to do two things to /usr/bin/grub-bootxen.sh in Xen4CentOS. 1. Automate running it if xen (the package) and the xen kernel are installed. But only if the user WANTS to run it. 2. Allow users to automatically modify the variables passed into the xen.gz line (that is, more or less memory, add console settings, etc.) If you look at the current script, "--mbargs=dom0_mem=1024M,max:1024M loglvl=all guest_loglvl=all" is hard coded in as the only option for the xen.gz line. While doing that we also still want to preserve the ability to run that kernel in other places than just for xen dom0 setups. Here is how I propose we do that. Currently the /usr/bin/grub-bootxen.sh file is in centos-release-xen ... that is a good place as it allows us to use a different file in different major versions of CentOS (so the file in 7 can be different than the file in 6, but still use the same auxiliary files, etc). So, what we can do is setup a file in /etc/sysconfig/ (probably from the xen package) that we call xen-boot or xen-kernel, etc. In this file we put some variables like these: BOOT_XEN_AS_DEFAULT="yes" XEN_KERNEL_MBARGS="--mbargs=dom0_mem=1024M,max:1024M loglvl=all guest_loglvl=all" Then we look for that file (/etc/sysconfig/xen-boot) as a post-install from the xen kernel. If the file exists, we source it ... an if BOOT_XEN_AS_DEFAULT is yes, and if /usr/bin/grub-bootxen.sh exists we run it passing in XEN_KERNEL_MBARGS as a variable. The user can set BOOT_XEN_AS_DEFAULT to no if they want, so they do not get a xen kernel entry in their grub config. That should mean that if either there is no '/etc/sysconfig/xen-boot' config file OR if '/usr/bin/grub-bootxen.sh' does not exist, we get only the standard kernel entry .. but if they do exist, we also get a user modifiable xen.gz kernel entry as well. Also, we should likely use the centos-release-xen package to handle the '/etc/sysconfig/xen-boot' file as well, since it already has the /usr/bin/grub-bootxen.sh script. Thoughts? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: OpenPGP digital signature URL: <http://lists.centos.org/pipermail/centos-virt/attachments/20141003/a805bad9/attachment-0006.sig>
PJ Welsh
2014-Oct-03 18:09 UTC
[CentOS-virt] Automate running grub-bootxen.sh for kernel installs in Xen4CentOS
Sounds consistent to existing precedence (like selinux). Thanks! PJ On Fri, Oct 3, 2014 at 5:57 AM, Johnny Hughes <johnny at centos.org> wrote:> We need a way to do two things to /usr/bin/grub-bootxen.sh in Xen4CentOS. > > 1. Automate running it if xen (the package) and the xen kernel are > installed. But only if the user WANTS to run it. > > 2. Allow users to automatically modify the variables passed into the > xen.gz line (that is, more or less memory, add console settings, etc.) > If you look at the current script, "--mbargs=dom0_mem=1024M,max:1024M > loglvl=all guest_loglvl=all" is hard coded in as the only option for the > xen.gz line. > > While doing that we also still want to preserve the ability to run that > kernel in other places than just for xen dom0 setups. > > Here is how I propose we do that. > > Currently the /usr/bin/grub-bootxen.sh file is in centos-release-xen ... > that is a good place as it allows us to use a different file in > different major versions of CentOS (so the file in 7 can be different > than the file in 6, but still use the same auxiliary files, etc). > > So, what we can do is setup a file in /etc/sysconfig/ (probably from the > xen package) that we call xen-boot or xen-kernel, etc. In this file we > put some variables like these: > > BOOT_XEN_AS_DEFAULT="yes" > > XEN_KERNEL_MBARGS="--mbargs=dom0_mem=1024M,max:1024M loglvl=all > guest_loglvl=all" > > Then we look for that file (/etc/sysconfig/xen-boot) as a post-install > from the xen kernel. If the file exists, we source it ... an if > BOOT_XEN_AS_DEFAULT is yes, and if /usr/bin/grub-bootxen.sh exists we > run it passing in XEN_KERNEL_MBARGS as a variable. > > The user can set BOOT_XEN_AS_DEFAULT to no if they want, so they do not > get a xen kernel entry in their grub config. > > That should mean that if either there is no '/etc/sysconfig/xen-boot' > config file OR if '/usr/bin/grub-bootxen.sh' does not exist, we get only > the standard kernel entry .. but if they do exist, we also get a user > modifiable xen.gz kernel entry as well. > > Also, we should likely use the centos-release-xen package to handle the > '/etc/sysconfig/xen-boot' file as well, since it already has the > /usr/bin/grub-bootxen.sh script. > > Thoughts? > > > > > _______________________________________________ > CentOS-virt mailing list > CentOS-virt at centos.org > http://lists.centos.org/mailman/listinfo/centos-virt > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos-virt/attachments/20141003/accabe91/attachment-0006.html>
George Dunlap
2014-Oct-09 09:46 UTC
[CentOS-virt] Automate running grub-bootxen.sh for kernel installs in Xen4CentOS
On Fri, Oct 3, 2014 at 11:57 AM, Johnny Hughes <johnny at centos.org> wrote:> We need a way to do two things to /usr/bin/grub-bootxen.sh in Xen4CentOS. > > 1. Automate running it if xen (the package) and the xen kernel are > installed. But only if the user WANTS to run it. > > 2. Allow users to automatically modify the variables passed into the > xen.gz line (that is, more or less memory, add console settings, etc.) > If you look at the current script, "--mbargs=dom0_mem=1024M,max:1024M > loglvl=all guest_loglvl=all" is hard coded in as the only option for the > xen.gz line. > > While doing that we also still want to preserve the ability to run that > kernel in other places than just for xen dom0 setups. > > Here is how I propose we do that. > > Currently the /usr/bin/grub-bootxen.sh file is in centos-release-xen ... > that is a good place as it allows us to use a different file in > different major versions of CentOS (so the file in 7 can be different > than the file in 6, but still use the same auxiliary files, etc). > > So, what we can do is setup a file in /etc/sysconfig/ (probably from the > xen package) that we call xen-boot or xen-kernel, etc. In this file we > put some variables like these: > > BOOT_XEN_AS_DEFAULT="yes" > > XEN_KERNEL_MBARGS="--mbargs=dom0_mem=1024M,max:1024M loglvl=all > guest_loglvl=all" > > Then we look for that file (/etc/sysconfig/xen-boot) as a post-install > from the xen kernel. If the file exists, we source it ... an if > BOOT_XEN_AS_DEFAULT is yes, and if /usr/bin/grub-bootxen.sh exists we > run it passing in XEN_KERNEL_MBARGS as a variable. > > The user can set BOOT_XEN_AS_DEFAULT to no if they want, so they do not > get a xen kernel entry in their grub config. > > That should mean that if either there is no '/etc/sysconfig/xen-boot' > config file OR if '/usr/bin/grub-bootxen.sh' does not exist, we get only > the standard kernel entry .. but if they do exist, we also get a user > modifiable xen.gz kernel entry as well. > > Also, we should likely use the centos-release-xen package to handle the > '/etc/sysconfig/xen-boot' file as well, since it already has the > /usr/bin/grub-bootxen.sh script. > > Thoughts?This sounds reasonable to me. One thing we also need to do is to make sure that when we *remove* xen, that these grub entries are removed as well. -George