mirror of
https://github.com/BigfootACA/arch-image-builder.git
synced 2024-09-21 12:02:48 +08:00
builder: build: filesystem.py: allow add custom kernel and firmware
Signed-off-by: BigfootACA <bigfoot@classfun.cn>
This commit is contained in:
parent
8ed06d8f8b
commit
0d8ef8a67c
@ -78,8 +78,17 @@ def check_allowed(path: str, action: str):
|
|||||||
1. /etc/ is used for administrator configs
|
1. /etc/ is used for administrator configs
|
||||||
2. /boot/ is used for system boot up, you can put bootloaders configs into this folder
|
2. /boot/ is used for system boot up, you can put bootloaders configs into this folder
|
||||||
3. /var/ is used for daemons runtime states
|
3. /var/ is used for daemons runtime states
|
||||||
|
3. /usr/lib/modules/ is used for kernel modules (custom kernel)
|
||||||
|
3. /usr/lib/firmware/ is used for system firmware (custom firmware)
|
||||||
"""
|
"""
|
||||||
if not path.startswith(("/etc/", "/boot/", "/var/")):
|
allow_list = (
|
||||||
|
"/etc/",
|
||||||
|
"/boot/",
|
||||||
|
"/var/",
|
||||||
|
"/usr/lib/modules",
|
||||||
|
"/usr/lib/firmware",
|
||||||
|
)
|
||||||
|
if not path.startswith(allow_list):
|
||||||
raise ArchBuilderConfigError(f"{action} {path} is not allowed")
|
raise ArchBuilderConfigError(f"{action} {path} is not allowed")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user