Root password reset

Hi,

I haven’t used my device for some time and I need to change the password for the root user. I was hoping that I could add some boot arguments but apparently, it didn’t work, and don’t know U-Boot well enough to fix it.

What I tried:

=> setenv bootargs single init=/bin/sh
=> run mmc_boot

This started the boot sequence I would normally see, but my arguments were not present in the bootargs. I expected to see my boot argument as part of arguments that are added by the init scripts. Instead I get the following output:

switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1
Found /boot/extlinux/extlinux.conf
Retreiving file: /boot/extlinux/extlinux.conf
159 bytes read in 108 ms (1000 Bytes/s)
1:             default
Retreiving file: /boot/extlinux/../initrd
9132022 bytes read in 605 mx (14.4 MiB/s)
Retreiving file: /boot/extlinux/../`Image
7153744 bytes read in 523 mx (13 MiB/s)
append: root=UUID=[uuid] rootfstype=auto rootwait
Retreiving file: /boot/extlinux/../dtb-dir/undefined

The mmc_boot script failed since I did not set the DTB file, but it gave me an opportunity to see the contents of the bootargs variables:

=> printenv bootargs
root=UUID=[uuid] rootfstype=auto rootwait

As you can see, the boot scripts didn’t actually append anything. Instead, they discarded the previous value of the variable and have set it with a different value.

Any suggestions what can I do about it?

Most likely the extlinux.conf is not setup to append the bootargs env variable from u-boot. Which distribution are you booting? Is this an SDHC card? If it is then you can easily fix your issues from another Linux device.

I’m using Debian (Stretch I think) and indeed, I’m booting it from an SDHC card.

I did manage to edit the extlinux.conf file on my old laptop and I confirmed that U-Boot is adding my boot arguments, but then I got stuck on mounting the FS.

EXT4-fs (mmcblk0p1): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (mmcblk0p1): couldn't mount as ext2 due to feature incompatibilities
EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)

After waiting for some time I’ve seen some urandom errors but I don’t think they were relevant. My guess is that these messages are related to the rootfstype=auto parameter. What’s weird, it only happens when I add some extra arguments to the extlinux.conf.

I searched for the above messages but didn’t find anything relevant. Is there anything else I could try?

can you post the kernel cmdline that is getting passed? It should be output early on the dmesg. Thanks

Apparently not. After U-Boot finishes, the screen goes blank for some time (I assume the display drivers are not yet loaded) and when it starts to work again I’m way past the kernel command line part. I tried scrolling with Shift + PgUp but the screen buffer is to low. I could try to increase it with boot arguments but, you know, they are problematic. There are also no logs in /var/log/kern.log as the FS is not mounted and there’s no ware to save them.

Here’s what I can show you:

  • Standard boot arguments (OS boots fine)
// extlinux.conf
APPEND root=UUID=[uuid] rootfstype=auto rootwait

// U-Boot log
append: root=UUID=[uuid] rootfstype=auto rootwait

// Kernel command line
[    0.000000] Kernel command line: root=UUID=[uuid] rootfstype=auto rootwait
  • Modified boot arguments (OS fails to boot)
// extlinux.conf
APPEND root=UUID=[uuid] rootfstype=auto rootwait single init=/bin/bash

// U-Boot log
append: root=UUID=[uuid] rootfstype=auto rootwait single init=/bin/bash

After your suggestion to plug the SD card into antoher device I’ve made a backup of the files so I could just re-install the OS but I find this problem to be a great learning expirience so I would still like try to solve it.

after booting you can review the full boot log with the dmesg command.

I don’t believe I can. After adding additional boot args my screen stops at

EXT4-fs (mmcblk0p1): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (mmcblk0p1): couldn't mount as ext2 due to feature incompatibilities
EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)

and I don’t have any command prompt (I can’t type anything). I tried connecting with ssh but the device is unreachable. I tried waiting for a bit and it didn’t help. If I plug out (or plug in) my keyboard I do get a message that the USB device was (dis)connected though.

Is this a HummingBoard or Cubox-i? Have you tried getting a serial console connection?

I’m using a HummingBoard. For a serial connection, I would have to buy a serial adapter. I guess it might be a good idea to have one anyway so I’ll try to find one that will work with my laptop.