Commit 185d064a authored by jan.koester's avatar jan.koester
Browse files

test

parent 55f217e0
Loading
Loading
Loading
Loading
+35 −7
Changes for build-chroot.sh: 35 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -998,9 +998,12 @@ fetch_url() {

# The kernel options build_kernel() in build-os.sh adds to x86_64's
# defconfig: framebuffer console for Limine's GOP handoff, zstd squashfs
# for the live image, NVMe, virtio (VMs) and the Realtek, Intel (e1000e,
# igb, igc for I225/I226, ixgbe, i40e, ice) and Aquantia (atlantic) NICs
# built in; plus what the initramfs needs to find the live image (loop,
# for the live image, NVMe and virtio (VMs) built in; the NICs are
# KERNEL_MODULES, only the Realtek PHY driver r8169 needs stays built in
# (phylib asks request_module for it while r8169 probes); plus the bool
# options of the GPU modules (amdgpu: SI and CIK cards, which radeon
# would drive otherwise, and the HSA/KFD compute driver ROCm talks to);
# plus what the initramfs needs to find the live image (loop,
# iso9660) and to make it writable (overlayfs over tmpfs); the kernel
# file servers sharedd drives: ksmbd (SMB_SERVER) and knfsd (NFSD, NFSv4),
# and its iSCSI targets (LIO over configfs: TARGET_CORE, ISCSI_TARGET);
@@ -1023,11 +1026,11 @@ fetch_url() {
# (X86_PKG_TEMP_THERMAL alone is only a thermal zone, it has no hwmon).
KERNEL_OPTIONS="SYSFB SYSFB_SIMPLEFB DRM DRM_SIMPLEDRM DRM_FBDEV_EMULATION FB FB_CORE
    FRAMEBUFFER_CONSOLE FRAMEBUFFER_CONSOLE_DETECT_PRIMARY SQUASHFS SQUASHFS_ZSTD SQUASHFS_XATTR
    SQUASHFS_FILE_DIRECT NETDEVICES ETHERNET NET_VENDOR_REALTEK R8169 PHYLIB REALTEK_PHY BLK_DEV_NVME
    SQUASHFS_FILE_DIRECT NETDEVICES ETHERNET NET_VENDOR_REALTEK PHYLIB REALTEK_PHY BLK_DEV_NVME
    NVME_CORE VIRTIO VIRTIO_PCI VIRTIO_BLK VIRTIO_NET VIRTIO_CONSOLE SCSI_VIRTIO VIRTIO_BALLOON
    VIRTIO_INPUT VIRTIO_MMIO BLK_DEV_LOOP ISO9660_FS DEVTMPFS DEVTMPFS_MOUNT OVERLAY_FS TMPFS
    NET_VENDOR_INTEL E1000 E1000E IGB IGC IGBVF IXGBE IXGBEVF I40E ICE
    NET_VENDOR_AQUANTIA AQTION
    NET_VENDOR_INTEL NET_VENDOR_AQUANTIA
    DRM_AMDGPU_SI DRM_AMDGPU_CIK DRM_AMDGPU_USERPTR HSA_AMD
    NETWORK_FILESYSTEMS SMB_SERVER NFSD NFSD_V4 NFSD_LEGACY_CLIENT_TRACKING
    MD BLK_DEV_MD MD_RAID0 MD_RAID1 MD_RAID10 MD_RAID456 BLK_DEV_DM
    BONDING BRIDGE WIREGUARD DEBUG_INFO_DWARF5 DEBUG_INFO_BTF
@@ -1041,6 +1044,22 @@ KERNEL_OPTIONS="SYSFB SYSFB_SIMPLEFB DRM DRM_SIMPLEDRM DRM_FBDEV_EMULATION FB FB
# DEBUG_INFO_BTF needs DWARF (pahole turns it into BTF): DWARF5 replaces
# defconfig's DEBUG_INFO_NONE in that choice
KERNEL_OPTIONS_OFF="DEBUG_INFO_NONE"
# Hardware drivers the boot does not need, as modules (=m, also where
# defconfig builds them in): the initramfs has no modules, syslite loads
# them from the root file system by the devices' modalias (coldplug, then
# uevents). Only drivers that are loaded by modalias: fresh's modprobe is
# no request_module() helper (no /sbin/modprobe, no -q, no aliases), so
# what the kernel requests by name (rtnl-link-bridge, fs-nfsd, md-raid1,
# phy drivers, ...) stays in KERNEL_OPTIONS. GPUs: amdgpu (GCN 1.0 and
# newer), radeon (older AMD/ATI), nouveau (NVIDIA; GSP firmware for Turing
# and newer), i915 and xe (Intel); they load their firmware while probing,
# which a built-in driver could not (no root file system yet). simpledrm
# keeps the console on the firmware framebuffer until they take over.
# NICs: the Realtek, Intel and Aquantia ones of KERNEL_OPTIONS and the
# ones defconfig builds in.
KERNEL_MODULES="DRM_AMDGPU DRM_RADEON DRM_NOUVEAU DRM_I915 DRM_XE
    R8169 E100 E1000 E1000E IGB IGC IGBVF IXGBE IXGBEVF I40E ICE AQTION
    8139TOO FORCEDETH SKY2 TIGON3"

# kernel_config <version> -- kernel.spec's Source2: defconfig plus
# KERNEL_OPTIONS, generated inside the chroot (kconfig needs flex/bison,
@@ -1053,7 +1072,7 @@ kernel_config() {
    # needs >= 1.22), so a config made before dwarves was installed is stale
    local pahole
    pahole="$(in_chroot /bin/sh -c 'pahole --version' 2>/dev/null </dev/null || true)"
    local opts="$KERNEL_OPTIONS | $KERNEL_OPTIONS_OFF | pahole ${pahole:-none}"
    local opts="$KERNEL_OPTIONS | $KERNEL_OPTIONS_OFF | $KERNEL_MODULES | pahole ${pahole:-none}"
    if [[ -s $out && ${KERNEL_CONFIG_FORCE:-0} != 1 && -f $out.options && "$(cat "$out.options")" == "$opts" ]]; then
        return
    fi
@@ -1064,6 +1083,9 @@ kernel_config() {
    for o in $KERNEL_OPTIONS_OFF; do
        sets+="sed -i -e '/^CONFIG_$o=/d' -e '/^# CONFIG_$o is not set/d' .config; echo '# CONFIG_$o is not set' >>.config; "
    done
    for o in $KERNEL_MODULES; do
        sets+="sed -i -e '/^CONFIG_$o=/d' -e '/^# CONFIG_$o is not set/d' .config; echo CONFIG_$o=m >>.config; "
    done
    cat >"$CHROOT/tmp/kconfig.sh" <<EOF
set -e
rm -rf /build/kconfig; mkdir -p /build/kconfig; cd /build/kconfig
@@ -1085,6 +1107,12 @@ EOF
        grep -q "^CONFIG_$o=y" "$out" || missing+=" $o"
    done
    [[ -z $missing ]] || warn "kernel-config-$v: not enabled (unknown symbol or unmet dependency):$missing"
    # =y: something built in selects it
    missing=""
    for o in $KERNEL_MODULES; do
        grep -q "^CONFIG_$o=m" "$out" || missing+=" $o"
    done
    [[ -z $missing ]] || warn "kernel-config-$v: not a module (unknown symbol, unmet dependency or selected by a built-in option):$missing"
}

# llvm_wrappers <version> <tarball> -- llvm-project.spec's Source1: the