forked from zhovner/OneFileLinux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_kernel.sh
More file actions
executable file
·52 lines (44 loc) · 1.87 KB
/
Copy pathbuild_kernel.sh
File metadata and controls
executable file
·52 lines (44 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
DPKG_BUILD='which dpkg-buildpackage'
# if [ -f $DPKG_BUILD ]; then
cp $PWD/cfg/buildroot_x86_64_glibc-systemd $PWD/buildroot/.config
cd $PWD/buildroot; make linux-source; cd ../
echo $PWD
if [ ! -L $PWD/linux ]; then
#mkdir -p $PWD/buildroot/output/build/linux-linux-rolling-stable
mkdir -p $PWD/buildroot/dl/linux/git/
#ln -s $PWD/buildroot/dl/linux/git/.git $PWD/buildroot/output/build/linux-linux-rolling-stable/.git
ln -s $PWD/buildroot/dl/linux/git $PWD/linux
#ln -s $PWD/buildroot/output/build/linux-linux-rolling-stable/.git $PWD/linux/.git
cd linux; git fetch; git reset --hard origin/linux-rolling-stable;
# git gc --aggressive --prune=all
fi
echo $PWD
if [ ! -L $PWD/linux/debian ]; then
# mkdir $PWD/linux/
echo $PWD
ln -s $PWD/debian/debian/ $PWD/linux/debian
cd $PWD/linux/debian; git fetch; git reset --hard origin/debian/7.1/forky; cd ../../ # debian/latest
echo $PWD
cd $PWD/linux/debian; patch -p1 < $PWD/../../patches/0000_dont_clean_kernel_build_on_error.patch; cd ../../
# git gc --aggressive --prune=all
fi
echo $PWD
# Configure build for the current the running pc/perhapsials
cp /boot/config-$(uname -r) $PWD/linux/.config
#make localmodconfig;
#make oldconfig;
ARCH=$(uname -m)
echo $PWD
$PWD/kernel-hardening-checker/bin/kernel-hardening-checker -g "${ARCH^^}" > $PWD/cfg/config_harden_fragment
$PWD/linux/scripts/kconfig/merge_config.sh $PWD/linux/.config $PWD/cfg/config_harden_fragment
$PWD/kernel-hardening-checker/bin/kernel-hardening-checker -c $PWD/linux/.config
cd $PWD/linux/ && yes ´´ | make localmodconfig && cp $PWD/.config $PWD/../cfg/current_building_kernel_config && make mrproper;
#ROOT_ARCH=`uname -m`
#if [ -f $DPKG_BUILD ]; then
# dpkg-buildpackage -us -ui -uc --no-sign --build=binary --no-post-clean
#fi
# Apply Debian patches regardless
echo $PWD
make -f debian/rules source &&
cd $PWD/../buildroot; make linux-rebuild # ./build_buildroot.sh