[Bug 1900693] Re: snapd cannot refresh on some SD cards due to uboot bug

Mathew Hodson 1900693 at bugs.launchpad.net
Sun Nov 15 01:59:23 UTC 2020


Fixed in Groovy
---

u-boot (2020.04+dfsg-2ubuntu1) groovy; urgency=medium

  * Merge with 2020.04+dfsg-2 from Debian unstable.

[...]

u-boot (2019.10~rc4+dfsg-1) experimental; urgency=medium

  * New upstream release candidate.
  * u-boot-rockchip: Add rock64-rk3328 target.
  * u-boot-rockchip: Install rockchip_make_fit_atf and Recommend python3.
  * generate-rksd: Add support for rk3328 and TPL images.
  * debian/patches:
    - Update ensure-config-sandbox-for-make-env.
    - Update qemu-riscv64-raw-initrd for.
    - Add description and forwarded links for qemu-riscv64-raw-initrd.
  * u-boot-qemu: Drop support for qemu_mips, qemu_mipsel and
    qemu_mips64el as the cross compilers are no longer available.
  * u-boot-tools:
    - Remove fw_printenv and fw_setenv and Recommend libubootenv-tool.
      (Closes: #939598)
    - Update package description.
  * README.Debian: Drop references to fw_setenv and fw_printenv.
  * debian/control:
    - [arm64] Drop Build-Depends on python-pyelftools; no longer needed
      for fit image creation.
    - Update Standards-Version to 4.4.0, no changes needed.
    - Update to debhelper-compat 12.
  * debian/copyright: Drop stanza and license for pcmcia; code was
    removed.

 -- Dave Jones <dave.jones at canonical.com>  Sat, 16 May 2020 01:02:53
+0000

** Also affects: u-boot (Ubuntu Focal)
   Importance: Undecided
       Status: New

** Also affects: u-boot (Ubuntu Bionic)
   Importance: Undecided
       Status: New

** Changed in: u-boot (Ubuntu)
   Importance: Undecided => Medium

** Changed in: u-boot (Ubuntu Bionic)
   Importance: Undecided => Medium

** Changed in: u-boot (Ubuntu Focal)
   Importance: Undecided => Medium

** Changed in: u-boot (Ubuntu)
       Status: Confirmed => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to u-boot in Ubuntu.
https://bugs.launchpad.net/bugs/1900693

Title:
  snapd cannot refresh on some SD cards due to uboot bug

Status in snapd:
  New
Status in u-boot package in Ubuntu:
  Fix Released
Status in u-boot source package in Bionic:
  New
Status in u-boot source package in Focal:
  New

Bug description:
  Analysis of a specific Pi device resulted in mystery of failure to
  upgrade core18 or other snaps that require writes to FAT bootable
  partition.

  This was finally reproduced with a fixed set of snaps:

  - core18 - revision 1076
  - pi - revision 17
  - pi-kernel - revision 44
  - snapd (current version may fail due to session.d bug) - revision 9731 (hard to seed without help)

  This combination seems to suffer from:
  - lack of fsck.vfat in core18 (fixed later)
  - possible malfunction of snapd-specific shutdown helper

  Refreshing core18 from this setup results in the following failure (as
  captured on the serial log), necessitating TWO power cycles to
  resolve:


  U-Boot 2019.04-dirty (Jul 10 2019 - 09:50:40 +0000)

  DRAM:  948 MiB
  RPI 3 Model B+ (0xa020d3)
  MMC:   mmc at 7e202000: 0, sdhci at 7e300000: 1
  Loading Environment from FAT... OK
  In:    serial
  Out:   serial
  Err:   serial
  Net:   No ethernet found.
  Hit any key to stop autoboot:  0 
  switch to partitions #0, OK
  mmc0 is current device
  LOADBOOTENV
  Running uenvcmd ...
  ENVCMD
  Saving Environment to FAT... wait_transfer_complete - still waiting after 100001 retries
  mmc write failed
  Error: writing directory entry
  OK
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  ** Can't read partition table on 0:0 **
  ** Invalid partition 1 **
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  ** Can't read partition table on 0:0 **
  ** Invalid partition 1 **
  previous command (24) not complete (EDM 00010807)
  WARNING at drivers/mmc/bcm2835_sdhost.c:376/bcm2835_prepare_data()!
  3314130 bytes read in 154 ms (20.5 MiB/s)
  42079 bytes read in 36 ms (1.1 MiB/s)
  Bad Linux ARM zImage magic!
  Scanning mmc 0:1...
  Scanning mmc 0:2...
  starting USB...
  USB0:   scanning bus 0 for devices... 4 USB Device(s) found
         scanning usb for storage devices... 0 Storage Device(s) found

  Device 0: unknown device
  lan78xx_eth Waiting for PHY auto negotiation to complete...... done
  BOOTP broadcast 1
  BOOTP broadcast 2
  BOOTP broadcast 3
  DHCP client bound to address 192.168.2.106 (757 ms)
  *** ERROR: `serverip' not set
  Cannot autoload with TFTPGET
  missing environment variable: pxeuuid
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/01-b8-27-eb-9f-89-d1
  lan78xx_eth Waiting for PHY auto negotiation to complete....... done
  *** ERROR: `serverip' not set
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/C0A8026A
  lan78xx_eth Waiting for PHY auto negotiation to complete....... done
  *** ERROR: `serverip' not set
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/C0A8026
  lan78xx_eth Waiting for PHY auto negotiation to complete....... done
  *** ERROR: `serverip' not set
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/C0A802
  lan78xx_eth Waiting for PHY auto negotiation to complete....... done
  *** ERROR: `serverip' not set
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/C0A80
  lan78xx_eth Waiting for PHY auto negotiation to complete...


  
  On the first power-cycle the logs say this:


  U-Boot 2019.04-dirty (Jul 10 2019 - 09:50:40 +0000)

  DRAM:  948 MiB
  RPI 3 Model B+ (0xa020d3)
  MMC:   mmc at 7e202000: 0, sdhci at 7e300000: 1
  Loading Environment from FAT... OK
  In:    serial
  Out:   serial
  Err:   serial
  Net:   No ethernet found.
  Hit any key to stop autoboot:  0 
  switch to partitions #0, OK
  mmc0 is current device
  LOADBOOTENV
  Running uenvcmd ...
  ENVCMD
  Saving Environment to FAT... wait_transfer_complete - still waiting after 100001 retries
  mmc write failed
  Error: writing directory entry
  OK
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  ** Can't read partition table on 0:0 **
  ** Invalid partition 1 **
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  ** Can't read partition table on 0:0 **
  ** Invalid partition 1 **
  previous command (24) not complete (EDM 00010807)
  WARNING at drivers/mmc/bcm2835_sdhost.c:376/bcm2835_prepare_data()!
  3314130 bytes read in 155 ms (20.4 MiB/s)
  42079 bytes read in 54 ms (760.7 KiB/s)
  Bad Linux ARM zImage magic!
  Scanning mmc 0:1...
  Scanning mmc 0:2...
  starting USB...
  USB0:   scanning bus 0 for devices... 4 USB Device(s) found
         scanning usb for storage devices... 0 Storage Device(s) found

  Device 0: unknown device
  lan78xx_eth Waiting for PHY auto negotiation to complete...... done
  BOOTP broadcast 1
  BOOTP broadcast 2
  BOOTP broadcast 3
  DHCP client bound to address 192.168.2.106 (758 ms)
  *** ERROR: `serverip' not set
  Cannot autoload with TFTPGET
  missing environment variable: pxeuuid
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/01-b8-27-eb-9f-89-d1
  lan78xx_eth Waiting for PHY auto negotiation to complete....... done
  *** ERROR: `serverip' not set
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/C0A8026A
  lan78xx_eth Waiting for PHY auto negotiation to complete....... done
  *** ERROR: `serverip' not set
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/C0A8026
  lan78xx_eth Waiting for PHY auto negotiation to complete....... done
  *** ERROR: `serverip' not set
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/C0A802
  lan78xx_eth Waiting for PHY auto negotiation to complete...... done
  *** ERROR: `serverip' not set
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/C0A80
  lan78xx_eth Waiting for PHY auto negotiation to complete..... done
  *** ERROR: `serverip' not set
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/C0A8
  lan78xx_eth Waiting for PHY auto negotiation to complete....... done
  *** ERROR: `serverip' not set
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/C0A
  lan78xx_eth Waiting for PHY auto negotiation to complete....... done
  *** ERROR: `serverip' not set
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/C0
  lan78xx_eth Waiting for PHY auto negotiation to complete....... done
  *** ERROR: `serverip' not set
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/C
  lan78xx_eth Waiting for PHY auto negotiation to complete....... done
  *** ERROR: `serverip' not set
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/default-arm-bcm283x
  lan78xx_eth Waiting for PHY auto negotiation to complete....... done
  *** ERROR: `serverip' not set
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/default-arm
  lan78xx_eth Waiting for PHY auto negotiation to complete....... done
  *** ERROR: `serverip' not set
  missing environment variable: bootfile
  Retrieving file: pxelinux.cfg/default
  lan78xx_eth Waiting for PHY auto negotiation to complete....... done
  *** ERROR: `serverip' not set
  Config file not found
  lan78xx_eth Waiting for PHY auto negotiation to complete....

  
  Finally on the second power cycle the logs contain:

  
  U-Boot 2019.04-dirty (Jul 10 2019 - 09:50:40 +0000)

  DRAM:  948 MiB
  RPI 3 Model B+ (0xa020d3)
  MMC:   mmc at 7e202000: 0, sdhci at 7e300000: 1
  Loading Environment from FAT... OK
  In:    serial
  Out:   serial
  Err:   serial
  Net:   No ethernet found.
  Hit any key to stop autoboot:  0 
  switch to partitions #0, OK
  mmc0 is current device
  LOADBOOTENV
  Running uenvcmd ...
  ENVCMD
  Saving Environment to FAT... wait_transfer_complete - still waiting after 100001 retries
  mmc write failed
  Error: writing directory entry
  OK
  previous command (24) not complete (EDM 00010807)
  previous command (24) not complete (EDM 00010807)
  WARNING at drivers/mmc/bcm2835_sdhost.c:376/bcm2835_prepare_data()!
  6693376 bytes read in 304 ms (21 MiB/s)
  3314130 bytes read in 148 ms (21.4 MiB/s)
  42079 bytes read in 55 ms (747.1 KiB/s)
  Kernel image @ 0x200000 [ 0x000000 - 0x662200 ]
  ## Flattened Device Tree blob at 02000000
     Booting using the fdt blob at 0x2000000
     Loading Ramdisk to 3ac19000, end 3af4c631 ... OK
     Loading Device Tree to 3ac0f000, end 3ac18526 ... OK

  Starting kernel ...

  
  (boot proceeds normally)

  
  Searching the web seems to suggest that uboot is waiting insufficiently for the FAT write to complete: https://www.mail-archive.com/u-boot@lists.denx.de/msg330093.html

To manage notifications about this bug go to:
https://bugs.launchpad.net/snapd/+bug/1900693/+subscriptions



More information about the foundations-bugs mailing list