ANDROID: mnt: Propagate remount correctly
[GitHub/exynos8895/android_kernel_samsung_universal8895.git] / scripts / link-vmlinux.sh
old mode 100755 (executable)
new mode 100644 (file)
index 1a10d8a..48e6f84
@@ -62,7 +62,7 @@ vmlinux_link()
                        -Wl,--start-group                                    \
                                 ${KBUILD_VMLINUX_MAIN}                      \
                        -Wl,--end-group                                      \
-                       -lutil ${1}
+                       -lutil -lrt -lpthread ${1}
                rm -f linux
        fi
 }
@@ -248,5 +248,28 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then
        fi
 fi
 
+# CFP instrumentation will change binary, need to be before FIPS
+if [ -n "${CONFIG_RKP_CFP}" ]; then
+       echo '  RKP_CFP : instrumenting vmlinux... '
+       "${srctree}/scripts/rkp_cfp/instrument.py" --vmlinux "${objtree}/vmlinux" --config "${objtree}/.config"  --inplace
+fi
+
+if [ -n "${CONFIG_RELOCATABLE_KERNEL}" ]; then
+    if [ -n "${CONFIG_CRYPTO_FIPS}" ]; then
+       echo '  FIPS with KALSR : Generating hmac of crypto and fmp, then update vmlinux... '
+       ${CONFIG_SHELL} "${srctree}/scripts/fips_kaslr_crypto_hmac.sh" "${objtree}/vmlinux" "${objtree}/System.map"
+    fi
+else
+    if [ -n "${CONFIG_CRYPTO_FIPS}" ]; then
+       echo '  FIPS : Generating hmac of crypto and updating vmlinux... '
+       ${CONFIG_SHELL} "${srctree}/scripts/fips_crypto_hmac.sh" "${objtree}/vmlinux" "${objtree}/System.map"
+    fi
+    
+    if [ -n "${CONFIG_FIPS_FMP}" ]; then
+       echo '  FIPS : Generating hmac of fmp and updating vmlinux... '
+       ${CONFIG_SHELL} "${srctree}/scripts/fips_fmp_hmac.sh" "${objtree}/vmlinux" "${objtree}/System.map"
+    fi
+fi
+
 # We made a new kernel - delete old version file
 rm -f .old_version