Browse code

initramfs enhancements: fsck, versioning Rename linux-dev -> linux-devel

Change-Id: I7738ec89ccefcf21d1c3d79833980f9b40abf85d
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/1429
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Vinay Kulkarni <kulkarniv@vmware.com>

Alexey Makhalov authored on 2016/09/21 18:26:53
Showing 9 changed files
... ...
@@ -18,7 +18,7 @@ BuildRequires:	curl
18 18
 BuildRequires:	zlib-devel
19 19
 BuildRequires:	ncurses-devel
20 20
 BuildRequires:  automake
21
-BuildRequires:	linux-dev = %{KERNEL_VERSION}-%{KERNEL_RELEASE}
21
+BuildRequires:	linux-devel = %{KERNEL_VERSION}-%{KERNEL_RELEASE}
22 22
 BuildRequires:  autoconf 
23 23
 BuildRequires:  libgcrypt 
24 24
 BuildRequires:  sysdig
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:	initramfs
2 2
 Name:		initramfs
3 3
 Version:	1.0
4
-Release:	4%{?kernelsubrelease}%{?dist}
4
+Release:	5%{?kernelsubrelease}%{?dist}
5 5
 License:	Apache License
6 6
 Group:		System Environment/Base
7 7
 Vendor:		VMware, Inc.
... ...
@@ -10,6 +10,7 @@ Provides:	initramfs
10 10
 BuildRequires:       linux = %{KERNEL_VERSION}-%{KERNEL_RELEASE}
11 11
 BuildRequires:       dracut
12 12
 BuildRequires:       ostree
13
+BuildRequires:       e2fsprogs
13 14
 Requires:	     linux = %{KERNEL_VERSION}-%{KERNEL_RELEASE}
14 15
 
15 16
 %description
... ...
@@ -28,13 +29,11 @@ echo 'add_drivers+="tmem xen-acpi-processor xen-evtchn xen-gntalloc xen-gntdev x
28 28
 echo 'add_dracutmodules+=" ostree systemd "' > /etc/dracut.conf.d/ostree.conf
29 29
 
30 30
 %build
31
-dracut --force --kver %{KERNEL_VERSION} initrd.img-no-kmods
31
+dracut --force --kver %{KERNEL_VERSION} --fscks "e2fsck fsck fsck.ext2 fsck.ext3 fsck.ext4" initrd.img-%{KERNEL_VERSION}-%{KERNEL_RELEASE}
32 32
 %install
33 33
 rm -rf $RPM_BUILD_ROOT
34 34
 install -d $RPM_BUILD_ROOT/boot
35
-install -m 600 initrd.img-no-kmods $RPM_BUILD_ROOT/boot/initrd.img-no-kmods
36
-
37
-%post
35
+install -m 600 initrd.img-%{KERNEL_VERSION}-%{KERNEL_RELEASE} $RPM_BUILD_ROOT/boot/initrd.img-%{KERNEL_VERSION}-%{KERNEL_RELEASE}
38 36
 
39 37
 %clean
40 38
 rm -rf $RPM_BUILD_ROOT
... ...
@@ -42,15 +41,18 @@ rm -rf $RPM_BUILD_ROOT
42 42
 %files
43 43
 %defattr(-,root,root,-)
44 44
 %dir /boot
45
-/boot/initrd.img-no-kmods 
45
+/boot/initrd.img-%{KERNEL_VERSION}-%{KERNEL_RELEASE}
46 46
 
47 47
 %changelog
48
+*   Tue Sep 20 2016 Alexey Makhalov <amakhalov@vmware.com> 1.0-5
49
+-   Added fsck tools
50
+-   Use kernel version and release number in initrd file name
48 51
 *   Mon Aug 1 2016 Divya Thaluru <dthaluru@vmware.com> 1.0-4
49 52
 -   Added kernel macros
50 53
 *   Thu Jun 30 2016 Xiaolin Li <xiaolinl@vmware.com> 1.0-4
51 54
 -   Exapand setup macro and remove the source file.
52
-*	Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0-3
53
--	GA - Bump release of all rpms
55
+*   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0-3
56
+-   GA - Bump release of all rpms
54 57
 *   Thu Apr 28 2016 Alexey Makhalov <amakhalov@vmware.com> 1.0-2
55 58
 -   Update to linux-4.4.8
56 59
 *   Thu Mar 24 2016 Xiaolin Li <xiaolinl@vmware.com> 1.0-1
... ...
@@ -23,7 +23,7 @@ BuildRequires:  libgcc
23 23
 BuildRequires:  libgcc-devel
24 24
 BuildRequires:  make
25 25
 BuildRequires:  linux
26
-BuildRequires:  linux-dev
26
+BuildRequires:  linux-devel
27 27
 BuildRequires:  perl
28 28
 BuildRequires:  xz
29 29
 BuildRequires:  xz-devel
... ...
@@ -11,7 +11,7 @@ Vendor:     VMware, Inc.
11 11
 Patch0:        linux-4.4-support.patch
12 12
 Distribution:  Photon
13 13
 BuildRequires: elfutils-devel
14
-BuildRequires: linux-dev = %{KERNEL_VERSION}-%{KERNEL_RELEASE}
14
+BuildRequires: linux-devel = %{KERNEL_VERSION}-%{KERNEL_RELEASE}
15 15
 BuildRequires: linux = %{KERNEL_VERSION}-%{KERNEL_RELEASE}
16 16
 BuildRequires: unzip
17 17
 Requires: kmod
... ...
@@ -2,7 +2,7 @@
2 2
 Summary:       Kernel
3 3
 Name:          linux-esx
4 4
 Version:       4.4.20
5
-Release:       1%{?dist}
5
+Release:       2%{?dist}
6 6
 License:       GPLv2
7 7
 URL:           http://www.kernel.org/
8 8
 Group:         System Environment/Kernel
... ...
@@ -101,16 +101,17 @@ install -vdm 755 %{buildroot}%{_defaultdocdir}/linux-esx-%{version}
101 101
 install -vdm 755 %{buildroot}/etc/modprobe.d
102 102
 install -vdm 755 %{buildroot}/usr/src/%{name}-headers-%{version}-%{release}
103 103
 make INSTALL_MOD_PATH=%{buildroot} modules_install
104
-cp -v arch/x86/boot/bzImage    %{buildroot}/boot/vmlinuz-esx-%{version}
105
-cp -v System.map        %{buildroot}/boot/system.map-esx-%{version}
106
-cp -v .config            %{buildroot}/boot/config-esx-%{version}
104
+cp -v arch/x86/boot/bzImage    %{buildroot}/boot/vmlinuz-esx-%{version}-%{release}
105
+cp -v System.map        %{buildroot}/boot/system.map-esx-%{version}-%{release}
106
+cp -v .config            %{buildroot}/boot/config-esx-%{version}-%{release}
107
+cp -v vmlinux			%{buildroot}/lib/modules/%{version}-esx/vmlinux-esx-%{version}-%{release}
107 108
 cp -r Documentation/*        %{buildroot}%{_defaultdocdir}/linux-esx-%{version}
108 109
 
109 110
 # TODO: noacpi acpi=off noapic pci=conf1,nodomains pcie_acpm=off pnpacpi=off
110 111
 cat > %{buildroot}/boot/%{name}-%{version}-%{release}.cfg << "EOF"
111 112
 # GRUB Environment Block
112 113
 photon_cmdline=init=/lib/systemd/systemd rcupdate.rcu_expedited=1 rw systemd.show_status=0 quiet noreplace-smp cpu_init_udelay=0 plymouth.enable=0
113
-photon_linux=vmlinuz-esx-%{version}
114
+photon_linux=vmlinuz-esx-%{version}-%{release}
114 115
 EOF
115 116
 
116 117
 # cleanup dangling symlinks
... ...
@@ -127,6 +128,7 @@ find arch/x86/include Module.symvers include scripts -type f | xargs  sh -c 'cp
127 127
 cp .config %{buildroot}/usr/src/%{name}-headers-%{version}-%{release}
128 128
 # symling to the build folder
129 129
 ln -sf /usr/src/%{name}-headers-%{version}-%{release} %{buildroot}/lib/modules/%{version}-esx/build
130
+find %{buildroot}/lib/modules -name '*.ko' -print0 | xargs -0 chmod u+x
130 131
 
131 132
 %post
132 133
 /sbin/depmod -aq %{version}-esx
... ...
@@ -134,12 +136,13 @@ ln -sf %{name}-%{version}-%{release}.cfg /boot/photon.cfg
134 134
 
135 135
 %files
136 136
 %defattr(-,root,root)
137
-/boot/system.map-esx-%{version}
138
-/boot/config-esx-%{version}
139
-/boot/vmlinuz-esx-%{version}
137
+/boot/system.map-esx-%{version}-%{release}
138
+/boot/config-esx-%{version}-%{release}
139
+/boot/vmlinuz-esx-%{version}-%{release}
140 140
 %config(noreplace) /boot/%{name}-%{version}-%{release}.cfg
141 141
 /lib/modules/*
142 142
 %exclude /lib/modules/%{version}-esx/build
143
+%exclude /lib/modules/%{version}-esx/vmlinux-%{version}-%{release}
143 144
 %exclude /usr/src
144 145
 
145 146
 %files docs
... ...
@@ -152,6 +155,9 @@ ln -sf %{name}-%{version}-%{release}.cfg /boot/photon.cfg
152 152
 /usr/src/%{name}-headers-%{version}-%{release}
153 153
 
154 154
 %changelog
155
+*   Tue Sep 20 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.20-2
156
+-   Add -release number for /boot/* files
157
+-   Fixed generation of debug symbols for kernel modules & vmlinux
155 158
 *   Wed Sep  7 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.20-1
156 159
 -   Update to linux-4.4.20
157 160
 -   keys-fix-asn.1-indefinite-length-object-parsing.patch
... ...
@@ -2,7 +2,7 @@
2 2
 Summary:        Kernel
3 3
 Name:           linux
4 4
 Version:    	4.4.20
5
-Release:    	1%{?dist}
5
+Release:    	2%{?dist}
6 6
 License:    	GPLv2
7 7
 URL:        	http://www.kernel.org/
8 8
 Group:        	System Environment/Kernel
... ...
@@ -48,11 +48,11 @@ Requires:       filesystem kmod coreutils
48 48
 The Linux package contains the Linux kernel. 
49 49
 
50 50
 
51
-%package dev
51
+%package devel
52 52
 Summary:    Kernel Dev
53 53
 Group:        System Environment/Kernel
54 54
 Requires:    python2
55
-%description dev
55
+%description devel
56 56
 The Linux package contains the Linux kernel dev files
57 57
 
58 58
 %package drivers-gpu
... ...
@@ -118,20 +118,20 @@ install -vdm 755 %{buildroot}/etc/modprobe.d
118 118
 install -vdm 755 %{buildroot}/usr/src/%{name}-headers-%{version}-%{release}
119 119
 make INSTALL_MOD_PATH=%{buildroot} modules_install
120 120
 
121
-cp -v arch/x86/boot/bzImage    %{buildroot}/boot/vmlinuz-%{version}
122
-cp -v System.map        %{buildroot}/boot/System.map-%{version}
123
-cp -v .config           %{buildroot}/boot/config-%{version}
124
-cp -v vmlinux			%{buildroot}/lib/modules/%{version}/vmlinux-%{version}
121
+cp -v arch/x86/boot/bzImage    %{buildroot}/boot/vmlinuz-%{version}-%{release}
122
+cp -v System.map        %{buildroot}/boot/System.map-%{version}-%{release}
123
+cp -v .config           %{buildroot}/boot/config-%{version}-%{release}
124
+cp -v vmlinux			%{buildroot}/lib/modules/%{version}/vmlinux-%{version}-%{release}
125 125
 cp -r Documentation/*        %{buildroot}%{_defaultdocdir}/%{name}-%{version}
126 126
 cat > %{buildroot}/boot/%{name}-%{version}-%{release}.cfg << "EOF"
127 127
 # GRUB Environment Block
128 128
 photon_cmdline=init=/lib/systemd/systemd ro loglevel=3 quiet plymouth.enable=0
129
-photon_linux=vmlinuz-%{version}
130
-photon_initrd=initrd.img-no-kmods
129
+photon_linux=vmlinuz-%{version}-%{release}
130
+photon_initrd=initrd.img-%{version}-%{release}
131 131
 EOF
132 132
 
133 133
 # Restrict the permission on System.map-X file
134
-chmod -v 400 %{buildroot}/boot/System.map-%{version}
134
+chmod -v 400 %{buildroot}/boot/System.map-%{version}-%{release}
135 135
 
136 136
 #    Cleanup dangling symlinks
137 137
 rm -rf %{buildroot}/lib/modules/%{version}/source
... ...
@@ -159,13 +159,13 @@ ln -sf %{name}-%{version}-%{release}.cfg /boot/photon.cfg
159 159
 /sbin/depmod -aq %{version}
160 160
 
161 161
 %post debuginfo
162
-ln -s /usr/lib/debug/lib/modules/%{version}/vmlinux-%{version}.debug /boot/vmlinux-%{version}.debug
162
+ln -s /usr/lib/debug/lib/modules/%{version}/vmlinux-%{version}-%{release}.debug /boot/vmlinux-%{version}-%{release}.debug
163 163
 
164 164
 %files
165 165
 %defattr(-,root,root)
166
-/boot/System.map-%{version}
167
-/boot/config-%{version}
168
-/boot/vmlinuz-%{version}
166
+/boot/System.map-%{version}-%{release}
167
+/boot/config-%{version}-%{release}
168
+/boot/vmlinuz-%{version}-%{release}
169 169
 %config(noreplace) /boot/%{name}-%{version}-%{release}.cfg
170 170
 /lib/firmware/*
171 171
 %defattr(0644,root,root)
... ...
@@ -174,13 +174,13 @@ ln -s /usr/lib/debug/lib/modules/%{version}/vmlinux-%{version}.debug /boot/vmlin
174 174
 %exclude /lib/modules/%{version}/kernel/drivers/gpu
175 175
 %exclude /lib/modules/%{version}/kernel/sound
176 176
 %exclude /lib/modules/%{version}/kernel/arch/x86/oprofile/
177
-%exclude /lib/modules/%{version}/vmlinux-%{version}
177
+%exclude /lib/modules/%{version}/vmlinux-%{version}-%{release}
178 178
 
179 179
 %files docs
180 180
 %defattr(-,root,root)
181 181
 %{_defaultdocdir}/%{name}-%{version}/*
182 182
 
183
-%files dev
183
+%files devel
184 184
 %defattr(-,root,root)
185 185
 /lib/modules/%{version}/build
186 186
 /usr/src/%{name}-headers-%{version}-%{release}
... ...
@@ -199,6 +199,10 @@ ln -s /usr/lib/debug/lib/modules/%{version}/vmlinux-%{version}.debug /boot/vmlin
199 199
 /lib/modules/%{version}/kernel/arch/x86/oprofile/
200 200
 
201 201
 %changelog
202
+*   Tue Sep 20 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.20-2
203
+-   Add -release number for /boot/* files
204
+-   Use initrd.img with version and release number
205
+-   Rename -dev subpackage to -devel
202 206
 *   Wed Sep  7 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.20-1
203 207
 -   Update to linux-4.4.20
204 208
 -   apparmor-fix-oops-validate-buffer-size-in-apparmor_setprocattr.patch 
... ...
@@ -11,7 +11,7 @@ Distribution:	Photon
11 11
 Source0:	https://github.com/draios/sysdig/archive/%{name}-%{version}.tar.gz
12 12
 %define sha1 sysdig=272b95ad02be4d194bba66d360ff935084d9c842
13 13
 BuildRequires:	cmake 
14
-BuildRequires:  linux-dev = %{KERNEL_VERSION}-%{KERNEL_RELEASE}
14
+BuildRequires:  linux-devel = %{KERNEL_VERSION}-%{KERNEL_RELEASE}
15 15
 BuildRequires:	openssl-devel
16 16
 BuildRequires:	curl
17 17
 BuildRequires:	zlib-devel
... ...
@@ -43,7 +43,7 @@ BuildRequires: pkg-config
43 43
 BuildRequires: rpm-devel
44 44
 %endif
45 45
 Requires:      gcc
46
-Requires:      linux-dev
46
+Requires:      linux-devel
47 47
 Requires:      make
48 48
 Requires:	   elfutils 
49 49
 Requires:      %{name}-runtime = %{?epoch:%epoch:}%{version}-%{release}
... ...
@@ -69,7 +69,7 @@ Initscript for Systemtap scripts.
69 69
 %package runtime
70 70
 Group:         System/Tools
71 71
 Summary:       Instrumentation System Runtime
72
-Requires:      linux-dev
72
+Requires:      linux-devel
73 73
 
74 74
 %description runtime
75 75
 SystemTap runtime is the runtime component of an instrumentation system for systems running Linux.
... ...
@@ -85,7 +85,7 @@
85 85
         "util-linux-lang",
86 86
         "util-linux-devel",
87 87
         "db-docs",
88
-        "linux-dev",
88
+        "linux-devel",
89 89
         "linux-docs",
90 90
         "mpc",
91 91
         "json-glib",