sh "mkswap $label $dev";
}
+
+warn "mount bind chroot...\n";
+
+foreach ( qw(dev proc sys) ) {
+ sh "mount --bind /$_ $tmp/$_";
+ unshift @umount, "$tmp/$_";
+}
+
+warn "make backup bootable...\n";
+
+open(my $sh, '>', "$tmp/tmp/backup-fixup.sh");
+print $sh qq{
+grub-install /dev/nbd0
+update-grub
+};
+close($sh);
+chmod 0755, "$tmp/tmp/backup-fixup.sh";
+
+sh "chroot $tmp /tmp/backup-fixup.sh";
+
+warn "wait for ENTER to continue...\n";
+<STDIN>;
+
+
warn "cleanup...\n";
sh "umount $_" foreach @umount;