summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* generate-tar: Add machine nameHEADmasterLei YU2020-01-211-0/+11
| | | | | | | | | | | | | | | | | | The openbmc image manager expects "MachineName" in MANIFEST that matches the BMC's OPENBMC_TARGET_MACHINE in /etc/os-release. * If there is no MachineName in MANIFEST, it logs a warning for now; * If they do not match, an error is reported and the version is deleted. Add -m, --machine argument for generate-tar to make it support the "MachineName". Tested: Verify that when a correct machine name is given, the tarball is processed by image manager correctly; And if an invalid machine name is given, the tarball uploaded will get "Machine name doesn't match" error and is deleted. Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I8fbb5060cb1be348c39e0688fe7306426cc4ed77
* generate-tar: Add --interactive=never for rmLei YU2020-01-201-1/+4
| | | | | | | | | | | | | | On generating Witherspoon PNOR tarball, rm is asking for confirmation on removing the files in the temp dir, because the partitions are read-only now. Add --interactive=never so that it does not ask for interaction. Tested: Run the script to generate Witherspoon PNOR and verify it does not ask for interfaction to remove the files in temp dir. Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I89e94e47e02fab53eaca952a70dc672407b75cc7
* Fix ECC usage of being cleaned partitionsAlexander Filippov2019-12-202-2/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reset procedure of PNOR works improperly for our P8 based VESNIN hardware and makes the host unbootable. The problem is in incorrect partition cleaning. Hostboot for P8 has no support for CLEARECC bit and PNOR flash has no partitions with flag 'C'. P9 based hardware is not affected until PNOR has partitions with ECC flag only. This commit modifies the reset procedure to make it use the flag 'E' (ECC) instead of 'C' (CLEARECC). * The flag 'E' means that the partition requires ECC. * The flag 'C' means that the partition might be cleaned by hostboot when ECC is wrong. For details see: https://github.com/open-power/hostboot/blob/75c0908b91275dc10bd17cb0f10b452f32ce0b91/src/include/usr/pnor/pnor_const.H#L128 Tested: All PNOR partitions with enabled flags 'E' and 'F' should be cleaned with ECC. Change-Id: I632e90c8e256df3445fc3d1f45c830d155a1d208 Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
* Host.Updater.service: Move dependency on ubi service to the ubi serviceAdriana Kobylak2019-10-282-2/+4
| | | | | | | | | | | | | | | The org.open_power.Software.Host.Updater.service is a service common to the static and ubi layout, but it had a dependency on a ubi service. It doesn't cause a failure on the static layout because the dependency is a Wants vs a Required, but it should not be there. Move the dependency instead to the ubi service. Tested: Verified on witherspoon that the org.open_power.Software.Host.Updater.service started followed by the obmc-flash-bios-ubipatch.service as it did before. Change-Id: I9c850e312d0b11faaf2a08db6b3ccb17cdfcbcb6 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Move updatesymlinks to new vpnor featureAdriana Kobylak2019-10-257-66/+96
| | | | | | | | | | | | | | The updatesymlinks functionality is to support virtual pnor and it does not depend on the filesystem type. Move it to a new vpnor feature so that users can make use of this feature without being tied to UBI, for example on a eMMC that has a combined BMC+PNOR image. Tested: Verified that the witherspoon image contained the new script and service file and that it powered on to the host. Change-Id: Ic5e51dfde81718e5e285f010be67afbd58eac2e1 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* generate-tar: Set permissions of partition files to read onlyAdriana Kobylak2019-10-151-0/+2
| | | | | | | | | | | | | | | | | Set file permissions to 440 since the PNOR partition files are intended to be read-only and managed by the mbox application, so the permissions should be set accordingly for cases where the BMC root filesystem is not read-only. Tested: Before: -rw-r--r-- 1 root root 1179648 Oct 9 18:43 HBD After: -r--r----- 1 root root 1179648 Oct 9 15:33 HBD Change-Id: I9eaf773fc09a12c4c0ed02302a41eb959719013f Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* generate-tar: Call mksquashfs with -all-root optionAdriana Kobylak2019-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The mksquashfs command preserves the owner of the files it squashes, which is the login name of the user that runs generate-tar since the partiton files are extracted into a local directory by pflash. Bitbake sets the owner for the filesystem files to root as default, so makes sense that the PNOR partition files are also owned by root instead of a user name that doesn't exist on the BMC. Tested: Before: root@witherspoon:~# ls -l /media/pnor-ro-652c7b59/ -rw-rw-r-- 1 253760 401855 32768 Aug 15 14:39 ATTR_PERM After: root@witherspoon:~# ls -l /media/pnor-ro-944751fd/ -rw-rw-r-- 1 root root 32768 Sep 11 15:07 ATTR_PERM -rw-rw-r-- 1 root root 32768 Sep 11 15:07 ATTR_TMP Change-Id: Ic2cbed13e0da687e51a5c15041f54fef93c07be9 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* msl: Support for v-xx.xx.xx format version IDJohn Wang2019-09-172-4/+16
| | | | | | | | | | | | | The version ID of the pnor we have released is similar to the following format. Inspur-Dubai-v-4.1.01 This change adds support for parsing version ID in v-xx.xx.xx format Signed-off-by: John Wang <wangzqbj@inspur.com> Change-Id: I1a7dd04256d1901e3dafef14baf338b853e2ff97
* Move to new association interfaceJohn Wang2019-09-177-38/+6
| | | | | | | | | | | | | | | | | | | A new association interface is defined in phosphor-dbus-interfaces It would be nice to move the local version of the interface to the new one. The behavior of how association work is described here: https://github.com/openbmc/docs/blob/master/object-mapper.md#associations Partially resolves openbmc/openbmc#3584 Tested: See the org.openbmc.Associations interface has been replaced by the xyz one in /xyz/openbmc_project/software/version_id object and only when the version number is less than PNOR_MSL, "PNOR Minimum Ship Level NOT met" is reported. Signed-off-by: John Wang <wangzqbj@inspur.com> Change-Id: If4afeb69a9bd8bc494b77826f2ec2854a71f56f5
* Use wc to calculate file sizesOliver O'Halloran2019-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | Milton pointed out that for the du command the -b and -k options aren't really compatible. From the man page: -b, --bytes equivalent to '--apparent-size --block-size=1' -k like --block-size=1K As a result 'du -bk' will act as if the following args were used: --apparent-size --block-size=1K However, it's probably not safe to assume this. Fix this by replacing the use of du with "wc -c". POSIX requires that wc -c prints size of each input file in bytes so it should be safe (and portable). Fixes: adf91f58dac9 ("Fix generate-tar on ppc64 hosts") Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Change-Id: I1baf96b4c5304a27ddedf3384cf23d2c346134d8
* Code Update: Host ApplyTime supportJayashankar Padath2019-08-093-7/+109
| | | | | | | | | | | | | | | | | | | | Get the requested image apply time value provided through the UpdateService redfish schema. If the apply time value is Immediate, then host reboot will be triggered just after the new pnor image activation. The default apply time value is OnReset in which the new image remains at Active state and user has to manualy reboot the host for applying the new image. Tested: Verified that host is getting rebooted while doing a pnor code update if the apply time value is Immediate. Tested this use case at server power Off and Running scenarios. OnReset scenario was also tested in which new image remained at Active state as pnor code update application did not trigger the host reboot. Note: This change is applicable to ubi based systems (Witherspoon) Signed-off-by: Jayashankar Padath <jayashankar.padath@in.ibm.com> Change-Id: I74f73172626919b225efef43d9baacd64eadbf60
* ubi: Rewrite freePriorityAdriana Kobylak2019-07-232-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | freePriority is called by RedundancyPriority::priority() to ensure that there are no duplicate priority values. Originally, freePriority would call priority() whenever it updated a priority value, but this would call freePriority again. This can cause the priorities stored on flash to not match the D-Bus values. The priorities on flash are used to determine which version to boot from so that leads to unexpected behavior. Example is if A has priority 1 and B has priority 2, and the priority of B is changed to 1, this triggers the new value of 1 to be stored on flash, then A is bumped to 2, but then B that originally had 2 is bumped to 3, so that at the end of the operation, B has priority 3 on flash but the correct 1 in D-Bus. The solution is to prevent freePriority from calling itself, by sorting all versions by priority in ascending order, so that if a version is bumped, then only the remaining versions need to be checked. Then locally update the priority values on flash and on D-Bus for each changed one. Tested: Changed priorities multipled times and verified the mismatch is not seen anymore. Change-Id: I704ee98f356a1a77f431b83e4b9d787b2671aeb2 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Fix generate-tar on ppc64 hostsOliver O'Halloran2019-07-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Currently the tarball MANIFEST is garbaled when building the tarball on a ppc64 host. This is because the check to determine if the secureboot header needs to be removed is sensitive to the system page size. By default the scratch directory used when running generate-tar is placed in /tmp. Typically this is a tmpfs file system which has a minimum block of one system page, which is 64KB on ppc64. We use the du utility to calculate the size of the VERSION partition and when a file is smaller than the file systems minimum allocation block it gives an unexpected result: $ du -k /tmp/tmp.BhDKg0pQGF/VERSION 64 /tmp/tmp.BhDKg0pQGF/VERSION $ du -bk /tmp/tmp.BhDKg0pQGF/VERSION 8 /tmp/tmp.BhDKg0pQGF/VERSION We can fix this by passing the '-b' parameter to du to make it ignore the filesystem block size. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Change-Id: I03e47d81d837f73159a523bacdd481d6e294b84b
* Move script and systemd service files into repoAdriana Kobylak2019-06-2115-1/+523
| | | | | | | | | | Move the obmc-flash-bios script and systemd service files from openbmc/openbmc to the local repo. Tested: PNOR code update was successful on witherspoon. Change-Id: Ibb7adba0638b8205173cb0ec4d4d61f2aeb6ce28 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* generate-tar: Extract PNOR contents to a subdirAdriana Kobylak2019-06-111-13/+17
| | | | | | | | | | | Extract the PNOR contents to a subdir to support creating an ext4 image that takes a directory as a parameter instead of individual files. Tested: Generated a squashfs image and verified it contained the PNOR partitions. Change-Id: I4aef816b55833b5e4df8e93c29d9484c2c9b3d3d Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* generate-tar: Always remove scratch dirAdriana Kobylak2019-06-101-1/+1
| | | | | | | | | | | Add a trap to generate-tar to remove the scratch dir on exit, otherwise the scratch dir was not being removed if the script failed before it reached the end where the rm command was. Tested: Verified the scratch dir was removed on failure. Change-Id: I177201976d19d5b7a44a909090739f7e74f75320 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Remove deprecated is_method_error codeAdriana Kobylak2019-06-032-40/+50
| | | | | | | | | | | | | The is_method_error() function is no longer needed, instead a try-catch block should be used instead. Reference: https://lists.ozlabs.org/pipermail/openbmc/2018-October/013696.html Tested: Code update with field mode enabled, and ran Delete while host powered on, to check things still worked as expected. Change-Id: I8ba8da32fe787c3151cc5be7cb9f55d1901e57cd Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Static layout: support image verificationLei YU2019-04-0410-37/+60
| | | | | | | | | | | Add support of image verification for static layout PNOR code update. Tested: Verify the PNOR code update succeeds with valid-signed PNOR; and fails with invalid-signed PNOR or a PNOR tarball without signature. Change-Id: I1aafeb4e8e07eaa16c170f33f4f21940f7c9c146 Signed-off-by: Lei YU <mine260309@gmail.com>
* build: install into bin instead of sbinPatrick Venture2019-03-281-1/+1
| | | | | | | Installs into bin instead of sbin per guidelines. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I8781724e7261745896166421504ba88f37690ebc
* activation_ubi: Set priority in constructorAdriana Kobylak2019-03-251-1/+6
| | | | | | | | | | | | | | | | | | The base activation class sets the priority value in its constructor, but since the ubi class overrides this method, need to call it in the ubi constructor as well, otherwise the priority values won't get written to flash after a BMC factory reset, causing the pnor updater to think there are no pnor versions installed. Tested: After a BMC factory reset, the ubi priority() method was called, which restores the pnor priority files, and the pnor symlinks were created. Fixes: openbmc/openbmc#3507 Change-Id: I5d234ab232c91ac01d5c15c1c6ae87408c73b99c Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Add Lei as MaintainerAdriana Kobylak2019-03-191-0/+1
| | | | | | | | | | Lei has written all the function needed to support updates on a static layout PNOR. He's committed to maintaining this piece and verifying that submitted changes are compatible with this layout. Change-Id: I50e3c51d47e6e3623849036bb4269d0dee921190 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Refactor: Use hiomapd instead of mboxdLei YU2019-03-188-178/+135
| | | | | | | | | | | | | | mbox service is renamed to hiomapd and provides "Suspend" and "Resume" method calls, which is more appropriate for raw "cmd" calls. Use the new methods to suspend and resume hiomapd. Move "getService()" function into utils so it is shared by multiple files. Tested: Verify the reset works on Romulus Change-Id: I8f89de134b13126697bfc69a21a3148a01c34cca Signed-off-by: Lei YU <mine260309@gmail.com>
* Install services to systemd unit dirLei YU2019-03-142-0/+20
| | | | | | | | | | | Add configure and makefile rule to install system service units to systemd unit dir. Tested: Verify the service is install to /lib/systemd/system in openbmc environment. Change-Id: I620fe1f01ad315e4918d30fecdf165fd91fefe7b Signed-off-by: Lei YU <mine260309@gmail.com>
* Refactor: Fix issues found by cppcheckLei YU2019-03-1310-20/+18
| | | | | | | | | | | | | | | | | | | | | | | Resolve several issues found by cppcheck: [msl_verify.hpp:28]: (style) Class 'MinimumShipLevel' has a constructor with 1 argument that is not explicit. [ubi/watch.hpp:21]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? [item_updater_main.cpp:22] -> [item_updater_main.cpp:49]: (style) Local variable rc shadows outer symbol [serialize.cpp:19]: (performance) Function parameter 'versionId' should be passed by const reference. [ubi/watch.hpp:43]: (style) Struct 'CustomFd' has a constructor with 1 argument that is not explicit. [serialize.cpp:52]: (performance) Function parameter 'versionId' should be passed by const reference. [serialize.cpp:116]: (performance) Function parameter 'versionId' should be passed by const reference. [activation.cpp:115] -> [activation.cpp:152]: (style) Local variable mapperResponseMsg shadows outer symbol [version.hpp:114]: (performance) Variable 'eraseCallback' is assigned in constructor body. Consider performing initialization in initialization list. [image_verify.hpp:53]: (style) Struct 'CustomFd' has a constructor with 1 argument that is not explicit. [ubi/item_updater_ubi.cpp:192]: (performance) Function parameter 'versionId' should be passed by const reference. [ubi/item_updater_ubi.cpp:203]: (performance) Function parameter 'versionId' should be passed by const reference. Tested: Verify the code compiles and cppcheck does not report the above issues. Change-Id: I096392a2a7a283fe198c9c29185125e61295e10f Signed-off-by: Lei YU <mine260309@gmail.com>
* test: Add test for getPartsToClearLei YU2019-03-133-4/+157
| | | | | | | | | | Add the test for getPartsToClear(), and fix issues found by the unit test case with malformed input. Tested: Verify test builds and passes. Change-Id: I67c8bbd184e7e0c0f7f0f0fca678d1952a07cd66 Signed-off-by: Lei YU <mine260309@gmail.com>
* test: Add test for GetVersions()Lei YU2019-03-133-22/+60
| | | | | | | | | | Also split and rename the cases in utest.cpp into test_signature and test_version. Tested: Verify test is built and passed. Change-Id: Ibe59355936d9366be8e3f56760bff7384a28a28c Signed-off-by: Lei YU <mine260309@gmail.com>
* test: Add sources of static PNORLei YU2019-03-136-9/+36
| | | | | | | | | | | | | | | | Add sources in static dir to test. It generates a link error about duplcated GardReset::reset(). Then an issue is found that GardReset::~GardReset() is not virtual, this will casuse the destructor not calling its super class' dtor. To fix the above link error, add GardReset[Ubi|Static] to make ubi/static specific implementation in its own class. Tested: Verify the test build works fine. Change-Id: I41bd4d522e8b9c4053283c0cf4373807ef4f2d1c Signed-off-by: Lei YU <mine260309@gmail.com>
* test: Fix parallel build error on testsLei YU2019-03-131-8/+11
| | | | | | | | | | | | | | | | | | The test was using LDADD to link the objects, this results in below error when building with `make check -j` *** No rule to make target '../openpower_update_manager-activation.o', needed by 'utest'. Stop. Because the test depends on the objects to be pre-build, but there is no rule in test/Makefile.am to build t he objects. This commit changes it to add sources instead of linking to objects, so parallel build works fine. Tested: run `make check -j` without error. Change-Id: Ie7aaac49756fdd3b8941c1dec8f693ec66f659ab Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Do not crash on empty PNORLei YU2019-03-132-3/+9
| | | | | | | | | | | | | | | | When PNOR is empty, or corrupted and it fails to retrieve the version, the service throws an exception. This is not good because it should run on a corrupted or empty PNOR, which then could be used to re-program the PNOR. This commit fixes the issue, by not throwing on the above case. Tested: Verify the service does not crash on a corrupted VERSION partition, and could be used to do code update to fix the corruption. Change-Id: Ic6a413a81ad13894a9c7f039df71fff9b9d4b2ad Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Do not update PNOR when host is onLei YU2019-03-136-11/+22
| | | | | | | | | | | | | | Static layout only has 1 active and functional PNOR. When host is running, do not update PNOR. This is done by checking the return value of freeSpace(), and if it returns false, it means there is no space for PNOR because the host is running and erase() returns false. Tested: Verify the status becomes Failed when trying to activate a PNOR while host is running. Change-Id: Ie2986b0c6fd29557685f67eb77ccc29709e1669a Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Use pflash to get partitions to clearLei YU2019-03-131-18/+39
| | | | | | | | | | | Use pflash -i to get partitions that should be cleared during factory reset, instead of hard-coded ones. Tested: From log verify the partitions with REPROVISION flag are cleared during factory reset. Change-Id: I5f1681d0c5092e89a4a964ce41991b116252b9dd Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Implement factory resetLei YU2019-03-131-10/+74
| | | | | | | | Tested: Verify the partitions hard-coded are cleared during factory reset. Change-Id: I70febe5f8245a299d4e2a782414662dbf09e84cb Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Implement gard resetLei YU2019-03-131-6/+69
| | | | | | | | | Use pflash to clear GUARD partition. Tested: Verify GUARD partition is cleared on gard reset. Change-Id: I54f77a30d728dc80aa40dfd58a17152b936a6a6d Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Implement PNOR code updateLei YU2019-03-136-3/+164
| | | | | | | | | | Implement the PNOR code update by pflash tool in openpower-pnor-update service, and update the related associations. Tested: Verify PNOR code update succeeds. Change-Id: I53781d6420071200ac2ed6837f7a79bf5e1162c2 Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Add dummy activation_staticLei YU2019-03-134-4/+80
| | | | | | | | | | Add ActivationStatic inherits Activation, which will be used to do PNOR code update for statis layout. Tested: Verify code compiles. Change-Id: I5d90c84b63797e37fa309caeb9b23035f3c76f9f Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Read PNOR VERSION using pflashLei YU2019-03-133-1/+195
| | | | | | | | | | | Use pflash to read VERSION partition to get the PNOR version Add code to parse pflash's VERSION partition string. Tested: Verify that the version and extended version are retrieved correctly on Romulus and Palmetto. Change-Id: Ia053c1683a5a969be0773d251cb88c4c5c9b6c60 Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Add dummy item_updaterLei YU2019-03-134-1/+142
| | | | | | | | | This commit only adds the functions without implementation. Tested: Verify the code compiles with or without static layout. Change-Id: Id57640b367f9594d07e6780d446479eb7ac06007 Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Generate tar.gz for static layout pnorLei YU2019-03-132-20/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add --image_type option to specify the image type of generated PNOR in tarball. Support "squashfs" and "static" image types. Rename `generate-squashfs` to `generate-tar` to reflect that this util is to generate a tarball instead of squashfs. Example of usage: # Generate unsigned tarball for Witherspoon ./generate-tar -i squashfs witherspoon.pnor # Generate signed tarball with default key for Witherspoon ./generate-tar -i squashfs -s -- witherspoon.pnor # Generate unsigned tarball for Romulus ./generate-tar -i static romulus.pnor # Generate signed tarball with default key for Romulus ./generate-tar -i static -s -- romulus.pnor Tested: Verify the generated tarball contains correct files. Change-Id: Ibb66605663b28888bd643baf92d6e4bdbf60c206 Signed-off-by: Lei YU <mine260309@gmail.com>
* Refactor: Make createActivation() commonLei YU2019-03-085-110/+170
| | | | | | | | | | | | | | | | | | The function is almost the same for ubi and static layout, except a few differences that creates the ubi objects. Add below pure virtual functions for ubi to create ubi specific objects * createActivationObject() * createVersionObject() Then it is possible to move most of the code in createActivation() into the commone one. Tested: On the last commit of the patch series, run code update and factory reset on Witherspoon and all work fine. Change-Id: Ieb3e783bc5b251529a55909f9e9f644230b274e7 Signed-off-by: Lei YU <mine260309@gmail.com>
* Refactor: Move serialize to ubiLei YU2019-03-086-3/+2
| | | | | | | | | | Functions in serialize are specific to UBI, move it to ubi dir. Tested: On the last commit of the patch series, run code update and factory reset on Witherspoon and all work fine. Change-Id: I9176e638d9f3bfe0d424b57f8da4667a751cb5bd Signed-off-by: Lei YU <mine260309@gmail.com>
* Refactor: Split Activation into common and ubiLei YU2019-03-086-187/+266
| | | | | | | | | | | | | | | | | Activations has a few functions coupled with ubi, split them into ubi/activation_ubi * Keep common code in activation. * Make start/finishActivation() pure virtual. * Move ubi specific code into ubi. * Move ubiVolumnCreated into ubi. * Make validateSignature() not inline, otherwise it gets compile error. Tested: On the last commit of the patch series, run code update and factory reset on Witherspoon and all work fine. Change-Id: I7c8a0de6b0be4b1e9814ea75fd802a014b4aacfc Signed-off-by: Lei YU <mine260309@gmail.com>
* Refactor: Remove unused isLowestPriority()Lei YU2019-03-073-26/+0
| | | | | | | | | | The function isLowestPriority() is not used, remove it. Tested: On the last commit of the patch series, run code update and factory reset on Witherspoon and all work fine. Change-Id: Ib71ce5b9ad0319f8d7db3442d507c3fee7aba7fa Signed-off-by: Lei YU <mine260309@gmail.com>
* Refactor: Move determinId to ubiLei YU2019-03-074-11/+11
| | | | | | | | | | The function determinId is used only in ubi case, move it to ubi. Tested: On the last commit of the patch series, run code update and factory reset on Witherspoon and all work fine. Change-Id: I8974d25bf904a5202b913fc185790c5ecf8eca90 Signed-off-by: Lei YU <mine260309@gmail.com>
* Refactor: Move watch to ubiLei YU2019-03-076-4/+6
| | | | | | | | | | watch is ubi specific functions, move it to ubi dir. Tested: On the last commit of the patch series, run code update and factory reset on Witherspoon and all work fine. Change-Id: Ia7f6b6de845ddd40e2a32ad626d3b7af9074c7f3 Signed-off-by: Lei YU <mine260309@gmail.com>
* Refactor: Split item_updater to common and ubiLei YU2019-03-0711-624/+733
| | | | | | | | | | | | | | | | | | | | | | | The existing item_updater is highly coupled with ubifs. It will support static layout and ubi in future. So split the functions in to common ones and ubi specific ones, and move the ubi specific code in ubi dir. 1. Keep common functions and make them virtual for extension. createActiveAssociation() updateFunctionalAssociation() removeAssociation() erase() 2. Create ubi/item_updater_ubi and move other functions into it. 3. Change updateFunctionalAssociation() parameter for future use. To support static layout, a new item_updater_static will be written. Tested: On the last commit of the patch series, run code update and factory reset on Witherspoon and all work fine. Change-Id: I4cc55b31ee3f37c5b27168611305dee8ce02880a Signed-off-by: Lei YU <mine260309@gmail.com>
* Add repo specific items in .gitignoreLei YU2019-03-041-0/+5
| | | | | Change-Id: I1f565fbd98f75a8e19fa355ed0f1e41700601351 Signed-off-by: Lei YU <mine260309@gmail.com>
* build: pkg anti-pattern: use defaultsPatrick Venture2019-02-131-6/+3
| | | | | | | | Use the defaults in the pkg check where the default error message is sufficient to identify which package is missing. Change-Id: Id4ae96c559212f60721bd9a3af6fd3d7742e61ee Signed-off-by: Patrick Venture <venture@google.com>
* Invoke Delete method to correct serviceLei YU2019-01-291-5/+22
| | | | | | | | | | | | | | | | | | | | When PNOR code update is finished, it needs to invoke Delete interface to xyz.openbmc_project.Software.Version service to delete the temporary files in /tmp/images. The code was using the first service from mapper call, and the first service may be org.open_power.Software.Host.Updater, which is itself, and this method call results in ELOOP error. Change the code to pick the correct service to invoke Delete method. Resovles: openbmc/openbmc#3311 Tested: Verify the temp files in /tmp/images/<versionID> is deleted after PNOR code update, and no ELOOP error occurs. Change-Id: I855db171a05db66a5e4540d662031c3d219d4a9e Signed-off-by: Lei YU <mine260309@gmail.com>
* Allow delete functional PNOR if only 1 PNOR is allowedLei YU2019-01-241-2/+4
| | | | | | | | | | | | | | | | | When a system only supports 1 PNOR (e.g. 64MiB chip), it shall define ACTIVE_PNOR_MAX_ALLOWED to 1. In this case, the PNOR code update shall delete the exising functional PNOR to free the space for the new PNOR, otherwise there will be not enough space for the new PNOR, and the code update will fail. So change the logic in freeSpace() to allow delete functional PNOR if ACTIVE_PNOR_MAX_ALLOWED is defined to 1. Tested: Enable openpower-ubi on Romulus and verify PNOR code update succeeds. Change-Id: Ib46c8a542d6baf02b60c3453686d7fe831468e6e Signed-off-by: Lei YU <mine260309@gmail.com>
* std::variant: Fix forgotten conversionWilliam A. Kennington III2018-11-271-1/+1
| | | | | Change-Id: Ie802ac340ebc0fde965bd84e18d2af9391136626 Signed-off-by: William A. Kennington III <wak@google.com>
OpenPOWER on IntegriCloud