Grub password set after update

I have only carried out an update and after the update a Grub password was set under /etc/grub.d/07_passwd

#!/bin/sh
#------------------------------------------------------------------------------

Modified Calculate Utilities 3.7.6.8

Processed template files:

/var/db/repos/calculate/profiles/templates/2_ac_install_merge/sys-boot/grub/grub.d/07_passwd

To modify this file, create a /etc/grub.d/07_passwd.clt template.

#------------------------------------------------------------------------------

grub-mkconfig helper script.

Copyright 2016 Calculate Ltd. http://www.calculate-linux.org

Licensed under the Apache License, Version 2.0 (the “License”);

you may not use this file except in compliance with the License.

You may obtain a copy of the License at

Apache License, Version 2.0

cat <<EOF
set superusers=“root”
password_pbkdf2 root grub.pbkdf2.sha512.25000.8811E27C0F21C4F8BF17C2F87FAFD51AE39C73AE15C2D8FBBF9732C6D8BB772EC578AF558A1122C4B837C6D8BB17628C114228254488D17AAF15024088712E25.C1F64B01030B7BCF71646CBCC6DED813C64F4FA5653C3A8CC0B0CC5C34A9CC84F9F6BED3E040F44508826FD957C5714733C07ACA9CE66E44FCC07484F8B636A8
export superusers
EOF

I didn’t create the file, I don’t know where it came from. I used the following to update my system, it took a while because it is an old laptop and there was an KDE update and there were many ~amd64 packages to compile:

emaint -A sync && eix-update && emerge -avNDuq --keep-going --with-bdeps=y --complete-graph --verbose-conflicts @world && smart-live-rebuild && emerge @module-rebuild -q && emerge -aqv --depclean && emerge -avq --keep-going @preserved-rebuild && grub-install /dev/sda && grub-mkconfig -o /boot/grub/grub.cfg

I changed some useflags on my system, installed some packages from overlays and installed many ~amd64 packages, but I don’t know what should trigger something like this.
I don’t know where the pw hash in /etc/grub.d/07_passwd came from, my passwords didn’t work with it.
I created my own hash and saved it there, and it works.

If you are experiencing this problem, the following steps may help to solve the problem. You need a medium from which you can boot, preferably Calculate or Gentoo, but other distros will also work.
Then you need to mount your hard disk and chroot into your system.


#mount your root  / partition (and possible other partitions like /boot if you have them):
mount /dev/sda4 /mnt

# mount necessary filesystems
mount --types proc /proc /mnt/proc
mount --rbind /sys /mnt/sys
mount --make-rslave /mnt/sys
mount --rbind /dev /mnt/dev
mount --make-rslave /mnt/dev
mount --bind /run /mnt/run
mount --make-slave /mnt/run

#do this if your boot medium is not gentoo based
test -L /dev/shm && rm /dev/shm && mkdir /dev/shm
mount --types tmpfs --options nosuid,nodev,noexec shm /dev/shm
chmod 1777 /dev/shm /run/shm

#chroot in your environment
chroot /mnt//bin/bash
source /etc/profile
export PS1="(chroot) ${PS1}"

#remove the password file
rm  /etc/grub.d/07_passwd 

#update grub cfg
grub-mkconfig -o /boot/grub/grub.cfg

After that, the grub PW should be gone and you can reboot.

Hello! By default, Calculate Linux sets a password for Grub. It is created to be the same as the root password. The file /etc/grub.d/07_passwd is generated during installation. I just checked, and nothing has changed. Grub asks for a password to prevent unauthorized access to the system by anyone who gains physical access to the PC.

Since when does Calculate Linux do this?
This installation of Claculate (KDE) was at least 8 months ago, no Grub password was set after the installation.

After this one update this file suddenly appeared, I have deleted 07_passwd in the meantime and already made a new update, but the file did not come back.

Password usage in Grub appeared in Calculate Linux about 7 years ago. The installer sets the root user password by default, unless you disabled this option during installation.

Anyway, when I not set it on installation, it should not set itself on a later update. There was another guy who said he had the same problem on Telegram.