方式一、移除 overlay

编辑 .BoardConfig.mk 第 124 行,把 overlay-luckfox-buildroot-shadowRK_POST_OVERLAY 中去掉:

overlay-luckfox-buildroot-shadow

export RK_POST_OVERLAY="overlay-luckfox-config overlay-luckfox-buildroot-init overlay-luckfox-wifibt-firmware

sysdrv/source/buildroot/buildroot-2023.02.6/configs/luckfox_pico_defconfig

修改

BR2_TARGET_GENERIC_HOSTNAME="wyl" #主机名称
BR2_TARGET_GENERIC_ISSUE="Welcome to wyl" #欢迎语
#BR2_TARGET_GENERIC_ROOT_PASSWD="luckfox" #原始密码
BR2_TARGET_GENERIC_ROOT_PASSWD="root" #密码

方式二、修改overlay中密码

project/cfg/BoardConfig_IPC/overlay/下的overlay-luckfox-buildroot-shadow/etc

shadow文件

root:$1$dXmV8ZLO$eNAQzSYOgRkYMJRdsHwLS1:19664::::::
daemon:*:::::::
bin:*:::::::
sys:*:::::::
sync:*:::::::
mail:*:::::::
www-data:*:::::::
operator:*:::::::
nobody:*:::::::
  • openssl passwd -1 # 然后输入你要的密码

  • 将生成的 hash 替换 overlay 中 root 行的 $1$dXmV8ZLO$eNAQzSYOgRkYMJRdsHwLS1 部分。

方法三、在 shadow overlay 中直接写明文让你当前的密码生效

在 overlay 中放一个空的 /etc/shadow,让 Buildroot 生成的 shadow 文件不被覆盖。或者把 overlay 中的 shadow 文件内容改成空的 root 行,系统会在首次启动时用 Buildroot 的密码。