* [PATCH] sysvinit-inittab: fix getty device removal
@ 2016-11-29 18:29 leonardo.sandoval.gonzalez
2016-11-29 20:15 ` Christopher Larson
0 siblings, 1 reply; 6+ messages in thread
From: leonardo.sandoval.gonzalez @ 2016-11-29 18:29 UTC (permalink / raw)
To: openembedded-core
From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
getty devices were not being removed in some cases because device name
was not at the end of the line, for example a ttyS1 device:
S1:12345:respawn:/bin/start_getty 115200 ttyS1 vt102
Removing this limitation allows sed to remove any line containing
the device.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
---
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
index c219cbf..dd30f43 100644
--- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
+++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
@@ -62,7 +62,7 @@ if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then
k=`echo ${i} | sed s/^.*\://g`
if [ -z "`grep ${j} /proc/consoles`" ]; then
if [ -z "${k}" ] || [ -z "`grep ${k} /proc/consoles`" ] || [ ! -e /dev/${j} ]; then
- sed -i /^.*${j}$/d /etc/inittab
+ sed -i /^.*${j}/d /etc/inittab
fi
fi
done
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] sysvinit-inittab: fix getty device removal
2016-11-29 18:29 [PATCH] sysvinit-inittab: fix getty device removal leonardo.sandoval.gonzalez
@ 2016-11-29 20:15 ` Christopher Larson
2016-11-29 20:52 ` Leonardo Sandoval
0 siblings, 1 reply; 6+ messages in thread
From: Christopher Larson @ 2016-11-29 20:15 UTC (permalink / raw)
To: Leonardo Sandoval; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 1681 bytes --]
On Tue, Nov 29, 2016 at 11:29 AM, <
leonardo.sandoval.gonzalez@linux.intel.com> wrote:
> From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
>
> getty devices were not being removed in some cases because device name
> was not at the end of the line, for example a ttyS1 device:
>
> S1:12345:respawn:/bin/start_getty 115200 ttyS1 vt102
>
> Removing this limitation allows sed to remove any line containing
> the device.
>
> Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@
> linux.intel.com>
> ---
> meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> index c219cbf..dd30f43 100644
> --- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> +++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> @@ -62,7 +62,7 @@ if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then
> k=`echo ${i} | sed s/^.*\://g`
> if [ -z "`grep ${j} /proc/consoles`" ]; then
> if [ -z "${k}" ] || [ -z "`grep ${k}
> /proc/consoles`" ] || [ ! -e /dev/${j} ]; then
> - sed -i /^.*${j}$/d /etc/inittab
> + sed -i /^.*${j}/d /etc/inittab
>
This doesn’t check for the end of a word, so it’d match a partial as well.
Would that be a problem? i.e. ttyS1 vs ttyS10.
--
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
[-- Attachment #2: Type: text/html, Size: 2877 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sysvinit-inittab: fix getty device removal
2016-11-29 20:15 ` Christopher Larson
@ 2016-11-29 20:52 ` Leonardo Sandoval
2016-11-29 21:05 ` Cal Sullivan
0 siblings, 1 reply; 6+ messages in thread
From: Leonardo Sandoval @ 2016-11-29 20:52 UTC (permalink / raw)
To: Christopher Larson; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 2445 bytes --]
On 11/29/2016 02:15 PM, Christopher Larson wrote:
>
> On Tue, Nov 29, 2016 at 11:29 AM,
> <leonardo.sandoval.gonzalez@linux.intel.com
> <mailto:leonardo.sandoval.gonzalez@linux.intel.com>> wrote:
>
> From: Leonardo Sandoval
> <leonardo.sandoval.gonzalez@linux.intel.com
> <mailto:leonardo.sandoval.gonzalez@linux.intel.com>>
>
> getty devices were not being removed in some cases because device name
> was not at the end of the line, for example a ttyS1 device:
>
> S1:12345:respawn:/bin/start_getty 115200 ttyS1 vt102
>
> Removing this limitation allows sed to remove any line containing
> the device.
>
> Signed-off-by: Leonardo Sandoval
> <leonardo.sandoval.gonzalez@linux.intel.com
> <mailto:leonardo.sandoval.gonzalez@linux.intel.com>>
> ---
> meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> <http://sysvinit-inittab_2.88dsf.bb> | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git
> a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> <http://sysvinit-inittab_2.88dsf.bb>
> b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> <http://sysvinit-inittab_2.88dsf.bb>
> index c219cbf..dd30f43 100644
> --- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> <http://sysvinit-inittab_2.88dsf.bb>
> +++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> <http://sysvinit-inittab_2.88dsf.bb>
> @@ -62,7 +62,7 @@ if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then
> k=`echo ${i} | sed s/^.*\://g`
> if [ -z "`grep ${j} /proc/consoles`" ]; then
> if [ -z "${k}" ] || [ -z "`grep ${k}
> /proc/consoles`" ] || [ ! -e /dev/${j} ]; then
> - sed -i /^.*${j}$/d /etc/inittab
> + sed -i /^.*${j}/d /etc/inittab
>
>
> This doesn’t check for the end of a word, so it’d match a partial as
> well. Would that be a problem? i.e. ttyS1 vs ttyS10.
That is the intention, that line removal is not tied to finding the
device at the end of the line. With proposed patch, it removes the
device, no matter where is located.
> --
> Christopher Larson
> clarson at kergoth dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Maintainer - Tslib
> Senior Software Engineer, Mentor Graphics
[-- Attachment #2: Type: text/html, Size: 5099 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sysvinit-inittab: fix getty device removal
2016-11-29 20:52 ` Leonardo Sandoval
@ 2016-11-29 21:05 ` Cal Sullivan
2016-11-29 21:08 ` Cal Sullivan
0 siblings, 1 reply; 6+ messages in thread
From: Cal Sullivan @ 2016-11-29 21:05 UTC (permalink / raw)
To: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 2965 bytes --]
On 11/29/2016 12:52 PM, Leonardo Sandoval wrote:
>
>
>
> On 11/29/2016 02:15 PM, Christopher Larson wrote:
>>
>> On Tue, Nov 29, 2016 at 11:29 AM,
>> <leonardo.sandoval.gonzalez@linux.intel.com
>> <mailto:leonardo.sandoval.gonzalez@linux.intel.com>> wrote:
>>
>> From: Leonardo Sandoval
>> <leonardo.sandoval.gonzalez@linux.intel.com
>> <mailto:leonardo.sandoval.gonzalez@linux.intel.com>>
>>
>> getty devices were not being removed in some cases because device
>> name
>> was not at the end of the line, for example a ttyS1 device:
>>
>> S1:12345:respawn:/bin/start_getty 115200 ttyS1 vt102
>>
>> Removing this limitation allows sed to remove any line containing
>> the device.
>>
>> Signed-off-by: Leonardo Sandoval
>> <leonardo.sandoval.gonzalez@linux.intel.com
>> <mailto:leonardo.sandoval.gonzalez@linux.intel.com>>
>> ---
>> meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>> <http://sysvinit-inittab_2.88dsf.bb> | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git
>> a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>> <http://sysvinit-inittab_2.88dsf.bb>
>> b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>> <http://sysvinit-inittab_2.88dsf.bb>
>> index c219cbf..dd30f43 100644
>> --- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>> <http://sysvinit-inittab_2.88dsf.bb>
>> +++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>> <http://sysvinit-inittab_2.88dsf.bb>
>> @@ -62,7 +62,7 @@ if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then
>> k=`echo ${i} | sed s/^.*\://g`
>> if [ -z "`grep ${j} /proc/consoles`" ]; then
>> if [ -z "${k}" ] || [ -z "`grep ${k}
>> /proc/consoles`" ] || [ ! -e /dev/${j} ]; then
>> - sed -i /^.*${j}$/d /etc/inittab
>> + sed -i /^.*${j}/d /etc/inittab
>>
>>
>> This doesn’t check for the end of a word, so it’d match a partial as
>> well. Would that be a problem? i.e. ttyS1 vs ttyS10.
>
> That is the intention, that line removal is not tied to finding the
> device at the end of the line. With proposed patch, it removes the
> device, no matter where is located.
>
Right, but look at this hypothetical example:
S1:12345:respawn:/bin/start_getty 115200 ttyS1 vt102
S10:12345:respawn:/bin/start_getty 115200 ttyS10
Both would match, when you only want the top to match. This is untested
but likely more what we want:
sed -i /^.*${j}[\ $]/d /etc/inittab
That way we either match up to a space (end of word) or end of line.
---
Cal
>
>> --
>> Christopher Larson
>> clarson at kergoth dot com
>> Founder - BitBake, OpenEmbedded, OpenZaurus
>> Maintainer - Tslib
>> Senior Software Engineer, Mentor Graphics
>
>
>
[-- Attachment #2: Type: text/html, Size: 6320 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sysvinit-inittab: fix getty device removal
2016-11-29 21:05 ` Cal Sullivan
@ 2016-11-29 21:08 ` Cal Sullivan
2016-11-29 21:53 ` Leonardo Sandoval
0 siblings, 1 reply; 6+ messages in thread
From: Cal Sullivan @ 2016-11-29 21:08 UTC (permalink / raw)
To: openembedded-core; +Cc: clarson
[-- Attachment #1: Type: text/plain, Size: 3162 bytes --]
Oops, accidentally dropped CCs. See my reply below.
On 11/29/2016 01:05 PM, Cal Sullivan wrote:
>
>
> On 11/29/2016 12:52 PM, Leonardo Sandoval wrote:
>>
>>
>>
>> On 11/29/2016 02:15 PM, Christopher Larson wrote:
>>>
>>> On Tue, Nov 29, 2016 at 11:29 AM,
>>> <leonardo.sandoval.gonzalez@linux.intel.com
>>> <mailto:leonardo.sandoval.gonzalez@linux.intel.com>> wrote:
>>>
>>> From: Leonardo Sandoval
>>> <leonardo.sandoval.gonzalez@linux.intel.com
>>> <mailto:leonardo.sandoval.gonzalez@linux.intel.com>>
>>>
>>> getty devices were not being removed in some cases because
>>> device name
>>> was not at the end of the line, for example a ttyS1 device:
>>>
>>> S1:12345:respawn:/bin/start_getty 115200 ttyS1 vt102
>>>
>>> Removing this limitation allows sed to remove any line containing
>>> the device.
>>>
>>> Signed-off-by: Leonardo Sandoval
>>> <leonardo.sandoval.gonzalez@linux.intel.com
>>> <mailto:leonardo.sandoval.gonzalez@linux.intel.com>>
>>> ---
>>> meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>>> <http://sysvinit-inittab_2.88dsf.bb> | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git
>>> a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>>> <http://sysvinit-inittab_2.88dsf.bb>
>>> b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>>> <http://sysvinit-inittab_2.88dsf.bb>
>>> index c219cbf..dd30f43 100644
>>> --- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>>> <http://sysvinit-inittab_2.88dsf.bb>
>>> +++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>>> <http://sysvinit-inittab_2.88dsf.bb>
>>> @@ -62,7 +62,7 @@ if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then
>>> k=`echo ${i} | sed s/^.*\://g`
>>> if [ -z "`grep ${j} /proc/consoles`" ]; then
>>> if [ -z "${k}" ] || [ -z "`grep ${k}
>>> /proc/consoles`" ] || [ ! -e /dev/${j} ]; then
>>> - sed -i /^.*${j}$/d /etc/inittab
>>> + sed -i /^.*${j}/d /etc/inittab
>>>
>>>
>>> This doesn’t check for the end of a word, so it’d match a partial as
>>> well. Would that be a problem? i.e. ttyS1 vs ttyS10.
>>
>> That is the intention, that line removal is not tied to finding the
>> device at the end of the line. With proposed patch, it removes the
>> device, no matter where is located.
>>
> Right, but look at this hypothetical example:
>
> S1:12345:respawn:/bin/start_getty 115200 ttyS1 vt102
> S10:12345:respawn:/bin/start_getty 115200 ttyS10
>
> Both would match, when you only want the top to match. This is
> untested but likely more what we want:
>
> sed -i /^.*${j}[\ $]/d /etc/inittab
>
> That way we either match up to a space (end of word) or end of line.
>
> ---
> Cal
>
>>
>>> --
>>> Christopher Larson
>>> clarson at kergoth dot com
>>> Founder - BitBake, OpenEmbedded, OpenZaurus
>>> Maintainer - Tslib
>>> Senior Software Engineer, Mentor Graphics
>>
>>
>>
>
[-- Attachment #2: Type: text/html, Size: 7040 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sysvinit-inittab: fix getty device removal
2016-11-29 21:08 ` Cal Sullivan
@ 2016-11-29 21:53 ` Leonardo Sandoval
0 siblings, 0 replies; 6+ messages in thread
From: Leonardo Sandoval @ 2016-11-29 21:53 UTC (permalink / raw)
To: Cal Sullivan, openembedded-core; +Cc: clarson
[-- Attachment #1: Type: text/plain, Size: 3352 bytes --]
On 11/29/2016 03:08 PM, Cal Sullivan wrote:
> Oops, accidentally dropped CCs. See my reply below.
>
> On 11/29/2016 01:05 PM, Cal Sullivan wrote:
>>
>>
>> On 11/29/2016 12:52 PM, Leonardo Sandoval wrote:
>>>
>>>
>>>
>>> On 11/29/2016 02:15 PM, Christopher Larson wrote:
>>>>
>>>> On Tue, Nov 29, 2016 at 11:29 AM,
>>>> <leonardo.sandoval.gonzalez@linux.intel.com
>>>> <mailto:leonardo.sandoval.gonzalez@linux.intel.com>> wrote:
>>>>
>>>> From: Leonardo Sandoval
>>>> <leonardo.sandoval.gonzalez@linux.intel.com
>>>> <mailto:leonardo.sandoval.gonzalez@linux.intel.com>>
>>>>
>>>> getty devices were not being removed in some cases because
>>>> device name
>>>> was not at the end of the line, for example a ttyS1 device:
>>>>
>>>> S1:12345:respawn:/bin/start_getty 115200 ttyS1 vt102
>>>>
>>>> Removing this limitation allows sed to remove any line containing
>>>> the device.
>>>>
>>>> Signed-off-by: Leonardo Sandoval
>>>> <leonardo.sandoval.gonzalez@linux.intel.com
>>>> <mailto:leonardo.sandoval.gonzalez@linux.intel.com>>
>>>> ---
>>>> meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>>>> <http://sysvinit-inittab_2.88dsf.bb> | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git
>>>> a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>>>> <http://sysvinit-inittab_2.88dsf.bb>
>>>> b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>>>> <http://sysvinit-inittab_2.88dsf.bb>
>>>> index c219cbf..dd30f43 100644
>>>> --- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>>>> <http://sysvinit-inittab_2.88dsf.bb>
>>>> +++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>>>> <http://sysvinit-inittab_2.88dsf.bb>
>>>> @@ -62,7 +62,7 @@ if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then
>>>> k=`echo ${i} | sed s/^.*\://g`
>>>> if [ -z "`grep ${j} /proc/consoles`" ]; then
>>>> if [ -z "${k}" ] || [ -z "`grep ${k}
>>>> /proc/consoles`" ] || [ ! -e /dev/${j} ]; then
>>>> - sed -i /^.*${j}$/d /etc/inittab
>>>> + sed -i /^.*${j}/d /etc/inittab
>>>>
>>>>
>>>> This doesn’t check for the end of a word, so it’d match a partial
>>>> as well. Would that be a problem? i.e. ttyS1 vs ttyS10.
>>>
>>> That is the intention, that line removal is not tied to finding the
>>> device at the end of the line. With proposed patch, it removes the
>>> device, no matter where is located.
>>>
>> Right, but look at this hypothetical example:
>>
>> S1:12345:respawn:/bin/start_getty 115200 ttyS1 vt102
>> S10:12345:respawn:/bin/start_getty 115200 ttyS10
>>
>> Both would match, when you only want the top to match. This is
>> untested but likely more what we want:
>>
>> sed -i /^.*${j}[\ $]/d /etc/inittab
>>
>> That way we either match up to a space (end of word) or end of line.
Got it, that can be possible. Sending a v2
>>
>> ---
>> Cal
>>
>>>
>>>> --
>>>> Christopher Larson
>>>> clarson at kergoth dot com
>>>> Founder - BitBake, OpenEmbedded, OpenZaurus
>>>> Maintainer - Tslib
>>>> Senior Software Engineer, Mentor Graphics
>>>
>>>
>>>
>>
>
[-- Attachment #2: Type: text/html, Size: 8005 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-11-29 21:47 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-29 18:29 [PATCH] sysvinit-inittab: fix getty device removal leonardo.sandoval.gonzalez
2016-11-29 20:15 ` Christopher Larson
2016-11-29 20:52 ` Leonardo Sandoval
2016-11-29 21:05 ` Cal Sullivan
2016-11-29 21:08 ` Cal Sullivan
2016-11-29 21:53 ` Leonardo Sandoval
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox