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

Launchpad Bug Tracker 1900693 at bugs.launchpad.net
Thu Feb 18 12:54:47 UTC 2021


This bug was fixed in the package u-boot - 2020.10+dfsg-1ubuntu0~18.04.2

---------------
u-boot (2020.10+dfsg-1ubuntu0~18.04.2) bionic; urgency=medium

  * SRU of changes through to 2020.10+dfsg-1ubuntu6 to fix Pi4-8GB & CM4
support:

  * Add d/p/rpi-8gb-pci.patch for Pi400 and Pi4-8Gb support (LP: #1906552)
  * Add d/p/rpi-cm4-sdhci.patch for CM4 eMMC support
  * Add d/p/rpi-maxargs.patch for new Core 18 boot-env (LP: #1910094)
  * Remove redundant d/targets entries

u-boot (2020.10+dfsg-1ubuntu0~18.04.1) bionic; urgency=low

  * SRU of 2020.10+dfsg-1 to support Raspberry Pi 4 (LP: #1903054), and
    fix a failure to write issue (LP: #1900693)
  * Re-added d/p/lzo-to-lzno.patch as lzop is in universe prior to Groovy
  * Updated d/targets to remove arm-trusted-firmware references
  * Updated d/control for compatibility with bionic debhelper
  * Reinstate rpi-config-migration script for bionic

  [ Dave Jones ]
  * Merge from Debian unstable.  Remaining changes:
    - Enable Ubuntu support for the Nitrogen6x board (LP: #1838064)
      - Add d/p/ubuntu-nitrogen6q2g-config-tweaks.patch to tweak the
        nitrogen6q2g configs to better fit our Ubuntu usage.
      - Start building the nitrogen6x2g target for u-boot.
    - Enable FIT signing support (LP: #1831942)
      - Enable CONFIG_FIT_SIGNATURE so we can sign FIT images.
      - Add libssl-dev to Build-Depends: to enable crypto functionality.
      - Limit key names to keys within the keydir.
    - d/p/rpi-config-tweaks.patch: Configuration adjustments to the RPi
      configs
    - d/p/rpi-board-dt.patch: use the board's device-tree instead of an
      embedded one

  * Removed obsolete patches/changes:
    - d/p/lzo-to-lzno.patch: use gzip instead of lzo compression for FIT
      images as lzop in Ubuntu is in universe. This should be temporary and in
      the next releases ideally we should follow what Debian does.

u-boot (2020.10+dfsg-1) unstable; urgency=medium

  * New upstream release.

u-boot (2020.10~rc5+dfsg-1) experimental; urgency=medium

  [ Vagrant Cascadian ]
  * New upstream release candidate.
  * debian/control: u-boot-qemu: Set Multi-Arch: foreign.

  [ Uwe Kleine-König ]
  * control: Use https for upstream homepage

u-boot (2020.10~rc3+dfsg-1) experimental; urgency=medium

  * New upstream release candidate.
  * debian/patches: Refresh and remove obsolete patches.
  * [armhf] u-boot-sunxi: Add Bananapi_M2_Ultra (Closes: #962931). Thanks
    to Bernhard Wörner.
  * [arm64] u-boot-rockchip: Update rock-pi-4 .dtb names.
  * u-boot-qemu: Build firmware for qemu ppc e500 (Closes: #966624).

u-boot (2020.07+dfsg-2) unstable; urgency=medium

  [ Vagrant Cascadian ]
  * u-boot-install-rockchip: Update with additional RockPro64 names from
    linux 5.7 device-trees.

  [ Denis Pynkin ]
  * u-boot-rpi: Add rpi_arm64 target for arm64 (Closes: #966078).

  [ Vagrant Cascadian ]
  * debian/patches: Fix reproducibility of mx6cuboxi target.

u-boot (2020.07+dfsg-1) unstable; urgency=medium

  * New upstream release.
  * [armhf] u-boot-omap: Drop omap3_pandora, removed upstream.
  * [arm64] u-boot-amlogic: Install new board-specific documentation.
  * debian/patches: Fix riscv64 support for extlinux.
  * debian/control:
    - Upgrade to debhelper compat 13.
    - Update Build-Depends on arm-trusted-firmware.

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

  * New upstream release candidate.
  * debian/patches:
    - Remove pinebook-pro patches, applied upstream.
    - Remove riscv64 patches, applied upstream.
  * u-boot-rockchip: Update puma-rk3399 to include new
    rk3399-puma-haikou.dtb file.
  * Update lintian overrides to use "shared-library-lacks-prerequisites"
    instead of older tag name.

u-boot (2020.07~rc3+dfsg-1) experimental; urgency=medium

  [ Andreas Henriksson ]
  * u-boot-rpi: Enable rpi4 target on armhf and arm64 (Closes: #958668)

  [ Vagrant Cascadian ]
  * New upstream release candidate.
  * debian/patches: Refresh n900 patch.

u-boot (2020.07~rc2+dfsg-1) experimental; urgency=medium

  * New upstream release candidate.
  * debian/patches: Refresh.

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

  * Merge with 2020.04+dfsg-2 from Debian unstable. Remaining changes:
    - Enable Ubuntu support for the Nitrogen6x board (LP: #1838064)
      - Add d/p/ubuntu-nitrogen6q2g-config-tweaks.patch to tweak the
        nitrogen6q2g configs to better fit our Ubuntu usage.
      - Start building the nitrogen6x2g target for u-boot.
    - Enable FIT signing support (LP: #1831942)
      - Enable CONFIG_FIT_SIGNATURE so we can sign FIT images.
      - Add libssl-dev to Build-Depends: to enable crypto functionality.
      - Limit key names to keys within the keydir.
    - d/p/rpi-config-tweaks.patch: Configuration adjustments to the RPi
      configs
    - d/p/lzo-to-lzno.patch: use gzip instead of lzo compression for FIT
      images as lzop in Ubuntu is in universe. This should be temporary and in
      the next releases ideally we should follow what Debian does.
    - d/p/rpi-board-dt.patch: use the board's device-tree instead of an
      embedded one

  * Removed obsolete patches/changes:
    - Handle differing root partition labels during migration
    - Add script to migrate old boot configurations to split, selective style
    - Don't attempt config migration when /boot/firmware is a chroot
    - Use vc4-fkms-v3d overlay on all models of Raspberry Pi
    - Do not include the vc4-fkms-v3d overlay; this breaks book on the 3A+
    - Ensure boot.scr is from recent flash-kernel
    - d/p/rpi-import-mkknlimg.patch import tools/mkknlimg from Xenial/raspi2 -
      scripts/mkknlimg @ 83a3ebb
    - Remove redundant d/p/rpi-import-mkknlimg.patch
    - d/p/ubuntu-nitrogen6q2g-temporary-config-fixup.patch:
      Fix bad CRC issue. The env size and redundant environment config
      variables have not yet been migrated to Kconfig, so setting them in
      _defconfig has no effect. Set those manually.

  * Removed patches obsoleted/merged by upstream:
    - Use python2 for the build.
    - Added d/p/python2.patch to fix-up remaining scripts still using bare
      "python"
    - d/p/am57xx/omap5_distro_bootcmd
    - Correct odroid README paths
    - Add d/p/rpi4.patch to support Raspberry Pi 4 boot
    - Avoid device-tree memory fixup on Raspberry Pi 4; this allows access to
      the all the RAM on models with more than 1Gb
    - Add missing build dependency on arm/arm64

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

  * debian/patches:
    - Remove dreamplug cache patch, fixed upstream.
    - Add patches submitted upstream to support pinebook pro.
  * u-boot-rockchip:
    - Add support for rockpro64-rk3399.
    - Add support for pinebook-pro-rk3399.
    - Add u-boot-install-rockchip helper script.

u-boot (2020.04+dfsg-1) unstable; urgency=medium

  * New upstream release.

  [ Vagrant Cascadian ]
  * Update upstream signing key.
  * [arm64] Build arm-trusted-firmware into rockchip/sunxi systems.
  * [arm64] u-boot-sunxi: Add a64-olinuxino-emmc target Thanks to Philip
    Rinn. (Closes: #956394).

  [ Walter Lozano ]
  * debian/targets: Add support for rock-pi-4-rk3399
  * debian/targets: Add target idbloader.img for rk3399 boards

  [ Vagrant Cascadian ]
  * debian/control: Add versioned Build-Depends on arm-trusted-firmware
    for rk3399 support.
  * debian/targets: Add idbloader.img for all rockchip platforms.
  * u-boot-rockchip: Update README.Debian.
  * Remove debian/bin/generate-rksd.
  * u-boot-rockchip: firefly-rk3288: Also install u-boot.img.
  * [arm64] u-boot-rockchip, u-boot-sunxi: Add Built-Using
    arm-trusted-firmware.

u-boot (2020.04~rc5+dfsg-1) experimental; urgency=medium

  * New upstream release candidate.
  * debian/patches:
    - Remove patch fixing video on pinebook, fixed upstream.

u-boot (2020.04~rc2+dfsg-1) experimental; urgency=medium

  * New upstream release candidate.
  * debian/patches:
    - riscv64: refresh qemu-riscv64 extlinux patch.
    - exynos: Refresh patch fixing console.
    - Drop patches applied upstream.
  * debian/rules: Disable CONFIG_FIT_SIGNATURE in all targets, as it
    requires openssl which introduces license incompatibilities with the
    GPL.
  * u-boot-rockchip: Update firefly-rk3288 instructions.

u-boot (2020.01+dfsg-2) unstable; urgency=medium

  * debian/patches:
    - Fix video output on pinebook (Closes: #948753).
    - Fix exynos5 board detection (Closes: #951195). Thanks to Jochen
      Sprickerhof!
    - Fix MMC on odroid U3. (Closes: #950293)
    - Improve error handling with GPT renames. Fixes CVE-2020-8432.
  * debian/control: Update Standards-Version to 4.5.0, no changes.

u-boot (2020.01+dfsg-1) unstable; urgency=medium

  * New upstream release.
  * debian/rules: Do not call qcom wrapper script.
  * debian/control: Drop Build-Depends on "skales", removed from testing.
  * u-boot-rockchip: Use python3 in rockchip_make_fit_atf.
  * generate-rksd: Only generate SPL rksd on targets not using TPL.
  * Add build profile pkg.uboot.subarch.* to build only subsets of
    packages.
  * [arm64] u-boot-rockchip: Add arm-trusted-firmware and u-boot-tools to
    Recommends.

u-boot (2020.01~rc5+dfsg-1) experimental; urgency=medium

  * New upstream release candidate (Closes: #941231).
  * debian/control: Update Build-Depends to use python3 and
    libpython3-dev, add python3-distutils (Closes: #938739).
  * [armhf] u-boot-imx: install u-boot-dtb.imx on mx6qsabrelite and
    nitrogen6q.
  * debian/patches:
    - Remove mx6/Revert-spl-imx6-Let-spl_boot_device-return-USDHC1-or,
      applied upstream.
    - Refresh riscv64/qemu-riscv64_smode-sifive-fu540-fix-extlinux.
    - Remove mx6/arm-Set-SYS_DCACHE_OFF-for-MX6-platforms, it was an ugly
      workaround.

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

  * u-boot-sifive: Install new fu540 documentation.
  * debian/patches:
    - Add qemu-riscv64_smode-sifive-fu540-fix-extlinux-define to fix
      extlinux support on riscv64 targets.
    - Drop qemu-riscv64-raw-initrd, it is redundant due to
      DISTRO_DEFAULTS=y.
    - Disable dcache on MX6 platforms.
    - Add patch to revert changes to imx6 MMC boot device order.
  * debian/control:
    - Set Rules-Requires-Root: no.
    - Update Standards-Version to 4.1.1, no changes needed.

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>  Fri, 08 Jan 2021 15:51:00
+0000

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

** CVE added: https://cve.mitre.org/cgi-bin/cvename.cgi?name=2020-8432

-- 
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:
  In Progress
Status in u-boot package in Ubuntu:
  Fix Released
Status in u-boot source package in Bionic:
  Fix Released
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