diff --git a/script/config/raspi_image/rpmlist b/script/config/raspi_image/rpmlist index 3c6a98c4258674aa13e33d813a499b07c6bed5f6..f923649cebf73c0cdac002fe3c4dc6bdb9e66b63 100644 --- a/script/config/raspi_image/rpmlist +++ b/script/config/raspi_image/rpmlist @@ -18,4 +18,5 @@ raspberrypi-kernel raspberrypi-firmware raspberrypi-bluetooth sudo +bc openEuler-repos \ No newline at end of file diff --git a/script/step/make_raspi_image.sh b/script/step/make_raspi_image.sh index 9967bdbb762479142358108d4e2f5df17cd5d160..e1bf2de960e647270b57e4690cffb1badb41e3c6 100644 --- a/script/step/make_raspi_image.sh +++ b/script/step/make_raspi_image.sh @@ -124,10 +124,10 @@ make_rootfs(){ # dnf --installroot=${rootfs_dir}/ install -y raspberrypi-kernel raspberrypi-firmware openEuler-repos set +e INSTALL_PACKAGES $CONFIG_RPM_LIST - cat ${rootfs_dir}/etc/systemd/timesyncd.conf | grep "^NTP*" + cat ${rootfs_dir}/etc/systemd/timesyncd.conf | grep "^NTP=*" if [ $? -ne 0 ]; then - sed -i 's/#NTP=/NTP=0.cn.pool.ntp.org/g' ${rootfs_dir}/etc/systemd/timesyncd.conf - sed -i 's/#FallbackNTP=/FallbackNTP=1.asia.pool.ntp.org 2.asia.pool.ntp.org/g' ${rootfs_dir}/etc/systemd/timesyncd.conf + sed -i -e '/^#NTP=/cNTP=0.cn.pool.ntp.org' ${rootfs_dir}/etc/systemd/timesyncd.conf + sed -i -e '/^#FallbackNTP=/cFallbackNTP=1.asia.pool.ntp.org 2.asia.pool.ntp.org' ${rootfs_dir}/etc/systemd/timesyncd.conf fi set -e #cp ${euler_dir}/hosts ${rootfs_dir}/etc/hosts @@ -190,11 +190,13 @@ make_img(){ mkdir -p ${root_mnt} ${boot_mnt} mount -t vfat -o uid=root,gid=root,umask=0000 ${bootp} ${boot_mnt} mount -t ext4 ${rootp} ${root_mnt} + prefix_len=${#loopX} + let prefix_len=prefix_len+13 fstab_array=("" "" "" "") for line in `blkid | grep /dev/mapper/${loopX}p` do partuuid=${line#*PARTUUID=\"} - fstab_array[${line:18:1}]=${partuuid%%\"*} + fstab_array[${line:$prefix_len:1}]=${partuuid%%\"*} done echo "PARTUUID=${fstab_array[3]} / ext4 defaults,noatime 0 0" > ${rootfs_dir}/etc/fstab echo "PARTUUID=${fstab_array[1]} /boot vfat defaults,noatime 0 0" >> ${rootfs_dir}/etc/fstab