Browse code

enable devpts mount in chroot

Change-Id: I026df3f74350eb728b11a60e9bbcc9f0a75fc294
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/3779
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>

Bo Gan authored on 2017/09/16 03:59:14
Showing 11 changed files
... ...
@@ -89,7 +89,6 @@ python2 setup.py install --prefix=%{_prefix} --root=%{buildroot}
89 89
 
90 90
 %check
91 91
 easy_install_2=$(ls /usr/bin |grep easy_install |grep 2)
92
-mount -t devpts -o gid=4,mode=620 none /dev/pts
93 92
 route add -net 224.0.0.0 netmask 240.0.0.0 dev lo
94 93
 $easy_install_2 pip
95 94
 pip install --upgrade tox
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        A high-level scripting language
2 2
 Name:           python2
3 3
 Version:        2.7.13
4
-Release:        8%{?dist}
4
+Release:        9%{?dist}
5 5
 License:        PSF
6 6
 URL:            http://www.python.org/
7 7
 Group:          System Environment/Programming
... ...
@@ -155,7 +155,6 @@ find %{buildroot}%{_libdir} -name '*.pyo' -delete
155 155
 rm -rf %{buildroot}/*
156 156
 
157 157
 %check
158
-mount -t devpts -o gid=4,mode=620 none /dev/pts
159 158
 make test
160 159
 
161 160
 %files 
... ...
@@ -237,6 +236,8 @@ make test
237 237
 %{_libdir}/python2.7/test/*
238 238
 
239 239
 %changelog
240
+*   Fri Sep 15 2017 Bo Gan <ganb@vmware.com> 2.7.13-9
241
+-   Remove devpts mount in check
240 242
 *   Mon Aug 28 2017 Chang Lee <changlee@vmware.com> 2.7.13-8
241 243
 -   Add %check with pty
242 244
 *   Wed Jul 12 2017 Xiaolin Li <xiaolinl@vmware.com> 2.7.13-7
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        A high-level scripting language
2 2
 Name:           python3
3 3
 Version:        3.6.1
4
-Release:        7%{?dist}
4
+Release:        8%{?dist}
5 5
 License:        PSF
6 6
 URL:            http://www.python.org/
7 7
 Group:          System Environment/Programming
... ...
@@ -164,7 +164,6 @@ find %{buildroot}%{_libdir} -name '*.o' -delete
164 164
 rm %{buildroot}%{_bindir}/2to3
165 165
 
166 166
 %check
167
-mount -t devpts -o gid=4,mode=620 none /dev/pts
168 167
 make  %{?_smp_mflags} test
169 168
 
170 169
 %post -p /sbin/ldconfig
... ...
@@ -264,6 +263,8 @@ rm -rf %{buildroot}/*
264 264
 %{_libdir}/python3.6/test/*
265 265
 
266 266
 %changelog
267
+*   Fri Sep 15 2017 Bo Gan <ganb@vmware.com> 3.6.1-8
268
+-   Remove devpts mount in check
267 269
 *   Mon Aug 28 2017 Dheeraj Shetty <dheerajs@vmware.com> 3.6.1-7
268 270
 -   Add pty for tests to pass
269 271
 *   Wed Jul 12 2017 Xiaolin Li <xiaolinl@vmware.com> 3.6.1-6
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        Utilities for file systems, consoles, partitions, and messages
2 2
 Name:           util-linux
3 3
 Version:        2.29.2
4
-Release:        3%{?dist}
4
+Release:        4%{?dist}
5 5
 URL:            http://www.kernel.org/pub/linux/utils/util-linux
6 6
 License:        GPLv2+
7 7
 Group:          Applications/System
... ...
@@ -59,10 +59,7 @@ find %{buildroot} -name '*.la' -delete
59 59
 
60 60
 %check
61 61
 chown -Rv nobody .
62
-echo "none  /dev/pts devpts" >> /etc/fstab
63
-mount /dev/pts
64 62
 sudo -u nobody -s /bin/bash -c "PATH=$PATH make -k check"
65
-umount /dev/pts
66 63
 rm -rf %{buildroot}/lib/systemd/system
67 64
 
68 65
 %post   -p /sbin/ldconfig
... ...
@@ -99,6 +96,8 @@ rm -rf %{buildroot}/lib/systemd/system
99 99
 %{_mandir}/man3/*
100 100
 
101 101
 %changelog
102
+*   Fri Sep 15 2017 Bo Gan <ganb@vmware.com> 2.29.2-4
103
+-   Cleanup check
102 104
 *   Mon Jul 31 2017 Xiaolin Li <xiaolinl@vmware.com> 2.29.2-3
103 105
 -   Fixed rpm check errors.
104 106
 *   Thu Apr 20 2017 Alexey Makhalov <amakhalov@vmware.com> 2.29.2-2
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        library for fast, message-based applications
2 2
 Name:           zeromq
3 3
 Version:        4.1.4
4
-Release:        2%{?dist}
4
+Release:        3%{?dist}
5 5
 URL:            http://www.zeromq.org
6 6
 License:        LGPLv3+
7 7
 Group:          System Environment/Libraries
... ...
@@ -38,8 +38,7 @@ make DESTDIR=%{buildroot} install
38 38
 find %{buildroot}%{_libdir} -name '*.la' -delete
39 39
 
40 40
 %check
41
-mount -t devpts -o gid=4,mode=620 none /dev/pts
42
-ulimit -n 1200 && make check
41
+make check
43 42
 
44 43
 %post   -p /sbin/ldconfig
45 44
 %postun -p /sbin/ldconfig
... ...
@@ -58,6 +57,8 @@ ulimit -n 1200 && make check
58 58
 %{_mandir}/*
59 59
 
60 60
 %changelog
61
+*   Fri Sep 15 2017 Bo Gan <ganb@vmware.com> 4.1.4-3
62
+-   Remove devpts mount
61 63
 *   Mon Aug 07 2017 Chang Lee <changlee@vmware.com> 4.1.4-2
62 64
 -   Fixed %check
63 65
 *   Thu Apr 13 2017 Dheeraj Shetty <dheerajs@vmware.com> 4.1.4-1
... ...
@@ -3,7 +3,7 @@
3 3
 Summary:      Z shell
4 4
 Name:         zsh
5 5
 Version:      5.3.1
6
-Release:      2%{?dist}
6
+Release:      3%{?dist}
7 7
 License:      MIT
8 8
 URL:          http://zsh.sourceforge.net/
9 9
 Group:        System Environment/Shells
... ...
@@ -68,15 +68,8 @@ export LIBLDFLAGS='-z lazy'
68 68
 make all html
69 69
 
70 70
 %check
71
-#Ubuntu dev machine can have different test failures like Y01completion.ztst, Y02compmatch.ztst, and Y03arguments.ztst
72
-if `uname -a | grep photon`;then
73
-    mount -t devpts -o gid=4,mode=620 none /dev/pts
74
-    #Skip the C02cond.ztst that failed in Phootn OS chroot.
75
-    rm -f Test/C02cond.ztst
76
-    make check
77
-else
78
-    echo '*** The chroot file system from other OSes does not support all zsh test cases ***'
79
-fi
71
+rm -f Test/C02cond.ztst
72
+make check
80 73
 %install
81 74
 rm -rf $RPM_BUILD_ROOT
82 75
 
... ...
@@ -151,6 +144,8 @@ fi
151 151
 %doc Doc/*.html
152 152
 
153 153
 %changelog
154
+*   Fri Sep 15 2017 Bo Gan <ganb@vmware.com> 5.3.1-3
155
+-   Clean up check
154 156
 *   Wed Aug 02 2017 Chang Lee <changlee@vmware.com> 5.3.1-2
155 157
 -   Skip a test case that is not supported from photon OS chroot
156 158
 *   Wed Apr 05 2017 Xiaolin Li <xiaolinl@vmware.com> 5.3.1-1
... ...
@@ -26,8 +26,7 @@ LOGFILE=/var/log/"${PRGNAME}-${LOGFILE}"    #   set log file name
26 26
 if mountpoint ${BUILDROOT}/run  >/dev/null 2>&1; then umount ${BUILDROOT}/run; fi
27 27
 if mountpoint ${BUILDROOT}/sys  >/dev/null 2>&1; then umount ${BUILDROOT}/sys; fi
28 28
 if mountpoint ${BUILDROOT}/proc >/dev/null 2>&1; then umount ${BUILDROOT}/proc; fi
29
-if mountpoint ${BUILDROOT}/dev/pts  >/dev/null 2>&1; then umount ${BUILDROOT}/dev/pts; fi
30
-if mountpoint ${BUILDROOT}/dev  >/dev/null 2>&1; then umount ${BUILDROOT}/dev; fi
29
+if mountpoint ${BUILDROOT}/dev  >/dev/null 2>&1; then umount -R ${BUILDROOT}/dev; fi
31 30
 [ ${EUID} -eq 0 ]   || fail "${PRGNAME}: Need to be root user: FAILURE"
32 31
 
33 32
 cd ${BUILDROOT} || fail "${PRGNAME}: Change directory: ${BUILDROOT}: FAILURE"
... ...
@@ -64,8 +63,7 @@ fi
64 64
 #
65 65
 #   Mount kernel filesystem
66 66
 #
67
-if ! mountpoint ${BUILDROOT}/dev    >/dev/null 2>&1; then mount --bind /dev ${BUILDROOT}/dev; fi
68
-if ! mountpoint ${BUILDROOT}/dev/pts    >/dev/null 2>&1; then mount -t devpts devpts ${BUILDROOT}/dev/pts -o gid=5,mode=620; fi
67
+if ! mountpoint ${BUILDROOT}/dev    >/dev/null 2>&1; then mount --rbind /dev ${BUILDROOT}/dev; mount --make-rslave ${BUILDROOT}/dev; fi
69 68
 if ! mountpoint ${BUILDROOT}/proc   >/dev/null 2>&1; then mount -t proc proc ${BUILDROOT}/proc; fi
70 69
 if ! mountpoint ${BUILDROOT}/sys    >/dev/null 2>&1; then mount -t sysfs sysfs ${BUILDROOT}/sys; fi
71 70
 if ! mountpoint ${BUILDROOT}/run    >/dev/null 2>&1; then mount -t tmpfs tmpfs ${BUILDROOT}/run; fi
... ...
@@ -23,8 +23,7 @@ LOGFILE=/var/log/"${PRGNAME}-${LOGFILE}"    #   set log file name
23 23
 if mountpoint ${BUILDROOT}/run >/dev/null 2>&1; then umount ${BUILDROOT}/run; fi
24 24
 if mountpoint ${BUILDROOT}/sys >/dev/null 2>&1; then umount ${BUILDROOT}/sys; fi
25 25
 if mountpoint ${BUILDROOT}/proc    >/dev/null 2>&1; then umount ${BUILDROOT}/proc; fi
26
-if mountpoint ${BUILDROOT}/dev/pts >/dev/null 2>&1; then umount ${BUILDROOT}/dev/pts; fi
27
-if mountpoint ${BUILDROOT}/dev >/dev/null 2>&1; then umount ${BUILDROOT}/dev; fi
26
+if mountpoint ${BUILDROOT}/dev >/dev/null 2>&1; then umount -R ${BUILDROOT}/dev; fi
28 27
 
29 28
 while [[ $# > 0 ]]
30 29
 do
... ...
@@ -156,8 +156,8 @@ if __name__ == '__main__':
156 156
             shutil.rmtree(additional_rpms_path, ignore_errors=True)
157 157
 
158 158
         utils.runshellcommand("mount -o bind /proc {}".format(options.mount_path + "/proc"))
159
-        utils.runshellcommand("mount -o bind /dev {}".format(options.mount_path + "/dev"))
160
-        utils.runshellcommand("mount -o bind /dev/pts {}".format(options.mount_path + "/dev/pts"))
159
+        utils.runshellcommand("mount -o rbind /dev {}".format(options.mount_path + "/dev"))
160
+        utils.runshellcommand("mount --make-rslave {}".format(options.mount_path + "/dev"))
161 161
         utils.runshellcommand("mount -o bind /sys {}".format(options.mount_path + "/sys"))
162 162
 
163 163
         if 'additionalfiles' in config:
... ...
@@ -179,8 +179,7 @@ if __name__ == '__main__':
179 179
             shutil.rmtree(options.mount_path + "/tempscripts", ignore_errors=True)
180 180
 
181 181
         utils.runshellcommand("umount -l {}".format(options.mount_path + "/sys"))
182
-        utils.runshellcommand("umount -l {}".format(options.mount_path + "/dev/pts"))
183
-        utils.runshellcommand("umount -l {}".format(options.mount_path + "/dev"))
182
+        utils.runshellcommand("umount -R -l {}".format(options.mount_path + "/dev"))
184 183
         utils.runshellcommand("umount -l {}".format(options.mount_path + "/proc"))
185 184
         utils.runshellcommand("umount -l {}".format(options.mount_path))
186 185
 
... ...
@@ -24,8 +24,7 @@ PARENT=/usr/src/photon
24 24
 if mountpoint ${BUILDROOT}/run	>/dev/null 2>&1; then umount ${BUILDROOT}/run; fi
25 25
 if mountpoint ${BUILDROOT}/sys	>/dev/null 2>&1; then umount ${BUILDROOT}/sys; fi
26 26
 if mountpoint ${BUILDROOT}/proc	>/dev/null 2>&1; then umount ${BUILDROOT}/proc; fi
27
-#if mountpoint ${BUILDROOT}/dev/pts	>/dev/null 2>&1; then umount ${BUILDROOT}/dev/pts; fi
28
-if mountpoint ${BUILDROOT}/dev	>/dev/null 2>&1; then umount ${BUILDROOT}/dev; fi
27
+if mountpoint ${BUILDROOT}/dev	>/dev/null 2>&1; then umount -R ${BUILDROOT}/dev; fi
29 28
 
30 29
 
31 30
 #copy localegen files.
... ...
@@ -45,8 +44,7 @@ if [ ${EUID} -eq 0 ] ; then
45 45
 #
46 46
 #	Mount kernel filesystem
47 47
 #
48
-    if ! mountpoint ${BUILDROOT}/dev	>/dev/null 2>&1; then mount --bind /dev ${BUILDROOT}/dev; fi
49
-#    if ! mountpoint ${BUILDROOT}/dev/pts	>/dev/null 2>&1; then mount -t devpts devpts ${BUILDROOT}/dev/pts -o gid=5,mode=620; fi
48
+    if ! mountpoint ${BUILDROOT}/dev	>/dev/null 2>&1; then mount --rbind /dev ${BUILDROOT}/dev; mount --make-rslave ${BUILDROOT}/dev; fi
50 49
     if ! mountpoint ${BUILDROOT}/proc	>/dev/null 2>&1; then mount -t proc proc ${BUILDROOT}/proc; fi
51 50
     if ! mountpoint ${BUILDROOT}/sys 	>/dev/null 2>&1; then mount -t sysfs sysfs ${BUILDROOT}/sys; fi
52 51
     if ! mountpoint ${BUILDROOT}/run	>/dev/null 2>&1; then mount -t tmpfs tmpfs ${BUILDROOT}/run; fi
... ...
@@ -27,8 +27,7 @@ if [ ${EUID} -eq 0 ] ; then
27 27
     if mountpoint ${BUILDROOT}/run	>/dev/null 2>&1; then umount ${BUILDROOT}/run; fi
28 28
     if mountpoint ${BUILDROOT}/sys	>/dev/null 2>&1; then umount ${BUILDROOT}/sys; fi
29 29
     if mountpoint ${BUILDROOT}/proc	>/dev/null 2>&1; then umount ${BUILDROOT}/proc; fi
30
-    if mountpoint ${BUILDROOT}/dev/pts	>/dev/null 2>&1; then umount ${BUILDROOT}/dev/pts; fi
31
-    if mountpoint ${BUILDROOT}/dev	>/dev/null 2>&1; then umount ${BUILDROOT}/dev; fi
30
+    if mountpoint ${BUILDROOT}/dev	>/dev/null 2>&1; then umount -R ${BUILDROOT}/dev; fi
32 31
 fi
33 32
 
34 33
 exit 0