1666 Commits

Author SHA1 Message Date
openharmony_ci f418e5f4dc !87 merge master into master
- Description: [feature] libnl build optimization: libnl 3.11.0 OHOS adaptation

Created-by: dong_jinguang
Commit-by: Jinguang Dong
Merged-by: openharmony_ci
Description: 本仓库采用 **代码环境提前准备** 的方式集成 libnl:上游源码已经过
解压、`configure`、flex/bison 语法文件预生成、以及应用 OpenHarmony 适配 patch,
结果直接入库到 `libnl/` 目录。因此日常构建只需 `gn`/`ninja` 直接
编译 `BUILD.gn`,**不依赖** autotools / configure / flex / bison 等主机工具,
也不在 `gn gen` 阶段执行任何脚本。

> 历史背景:旧方案在每次 `gn gen` 时通过 `BUILD.gn` 的 `exec_script("install.sh")`
> 重复解压 tarball 并运行 `autogen.sh` + `configure`,缓慢且强依赖主机环境。
> 现已由 `prepare.sh`(仅升级时手动运行)替代。

## 仓库内容约定

- `libnl/`:已准备好的源码树(含 `include/config.h`、`include/netlink/version.h`
  以及预生成的语法文件 `lib/route/{pktloc_grammar,pktloc_syntax}.{c,h}`、
  `lib/route/cls/{ematch_grammar,ematch_syntax}.{c,h}`)。直接被 `BUILD.gn` 编译。
- `prepare.sh`:分三阶段的环境准备脚本(升级时手动运行,构建期不调用)。
- `solve-oh-compile-problem3_11_0.patch`:当前生效的 OpenHarmony 适配 patch。
- `archive/patches/`:历史各版本(解决冲突后的)适配 patch 归档,供后续升级参考复用。
- `archive/libnl-<ver>.sha256sums`:**整个上游 tar 包**的 SHA256 校验和(标准
  `sha256sum` 单行格式、记录规范包名),随上游基线 commit 入库,供整包可信校验。
- `COPYING`:LGPL v2.1 许可文件。
- 上游 tarball **不入库**;上游版本/地址记录在 `README.OpenSource`(其元数据结构
  保持不变,**不**在其中记录 SHA256)。源码可信校验改由上述 `*.sha256sums`
  整包校验和 + git「上游基线 commit」提供。

## 升级流程:三个独立 commit

为清晰区分 **上游原始代码 / 构建环境产物 / OHOS 适配** 三类变更,每次升级按
`upstream → build → patch` 三个阶段进行,**每个阶段各提交一次独立 commit**。
这样 `git diff` 在三个 commit 之间分别只显示一类变更,溯源清晰、便于审计与回溯。

以从 `3.11.0` 升级到新版本 `<new_ver>` 为例:

### 0. 准备:更新脚本变量与版本元信息

- 编辑 `prepare.sh` 顶部变量:`LIBNL_VERSION`、`UPSTREAM_URL`、`EXTRACTED_DIR`
  (若上游归档顶层目录名变化)。
- 更新 `README.OpenSource` 的 `Version Number` 与 `Upstream URL`
  (**不**新增 SHA256 字段,保持其元数据结构不变)。
- 更新 `bundle.json` 的 `version`(如适用)。

### 1. commit 1 —— 纯上游源码基线(可信溯源)

```sh
# 方式一:使用本地已下载 tarball;方式二:省略路径,从 Upstream URL 下载
./prepare.sh upstream /path/to/libnl-<new_ver>.tar.gz
```

该阶段会清空 `libnl/` 并解压**未经任何修改**的上游源码树(不含 config.h、
不含语法生成物、不含 OHOS 改动)。脚本会:

- 对**整个上游 tar 包**计算 SHA256,写入 `archive/libnl-<new_ver>.sha256sums`
  (标准 `sha256sum` 单行格式、记录规范包名),随本 commit 入库。

- 该整包校验和可用于:

  ```sh
  # 将上游 tar 包按规范名(如 libnl3_11_0.tar.gz)放到 archive/ 下后校验
  ( cd archive && sha256sum -c libnl-<new_ver>.sha256sums )
  ```

  或直接把该值与**上游社区发布的 sha256sum 文件**比对,确认 tar 包可信。

  > 说明:校验对象是**整包 tar.gz**,与上游社区通常发布的校验形式一致;因此
  > 无需逐文件计算,也不受入库后 configure/patch 改动的影响。

- 提交:

  ```sh
  git add libnl/ archive/libnl-<new_ver>.sha256sums README.OpenSource
  git commit -m "Import libnl <new_ver> upstream"
  ```

### 2. commit 2 —— 构建环境产物(configure + 语法文件)

```sh
./prepare.sh build
```

该阶段运行 `autogen.sh` + `configure`(产出 `config.h`/`version.h`)、flex/bison
预生成 8 个语法文件、清理 autotools 中间产物,并自动调整 `libnl/.gitignore`
使上述生成物可入库。

- 本 commit 的 diff 仅为「新增 config.h + version.h + 8 个语法文件 + .gitignore 调整」,
  不含任何 OHOS 源码改动。

- 提交:

  ```sh
  git add libnl/
  git commit -m "libnl <new_ver> build env (configure + grammars)"
  ```

### 3. commit 3 —— OHOS 适配 patch

```sh
./prepare.sh patch
```

该阶段应用 `solve-oh-compile-problem3_11_0.patch`,并把(解决冲突后的)patch
归档到 `archive/patches/solve-oh-compile-problem-<new_ver>.patch`。

- **若 patch 冲突**:脚本会报错中止。请手动解决冲突、更新根目录的
  `solve-oh-compile-problem*.patch`(或依据上游变更重做),再重新运行
  `./prepare.sh patch`。当前 patch 涉及的文件(升级后重点检查是否仍兼容):

  - `lib/utils.c`、`lib/route/mdb.c`、`lib/route/neigh.c`、`lib/route/link/bridge.c`
  - `include/base/nl-base-utils.h`
  - `include/config.h`(交叉编译值修正:`HAVE_STRERROR_L`、
    `HAVE_DECL_GETPROTOBYNAME_R`、`HAVE_DECL_GETPROTOBYNUMBER_R` 置 0)
  - `include/nl-priv-dynamic-core/nl-core.h`、`src/lib/utils.c`

- 本 commit 的 diff 仅为「OHOS 对上游源码的适配改动 + 归档 patch」。

- 提交:

  ```sh
  git add libnl/ archive/patches/
  git commit -m "libnl <new_ver> OHOS adaptation patch"
  ```

> 提示:`upstream`/`build`/`patch` 操作的文件集互不相交,`build` 与 `patch` 顺序
> 理论上可换;但务必保持 `configure`(在 build 阶段)早于 `patch`,因为 patch 要
> 修正 configure 生成的 `config.h` 交叉编译值。

### 4. 同步 `BUILD.gn` 的 `sources` 列表

若上游新增/删除/重命名了 `lib/`、`src/lib/` 下的 `.c` 文件,需相应增删 `BUILD.gn`
中 `sources` 条目。语法文件(`pktloc_*`、`ematch_*`)已作为预生成源直接列入
`sources`,无需 `action()`。此改动可并入 commit 3 或单独提交。

### 5. 构建验证

```sh
./build.sh --product-name <product> --build-target libnl_share
```

验证要点:

- `gn gen` 阶段不再执行任何脚本(无 `install.sh` / autotools 调用)。
- 即使主机 **未安装** flex / bison / autoconf,也能成功编译出 `libnl_share` 动态库。

## 一次性快速搭建(非升级场景)

若只是想在本地一次性重建已准备好的源码树(不关心三 commit 拆分):

```sh
./prepare.sh all /path/to/libnl-3.11.0.tar.gz
```

## 设计要点(为何这样做)

- `configure` 产物中,GN 构建实际只需要 `include/config.h` 与
  `include/netlink/version.h` 两个文件;其余 Makefile / libtool / `.pc` 等
  对 GN 构建无用,故 `build` 阶段在生成后即清理,保持源码树精简、
  避免泄漏主机路径。
- `config.h` 由 `configure` 在主机生成后,再由 patch 修正为交叉编译正确值,
  因此 **顺序必须是先 `configure` 后 `patch`**。
- 三阶段对应三 commit,使「上游代码」「构建产物」「OHOS 适配」在版本历史中
  天然解耦:审计上游变更只看 commit 1,审计 OHOS 改动只看 commit 3。



See merge request: openharmony/third_party_libnl!87
2026-07-03 12:15:11 +08:00
Jinguang Dong cd8e1f9b28 - Description: [feature] libnl build optimization: libnl 3.11.0 OHOS adaptation
patch
- Bug: #43
- Test: It could be normally compile and testcase passed

Signed-off-by: Jinguang Dong <dongjinguang@huawei.com>
2026-07-02 22:00:08 +08:00
Jinguang Dong 6c5b5c73f4 - Description: [feature] libnl build optimization: libnl 3.11.0 build env
(configure + grammars)
- Bug: #43
- Test: check the configure include file and grammars file exist

Signed-off-by: Jinguang Dong <dongjinguang@huawei.com>
2026-07-02 21:21:08 +08:00
Jinguang Dong dae51a5a05 - Description:[feature] libnl build optimization: import libnl 3_11_0 upstream
- Bug: #43
- Test: calculate the SHA256 checksum for the libnl upstream tarball and compare
it with the upstream SHA256 value

Signed-off-by: Jinguang Dong <dongjinguang@huawei.com>
2026-07-02 15:17:27 +08:00
ohci1 639c2672d7 !83 merge master into master
update: 更新文件 README.OpenSource

Created-by: li-ke1067
Commit-by: li-ke1067
Merged-by: ohci1
Description: ### 一、内容说明(相关的Issue)



### 二、建议测试周期和提测地址  
  建议测试完成时间:xxxx.xx.xx  
  投产上线时间:xxxx.xx.xx  
  提测地址:CI环境/压测环境  
  测试账号:  

### 三、变更内容
  * 3.1 关联PR列表

  * 3.2 数据库和部署说明  
    1. 常规更新 
    2. 重启unicorn
    3. 重启sidekiq
    4. 迁移任务:是否有迁移任务,没有写 "无"
    5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无"

  * 3.4 其他技术优化内容(做了什么,变更了什么)
    - 重构了 xxxx 代码
    - xxxx 算法优化


  * 3.5 废弃通知(什么字段、方法弃用?)



  * 3.6  后向不兼容变更(是否有无法向后兼容的变更?)


  
### 四、研发自测点(自测哪些?冒烟用例全部自测?)
  自测测试结论:


### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方)
  检查点:

| 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 |
|------|------------|----------|---------------|
| xxx  | 否          | 需要       | 不需要           |
|      |            |          |               |

  接口测试:

  性能测试:

  并发测试:

  其他:



See merge request: openharmony/third_party_libnl!83
OpenHarmony-v6.1-Release OpenHarmony-v7.0-Beta1
2026-01-13 14:16:27 +08:00
li-ke1067 4c7232cde3 update: 更新文件 README.OpenSource
Signed-off-by: li-ke1067 <like115@huawei.com>
2026-01-13 14:13:47 +08:00
ohci1 2ab35f41a3 !81 merge master into master
增加libnl锁机制

Created-by: li-ke1067
Commit-by: li-ke1067
Merged-by: ohci1
Description: ### 一、内容说明(相关的Issue)
https://gitcode.com/openharmony/third_party_libnl/issues/38


### 二、建议测试周期和提测地址  
  建议测试完成时间:xxxx.xx.xx  
  投产上线时间:xxxx.xx.xx  
  提测地址:CI环境/压测环境  
  测试账号:  

### 三、变更内容
  * 3.1 关联PR列表

  * 3.2 数据库和部署说明  
    1. 常规更新 
    2. 重启unicorn
    3. 重启sidekiq
    4. 迁移任务:是否有迁移任务,没有写 "无"
    5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无"

  * 3.4 其他技术优化内容(做了什么,变更了什么)
    - 重构了 xxxx 代码
    - xxxx 算法优化


  * 3.5 废弃通知(什么字段、方法弃用?)



  * 3.6  后向不兼容变更(是否有无法向后兼容的变更?)


  
### 四、研发自测点(自测哪些?冒烟用例全部自测?)
  自测测试结论:


### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方)
  检查点:

| 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 |
|------|------------|----------|---------------|
| xxx  | 否          | 需要       | 不需要           |
|      |            |          |               |

  接口测试:

  性能测试:

  并发测试:

  其他:



See merge request: openharmony/third_party_libnl!81
2025-11-25 14:36:26 +08:00
li-ke1067 41964b076c update
Signed-off-by: li-ke1067 <like115@huawei.com>
2025-11-10 15:52:23 +08:00
li-ke1067 cc34fd0836 update: 更新文件 install.sh
增加独占锁,防止解压完成前调用

Signed-off-by: li-ke1067 <like115@huawei.com>
2025-11-07 15:18:21 +08:00
openharmony_ci 4f9814b113 !79 merge refs/merge-requests/79/head into master
【轻量级 PR】修复非root用户编译报错的问题

Created-by: hlzhangaj
Commit-by: hlzhangaj
Merged-by: openharmony_ci
Description: https://gitcode.com/openharmony/third_party_libnl/issues/36

See merge request: openharmony/third_party_libnl!79
2025-10-28 10:35:36 +08:00
hlzhangaj 30fc07de1f test
Signed-off-by: hlzhangaj <zhanghanlin16@h-partners.com>
2025-10-13 21:26:19 +08:00
openharmony_ci ae1de3a7dd !76 libnl3_11_0
Merge pull request !76 from Bruin06/master
2025-09-03 03:07:00 +00:00
Bruin06 ef5fd49261 libnl3_11_0
Signed-off-by: Bruin06 <419738327@qq.com>
Signed-off-by: Bruin06 <15325335+bruin06@user.noreply.gitee.com>
2025-09-03 10:00:20 +08:00
openharmony_ci 9e4f1dd493 !74 高风险进程所需so开启PAC
Merge pull request !74 from zhangqin88/master
OpenHarmony-v6.0-Beta1 OpenHarmony-v5.1.0-Release
2024-09-12 15:38:03 +00:00
zhangqin88 1ef7cfa425 update BUILD.gn.
Signed-off-by: zhangqin88 <zhangqin88@huawei.com>
2024-09-11 01:39:05 +00:00
openharmony_ci 0c39ce4d0e !73 新增bugfix patch
Merge pull request !73 from zhangqin88/master
2024-08-13 03:52:45 +00:00
zhangqin88 4a15b9c368 add libnl bug fix
Signed-off-by: zhangqin88 <zhangqin88@huawei.com>
2024-08-08 15:33:11 +08:00
openharmony_ci 2fec1729ca !71 修改version number
Merge pull request !71 from zhangqin88/master
OpenHarmony-v5.0.2-Release OpenHarmony-v5.0.1-Release OpenHarmony-v5.0.0-Release
2024-06-15 03:46:46 +00:00
zhangqin88 2289db4bf0 modify version number
Signed-off-by: zhangqin88 <zhangqin88@huawei.com>
2024-06-14 14:41:12 +08:00
openharmony_ci 480ee0cf51 !69 升级libnl
Merge pull request !69 from zhangqin88/zzqzqzq
2024-06-06 03:55:10 +00:00
openharmony_ci 503723c567 !70 wap部件独立编译整改
Merge pull request !70 from HW-cjd/master
2024-06-05 07:51:43 +00:00
HW-cjd 94d8c9ebff 独立部件编译整改
Signed-off-by: HW-cjd <chengjiadong@huawei.com>
2024-06-03 21:31:53 +08:00
zhangqin88 81617fcb2f modify libnl to sp3
Signed-off-by: zhangqin88 <zhangqin88@huawei.com>
2024-06-03 19:31:47 +08:00
openharmony_ci b8f7d3ea67 !67 libnl 升级3.7.0
Merge pull request !67 from 吴俊/master
OpenHarmony-v4.1.4-Release OpenHarmony-v4.1.3-Release OpenHarmony-v4.1.2-Release OpenHarmony-v5.0-Beta1 OpenHarmony-v4.1.1-Release OpenHarmony-v4.1-Release
2024-01-16 02:52:22 +00:00
wujun 303a584c3f add patch solve vrf.h build fail
Signed-off-by: wujun <2019125625@qq.com>
2024-01-15 17:22:32 +08:00
wujun 6f9d43c405 change readme file
Signed-off-by: wujun <2019125625@qq.com>
2024-01-15 16:34:46 +08:00
wujun 9b0e504193 change patch file
Signed-off-by: wujun <2019125625@qq.com>
2024-01-15 16:23:07 +08:00
wujun 7fbed89874 upgrade libnl to 3.7.0
Signed-off-by: wujun <2019125625@qq.com>
2024-01-15 15:13:03 +08:00
openharmony_ci 3ad11f520b !66 add chipsetsdk tag for nl_share
Merge pull request !66 from Aurora/zw_1103
weekly_20240115-v master-v OpenHarmony-v4.1-Beta1
2023-11-16 06:45:29 +00:00
liuxiyao 4add87e139 add chipsetsdk tag for nl_share
Signed-off-by: liuxiyao <liuxiyao223@huawei.com>
2023-11-04 15:38:01 +08:00
openharmony_ci eec74cb503 !61 fix:modify libnl BUILD.gn
Merge pull request !61 from xingchu/master
OpenHarmony-v4.0.4-Release OpenHarmony-v4.0.3-Release OpenHarmony-v4.0.2-Release OpenHarmony-v4.0.1-Release OpenHarmony-v4.0-Release OpenHarmony-v4.0-Beta2
2023-06-28 15:47:29 +00:00
weiqian 92ae4a3779 fix:modify libnl BUILD.gn
Signed-off-by: weiqian <weiqian22@huawei.com>
2023-06-26 14:50:23 +08:00
openharmony_ci 8419b56567 !60 fix:modify component name
Merge pull request !60 from xingchu/master
2023-06-13 11:30:49 +00:00
weiqian c07c586c1a fix:modify component name
Signed-off-by: weiqian <weiqian22@huawei.com>
2023-06-08 20:29:01 +08:00
openharmony_ci 4fe6815cd0 !58 fix:sove the problem of license compatibility
Merge pull request !58 from zyshg/master
2023-05-30 09:33:33 +00:00
zhangyu 7bddb53e7c fix:modify OAT.xml
Signed-off-by: zhangyu <zhangyu602@huawei.com>
2023-05-30 15:36:05 +08:00
openharmony_ci 32470edcbb !56 fix: add license file for libnl
Merge pull request !56 from xingchu/master
2023-05-25 09:29:29 +00:00
weiqian 85bf3f6d62 fix:add license file for libnl
Signed-off-by: weiqian <weiqian22@huawei.com>
2023-05-24 20:38:27 +08:00
openharmony_ci 790a1540d0 !53 feat: add bundle.json
Merge pull request !53 from xingchu/master
2023-05-24 04:09:10 +00:00
xingchu 330261af3f update bundle.json.
Signed-off-by: xingchu <weiqian22@huawei.com>
2023-05-19 09:41:49 +00:00
xingchu 031d724d3b update bundle.json.
Signed-off-by: xingchu <weiqian22@huawei.com>
2023-05-19 08:03:30 +00:00
xingchu c175fb6f40 update bundle.json.
Signed-off-by: xingchu <weiqian22@huawei.com>
2023-05-19 06:55:46 +00:00
xingchu 50289ee4d9 update bundle.json.
Signed-off-by: xingchu <weiqian22@huawei.com>
2023-05-19 06:35:05 +00:00
weiqian bfeb86dfdb feat:add libnl bundle.json
Signed-off-by: weiqian <weiqian22@huawei.com>
2023-05-19 14:22:23 +08:00
openharmony_ci 415d492e13 !52 feat: add README.OpenSource
Merge pull request !52 from xingchu/master
2023-05-17 12:36:59 +00:00
weiqian 1605a4ee2d feat:add README.OpenSource
Signed-off-by: weiqian <weiqian22@huawei.com>
2023-05-16 21:13:44 +08:00
openharmony_ci 42f483045e !51 fix: solve the problem of pollution work directory while compiling
Merge pull request !51 from 黄一平/master
2023-05-10 02:28:22 +00:00
RichardHuang9527 86c3e703dd fix: solve the problem of pollution work directory while compiling
Signed-off-by: RichardHuang9527 <huangyiping8@huawei.com>
2023-05-08 22:45:31 -07:00
openharmony_ci 0942c6c830 !50 fix: modify the patch file which solve the compile problem on OpenHarmony
Merge pull request !50 from 黄一平/master
2023-04-24 08:50:37 +00:00
RichardHuang9527 afeeb29ba7 fix: modify the patch file which solve the problem on OpenHarmony
Signed-off-by: RichardHuang9527 <huangyiping8@huawei.com>
2023-04-24 00:45:35 -07:00