All notes should be like "# xxx".
+#!/bin/bash +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+#Configure rootfs +make_rootfs() +{
- yum repolist
- yum -y install $(</root/bin/repolist)
- yum clean all
- rm -rf $(</root/bin/dellist)
- ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
- cd /root/modules
- zcat modules-5.8.0.1.cgz | cpio -idmv >/dev/null
+}
+#config passwd +pre_config_rootfs() {
- [ -n "$ROOT_NEW_PASSWD" ] && {
echo "Changing root password"
passwd_md5=$(openssl passwd -1 "$ROOT_NEW_PASSWD")
echo $passwd_md5
sed -i -r "s/^root:[^:]*:(.*)/root:${passwd_md5//\//\\/}:\1/" "$ROOTFS_DIR/etc/shadow"
sed -i 's/[# ]PermitRootLogin.*/PermitRootLogin yes/' "$ROOTFS_DIR/etc/ssh/sshd_config"
Pls add some notes here.
Thanks, Xijian