Add a new flag for capturing WIMBoot-compatible WIM
authorEric Biggers <ebiggers3@gmail.com>
Sun, 13 Apr 2014 06:58:19 +0000 (01:58 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Fri, 18 Apr 2014 06:23:03 +0000 (01:23 -0500)
include/wimlib.h
src/add_image.c
src/update_image.c

index fd55ebf..799f66b 100644 (file)
@@ -1381,6 +1381,9 @@ typedef int (*wimlib_iterate_lookup_table_callback_t)(const struct wimlib_resour
  */
 #define WIMLIB_ADD_FLAG_WINCONFIG              0x00000800
 
+/** Capture image as WIMBoot compatible.  */
+#define WIMLIB_ADD_FLAG_WIMBOOT                        0x00001000
+
 #define WIMLIB_ADD_IMAGE_FLAG_NTFS             WIMLIB_ADD_FLAG_NTFS
 #define WIMLIB_ADD_IMAGE_FLAG_DEREFERENCE      WIMLIB_ADD_FLAG_DEREFERENCE
 #define WIMLIB_ADD_IMAGE_FLAG_VERBOSE          WIMLIB_ADD_FLAG_VERBOSE
@@ -1394,6 +1397,8 @@ typedef int (*wimlib_iterate_lookup_table_callback_t)(const struct wimlib_resour
 #define WIMLIB_ADD_IMAGE_FLAG_NO_UNSUPPORTED_EXCLUDE \
                                                WIMLIB_ADD_FLAG_NO_UNSUPPORTED_EXCLUDE
 #define WIMLIB_ADD_IMAGE_FLAG_WINCONFIG                WIMLIB_ADD_FLAG_WINCONFIG
+#define WIMLIB_ADD_IMAGE_FLAG_WIMBOOT          WIMLIB_ADD_FLAG_WIMBOOT
+
 
 /** @} */
 /** @ingroup G_modifying_wims
index 9b8cffb..1d826fb 100644 (file)
@@ -139,7 +139,8 @@ capture_sources_to_add_cmds(const struct wimlib_capture_source *sources,
                              sources[i].fs_source_path,
                              sources[i].wim_target_path);
                        add_cmds[i].op = WIMLIB_UPDATE_OP_ADD;
-                       add_cmds[i].add.add_flags = add_flags & ~WIMLIB_ADD_FLAG_BOOT;
+                       add_cmds[i].add.add_flags = add_flags & ~(WIMLIB_ADD_FLAG_BOOT |
+                                                                 WIMLIB_ADD_FLAG_WIMBOOT);
                        add_cmds[i].add.config = (struct wimlib_capture_config*)config;
                        add_cmds[i].add.fs_source_path = sources[i].fs_source_path;
                        add_cmds[i].add.wim_target_path = sources[i].wim_target_path;
@@ -191,6 +192,8 @@ wimlib_add_image_multisource(WIMStruct *wim,
        /* Success; set boot index if requested. */
        if (add_flags & WIMLIB_ADD_FLAG_BOOT)
                wim->hdr.boot_idx = wim->hdr.image_count;
+       if (add_flags & WIMLIB_ADD_FLAG_WIMBOOT)
+               wim_info_set_wimboot(wim->wim_info, wim->hdr.image_count, true);
        ret = 0;
        goto out;
 out_delete_image:
index 7d2d531..9e6262c 100644 (file)
@@ -465,8 +465,10 @@ check_add_command(struct wimlib_update_command *cmd,
        if (add_flags & ~(WIMLIB_ADD_FLAG_NTFS |
                          WIMLIB_ADD_FLAG_DEREFERENCE |
                          WIMLIB_ADD_FLAG_VERBOSE |
-                         /* BOOT doesn't make sense for wimlib_update_image()  */
+                         /* BOOT doesn't make sense for wimlib_update_image().
+                          * Same with WIMBOOT.  */
                          /*WIMLIB_ADD_FLAG_BOOT |*/
+                         /*WIMLIB_ADD_FLAG_WIMBOOT |*/
                          WIMLIB_ADD_FLAG_UNIX_DATA |
                          WIMLIB_ADD_FLAG_NO_ACLS |
                          WIMLIB_ADD_FLAG_STRICT_ACLS |