diff options
author | Adriana Kobylak <anoo@us.ibm.com> | 2017-03-07 12:24:52 -0600 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-03-15 21:02:57 +0000 |
commit | e0d23c0d7ca9278f58c15c12a6fdc517ddc09979 (patch) | |
tree | a178baf8e8fbbbdcc612aeb80f018acd6070f6a8 /meta-phosphor | |
parent | 579c8e04245bf2022f7c653f991077072b4c9e9c (diff) | |
download | talos-openbmc-e0d23c0d7ca9278f58c15c12a6fdc517ddc09979.tar.gz talos-openbmc-e0d23c0d7ca9278f58c15c12a6fdc517ddc09979.zip |
Attach the PNOR mtd device to UBI
Create a new service that gets the PNOR mtd device
from /proc/mtd and performs a ubiattach to it.
Since only one mtd device (PNOR) is being attached,
it's assumed that a /dev/ubi0 device is created.
Later when more devices/chips are attached, a udev
rule might be needed to link them to a specific ubi
device number.
Change-Id: I5e3018b7f4b9551861ca52718cc40b8ccfe0da6e
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'meta-phosphor')
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/flash/obmc-flash-bios.bb | 3 | ||||
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/flash/obmc-flash-bios/obmc-flash-bios-ubiattach.service | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/flash/obmc-flash-bios.bb b/meta-phosphor/common/recipes-phosphor/flash/obmc-flash-bios.bb index c425027bf..9fdd7e3e7 100644 --- a/meta-phosphor/common/recipes-phosphor/flash/obmc-flash-bios.bb +++ b/meta-phosphor/common/recipes-phosphor/flash/obmc-flash-bios.bb @@ -7,6 +7,9 @@ PR = "r1" inherit skeleton-gdbus inherit obmc-phosphor-dbus-service +RDEPENDS_${PN} += "mtd-utils-ubifs" + SKELETON_DIR = "flashbios" DBUS_SERVICE_${PN} += "org.openbmc.control.Flash.service" SYSTEMD_SERVICE_${PN} += "obmc-flash-init.service" +SYSTEMD_SERVICE_${PN} += "obmc-flash-bios-ubiattach.service" diff --git a/meta-phosphor/common/recipes-phosphor/flash/obmc-flash-bios/obmc-flash-bios-ubiattach.service b/meta-phosphor/common/recipes-phosphor/flash/obmc-flash-bios/obmc-flash-bios-ubiattach.service new file mode 100644 index 000000000..90013ff1e --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/flash/obmc-flash-bios/obmc-flash-bios-ubiattach.service @@ -0,0 +1,8 @@ +[Unit] +Description=Attach the PNOR mtd device to UBI + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/bin/sh -c 'grep pnor /proc/mtd |cut -c 4 |xargs {sbindir}/ubiattach /dev/ubi_ctrl -m' +ExecStop=/bin/sh -c 'grep pnor /proc/mtd |cut -c 4 |xargs {sbindir}/ubidetach /dev/ubi_ctrl -m' |