From 3286b270694e03f5eddb4e61078a34d7f8ece682 Mon Sep 17 00:00:00 2001 From: Debin Date: Tue, 3 Mar 2026 16:30:09 +0800 Subject: [PATCH] add kylin header --- api/kapi/src/tee/arch/mod.rs | 4 ++ .../src/tee/arch/x86_64/hygon_csv_bindings.rs | 4 ++ api/kapi/src/tee/arch/x86_64/mod.rs | 4 ++ core/kernel_elf_parser/src/auxv.rs | 4 ++ core/kernel_elf_parser/src/info.rs | 4 ++ core/kernel_elf_parser/src/lib.rs | 4 ++ core/kernel_elf_parser/src/user_stack.rs | 4 ++ core/kernel_elf_parser/tests/test_dynamic.rs | 4 ++ core/kernel_elf_parser/tests/test_static.rs | 4 ++ core/kpoll/src/tests.rs | 4 ++ core/ksync/src/tests.rs | 4 ++ core/ktypes/src/lazy.rs | 4 ++ core/slab_allocator/src/lib.rs | 4 ++ core/slab_allocator/src/slab.rs | 4 ++ core/slab_allocator/src/tests.rs | 4 ++ drivers/aarch64-pmuv3/src/lib.rs | 4 ++ drivers/aarch64-pmuv3/src/pmuv3.rs | 4 ++ drivers/aarch64-pmuv3/src/regs/macros.rs | 4 ++ drivers/aarch64-pmuv3/src/regs/mod.rs | 4 ++ .../aarch64-pmuv3/src/regs/pmccfiltr_el0.rs | 4 ++ drivers/aarch64-pmuv3/src/regs/pmcr_el0.rs | 4 ++ .../aarch64-pmuv3/src/regs/pmuserenr_el0.rs | 4 ++ drivers/aarch64-pmuv3/src/regs/regs.rs | 4 ++ drivers/display/src/tests.rs | 4 ++ drivers/virtio/src/mock_virtio.rs | 4 ++ fs/fatfs/src/boot_sector.rs | 4 ++ fs/fatfs/src/dir.rs | 4 ++ fs/fatfs/src/dir_entry.rs | 4 ++ fs/fatfs/src/error.rs | 4 ++ fs/fatfs/src/file.rs | 4 ++ fs/fatfs/src/fs.rs | 4 ++ fs/fatfs/src/io.rs | 4 ++ fs/fatfs/src/lib.rs | 4 ++ fs/fatfs/src/log_macros.rs | 4 ++ fs/fatfs/src/table.rs | 4 ++ fs/fatfs/src/time.rs | 4 ++ fs/fs-ng-vfs/src/test_path.rs | 4 ++ fs/fs-ng-vfs/src/test_types.rs | 4 ++ fs/kfs/src/fs/ext4/lwext4/fs.rs | 4 ++ fs/kfs/src/fs/ext4/lwext4/inode.rs | 4 ++ fs/kfs/src/fs/ext4/lwext4/mod.rs | 4 ++ fs/kfs/src/fs/ext4/lwext4/util.rs | 4 ++ fs/kfs/src/fs/ext4/mod.rs | 4 ++ fs/kfs/src/test_path_resolver.rs | 4 ++ fs/kfs/src/test_working_context.rs | 4 ++ fs/rsext4/src/api.rs | 4 ++ fs/rsext4/src/bitmap.rs | 4 ++ fs/rsext4/src/bitmap_cache.rs | 4 ++ fs/rsext4/src/blockdev.rs | 4 ++ fs/rsext4/src/blockgroup_description.rs | 4 ++ fs/rsext4/src/bmalloc.rs | 4 ++ fs/rsext4/src/config.rs | 4 ++ fs/rsext4/src/datablock_cache.rs | 4 ++ fs/rsext4/src/dir.rs | 4 ++ fs/rsext4/src/disknode.rs | 4 ++ fs/rsext4/src/endian.rs | 4 ++ fs/rsext4/src/entries.rs | 4 ++ fs/rsext4/src/error.rs | 4 ++ fs/rsext4/src/ext4.rs | 4 ++ fs/rsext4/src/extents_tree.rs | 4 ++ fs/rsext4/src/file.rs | 4 ++ fs/rsext4/src/hashtree.rs | 4 ++ fs/rsext4/src/inodetable_cache.rs | 4 ++ fs/rsext4/src/jbd2/jbd2.rs | 4 ++ fs/rsext4/src/jbd2/jbdstruct.rs | 4 ++ fs/rsext4/src/jbd2/mod.rs | 4 ++ fs/rsext4/src/lib.rs | 4 ++ fs/rsext4/src/loopfile.rs | 4 ++ fs/rsext4/src/superblock.rs | 4 ++ fs/rsext4/src/tool.rs | 4 ++ io/kio/src/test_cursor.rs | 4 ++ io/kio/src/test_iobuf.rs | 4 ++ io/kio/src/test_seek.rs | 4 ++ net/knet/src/test_options.rs | 4 ++ net/knet/src/test_state.rs | 4 ++ process/kprocess/src/tests.rs | 4 ++ process/ksignal/src/tests.rs | 4 ++ process/osvm/src/tests.rs | 4 ++ scripts/check_header.py | 61 +++++++++++++++++++ tee_apps/sh/src/main.rs | 4 ++ tee_apps/tee_app1/src/main.rs | 4 ++ tee_apps/tee_app2/src/main.rs | 4 ++ util/kbuild_config/build.rs | 4 ++ util/kbuild_config/src/lib.rs | 4 ++ xtask/crate_rootfs/src/args.rs | 4 ++ xtask/crate_rootfs/src/blockdev.rs | 4 ++ xtask/crate_rootfs/src/main.rs | 4 ++ xtask/crate_rootfs/src/rootfs.rs | 4 ++ xtask/crate_rootfs/src/util.rs | 4 ++ xtask/src/main.rs | 4 ++ xtask/xconfig/benches/parser_bench.rs | 4 ++ xtask/xconfig/src/cli/commands.rs | 4 ++ xtask/xconfig/src/cli/defconfig.rs | 4 ++ xtask/xconfig/src/cli/gen_const.rs | 4 ++ xtask/xconfig/src/cli/menuconfig.rs | 4 ++ xtask/xconfig/src/cli/mod.rs | 4 ++ xtask/xconfig/src/cli/oldconfig.rs | 4 ++ xtask/xconfig/src/cli/saveconfig.rs | 4 ++ xtask/xconfig/src/config/generator.rs | 4 ++ xtask/xconfig/src/config/mod.rs | 4 ++ xtask/xconfig/src/config/oldconfig.rs | 4 ++ xtask/xconfig/src/config/reader.rs | 4 ++ xtask/xconfig/src/config/writer.rs | 4 ++ xtask/xconfig/src/error.rs | 4 ++ xtask/xconfig/src/kconfig/ast.rs | 4 ++ xtask/xconfig/src/kconfig/expr.rs | 4 ++ xtask/xconfig/src/kconfig/lexer.rs | 4 ++ xtask/xconfig/src/kconfig/mod.rs | 4 ++ xtask/xconfig/src/kconfig/parser.rs | 4 ++ xtask/xconfig/src/kconfig/shell_expr.rs | 4 ++ xtask/xconfig/src/kconfig/symbol.rs | 4 ++ xtask/xconfig/src/lib.rs | 4 ++ xtask/xconfig/src/log.rs | 4 ++ xtask/xconfig/src/main.rs | 4 ++ xtask/xconfig/src/ui/app.rs | 4 ++ xtask/xconfig/src/ui/dependency_resolver.rs | 4 ++ xtask/xconfig/src/ui/events/handler.rs | 4 ++ xtask/xconfig/src/ui/events/mod.rs | 4 ++ xtask/xconfig/src/ui/mod.rs | 4 ++ xtask/xconfig/src/ui/rendering/mod.rs | 4 ++ xtask/xconfig/src/ui/rendering/theme.rs | 4 ++ xtask/xconfig/src/ui/state/mod.rs | 4 ++ xtask/xconfig/src/ui/utils/fuzzy_search.rs | 4 ++ xtask/xconfig/src/ui/utils/mod.rs | 4 ++ xtask/xconfig/tests/arch_config_bugs_test.rs | 4 ++ xtask/xconfig/tests/choice_defaults_test.rs | 4 ++ .../tests/choice_mutual_exclusion_test.rs | 4 ++ xtask/xconfig/tests/config_tests.rs | 4 ++ .../xconfig/tests/dependency_display_test.rs | 4 ++ .../tests/dependency_not_operator_test.rs | 4 ++ xtask/xconfig/tests/dependency_tests.rs | 4 ++ xtask/xconfig/tests/end_to_end_range_test.rs | 4 ++ xtask/xconfig/tests/if_block_test.rs | 4 ++ xtask/xconfig/tests/integration_tests.rs | 4 ++ xtask/xconfig/tests/lexer_tests.rs | 4 ++ xtask/xconfig/tests/menu_navigation_test.rs | 4 ++ .../xconfig/tests/menuconfig_defaults_test.rs | 4 ++ .../tests/menuconfig_ghost_filter_test.rs | 4 ++ xtask/xconfig/tests/parser_tests.rs | 4 ++ xtask/xconfig/tests/range_array_tests.rs | 4 ++ xtask/xconfig/tests/range_test.rs | 4 ++ xtask/xconfig/tests/search_navigation_test.rs | 4 ++ xtask/xconfig/tests/source_tests.rs | 4 ++ xtask/xconfig/tests/stable_ordering_test.rs | 4 ++ xtask/xconfig/tests/ui_checkbox_sync_test.rs | 4 ++ xtask/xconfig/tests/ui_tests.rs | 4 ++ .../tests/visibility_filtering_test.rs | 4 ++ 147 files changed, 645 insertions(+) create mode 100644 scripts/check_header.py diff --git a/api/kapi/src/tee/arch/mod.rs b/api/kapi/src/tee/arch/mod.rs index 832557ef..2fe50193 100644 --- a/api/kapi/src/tee/arch/mod.rs +++ b/api/kapi/src/tee/arch/mod.rs @@ -1,2 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + #[cfg(target_arch = "x86_64")] pub mod x86_64; diff --git a/api/kapi/src/tee/arch/x86_64/hygon_csv_bindings.rs b/api/kapi/src/tee/arch/x86_64/hygon_csv_bindings.rs index 4d19dc4f..a97c2099 100644 --- a/api/kapi/src/tee/arch/x86_64/hygon_csv_bindings.rs +++ b/api/kapi/src/tee/arch/x86_64/hygon_csv_bindings.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + // automatically generated by rust-bindgen 0.69.5 #[repr(C)] diff --git a/api/kapi/src/tee/arch/x86_64/mod.rs b/api/kapi/src/tee/arch/x86_64/mod.rs index 48398ccb..3707c056 100644 --- a/api/kapi/src/tee/arch/x86_64/mod.rs +++ b/api/kapi/src/tee/arch/x86_64/mod.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + #[cfg(feature = "x86_csv")] pub mod hygon_csv; #[cfg(feature = "x86_csv")] diff --git a/core/kernel_elf_parser/src/auxv.rs b/core/kernel_elf_parser/src/auxv.rs index cff6c854..48f178da 100644 --- a/core/kernel_elf_parser/src/auxv.rs +++ b/core/kernel_elf_parser/src/auxv.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use zerocopy::{Immutable, IntoBytes}; /// Represents the type of an auxiliary vector entry. diff --git a/core/kernel_elf_parser/src/info.rs b/core/kernel_elf_parser/src/info.rs index 8710390a..28c7685f 100644 --- a/core/kernel_elf_parser/src/info.rs +++ b/core/kernel_elf_parser/src/info.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! ELF information parsed from the ELF file use alloc::vec::Vec; diff --git a/core/kernel_elf_parser/src/lib.rs b/core/kernel_elf_parser/src/lib.rs index 425eafb6..d8dc4b4a 100644 --- a/core/kernel_elf_parser/src/lib.rs +++ b/core/kernel_elf_parser/src/lib.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + #![cfg_attr(not(test), no_std)] #![doc = include_str!("../README.md")] diff --git a/core/kernel_elf_parser/src/user_stack.rs b/core/kernel_elf_parser/src/user_stack.rs index b59715e8..545084ba 100644 --- a/core/kernel_elf_parser/src/user_stack.rs +++ b/core/kernel_elf_parser/src/user_stack.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Initialize the user stack for the application //! //! The structure of the user stack is described in the following figure: diff --git a/core/kernel_elf_parser/tests/test_dynamic.rs b/core/kernel_elf_parser/tests/test_dynamic.rs index b5754296..cc764533 100644 --- a/core/kernel_elf_parser/tests/test_dynamic.rs +++ b/core/kernel_elf_parser/tests/test_dynamic.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + #[test] fn test_elf_parser() { let elf_bytes = include_bytes!("ld-linux-x86-64.so.2"); diff --git a/core/kernel_elf_parser/tests/test_static.rs b/core/kernel_elf_parser/tests/test_static.rs index af01ed59..cc065293 100644 --- a/core/kernel_elf_parser/tests/test_static.rs +++ b/core/kernel_elf_parser/tests/test_static.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use kernel_elf_parser::ELFParser; #[test] diff --git a/core/kpoll/src/tests.rs b/core/kpoll/src/tests.rs index d0131c1e..3f429b48 100644 --- a/core/kpoll/src/tests.rs +++ b/core/kpoll/src/tests.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Unit tests for kpoll using the unittest framework. #![cfg(unittest)] diff --git a/core/ksync/src/tests.rs b/core/ksync/src/tests.rs index bc6fa006..81cf3cbf 100644 --- a/core/ksync/src/tests.rs +++ b/core/ksync/src/tests.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Unit tests for ksync using the unittest framework. #![cfg(unittest)] diff --git a/core/ktypes/src/lazy.rs b/core/ktypes/src/lazy.rs index 94083e98..7b4d4b87 100644 --- a/core/ktypes/src/lazy.rs +++ b/core/ktypes/src/lazy.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Synchronization primitives for lazy evaluation. //! //! Implementation adapted from the `SyncLazy` type of the standard library. See: diff --git a/core/slab_allocator/src/lib.rs b/core/slab_allocator/src/lib.rs index 1d89c68d..82110ddf 100644 --- a/core/slab_allocator/src/lib.rs +++ b/core/slab_allocator/src/lib.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Slab allocator for `no_std` systems. It uses multiple slabs with blocks of //! different sizes and a [buddy_system_allocator] for blocks larger than 4096 //! bytes. diff --git a/core/slab_allocator/src/slab.rs b/core/slab_allocator/src/slab.rs index 428c4e46..46302c41 100644 --- a/core/slab_allocator/src/slab.rs +++ b/core/slab_allocator/src/slab.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use alloc::alloc::{AllocError, Layout}; use super::SET_SIZE; diff --git a/core/slab_allocator/src/tests.rs b/core/slab_allocator/src/tests.rs index e99c6b9f..ad7dd3ea 100644 --- a/core/slab_allocator/src/tests.rs +++ b/core/slab_allocator/src/tests.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use alloc::alloc::Layout; use core::mem::{align_of, size_of}; diff --git a/drivers/aarch64-pmuv3/src/lib.rs b/drivers/aarch64-pmuv3/src/lib.rs index cda2f75f..55eeb0e8 100644 --- a/drivers/aarch64-pmuv3/src/lib.rs +++ b/drivers/aarch64-pmuv3/src/lib.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + #![no_std] pub mod pmuv3; diff --git a/drivers/aarch64-pmuv3/src/pmuv3.rs b/drivers/aarch64-pmuv3/src/pmuv3.rs index 1533157d..f4e225fc 100644 --- a/drivers/aarch64-pmuv3/src/pmuv3.rs +++ b/drivers/aarch64-pmuv3/src/pmuv3.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! PMU Counter Configuration Module use core::sync::atomic::{AtomicBool, Ordering}; diff --git a/drivers/aarch64-pmuv3/src/regs/macros.rs b/drivers/aarch64-pmuv3/src/regs/macros.rs index 2d8a2627..04f3e4fe 100644 --- a/drivers/aarch64-pmuv3/src/regs/macros.rs +++ b/drivers/aarch64-pmuv3/src/regs/macros.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + // Move to ARM register from system coprocessor register. // MRS Xd, sysreg "Xd = sysreg" #[macro_export] diff --git a/drivers/aarch64-pmuv3/src/regs/mod.rs b/drivers/aarch64-pmuv3/src/regs/mod.rs index 744c29ba..115a548d 100644 --- a/drivers/aarch64-pmuv3/src/regs/mod.rs +++ b/drivers/aarch64-pmuv3/src/regs/mod.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + #[macro_use] pub mod macros; diff --git a/drivers/aarch64-pmuv3/src/regs/pmccfiltr_el0.rs b/drivers/aarch64-pmuv3/src/regs/pmccfiltr_el0.rs index 5d08086a..61fafb18 100644 --- a/drivers/aarch64-pmuv3/src/regs/pmccfiltr_el0.rs +++ b/drivers/aarch64-pmuv3/src/regs/pmccfiltr_el0.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use tock_registers::{ interfaces::{Readable, Writeable}, register_bitfields, diff --git a/drivers/aarch64-pmuv3/src/regs/pmcr_el0.rs b/drivers/aarch64-pmuv3/src/regs/pmcr_el0.rs index bcb905b7..8ed93dfa 100644 --- a/drivers/aarch64-pmuv3/src/regs/pmcr_el0.rs +++ b/drivers/aarch64-pmuv3/src/regs/pmcr_el0.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use tock_registers::{ interfaces::{Readable, Writeable}, register_bitfields, diff --git a/drivers/aarch64-pmuv3/src/regs/pmuserenr_el0.rs b/drivers/aarch64-pmuv3/src/regs/pmuserenr_el0.rs index 81678928..46a82bf2 100644 --- a/drivers/aarch64-pmuv3/src/regs/pmuserenr_el0.rs +++ b/drivers/aarch64-pmuv3/src/regs/pmuserenr_el0.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use tock_registers::{ interfaces::{Readable, Writeable}, register_bitfields, diff --git a/drivers/aarch64-pmuv3/src/regs/regs.rs b/drivers/aarch64-pmuv3/src/regs/regs.rs index 467f69f8..50d6492c 100644 --- a/drivers/aarch64-pmuv3/src/regs/regs.rs +++ b/drivers/aarch64-pmuv3/src/regs/regs.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use crate::define_pmu_register; // define_pmu_register!(pmccfiltr_el0, PMCCFILTR_EL0, "PMCCFILTR_EL0"); define_pmu_register!(pmccntr_el0, PMCCNTR_EL0, "PMCCNTR_EL0"); diff --git a/drivers/display/src/tests.rs b/drivers/display/src/tests.rs index 3b0992fb..adb50736 100644 --- a/drivers/display/src/tests.rs +++ b/drivers/display/src/tests.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Unit tests for display drivers using the unittest framework. #![cfg(unittest)] diff --git a/drivers/virtio/src/mock_virtio.rs b/drivers/virtio/src/mock_virtio.rs index aab9d2c2..88730349 100644 --- a/drivers/virtio/src/mock_virtio.rs +++ b/drivers/virtio/src/mock_virtio.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use core::{cell::RefCell, ptr::NonNull}; use virtio_drivers::{ diff --git a/fs/fatfs/src/boot_sector.rs b/fs/fatfs/src/boot_sector.rs index f41a3157..d5f1e6d2 100644 --- a/fs/fatfs/src/boot_sector.rs +++ b/fs/fatfs/src/boot_sector.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use core::slice; use crate::{ diff --git a/fs/fatfs/src/dir.rs b/fs/fatfs/src/dir.rs index 1e5f9a67..80809a83 100644 --- a/fs/fatfs/src/dir.rs +++ b/fs/fatfs/src/dir.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + #[cfg(all(not(feature = "std"), feature = "alloc", feature = "lfn"))] use alloc::vec::Vec; #[cfg(feature = "lfn")] diff --git a/fs/fatfs/src/dir_entry.rs b/fs/fatfs/src/dir_entry.rs index 9bb1fb5c..4f8d6bb7 100644 --- a/fs/fatfs/src/dir_entry.rs +++ b/fs/fatfs/src/dir_entry.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + #[cfg(all(not(feature = "std"), feature = "alloc"))] use alloc::string::String; #[cfg(not(feature = "unicode"))] diff --git a/fs/fatfs/src/error.rs b/fs/fatfs/src/error.rs index ab2c4119..0749d034 100644 --- a/fs/fatfs/src/error.rs +++ b/fs/fatfs/src/error.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + /// Error enum with all errors that can be returned by functions from this crate /// /// Generic parameter `T` is a type of external error returned by the user provided storage diff --git a/fs/fatfs/src/file.rs b/fs/fatfs/src/file.rs index 0ddbe88f..d2ae76fb 100644 --- a/fs/fatfs/src/file.rs +++ b/fs/fatfs/src/file.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use core::convert::TryFrom; use crate::{ diff --git a/fs/fatfs/src/fs.rs b/fs/fatfs/src/fs.rs index cb677c51..b5d87c5e 100644 --- a/fs/fatfs/src/fs.rs +++ b/fs/fatfs/src/fs.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + #[cfg(all(not(feature = "std"), feature = "alloc"))] use alloc::string::String; use core::{ diff --git a/fs/fatfs/src/io.rs b/fs/fatfs/src/io.rs index 7e873700..b4bfe853 100644 --- a/fs/fatfs/src/io.rs +++ b/fs/fatfs/src/io.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use crate::error::IoError; /// Provides IO error as an associated type. diff --git a/fs/fatfs/src/lib.rs b/fs/fatfs/src/lib.rs index df68299b..4ec9374f 100644 --- a/fs/fatfs/src/lib.rs +++ b/fs/fatfs/src/lib.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! A FAT filesystem library implemented in Rust. //! //! # Usage diff --git a/fs/fatfs/src/log_macros.rs b/fs/fatfs/src/log_macros.rs index 36a195dc..5cb9eb48 100644 --- a/fs/fatfs/src/log_macros.rs +++ b/fs/fatfs/src/log_macros.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! This module offers a convenient way to enable only a subset of logging levels //! for just this `fatfs` crate only without changing the logging levels //! of other crates in a given project. diff --git a/fs/fatfs/src/table.rs b/fs/fatfs/src/table.rs index abd345f4..eeed24f5 100644 --- a/fs/fatfs/src/table.rs +++ b/fs/fatfs/src/table.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use core::{borrow::BorrowMut, marker::PhantomData}; use crate::{ diff --git a/fs/fatfs/src/time.rs b/fs/fatfs/src/time.rs index daa72a20..259d935f 100644 --- a/fs/fatfs/src/time.rs +++ b/fs/fatfs/src/time.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + #[cfg(feature = "chrono")] use core::convert::TryFrom; use core::fmt::Debug; diff --git a/fs/fs-ng-vfs/src/test_path.rs b/fs/fs-ng-vfs/src/test_path.rs index eef065a6..56ac6b1f 100644 --- a/fs/fs-ng-vfs/src/test_path.rs +++ b/fs/fs-ng-vfs/src/test_path.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Unit tests for Path and PathBuf. #![cfg(unittest)] diff --git a/fs/fs-ng-vfs/src/test_types.rs b/fs/fs-ng-vfs/src/test_types.rs index a40d0f74..556fd1cb 100644 --- a/fs/fs-ng-vfs/src/test_types.rs +++ b/fs/fs-ng-vfs/src/test_types.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + #![cfg(unittest)] use unittest::{assert_eq, def_test}; diff --git a/fs/kfs/src/fs/ext4/lwext4/fs.rs b/fs/kfs/src/fs/ext4/lwext4/fs.rs index 5d1e5ecc..d6eefb53 100644 --- a/fs/kfs/src/fs/ext4/lwext4/fs.rs +++ b/fs/kfs/src/fs/ext4/lwext4/fs.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use alloc::sync::Arc; use core::cell::OnceCell; diff --git a/fs/kfs/src/fs/ext4/lwext4/inode.rs b/fs/kfs/src/fs/ext4/lwext4/inode.rs index d701a2c2..84a2fed3 100644 --- a/fs/kfs/src/fs/ext4/lwext4/inode.rs +++ b/fs/kfs/src/fs/ext4/lwext4/inode.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use alloc::{borrow::ToOwned, string::String, sync::Arc}; use core::{any::Any, task::Context}; diff --git a/fs/kfs/src/fs/ext4/lwext4/mod.rs b/fs/kfs/src/fs/ext4/lwext4/mod.rs index 26c6fd34..a5986b37 100644 --- a/fs/kfs/src/fs/ext4/lwext4/mod.rs +++ b/fs/kfs/src/fs/ext4/lwext4/mod.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + mod fs; mod inode; mod util; diff --git a/fs/kfs/src/fs/ext4/lwext4/util.rs b/fs/kfs/src/fs/ext4/lwext4/util.rs index d6806f81..0f5cb541 100644 --- a/fs/kfs/src/fs/ext4/lwext4/util.rs +++ b/fs/kfs/src/fs/ext4/lwext4/util.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use fs_ng_vfs::{NodeType, VfsError}; use kerrno::LinuxError; use lwext4_rust::{Ext4Error, InodeType, SystemHal}; diff --git a/fs/kfs/src/fs/ext4/mod.rs b/fs/kfs/src/fs/ext4/mod.rs index 0e02f325..40edad9e 100644 --- a/fs/kfs/src/fs/ext4/mod.rs +++ b/fs/kfs/src/fs/ext4/mod.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + #[cfg(feature = "ext4-rsext4")] mod rsext4; diff --git a/fs/kfs/src/test_path_resolver.rs b/fs/kfs/src/test_path_resolver.rs index 9bdf7e0b..e5886fab 100644 --- a/fs/kfs/src/test_path_resolver.rs +++ b/fs/kfs/src/test_path_resolver.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Unit tests for PathResolver. #![cfg(unittest)] diff --git a/fs/kfs/src/test_working_context.rs b/fs/kfs/src/test_working_context.rs index 962f4cb7..0ae90bed 100644 --- a/fs/kfs/src/test_working_context.rs +++ b/fs/kfs/src/test_working_context.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Unit tests for WorkingContext. #![cfg(unittest)] diff --git a/fs/rsext4/src/api.rs b/fs/rsext4/src/api.rs index 593bddfb..01ffe5c7 100644 --- a/fs/rsext4/src/api.rs +++ b/fs/rsext4/src/api.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # ext4 API //! //! 提供 ext4 文件系统的高级 API 接口,包括文件系统挂载、文件操作等功能。 diff --git a/fs/rsext4/src/bitmap.rs b/fs/rsext4/src/bitmap.rs index 72e42641..343b5934 100644 --- a/fs/rsext4/src/bitmap.rs +++ b/fs/rsext4/src/bitmap.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # 位图操作模块 //! //! 提供对块和inode位图的操作,用于跟踪块和inode的分配状态。 diff --git a/fs/rsext4/src/bitmap_cache.rs b/fs/rsext4/src/bitmap_cache.rs index e03066db..d1cec8f8 100644 --- a/fs/rsext4/src/bitmap_cache.rs +++ b/fs/rsext4/src/bitmap_cache.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! 位图缓存模块 use alloc::{collections::BTreeMap, vec::Vec}; diff --git a/fs/rsext4/src/blockdev.rs b/fs/rsext4/src/blockdev.rs index 1daa2412..870bd378 100644 --- a/fs/rsext4/src/blockdev.rs +++ b/fs/rsext4/src/blockdev.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # 块设备实现 //! //! 定义了块设备的抽象接口和实现,为文件系统提供底层存储支持 diff --git a/fs/rsext4/src/blockgroup_description.rs b/fs/rsext4/src/blockgroup_description.rs index 882ff2bb..1193c8ec 100644 --- a/fs/rsext4/src/blockgroup_description.rs +++ b/fs/rsext4/src/blockgroup_description.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # 块组描述符模块 //! //! 定义了 ext4 文件系统的块组描述符结构和相关操作。 diff --git a/fs/rsext4/src/bmalloc.rs b/fs/rsext4/src/bmalloc.rs index b5e7c8b7..782d5a4e 100644 --- a/fs/rsext4/src/bmalloc.rs +++ b/fs/rsext4/src/bmalloc.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! 位图分配器模块 use crate::{bitmap::*, blockgroup_description::*, superblock::*}; diff --git a/fs/rsext4/src/config.rs b/fs/rsext4/src/config.rs index e82071f6..de2299f6 100644 --- a/fs/rsext4/src/config.rs +++ b/fs/rsext4/src/config.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # 配置常量定义 //! //! 定义了 ext4 文件系统实现中使用的各种配置常量,包括块大小、 diff --git a/fs/rsext4/src/datablock_cache.rs b/fs/rsext4/src/datablock_cache.rs index 4cb471f0..65097320 100644 --- a/fs/rsext4/src/datablock_cache.rs +++ b/fs/rsext4/src/datablock_cache.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! 数据块缓存模块 //! //! 提供文件和目录数据块的缓存管理,支持延迟写回和LRU淘汰 diff --git a/fs/rsext4/src/dir.rs b/fs/rsext4/src/dir.rs index 72a80af6..5ae903dc 100644 --- a/fs/rsext4/src/dir.rs +++ b/fs/rsext4/src/dir.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # 目录操作模块 //! //! 提供对 ext4 文件系统中目录的创建、删除、遍历等操作功能。 diff --git a/fs/rsext4/src/disknode.rs b/fs/rsext4/src/disknode.rs index aac26f37..88588715 100644 --- a/fs/rsext4/src/disknode.rs +++ b/fs/rsext4/src/disknode.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # 磁盘节点模块 //! //! 定义了 ext4 文件系统的 inode 结构和相关操作。 diff --git a/fs/rsext4/src/endian.rs b/fs/rsext4/src/endian.rs index ee85cfb3..58e76d7a 100644 --- a/fs/rsext4/src/endian.rs +++ b/fs/rsext4/src/endian.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # 字节序转换辅助模块 //! //! Ext4 磁盘格式使用小端序(Little Endian) diff --git a/fs/rsext4/src/entries.rs b/fs/rsext4/src/entries.rs index b742ec41..69a79847 100644 --- a/fs/rsext4/src/entries.rs +++ b/fs/rsext4/src/entries.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # 目录条目模块 //! //! 定义了 ext4 文件系统中目录条目的数据结构和操作。 diff --git a/fs/rsext4/src/error.rs b/fs/rsext4/src/error.rs index 06956b5f..4bbbbcc2 100644 --- a/fs/rsext4/src/error.rs +++ b/fs/rsext4/src/error.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # 错误处理模块 //! //! 定义了 rsext4 库中使用的所有错误类型,提供清晰的错误信息以便调试和处理 diff --git a/fs/rsext4/src/ext4.rs b/fs/rsext4/src/ext4.rs index 4a45de6f..337014de 100644 --- a/fs/rsext4/src/ext4.rs +++ b/fs/rsext4/src/ext4.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # Ext4 文件系统主调用入口 //! //! 提供 ext4 文件系统的核心实现,包括文件系统挂载、卸载、文件操作等高层接口。 diff --git a/fs/rsext4/src/extents_tree.rs b/fs/rsext4/src/extents_tree.rs index e9e2add5..8be3cee3 100644 --- a/fs/rsext4/src/extents_tree.rs +++ b/fs/rsext4/src/extents_tree.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # Extents 树模块 //! //! 实现 ext4 文件系统的 extents 功能,用于高效管理文件的连续块分配。 diff --git a/fs/rsext4/src/file.rs b/fs/rsext4/src/file.rs index e60d7a92..235517c6 100644 --- a/fs/rsext4/src/file.rs +++ b/fs/rsext4/src/file.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # 文件操作模块 //! //! 提供对 ext4 文件系统中文件的读写、创建、删除等操作功能。 diff --git a/fs/rsext4/src/hashtree.rs b/fs/rsext4/src/hashtree.rs index 1e9d9d3e..470e983a 100644 --- a/fs/rsext4/src/hashtree.rs +++ b/fs/rsext4/src/hashtree.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # 目录条目 HashTree 实现 //! //! 提供基于哈希树的目录查找功能,替代线性搜索以提高大型目录的性能 diff --git a/fs/rsext4/src/inodetable_cache.rs b/fs/rsext4/src/inodetable_cache.rs index 5788c288..4cc26566 100644 --- a/fs/rsext4/src/inodetable_cache.rs +++ b/fs/rsext4/src/inodetable_cache.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Inode表缓存模块 //! //! 提供inode结构的缓存管理,支持延迟写回和LRU淘汰 diff --git a/fs/rsext4/src/jbd2/jbd2.rs b/fs/rsext4/src/jbd2/jbd2.rs index d4883052..8d0d9a93 100644 --- a/fs/rsext4/src/jbd2/jbd2.rs +++ b/fs/rsext4/src/jbd2/jbd2.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # JBD2 日志系统实现 //! //! 实现了 ext4 文件系统的日志功能,确保事务的原子性和一致性。 diff --git a/fs/rsext4/src/jbd2/jbdstruct.rs b/fs/rsext4/src/jbd2/jbdstruct.rs index 3d5edb9a..9104a509 100644 --- a/fs/rsext4/src/jbd2/jbdstruct.rs +++ b/fs/rsext4/src/jbd2/jbdstruct.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # JBD2 数据结构定义 //! //! 定义了 JBD2 日志系统使用的各种数据结构。 diff --git a/fs/rsext4/src/jbd2/mod.rs b/fs/rsext4/src/jbd2/mod.rs index 28572694..132e6119 100644 --- a/fs/rsext4/src/jbd2/mod.rs +++ b/fs/rsext4/src/jbd2/mod.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # JBD2 日志系统模块 //! //! 提供 ext4 文件系统的日志功能,确保文件系统的一致性和可靠性。 diff --git a/fs/rsext4/src/lib.rs b/fs/rsext4/src/lib.rs index ec2053bb..123537e1 100644 --- a/fs/rsext4/src/lib.rs +++ b/fs/rsext4/src/lib.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # ext4_backend //! //! ext4 文件系统的核心实现模块,提供对 ext4 文件系统的底层操作支持。 diff --git a/fs/rsext4/src/loopfile.rs b/fs/rsext4/src/loopfile.rs index 6cde2bfe..c1a637dc 100644 --- a/fs/rsext4/src/loopfile.rs +++ b/fs/rsext4/src/loopfile.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # 文件遍历和操作模块 //! //! 提供文件内容读取、块解析等功能。 diff --git a/fs/rsext4/src/superblock.rs b/fs/rsext4/src/superblock.rs index cb82f7c0..8a7a8d9b 100644 --- a/fs/rsext4/src/superblock.rs +++ b/fs/rsext4/src/superblock.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # 超级块实现模块 //! //! 定义了 ext4 文件系统的超级块结构,包含文件系统的基本元数据和参数。 diff --git a/fs/rsext4/src/tool.rs b/fs/rsext4/src/tool.rs index 2010ca27..3e6dd7ed 100644 --- a/fs/rsext4/src/tool.rs +++ b/fs/rsext4/src/tool.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! # 工具函数模块 //! //! 提供各种辅助函数,如 UUID 生成等。 diff --git a/io/kio/src/test_cursor.rs b/io/kio/src/test_cursor.rs index 476da5aa..f9a0c7d3 100644 --- a/io/kio/src/test_cursor.rs +++ b/io/kio/src/test_cursor.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Unit tests for Cursor. #![cfg(unittest)] diff --git a/io/kio/src/test_iobuf.rs b/io/kio/src/test_iobuf.rs index e122abad..53d7c047 100644 --- a/io/kio/src/test_iobuf.rs +++ b/io/kio/src/test_iobuf.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Unit tests for IoBuf and IoBufMut. #![cfg(unittest)] diff --git a/io/kio/src/test_seek.rs b/io/kio/src/test_seek.rs index d019f70d..37a56a05 100644 --- a/io/kio/src/test_seek.rs +++ b/io/kio/src/test_seek.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Unit tests for Seek operations. #![cfg(unittest)] diff --git a/net/knet/src/test_options.rs b/net/knet/src/test_options.rs index e28948db..16e85531 100644 --- a/net/knet/src/test_options.rs +++ b/net/knet/src/test_options.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Unit tests for socket options. #![cfg(unittest)] diff --git a/net/knet/src/test_state.rs b/net/knet/src/test_state.rs index 23142622..618c89e5 100644 --- a/net/knet/src/test_state.rs +++ b/net/knet/src/test_state.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Unit tests for socket state management. #![cfg(unittest)] diff --git a/process/kprocess/src/tests.rs b/process/kprocess/src/tests.rs index 5bdaf1e2..722f8957 100644 --- a/process/kprocess/src/tests.rs +++ b/process/kprocess/src/tests.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Unit tests for kprocess #![cfg(unittest)] diff --git a/process/ksignal/src/tests.rs b/process/ksignal/src/tests.rs index 0fe7d2e4..52df8094 100644 --- a/process/ksignal/src/tests.rs +++ b/process/ksignal/src/tests.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Unit tests for ksignal #![cfg(unittest)] diff --git a/process/osvm/src/tests.rs b/process/osvm/src/tests.rs index 0543e373..37decc69 100644 --- a/process/osvm/src/tests.rs +++ b/process/osvm/src/tests.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Unit tests for osvm #![cfg(unittest)] diff --git a/scripts/check_header.py b/scripts/check_header.py new file mode 100644 index 00000000..def31543 --- /dev/null +++ b/scripts/check_header.py @@ -0,0 +1,61 @@ +import os + +EXPECTED_HEADER = """// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details.""" + +def check_rs_file_headers(root_dir="."): + """ + 检查指定目录下的所有 .rs 文件是否包含预期的文件头。 + 返回一个缺失文件头的文件路径列表。 + """ + missing_headers_list = [] + + for root, dirs, files in os.walk(root_dir): + # 忽略 target 目录以加快搜索速度 + if 'target' in dirs: + dirs.remove('target') + + for file in files: + if file.endswith(".rs"): + file_path = os.path.join(root, file) + try: + with open(file_path, 'r', encoding='utf-8') as f: + # 读取文件的前几行(假设头信息在前 10 行内),以避免读取整个大文件 + lines = [f.readline() for _ in range(10)] + content_head = "".join(lines) + + if EXPECTED_HEADER not in content_head: + missing_headers_list.append(file_path) + except Exception as e: + print(f"无法读取文件 {file_path}: {e}") + + return missing_headers_list + +def add_missing_headers(missing_list): + """ + 为缺失文件头的文件添加版权头信息。 + """ + if not missing_list: + print("🎉 恭喜!所有的 .rs 文件都包含了指定的版权头信息。") + return + + print(f"⚠️ 发现 {len(missing_list)} 个 .rs 文件缺失指定的版权头信息,正在添加...") + print("-" * 50) + for path in missing_list: + try: + with open(path, 'r', encoding='utf-8') as f: + content = f.read() + + with open(path, 'w', encoding='utf-8') as f: + f.write(EXPECTED_HEADER + "\n\n" + content) + print(f"已添加: {path}") + except Exception as e: + print(f"❌ 无法处理文件 {path}: {e}") + print("-" * 50) + print("✅ 处理完成!") + +if __name__ == "__main__": + # 指定项目根目录运行,默认为当前目录 '.' + missing_files = check_rs_file_headers(".") + add_missing_headers(missing_files) \ No newline at end of file diff --git a/tee_apps/sh/src/main.rs b/tee_apps/sh/src/main.rs index 24850a02..592b5cd0 100644 --- a/tee_apps/sh/src/main.rs +++ b/tee_apps/sh/src/main.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::process::{Child, Command, Stdio}; fn spawn_app(path: &str) -> Option { diff --git a/tee_apps/tee_app1/src/main.rs b/tee_apps/tee_app1/src/main.rs index 373b8f01..1788a928 100644 --- a/tee_apps/tee_app1/src/main.rs +++ b/tee_apps/tee_app1/src/main.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + fn main() { println!("Hello, tee_app1!"); let mut count = 0u64; diff --git a/tee_apps/tee_app2/src/main.rs b/tee_apps/tee_app2/src/main.rs index bdcbd026..ccda0b56 100644 --- a/tee_apps/tee_app2/src/main.rs +++ b/tee_apps/tee_app2/src/main.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + fn main() { println!("Hello, tee_app2!"); let mut count = 0u64; diff --git a/util/kbuild_config/build.rs b/util/kbuild_config/build.rs index 1a629cf9..2994c04c 100644 --- a/util/kbuild_config/build.rs +++ b/util/kbuild_config/build.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::{env, fs, path::Path}; fn main() { diff --git a/util/kbuild_config/src/lib.rs b/util/kbuild_config/src/lib.rs index b292f19b..142973bd 100644 --- a/util/kbuild_config/src/lib.rs +++ b/util/kbuild_config/src/lib.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + // Auto-generated kbuild configuration module // // This module provides access to configuration constants from .config file diff --git a/xtask/crate_rootfs/src/args.rs b/xtask/crate_rootfs/src/args.rs index 8789e7a9..6755ca18 100644 --- a/xtask/crate_rootfs/src/args.rs +++ b/xtask/crate_rootfs/src/args.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use clap::Parser; diff --git a/xtask/crate_rootfs/src/blockdev.rs b/xtask/crate_rootfs/src/blockdev.rs index 5305b5ec..f7ae6460 100644 --- a/xtask/crate_rootfs/src/blockdev.rs +++ b/xtask/crate_rootfs/src/blockdev.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::{ fs::File, io::{Read, Seek, SeekFrom, Write}, diff --git a/xtask/crate_rootfs/src/main.rs b/xtask/crate_rootfs/src/main.rs index c607195f..1cb633c8 100644 --- a/xtask/crate_rootfs/src/main.rs +++ b/xtask/crate_rootfs/src/main.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + mod args; mod blockdev; mod rootfs; diff --git a/xtask/crate_rootfs/src/rootfs.rs b/xtask/crate_rootfs/src/rootfs.rs index 90be4ff0..7a580e4d 100644 --- a/xtask/crate_rootfs/src/rootfs.rs +++ b/xtask/crate_rootfs/src/rootfs.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::{ fs::{File, OpenOptions}, io::Read, diff --git a/xtask/crate_rootfs/src/util.rs b/xtask/crate_rootfs/src/util.rs index 03665d37..79f5d1b1 100644 --- a/xtask/crate_rootfs/src/util.rs +++ b/xtask/crate_rootfs/src/util.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::Path; /// Align up to the next multiple of `align`. diff --git a/xtask/src/main.rs b/xtask/src/main.rs index b9543968..cdea0691 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + fn main() { println!("Hello, xtask!"); } \ No newline at end of file diff --git a/xtask/xconfig/benches/parser_bench.rs b/xtask/xconfig/benches/parser_bench.rs index 21d11d1a..200ad84c 100644 --- a/xtask/xconfig/benches/parser_bench.rs +++ b/xtask/xconfig/benches/parser_bench.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use criterion::{Criterion, black_box, criterion_group, criterion_main}; diff --git a/xtask/xconfig/src/cli/commands.rs b/xtask/xconfig/src/cli/commands.rs index 7d306d59..ef832790 100644 --- a/xtask/xconfig/src/cli/commands.rs +++ b/xtask/xconfig/src/cli/commands.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use clap::{Parser as ClapParser, Subcommand}; diff --git a/xtask/xconfig/src/cli/defconfig.rs b/xtask/xconfig/src/cli/defconfig.rs index b790a7c4..72fd4bd4 100644 --- a/xtask/xconfig/src/cli/defconfig.rs +++ b/xtask/xconfig/src/cli/defconfig.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use crate::error::Result; diff --git a/xtask/xconfig/src/cli/gen_const.rs b/xtask/xconfig/src/cli/gen_const.rs index 3baa438c..d22c5bae 100644 --- a/xtask/xconfig/src/cli/gen_const.rs +++ b/xtask/xconfig/src/cli/gen_const.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::{ collections::HashMap, fs, diff --git a/xtask/xconfig/src/cli/menuconfig.rs b/xtask/xconfig/src/cli/menuconfig.rs index fbeb43fa..b630572e 100644 --- a/xtask/xconfig/src/cli/menuconfig.rs +++ b/xtask/xconfig/src/cli/menuconfig.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::{io, path::PathBuf}; use crossterm::{ diff --git a/xtask/xconfig/src/cli/mod.rs b/xtask/xconfig/src/cli/mod.rs index 6b521ae2..1bf6ef76 100644 --- a/xtask/xconfig/src/cli/mod.rs +++ b/xtask/xconfig/src/cli/mod.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + pub mod commands; pub mod defconfig; pub mod gen_const; diff --git a/xtask/xconfig/src/cli/oldconfig.rs b/xtask/xconfig/src/cli/oldconfig.rs index ce379f04..0c9ef8da 100644 --- a/xtask/xconfig/src/cli/oldconfig.rs +++ b/xtask/xconfig/src/cli/oldconfig.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use crate::{ diff --git a/xtask/xconfig/src/cli/saveconfig.rs b/xtask/xconfig/src/cli/saveconfig.rs index 0802fe0d..160916a7 100644 --- a/xtask/xconfig/src/cli/saveconfig.rs +++ b/xtask/xconfig/src/cli/saveconfig.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use crate::{ diff --git a/xtask/xconfig/src/config/generator.rs b/xtask/xconfig/src/config/generator.rs index 47bec42f..bd0e8dda 100644 --- a/xtask/xconfig/src/config/generator.rs +++ b/xtask/xconfig/src/config/generator.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::{collections::HashMap, fs::File, io::Write, path::Path}; use crate::{ diff --git a/xtask/xconfig/src/config/mod.rs b/xtask/xconfig/src/config/mod.rs index ddac4425..aeb11bf8 100644 --- a/xtask/xconfig/src/config/mod.rs +++ b/xtask/xconfig/src/config/mod.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + pub mod generator; pub mod oldconfig; pub mod reader; diff --git a/xtask/xconfig/src/config/oldconfig.rs b/xtask/xconfig/src/config/oldconfig.rs index 6111d993..4e672c06 100644 --- a/xtask/xconfig/src/config/oldconfig.rs +++ b/xtask/xconfig/src/config/oldconfig.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::{collections::HashSet, path::Path}; use crate::{ diff --git a/xtask/xconfig/src/config/reader.rs b/xtask/xconfig/src/config/reader.rs index 44933e71..fcdc2ce4 100644 --- a/xtask/xconfig/src/config/reader.rs +++ b/xtask/xconfig/src/config/reader.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::{collections::HashMap, fs, path::Path}; use crate::error::Result; diff --git a/xtask/xconfig/src/config/writer.rs b/xtask/xconfig/src/config/writer.rs index 1cde8cc9..f9f54fb1 100644 --- a/xtask/xconfig/src/config/writer.rs +++ b/xtask/xconfig/src/config/writer.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::{fs::File, io::Write, path::Path}; use crate::{error::Result, kconfig::SymbolTable}; diff --git a/xtask/xconfig/src/error.rs b/xtask/xconfig/src/error.rs index dae5a3bf..8245e368 100644 --- a/xtask/xconfig/src/error.rs +++ b/xtask/xconfig/src/error.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use thiserror::Error; diff --git a/xtask/xconfig/src/kconfig/ast.rs b/xtask/xconfig/src/kconfig/ast.rs index 8781f715..8f9ab4a5 100644 --- a/xtask/xconfig/src/kconfig/ast.rs +++ b/xtask/xconfig/src/kconfig/ast.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; #[derive(Debug, Clone, PartialEq)] diff --git a/xtask/xconfig/src/kconfig/expr.rs b/xtask/xconfig/src/kconfig/expr.rs index 0e45751f..439853e1 100644 --- a/xtask/xconfig/src/kconfig/expr.rs +++ b/xtask/xconfig/src/kconfig/expr.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use crate::{ error::{KconfigError, Result}, kconfig::{ast::Expr, shell_expr::evaluate_shell_expr, symbol::SymbolTable}, diff --git a/xtask/xconfig/src/kconfig/lexer.rs b/xtask/xconfig/src/kconfig/lexer.rs index 785f15d1..1158fa65 100644 --- a/xtask/xconfig/src/kconfig/lexer.rs +++ b/xtask/xconfig/src/kconfig/lexer.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use crate::error::{KconfigError, Result}; diff --git a/xtask/xconfig/src/kconfig/mod.rs b/xtask/xconfig/src/kconfig/mod.rs index e322f26b..93224572 100644 --- a/xtask/xconfig/src/kconfig/mod.rs +++ b/xtask/xconfig/src/kconfig/mod.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + pub mod ast; pub mod expr; pub mod lexer; diff --git a/xtask/xconfig/src/kconfig/parser.rs b/xtask/xconfig/src/kconfig/parser.rs index 1051ef41..0b50d2d0 100644 --- a/xtask/xconfig/src/kconfig/parser.rs +++ b/xtask/xconfig/src/kconfig/parser.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::{ collections::HashSet, fs, diff --git a/xtask/xconfig/src/kconfig/shell_expr.rs b/xtask/xconfig/src/kconfig/shell_expr.rs index 145660ad..649998c2 100644 --- a/xtask/xconfig/src/kconfig/shell_expr.rs +++ b/xtask/xconfig/src/kconfig/shell_expr.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use crate::{ error::{KconfigError, Result}, kconfig::symbol::SymbolTable, diff --git a/xtask/xconfig/src/kconfig/symbol.rs b/xtask/xconfig/src/kconfig/symbol.rs index c038a0e1..ddcb3ddf 100644 --- a/xtask/xconfig/src/kconfig/symbol.rs +++ b/xtask/xconfig/src/kconfig/symbol.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::collections::HashMap; use crate::kconfig::ast::SymbolType; diff --git a/xtask/xconfig/src/lib.rs b/xtask/xconfig/src/lib.rs index e2c707ef..b3638585 100644 --- a/xtask/xconfig/src/lib.rs +++ b/xtask/xconfig/src/lib.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + pub mod cli; pub mod config; pub mod error; diff --git a/xtask/xconfig/src/log.rs b/xtask/xconfig/src/log.rs index c293b7d1..93fe4eda 100644 --- a/xtask/xconfig/src/log.rs +++ b/xtask/xconfig/src/log.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + #[cfg(unix)] use std::os::unix::fs::OpenOptionsExt; use std::sync::OnceLock; diff --git a/xtask/xconfig/src/main.rs b/xtask/xconfig/src/main.rs index 02ea0cbd..468d9c69 100644 --- a/xtask/xconfig/src/main.rs +++ b/xtask/xconfig/src/main.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use xconfig::cli::run_cli; fn main() { diff --git a/xtask/xconfig/src/ui/app.rs b/xtask/xconfig/src/ui/app.rs index feeac043..a1a84165 100644 --- a/xtask/xconfig/src/ui/app.rs +++ b/xtask/xconfig/src/ui/app.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::{io::Write, time::Duration}; use crossterm::event::{self, Event, KeyCode, KeyEvent}; diff --git a/xtask/xconfig/src/ui/dependency_resolver.rs b/xtask/xconfig/src/ui/dependency_resolver.rs index 7aef3e86..f1c6fa3b 100644 --- a/xtask/xconfig/src/ui/dependency_resolver.rs +++ b/xtask/xconfig/src/ui/dependency_resolver.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::collections::HashMap; use crate::kconfig::{ diff --git a/xtask/xconfig/src/ui/events/handler.rs b/xtask/xconfig/src/ui/events/handler.rs index c7b34a96..683571e2 100644 --- a/xtask/xconfig/src/ui/events/handler.rs +++ b/xtask/xconfig/src/ui/events/handler.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum EventResult { Continue, diff --git a/xtask/xconfig/src/ui/events/mod.rs b/xtask/xconfig/src/ui/events/mod.rs index 4bc7dc7f..fb7ced11 100644 --- a/xtask/xconfig/src/ui/events/mod.rs +++ b/xtask/xconfig/src/ui/events/mod.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + pub mod handler; pub use handler::{EventHandler, EventResult}; diff --git a/xtask/xconfig/src/ui/mod.rs b/xtask/xconfig/src/ui/mod.rs index 4d9e6cda..8eee578b 100644 --- a/xtask/xconfig/src/ui/mod.rs +++ b/xtask/xconfig/src/ui/mod.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + pub mod app; pub mod dependency_resolver; pub mod events; diff --git a/xtask/xconfig/src/ui/rendering/mod.rs b/xtask/xconfig/src/ui/rendering/mod.rs index 3104c3fe..2760024b 100644 --- a/xtask/xconfig/src/ui/rendering/mod.rs +++ b/xtask/xconfig/src/ui/rendering/mod.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + pub mod theme; pub use theme::Theme; diff --git a/xtask/xconfig/src/ui/rendering/theme.rs b/xtask/xconfig/src/ui/rendering/theme.rs index cc6399f6..ad177444 100644 --- a/xtask/xconfig/src/ui/rendering/theme.rs +++ b/xtask/xconfig/src/ui/rendering/theme.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use ratatui::style::{Color, Modifier, Style}; #[derive(Debug, Clone)] diff --git a/xtask/xconfig/src/ui/state/mod.rs b/xtask/xconfig/src/ui/state/mod.rs index 921375c9..ce5f7007 100644 --- a/xtask/xconfig/src/ui/state/mod.rs +++ b/xtask/xconfig/src/ui/state/mod.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::{collections::HashMap, io::Write}; use crate::{ diff --git a/xtask/xconfig/src/ui/utils/fuzzy_search.rs b/xtask/xconfig/src/ui/utils/fuzzy_search.rs index 520c7a99..517f155d 100644 --- a/xtask/xconfig/src/ui/utils/fuzzy_search.rs +++ b/xtask/xconfig/src/ui/utils/fuzzy_search.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use crate::ui::state::MenuItem; pub struct FuzzySearcher { diff --git a/xtask/xconfig/src/ui/utils/mod.rs b/xtask/xconfig/src/ui/utils/mod.rs index 9a85027e..a666f9b7 100644 --- a/xtask/xconfig/src/ui/utils/mod.rs +++ b/xtask/xconfig/src/ui/utils/mod.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + pub mod fuzzy_search; pub use fuzzy_search::{FuzzySearcher, SearchResult}; diff --git a/xtask/xconfig/tests/arch_config_bugs_test.rs b/xtask/xconfig/tests/arch_config_bugs_test.rs index d68230f7..6cca3d9b 100644 --- a/xtask/xconfig/tests/arch_config_bugs_test.rs +++ b/xtask/xconfig/tests/arch_config_bugs_test.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + /// Tests for Bug 1: ARCH config value is incorrect when loading defconfig with ARCH_X86_64=y /// Tests for Bug 2: Cross-architecture configuration pollution from defconfig use std::fs; diff --git a/xtask/xconfig/tests/choice_defaults_test.rs b/xtask/xconfig/tests/choice_defaults_test.rs index e7fd9300..0a8ab5d8 100644 --- a/xtask/xconfig/tests/choice_defaults_test.rs +++ b/xtask/xconfig/tests/choice_defaults_test.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::fs; use tempfile::TempDir; diff --git a/xtask/xconfig/tests/choice_mutual_exclusion_test.rs b/xtask/xconfig/tests/choice_mutual_exclusion_test.rs index 2638d5b6..bafe5ce9 100644 --- a/xtask/xconfig/tests/choice_mutual_exclusion_test.rs +++ b/xtask/xconfig/tests/choice_mutual_exclusion_test.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::io::Write; use tempfile::NamedTempFile; diff --git a/xtask/xconfig/tests/config_tests.rs b/xtask/xconfig/tests/config_tests.rs index e77e9a45..4d07b3f2 100644 --- a/xtask/xconfig/tests/config_tests.rs +++ b/xtask/xconfig/tests/config_tests.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::fs; use tempfile::TempDir; diff --git a/xtask/xconfig/tests/dependency_display_test.rs b/xtask/xconfig/tests/dependency_display_test.rs index 3d41603d..48d15262 100644 --- a/xtask/xconfig/tests/dependency_display_test.rs +++ b/xtask/xconfig/tests/dependency_display_test.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use xconfig::{kconfig::Parser, ui::state::ConfigState}; diff --git a/xtask/xconfig/tests/dependency_not_operator_test.rs b/xtask/xconfig/tests/dependency_not_operator_test.rs index 7d582b5c..b7247803 100644 --- a/xtask/xconfig/tests/dependency_not_operator_test.rs +++ b/xtask/xconfig/tests/dependency_not_operator_test.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use xconfig::{ diff --git a/xtask/xconfig/tests/dependency_tests.rs b/xtask/xconfig/tests/dependency_tests.rs index aa65baf0..70a2fabb 100644 --- a/xtask/xconfig/tests/dependency_tests.rs +++ b/xtask/xconfig/tests/dependency_tests.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use xconfig::{ diff --git a/xtask/xconfig/tests/end_to_end_range_test.rs b/xtask/xconfig/tests/end_to_end_range_test.rs index b333df83..16d54d13 100644 --- a/xtask/xconfig/tests/end_to_end_range_test.rs +++ b/xtask/xconfig/tests/end_to_end_range_test.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::fs; use tempfile::TempDir; diff --git a/xtask/xconfig/tests/if_block_test.rs b/xtask/xconfig/tests/if_block_test.rs index e363ac54..d24e4bfa 100644 --- a/xtask/xconfig/tests/if_block_test.rs +++ b/xtask/xconfig/tests/if_block_test.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::fs; use tempfile::TempDir; diff --git a/xtask/xconfig/tests/integration_tests.rs b/xtask/xconfig/tests/integration_tests.rs index eb9bcf22..1a5adec5 100644 --- a/xtask/xconfig/tests/integration_tests.rs +++ b/xtask/xconfig/tests/integration_tests.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use tempfile::TempDir; diff --git a/xtask/xconfig/tests/lexer_tests.rs b/xtask/xconfig/tests/lexer_tests.rs index ce4e43d4..ca7fa2d1 100644 --- a/xtask/xconfig/tests/lexer_tests.rs +++ b/xtask/xconfig/tests/lexer_tests.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use xconfig::kconfig::{Lexer, Token}; diff --git a/xtask/xconfig/tests/menu_navigation_test.rs b/xtask/xconfig/tests/menu_navigation_test.rs index 83fb3b40..64158f24 100644 --- a/xtask/xconfig/tests/menu_navigation_test.rs +++ b/xtask/xconfig/tests/menu_navigation_test.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use xconfig::{ diff --git a/xtask/xconfig/tests/menuconfig_defaults_test.rs b/xtask/xconfig/tests/menuconfig_defaults_test.rs index a414fa14..7a1b2334 100644 --- a/xtask/xconfig/tests/menuconfig_defaults_test.rs +++ b/xtask/xconfig/tests/menuconfig_defaults_test.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use xconfig::{ config::ConfigReader, kconfig::{SymbolTable, SymbolType}, diff --git a/xtask/xconfig/tests/menuconfig_ghost_filter_test.rs b/xtask/xconfig/tests/menuconfig_ghost_filter_test.rs index 1b9b8159..261e4460 100644 --- a/xtask/xconfig/tests/menuconfig_ghost_filter_test.rs +++ b/xtask/xconfig/tests/menuconfig_ghost_filter_test.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Tests for ghost config filtering in menuconfig //! //! Verifies that configs with unsatisfied dependencies are cleared when loading .config diff --git a/xtask/xconfig/tests/parser_tests.rs b/xtask/xconfig/tests/parser_tests.rs index baf4138d..dc43a192 100644 --- a/xtask/xconfig/tests/parser_tests.rs +++ b/xtask/xconfig/tests/parser_tests.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use xconfig::kconfig::Parser; diff --git a/xtask/xconfig/tests/range_array_tests.rs b/xtask/xconfig/tests/range_array_tests.rs index 2abf114e..d13a747b 100644 --- a/xtask/xconfig/tests/range_array_tests.rs +++ b/xtask/xconfig/tests/range_array_tests.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use xconfig::kconfig::{ diff --git a/xtask/xconfig/tests/range_test.rs b/xtask/xconfig/tests/range_test.rs index a2246fbc..5ac3b29d 100644 --- a/xtask/xconfig/tests/range_test.rs +++ b/xtask/xconfig/tests/range_test.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::fs; use tempfile::TempDir; diff --git a/xtask/xconfig/tests/search_navigation_test.rs b/xtask/xconfig/tests/search_navigation_test.rs index 4f5bd9eb..7a14ca16 100644 --- a/xtask/xconfig/tests/search_navigation_test.rs +++ b/xtask/xconfig/tests/search_navigation_test.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use xconfig::{kconfig::Parser, ui::app::MenuConfigApp}; diff --git a/xtask/xconfig/tests/source_tests.rs b/xtask/xconfig/tests/source_tests.rs index 405f7fc7..5b2e57d2 100644 --- a/xtask/xconfig/tests/source_tests.rs +++ b/xtask/xconfig/tests/source_tests.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use xconfig::kconfig::Parser; diff --git a/xtask/xconfig/tests/stable_ordering_test.rs b/xtask/xconfig/tests/stable_ordering_test.rs index f989e23d..bef65357 100644 --- a/xtask/xconfig/tests/stable_ordering_test.rs +++ b/xtask/xconfig/tests/stable_ordering_test.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::fs; use tempfile::TempDir; diff --git a/xtask/xconfig/tests/ui_checkbox_sync_test.rs b/xtask/xconfig/tests/ui_checkbox_sync_test.rs index dbe2122e..caf5a324 100644 --- a/xtask/xconfig/tests/ui_checkbox_sync_test.rs +++ b/xtask/xconfig/tests/ui_checkbox_sync_test.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + //! Tests for checkbox state synchronization in MenuConfigApp //! //! # Testing Limitations diff --git a/xtask/xconfig/tests/ui_tests.rs b/xtask/xconfig/tests/ui_tests.rs index d8559a77..bbb87dfd 100644 --- a/xtask/xconfig/tests/ui_tests.rs +++ b/xtask/xconfig/tests/ui_tests.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::path::PathBuf; use xconfig::{ diff --git a/xtask/xconfig/tests/visibility_filtering_test.rs b/xtask/xconfig/tests/visibility_filtering_test.rs index 3cd7a35e..4a8e2dcb 100644 --- a/xtask/xconfig/tests/visibility_filtering_test.rs +++ b/xtask/xconfig/tests/visibility_filtering_test.rs @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2025 KylinSoft Co., Ltd. +// See LICENSES for license details. + use std::fs; use tempfile::TempDir;