+mkdir -p "$TMP_IMAGE_DIR/images"
+v_print "Copying efiboot image to $TMP_IMAGE_DIR/images/efiboot.img"
+cp $EFIBOOT "$TMP_IMAGE_DIR/images/efiboot.img"
+if [ $? -ne 0 ]; then
+ err_print "Failed to copy $EFIBOOT to $TMP_IMAGE_DIR/images"
+ cleanup
+ exit 1
+fi
+
+v_print "Copying EFI directory to $TMP_IMAGE_DIR/EFI"
+cp -r $EFIDIR "$TMP_IMAGE_DIR/EFI"
+if [ $? -ne 0 ]; then
+ err_print "Failed to copy $EFIDIR to $TMP_IMAGE_DIR/EFI"
+ cleanup
+ exit 1
+fi
+# Generate grub.cfg for default booting
+sed -i '/BEGIN/q' "$TMP_IMAGE_DIR/EFI/BOOT/grub.cfg"