3
|
1 # build Feora Linux kernel from sourcr
|
|
2 # kono@ie.u-ryukyu.ac.jp
|
|
3 #
|
8
|
4 # old.config generates non address randomize kernel for gdb
|
4
|
5 #
|
|
6 # prepare at least 30GB of file space
|
|
7 # ( Fedora default is 15GB, no matter how HDD big size )
|
|
8 #
|
|
9 # rsync -av -e 'ssh -p 2222' ~/.ssh/id_rsa.pub xxx@localhost:.ssh/authorized_keys
|
|
10 # screen -L ansible-playbook -i hosts main.yml --ask-become-pass
|
6
|
11 # ssh localhost -p 2222 -l root 'cd /usr/src/kernels ; tar czf - fedora' | dd of=fedora26-kernel.tgz
|
3
|
12
|
0
|
13 - hosts: all
|
9
|
14 remote_user: ie-user
|
0
|
15 become: yes
|
|
16 become_method: sudo
|
|
17 tasks:
|
|
18
|
|
19 - name: install kernel dev packages
|
9
|
20 dnf:
|
|
21 state: present
|
|
22 name:
|
|
23 - fedpkg
|
|
24 - fedora-packager
|
|
25 - rpmdevtools
|
|
26 - ncurses-devel
|
|
27 - pesign
|
|
28 - libselinux-python3
|
0
|
29
|
|
30 - name: fedpkg clone
|
9
|
31 command: fedpkg clone -a --depth 1 kernel
|
0
|
32 args:
|
|
33 chdir: /usr/src/
|
|
34 creates: /usr/src/kernel
|
3
|
35
|
6
|
36 # we need not to this as root
|
|
37 #
|
3
|
38 # this should be cd /usr/src/kernel ; git checkout
|
0
|
39 - name: git clone kernel
|
|
40 git: >
|
|
41 repo=git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/fedora.git
|
|
42 dest=/usr/src/kernels/fedora
|
|
43
|
3
|
44 # this does not work and unnecessary
|
1
|
45 # - name: authorize user script
|
|
46 # shell: /usr/libexec/pesign/pesign-authorize-users
|
0
|
47
|
1
|
48 #
|
2
|
49 # this does not work, we have to chdir to /usr/src/kernel
|
1
|
50 # - name: install kernel dev packages
|
|
51 # dnf: name={{ item }} state=present
|
|
52 # with_items:
|
|
53 # - builddep
|
|
54 # - kernel.spec
|
|
55 #
|
|
56 # args:
|
|
57 # chdir: /usr/src/kernels/fedora
|
3
|
58 # use shell command instead
|
|
59 #
|
|
60 - name: dnf builddep kernel.spec
|
|
61 command: dnf -y builddep kernel.spec
|
|
62 args:
|
|
63 chdir: /usr/src/kernel
|
|
64 creates: /bin/gcc
|
1
|
65
|
3
|
66 # olddefconfig requires old config file
|
2
|
67 - name: copy old .config
|
1
|
68 copy:
|
|
69 src: old.config
|
|
70 dest: /usr/src/kernels/fedora/.config
|
0
|
71
|
2
|
72 - name: make olddefconfig
|
9
|
73 become: yes
|
|
74 make:
|
|
75 target: olddefconfig
|
2
|
76 chdir: /usr/src/kernels/fedora
|
9
|
77 params:
|
|
78 NUM_THREADS: 8
|
1
|
79
|
2
|
80 - name: make kernel
|
9
|
81 become: yes
|
|
82 make:
|
2
|
83 chdir: /usr/src/kernels/fedora
|
9
|
84 params:
|
|
85 NUM_THREADS: 8
|
2
|
86
|
|
87 - name: make bzImage
|
9
|
88 become: yes
|
|
89 make:
|
|
90 target: bzImage
|
2
|
91 chdir: /usr/src/kernels/fedora
|
9
|
92 params:
|
|
93 NUM_THREADS: 8
|
2
|
94
|
|
95 - name: make modules
|
9
|
96 become: yes
|
|
97 make:
|
|
98 target: modules
|
2
|
99 chdir: /usr/src/kernels/fedora
|
9
|
100 params:
|
|
101 NUM_THREADS: 8
|
|
102
|
|
103 - name: make modules_install
|
|
104 become: yes
|
|
105 make:
|
|
106 target: modules_install
|
|
107 chdir: /usr/src/kernels/fedora
|
|
108 params:
|
|
109 NUM_THREADS: 8
|
|
110
|
2
|
111
|
|
112 - name: install kernel
|
9
|
113 become: yes
|
|
114 make:
|
|
115 target: install
|
0
|
116 chdir: /usr/src/kernels/fedora
|
9
|
117 params:
|
|
118 NUM_THREADS: 8
|