Commit Graph

12 Commits

Author SHA1 Message Date
dflynn-Nokia
df12ac5abd
[build]: marvell-armhf bullseye fixes (#9243)
This commit fixes/avoids the following errors encountered during the
marvell-armhf build for bullseye

- Fix Marvell prestera DMA driver build failure due to kallsyms_lookup_name()
  no longer being exported by the updated bullseye kernel. This is a temporary
  fix that will be replaced by a future version of the DMA driver.

- Update qemu-user-static version to align with the new glibc version included
  in bullseye

- Skip systemd-sonic-generator unit tests to avoid test failures. Root cause is
  still TBD

#### Why I did it
Fix the following build errors observed when building marvell-armhf for bullseye
1. Marvell Prestera DMA driver uses kernel API no longer exported
ERROR: modpost: "kallsyms_lookup_name" [/sonic/platform/marvell-armhf/prestera/mrvl-prestera/cpssEnabler/linuxNoKernelModule/drivers//mvDmaDrv.ko] undefined!

2. Old qemu-user-static version does not support semop() leading to following build failure
semop(1): encountered an error: Function not implemented

3. systemd-sonic-generator unit test failure
ssg-test.cc:217: Failure
Expected equality of these values:
  find_string_in_file(str_t, target, num_asics)
    Which is: false
  expected_result
    Which is: true
Error validating Before=single_inst.service in test.service
[  FAILED  ] SsgMainTest.ssg_main_40_npu (20 ms)
[----------] 4 tests from SsgMainTest (36 ms total)

[----------] Global test environment tear-down
[==========] 10 tests from 3 test suites ran. (54 ms total)
[  PASSED  ] 7 tests.
[  FAILED  ] 3 tests, listed below:
[  FAILED  ] SsgMainTest.ssg_main_single_npu
[  FAILED  ] SsgMainTest.ssg_main_10_npu
[  FAILED  ] SsgMainTest.ssg_main_40_npu

 3 FAILED TESTS
2021-11-13 10:48:58 -08:00
Raphael Tryster
2bb9f0b314
[build]: Fix changelong for systemd-sonic-generator (#8317)
Malformed changelog file causes build to fail when SONIC_PROFILING_ON = y.

Signed-off-by: Raphael Tryster <raphaelt@nvidia.com>
2021-08-04 10:00:43 -07:00
anamehra
3b30127913
[multi-asic] Fixed systemd-sonic-generator for multi-asic (#7954)
Why I did it

systemd-sonic-generator limits multi-asic unit file instances to 10 (single digit instance number 0 - 10). This limitation needs to be removed to handle more than 10 asics.
MAX_NUM_TARGETS and MAX_NUM_INSTALL_LINES limits to 15 which is not sufficient for systems with more than 15 asics.
Inside get_unit_files(), strcmp produce incorrect results due to non null terminated string being compared.

 Added build UT support for systemd-sonic-generator
2021-07-07 17:14:21 -07:00
Guohan Lu
c7bc0f0fa2 Revert "[multi-asic] Fixed systemd-sonic-generator for multi-asic (#7633)"
This reverts commit 4f8dec9a6f.
2021-06-09 08:20:23 -07:00
anamehra
4f8dec9a6f
[multi-asic] Fixed systemd-sonic-generator for multi-asic (#7633)
* Fixed systemd-sonic-generator for multi-asic

    1. In function insert_instance_number instance_string was malloced for 2 char
       size which was limiting the instance number value in instance_name to 1 digit.
       Fixed insert_instance_number to use asprintf to generate instancd_name for
       any number of instances. Added _GNU_SOURCE to CFLAGS for asprintf.

    2. Fixed get_unit_files() to use calloc instead of malloc. Uninitialized memory
       was causing incorrect string mismatch error while comparing unit file name
       string.

    3. Increased MAX_NUM_TARGETS and MAX_NUM_INSTALL_LINES values to 48 to handle more
       asic instances.

    4. Added build UT support for systemd-sonic-generator:
        a. Refactor systemd-sonic-generator.c to be used with UT infra.
        b. Added UT infra to run build UT for systemd-sonic-generator
        c. Added functional level and program level UT class and test cases.

* Resolved review comments.

    1. Explicitly setting global pointers to NULL in definitions.
    2. Added a space before ": public" in class definitions to align style
       with SONiC C++ files.

* Merged strtok_r statements in single command.

Signed-off-by: Anand Mehra <anamehra@cisco.com>
2021-05-28 13:20:11 -07:00
lguohan
ab2ae41212
[build]: fix dpkg admindir corruption issue in parallel build (#6408)
Fix #119

when parallel build is enable, multiple dpkg-buildpackage
instances are running at the same time. /var/lib/dpkg is shared
by all instances and the /var/lib/dpkg/updates could be corrupted
and cause the build failure.

the fix is to use overlay fs to mount separate /var/lib/dpkg
for each dpkg-buildpackage instance so that they are not affecting
each other.

Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-12 06:03:12 -08:00
SuvarnaMeenakshi
3d7b6faf91
[systemd-generator]: Remove creation of NUM_ASIC environment (#5122)
NUM_ASIC environment variable was added so that it could be used by other utilities.
This is not being used by any other utility or docker, hence removing the addition of NUM_ASIC environment variable.
Also, the environment variable was added by adding the variable value to /etc/environ file.
Upon each reboot, this file gets updated with the NUM_ASIC value but the existing value was not removed.
This causes multiple lines getting appended in /etc/environ file upon each reboot.

Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
2020-08-11 13:58:20 -07:00
SuvarnaMeenakshi
ab2177b4a9
[systemd-generator]: Fix dependency update for multi-asic platform (#4820)
* [systemd-generator]: Fix the code to make sure that dependencies
of host services are generated correctly for multi-asic platforms.
Add code to make sure that systemd timer files are also modified
to add the correct service dependency for multi-asic platforms.

Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>

* [systemd-generator]: Minor fix, remove debug code and
remove unused variable.
2020-06-29 09:39:23 -07:00
Joe LeVeque
c6365e7abe
Reorganize .gitignore files (#4707)
- Add .gitignore files in each subdirectory of src/, so as to reduce the size of the .gitignore file in the project root, and also make it easier to maintain (i.e., if a directory in src/ is removed, there will not be outdated entries in the root .gitignore file.

- Also add missing .gitignore entries and remove outdated entries and duplicates.
2020-06-09 21:04:55 -07:00
Joe LeVeque
1e369b0998
[systemd] Relocate all SONiC unit files to /usr/lib/systemd/system (#4673)
This will allow us to disable services and have it persist across reboots by using the `systemctl mask` operation
2020-05-30 13:46:44 -07:00
SuvarnaMeenakshi
c9483796dc [baseimage]: support building multi-asic component (#3856)
- move single instance services into their own folder
- generate Systemd templates for any multi-instance service files in slave.mk
- detect single or multi-instance platform in systemd-sonic-generator based on asic.conf platform specific file.
- update container hostname after creation instead of during creation (docker_image_ctl)
- run Docker containers in a network namespace if specified
- add a service to create a simulated multi-ASIC topology on the virtual switch platform

Signed-off-by: Lawrence Lee <t-lale@microsoft.com>
Signed-off-by: Suvarna Meenakshi <Suvarna.Meenaksh@microsoft.com>
2020-01-26 13:56:42 -08:00
Lawrence Lee
7271fe598f [build]: Move Systemd service start to systemd generator (#3172)
- What I did

 Move the enabling of Systemd services from sonic_debian_extension to a new systemd generator

- How I did it

  Create a new systemd generator to manually create symlinks to enable systemd services
  Add rules/Makefile to build generator
  Add services to be enabled to /etc/sonic/generated_services.conf to be read by the generator at boot time

Signed-off-by: Lawrence Lee <t-lale@microsoft.com>
2019-07-29 15:52:15 -07:00