fakeroot 可以用来模拟 root 权限,以便建立特定权限与档案拥有者的压缩文件案(tar, ar, .deb 等)。透过 LD_PRELOAD 的 dynamic loader 功能,用户不必实际拥有 root 权限。
生成系统文件时使用
echo "make squash image ..."
echo "${TOOLDIR}/makedevs -d device_table.txt ${CUDIR}/fs" > squash_input
echo "${TOOLDIR}/mksquashfs ${FS_DIR} ${2} -all-root -le -noappend" >> squash_input
echo "exit" >> squash_input
#chmod +x squash_input
#./squash_input
fakeroot<squash_input > /dev/null
rm squash_input