Los argumentos de mtdparts parecen ignorados por el kernel de Linux desde la actualización de Buster

Los argumentos de mtdparts parecen ignorados por el kernel de Linux desde la actualización de Buster

Ejecutando Debian en mi NAS durante años. Vanilla Debian con linux-image-kirkwood/linux-image-kernel. El gestor de arranque es u-boot.

Con Debian Stretch (4.9.0-11-marvell) estuvo bien: u-boot entregó el parámetro mtdparts=orion_nand:896k(u-boot),128k(u-boot-env),-(root)a Linux, que lo usó para mapear la NAND y pudo montar felizmente la tercera partición /boot, como ubifs.

Ahora que actualicé a Buster (kernel 4.19.0-6-marvell), Linux parece ignorar el parámetro mtdparts: se pasa bien:

# dmesg|grep mtdparts
[    0.000000] Kernel command line: console=ttyS0,115200 ubi.mtd=2 mtdparts=orion_nand:896k(u-boot),128k(u-boot-env),-(root) root=/dev/sda rootflags=device=/dev/sda,device=/dev/sdb,defaults,noatime rootfstype=btrfs

… Pero parece ignorado por alguna razón, a favor de algún otro diseño (¿predeterminado?):

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00500000 00020000 "uImage"
mtd2: 00500000 00020000 "ramdisk"
mtd3: 06600000 00020000 "image"
mtd4: 00a00000 00020000 "mini firmware"
mtd5: 00500000 00020000 "config"

No actualicé u-boot.

Aquí hay información relevante del lado de u-boot:

=> printenv 
autoload=no
baudrate=115200
boot_fdt=no
bootcmd=setenv bootargs console=${console} ${optargs} ${mtdparts} ${root_hdd} ; run load_ubifs ; bootm 0x1000000 0x1200000 0x0900000
bootdelay=3
bootenv=uEnv.txt
console=ttyS0,115200
ethact=egiga0
ethaddr=00:50:43:XX:XX:XX
filesize=8936df
importbootenv=echo Importing environment ...; env import -t ${loadaddr} ${filesize}
load_ubifs=ubi part root ; ubifsmount ubi:rootfs ; ubifsload 0x0900000 /kirkwood-dns325.dtb ; ubifsload 0x1000000 /uImage ; ubifsload 0x1200000 /uInitrd
loadaddr=0x800000
loadbootenv=fatload usb 0 ${loadaddr} ${bootenv}
mtddevname=u-boot
mtddevnum=0
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:896k(u-boot),128k(u-boot-env),-(root)
nandloadimage=nand read ${loadaddr} kernel
nandroot=ubi0:rootfs ubi.mtd=rootfs
nandrootfstype=ubifs
optargs=ubi.mtd=2
partition=nand0,0
root_flash=ubi.mtd=root root=ubi0:rootfs rootfstype=ubifs
root_hdd=root=/dev/sda rootflags=device=/dev/sda,device=/dev/sdb,defaults,noatime rootfstype=btrfs
setbootargs=setenv bootargs console=${console} ${optargs} ${mtdparts} root=${bootenvroot} rootfstype=${bootenvrootfstype}
setnandbootenv=echo Booting from nand ...; setenv bootenvroot ${nandroot}; setenv bootenvrootfstype ${nandrootfstype}; setenv bootenvloadimage ${nandloadimage}
stderr=serial
stdin=serial
stdout=serial
subbootcmd=run setbootargs; if run bootenvloadimage; then bootm ${loadaddr};fi;
=> mtdparts

device nand0 <orion_nand>, # parts = 3
 #: name                size            offset          mask_flags
 0: u-boot              0x000e0000      0x00000000      0
 1: u-boot-env          0x00020000      0x000e0000      0
 2: root                0x07f00000      0x00100000      0

active partition: nand0,0 - (u-boot) 0x000e0000 @ 0x00000000

defaults:
mtdids  : nand0=orion_nand
mtdparts: mtdparts=orion_nand:896k(u-boot),128k(u-boot-env),5m(kernel),-(rootfs)
=> version

U-Boot 2014.01 (Jan 21 2014 - 18:35:47)
D-Link DNS-325
arm-none-eabi-gcc (Sourcery CodeBench Lite 2013.05-23) 4.7.3
GNU ld (Sourcery CodeBench Lite 2013.05-23) 2.23.52.20130219

Mientras arranca, justo antes de pasar a Linux:

UBI: available PEBs:             0
UBI: total number of reserved PEBs: 1012
UBI: number of PEBs reserved for bad PEB handling: 10
UBI: max/mean erase counter: 13/7
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: mounted read-only
UBIFS: file system size:   127346688 bytes (124362 KiB, 121 MiB, 987 LEBs)
UBIFS: journal size:       9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: zlib
UBIFS: reserved for root:  0 bytes (0 KiB)
Loading file '/kirkwood-dns325.dtb' to addr 0x00900000 with size 12863 (0x0000323f)...
Done
Loading file '/uImage' to addr 0x01000000 with size 2045912 (0x001f37d8)...
Done

Alguna idea ?

Respuesta1

Finalmente encontré la solución. Hay un error relacionado en la última versión de Debian:https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=931852

La mtdpartsopción se había convertido cmdlinepart.mtdparts(al menos en Debian-land).

Por lo tanto, ejecutar lo siguiente en el indicador de u-boot lo hizo correcto:

setenv bootcmd 'setenv bootargs console=${console} ${optargs} cmdlinepart.${mtdparts} ${root_hdd} ; run load_ubifs ; bootm 0x1000000 0x1200000 0x0900000'
saveenv
boot

información relacionada