Skip to contentSkip to conversation

coreutils: don't build su

PATCH New Ross Burton 1 participant 2 messages Aug 14, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 coreutils: don't build su

Previously we built su but didn't package it because util-linux is the preferred provider. However with glibc 2.28 libcrypt has been removed so su doesn't build. Instead of depending on virtual/crypt, lets just not build su at all.

---
 recipes-core/coreutils/coreutils-6.9/no-su.patch | 56 ++++++++++++++++++++++++
 recipes-core/coreutils/coreutils_6.9.bb          |  5 +--
 2 files changed, 57 insertions(+), 4 deletions(-)
 create mode 100644 recipes-core/coreutils/coreutils-6.9/no-su.patch
recipes-core/coreutils/coreutils-6.9/no-su.patch new file +56 -0
new file mode 100644
index 0000000..47339e5
@@ -0,0 +1,56 @@
+Newer versions of su don't provide su as util-linux is the preferred provider,
+so don't build it.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <[email protected]>
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 863a32b5a..28c060898 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -16,7 +16,7 @@
+ ## along with this program; if not, write to the Free Software Foundation,
+ ## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ 
+-EXTRA_PROGRAMS = chroot df hostid nice pinky stty su uname uptime users who
++EXTRA_PROGRAMS = chroot df hostid nice pinky stty uname uptime users who
+ 
+ bin_SCRIPTS = groups
+ bin_PROGRAMS = [ chgrp chown chmod cp dd dircolors du \
+@@ -131,8 +131,6 @@ RELEASE_YEAR = \
+ 	chmod +x $@-t
+ 	mv $@-t $@
+ 
+-all-local: su$(EXEEXT)
+-
+ installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
+ 
+ setuid_root_mode = a=rx,u+s
+@@ -146,27 +144,6 @@ INSTALL_SU = \
+   echo " chmod $(setuid_root_mode) $(installed_su)"; \
+   chmod $(setuid_root_mode) $(installed_su)
+ 
+-install-root: su$(EXEEXT)
+-	@$(INSTALL_SU)
+-
+-install-exec-local: su$(EXEEXT)
+-	@TMPFILE=$(DESTDIR)$(bindir)/.su-$$$$; \
+-	rm -f $$TMPFILE; \
+-	echo > $$TMPFILE; \
+-## See if we can create a setuid root executable in $(bindir).
+-## If not, then don't even try to install su.
+-	can_create_suid_root_executable=no; \
+-	chown root $$TMPFILE > /dev/null 2>&1 \
+-	  && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \
+-	  && can_create_suid_root_executable=yes; \
+-	rm -f $$TMPFILE; \
+-	if test $$can_create_suid_root_executable = yes; then \
+-	  $(INSTALL_SU); \
+-	else \
+-	  echo "WARNING: insufficient access; not installing su"; \
+-	  echo "NOTE: to install su, run 'make install-root' as root"; \
+-	fi
+-
+ uninstall-local:
+ # Remove su only if it's one we installed.
+ 	@if grep '$(GNU_PACKAGE)' $(installed_su) > /dev/null 2>&1; then \
recipes-core/coreutils/coreutils_6.9.bb +1 -4
index 0d236b2..ae941fd 100644
@@ -28,6 +28,7 @@ SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.bz2 \
            file://loadavg.patch \
            file://no-man.patch \
            file://build-don-t-need-charset.alias-when-building-for-mus.patch \
+           file://no-su.patch \
            "
 
 SRC_URI[md5sum] = "c9607d8495f16e98906e7ed2d9751a06"
@@ -78,10 +79,6 @@ do_install() {
 	# in update-alternatives to fail, therefore use lbracket - the name used
 	# for the actual source file.
 	mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
-
-	# Newer versions of coreutils do not include su, to mimic this behavior
-	# we simply remove it.
-	rm -f ${D}${bindir}/su
 }
 
 inherit update-alternatives
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 coreutils: remove obsolete patches

No point fixing small problems with the man pages build if we later disable them entirely.

---
 .../coreutils-6.9/fix_for_manpage_building.patch   | 85 ----------------------
 .../coreutils/coreutils-6.9/man-touch.patch        | 24 ------
 recipes-core/coreutils/coreutils_6.9.bb            |  2 -
 3 files changed, 111 deletions(-)
 delete mode 100644 recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch
 delete mode 100644 recipes-core/coreutils/coreutils-6.9/man-touch.patch
recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch deleted +0 -85
deleted file mode 100644
index e0d600a..0000000
@@ -1,85 +0,0 @@
-Upstream-Status: Inappropriate [legacy version]
-
-Use native coreutils binaries to build manpages in cross environment.
-This avoids man page build issues like this:
-
-| Making all in man
-| make[1]: Entering directory `/build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/coreutils-6.9/man'
-| Updating man page cut.1
-| Updating man page dir.1
-| Updating man page expand.1
-| Updating man page fold.1
-| Updating man page install.1
-| Updating man page join.1
-| Updating man page pr.1
-| Updating man page ls.1
-| Updating man page sort.1
-| Updating man page unexpand.1
-| Updating man page uniq.1
-| Updating man page who.1
-| Updating man page vdir.1
-| help2man: can't get `--help' info from dir.td/dir
-| help2man: can't get `--help' info from cut.td/cut
-| make[1]: *** [dir.1] Error 126
-| make[1]: *** Waiting for unfinished jobs....
-| help2man: can't get `--help' info from fold.td/fold
-| help2man: can't get `--help' info from install.td/install
-| help2man: can't get `--help' info from expand.td/expand
-| help2man: can't get `--help' info from join.td/join
-| make[1]: *** [cut.1] Error 126
-| make[1]: *** [fold.1] Error 126
-| make[1]: *** [install.1] Error 126
-| help2man: can't get `--help' info from sort.td/sort
-| make[1]: *** [expand.1] Error 126
-| help2man: can't get `--help' info from pr.td/pr
-| make[1]: *** [join.1] Error 126
-| help2man: can't get `--help' info from ls.td/ls
-| help2man: can't get `--help' info from unexpand.td/unexpand
-| help2man: can't get `--help' info from uniq.td/uniq
-| help2man: can't get `--help' info from who.td/who
-| make[1]: *** [sort.1] Error 126
-| make[1]: *** [pr.1] Error 126
-| help2man: can't get `--help' info from vdir.td/vdir
-| make[1]: *** [ls.1] Error 126
-| make[1]: *** [uniq.1] Error 126
-| make[1]: *** [unexpand.1] Error 126
-| make[1]: *** [who.1] Error 126
-| make[1]: *** [vdir.1] Error 126
-| make[1]: Leaving directory `/build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/coreutils-6.9/man'
-| make: *** [all-recursive] Error 1
-| FATAL: oe_runmake failed
-| ERROR: Function 'do_compile' failed (see /build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/temp/log.do_compile.12780 for further information)
-NOTE: package coreutils-6.9-r0: task do_compile: Failed
-ERROR: Task 8 (/home/nitin/prj/poky.git/meta/recipes-core/coreutils/coreutils_6.9.bb, do_compile) failed with exit code '1'
-
-
-This patch is made for gplv2 coreutils the recipe
-Nitin A Kamble <[email protected]>
-2011/03/17
-
-Index: man/Makefile.am
-===================================================================
---- a/man.orig/Makefile.am
-+++ b/man/Makefile.am
-@@ -167,7 +167,7 @@ mapped_name = `echo $*|sed 's/install/gi
- 	            $(PERL) -- $(srcdir)/help2man		\
- 	             --source='$(PACKAGE_STRING)'		\
- 	             --include=$(srcdir)/$*.x			\
--	             --output=$t/$@ $t/$*;			\
-+	             --output=$t/$@ $*;			\
- 	       }						\
- 	    && sed 's|$*\.td/||g' $t/$@ > $@			\
- 	    && chmod a-w $@					\
-Index: man/Makefile.in
-===================================================================
---- a/man.orig/Makefile.in
-+++ b/man/Makefile.in
-@@ -865,7 +865,7 @@ yes.1:		$(common_dep)	$(srcdir)/yes.x		.
- 	            $(PERL) -- $(srcdir)/help2man		\
- 	             --source='$(PACKAGE_STRING)'		\
- 	             --include=$(srcdir)/$*.x			\
--	             --output=$t/$@ $t/$*;			\
-+	             --output=$t/$@ $*;			\
- 	       }						\
- 	    && sed 's|$*\.td/||g' $t/$@ > $@			\
- 	    && chmod a-w $@					\
recipes-core/coreutils/coreutils-6.9/man-touch.patch deleted +0 -24
deleted file mode 100644
index 59a4fe0..0000000
@@ -1,24 +0,0 @@
-Upstream-Status: Inappropriate [legacy version]
-
-# man page for 'touch' is generated differently from others. All other utilities
-# are provided static man source files, while for 'touch' it requires help2man
-# to invoke "touch --help" and then convert the output into the manual. Since touch
-# is with target format which can't be invoked on build system, disable building
-# 'touch' man page here.
-#
-# Signed-off-by: Kevin Tian <[email protected]>, 2010-08-18
-# (this patch is licensed under GPLv2)
-
-diff --git a/man/Makefile.am b/man/Makefile.am
-index 32df9d1..37b09e3 100644
---- a/man/Makefile.am
-+++ b/man/Makefile.am
-@@ -27,7 +27,7 @@ dist_man_MANS = \
-   paste.1 pathchk.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \
-   rm.1 rmdir.1 seq.1 sha1sum.1 sha224sum.1 sha256sum.1 sha384sum.1 sha512sum.1 \
-   shred.1 shuf.1 sleep.1 sort.1 split.1 stat.1 \
--  su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \
-+  su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 tr.1 true.1 tsort.1 \
-   tty.1 unexpand.1 uniq.1 unlink.1 vdir.1 wc.1 \
-   whoami.1 yes.1 $(MAN)
- optional_mans = \
recipes-core/coreutils/coreutils_6.9.bb +0 -2
index ae941fd..906bc4a 100644
@@ -21,10 +21,8 @@ SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.bz2 \
            file://coreutils-i18n.patch \
            file://coreutils-overflow.patch \
            file://coreutils-fix-install.patch \
-           file://man-touch.patch \
            file://coreutils_fix_for_automake-1.12.patch \
            file://coreutils-fix-texinfo.patch \
-           file://fix_for_manpage_building.patch \
            file://loadavg.patch \
            file://no-man.patch \
            file://build-don-t-need-charset.alias-when-building-for-mus.patch \
Signature · 1 line
2.11.0