Harmonize stages 0 and 2 kernel headers installation
[hvlinux.git] / stage2 / pkg / kernel-headers
index f9ee5bb..35810b3 100644 (file)
@@ -2,24 +2,13 @@
 
 hvbuild()
 {
-    # Check if kernel sources from stage0 are still in /usr/src.
-    # If not, recopy them.
-    if [ ! -d /usr/src/${PACKAGE} ]; then
-        # Decompress kernel sources
-        decompress_package ${PACKAGE} /usr/src
-
-        apply_patches ${PACKAGE} /usr/src
-    fi
-
     # Install headers
-    cd /usr/src/${PACKAGE}
-    make mrproper
-    make headers_check
+    cd ${LFS_TMP}/${PACKAGE}
+
+    local DESTDIR=/usr/include
 
-    # Remove any previous headers install
-    rm -rf dest
-    make INSTALL_HDR_PATH=dest headers_install
-    cp -rv dest/include/* /usr/include
-    find /usr/include -name .install -or -name ..install.cmd | xargs rm -fv
-    rm -rf dest
+    ${HVMAKE} mrproper
+    ${HVMAKE} INSTALL_HDR_PATH=dest headers_install
+    cp -rv dest/include/* ${DESTDIR}
+    find ${DESTDIR} -name .install -or -name ..install.cmd | xargs rm -fv
 }