#NEWLINE# def grub2_cfg_bundled( kernel_params = '' , chroot = '' , grub_timeout = 5 , lvm_boot = False ) : #NEWLINE# #INDENT# os . symlink ( chroot , '/tmp/rootfs' ) #NEWLINE# with grub2_prepare ( kernel_params , chroot , grub_timeout , lvm_boot ) : #NEWLINE# #INDENT# os . remove ( '/etc/grub.d/10_linux' ) #NEWLINE# cmd = [ guess_grub2_mkconfig ( ) , '-o' , ( chroot + '/boot/grub2/grub.cfg' ) ] #NEWLINE# utils . execute ( * cmd , run_as_root = True , cwd = '/tmp/' ) #NEWLINE# os . remove ( '/tmp/rootfs' )