···1616 };
17171818 preAutoreconf = ''
1919- # ply wants to install header fails to its build directory
2020- # use 7z to handle multiple archive formats transparently
2121- 7z x ${kernel.src} -so | 7z x -aoa -si -ttar
1919+ # If kernel sources are a folder (i.e. fetched from git), we just copy them in
2020+ # Since they are owned by uid 0 and read-only, we need to fix permissions
2121+ if [ -d ${kernel.src} ]; then
2222+ cp -r ${kernel.src} linux-${kernel.version}
2323+ chown -R $(whoami): linux-${kernel.version}
2424+ chmod -R a+w linux-${kernel.version}
2525+ else
2626+ # ply wants to install header files to its build directory
2727+ # use 7z to handle multiple archive formats transparently
2828+ 7z x ${kernel.src} -so | 7z x -aoa -si -ttar
2929+ fi
22302331 configureFlagsArray+=(--with-kerneldir=$(echo $(pwd)/linux-*))
2432 ./autogen.sh --prefix=$out