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
|
6
|
14 remote_user: xxxxx
|
0
|
15 become: yes
|
|
16 become_method: sudo
|
|
17 tasks:
|
|
18
|
|
19 - name: install kernel dev packages
|
|
20 dnf: name={{ item }} state=present
|
|
21 with_items:
|
|
22 - fedpkg
|
|
23 - fedora-packager
|
|
24 - rpmdevtools
|
|
25 - ncurses-devel
|
|
26 - pesign
|
2
|
27 - libselinux-python
|
0
|
28
|
|
29 - name: fedpkg clone
|
|
30 command: fedpkg clone -a kernel
|
|
31 args:
|
|
32 chdir: /usr/src/
|
|
33 creates: /usr/src/kernel
|
3
|
34
|
6
|
35 # we need not to this as root
|
|
36 #
|
3
|
37 # this should be cd /usr/src/kernel ; git checkout
|
0
|
38 - name: git clone kernel
|
|
39 git: >
|
|
40 repo=git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/fedora.git
|
|
41 dest=/usr/src/kernels/fedora
|
|
42
|
3
|
43 # this does not work and unnecessary
|
1
|
44 # - name: authorize user script
|
|
45 # shell: /usr/libexec/pesign/pesign-authorize-users
|
0
|
46
|
1
|
47 #
|
2
|
48 # this does not work, we have to chdir to /usr/src/kernel
|
1
|
49 # - name: install kernel dev packages
|
|
50 # dnf: name={{ item }} state=present
|
|
51 # with_items:
|
|
52 # - builddep
|
|
53 # - kernel.spec
|
|
54 #
|
|
55 # args:
|
|
56 # chdir: /usr/src/kernels/fedora
|
3
|
57 # use shell command instead
|
|
58 #
|
|
59 - name: dnf builddep kernel.spec
|
|
60 command: dnf -y builddep kernel.spec
|
|
61 args:
|
|
62 chdir: /usr/src/kernel
|
|
63 creates: /bin/gcc
|
1
|
64
|
3
|
65 # olddefconfig requires old config file
|
2
|
66 - name: copy old .config
|
1
|
67 copy:
|
|
68 src: old.config
|
|
69 dest: /usr/src/kernels/fedora/.config
|
0
|
70
|
2
|
71 - name: make olddefconfig
|
|
72 shell: "{{ item }}"
|
|
73 with_items:
|
|
74 - make olddefconfig
|
|
75 args:
|
|
76 chdir: /usr/src/kernels/fedora
|
1
|
77
|
2
|
78 - name: make kernel
|
0
|
79 shell: "{{ item }}"
|
|
80 with_items:
|
|
81 - make -j8
|
2
|
82 args:
|
|
83 chdir: /usr/src/kernels/fedora
|
|
84
|
|
85 - name: make bzImage
|
|
86 shell: "{{ item }}"
|
|
87 with_items:
|
0
|
88 - make bzImage
|
2
|
89 args:
|
|
90 chdir: /usr/src/kernels/fedora
|
|
91
|
|
92 - name: make modules
|
|
93 shell: "{{ item }}"
|
|
94 with_items:
|
5
|
95 - make -j8 modules
|
|
96 - make -j8 modules_install
|
2
|
97 args:
|
|
98 chdir: /usr/src/kernels/fedora
|
|
99
|
|
100 - name: install kernel
|
|
101 shell: "{{ item }}"
|
|
102 with_items:
|
0
|
103 - make install
|
|
104 args:
|
|
105 chdir: /usr/src/kernels/fedora
|