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