[OE-core] [PATCH] image_types: Ensure /init exists for cpio rootfs archives

Andrea Adami andrea.adami at gmail.com
Fri Jan 6 22:58:32 UTC 2012


On Fri, Jan 6, 2012 at 11:57 AM, Richard Purdie
<richard.purdie at linuxfoundation.org> wrote:
> On Fri, 2012-01-06 at 02:00 +0100, Andrea Adami wrote:
>> On Fri, Jan 6, 2012 at 12:36 AM, Darren Hart <dvhart at linux.intel.com> wrote:
>> >
>> >
>> > On 01/05/2012 04:30 AM, Richard Purdie wrote:
>> >> On Thu, 2012-01-05 at 01:05 +0100, Andrea Adami wrote:
>> >>> I'd say we have to test for the in-existence of the file instead of
>> >>> blindly touching it.
>> >>> Smthg like
>> >>>
>> >>> if [! -e ${IMAGE_ROOTFS}/init]; then
>> >>> touch ${IMAGE_ROOTFS}/init
>> >>> fi
>> >
>> > Why? Touch creates it if it doesn't exist and updates the modtime if it
>> > does. It doesn't modify the content of the file if it exists. What is
>> > the motivation for testing for it's existence?
>> >
>> touch fails with Permission denied because one package in my rootfs
>> already created the symlink
>>
>> >>>
>> >>>
>> >>> Now, repeating that block for all 4 cpio images is a bit ugly... better ideas?
>> >>
>> >> Make it a shell function we call? I'd also check for
>> >> ${base_sbindir}/init first too?
>> >
>> > Why check for that? So we can link to it instead of creating an empty file?
>>
>> Nonsense, kernel looks for /init
>> ( http://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt
>> )
>
> Yes, please ignore my comment about /sbin/init, I'm misremembering
> something. We should deal with the symlink case though.
>
> Cheers,
>
> Richard
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

ok, I think the issue is the behavior of touch when trying to change
the timestamp of a symlink.

http://fossplanet.com/f13/bug-7122-touch-gnu-coreutils-7-4-no-way-touch-symlink-57418/

Using 'touch -h' seems solving the issue and the image is built.
However, the timestamp of the /init symlink now differs from the
timestamp of the binary.

Regards

Andrea




More information about the Openembedded-core mailing list