On Thu, May 4, 2023 at 7:33 AM Khem Raj <[email protected]> wrote:
>
> On Wed, May 3, 2023 at 10:29 PM Marek Belisko <[email protected]> wrote:
> >
> > Hi,
> >
> > I'm building an image using a kirkstone release for a banana pi m2
> > board. I've created wic file with 2 partitions one for rootfs and
> > second for storage. Storage partition if mounted to /opt/storage and
> > resized to then end of the SD card.
> > wks snippet:
> > part /opt/storage --source rootfs
> > --rootfs-dir=${IMAGE_ROOTFS}/opt/storage --ondisk mmcblk0
> > --fstype=ext4 --fsoptions="defaults,x-systemd.growfs" --align 2048
> > --fixed-size=10M
> >
> > This works fine. I've also added custom systemd-conf file for
> > journal.conf which set logs to persistent like:
> > [Journal]
> > Storage=persistent
> > ForwardToSyslog=yes
> > RuntimeMaxUse=100M
> >
> > In local.conf I've added: VOLATILE_LOG_DIR = "no" which makes /var/log
> > non volatile.
> >
> > When image is build I've added following:
> >
> > persist_logs() {
> >         mkdir -p ${IMAGE_ROOTFS}/opt/storage/journal
> >         mv ${IMAGE_ROOTFS}/var/log ${IMAGE_ROOTFS}/opt/storage/journal
> >         ln -sf /opt//storage/journal ${IMAGE_ROOTFS}/var/log
> > }
> >
> > # Create persistent logs
> > ROOTFS_POSTPROCESS_COMMAND += "persist_logs; "
> >
> > But even after all those changes, the journal is saved in /run/var ...
> >
> > Any ideas what I'm doing wrong?
> >
>
> Perhaps its not mounted yet when systemd journal needs it. So it falls
> back to /run to store it.
> usually I have always done mounting in a pre-init step via something
> like initramfs before passing
> control to systemd. That worked reliably well.
I've tried to mount my partition before systemd is started but I'm still seeing:
journalctl -b -u systemd-journald
Apr 28 17:42:27 bananapi-m2-zero systemd-journald[133]: Journal started
Apr 28 17:42:27 bananapi-m2-zero systemd-journald[133]: Runtime
Journal (/run/log/journal/d41d8cd98f00b204e9800998ecf8.
Apr 28 17:42:27 bananapi-m2-zero systemd-journald[133]: Runtime
Journal (/run/log/journal/d41d8cd98f00b204e9800998ecf8.
Apr 28 17:42:27 bananapi-m2-zero systemd-journald[133]: Received
client request to flush runtime journal.
Apr 28 17:51:03 bananapi-m2-zero systemd-journald[133]: Forwarding to
syslog missed 1 messages.
Apr 28 17:51:33 bananapi-m2-zero systemd-journald[133]: Forwarding to
syslog missed 49 messages.

and :
ls -la /var/log
lrwxrwxrwx    1 root     root            26 Mar  9  2018 /var/log ->
/opt/storage/log

Seems OK to me. Any other ideas pls? Thanks.

>
> > Thanks and BR,
> >
> > marek
> >
> > --
> > as simple and primitive as possible
> > -------------------------------------------------
> > Marek Belisko - OPEN-NANDRA
> > Freelance Developer
> >
> > Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
> > Tel: +421 915 052 184
> > skype: marekwhite
> > twitter: #opennandra
> > web: http://open-nandra.com
> >
> > 
> >



--
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#59884): https://lists.yoctoproject.org/g/yocto/message/59884
Mute This Topic: https://lists.yoctoproject.org/mt/98678435/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to