copied from https://github.com/rockchip-linux/rk-rootfs-build/commit/9625f4ad023b6528d6da7ec4c340c48a4074e9a2