From 94e3e14e139960bdafa125081de371c308494e02 Mon Sep 17 00:00:00 2001 From: superconvert Date: Thu, 13 Oct 2022 14:19:12 +0000 Subject: [PATCH] update script --- 01_build_src.sh | 194 +++++++++++++++++++++++++++++++++++++++++------- 02_build_img.sh | 16 +++- mk_xfce.sh | 28 +++++++ 3 files changed, 207 insertions(+), 31 deletions(-) diff --git a/01_build_src.sh b/01_build_src.sh index 0afbaef..e68c5ef 100755 --- a/01_build_src.sh +++ b/01_build_src.sh @@ -112,38 +112,178 @@ cd ${build_dir} if [ ! -d "linux_install" ]; then mkdir -pv linux_install && cd ${LINUX_SRC_DIR} && make mrproper && make x86_64_defconfig # Enable the VESA framebuffer for graphics support. - sed -i "s/.*CONFIG_FB_VESA.*/CONFIG_FB_VESA=y/" .config + # 内核 3d 加速 https://wiki.gentoo.org/wiki/Xorg/Hardware_3D_acceleration_guide # xfce4 需要 drm 支持,内核版本尽量大于等于 18.04 的,所以选取了 5.8.6 的内核 - sed -i "/CONFIG_ARCH_HAS_PTE_SPECIAL=y/a\CONFIG_MAPPING_DIRTY_HELPERS=y" .config - sed -i "/# CONFIG_DRM_DP_CEC is not set/a\CONFIG_DRM_TTM=m" .config - sed -i "/CONFIG_DRM_TTM=m/a\CONFIG_DRM_TTM_DMA_PAGE_POOL=y" .config - sed -i "/CONFIG_DRM_TTM_DMA_PAGE_POOL=y/a\CONFIG_DRM_VRAM_HELPER=m" .config - sed -i "/CONFIG_DRM_VRAM_HELPER=m/a\CONFIG_DRM_TTM_HELPER=m" .config - sed -i "/CONFIG_DRM_TTM_HELPER=m/a\CONFIG_DRM_GEM_SHMEM_HELPER=y" .config - sed -i "/# CONFIG_FIRMWARE_EDID is not set/a\CONFIG_FB_BOOT_VESA_SUPPORT=y" .config - sed -i "/CONFIG_FB_DEFERRED_IO=y/a\CONFIG_FB_BACKLIGHT=m" .config - sed -i "/CONFIG_HDMI=y/i\CONFIG_VGASTATE=m" .config - sed -i "s/# CONFIG_FB_BACKLIGHT is not set/CONFIG_FB_BACKLIGHT=y/" .config - sed -i "s/# CONFIG_FB_CIRRUS is not set/CONFIG_FB_CIRRUS=m/" .config - sed -i "s/# CONFIG_FB_VGA16 is not set/CONFIG_FB_VGA16=m/" .config - sed -i "s/# CONFIG_FB_UVESA is not set/CONFIG_FB_UVESA=m/" .config - sed -i "s/# CONFIG_FB_OPENCORES is not set/CONFIG_FB_OPENCORES=m/" .config - sed -i "s/# CONFIG_FB_NVIDIA is not set/CONFIG_FB_NVIDIA=m/" .config - sed -i "/CONFIG_FB_NVIDIA=m/a\# CONFIG_FB_NVIDIA_I2C is not set" .config - sed -i "/# CONFIG_FB_NVIDIA_I2C is not set/a\# CONFIG_FB_NVIDIA_DEBUG is not set" .config - sed -i "/# CONFIG_FB_NVIDIA_DEBUG is not set/a\CONFIG_FB_NVIDIA_BACKLIGHT=y" .config - sed -i "s/# CONFIG_FB_IBM_GXT4500 is not set/CONFIG_FB_IBM_GXT4500=m/" .config + + sed -i "s/# CONFIG_X86_SYSFB is not set/CONFIG_X86_SYSFB=y/" .config + + sed -i "/CONFIG_VIRTUALIZATION=y/i\CONFIG_HAVE_KVM_IRQCHIP=y" .config + sed -i "/CONFIG_VIRTUALIZATION=y/i\CONFIG_HAVE_KVM_IRQFD=y" .config + sed -i "/CONFIG_VIRTUALIZATION=y/i\CONFIG_HAVE_KVM_IRQ_ROUTING=y" .config + sed -i "/CONFIG_VIRTUALIZATION=y/i\CONFIG_HAVE_KVM_EVENTFD=y" .config + sed -i "/CONFIG_VIRTUALIZATION=y/i\CONFIG_KVM_MMIO=y" .config + sed -i "/CONFIG_VIRTUALIZATION=y/i\CONFIG_KVM_ASYNC_PF=y" .config + sed -i "/CONFIG_VIRTUALIZATION=y/i\CONFIG_HAVE_KVM_MSI=y" .config + sed -i "/CONFIG_VIRTUALIZATION=y/i\CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y" .config + sed -i "/CONFIG_VIRTUALIZATION=y/i\CONFIG_KVM_VFIO=y" .config + sed -i "/CONFIG_VIRTUALIZATION=y/i\CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y" .config + sed -i "/CONFIG_VIRTUALIZATION=y/i\CONFIG_KVM_COMPAT=y" .config + sed -i "/CONFIG_VIRTUALIZATION=y/i\CONFIG_HAVE_KVM_IRQ_BYPASS=y" .config + sed -i "/CONFIG_VIRTUALIZATION=y/i\CONFIG_HAVE_KVM_NO_POLL=y" .config + + sed -i "s/# CONFIG_KVM is not set/CONFIG_KVM=y/" .config + sed -i "/CONFIG_AS_AVX512=y/i\CONFIG_KVM_INTEL=y" .config + sed -i "/CONFIG_AS_AVX512=y/i\CONFIG_KVM_AMD=y" .config + sed -i "/CONFIG_AS_AVX512=y/i\CONFIG_KVM_MMU_AUDIT=y" .config + + sed -i "/CONFIG_HAVE_IOREMAP_PROT=y/i\CONFIG_USER_RETURN_NOTIFIER=y" .config + sed -i "/CONFIG_BLK_PM=y/i\CONFIG_BLK_MQ_VIRTIO=y" .config + sed -i "/CONFIG_ASN1=y/i\CONFIG_PREEMPT_NOTIFIERS=y" .config + sed -i "/# CONFIG_MEMORY_HOTPLUG is not set/i\CONFIG_MEMORY_ISOLATION=y" .config + sed -i "/CONFIG_PHYS_ADDR_T_64BIT=y/i\CONFIG_CONTIG_ALLOC=y" .config + + sed -i "s/# CONFIG_CMA is not set/CONFIG_CMA=y/" .config + sed -i "/# CONFIG_ZPOOL is not set/i\# CONFIG_CMA_DEBUG is not set" .config + sed -i "/# CONFIG_ZPOOL is not set/i\# CONFIG_CMA_DEBUGFS is not set" .config + sed -i "/# CONFIG_ZPOOL is not set/i\CONFIG_CMA_AREAS=7" .config + + sed -i "/CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y/i\CONFIG_HMM_MIRROR=y" .config + sed -i "/# end of Memory Management options/i\CONFIG_MAPPING_DIRTY_HELPERS=y" .config + + sed -i "/CONFIG_ALLOW_DEV_COREDUMP=y/i\CONFIG_WANT_DEV_COREDUMP=y" .config + sed -i "/# CONFIG_DEBUG_DRIVER is not set/i\CONFIG_DEV_COREDUMP=y" .config + sed -i "/# CONFIG_BLK_DEV_RBD is not set/i\# CONFIG_VIRTIO_BLK is not set" .config + sed -i "/# CONFIG_NLMON is not set/i\# CONFIG_VIRTIO_NET is not set" .config + sed -i "/# CONFIG_IPMI_HANDLER is not set/i\# CONFIG_VIRTIO_CONSOLE is not set" .config + sed -i "/# CONFIG_APPLICOM is not set/i\# CONFIG_HW_RANDOM_VIRTIO is not set" .config + + sed -i "s/# CONFIG_AGP_SIS is not set/CONFIG_AGP_SIS=y/" .config + sed -i "s/# CONFIG_AGP_VIA is not set/CONFIG_AGP_VIA=y/" .config + sed -i "s/# CONFIG_DRM_DP_AUX_CHARDEV is not set/CONFIG_DRM_DP_AUX_CHARDEV=y/" .config + sed -i "s/# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set/CONFIG_DRM_LOAD_EDID_FIRMWARE=y/" .config + + sed -i "/# CONFIG_DRM_DP_CEC is not set/a\CONFIG_DRM_TTM=y" .config + sed -i "/CONFIG_DRM_TTM=y/a\CONFIG_DRM_TTM_DMA_PAGE_POOL=y" .config + sed -i "/CONFIG_DRM_TTM_DMA_PAGE_POOL=y/a\CONFIG_DRM_VRAM_HELPER=y" .config + sed -i "/CONFIG_DRM_VRAM_HELPER=y/a\CONFIG_DRM_TTM_HELPER=y" .config + sed -i "/CONFIG_DRM_TTM_HELPER=y/a\CONFIG_DRM_GEM_SHMEM_HELPER=y" .config + sed -i "/CONFIG_DRM_GEM_SHMEM_HELPER=y/a\CONFIG_DRM_VM=y" .config + sed -i "/CONFIG_DRM_VM=y/a\CONFIG_DRM_SCHED=y" .config + + sed -i "/# CONFIG_DRM_RADEON is not set/d" .config + sed -i "/# CONFIG_DRM_AMDGPU is not set/d" .config + sed -i "/# CONFIG_DRM_NOUVEAU is not set/d" .config + sed -i "/CONFIG_DRM_I915=y/i\CONFIG_DRM_RADEON=y" .config + sed -i "/CONFIG_DRM_I915=y/i\CONFIG_DRM_RADEON_USERPTR=y" .config + sed -i "/CONFIG_DRM_I915=y/i\CONFIG_DRM_AMDGPU=y" .config + sed -i "/CONFIG_DRM_I915=y/i\CONFIG_DRM_AMDGPU_SI=y" .config + sed -i "/CONFIG_DRM_I915=y/i\CONFIG_DRM_AMDGPU_CIK=y" .config + sed -i "/CONFIG_DRM_I915=y/i\CONFIG_DRM_AMDGPU_USERPTR=y" .config + sed -i "/CONFIG_DRM_I915=y/i\# CONFIG_DRM_AMDGPU_GART_DEBUGFS is not set\n" .config + sed -i "/CONFIG_DRM_I915=y/i\#\n# ACP (Audio CoProcessor) Configuration\n#" .config + sed -i "/CONFIG_DRM_I915=y/i\# CONFIG_DRM_AMD_ACP is not set" .config + sed -i "/CONFIG_DRM_I915=y/i\# end of ACP (Audio CoProcessor) Configuration\n" .config + sed -i "/CONFIG_DRM_I915=y/i\#\n# Display Engine Configuration\n#" .config + sed -i "/CONFIG_DRM_I915=y/i\CONFIG_DRM_AMD_DC=y" .config + sed -i "/CONFIG_DRM_I915=y/i\CONFIG_DRM_AMD_DC_DCN=y" .config + sed -i "/CONFIG_DRM_I915=y/i\# CONFIG_DRM_AMD_DC_HDCP is not set" .config + sed -i "/CONFIG_DRM_I915=y/i\# CONFIG_DEBUG_KERNEL_DC is not set" .config + sed -i "/CONFIG_DRM_I915=y/i\# end of Display Engine Configuration\n" .config + sed -i "/CONFIG_DRM_I915=y/i\CONFIG_HSA_AMD=y" .config + sed -i "/CONFIG_DRM_I915=y/i\CONFIG_DRM_NOUVEAU=y" .config + sed -i "/CONFIG_DRM_I915=y/i\CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT=y" .config + sed -i "/CONFIG_DRM_I915=y/i\CONFIG_NOUVEAU_DEBUG=5" .config + sed -i "/CONFIG_DRM_I915=y/i\CONFIG_NOUVEAU_DEBUG_DEFAULT=3" .config + sed -i "/CONFIG_DRM_I915=y/i\# CONFIG_NOUVEAU_DEBUG_MMU is not set" .config + sed -i "/CONFIG_DRM_I915=y/i\CONFIG_DRM_NOUVEAU_BACKLIGHT=y" .config + + sed -i "s/# CONFIG_DRM_I915_GVT is not set/CONFIG_DRM_I915_GVT=y/" .config + sed -i "s/# CONFIG_DRM_VGEM is not set/CONFIG_DRM_VGEM=y/" .config + + sed -i "s/# CONFIG_DRM_VMWGFX is not set/CONFIG_DRM_VMWGFX=y\nCONFIG_DRM_VMWGFX_FBCON=y/" .config + sed -i "s/# CONFIG_DRM_GMA500 is not set/CONFIG_DRM_GMA500=y\nCONFIG_DRM_GMA600=y\nCONFIG_DRM_GMA3600=y/" .config + sed -i "s/# CONFIG_DRM_MGAG200 is not set/CONFIG_DRM_MGAG200=y/" .config + sed -i "s/# CONFIG_DRM_QXL is not set/CONFIG_DRM_QXL=y/" .config + sed -i "s/# CONFIG_DRM_BOCHS is not set/CONFIG_DRM_BOCHS=y\n# CONFIG_DRM_VIRTIO_GPU is not set/" .config + + sed -i "s/# CONFIG_DRM_ETNAVIV is not set/CONFIG_DRM_ETNAVIV=y\nCONFIG_DRM_ETNAVIV_THERMAL=y/" .config + sed -i "s/# CONFIG_DRM_CIRRUS_QEMU is not set/CONFIG_DRM_CIRRUS_QEMU=y/" .config + sed -i "s/# CONFIG_DRM_GM12U320 is not set/CONFIG_DRM_GM12U320=y/" .config + sed -i "s/# CONFIG_DRM_VBOXVIDEO is not set/CONFIG_DRM_VBOXVIDEO=y/" .config + sed -i "s/# CONFIG_DRM_LEGACY is not set/CONFIG_DRM_LEGACY=y/" .config + sed -i "/CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y/i\# CONFIG_DRM_TDFX is not set" .config + sed -i "/CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y/i\# CONFIG_DRM_R128 is not set" .config + sed -i "/CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y/i\# CONFIG_DRM_I810 is not set" .config + sed -i "/CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y/i\# CONFIG_DRM_MGA is not set" .config + sed -i "/CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y/i\# CONFIG_DRM_SIS is not set" .config + sed -i "/CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y/i\# CONFIG_DRM_VIA is not set" .config + sed -i "/CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y/i\# CONFIG_DRM_SAVAGE is not set" .config + + sed -i "s/# CONFIG_FIRMWARE_EDID is not set/CONFIG_FIRMWARE_EDID=y\nCONFIG_FB_DDC=y\nCONFIG_FB_BOOT_VESA_SUPPORT=y/" .config + sed -i "/CONFIG_FB_MODE_HELPERS=y/i\CONFIG_FB_SVGALIB=y" .config + sed -i "/CONFIG_FB_MODE_HELPERS=y/i\CONFIG_FB_BACKLIGHT=y" .config + + sed -i "s/# CONFIG_FB_CIRRUS is not set/CONFIG_FB_CIRRUS=y/" .config + sed -i "s/# CONFIG_FB_VGA16 is not set/CONFIG_FB_VGA16=y/" .config + sed -i "s/# CONFIG_FB_UVESA is not set/CONFIG_FB_UVESA=y/" .config + sed -i "s/# CONFIG_FB_VESA is not set/CONFIG_FB_VESA=y/" .config + + sed -i "s/# CONFIG_FB_OPENCORES is not set/CONFIG_FB_OPENCORES=y/" .config + + sed -i "s/# CONFIG_FB_NVIDIA is not set/CONFIG_FB_NVIDIA=y\nCONFIG_FB_NVIDIA_I2C=y\nCONFIG_FB_NVIDIA_DEBUG=y\nCONFIG_FB_NVIDIA_BACKLIGHT=y/" .config + sed -i "s/# CONFIG_FB_RIVA is not set/CONFIG_FB_RIVA=y\n# CONFIG_FB_RIVA_I2C is not set\n# CONFIG_FB_RIVA_DEBUG is not set\nCONFIG_FB_RIVA_BACKLIGHT=y/" .config + sed -i "s/# CONFIG_FB_I740 is not set/CONFIG_FB_I740=y/" .config + sed -i "s/# CONFIG_FB_RADEON is not set/CONFIG_FB_RADEON=y\nCONFIG_FB_RADEON_I2C=y\nCONFIG_FB_RADEON_BACKLIGHT=y\n# CONFIG_FB_RADEON_DEBUG is not set/" .config + + sed -i "s/# CONFIG_FB_3DFX is not set/CONFIG_FB_3DFX=y\nCONFIG_FB_3DFX_ACCEL=y\nCONFIG_FB_3DFX_I2C=y/" .config + sed -i "s/# CONFIG_FB_VOODOO1 is not set/CONFIG_FB_VOODOO1=y/" .config + sed -i "s/# CONFIG_FB_VT8623 is not set/CONFIG_FB_VT8623=y/" .config + sed -i "s/# CONFIG_FB_TRIDENT is not set/CONFIG_FB_TRIDENT=y/" .config + sed -i "s/# CONFIG_FB_IBM_GXT4500 is not set/CONFIG_FB_IBM_GXT4500=y/" .config sed -i "s/# CONFIG_FB_SIMPLE is not set/CONFIG_FB_SIMPLE=y/" .config - sed -i "s/# CONFIG_VGASTATE is not set/CONFIG_VGASTATE=m/" .config - sed -i "s/# CONFIG_DRM_VMWGFX is not set/CONFIG_DRM_VMWGFX=m\nCONFIG_DRM_VMWGFX_FBCON=y/" .config - sed -i "s/# CONFIG_DRM_CIRRUS_QEMU is not set/CONFIG_DRM_CIRRUS_QEMU=m/" .config - sed -i "s/# CONFIG_DRM_QXL is not set/CONFIG_DRM_QXL=m/" .config - sed -i "s/# CONFIG_DRM_BOCHS is not set/CONFIG_DRM_BOCHS=m/" .config - sed -i "s/# CONFIG_DRM_HISI_HIBMC is not set/CONFIG_DRM_HISI_HIBMC=m/" .config + + sed -i "/CONFIG_HDMI=y/i\CONFIG_VGASTATE=y" .config + sed -i "/# CONFIG_VIRT_DRIVERS is not set/i\CONFIG_IRQ_BYPASS_MANAGER=y" .config + sed -i "/CONFIG_VIRTIO_MENU=y/i\CONFIG_VIRTIO=y" .config + + sed -i "s/# CONFIG_VIRTIO_PCI is not set/CONFIG_VIRTIO_PCI=y\nCONFIG_VIRTIO_PCI_LEGACY=y\n# CONFIG_VIRTIO_BALLOON is not set\n# CONFIG_VIRTIO_INPUT is not set/" .config + sed -i "s/# CONFIG_ACPI_WMI is not set/CONFIG_ACPI_WMI=y/" .config + sed -i "/# CONFIG_ACERHDF is not set/i\CONFIG_WMI_BMOF=y" .config + sed -i "/# CONFIG_ACERHDF is not set/i\# CONFIG_ALIENWARE_WMI is not set" .config + sed -i "/# CONFIG_ACERHDF is not set/i\# CONFIG_HUAWEI_WMI is not set" .config + sed -i "/# CONFIG_ACERHDF is not set/i\# CONFIG_INTEL_WMI_SBL_FW_UPDATE is not set" .config + sed -i "/# CONFIG_ACERHDF is not set/i\# CONFIG_INTEL_WMI_THUNDERBOLT is not set" .config + sed -i "/# CONFIG_ACERHDF is not set/i\CONFIG_MXM_WMI=y" .config + sed -i "/# CONFIG_ACERHDF is not set/i\# CONFIG_PEAQ_WMI is not set" .config + sed -i "/# CONFIG_ACERHDF is not set/i\# CONFIG_XIAOMI_WMI is not set" .config + + sed -i "/# CONFIG_APPLE_GMUX is not set/i\# CONFIG_ACER_WMI is not set" .config + sed -i "/CONFIG_EEEPC_LAPTOP=y/i\# CONFIG_ASUS_WMI is not set" .config + sed -i "/# CONFIG_AMILO_RFKILL is not set/i\# CONFIG_DELL_WMI_AIO is not set" .config + sed -i "/# CONFIG_AMILO_RFKILL is not set/i\# CONFIG_DELL_WMI_LED is not set" .config + sed -i "/# CONFIG_IBM_RTL is not set/i\# CONFIG_HP_WMI is not set" .config + sed -i "/# CONFIG_SAMSUNG_LAPTOP is not set/i\# CONFIG_MSI_WMI is not set" .config + sed -i "/# CONFIG_ACPI_CMPC is not set/i\# CONFIG_TOSHIBA_WMI is not set" .config + sed -i "/# CONFIG_PANASONIC_LAPTOP is not set/i\# CONFIG_LG_LAPTOP is not set" .config + + sed -i "/# CONFIG_CRYPTO_TEST is not set/a\CONFIG_CRYPTO_ENGINE=m" .config + sed -i "/# CONFIG_CRYPTO_DEV_SAFEXCEL is not set/i\CONFIG_CRYPTO_DEV_VIRTIO=m" .config + + sed -i "/# CONFIG_DMA_API_DEBUG is not set/i\CONFIG_DMA_CMA=y\n" .config + sed -i "/# CONFIG_DMA_API_DEBUG is not set/i\#\n# Default contiguous memory area size:\n#" .config + sed -i "/# CONFIG_DMA_API_DEBUG is not set/i\CONFIG_CMA_SIZE_MBYTES=0" .config + sed -i "/# CONFIG_DMA_API_DEBUG is not set/i\CONFIG_CMA_SIZE_SEL_MBYTES=y" .config + sed -i "/# CONFIG_DMA_API_DEBUG is not set/i\# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set" .config + sed -i "/# CONFIG_DMA_API_DEBUG is not set/i\# CONFIG_CMA_SIZE_SEL_MIN is not set" .config + sed -i "/# CONFIG_DMA_API_DEBUG is not set/i\# CONFIG_CMA_SIZE_SEL_MAX is not set" .config + sed -i "/# CONFIG_DMA_API_DEBUG is not set/i\CONFIG_CMA_ALIGNMENT=8" .config + # 网络需要 TUN/TAP 驱动 [ Device Drivers ] ---> [ Network device support ] ---> [ Universal TUN/TAP device driver support ] make bzImage -j8 + make modules -j8 #cd linux-5.8.6 && make x86_64_defconfig && make bzImage -j8 && make modules && make modules_install && cd .. - make INSTALL_HDR_PATH=${linux_install} headers_install -j8 && cp arch/x86_64/boot/bzImage ${linux_install} && cd .. + make INSTALL_HDR_PATH=${linux_install} headers_install -j8 + make modules_install INSTALL_MOD_PATH=${linux_install} -j8 && cp arch/x86_64/boot/bzImage ${linux_install} && cd .. fi # 编译glibc diff --git a/02_build_img.sh b/02_build_img.sh index adb8bd2..cd15728 100755 --- a/02_build_img.sh +++ b/02_build_img.sh @@ -31,6 +31,7 @@ losetup -o 1048576 ${loop_dev} disk.img # 对磁盘进行格式化 mkfs.ext3 ${loop_dev} +# 如果制作的 disk.img 转换为 qemu-img convert disk.img -f raw -O vmdk out.vmdk, vmware 的磁盘类型一定设置为 SATA ,否则,启动失败 diskfs="diskfs" # 挂载磁盘到本地目录 mkdir -pv ${diskfs} @@ -59,6 +60,7 @@ mkdir -pv rootfs/lib/modules # 拷贝内核镜像 cp ${linux_install}/bzImage ${diskfs}/boot/bzImage +cp ${linux_install}/lib ${diskfs}/ -r # 拷贝 glibc 到 rootfs cp ${glibc_install}/* rootfs/ -r @@ -119,7 +121,7 @@ mount --move /proc /mnt/proc mount --move /tmp /mnt/tmp # 切换到真正的磁盘系统上 rootfs ---> diskfs export LD_LIBRARY_PATH="/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64:/usr/lib/x86_64-linux-gnu" -exec switch_root /mnt /sbin/init +exec switch_root -c /dev/console /mnt /sbin/init EOF # /sbin/init [switch_root 执行] ---> /etc/inittab [定义了启动顺序] ---> @@ -175,6 +177,12 @@ if [ "${with_gcc}" = true ]; then fi rm -rf ${diskfs}/init ${diskfs}/lost+found +# lspci 显示厂商 ( 下面的是 ubuntu 的 ) +if [ -f "/usr/share/misc/pci.ids" ]; then + mkdir -p ${diskfs}/usr/share/misk + cp /usr/share/misc/pci.ids ${diskfs}/usr/share/misk/pci.ids +fi + # 测试用户登陆模式: root/123456 if [ "${with_login}" = true ]; then echo "${RED} ... build with-login${NC}" @@ -189,15 +197,15 @@ if [ "${with_xfce}" = true ]; then ln -s /usr/share/X11/xkb ${xfce_install}/usr/local/share/X11 # 依赖版本 libpcre.so.3 if [ -f "${xfce_install}/usr/local/lib/libpcre.so.1" ]; then - mv ${xfce_install}/usr/local/lib/libpcre.so.1 ${xfce_install}/usr/local/lib/libpcre.so.3 + cp ${xfce_install}/usr/local/lib/libpcre.so.1 ${xfce_install}/usr/local/lib/libpcre.so.3 fi # 依赖版本 libedit2 if [ -f "${xfce_install}/usr/local/lib/libedit.so.0" ]; then - mv ${xfce_install}/usr/local/lib/libedit.so.0 ${xfce_install}/usr/local/lib/libedit.so.2 + cp ${xfce_install}/usr/local/lib/libedit.so.0 ${xfce_install}/usr/local/lib/libedit.so.2 fi # 依赖版本 libtinfo.so.5 if [ -f "${xfce_install}/usr/lib/libtinfo.so.6" ]; then - mv ${xfce_install}/usr/lib/libtinfo.so.6 ${xfce_install}/usr/lib/libtinfo.so.5 + cp ${xfce_install}/usr/lib/libtinfo.so.6 ${xfce_install}/usr/lib/libtinfo.so.5 fi # 依赖版本 libffi.so.6 if [ -f "${xfce_install}/usr/local/lib/libffi.so.8" ]; then diff --git a/mk_xfce.sh b/mk_xfce.sh index bb234f3..af1bf69 100755 --- a/mk_xfce.sh +++ b/mk_xfce.sh @@ -69,6 +69,7 @@ WAYLANDCORE_SRC_URL=https://wayland.freedesktop.org/releases/wayland-1.20.0.tar. WAYLANDPROT_SRC_URL=https://wayland.freedesktop.org/releases/wayland-protocols-1.25.tar.xz UPOWER_SRC_URL=https://gitlab.freedesktop.org/upower/upower/-/archive/v1.90.0/upower-v1.90.0.tar.gz MESA_SRC_URL=https://gitlab.freedesktop.org/mesa/mesa/-/archive/mesa-20.0.0-rc3/mesa-mesa-20.0.0-rc3.tar.gz +SPICEPROT_SRC_URL=https://gitlab.freedesktop.org/spice/spice-protocol/uploads/cf23e217768affaca44896598bd50f3e/spice-protocol-0.14.2.tar.xz LIBDRM_SRC_URL=https://dri.freedesktop.org/libdrm/libdrm-2.4.110.tar.xz DBUS1_SRC_URL=https://dbus.freedesktop.org/releases/dbus/dbus-1.12.12.tar.gz GSTREAMER_SRC_URL=https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.20.2.tar.xz @@ -142,7 +143,11 @@ FONTUTIL_SRC_URL=https://www.x.org/releases/individual/font/font-util-1.3.3.tar. FONTMISC_SRC_URL=https://www.x.org/releases/individual/font/font-misc-misc-1.1.2.tar.bz2 XF86INPUT_SRC_URL=https://www.x.org/releases/individual/driver/xf86-input-libinput-1.2.1.tar.xz XF86VIDEOVESA_SRC_URL=https://www.x.org/releases/individual/driver/xf86-video-vesa-2.5.0.tar.bz2 +XF86VIDEOQXL_SRC_URL=https://www.x.org/releases/individual/driver/xf86-video-qxl-0.1.5.tar.bz2 +XF86VIDEOAMD_SRC_URL=https://www.x.org/releases/individual/driver/xf86-video-amd-2.7.7.7.tar.bz2 +XF86VIDEOFBDEV_SRC_URL=https://www.x.org/releases/individual/driver/xf86-video-fbdev-0.5.0.tar.bz2 XF86VIDEOVMWARE_SRC_URL=https://www.x.org/releases/individual/driver/xf86-video-vmware-13.3.0.tar.bz2 +XF86VIDEOAMDGPU_SRC_URL=https://www.x.org/releases/individual/driver/xf86-video-amdgpu-21.0.0.tar.bz2 XKBDATA_SRC_URL=https://www.x.org/releases/individual/data/xkbdata-1.0.1.tar.bz2 XKBDCFG_SRC_URL=https://www.x.org/releases/individual/data/xkeyboard-config/xkeyboard-config-2.36.tar.xz @@ -257,9 +262,14 @@ MTDEV_SRC_NAME=$(download_src ${MTDEV_SRC_URL}) LIBEVDEV_SRC_NAME=$(download_src ${LIBEVDEV_SRC_URL}) LIBWACOM_SRC_NAME=$(download_src ${LIBWACOM_SRC_URL}) LIBINPUT_SRC_NAME=$(download_src ${LIBINPUT_SRC_URL}) +SPICEPROT_SRC_NAME=$(download_src ${SPICEPROT_SRC_URL}) XF86INPUT_SRC_NAME=$(download_src ${XF86INPUT_SRC_URL}) XF86VIDEOVESA_SRC_NAME=$(download_src ${XF86VIDEOVESA_SRC_URL}) +XF86VIDEOQXL_SRC_NAME=$(download_src ${XF86VIDEOQXL_SRC_URL}) +XF86VIDEOAMD_SRC_NAME=$(download_src ${XF86VIDEOAMD_SRC_URL}) +XF86VIDEOFBDEV_SRC_NAME=$(download_src ${XF86VIDEOFBDEV_SRC_URL}) XF86VIDEOVMWARE_SRC_NAME=$(download_src ${XF86VIDEOVMWARE_SRC_URL}) +XF86VIDEOAMDGPU_SRC_NAME=$(download_src ${XF86VIDEOAMDGPU_SRC_URL}) DEJAVUFONTS1_SRC_NAME=$(download_src ${DEJAVUFONTS1_SRC_URL}) DEJAVUFONTS2_SRC_NAME=$(download_src ${DEJAVUFONTS2_SRC_URL}) GNOMEICONTHEME_SRC_NAME=$(download_src ${GNOMEICONTHEME_SRC_URL}) @@ -382,9 +392,14 @@ MTDEV_SRC_DIR=$(unzip_src ".tar.bz2" ${MTDEV_SRC_NAME}); echo "unzip ${MTDEV_SRC LIBWACOM_SRC_DIR=$(unzip_src ".tar.xz" ${LIBWACOM_SRC_NAME}); echo "unzip ${LIBWACOM_SRC_NAME} source code" LIBEVDEV_SRC_DIR=$(unzip_src ".tar.xz" ${LIBEVDEV_SRC_NAME}); echo "unzip ${LIBEVDEV_SRC_NAME} source code" LIBINPUT_SRC_DIR=$(unzip_src ".tar.xz" ${LIBINPUT_SRC_NAME}); echo "unzip ${LIBINPUT_SRC_NAME} source code" +SPICEPROT_SRC_DIR=$(unzip_src ".tar.xz" ${SPICEPROT_SRC_NAME}); echo "unzip ${SPICEPROT_SRC_NAME} source code" XF86INPUT_SRC_DIR=$(unzip_src ".tar.xz" ${XF86INPUT_SRC_NAME}); echo "unzip ${XF86INPUT_SRC_NAME} source code" XF86VIDEOVESA_SRC_DIR=$(unzip_src ".tar.bz2" ${XF86VIDEOVESA_SRC_NAME}); echo "unzip ${XF86VIDEOVESA_SRC_NAME} source code" +XF86VIDEOQXL_SRC_DIR=$(unzip_src ".tar.bz2" ${XF86VIDEOQXL_SRC_NAME}); echo "unzip ${XF86VIDEOQXL_SRC_NAME} source code" +XF86VIDEOAMD_SRC_DIR=$(unzip_src ".tar.bz2" ${XF86VIDEOAMD_SRC_NAME}); echo "unzip ${XF86VIDEOAMD_SRC_NAME} source code" +XF86VIDEOFBDEV_SRC_DIR=$(unzip_src ".tar.bz2" ${XF86VIDEOFBDEV_SRC_NAME}); echo "unzip ${XF86VIDEOFBDEV_SRC_NAME} source code" XF86VIDEOVMWARE_SRC_DIR=$(unzip_src ".tar.bz2" ${XF86VIDEOVMWARE_SRC_NAME}); echo "unzip ${XF86VIDEOVMWARE_SRC_NAME} source code" +XF86VIDEOAMDGPU_SRC_DIR=$(unzip_src ".tar.bz2" ${XF86VIDEOAMDGPU_SRC_NAME}); echo "unzip ${XF86VIDEOAMDGPU_SRC_NAME} source code" DEJAVUFONTS1_SRC_DIR=$(unzip_src ".tar.bz2" ${DEJAVUFONTS1_SRC_NAME}); echo "unzip ${DEJAVUFONTS1_SRC_NAME} source code" DEJAVUFONTS2_SRC_DIR=$(unzip_src ".tar.bz2" ${DEJAVUFONTS2_SRC_NAME}); echo "unzip ${DEJAVUFONTS2_SRC_NAME} source code" GNOMEICONTHEME_SRC_DIR=$(unzip_src ".tar.xz" ${GNOMEICONTHEME_SRC_NAME}); echo "unzip ${GNOMEICONTHEME_SRC_NAME} source code" @@ -839,6 +854,8 @@ llvm_build() { common_build fontmisc ${FONTMISC_SRC_DIR} # mtdev ( libinput ) common_build mtdev ${MTDEV_SRC_DIR} + # spice_protocol ( xf86videoqxl 需要 ) + meson_build spice_protocol ${SPICEPROT_SRC_DIR} # libevdev ( libinput ) meson_build libevdev ${LIBEVDEV_SRC_DIR} -Ddocumentation=disabled # libwacom ( libinput ) @@ -849,6 +866,14 @@ llvm_build() { common_build xf86input ${XF86INPUT_SRC_DIR} # xf86videovesa ( vesa是一个支持大部分显卡的通用驱动,不提供任何 2D 和 3D 加速功能 也可以 apt install libgl1-mesa-dri ) common_build xf86videovesa ${XF86VIDEOVESA_SRC_DIR} + # xf86videoamd ( qemu 要模拟 vmware 的显卡,需要编译此工程 -vga vmware ) + # common_build xf86videoamd ${XF86VIDEOAMD_SRC_DIR} + # xf86videoqxl ( 需要: spice_protocol, qemu 要模拟 vmware 的显卡,需要编译此工程 -vga vmware ) + common_build xf86videoqxl ${XF86VIDEOQXL_SRC_DIR} + # xf86videofbdev ( qemu 要模拟 vmware 的显卡,需要编译此工程 -vga vmware ) + common_build xf86videofbdev ${XF86VIDEOFBDEV_SRC_DIR} + # xf86videoamdgpu ( qemu 要模拟 vmware 的显卡,需要编译此工程 -vga vmware ) + common_build xf86videoamdgpu ${XF86VIDEOAMDGPU_SRC_DIR} # xf86videovmware ( qemu 要模拟 vmware 的显卡,需要编译此工程 -vga vmware ) common_build xf86videovmware ${XF86VIDEOVMWARE_SRC_DIR} # gsetting-desktop-schemas @@ -894,6 +919,9 @@ llvm_build() { # 编译 xfce cd ${XFCE_SRC_DIR} + echo "${CYAN}build xfce4 utils${NC}" + sleep 3 + # 必须去掉这个,否则 xfce 编译不过,做的还是有点差,和 gtk+ 的编译还是差一个档次 #unset PKG_CONFIG_SYSROOT_DIR unset PKG_CONFIG_TOP_BUILD_DIR