<div dir="ltr">Hi,<div><br></div><div>I'm using libguestfs 1.42,</div><div><br></div><div>When I run the following python3 commands on a rhel7.8:</div><div><br></div><div>print(<a href="http://g.ls">g.ls</a>('/sys'))<br>print(g.sh('ls /sys'))<br></div><div><br></div><div>I get:</div><div><br></div><div>[]<br>block<br>bus<br>class<br>dev<br>devices<br>firmware<br>fs<br>hypervisor<br>kernel<br>module<br>power<br></div><div><br></div><div>It seems that <a href="http://g.ls">g.ls</a>('/sys') is chrooted correctly.</div><div>But g.sh('ls /sys') isn't.</div><div><br></div><div>I came across this behavior when I used g.command(['grub2-mkconfig', '-o', '....']) on rhel7.8 and it didn't produce the correct linuxefi/initrdefi entries in grub, since in rhel7.8 the uefi detection algorithm is checking in bash '[ -d /sys/firmware/efi ]'.</div><div><a href="https://src.fedoraproject.org/rpms/grub2/blob/71e0fb4ea646071ec86e4a65bb24241e31c156bb/f/0106-Make-10_linux-work-with-our-changes-for-linux16-and-.patch">https://src.fedoraproject.org/rpms/grub2/blob/71e0fb4ea646071ec86e4a65bb24241e31c156bb/f/0106-Make-10_linux-work-with-our-changes-for-linux16-and-.patch</a><br></div><div><br></div><div>I thought I could simply g.mkdir_p('/sys/firmware/efi') - but that created a fake dir in my chrooted environment, where grub2-mkconfig somehow was inspecting the real /sys as demonstrated in the above 'ls' example.</div><div><br></div><div>Any ideas on why sh jailbreaks the chroot? is /sys set through some environment variable?</div><div><br></div><div>Thanks!</div></div>