tinkerbell / actions

Suite of Tinkerbell Actions for use in Tinkerbell Workflows
Apache License 2.0
28 stars 43 forks source link

cexec: mount sysfs inside the chroot. #83

Closed vilkaspilkas closed 2 years ago

vilkaspilkas commented 2 years ago

Description

Mount sysfs inside the chroot

Why is this needed

Fixes: #82

How Has This Been Tested?

Locally. Before the change:

INFO[0000] Changing root before executing command
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Unknown device "/dev/sda2": No such device
Unknown device "/dev/sda1": No such device
Unknown device "/dev/sda1": No such device
Unknown device "/dev/sda2": No such device

....
Found linux image: /boot/vmlinuz-5.4.0-99-generic
Found initrd image: /boot/initrd.img-5.4.0-99-generic
...

Unknown device "/dev/sda2": No such device
Unknown device "/dev/sda3": No such device
Unknown device "/dev/sda2": No such device
Unknown device "/dev/sda2": No such device
Cannot find list of partitions!  (Try mounting /sys.)
done

With the change:

INFO[0000] Changing root before executing command
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-99-generic
Found initrd image: /boot/initrd.img-5.4.0-99-generic
done

How are existing users impacted? What migration steps/scripts do we need?

Shouldn't have any impact on the existing users.

Checklist:

I have: