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
|
3
|
10
|
|
11
|
0
|
12 - hosts: all
|
|
13 remote_user: one
|
|
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
|
|
34 # this should be cd /usr/src/kernel ; git checkout
|
0
|
35 - name: git clone kernel
|
|
36 git: >
|
|
37 repo=git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/fedora.git
|
|
38 dest=/usr/src/kernels/fedora
|
|
39
|
3
|
40 # this does not work and unnecessary
|
1
|
41 # - name: authorize user script
|
|
42 # shell: /usr/libexec/pesign/pesign-authorize-users
|
0
|
43
|
1
|
44 #
|
2
|
45 # this does not work, we have to chdir to /usr/src/kernel
|
1
|
46 # - name: install kernel dev packages
|
|
47 # dnf: name={{ item }} state=present
|
|
48 # with_items:
|
|
49 # - builddep
|
|
50 # - kernel.spec
|
|
51 #
|
|
52 # args:
|
|
53 # chdir: /usr/src/kernels/fedora
|
3
|
54 # use shell command instead
|
|
55 #
|
|
56 - name: dnf builddep kernel.spec
|
|
57 command: dnf -y builddep kernel.spec
|
|
58 args:
|
|
59 chdir: /usr/src/kernel
|
|
60 creates: /bin/gcc
|
1
|
61
|
3
|
62 # olddefconfig requires old config file
|
2
|
63 - name: copy old .config
|
1
|
64 copy:
|
|
65 src: old.config
|
|
66 dest: /usr/src/kernels/fedora/.config
|
0
|
67
|
2
|
68 - name: make olddefconfig
|
|
69 shell: "{{ item }}"
|
|
70 with_items:
|
|
71 - make olddefconfig
|
|
72 args:
|
|
73 chdir: /usr/src/kernels/fedora
|
1
|
74
|
2
|
75 - name: make kernel
|
0
|
76 shell: "{{ item }}"
|
|
77 with_items:
|
|
78 - make -j8
|
2
|
79 args:
|
|
80 chdir: /usr/src/kernels/fedora
|
|
81
|
|
82 - name: make bzImage
|
|
83 shell: "{{ item }}"
|
|
84 with_items:
|
0
|
85 - make bzImage
|
2
|
86 args:
|
|
87 chdir: /usr/src/kernels/fedora
|
|
88
|
|
89 - name: make modules
|
|
90 shell: "{{ item }}"
|
|
91 with_items:
|
5
|
92 - make -j8 modules
|
|
93 - make -j8 modules_install
|
2
|
94 args:
|
|
95 chdir: /usr/src/kernels/fedora
|
|
96
|
|
97 - name: install kernel
|
|
98 shell: "{{ item }}"
|
|
99 with_items:
|
0
|
100 - make install
|
|
101 args:
|
|
102 chdir: /usr/src/kernels/fedora
|