All of lore.kernel.org
 help / color / mirror / Atom feed
* About having a static /dev
@ 2010-04-22 11:43 Antonio Ospite
  2010-04-22 11:55 ` Phil Blundell
  2010-04-22 12:34 ` Koen Kooi
  0 siblings, 2 replies; 11+ messages in thread
From: Antonio Ospite @ 2010-04-22 11:43 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 1109 bytes --]

Hi,

For my machine (a780) I'd like to have a static /dev whatever image I
build, I tried setting:
IMAGE_DEV_MANAGER = ""
IMAGE_DEVICE_TABLES = "files/device_table-minimal.txt \
                       files/device_table-ezx.txt"

But this is still not enough:
 1. the 'devices' script from initscripts keeps rewriting /dev at each
    boot, and with a layout different than one would expect by having
    IMAGE_DEVICE_TABLES set, see also
    http://bugs.openembedded.org/show_bug.cgi?id=3593

 2. If I install any package which depends on udev then udev is brought
    in and the static layout is gone at the next boot.

Any suggestion about how to get to a clean solution which can be reused
by others? I can fix 1. somehow, but for 2. I still don't have any idea.

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

[-- Attachment #2: Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: About having a static /dev
  2010-04-22 11:43 About having a static /dev Antonio Ospite
@ 2010-04-22 11:55 ` Phil Blundell
  2010-04-22 12:46   ` Antonio Ospite
  2010-04-22 12:34 ` Koen Kooi
  1 sibling, 1 reply; 11+ messages in thread
From: Phil Blundell @ 2010-04-22 11:55 UTC (permalink / raw)
  To: openembedded-devel

On Thu, 2010-04-22 at 13:43 +0200, Antonio Ospite wrote:
>  2. If I install any package which depends on udev then udev is brought
>     in and the static layout is gone at the next boot.

I think your best option is probably to make udev be a DISTRO_FEATURE
and not set it for your own distribution.

If you genuinely want udev to be selected (for your particular DISTRO)
on a per-MACHINE basis then you'll have to invent some way to nobble its
startup script so that it just doesn't do anything on machines where it
isn't wanted.

p.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: About having a static /dev
  2010-04-22 11:43 About having a static /dev Antonio Ospite
  2010-04-22 11:55 ` Phil Blundell
@ 2010-04-22 12:34 ` Koen Kooi
  2010-04-26 15:36   ` [PATCH] image.bbclass: create /etc/device_table from IMAGE_DEVICE_TABLES Antonio Ospite
  1 sibling, 1 reply; 11+ messages in thread
From: Koen Kooi @ 2010-04-22 12:34 UTC (permalink / raw)
  To: openembedded-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 22-04-10 13:43, Antonio Ospite wrote:
> For my machine (a780) I'd like to have a static /dev whatever image I
> build, I tried setting:
> IMAGE_DEV_MANAGER = ""
> IMAGE_DEVICE_TABLES = "files/device_table-minimal.txt \
>                        files/device_table-ezx.txt"
> 
> But this is still not enough:
>  1. the 'devices' script from initscripts keeps rewriting /dev at each
>     boot, and with a layout different than one would expect by having
>     IMAGE_DEVICE_TABLES set, see also
>     http://bugs.openembedded.org/show_bug.cgi?id=3593

The right answer would be to have image.bbclass create /etc/device_table
from the IMAGE_DEVICE_TABLES vars during do_rootfs.

And of course mark /etc/device_table as CONFFILES in the initscripts
recipe to keep the changes on package upgrades.

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFL0EJeMkyGM64RGpERAmH7AJ9bEXPhkuaX0Rvo9n8nUE4ds5niNQCfXnVx
cWUbHwV6xcBe5hSoQpGkMIA=
=vw6J
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: About having a static /dev
  2010-04-22 11:55 ` Phil Blundell
@ 2010-04-22 12:46   ` Antonio Ospite
  2010-04-22 12:54     ` Dr. Michael Lauer
                       ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Antonio Ospite @ 2010-04-22 12:46 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 1377 bytes --]

On Thu, 22 Apr 2010 12:55:43 +0100
Phil Blundell <philb@gnu.org> wrote:

> On Thu, 2010-04-22 at 13:43 +0200, Antonio Ospite wrote:
> >  2. If I install any package which depends on udev then udev is brought
> >     in and the static layout is gone at the next boot.
> 
> I think your best option is probably to make udev be a DISTRO_FEATURE
> and not set it for your own distribution.
> 
> If you genuinely want udev to be selected (for your particular DISTRO)
> on a per-MACHINE basis then you'll have to invent some way to nobble its
> startup script so that it just doesn't do anything on machines where it
> isn't wanted.
>

A per-MACHINE way would be better IMHO, I am thinking about
adding a check on something like /dev/.staticdev (suggested in [1]) to
both udev init script and to the 'device' script from initscripts, and
make the image class add the /dev/.staticdev file when
IMAGE_DEV_MANAGER == "" (or maybe == "static" or "none"?)

Does this sound reasonable?

Thanks,
   Antonio

[1] http://bugs.openembedded.org/show_bug.cgi?id=3593

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

[-- Attachment #2: Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: About having a static /dev
  2010-04-22 12:46   ` Antonio Ospite
@ 2010-04-22 12:54     ` Dr. Michael Lauer
  2010-04-22 13:22     ` Phil Blundell
  2010-04-22 14:22     ` Koen Kooi
  2 siblings, 0 replies; 11+ messages in thread
From: Dr. Michael Lauer @ 2010-04-22 12:54 UTC (permalink / raw)
  To: openembedded-devel


Am 22.04.2010 um 14:46 schrieb Antonio Ospite:

> On Thu, 22 Apr 2010 12:55:43 +0100
> Phil Blundell <philb@gnu.org> wrote:
> 
>> On Thu, 2010-04-22 at 13:43 +0200, Antonio Ospite wrote:
>>> 2. If I install any package which depends on udev then udev is brought
>>>    in and the static layout is gone at the next boot.
>> 
>> I think your best option is probably to make udev be a DISTRO_FEATURE
>> and not set it for your own distribution.
>> 
>> If you genuinely want udev to be selected (for your particular DISTRO)
>> on a per-MACHINE basis then you'll have to invent some way to nobble its
>> startup script so that it just doesn't do anything on machines where it
>> isn't wanted.
>> 
> 
> A per-MACHINE way would be better IMHO, I am thinking about
> adding a check on something like /dev/.staticdev (suggested in [1]) to
> both udev init script and to the 'device' script from initscripts, and
> make the image class add the /dev/.staticdev file when
> IMAGE_DEV_MANAGER == "" (or maybe == "static" or "none"?)
> 
> Does this sound reasonable?

Please also handle the case where we neither want an IMAGE_DEV_MANAGER
nor static device population, since we use devtmpfs.

:M:




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: About having a static /dev
  2010-04-22 12:46   ` Antonio Ospite
  2010-04-22 12:54     ` Dr. Michael Lauer
@ 2010-04-22 13:22     ` Phil Blundell
  2010-04-22 14:22     ` Koen Kooi
  2 siblings, 0 replies; 11+ messages in thread
From: Phil Blundell @ 2010-04-22 13:22 UTC (permalink / raw)
  To: openembedded-devel

On Thu, 2010-04-22 at 14:46 +0200, Antonio Ospite wrote:
> A per-MACHINE way would be better IMHO, I am thinking about
> adding a check on something like /dev/.staticdev (suggested in [1]) to
> both udev init script and to the 'device' script from initscripts, and
> make the image class add the /dev/.staticdev file when
> IMAGE_DEV_MANAGER == "" (or maybe == "static" or "none"?)
> 
> Does this sound reasonable?

Yes, that sounds reasonable enough.  Or you could check for /dev being
mounted on tmpfs rather than persistent storage; you'd probably need
some check along those lines anyway to catch the devtmpfs case.

It would still be nice to have udev be a DISTRO_FEATURE as well, since
it'd suck a bit to have all that stuff installed in flash if it's never
going to be used.  But your proposal sounds basically fine to me.

p.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: About having a static /dev
  2010-04-22 12:46   ` Antonio Ospite
  2010-04-22 12:54     ` Dr. Michael Lauer
  2010-04-22 13:22     ` Phil Blundell
@ 2010-04-22 14:22     ` Koen Kooi
  2 siblings, 0 replies; 11+ messages in thread
From: Koen Kooi @ 2010-04-22 14:22 UTC (permalink / raw)
  To: openembedded-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 22-04-10 14:46, Antonio Ospite wrote:
> On Thu, 22 Apr 2010 12:55:43 +0100
> Phil Blundell <philb@gnu.org> wrote:
> 
>> On Thu, 2010-04-22 at 13:43 +0200, Antonio Ospite wrote:
>>>  2. If I install any package which depends on udev then udev is brought
>>>     in and the static layout is gone at the next boot.
>>
>> I think your best option is probably to make udev be a DISTRO_FEATURE
>> and not set it for your own distribution.
>>
>> If you genuinely want udev to be selected (for your particular DISTRO)
>> on a per-MACHINE basis then you'll have to invent some way to nobble its
>> startup script so that it just doesn't do anything on machines where it
>> isn't wanted.
>>
> 
> A per-MACHINE way would be better IMHO

That would break the case where you want static devs for one image (e.g.
initramfs, rescue fs), but other options (e.g. udev, devtempfs, mdev,
something else) for other images on the same machine.

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFL0FuNMkyGM64RGpERAs2oAJ9bxwZhqGcesRA3EpEoMJ6vR9rwCACgjEcq
as1zs5zE8iuE806tNVdekBU=
=85tD
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] image.bbclass: create /etc/device_table from IMAGE_DEVICE_TABLES
  2010-04-22 12:34 ` Koen Kooi
@ 2010-04-26 15:36   ` Antonio Ospite
  2010-04-26 16:34     ` Koen Kooi
  0 siblings, 1 reply; 11+ messages in thread
From: Antonio Ospite @ 2010-04-26 15:36 UTC (permalink / raw)
  To: openembedded-devel

Right now when the 'devices' script from initscripts is called the
layout specified in IMAGE_DEVICES_TABLES is lost.

With this change the default behaviour when no IMAGE_DEVICE_TABLES is
specified is to always use files/device_table-minimal.txt

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
Hi Koen et al.,

This looks to be enough in my preliminary tests.
As for the default behaviour change, I guess it is acceptable and
files/device_table-minimal.txt can always be changed in a later commit, maybe
to resemble more the very /etc/device_table from initscripts.

This patch fixes http://bugs.openembedded.org/show_bug.cgi?id=3593 and I
consider it an orthogonal problem to having static /dev, so this can be
reviewed alone.

Note that I used /etc instead of ${sysconfdir} on purpose as /etc is already
hardcoded in several places in image.bbclass.

Thanks,
   Antonio Ospite
   http://ao2.it

 classes/image.bbclass                  |    4 ++++
 recipes/initscripts/initscripts_1.0.bb |    4 +++-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/classes/image.bbclass b/classes/image.bbclass
index 8e202f0..0fcbc44 100644
--- a/classes/image.bbclass
+++ b/classes/image.bbclass
@@ -119,8 +119,12 @@ fakeroot do_rootfs () {
 	mkdir -p ${IMAGE_ROOTFS}
 	mkdir -p ${DEPLOY_DIR_IMAGE}
 
+	mkdir -p ${IMAGE_ROOTFS}/etc
+
 	if [ "${USE_DEVFS}" != "1" ]; then
+		rm -rf ${IMAGE_ROOTFS}/etc/device_table
 		for devtable in ${@get_devtable_list(d)}; do
+			cat $devtable >> ${IMAGE_ROOTFS}/etc/device_table
 			makedevs -r ${IMAGE_ROOTFS} -D $devtable
 		done
 	fi
diff --git a/recipes/initscripts/initscripts_1.0.bb b/recipes/initscripts/initscripts_1.0.bb
index 2c0689f..43cf347 100644
--- a/recipes/initscripts/initscripts_1.0.bb
+++ b/recipes/initscripts/initscripts_1.0.bb
@@ -4,7 +4,7 @@ PRIORITY = "required"
 DEPENDS = "makedevs"
 RDEPENDS = "makedevs"
 LICENSE = "GPL"
-PR = "r117"
+PR = "r118"
 
 SRC_URI = "file://functions \
            file://halt \
@@ -35,6 +35,8 @@ SRC_URI = "file://functions \
 
 SRC_URI_append_arm = " file://alignment.sh"
 
+CONFFILES_${PN} += "${sysconfdir}/device_table" 
+
 KERNEL_VERSION = ""
 
 do_install () {
-- 
1.7.0.5




^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] image.bbclass: create /etc/device_table from IMAGE_DEVICE_TABLES
  2010-04-26 15:36   ` [PATCH] image.bbclass: create /etc/device_table from IMAGE_DEVICE_TABLES Antonio Ospite
@ 2010-04-26 16:34     ` Koen Kooi
  2010-04-28 16:14       ` Antonio Ospite
  0 siblings, 1 reply; 11+ messages in thread
From: Koen Kooi @ 2010-04-26 16:34 UTC (permalink / raw)
  To: openembedded-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 26-04-10 17:36, Antonio Ospite wrote:
> Right now when the 'devices' script from initscripts is called the
> layout specified in IMAGE_DEVICES_TABLES is lost.
> 
> With this change the default behaviour when no IMAGE_DEVICE_TABLES is
> specified is to always use files/device_table-minimal.txt
> 
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

Acked-By: Koen Kooi <koen@openembedded.org>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFL1cB+MkyGM64RGpERAnquAKCFb89g5PV6wYgSd1GFMTbjd97xFwCgu2+6
RETaJGE/0J02PikPZeyBF7o=
=F9aX
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] image.bbclass: create /etc/device_table from IMAGE_DEVICE_TABLES
  2010-04-26 16:34     ` Koen Kooi
@ 2010-04-28 16:14       ` Antonio Ospite
  2010-04-28 16:25         ` Koen Kooi
  0 siblings, 1 reply; 11+ messages in thread
From: Antonio Ospite @ 2010-04-28 16:14 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Koen Kooi

[-- Attachment #1: Type: text/plain, Size: 954 bytes --]

On Mon, 26 Apr 2010 18:34:06 +0200
Koen Kooi <k.kooi@student.utwente.nl> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 26-04-10 17:36, Antonio Ospite wrote:
> > Right now when the 'devices' script from initscripts is called the
> > layout specified in IMAGE_DEVICES_TABLES is lost.
> > 
> > With this change the default behaviour when no IMAGE_DEVICE_TABLES is
> > specified is to always use files/device_table-minimal.txt
> > 
> > Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> 
> Acked-By: Koen Kooi <koen@openembedded.org>

Koen, would you push this if there are no objections?

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

[-- Attachment #2: Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] image.bbclass: create /etc/device_table from IMAGE_DEVICE_TABLES
  2010-04-28 16:14       ` Antonio Ospite
@ 2010-04-28 16:25         ` Koen Kooi
  0 siblings, 0 replies; 11+ messages in thread
From: Koen Kooi @ 2010-04-28 16:25 UTC (permalink / raw)
  To: openembedded-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Done, thanks for the patch!

On 28-04-10 18:14, Antonio Ospite wrote:
> On Mon, 26 Apr 2010 18:34:06 +0200
> Koen Kooi <k.kooi@student.utwente.nl> wrote:
> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 26-04-10 17:36, Antonio Ospite wrote:
>>> Right now when the 'devices' script from initscripts is called the
>>> layout specified in IMAGE_DEVICES_TABLES is lost.
>>>
>>> With this change the default behaviour when no IMAGE_DEVICE_TABLES is
>>> specified is to always use files/device_table-minimal.txt
>>>
>>> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
>>
>> Acked-By: Koen Kooi <koen@openembedded.org>
> 
> Koen, would you push this if there are no objections?
> 
> Thanks,
>    Antonio
> 
> 
> 
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFL2GFjMkyGM64RGpERAjdBAJ9Y24F2iqPUNBTL96xErdnX8Y1T/QCdEE+8
EZ1fuzMzbZVU/OrMFvhvGRE=
=uXiV
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-04-28 16:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-22 11:43 About having a static /dev Antonio Ospite
2010-04-22 11:55 ` Phil Blundell
2010-04-22 12:46   ` Antonio Ospite
2010-04-22 12:54     ` Dr. Michael Lauer
2010-04-22 13:22     ` Phil Blundell
2010-04-22 14:22     ` Koen Kooi
2010-04-22 12:34 ` Koen Kooi
2010-04-26 15:36   ` [PATCH] image.bbclass: create /etc/device_table from IMAGE_DEVICE_TABLES Antonio Ospite
2010-04-26 16:34     ` Koen Kooi
2010-04-28 16:14       ` Antonio Ospite
2010-04-28 16:25         ` Koen Kooi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.