All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] - Question: How to change safely /var/log --> /tmp in buildroot
@ 2021-04-08 13:41 Marko Stanisic
  2021-04-08 14:32 ` Maxim Kochetkov
  0 siblings, 1 reply; 5+ messages in thread
From: Marko Stanisic @ 2021-04-08 13:41 UTC (permalink / raw)
  To: buildroot

Hello,

I have no clue how? the symlink? /var/log --> ../tmp is statically 
defined. (in buildroot)

I need? to change this behaviour safely, so that /var/log is mounted 
onto our log partition, i already tried the following:

 ??? mount /dev/mmcblk0p9 /var/log

but then (due to the symlink) /dev/mmcblk0p9 is mounted on /tmp ,and the 
mount to the tmpfs (RAM) is vanished.


Is there maybe a better solution (best practice) to solve that problem?

Thank you for every proposal,

Marko Stanisic

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

* [Buildroot] - Question: How to change safely /var/log --> /tmp in buildroot
  2021-04-08 13:41 [Buildroot] - Question: How to change safely /var/log --> /tmp in buildroot Marko Stanisic
@ 2021-04-08 14:32 ` Maxim Kochetkov
  2021-04-08 14:39   ` Marko Stanisic
  0 siblings, 1 reply; 5+ messages in thread
From: Maxim Kochetkov @ 2021-04-08 14:32 UTC (permalink / raw)
  To: buildroot

Hi, Marko

08.04.2021 16:41, Marko Stanisic ?????:
> Hello,
> 
> I have no clue how? the symlink? /var/log --> ../tmp is statically 
> defined. (in buildroot)
> 


This link is created by skeleton-init-sysv or skeleton-init-openrc package

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

* [Buildroot] - Question: How to change safely /var/log --> /tmp in buildroot
  2021-04-08 14:32 ` Maxim Kochetkov
@ 2021-04-08 14:39   ` Marko Stanisic
  2021-04-08 15:08     ` Maxim Kochetkov
  0 siblings, 1 reply; 5+ messages in thread
From: Marko Stanisic @ 2021-04-08 14:39 UTC (permalink / raw)
  To: buildroot

Thank you for the fast response,

is it possible to overwrite that behaviour by introducing an overlay? 
filesystem and

 ??? (1) create a "relative" symlink /var/log --> ../tmp/LOG", and 
afterwards

 ??? (2) mount /tmp/LOG --> /mmcblk0p9

I already? testet it manually on the board, but still not sure how to 
implement (2) :

 ?? 2.1) postimage.sh (which i use to create the images)

 ??? 2.2) or as an init script in init.d


(3) take your solution and chnage behaviour in skeleton-init-sysv or 
skeleton-init-openrc package
if that is possible


Thanks again for everyy support!!!



On 08/04/2021 16:32, Maxim Kochetkov wrote:
> Hi, Marko
>
> 08.04.2021 16:41, Marko Stanisic ?????:
>> Hello,
>>
>> I have no clue how? the symlink? /var/log --> ../tmp is statically 
>> defined. (in buildroot)
>>
>
>
> This link is created by skeleton-init-sysv or skeleton-init-openrc 
> package
>

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

* [Buildroot] - Question: How to change safely /var/log --> /tmp in buildroot
  2021-04-08 14:39   ` Marko Stanisic
@ 2021-04-08 15:08     ` Maxim Kochetkov
  2021-04-09 13:07       ` Arnout Vandecappelle
  0 siblings, 1 reply; 5+ messages in thread
From: Maxim Kochetkov @ 2021-04-08 15:08 UTC (permalink / raw)
  To: buildroot

1. You can implement your own skeleton (based on your current skeleton)
2. You can modify your target rootfs by rootfs-overlay (BR2_ROOTFS_OVERLAY)
3. You can modify your target rootfs by BR2_ROOTFS_POST_BUILD_SCRIPT

The easiest way is 2.
I would recommend you to create your own skeleton.

08.04.2021 17:39, Marko Stanisic ?????:
> Thank you for the fast response,
> 
> is it possible to overwrite that behaviour by introducing an overlay 
> filesystem and
> 
>  ??? (1) create a "relative" symlink /var/log --> ../tmp/LOG", and 
> afterwards
> 
>  ??? (2) mount /tmp/LOG --> /mmcblk0p9
> 
> I already? testet it manually on the board, but still not sure how to 
> implement (2) :
> 
>  ?? 2.1) postimage.sh (which i use to create the images)
> 
>  ??? 2.2) or as an init script in init.d
> 
> 
> (3) take your solution and chnage behaviour in skeleton-init-sysv or 
> skeleton-init-openrc package
> if that is possible
> 
> 
> Thanks again for everyy support!!!
> 
> 
> 
> On 08/04/2021 16:32, Maxim Kochetkov wrote:
>> Hi, Marko
>>
>> 08.04.2021 16:41, Marko Stanisic ?????:
>>> Hello,
>>>
>>> I have no clue how? the symlink? /var/log --> ../tmp is statically 
>>> defined. (in buildroot)
>>>
>>
>>
>> This link is created by skeleton-init-sysv or skeleton-init-openrc 
>> package
>>

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

* [Buildroot] - Question: How to change safely /var/log --> /tmp in buildroot
  2021-04-08 15:08     ` Maxim Kochetkov
@ 2021-04-09 13:07       ` Arnout Vandecappelle
  0 siblings, 0 replies; 5+ messages in thread
From: Arnout Vandecappelle @ 2021-04-09 13:07 UTC (permalink / raw)
  To: buildroot



On 08/04/2021 17:08, Maxim Kochetkov via buildroot wrote:
> 1. You can implement your own skeleton (based on your current skeleton)
> 2. You can modify your target rootfs by rootfs-overlay (BR2_ROOTFS_OVERLAY)
> 3. You can modify your target rootfs by BR2_ROOTFS_POST_BUILD_SCRIPT
> 
> The easiest way is 2.

> I would recommend you to create your own skeleton.

 I would say option 2 is better. With your own skeleton, you have to make sure
that you don't forget anything, it's more complicated if you want to change
something (e.g. switch to systemd, or upgrade buildroot), and there's always a
possibility that some other package still messes with your changes. With an
overlay, you know exactly what happens.

> 
> 08.04.2021 17:39, Marko Stanisic ?????:
>> Thank you for the fast response,
>>
>> is it possible to overwrite that behaviour by introducing an overlay
>> filesystem and
>>
>> ???? (1) create a "relative" symlink /var/log --> ../tmp/LOG", and afterwards

 You don't need that, just create an empty /var/log directory in the overlay,
and then mount mmcblk0p9 on /var/log.

>>
>> ???? (2) mount /tmp/LOG --> /mmcblk0p9
>>
>> I already? testet it manually on the board, but still not sure how to
>> implement (2) :
>>
>> ??? 2.1) postimage.sh (which i use to create the images)
>>
>> ???? 2.2) or as an init script in init.d

 Put a custom /etc/fstab in your overlay (assuming you're using sysvinit or
busybox init). The default inittab mounts everything from fstab.


 For a more complete system, you may need to do an mkfs and/or fsck on the
partition. In that case, an init script will be needed, and that init script can
just as well do the mounting. E.g. you may want to make it failsafe by doing:

- fsck; if it fails with errors, goto format.
- mount; if it fails, goto format, else exit
- format: mkfs and mount, exit if successful
- failsafe: if all else fails, mount a tmpfs on it.


 Regards,
 Arnout

>>
>>
>> (3) take your solution and chnage behaviour in skeleton-init-sysv or
>> skeleton-init-openrc package
>> if that is possible
>>
>>
>> Thanks again for everyy support!!!
>>
>>
>>
>> On 08/04/2021 16:32, Maxim Kochetkov wrote:
>>> Hi, Marko
>>>
>>> 08.04.2021 16:41, Marko Stanisic ?????:
>>>> Hello,
>>>>
>>>> I have no clue how? the symlink? /var/log --> ../tmp is statically defined.
>>>> (in buildroot)
>>>>
>>>
>>>
>>> This link is created by skeleton-init-sysv or skeleton-init-openrc package
>>>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

end of thread, other threads:[~2021-04-09 13:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 13:41 [Buildroot] - Question: How to change safely /var/log --> /tmp in buildroot Marko Stanisic
2021-04-08 14:32 ` Maxim Kochetkov
2021-04-08 14:39   ` Marko Stanisic
2021-04-08 15:08     ` Maxim Kochetkov
2021-04-09 13:07       ` Arnout Vandecappelle

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.