From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=yahoo.com (client-ip=98.137.68.31; helo=sonic308-55.consmr.mail.gq1.yahoo.com; envelope-from=geissonator@yahoo.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=reject dis=none) header.from=yahoo.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=yahoo.com header.i=@yahoo.com header.a=rsa-sha256 header.s=s2048 header.b=XxzrOphR; dkim-atps=neutral Received: from sonic308-55.consmr.mail.gq1.yahoo.com (sonic308-55.consmr.mail.gq1.yahoo.com [98.137.68.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48RD4x0fn2zDqSS for ; Tue, 25 Feb 2020 07:22:21 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1582575737; bh=d+WPYqinFu0/OPAEDDbVjmYXaxJGC46tsa154XJrbNs=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From:Subject; b=XxzrOphRgsevmlSyAhswxFKw3BobR5/ubh/cOmLBx8ADf6jZqEnv1VsNVKNkRl7aLXwsQML046y5+oBcNM7fA5lIYGtak6w/kn8fBAXng+0OBQSi0OxfrcTqHxC8aAECUYDE2wHBMamfn295J/0y6dWpUC5lwTv/1uO1aQTx0ZvV5kR2VAZ+CZfzRd+1CrutXVcbXdDPwdaQkpyO34InIygZLTBD3BSa7YKKjuVUpuVYJEusMLm12EyIykv34LO4JibxMzYNfZPbpoJjy0Kg6VNk5f9BgXgiV3kWlx/MwDoWAeyCVCNLa4XvLalG5Wu3vL7/3xepZ+DYllLdbf+cwA== X-YMail-OSG: 9MzCas8VM1mJaodnDknCeyTeY00s9pIjvjTUofGmeZO9NS6fEbwoPhhWW3Mydag SuZew8bg.tbfG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6b.5tQA_7vNOwgCcs4bgS76r5EEt921gQzqm43R2HeOfoSuVn10q9 7TS10BlO.MJbh10lcqtn.eqWUhZouRUNpM47H0rWJwyliYwR_qPIm1MeDmVKOWh.owVEGAlHGZRN heHdIfMH4UuA_SFdmQuABY2IljiWJYqYw2I0DwnqrIMZIyOd_Qht63Oa13FS4askSenr0M8zKeH_ 7FxJIyYRrSCufPa_akr28tCuo1GDkcHrsmNJyU0s1NcPoDxKMWTCQ0ImNAEdtPSfKjo2dxgh7yqN C.Z6394pj3pcs_.HNyrjYylKTzaCfVYOOsg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.gq1.yahoo.com with HTTP; Mon, 24 Feb 2020 20:22:17 +0000 Received: by smtp423.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 3fc7458586fd86cc8c6255b330235c7d; Mon, 24 Feb 2020 20:22:15 +0000 (UTC) From: Andrew Geissler Message-Id: <15FDACF4-AA21-4867-9DFB-DC8CAB3AB17E@yahoo.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_2EE2CFFE-75C8-446A-AB99-1465D4305458" Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: OpenBMC Starting Point Date: Mon, 24 Feb 2020 14:22:13 -0600 In-Reply-To: Cc: Michael Richardson , openbmc@lists.ozlabs.org To: Samuel Herts References: <5937.1579503424@localhost> X-Mailer: Apple Mail (2.3608.60.0.2.5) X-Mailman-Approved-At: Thu, 27 Feb 2020 13:08:41 +1100 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2020 20:22:26 -0000 --Apple-Mail=_2EE2CFFE-75C8-446A-AB99-1465D4305458 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Feb 24, 2020, at 9:40 AM, Samuel Herts wrote: >=20 > So if I wanted a c++ script to run on the bmc whenever I desired, how = exactly would I go about implementing it as a module to run? Kind of = like the Phosphor state manager module that the Hello World guide starts = on, specifically, what steps would I need to take or what resources = should I look into for creating my own module that will run when a = specific command is sent, like the systemctl start phosphor.=20 This would probably make a good tutorial under https://github.com/openbmc/docs/tree/master/development = but here=E2=80=99s the really fast answer from my perspective. First you create a git repository somewhere (i.e. github). Next you pick a logical location in for your recipe to be located. For example if it was going to be a package used by all of OpenBMC, it would go out somewhere in = https://github.com/openbmc/openbmc/tree/master/meta-phosphor/recipes-phosp= hor = A good example is bmcweb: = https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-phosp= hor/interfaces/bmcweb_git.bb = You=E2=80=99d make a recipe like this, point SRC_URI and SRCREV to your code and the commit id to pick up. You=E2=80=99d create your own service file, like bmcweb.service (note the service file is packaged in your repo). (i.e. https://github.com/openbmc/bmcweb/blob/master/bmcweb.service.in = ) For the [Install] section you would just put the following to ensure your service was started on BMC boot up. WantedBy=3Dmulti-user.target You=E2=80=99d adjust the ExecStart to call your application Note that bmcweb uses CMake but we=E2=80=99re moving a lot of projects to meson which is what I=E2=80=99d recommend if you=E2=80=99re creating a new project. = https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-state-manager/+/2787= 8 = is an example of adding service files to meson. Then you would go into a packagegroup, like = https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-phosp= hor/packagegroups/packagegroup-obmc-apps.bb = and do something similar to what they did with bmcweb and add it as an RDEPENDS Then you would bitbake your image and voila, your code would be pulled down, built, and packaged into the image. When you start it in QEMU you would see your application run. If you were writing something you thought would be useful for the community then you would send out an email and write up a design doc to get feedback on the right location for the code and recipe to go. https://github.com/openbmc/docs/blob/master/designs/design-template.md = =20= Andrew >=20 > On Mon, Jan 20, 2020 at 1:57 AM Michael Richardson > wrote: >=20 > Samuel Herts > wrote: > > I am currently working on getting a working OpenBMC test = environment > > up and running. I am using VirtualBox and the github Development > > Environment tutorial. I had a couple questions regarding how to = make > > our own modules. Would it be possible to upload files to the bmc = on > > the virtual server? >=20 > You can do that. > The disk is rather small by default. > If you are using VirtualBox, you may be able to use the vboxfs file = system to > mount the host. That might require adding modules to the kernel. >=20 > > And would I be able to make a script which can read text off of = that > > file inside the bmc chip? >=20 > > I have a physical server which I am not using yet, would I be = able to > > install openbmc and the scripts and insert the file onto the = actual > > bmc chip, and eventually read from that file? >=20 > Maybe. What server do you have? >=20 > -- > ] Never tell me the odds! | ipv6 mesh = networks [ > ] Michael Richardson, Sandelman Software Works | IoT = architect [ > ] mcr@sandelman.ca = http://www.sandelman.ca/ | ruby on = rails [ >=20 >=20 >=20 > --=20 > Sincerely,=20 > Samuel Herts --Apple-Mail=_2EE2CFFE-75C8-446A-AB99-1465D4305458 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Feb 24, 2020, at 9:40 AM, Samuel Herts <sdherts@gmail.com> = wrote:

So if I wanted a c++ script to run on the bmc = whenever I desired, how exactly would I go about implementing it as a = module to run? Kind of like the Phosphor state manager module that the = Hello World guide starts on, specifically, what steps would I need to = take or what resources should I look into for creating my own module = that will run when a specific command is sent, like the systemctl start = phosphor. 

This would probably make a good tutorial = under
https://github.com/openbmc/docs/tree/master/development
but here=E2=80=99s the really fast answer from my = perspective.

First you create a git = repository somewhere (i.e. github).

Next you pick a logical location in for your = recipe to
be located. For example if it was going to be a = package used
by all of OpenBMC, it would go out somewhere = in

A good example is = bmcweb:
You=E2=80=99d make = a recipe like this, point SRC_URI and SRCREV to your
code and = the commit id to pick up.

You=E2=80=99= d create your own service file, like bmcweb.service
(note the = service file is packaged in your repo).
For the [Install] section you would just put the = following
to ensure your service was started on BMC boot = up.
WantedBy=3Dmulti-user.target
You=E2=80=99d = adjust the ExecStart to call your application

Note that bmcweb uses CMake but we=E2=80=99re = moving a lot of
projects to meson which is what I=E2=80=99d = recommend if you=E2=80=99re
creating a new = project.
is an example of adding service files to = meson.

Then you would go into a = packagegroup, like
and = do something similar to what they did with
bmcweb and add it = as an RDEPENDS

Then you would = bitbake your image and voila, your code would
be pulled down, = built, and packaged into the image. When you
start it in QEMU = you would see your application run.

If= you were writing something you thought would be useful
for = the community then you would send out an email and
write up a = design doc to get feedback on the right
location for the code = and recipe to go.

Andrew


On Mon, Jan 20, 2020 at 1:57 AM Michael Richardson = <mcr@sandelman.ca> wrote:

Samuel Herts <sdherts@gmail.com> wrote:
    > I am currently working on getting a working OpenBMC = test environment
    > up and running. I am using VirtualBox and the github = Development
    > Environment tutorial. I had a couple questions = regarding how to make
    > our own modules. Would it be possible to upload files = to the bmc on
    > the virtual server?

You can do that.
The disk is rather small by default.
If you are using VirtualBox, you may be able to use the vboxfs file = system to
mount the host. That might require adding modules to the kernel.

    > And would I be able to make a script which can read = text off of that
    > file inside the bmc chip?

    > I have a physical server which I am not using yet, = would I be able to
    > install openbmc and the scripts and insert the file = onto the actual
    > bmc chip, and eventually read from that file?

Maybe. What server do you have?

--
]               Never tell me = the odds!                 | = ipv6 mesh networks [
]   Michael Richardson, Sandelman Software Works    =     |    IoT architect   [
]     mcr@sandelman.ca  http://www.sandelman.ca/        = |   ruby on rails    [



--
Sincerely, Samuel Herts

= --Apple-Mail=_2EE2CFFE-75C8-446A-AB99-1465D4305458--