Re: [OE-core] luvOS yocto based project - "hvc0" respawning too fast

2015-10-29 Thread randy . e . witt
Hi Naresh,

> +OE core ML
>
> On 27 October 2015 at 16:17, Naresh Bhat  wrote:
>> Hi Randy,
>>
>> The luvOS project is based on luv-yocto frame work.  I have built the
>> luvOS project for AArch64 architecture using qemuarm64.conf machine
>> configuration file and boot the luvOS image on QEMU machine (used
>> latest QEMU git repository image i.e. qemu-system-aarch64 QEMU
>> v2.4.50)
>>
>> I am facing the following issue on the console "INIT: Id "hvc0"
>> respawning too fast: disabled for 5 minutes"
>>

The easiest way for you to get around this without creating your own image
is to probably mimc what runqemu does. (which is the expected consumer of
the qemu images)

If you add "-device virtio-serial-device -chardev null,id=virtcon -device
virtconsole,chardev=virtcon" to the qemu commandline, this will add the
second serial port.
>> ...
>> .
>> [-] kernel-efi-warnings
>>   [+] EFI_BOOT_SERVICES_*_illegal_access... passed
>>
>> Ran 3 testsuites and 64 unittests, 53 passes, 15 fails, 3 skipped.
>>
>> Linux UEFI Validation Distribution 2.0-dev qemuarm64 ttyAMA0
>>
>> INIT: Id "hvc0" respawning too fast: disabled for 5 minutes
>> Linux UEFI Validation Distribution 2.0-dev qemuarm64 ttyAMA0
>>
>> qemuarm64 login: root
>> root@qemuarm64:~#
>> root@qemuarm64:~#
>>
>>
>> Can you please let me know how did you tested this patch on QEMU and
>> what are the parameter's you have passed for command line ? Can you
>> please help me to overcome from the above issue ?
>>
>> I am using following script to launch the QEMU -
>> https://wiki.linaro.org/LEG/Engineering/luvOS#How_to_test_luvOS_image_on_QEMU
>> and I can see the below patch introduced the hvc0
>>
>> [nareshbhat@Lenovo luv-yocto]$ git show
>> f44e043c752470b1ed4d22f3732dc0b362f83fd9
>> commit f44e043c752470b1ed4d22f3732dc0b362f83fd9
>> Author: Randy Witt 
>> Date:   Thu Aug 27 19:42:43 2015 -0700
>>
>> qemuarm64.conf: Make the second serial console /dev/hvc0
>>
>> Since the qemu for aarch64 must use a virtual console for the second
>> serial port rather than emulating actual hardware, make sure the
>> correct
>> device is specified so that a tty is actually started.
>>
>> (From OE-Core rev: 5b720a69f0d181ab2de6032a6e3f5a0ee4a14302)
>>
>> Signed-off-by: Randy Witt 
>> Signed-off-by: Ross Burton 
>> Signed-off-by: Richard Purdie 
>>
>> diff --git a/meta/conf/machine/qemuarm64.conf
>> b/meta/conf/machine/qemuarm64.conf
>> index 7bbdad7..8459d0f 100644
>> --- a/meta/conf/machine/qemuarm64.conf
>> +++ b/meta/conf/machine/qemuarm64.conf
>> @@ -9,4 +9,4 @@ MACHINE_FEATURES = ""
>>
>>  KERNEL_IMAGETYPE = "Image"
>>
>> -SERIAL_CONSOLES = "38400;ttyAMA0 38400;ttyAMA1"
>> +SERIAL_CONSOLES = "38400;ttyAMA0 38400;hvc0"
>> [nareshbhat@Lenovo luv-yocto]$
>>
>>
>> Thanks and Regards
>> -Naresh
>

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 2/2] image.bbclass: Empty /var/volatile if it is a mount point

2015-03-24 Thread randy . e . witt
 On Mon, Mar 23, 2015 at 5:28 PM, Randy Witt
 randy.e.w...@linux.intel.com wrote:
 If /var/volatile is a mount point it shouldn't contain any files before
 mount time. If files are there, they will no longer be able to be
 accessed
 once the tmpfs gets mounted at /var/volatile.

 why not use copy-bind when mounting it second time as tmpfs ?


Khem, could you elaborate? I'm not sure I know the mechanism to which you
are referring.


 This problem can be seen for instance when systemd creates
 /var/volatile/log/journal as part of its package installation. It then
 assumes the journal is persistent even though /var/volatile/log/journal
 goes away shortly thereafter.

 This change makes sure that there are no files in /var/volatile if it is
 to be used as a mount point.

 [Yocto #7388]

 Signed-off-by: Randy Witt randy.e.w...@linux.intel.com
 ---
  meta/classes/image.bbclass | 16 
  1 file changed, 16 insertions(+)

 diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
 index 89eb5f3..dfedf9d 100644
 --- a/meta/classes/image.bbclass
 +++ b/meta/classes/image.bbclass
 @@ -181,6 +181,8 @@ POSTINST_LOGFILE ?=
 ${localstatedir}/log/postinstall.log
  SYSTEMD_DEFAULT_TARGET ?= '${@bb.utils.contains(IMAGE_FEATURES,
 x11-base, graphical.target, multi-user.target, d)}'
  ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains(DISTRO_FEATURES,
 systemd, set_systemd_default_target; , , d)}'

 +ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile;'
 +
  # some default locales
  IMAGE_LINGUAS ?= de-de fr-fr en-gb

 @@ -377,6 +379,20 @@ set_systemd_default_target () {
 fi
  }

 +# If /var/volatile is not empty, we have seen problems where programs
 such as the
 +# journal make assumptions based on the contents of /var/volatile. The
 journal
 +# would then write to /var/volatile before it was mounted, thus hiding
 the
 +# items previously written.
 +#
 +# This change is to attempt to fix those types of issues in a way that
 doesn't
 +# affect users that may not be using /var/volatile.
 +empty_var_volatile () {
 +   match=`awk '$1 !~ #  $2 ~ /\/var\/volatile/{print $2}'
 ${IMAGE_ROOTFS}/etc/fstab 2 /dev/null`
 +   if [ -n $match ]; then
 +   find ${IMAGE_ROOTFS}/var/volatile -mindepth 1 -delete
 +   fi
 +}
 +
  # Turn any symbolic /sbin/init link into a file
  remove_init_link () {
 if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then
 --
 1.9.3

 --
 ___
 Openembedded-core mailing list
 Openembedded-core@lists.openembedded.org
 http://lists.openembedded.org/mailman/listinfo/openembedded-core


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] systemd: Instruct the journal to always be volatile

2015-03-11 Thread randy . e . witt

 On Mar 11, 2015, at 2:28 PM, Randy Witt randy.e.w...@linux.intel.com
 wrote:

 When the storage mode for the journal is auto if /var/log/journal
 exists then the journal will flush to /var/log/journal assuming that
 /var/log/journal is persistent.

 However /var/log - /var/volatile/log in poky, so even though
 /var/log/journal exists, it is still volatile.

 Since this can cause ordering issues due to /var/volatile needing to be
 mounted before the journal actually writes to it, just specify that the
 journal
 should always be volatile and never try to write to persistent
 storage. The journal will exist in /run/log/journal only.

 This also disables the After of the journal on var-volatile.mount
 since the ordering is no longer necessary when the journal is only
 stored in /run/log/journal.

 [Yocto #7388]


 This is not right. What if I want persistent logs.? the options is just
 gone. Both cases should work. /var/volatile should only be used
 when doing ro-rfs its not FHS specified anyway. Lets not go with this
 patch.
The distro could still change it with a bbappend or additional
configuration files just like other settings. We don't have an option for
a persistent journal so I'm curious, how would both cases work currently?

Currently if a persistent journal is desired, the /var/log symlink has to
be changed to point to persistent storage, or /var/volatile has to be
dropped from /etc/fstab. These are also configuration changes.

The lesser of the two evils seems to be making it so that the journal
works in the volatile case, which is all we've ever supported in poky. If
a user wanted a non-volatile journal it was left to them to do.

I agree that the journal should be persistent, but I also agree with
Richard that seems to be too big of a change in behavior when we're so
close to the release point.


 Signed-off-by: Randy Witt randy.e.w...@linux.intel.com
 ---
 meta/recipes-core/systemd/systemd/journald-volatile.conf | 6 --
 meta/recipes-core/systemd/systemd_219.bb | 4 ++--
 2 files changed, 2 insertions(+), 8 deletions(-)
 delete mode 100644
 meta/recipes-core/systemd/systemd/journald-volatile.conf

 diff --git a/meta/recipes-core/systemd/systemd/journald-volatile.conf
 b/meta/recipes-core/systemd/systemd/journald-volatile.conf
 deleted file mode 100644
 index b11e160..000
 --- a/meta/recipes-core/systemd/systemd/journald-volatile.conf
 +++ /dev/null
 @@ -1,6 +0,0 @@
 -# If /var/volatile is a mount point then make sure to mount it before
 -# the journal starts. This is because base-files creates a symlink
 -# /var/log - /var/volatile/log. And if the journal starts before the
 mount
 -# happens, the journal will appear empty until restarted.
 -[Unit]
 -After=var-volatile.mount
 diff --git a/meta/recipes-core/systemd/systemd_219.bb
 b/meta/recipes-core/systemd/systemd_219.bb
 index d5eed08..f3bb0c4 100644
 --- a/meta/recipes-core/systemd/systemd_219.bb
 +++ b/meta/recipes-core/systemd/systemd_219.bb
 @@ -48,7 +48,6 @@ SRC_URI =
 git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=
file://00-create-volatile.conf \
file://init \
file://run-ptest \
 -   file://journald-volatile.conf \
   

 S = ${WORKDIR}/git
 @@ -145,7 +144,6 @@ do_install() {
  install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/

  install -m 0644 ${WORKDIR}/00-create-volatile.conf
 ${D}${sysconfdir}/tmpfiles.d/
 -install -D -m 0644 ${WORKDIR}/journald-volatile.conf
 ${D}${systemd_unitdir}/system/systemd-journald.service.d/journald-volatile.conf

  if
 ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)};
 then
  install -d ${D}${sysconfdir}/init.d
 @@ -170,6 +168,8 @@ do_install() {

  # Enable journal to forward message to syslog daemon
  sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/'
 ${D}${sysconfdir}/systemd/journald.conf
 +# Make the journal volatile by default.
 +sed -i -e 's/.*Storage.*/Storage=volatile/'
 ${D}${sysconfdir}/systemd/journald.conf
  # its needed in 216 upstream has fixed it with
 919699ec301ea507edce4a619141ed22e789ac0d
  # don't order journal flushing afte remote-fs.target
  sed -i -e 's/ remote-fs.target$//'
 ${D}${systemd_unitdir}/system/systemd-journal-flush.service
 --
 1.9.3

 --
 ___
 Openembedded-core mailing list
 Openembedded-core@lists.openembedded.org
 http://lists.openembedded.org/mailman/listinfo/openembedded-core



-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] systemd: Fix the problem of an empty journal on boot

2015-03-05 Thread randy . e . witt
 On Mar 5, 2015 6:13 PM, Randy Witt randy.e.w...@linux.intel.com wrote:

 systemd by default tries to write the journal to /var/log/journal.
 But base-files has a symlink /var/log - /var/volatile/log. And
 /var/volatile is a tmpfs mount in /etc/fstab.

 If the journal service started before /var/volatile was mounted (which
 was the typical scenario) then the journal would appear empty since
 the old location was mounted over.

 This change fixes the problem by ensuring that the journal doesn't start
 until after the mount happens.


 What happens if folks have a different fstab then default? Will it still
 work

Yes, the After only changes behavior if something else has caused
var-volatile.mount to be in the set of services to be started.

I verified that was the case by removing /var/volatile from /etc/fstab and
the journal still starts with no errors.

 [Yocto #7388]

 Signed-off-by: Randy Witt randy.e.w...@linux.intel.com
 ---
  meta/recipes-core/systemd/systemd/journald-volatile.conf | 6 ++
  meta/recipes-core/systemd/systemd_219.bb | 2 ++
  2 files changed, 8 insertions(+)
  create mode 100644
 meta/recipes-core/systemd/systemd/journald-volatile.conf

 diff --git a/meta/recipes-core/systemd/systemd/journald-volatile.conf
 b/meta/recipes-core/systemd/systemd/journald-volatile.conf
 new file mode 100644
 index 000..b11e160
 --- /dev/null
 +++ b/meta/recipes-core/systemd/systemd/journald-volatile.conf
 @@ -0,0 +1,6 @@
 +# If /var/volatile is a mount point then make sure to mount it before
 +# the journal starts. This is because base-files creates a symlink
 +# /var/log - /var/volatile/log. And if the journal starts before the
 mount
 +# happens, the journal will appear empty until restarted.
 +[Unit]
 +After=var-volatile.mount
 diff --git a/meta/recipes-core/systemd/systemd_219.bb
 b/meta/recipes-core/systemd/systemd_219.bb
 index 3c4b6cf..2be66af 100644
 --- a/meta/recipes-core/systemd/systemd_219.bb
 +++ b/meta/recipes-core/systemd/systemd_219.bb
 @@ -48,6 +48,7 @@ SRC_URI = git://
 anongit.freedesktop.org/systemd/systemd;branch=master;protocol=
 file://00-create-volatile.conf \
 file://init \
 file://run-ptest \
 +   file://journald-volatile.conf \


  S = ${WORKDIR}/git
 @@ -143,6 +144,7 @@ do_install() {
 install -m 0644 ${WORKDIR}/*.rules
 ${D}${sysconfdir}/udev/rules.d/

 install -m 0644 ${WORKDIR}/00-create-volatile.conf
 ${D}${sysconfdir}/tmpfiles.d/
 +   install -D -m 0644 ${WORKDIR}/journald-volatile.conf
 ${D}${systemd_unitdir}/system/systemd-journald.service.d/journald-volatile.conf

 if
 ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
 install -d ${D}${sysconfdir}/init.d
 --
 1.9.3

 --
 ___
 Openembedded-core mailing list
 Openembedded-core@lists.openembedded.org
 http://lists.openembedded.org/mailman/listinfo/openembedded-core


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] mkefidisk: change filesystem to be writeable on grub

2015-02-26 Thread randy . e . witt

 On Qui, 2015-02-26 at 13:44 -0800, Randy Witt wrote:
 On 02/26/2015 11:29 AM, Bruno Bottazzini wrote:
  This patch changes grub configuration so the filesystem will be
 writeable
  instead, just read only when running the script.
  ---
scripts/contrib/mkefidisk.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
 
  diff --git a/scripts/contrib/mkefidisk.sh
 b/scripts/contrib/mkefidisk.sh
  index b96b7d4..9b84831 100755
  --- a/scripts/contrib/mkefidisk.sh
  +++ b/scripts/contrib/mkefidisk.sh
  @@ -342,7 +342,7 @@ if [ -e $GRUB_CFG ]; then
 sed -i s/ LABEL=[^ ]*/ / $GRUB_CFG
 
 sed -i s@ root=[^ ]*@ @ $GRUB_CFG
  -  sed -i s@vmlinuz @vmlinuz root=$TARGET_ROOTFS ro rootwait quiet @
 $GRUB_CFG
  +  sed -i s@vmlinuz @vmlinuz root=$TARGET_ROOTFS rw rootwait quiet @
 $GRUB_CFG
fi
 
# Look for a gummiboot installation
 

 This change basically reverts
 http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=24cd3ddeb70a3d3f2985ec71c87ae0108f3d2777
 by Darren. It also doesn't change the ro option when using gummiboot
 instead.

 What is this change trying to fix?

 Hello Randy,

 I got the following message:
  file system is read-only

 if I try to touch a file that is not on /tmp, or when I start a systemd
 service that tries to write on the file system.

 After some research, I go it fixed by changing to read/write on the
 script that was with read only.

 I thought this would be useful for someone else.

Thank you for taking the time to do this. If things still don't work after
checking /etc/fstab, let us know.

 Reading the patch you sent me, Darren says that a proper fstab will ensure
 the rootfs is rw.
 Maybe I'm missing this. I will look for this to make sure that my fstab
 OK.

 Thanks






-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core