<commit_before>. $stdenv/setup

buildPhase() {
	cp $config .config
	echo "export INSTALL_PATH=$out" >> Makefile
	export INSTALL_MOD_PATH=$out
	make
	make modules_install

        # move this to install later on
        # largely copied from early FC3 kernel spec files
        stripHash $out
        version=$(echo $strippedName | cut -c 7-)

        # remove symlinks and create directories
        rm $out/lib/modules/${version}/build
        rm $out/lib/modules/${version}/source
        mkdir $out/lib/modules/${version}/build
        ln -s $out/lib/modules/${version}/build $out/lib/modules/${version}/source
        # copy all Makefiles and Kconfig files
        cp --parents `find  -type f -name Makefile -o -name "Kconfig*"` $out/lib/modules/${version}/build
        cp Module.symvers $out/lib/modules/$version/build

        # weed out unneeded stuff<commit_msg>embed Nix generated hash into kernel image and module path<commit_after>. $stdenv/setup

buildPhase() {
	cp $config .config
        #mkdir $out
        hashname=$(basename $out)
        echo $hashname
        if echo "$hashname" | grep -q '^[a-z0-9]\{32\}-'; then
          hashname=$(echo "$hashname" | cut -c -32)
        fi

        extraname=$(grep ^EXTRAVERSION Makefile)
        perl -p -i -e "s/^EXTRAVERSION.*/$extraname-$hashname/" Makefile
	echo "export INSTALL_PATH=$out" >> Makefile
	export INSTALL_MOD_PATH=$out
	make
	make modules_install

        # move this to install later on
        # largely copied from early FC3 kernel spec files
        stripHash $out
        version=$(echo $strippedName | cut -c 7-)-$hashname

        # remove symlinks and create directories
        rm $out/lib/modules/${version}/build
        rm $out/lib/modules/${version}/source
        mkdir $out/lib/modules/${version}/build
        ln -s $out/lib/modules/${version}/build $out/lib/modules/${version}/source
        # copy all Makefiles and Kconfig files
        cp --parents `find  -type f -name Makefile -o -name "Kconfig*"` $out/lib/modules/${version}/build
        cp Module.symvers $out/lib/modules/$version/build

        # weed out unneeded stuff
{'fraction_non_alphanumeric': 0.1210551106924164, 'fraction_numerical': 0.004710315591144607, 'mean_word_length': 2.551839464882943, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5312018', 'n_tokens_mistral': 648, 'n_tokens_neox': 641, 'n_words': 186}