Merge "Use sh instead of bash when installing grub"
This commit is contained in:
commit
7680625994
@ -112,7 +112,7 @@ def _install_grub2(device, root_uuid, efi_system_part_uuid=None):
|
|||||||
path_variable = '%s:/bin' % path_variable
|
path_variable = '%s:/bin' % path_variable
|
||||||
|
|
||||||
# Install grub
|
# Install grub
|
||||||
utils.execute('chroot %(path)s /bin/bash -c '
|
utils.execute('chroot %(path)s /bin/sh -c '
|
||||||
'"/usr/sbin/%(bin)s-install %(dev)s"' %
|
'"/usr/sbin/%(bin)s-install %(dev)s"' %
|
||||||
{'path': path, 'bin': binary_name, 'dev': device},
|
{'path': path, 'bin': binary_name, 'dev': device},
|
||||||
shell=True, env_variables={'PATH': path_variable})
|
shell=True, env_variables={'PATH': path_variable})
|
||||||
@ -125,13 +125,13 @@ def _install_grub2(device, root_uuid, efi_system_part_uuid=None):
|
|||||||
# the default file to be copied, destination file name, and
|
# the default file to be copied, destination file name, and
|
||||||
# prevents NVRAM from being updated.
|
# prevents NVRAM from being updated.
|
||||||
if efi_partition:
|
if efi_partition:
|
||||||
utils.execute('chroot %(path)s /bin/bash -c '
|
utils.execute('chroot %(path)s /bin/sh -c '
|
||||||
'"/usr/sbin/%(bin)s-install %(dev)s --removable"' %
|
'"/usr/sbin/%(bin)s-install %(dev)s --removable"' %
|
||||||
{'path': path, 'bin': binary_name, 'dev': device},
|
{'path': path, 'bin': binary_name, 'dev': device},
|
||||||
shell=True, env_variables={'PATH': path_variable})
|
shell=True, env_variables={'PATH': path_variable})
|
||||||
|
|
||||||
# Generate the grub configuration file
|
# Generate the grub configuration file
|
||||||
utils.execute('chroot %(path)s /bin/bash -c '
|
utils.execute('chroot %(path)s /bin/sh -c '
|
||||||
'"/usr/sbin/%(bin)s-mkconfig -o '
|
'"/usr/sbin/%(bin)s-mkconfig -o '
|
||||||
'/boot/%(bin)s/grub.cfg"' %
|
'/boot/%(bin)s/grub.cfg"' %
|
||||||
{'path': path, 'bin': binary_name}, shell=True,
|
{'path': path, 'bin': binary_name}, shell=True,
|
||||||
|
@ -86,11 +86,11 @@ class TestImageExtension(test_base.BaseTestCase):
|
|||||||
self.fake_dir + '/proc'),
|
self.fake_dir + '/proc'),
|
||||||
mock.call('mount', '-t', 'sysfs', 'none',
|
mock.call('mount', '-t', 'sysfs', 'none',
|
||||||
self.fake_dir + '/sys'),
|
self.fake_dir + '/sys'),
|
||||||
mock.call(('chroot %s /bin/bash -c '
|
mock.call(('chroot %s /bin/sh -c '
|
||||||
'"/usr/sbin/grub-install %s"' %
|
'"/usr/sbin/grub-install %s"' %
|
||||||
(self.fake_dir, self.fake_dev)), shell=True,
|
(self.fake_dir, self.fake_dev)), shell=True,
|
||||||
env_variables={'PATH': '/sbin:/bin'}),
|
env_variables={'PATH': '/sbin:/bin'}),
|
||||||
mock.call(('chroot %s /bin/bash -c '
|
mock.call(('chroot %s /bin/sh -c '
|
||||||
'"/usr/sbin/grub-mkconfig -o '
|
'"/usr/sbin/grub-mkconfig -o '
|
||||||
'/boot/grub/grub.cfg"' % self.fake_dir),
|
'/boot/grub/grub.cfg"' % self.fake_dir),
|
||||||
shell=True,
|
shell=True,
|
||||||
@ -131,15 +131,15 @@ class TestImageExtension(test_base.BaseTestCase):
|
|||||||
self.fake_dir + '/sys'),
|
self.fake_dir + '/sys'),
|
||||||
mock.call('mount', self.fake_efi_system_part,
|
mock.call('mount', self.fake_efi_system_part,
|
||||||
self.fake_dir + '/boot/efi'),
|
self.fake_dir + '/boot/efi'),
|
||||||
mock.call(('chroot %s /bin/bash -c '
|
mock.call(('chroot %s /bin/sh -c '
|
||||||
'"/usr/sbin/grub-install %s"' %
|
'"/usr/sbin/grub-install %s"' %
|
||||||
(self.fake_dir, self.fake_dev)), shell=True,
|
(self.fake_dir, self.fake_dev)), shell=True,
|
||||||
env_variables={'PATH': '/sbin:/bin'}),
|
env_variables={'PATH': '/sbin:/bin'}),
|
||||||
mock.call(('chroot %s /bin/bash -c '
|
mock.call(('chroot %s /bin/sh -c '
|
||||||
'"/usr/sbin/grub-install %s --removable"' %
|
'"/usr/sbin/grub-install %s --removable"' %
|
||||||
(self.fake_dir, self.fake_dev)), shell=True,
|
(self.fake_dir, self.fake_dev)), shell=True,
|
||||||
env_variables={'PATH': '/sbin:/bin'}),
|
env_variables={'PATH': '/sbin:/bin'}),
|
||||||
mock.call(('chroot %s /bin/bash -c '
|
mock.call(('chroot %s /bin/sh -c '
|
||||||
'"/usr/sbin/grub-mkconfig -o '
|
'"/usr/sbin/grub-mkconfig -o '
|
||||||
'/boot/grub/grub.cfg"' % self.fake_dir),
|
'/boot/grub/grub.cfg"' % self.fake_dir),
|
||||||
shell=True,
|
shell=True,
|
||||||
@ -191,15 +191,15 @@ class TestImageExtension(test_base.BaseTestCase):
|
|||||||
self.fake_dir + '/sys'),
|
self.fake_dir + '/sys'),
|
||||||
mock.call('mount', self.fake_efi_system_part,
|
mock.call('mount', self.fake_efi_system_part,
|
||||||
self.fake_dir + '/boot/efi'),
|
self.fake_dir + '/boot/efi'),
|
||||||
mock.call(('chroot %s /bin/bash -c '
|
mock.call(('chroot %s /bin/sh -c '
|
||||||
'"/usr/sbin/grub-install %s"' %
|
'"/usr/sbin/grub-install %s"' %
|
||||||
(self.fake_dir, self.fake_dev)), shell=True,
|
(self.fake_dir, self.fake_dev)), shell=True,
|
||||||
env_variables={'PATH': '/sbin:/bin'}),
|
env_variables={'PATH': '/sbin:/bin'}),
|
||||||
mock.call(('chroot %s /bin/bash -c '
|
mock.call(('chroot %s /bin/sh -c '
|
||||||
'"/usr/sbin/grub-install %s --removable"' %
|
'"/usr/sbin/grub-install %s --removable"' %
|
||||||
(self.fake_dir, self.fake_dev)), shell=True,
|
(self.fake_dir, self.fake_dev)), shell=True,
|
||||||
env_variables={'PATH': '/sbin:/bin'}),
|
env_variables={'PATH': '/sbin:/bin'}),
|
||||||
mock.call(('chroot %s /bin/bash -c '
|
mock.call(('chroot %s /bin/sh -c '
|
||||||
'"/usr/sbin/grub-mkconfig -o '
|
'"/usr/sbin/grub-mkconfig -o '
|
||||||
'/boot/grub/grub.cfg"' % self.fake_dir),
|
'/boot/grub/grub.cfg"' % self.fake_dir),
|
||||||
shell=True,
|
shell=True,
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Ironic Python Agent no longer requires 'bash' to be present in the user
|
||||||
|
image when preparing the partition image for local boot,
|
||||||
|
and uses default 'sh' interpreter to run 'grub'-related commands instead.
|
Loading…
Reference in New Issue
Block a user