<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>13313</bug_id>
          
          <creation_ts>2019-04-30 10:33:38 +0000</creation_ts>
          <short_desc>wic write --expand auto changes swap UUID</short_desc>
          <delta_ts>2020-05-13 17:38:28 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>Scripts and Tools</component>
          <version>3.0</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.2 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Chee Yang">chee.yang.lee</assigned_to>
          <cc>chee.yang.lee</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>83671</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2019-04-30 10:33:38 +0000</bug_when>
    <thetext>The generated mount point for the swap in a wic image&apos;s fstab uses the swap UUID, whereas the partition regeneration code when the new expanded partition is created uses the partition UUID.

If an image is written without using --expand the image boots.  If --expand is used the UUID of the swap isn&apos;t preserved and the image won&apos;t boot.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83672</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2019-04-30 10:42:18 +0000</bug_when>
    <thetext>Loopback mount the original wic: the fstab contains this:


UUID=9951-E297	/boot	vfat	defaults	0	0
UUID=53fbb599-1298-4ffb-b5fa-c697f6d7d993	swap	swap	defaults	0	0

lsblk says:

NAME      FSTYPE LABEL    UUID                                 MOUNTPOINT
loop1
├─loop1p1 vfat   efi      9951-E297
├─loop1p2 ext4   platform 0c057449-028a-4227-8549-6c6fca952f26 /mnt
└─loop1p3 swap   swap1    53fbb599-1298-4ffb-b5fa-c697f6d7d993

Those are filesystem UUIDs not partition UUIDs:

$ blkid  /dev/loop1p3
/dev/loop1p3: LABEL=&quot;swap1&quot; UUID=&quot;53fbb599-1298-4ffb-b5fa-c697f6d7d993&quot; TYPE=&quot;swap&quot; PARTLABEL=&quot;swap1&quot; PARTUUID=&quot;ff602e88-56f8-4091-afdb-35af24f8644f&quot;

But when wic write builds the new partition table it is using the UUIDs from sfdisk, which are the partition UUIDs.

$ wic write -e auto
DEBUG: _exec_cmd: /data/poky-tmp/master/work/corei7-64-poky-linux/wic-tools/1.0-r0/recipe-sysroot-native/sbin/mkswap -L swap1 -U FF602E88-56F8-4091-AFDB-35AF24F8644F /tmp/wic-part3-626vx29l</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87184</commentid>
    <comment_count>2</comment_count>
    <who name="Chee Yang">chee.yang.lee</who>
    <bug_when>2020-05-13 17:38:28 +0000</bug_when>
    <thetext>https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/scripts/lib/wic?id=df77ee47237244f400da4de62f201a55ec1a8f8d</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>