The populate-volatile script will check for "clearcache" in the kernel
command line and wipe the caches if it has been set. This is useful at
boot, but we shouldn't be checking the kernel commandline when being
ran on the build machine at rootfs-time.
[ YOCTO #16056 ]
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
}
clearcache=0
-exec 9</proc/cmdline
-while read -r line <&9
-do
- case "$line" in
- *clearcache*) clearcache=1
- ;;
- *) continue
- ;;
- esac
-done
-exec 9>&-
+if test -z "$ROOT_DIR"; then
+ exec 9</proc/cmdline
+ while read -r line <&9
+ do
+ case "$line" in
+ *clearcache*) clearcache=1
+ ;;
+ *) continue
+ ;;
+ esac
+ done
+ exec 9>&-
+fi
if test -e "${ROOT_DIR}/etc/volatile.cache" -a "$VOLATILE_ENABLE_CACHE" = "yes" -a "x$1" != "xupdate" -a "x$clearcache" = "x0"
then