[devel] RFC: test-rootfs

Alexey Tourbin =?iso-8859-1?q?at_=CE=C1_altlinux=2Eru?=
Вт Июн 14 13:46:49 MSD 2005


Здравствуйте.

Суть вопроса вот в чем:
Test that binaries in /bin and /sbin depend only on libraries in /lib.
Иными словами, система без смонтированного /usr должна быть замкнутой.

Для тестирования предлагается сделать отдельный пакет.  См.
test-rootfs.spec (attached).  Этот specfile будет обновляться
в полуавтоматическом режиме.

Обнаруженные нарушители конвенции приведены ниже.  Что бы с ними
сделать?  Развесить block-баги?

Error: /bin/rpm depends on /usr/lib/librpm-4.0.4.so
lrwxrwxrwx  1 rooter rooter 14 Jun 14 13:13 /bin/rpm -> ../usr/bin/rpm

Error: /bin/rpm depends on /usr/lib/librpmbuild-4.0.4.so
lrwxrwxrwx  1 rooter rooter 14 Jun 14 13:13 /bin/rpm -> ../usr/bin/rpm

Error: /bin/rpm depends on /usr/lib/librpmdb-4.0.4.so
lrwxrwxrwx  1 rooter rooter 14 Jun 14 13:13 /bin/rpm -> ../usr/bin/rpm

Error: /bin/rpm depends on /usr/lib/librpmio-4.0.4.so
lrwxrwxrwx  1 rooter rooter 14 Jun 14 13:13 /bin/rpm -> ../usr/bin/rpm

Error: /bin/rpm depends on /usr/lib/libbeecrypt.so.2
lrwxrwxrwx  1 rooter rooter 14 Jun 14 13:13 /bin/rpm -> ../usr/bin/rpm

Error: /bin/asfxload depends on /usr/lib/libawe.so.5
-rwxr-xr-x  1 rooter rooter 9976 Nov 11  2004 /bin/asfxload

Error: /bin/asfxload depends on /usr/lib/libasound.so.2
-rwxr-xr-x  1 rooter rooter 9976 Nov 11  2004 /bin/asfxload

Error: /bin/gusload depends on /usr/lib/libawe.so.5
-rwxr-xr-x  1 rooter rooter 11516 Nov 11  2004 /bin/gusload

Error: /bin/gusload depends on /usr/lib/libasound.so.2
-rwxr-xr-x  1 rooter rooter 11516 Nov 11  2004 /bin/gusload

Error: /bin/sfxload depends on /usr/lib/libawe.so.5
-rwxr-xr-x  1 rooter rooter 10284 Nov 11  2004 /bin/sfxload

Error: /bin/sfxload depends on /usr/lib/libasound.so.2
-rwxr-xr-x  1 rooter rooter 10284 Nov 11  2004 /bin/sfxload

Error: /sbin/install-info depends on /usr/lib/libzio.so.0
-rwxr-xr-x  1 rooter rooter 23324 Jun 14 13:13 /sbin/install-info

Error: /sbin/circleping depends on /usr/lib/libmagma.so.DEVEL
-rwxr-xr-x  1 rooter rooter 7464 Mar 31 19:42 /sbin/circleping

Error: /sbin/circleping depends on /usr/lib/libmagmamsg.so.DEVEL
-rwxr-xr-x  1 rooter rooter 7464 Mar 31 19:42 /sbin/circleping

Error: /sbin/cluster_cmd depends on /usr/lib/libmagma.so.DEVEL
-rwxr-xr-x  1 rooter rooter 10736 Mar 31 19:42 /sbin/cluster_cmd

Error: /sbin/cluster_cmd depends on /usr/lib/libmagmamsg.so.DEVEL
-rwxr-xr-x  1 rooter rooter 10736 Mar 31 19:42 /sbin/cluster_cmd

Error: /sbin/magma_tool depends on /usr/lib/libmagma.so.DEVEL
-rwxr-xr-x  1 rooter rooter 11588 Mar 31 19:42 /sbin/magma_tool

Error: /sbin/magma_tool depends on /usr/lib/libmagmamsg.so.DEVEL
-rwxr-xr-x  1 rooter rooter 11588 Mar 31 19:42 /sbin/magma_tool

Error: /sbin/ifplugd depends on /usr/lib/libdaemon.so.0
-rwxr-xr-x  1 rooter rooter 23452 Jan  4 19:01 /sbin/ifplugd

Error: /sbin/ifplugstatus depends on /usr/lib/libdaemon.so.0
-rwxr-xr-x  1 rooter rooter 10184 Jan  4 19:01 /sbin/ifplugstatus

Error: /sbin/syslog-ng depends on /usr/lib/libol.so.0
-rwxr-xr-x  1 rooter rooter 81256 Apr 13  2004 /sbin/syslog-ng

Error: /sbin/scsi_id depends on /usr/lib/libsysfs.so.1
-rwxr-xr-x  1 rooter rooter 14520 Mar 31 19:57 /sbin/scsi_id

Error: /sbin/udev depends on /usr/lib/libsysfs.so.1
-rwxr-xr-x  1 rooter rooter 30488 Mar 31 19:57 /sbin/udev

Error: /sbin/udev_volume_id depends on /usr/lib/libsysfs.so.1
-rwxr-xr-x  1 rooter rooter 16840 Mar 31 19:57 /sbin/udev_volume_id

Error: /sbin/udevd depends on /usr/lib/libsysfs.so.1
-rwxr-xr-x  1 rooter rooter 7372 Mar 31 19:57 /sbin/udevd

Error: /sbin/udevsend depends on /usr/lib/libsysfs.so.1
-rwxr-xr-x  1 rooter rooter 5624 Mar 31 19:57 /sbin/udevsend

Error: /sbin/udevstart depends on /usr/lib/libsysfs.so.1
lrwxrwxrwx  1 rooter rooter 4 Jun 14 13:15 /sbin/udevstart -> udev
----------- следующая часть -----------
Name: test-rootfs
Version: 20050614
Release: alt1

Summary: test root filesystem
License: GPL
Group: File tools

# error: unpacking of archive failed on file /dev/MAKEDEV;42ae9a90: cpio: symlink failed - Permission denied
#uildRequires(build): MAKEDEV
BuildRequires(build): SysVinit
BuildRequires(build): acct
BuildRequires(build): acl
BuildRequires(build): agetty
BuildRequires(build): apcupsd
BuildRequires(build): ash
BuildRequires(build): ash-static
BuildRequires(build): aumix-minimal
BuildRequires(build): awesfx
BuildRequires(build): bash
BuildRequires(build): bootsplash
BuildRequires(build): bridge-utils
BuildRequires(build): bzip2
BuildRequires(build): bzlib
BuildRequires(build): captive-lufs
# ccs: Depends: /etc/sysconfig/cluster but it is not installable
#uildRequires(build): ccs
BuildRequires(build): chkconfig
# cman: Depends: /etc/sysconfig/cluster but it is not installable
#uildRequires(build): cman
# console-tools: Conflicts: console-tools_or_kbd (> console-tools0:0.2.3-ipl31mdk)
#uildRequires(build): console-tools
BuildRequires(build): coreutils
BuildRequires(build): cpio
BuildRequires(build): cpuid
BuildRequires(build): cpuspeed
BuildRequires(build): dhcp-client
BuildRequires(build): dhcpcd
BuildRequires(build): dosfstools
BuildRequires(build): dump
BuildRequires(build): e2fsprogs
BuildRequires(build): ed
BuildRequires(build): evms
BuildRequires(build): evms-cli
BuildRequires(build): fbgetty
BuildRequires(build): fdisk
BuildRequires(build): fence
BuildRequires(build): findutils
# fuse-siefs: Depends: fuse (= 2.2-alt6)
#uildRequires(build): fuse-siefs
BuildRequires(build): gawk
BuildRequires(build): genromfs
BuildRequires(build): getopt
BuildRequires(build): glibc-core
BuildRequires(build): glibc-utils
BuildRequires(build): gnbd
BuildRequires(build): gpart
BuildRequires(build): grep
# gulm: Depends: /etc/sysconfig/cluster but it is not installable
#uildRequires(build): gulm
BuildRequires(build): gzip
BuildRequires(build): hashalot
BuildRequires(build): hdparm
BuildRequires(build): hotplug
BuildRequires(build): hwclock
BuildRequires(build): ifplugd
BuildRequires(build): ifrename
BuildRequires(build): info-install
BuildRequires(build): ipchains
BuildRequires(build): iproute2
BuildRequires(build): iptables
BuildRequires(build): iptables-ipv6
BuildRequires(build): iputils
BuildRequires(build): ipv6calc
BuildRequires(build): ipxutils
BuildRequires(build): ircd
BuildRequires(build): isapnptools
BuildRequires(build): isdn4k-utils
BuildRequires(build): jfsprogs
# kbd: Conflicts: console-tools_or_kbd (< kbd0:1.12-alt2)
#uildRequires(build): kbd
BuildRequires(build): kbdrate
BuildRequires(build): klogd
BuildRequires(build): lcap
BuildRequires(build): libcap-utils
BuildRequires(build): lilo
BuildRequires(build): login
BuildRequires(build): losetup
BuildRequires(build): lufs
BuildRequires(build): magma
BuildRequires(build): mailx
BuildRequires(build): mdadm
BuildRequires(build): mgetty
BuildRequires(build): mgetty-voice
BuildRequires(build): mingetty
BuildRequires(build): mkinitrd
BuildRequires(build): mktemp
BuildRequires(build): modutils
BuildRequires(build): mount
BuildRequires(build): msulogin
BuildRequires(build): mt-st
BuildRequires(build): ncpfs
BuildRequires(build): net-scripts
BuildRequires(build): net-tools
BuildRequires(build): nfs-clients
# nut-driver: PreDepends: nut (= 2.0.1-alt2) but it is not going to be installed
#uildRequires(build): nut-driver
BuildRequires(build): pam
BuildRequires(build): pam0_console
BuildRequires(build): pam0_timestamp
BuildRequires(build): pcmcia-cs
BuildRequires(build): pdksh
BuildRequires(build): portmap
BuildRequires(build): procps
BuildRequires(build): psmisc
BuildRequires(build): quota
BuildRequires(build): raidtools
BuildRequires(build): reiser4progs
BuildRequires(build): reiserfsprogs
BuildRequires(build): rmt
BuildRequires(build): rpm
BuildRequires(build): samba-client
BuildRequires(build): sash
BuildRequires(build): sed
BuildRequires(build): service
BuildRequires(build): setserial
BuildRequires(build): sfdisk
BuildRequires(build): sh
BuildRequires(build): squashfsprogs
BuildRequires(build): su
BuildRequires(build): submount
BuildRequires(build): submount24
BuildRequires(build): syslog-common
BuildRequires(build): syslog-ng
BuildRequires(build): syslogd
BuildRequires(build): tar
BuildRequires(build): tcb-utils
BuildRequires(build): tcsh
BuildRequires(build): termutils
BuildRequires(build): traceroute
BuildRequires(build): udev
BuildRequires(build): util-linux
BuildRequires(build): vim-minimal
BuildRequires(build): vitmp
BuildRequires(build): wireless-tools
BuildRequires(build): xfsdump
BuildRequires(build): xfsprogs
BuildRequires(build): zcip
BuildRequires(build): zsh

%description
: Test that binaries in /bin and /sbin depend only on libraries in /lib.
: This is how the above list was formed:
cd Sisyphus/files/i586/RPMS
for f in *.rpm ; do if rpm -qpl $f |grep -E '^/s?bin/'; then rpm -qp --qf '%{NAME}\n' $f; fi; done

%build
set +x
RC=0
for f in `find /bin /sbin`; do
	[ -f "$f" ] || { echo "test-rootfs: $f not a file"; continue; }
	[ -r "$f" ] || { echo "test-rootfs: $f not readable"; continue; }
	type="$(file -bL "$f")"
	[ -z "${type%%ELF *}" -a -z "${type##*(uses shared libs)*}" ] || { 
		echo "test-rootfs: $f type $type"; continue; }
	echo "$f"
	ldd="$(ldd "$f")"
	libs="$(echo "$ldd" |awk '{print$3}')"
	for lib in $libs; do
		[ -z "${lib%%/lib*/*}" ] || {
			echo "Error: $f depends on $lib"
			ls -l "$f"; RC=1; }
	done
done
exit $RC

%files

%changelog
* Tue Jun 14 2005 Alexey Tourbin <at на altlinux.ru> 20050614-alt1
- initial revision
----------- следующая часть -----------
Было удалено вложение не в текстовом формате...
Имя     : =?iso-8859-1?q?=CF=D4=D3=D5=D4=D3=D4=D7=D5=C5=D4?=
Тип     : application/pgp-signature
Размер  : 189 байтов
Описание: =?iso-8859-1?q?=CF=D4=D3=D5=D4=D3=D4=D7=D5=C5=D4?=
Url     : <http://lists.altlinux.org/pipermail/devel/attachments/20050614/65cf10c1/attachment-0001.bin>


Подробная информация о списке рассылки Devel