Wind River Support Network

HomeDefectsLIN5-7493
Fixed

LIN5-7493 : install order dependency between base-files package and shell packages

Created: Oct 15, 2013    Updated: Dec 19, 2017
Resolved Date: Oct 30, 2013
Found In Version: 5.0.1
Fix Version: 5.0.1.9
Severity: Standard
Applicable for: Wind River Linux 5
Component/s: Userspace

Description

The base-files package includes a copy of the "shells" file which lists valid login shells. The version of this file contained in oe-core layer lists several shells as follows:

--8<--
# /etc/shells: valid login shells
/bin/sh
/bin/ash
/bin/bash
/bin/dash
/bin/ksh
/usr/bin/ksh
/usr/bin/screen
--8<--

Several of which are not valid (there is no dash, ksh or ash package).

To remove these invalid shells the customer created his own layer with a bbappend and a new shells file which lists only /bin/sh.

He relies on the fact that bash is able to add itself to the shells list. Looking at the bash recipe we see the following:

--8<--
pkg_postinst_${PN} () {
        touch $D${sysconfdir}/shells
        grep -q "bin/bash" $D${sysconfdir}/shells || echo /bin/bash >> $D${sysconfdir}/shells
        grep -q "bin/sh" $D${sysconfdir}/shells || echo /bin/sh >> $D${sysconfdir}/shells
}
--8<--

So when bash is installed it should add itself to the shells file.

This is a much better solution than having the list of shells hard-coded in the base-files package anyway.

However, this does not work if bash is installed before the base-files package, as the base-files shells file would then overwrite the content of the shells file generated by bash with its own version. This can (and does) happen.

With the current oe-core shells file this works in the case of bash because it includes bash in its list, but customer integrated shells (eg tcsh) are not listed, so their entries get lost.

Thus we have a dependency on the install order which should not be there. The correct solution would be to have the base-files package only create a shells file if it does not already exist, and it should probably not actually contain any entries since they should all be added programmatically by the shell packages as done by bash.

Workaround

A workaround would be to create a custom base-files package with a shells file containing entries for all the shells that can be installed, thus making it not matter what the order is.

Steps to Reproduce

n/a

Other Downloads


Live chat
Online