mirror of
https://github.com/rosalinux/image-builder.git
synced 2025-02-23 10:22:50 +00:00
add extra_packages env
This commit is contained in:
parent
d768a00a96
commit
5a1f1c1613
3 changed files with 15 additions and 8 deletions
|
@ -1,16 +1,14 @@
|
|||
ARCH="aarch64"
|
||||
|
||||
KERNEL="https://github.com/raspberrypi/linux.git#rpi-6.6.y"
|
||||
KERNEL_CONFIG="bcm2711_defconfig"
|
||||
KERNEL_EXTRACONFIG="--module NTFS3_FS --enable NTFS3_LZX_XPRESS --enable NTFS3_FS_POSIX_ACL --disable NTFS3_64BIT_CLUSTER"
|
||||
EXTRA_PKGS="kernel-raspberry"
|
||||
#KERNEL="https://github.com/raspberrypi/linux.git#rpi-6.6.y"
|
||||
#KERNEL_CONFIG="bcm2711_defconfig"
|
||||
#KERNEL_EXTRACONFIG="--module NTFS3_FS --enable NTFS3_LZX_XPRESS --enable NTFS3_FS_POSIX_ACL --disable NTFS3_64BIT_CLUSTER"
|
||||
DTB="broadcom/bcm2711-rpi-4-b"
|
||||
|
||||
CMDLINE="dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait"
|
||||
NEED_INITRD=no
|
||||
|
||||
UBOOT="https://github.com/radxa/u-boot.git"
|
||||
UBOOT_VERSION="next-dev-v2024.03"
|
||||
|
||||
# disk section
|
||||
# /boot is vfat partition
|
||||
BOOT_FSTYPE="vfat"
|
||||
|
|
|
@ -50,10 +50,12 @@ enabled=1
|
|||
f.write(dnf_conf_content)
|
||||
|
||||
|
||||
def run_dnf_install(config, dnf_conf_path, rootfs_dir, arch):
|
||||
def run_dnf_install(config, dnf_conf_path, rootfs_dir, arch, extra_pkgs=""):
|
||||
"""Run dnf command to install packages based on the bootstrap configuration."""
|
||||
pkgs = config["PKGS"]
|
||||
weak_deps = config["WEAK_DEPS"].lower()
|
||||
if extra_pkgs:
|
||||
pkgs += f" {extra_pkgs}"
|
||||
|
||||
print(f"Bootstrapping '{arch}' rootfs...")
|
||||
dnf_command = [
|
||||
|
@ -79,10 +81,15 @@ def setup_bootstrap(bootstrap_dir, tmp_dir, vendor, device, distro, arch):
|
|||
|
||||
config = load_config(distro_config_path)
|
||||
|
||||
device_config_path = os.path.join("device", vendor, device, "config")
|
||||
device_config = load_config(device_config_path) if os.path.exists(device_config_path) else {}
|
||||
|
||||
extra_pkgs = device_config.get("EXTRA_PKGS", "")
|
||||
|
||||
dnf_conf_path = os.path.join(tmp_dir, vendor, device, "dnf.conf")
|
||||
rootfs_dir = os.path.join(tmp_dir, vendor, device, "rootfs")
|
||||
|
||||
generate_dnf_conf(dnf_conf_path, config["ABF_DOWNLOADS"], config["RELEASE"])
|
||||
run_dnf_install(config, dnf_conf_path, rootfs_dir, arch)
|
||||
run_dnf_install(config, dnf_conf_path, rootfs_dir, arch, extra_pkgs)
|
||||
|
||||
#setup_user(rootfs_dir, config["DEFAULT_USER"], config["DEFAULT_USER_PASSWORD"], config["PASSWD_ROOT"])
|
||||
|
|
|
@ -17,6 +17,7 @@ def create_disk_image(tmp_dir, config, vendor, device):
|
|||
boot_size = "0"
|
||||
|
||||
disk_image_path = os.path.join(tmp_dir, vendor, device, "disk.img")
|
||||
os.makedirs(os.path.dirname(disk_image_path), exist_ok=True)
|
||||
cmd = [
|
||||
"dd",
|
||||
"if=/dev/zero",
|
||||
|
@ -95,4 +96,5 @@ def mount_partitions(config, loop_device, tmp_dir, vendor, device):
|
|||
|
||||
print(f"Mounting root (/) partition at {rootfs_dir}")
|
||||
subprocess.run(["sudo", "mount", root_partition, rootfs_dir], check=True)
|
||||
|
||||
print("Mounting complete.")
|
||||
|
|
Loading…
Add table
Reference in a new issue