diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b1c9328 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.iso +catos-iso/airootfs/var/** +catos-iso-for-nvidia/airootfs/var/** diff --git a/catos-iso-for-nvidia/packages.x86_64 b/catos-iso-for-nvidia/packages.x86_64 index 9f6459d..0d1f022 100644 --- a/catos-iso-for-nvidia/packages.x86_64 +++ b/catos-iso-for-nvidia/packages.x86_64 @@ -180,7 +180,7 @@ fwupd gtkmm3 open-vm-tools xf86-input-vmmouse -xf86-video-vmware +#xf86-video-vmware ####################################################### #nvidia #docker @@ -228,3 +228,10 @@ corekeyboard system-config-printer catos-fix-storage tela-icon-theme-git +gparted + +xf86-video-amdgpu +vulkan-radeon +lib32-vulkan-radeon +vulkan-intel +lib32-vulkan-intel \ No newline at end of file diff --git a/catos-iso/airootfs/etc/mkinitcpio.conf b/catos-iso/airootfs/etc/mkinitcpio.conf index 8e23672..b478731 100644 --- a/catos-iso/airootfs/etc/mkinitcpio.conf +++ b/catos-iso/airootfs/etc/mkinitcpio.conf @@ -49,7 +49,7 @@ FILES=() # ## NOTE: If you have /usr on a separate partition, you MUST include the # usr, fsck and shutdown hooks. -HOOKS=(base udev modconf kms memdisk archiso archiso_loop_mnt archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs block filesystems keyboard) +HOOKS=(base microcode udev modconf kms memdisk archiso archiso_loop_mnt archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs block filesystems keyboard) # COMPRESSION # Use this to compress the initramfs image. By default, gzip compression diff --git a/catos-iso/airootfs/etc/modprobe.d/nvidia-loader.conf b/catos-iso/airootfs/etc/modprobe.d/nvidia-loader.conf new file mode 100644 index 0000000..9b7e518 --- /dev/null +++ b/catos-iso/airootfs/etc/modprobe.d/nvidia-loader.conf @@ -0,0 +1,6 @@ +# Forwards all NVIDIA module load requests to a "smart" loader that selects +# correct version of the module depending on used hardware. +install nvidia /usr/local/bin/nvidia-module-loader +install nvidia_drm /usr/local/bin/nvidia-module-loader +install nvidia_uvm /usr/local/bin/nvidia-module-loader +install nvidia_modeset /usr/local/bin/nvidia-module-loader diff --git a/catos-iso/airootfs/etc/motd b/catos-iso/airootfs/etc/motd deleted file mode 100644 index 4d9eda1..0000000 --- a/catos-iso/airootfs/etc/motd +++ /dev/null @@ -1,11 +0,0 @@ -To install Arch Linux follow the installation guide: -https://wiki.archlinux.org/title/Installation_guide - -For Wi-Fi, authenticate to the wireless network using the iwctl utility. -For mobile broadband (WWAN) modems, connect with the mmcli utility. -Ethernet, WLAN and WWAN interfaces using DHCP should work automatically. - -After connecting to the internet, the installation guide can be accessed -via the convenience script Installation_guide. - -                                           diff --git a/catos-iso/airootfs/etc/skel/.config/baloofileinformationrc b/catos-iso/airootfs/etc/skel/.config/baloofileinformationrc deleted file mode 100644 index 6d1c1d4..0000000 --- a/catos-iso/airootfs/etc/skel/.config/baloofileinformationrc +++ /dev/null @@ -1,34 +0,0 @@ -[Misc] -version=13 - -[Show] -channels=false -comment=false -contentCreated=false -contentSize=false -created=false -depends=false -embeddedRating=false -fileName=false -fileSize=false -height=false -kfileitem#group=false -kfileitem#owner=false -kfileitem#permissions=false -lastModified=false -lyrics=false -mimeType=false -photoGpsLatitude=false -photoGpsLongitude=false -photoMeteringMode=false -photoPixelXDimension=false -photoPixelYDimension=false -photoSaturation=false -photoSharpness=false -photoWhiteBalance=false -replayGainAlbumGain=false -replayGainAlbumPeak=false -replayGainTrackGain=false -replayGainTrackPeak=false -url=false -width=false diff --git a/catos-iso/airootfs/etc/skel/.config/baloofilerc b/catos-iso/airootfs/etc/skel/.config/baloofilerc deleted file mode 100644 index efa6de4..0000000 --- a/catos-iso/airootfs/etc/skel/.config/baloofilerc +++ /dev/null @@ -1,7 +0,0 @@ -[Basic Settings] -Indexing-Enabled=false - -[General] -dbVersion=2 -exclude filters=*~,*.part,*.o,*.la,*.lo,*.loT,*.moc,moc_*.cpp,qrc_*.cpp,ui_*.h,cmake_install.cmake,CMakeCache.txt,CTestTestfile.cmake,libtool,config.status,confdefs.h,autom4te,conftest,confstat,Makefile.am,*.gcode,.ninja_deps,.ninja_log,build.ninja,*.csproj,*.m4,*.rej,*.gmo,*.pc,*.omf,*.aux,*.tmp,*.po,*.vm*,*.nvram,*.rcore,*.swp,*.swap,lzo,litmain.sh,*.orig,.histfile.*,.xsession-errors*,*.map,*.so,*.a,*.db,*.qrc,*.ini,*.init,*.img,*.vdi,*.vbox*,vbox.log,*.qcow2,*.vmdk,*.vhd,*.vhdx,*.sql,*.sql.gz,*.ytdl,*.class,*.pyc,*.pyo,*.elc,*.qmlc,*.jsc,*.fastq,*.fq,*.gb,*.fasta,*.fna,*.gbff,*.faa,po,CVS,.svn,.git,_darcs,.bzr,.hg,CMakeFiles,CMakeTmp,CMakeTmpQmake,.moc,.obj,.pch,.uic,.npm,.yarn,.yarn-cache,__pycache__,node_modules,node_packages,nbproject,.venv,venv,core-dumps,lost+found -exclude filters version=8 diff --git a/catos-iso/airootfs/etc/skel/.config/fcitx5/conf/classicui.conf b/catos-iso/airootfs/etc/skel/.config/fcitx5/conf/classicui.conf deleted file mode 100644 index 52219fe..0000000 --- a/catos-iso/airootfs/etc/skel/.config/fcitx5/conf/classicui.conf +++ /dev/null @@ -1,35 +0,0 @@ -# 垂直候选列表 -Vertical Candidate List=False -# 使用鼠标滚轮翻页 -WheelForPaging=True -# 字体 -Font="Sans 10" -# 菜单字体 -MenuFont="Sans 10" -# 托盘字体 -TrayFont="Sans Bold 10" -# 托盘标签轮廓颜色 -TrayOutlineColor=#000000 -# 托盘标签文本颜色 -TrayTextColor=#ffffff -# 优先使用文字图标 -PreferTextIcon=False -# 在图标中显示布局名称 -ShowLayoutNameInIcon=True -# 使用输入法的语言来显示文字 -UseInputMethodLanguageToDisplayText=True -# 主题 -Theme=群青 -# 深色主题 -DarkTheme=群青 -# 跟随系统浅色/深色设置 -UseDarkTheme=False -# 当被主题和桌面支持时使用系统的重点色 -UseAccentColor=True -# 在 X11 上针对不同屏幕使用单独的 DPI -PerScreenDPI=False -# 固定 Wayland 的字体 DPI -ForceWaylandDPI=0 -# 在 Wayland 下启用分数缩放 -EnableFractionalScale=True - diff --git a/catos-iso/airootfs/etc/skel/.config/fcitx5/config b/catos-iso/airootfs/etc/skel/.config/fcitx5/config deleted file mode 100644 index 620c871..0000000 --- a/catos-iso/airootfs/etc/skel/.config/fcitx5/config +++ /dev/null @@ -1,79 +0,0 @@ -[Hotkey] -# 反复按切换键时进行轮换 -EnumerateWithTriggerKeys=True -# 临时在当前和第一个输入法之间切换 -AltTriggerKeys= -# 轮换输入法时跳过第一个输入法 -EnumerateSkipFirst=False - -[Hotkey/TriggerKeys] -0=Shift+Shift_L - - -[Hotkey/EnumerateForwardKeys] -0=Control+space - -[Hotkey/EnumerateBackwardKeys] -0=Control+Shift+space - -[Hotkey/EnumerateGroupForwardKeys] -0=Super+space - -[Hotkey/EnumerateGroupBackwardKeys] -0=Shift+Super+space - -[Hotkey/ActivateKeys] -0=Hangul_Hanja - -[Hotkey/DeactivateKeys] -0=Hangul_Romaja - -[Hotkey/PrevPage] -0=Up - -[Hotkey/NextPage] -0=Down - -[Hotkey/PrevCandidate] -0=Shift+Tab - -[Hotkey/NextCandidate] -0=Tab - -[Hotkey/TogglePreedit] -0=Control+Alt+P - -[Behavior] -# 默认状态为激活 -ActiveByDefault=False -# 共享输入状态 -ShareInputState=No -# 在程序中显示预编辑文本 -PreeditEnabledByDefault=True -# 切换输入法时显示输入法信息 -ShowInputMethodInformation=True -# 在焦点更改时显示输入法信息 -showInputMethodInformationWhenFocusIn=False -# 显示紧凑的输入法信息 -CompactInputMethodInformation=True -# 显示第一个输入法的信息 -ShowFirstInputMethodInformation=True -# 默认页大小 -DefaultPageSize=5 -# 覆盖 Xkb 选项 -OverrideXkbOption=False -# 自定义 Xkb 选项 -CustomXkbOption= -# Force Enabled Addons -EnabledAddons= -# Force Disabled Addons -DisabledAddons= -# Preload input method to be used by default -PreloadInputMethod=True -# 允许在密码框中使用输入法 -AllowInputMethodForPassword=False -# 输入密码时显示预编辑文本 -ShowPreeditForPassword=False -# 保存用户数据的时间间隔(以分钟为单位) -AutoSavePeriod=30 - diff --git a/catos-iso/airootfs/etc/skel/.config/konsolerc b/catos-iso/airootfs/etc/skel/.config/konsolerc deleted file mode 100644 index 1538a93..0000000 --- a/catos-iso/airootfs/etc/skel/.config/konsolerc +++ /dev/null @@ -1,30 +0,0 @@ -1280x720 screen: Height=613 -1280x720 screen: Width=853 -1280x720 screen: XPosition=265 -1280x720 screen: YPosition=57 -MenuBar=Disabled -State=AAAA/wAAAAD9AAAAAQAAAAAAAAAAAAAAAPwCAAAAAvsAAAAiAFEAdQBpAGMAawBDAG8AbQBtAGEAbgBkAHMARABvAGMAawAAAAAA/////wAAAXwBAAAD+wAAABwAUwBTAEgATQBhAG4AYQBnAGUAcgBEAG8AYwBrAAAAAAD/////AAABFQEAAAMAAANVAAACNwAAAAQAAAAEAAAACAAAAAj8AAAAAQAAAAIAAAACAAAAFgBtAGEAaQBuAFQAbwBvAGwAQgBhAHIBAAAAAP////8AAAAAAAAAAAAAABwAcwBlAHMAcwBpAG8AbgBUAG8AbwBsAGIAYQByAQAAAO3/////AAAAAAAAAAA= -eDP-1=eDP-1 - -[Desktop Entry] -DefaultProfile=CatOS.profile - -[General] -ConfigVersion=1 - -[MainWindow] -1280x720 screen: Height=613 -1280x720 screen: Width=853 -1280x720 screen: XPosition=213 -1280x720 screen: YPosition=49 -1536x864 screen: Height=524 -1536x864 screen: Width=911 -1536x864 screen: XPosition=350 -1536x864 screen: YPosition=160 -RestorePositionForNextInstance=false -State=AAAA/wAAAAD9AAAAAQAAAAAAAAAAAAAAAPwCAAAAAvsAAAAiAFEAdQBpAGMAawBDAG8AbQBtAGEAbgBkAHMARABvAGMAawAAAAAA/////wAAAXwBAAAD+wAAABwAUwBTAEgATQBhAG4AYQBnAGUAcgBEAG8AYwBrAAAAAAD/////AAABFQEAAAMAAANVAAACNwAAAAQAAAAEAAAACAAAAAj8AAAAAQAAAAIAAAACAAAAFgBtAGEAaQBuAFQAbwBvAGwAQgBhAHIBAAAAAP////8AAAAAAAAAAAAAABwAcwBlAHMAcwBpAG8AbgBUAG8AbwBsAGIAYQByAQAAASH/////AAAAAAAAAAA= -ToolBarsMovable=Disabled -eDP-1=eDP-1 - -[UiSettings] -ColorScheme= diff --git a/catos-iso/airootfs/etc/skel/.config/ktimezonedrc b/catos-iso/airootfs/etc/skel/.config/ktimezonedrc deleted file mode 100644 index e7daac7..0000000 --- a/catos-iso/airootfs/etc/skel/.config/ktimezonedrc +++ /dev/null @@ -1,4 +0,0 @@ -[TimeZones] -LocalZone=Asia/Shanghai -ZoneinfoDir=/usr/share/zoneinfo -Zonetab=/usr/share/zoneinfo/zone.tab diff --git a/catos-iso/airootfs/etc/skel/.config/kwalletrc b/catos-iso/airootfs/etc/skel/.config/kwalletrc deleted file mode 100644 index bc07dcc..0000000 --- a/catos-iso/airootfs/etc/skel/.config/kwalletrc +++ /dev/null @@ -1,15 +0,0 @@ -[Wallet] -Close When Idle=false -Close on Screensaver=false -Default Wallet=kdewallet -Enabled=false -First Use=false -Idle Timeout=10 -Launch Manager=false -Leave Manager Open=false -Leave Open=true -Prompt on Open=false -Use One Wallet=true - -[org.freedesktop.secrets] -apiEnabled=true diff --git a/catos-iso/airootfs/etc/skel/.config/kwinrc b/catos-iso/airootfs/etc/skel/.config/kwinrc deleted file mode 100644 index 67e5b44..0000000 --- a/catos-iso/airootfs/etc/skel/.config/kwinrc +++ /dev/null @@ -1,4 +0,0 @@ - -[org.kde.kdecoration2] -BorderSize=None -BorderSizeAuto=false diff --git a/catos-iso/airootfs/etc/skel/.local/share/applications/StarCatOS.desktop b/catos-iso/airootfs/etc/skel/.local/share/applications/StarCatOS.desktop deleted file mode 100755 index 2eec2dc..0000000 --- a/catos-iso/airootfs/etc/skel/.local/share/applications/StarCatOS.desktop +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env xdg-open -[Desktop Entry] -Encoding=UTF-8 -Name=Star CatOS -Comment=Star CatOS -Exec=xdg-open https://github.com/CatOS-Home/CatOS -Icon=catos -Terminal=false -Type=Application -Categories=Network; diff --git a/catos-iso/airootfs/etc/skel/.local/share/konsole/CatOS.profile b/catos-iso/airootfs/etc/skel/.local/share/konsole/CatOS.profile deleted file mode 100644 index a97c3cc..0000000 --- a/catos-iso/airootfs/etc/skel/.local/share/konsole/CatOS.profile +++ /dev/null @@ -1,11 +0,0 @@ -[Appearance] -Font=JetBrains Mono,12,-1,5,75,0,0,0,0,0,Bold -TabColor=156,133,245 - -[Cursor Options] -CursorShape=2 - -[General] -Command=/bin/fish -Name=CatOS -Parent=FALLBACK/ diff --git a/catos-iso/airootfs/root/customize_airootfs.sh b/catos-iso/airootfs/root/customize_airootfs.sh index bc13aa8..239e60e 100755 --- a/catos-iso/airootfs/root/customize_airootfs.sh +++ b/catos-iso/airootfs/root/customize_airootfs.sh @@ -4,81 +4,6 @@ set -e -u -## -------------------------------------------------------------- ## - -## lsb-release -rm /etc/lsb-release -touch /etc/catos-lsb-release -ln -s /etc/catos-lsb-release /etc/lsb-release -cat > "/etc/lsb-release" <<- _EOF_ - DISTRIB_ID="CatOS" - - DISTRIB_RELEASE="rolling" - DISTRIB_DESCRIPTION="CatOS" - -_EOF_ - -## -------------------------------------------------------------- ## - -## -------------------------------------------------------------- ## - -## /etc/os-release -rm /etc/os-release -touch catos-os-release -ln -s /etc/catos-os-release /etc/os-release -cat > "/etc/os-release" <<- _EOF_ - NAME="CatOS" - PRETTY_NAME="CatOS" - ID=catos - BUILD_ID=rolling - ANSI_COLOR="38;2;23;147;209" - HOME_URL="https://github.com/CatOS-Home/CatOS" - DOCUMENTATION_URL="https://github.com/CatOS-Home/CatOS" - SUPPORT_URL="https://github.com/CatOS-Home/CatOS" - BUG_REPORT_URL="https://github.com/CatOS-Home/CatOS" - PRIVACY_POLICY_URL="https://github.com/CatOS-Home/CatOS" - LOGO=catos - -_EOF_ - -## -------------------------------------------------------------- ## - -## -------------------------------------------------------------- ## - -## /etc/issue -rm /etc/issue -touch /etc/catos-issue -ln -s /etc/catos-issue /etc/issue -cat > "/etc/issue" <<- _EOF_ - CatOS \r (\l) - -_EOF_ - -## -------------------------------------------------------------- ## - -## -------------------------------------------------------------- ## - -## /etc/motd -rm /etc/motd -touch /etc/catos-motd -ln -s /etc/catos-motd /etc/motd -cat > "/etc/motd" <<- _EOF_ -To install Cat OS follow the installation guide: -https://wiki.archlinux.org/title/Installation_guide - -For Wi-Fi, authenticate to the wireless network using the iwctl utility. -For mobile broadband (WWAN) modems, connect with the mmcli utility. -Ethernet, WLAN and WWAN interfaces using DHCP should work automatically. - -After connecting to the internet, the installation guide can be accessed -via the convenience script Installation_guide. - -                                           - -_EOF_ - -## -------------------------------------------------------------- ## - ## -------------------------------------------------------------- ## ## 更换国内源 echo 'Server = https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist @@ -96,6 +21,9 @@ echo "CatOS" > /etc/hostname ## -------------------------------------------------------------- ## ## -------------------------------------------------------------- ## +## 修改pacman.conf +sed -i 's/Color/Color\nILoveCandy/' /etc/pacman.conf + ### 开启multilib仓库支持 echo '[multilib]' >> /etc/pacman.conf echo 'Include = /etc/pacman.d/mirrorlist' >> /etc/pacman.conf @@ -104,7 +32,8 @@ echo ' ' >> /etc/pacman.conf echo '[archlinuxcn]' >> /etc/pacman.conf echo 'SigLevel = Never' >> /etc/pacman.conf echo 'Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch' >> /etc/pacman.conf - +echo 'Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch' >> /etc/pacman.conf +echo 'Server = https://mirror.nju.edu.cn/archlinuxcn/$arch' >> /etc/pacman.conf ## -------------------------------------------------------------- ## @@ -112,6 +41,8 @@ echo 'Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch' >> /etc/pacman.con echo '[arch4edu]' >> /etc/pacman.conf echo 'SigLevel = Never' >> /etc/pacman.conf echo 'Server = https://mirrors.cernet.edu.cn/arch4edu/$arch' >> /etc/pacman.conf +echo 'Server = https://mirrors.tuna.tsinghua.edu.cn/arch4edu/$arch' >> /etc/pacman.conf +echo 'Server = https://mirror.nju.edu.cn/arch4edu/$arch' >> /etc/pacman.conf ## -------------------------------------------------------------- ## @@ -122,6 +53,13 @@ echo 'Server = https://pkgs.catos.info/$arch' >> /etc/pacman.conf ## -------------------------------------------------------------- ## +## 增加catos-extra源 +echo '[catos-extra]' >> /etc/pacman.conf +echo 'SigLevel = Never' >> /etc/pacman.conf +echo 'Server = file:///var/catos-extra/' >> /etc/pacman.conf + +## -------------------------------------------------------------- ## + #pip install questionary #设置时区 ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime @@ -188,10 +126,6 @@ echo 'GRUB_DISABLE_OS_PROBER=false' >> /etc/default/grub ###修改plymounth默认主题为catos /usr/share/plymouth/plymouthd.defaults #sed -i 's/bgrt/catos/g' /usr/share/plymouth/plymouthd.defaults - -##default icon -#sed -i 's/start-here-kde/\/usr\/share\/icons\/catos\/catos.svg/g' /usr/share/plasma/plasmoids/org.kde.plasma.kickoff/contents/config/main.xml -sed -i 's/start-here-kde-symbolic/catos/g' /usr/share/plasma/plasmoids/org.kde.plasma.kickoff/contents/config/main.xml ###sddm #sed -i 's:Current=.*:Current=sugar-candy-catos:g' /etc/sddm.conf.d/kde_settings.conf diff --git a/catos-iso/airootfs/usr/local/bin/nvidia-module-loader b/catos-iso/airootfs/usr/local/bin/nvidia-module-loader new file mode 100755 index 0000000..531b125 --- /dev/null +++ b/catos-iso/airootfs/usr/local/bin/nvidia-module-loader @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# Quick pass if one of the modules is already loaded. +if [[ -e /sys/module/nvidia || -e /sys/module/nouveau ]]; then + exit 0 +fi + +# Using "install" in modprobe seems to result in no dependency resolving for +# modules, so we have to manually set the order in which all modules are loaded +# at once. +load_nvidia_modules() { + local pkgname="$1" + + # Load some basic dependencies of nvidia modules + modprobe video + modprobe drm_ttm_helper + modprobe drm_kms_helper + + for module in nvidia nvidia-modeset nvidia-drm nvidia-uvm; do + modprobe --ignore-install "/usr/share/modules/${pkgname}/${module}.ko.zst" + done +} + +# Load compatible version of NVIDIA modules for current hardware +if chwd --list | awk '{ if($2 == "nouveau" || $2 == "nvidia-dkms-390xx" || $2 == "nvidia-dkms-470xx") f=1 } END {exit (f == 1) ? 0 : 1 }'; then + modprobe nouveau +elif chwd --list | awk '{ if($2 == "nvidia-dkms") f=1 } END {exit (f == 1) ? 0 : 1 }'; then + load_nvidia_modules nvidia +elif chwd --list | awk '{ if($2 == "nvidia-open-dkms") f=1 } END {exit (f == 1) ? 0 : 1 }'; then + load_nvidia_modules nvidia-open +fi + +# Otherwise, do a fallback to nouveau anyway +if [[ ! -e /sys/module/nouveau && ! -e /sys/module/nvidia ]]; then + modprobe nouveau +fi diff --git a/catos-iso/airootfs/usr/local/bin/remove-nvidia b/catos-iso/airootfs/usr/local/bin/remove-nvidia new file mode 100755 index 0000000..88f79b4 --- /dev/null +++ b/catos-iso/airootfs/usr/local/bin/remove-nvidia @@ -0,0 +1,48 @@ +#!/bin/bash + +_remove_pacman_package() { + local _pkgname="$1" + pacman -Rsnc "$_pkgname" --noconfirm || true +} + +# remove pkgs installed for VMs +_clean_vm_packages() { + + #remove virtualbox + if pacman -Qi virtualbox-guest-utils &> /dev/null; then + systemctl disable vboxservice.service + _remove_pacman_package virtualbox-guest-utils + fi + + if pacman -Qi virtualbox-guest-utils-nox &> /dev/null; then + systemctl disable vboxservice.service + _remove_pacman_package virtualbox-guest-utils-nox + fi + + #remove vmware + if [ -f /etc/xdg/autostart/vmware-user.desktop ]; then + rm /etc/xdg/autostart/vmware-user.desktop + fi + + if pacman -Qi open-vm-tools &> /dev/null; then + systemctl disable vmtoolsd.service + _remove_pacman_package open-vm-tools + fi + + if [ -f /etc/systemd/system/multi-user.target.wants/vmtoolsd.service ]; then + rm /etc/systemd/system/multi-user.target.wants/vmtoolsd.service + fi + + #remove qemu + if pacman -Qi qemu-guest-agent &> /dev/null; then + systemctl disable qemu-guest-agent.service + _remove_pacman_package qemu-guest-agent + fi +} + +_check_not_running_vm="$(systemd-detect-virt | grep -q 'none'; echo $?)" +if [[ "${_check_not_running_vm}" -eq 0 ]]; then + _clean_vm_packages +fi + +# vim:set ft=bash sw=2 sts=2 et: diff --git a/catos-iso/airootfs/usr/local/bin/removeun b/catos-iso/airootfs/usr/local/bin/removeun new file mode 100755 index 0000000..de37fc5 --- /dev/null +++ b/catos-iso/airootfs/usr/local/bin/removeun @@ -0,0 +1,51 @@ +#!/bin/bash +#set -e + +_clean_files() { +local _files_to_remove=( + /usr/local/bin/choose-mirror + /usr/local/bin/prepare-live-desktop.sh + /usr/local/bin/removeun-online + /usr/local/share/livecd-sound +) + + local xx + for xx in "${_files_to_remove[@]}"; do rm -rf "$xx" || true; done +} + +_clean_packages() { +local _packages_to_remove=( + gparted + catos-calamares + catos-calamares-config + edk2-shell + gpart + arch-install-scripts + squashfs-tools + syslinux + clonezilla + memtest86+ + memtest86+-efi + mkinitcpio-archiso + tcpdump +) + + local _check_nvidia_card="$(chwd --is_nvidia_card | grep -q 'NVIDIA card found!'; echo $?)" + if [[ "${_check_nvidia_card}" -ne 0 ]]; then + echo "No NVIDIA card detected. Removing nvidia drivers" + _packages_to_remove+=(nvidia-module-extractor nvidia-utils egl-wayland) + _files_to_remove+=(/usr/local/bin/nvidia-module-loader + /etc/modprobe.d/nvidia-loader.conf + ) + fi + + local xx + # @ does one by one to avoid errors in the entire process + # taken from Erik Dubois script + for xx in "${_packages_to_remove[@]}"; do pacman -Rsnc "$xx" --noconfirm; done +} + +_clean_packages +_clean_files + +# vim:set ft=bash sw=2 sts=2 et: diff --git a/catos-iso/efiboot/loader/entries/01-archiso-x86_64-linux.conf b/catos-iso/efiboot/loader/entries/01-archiso-x86_64-linux.conf index a481ebc..ff249d2 100644 --- a/catos-iso/efiboot/loader/entries/01-archiso-x86_64-linux.conf +++ b/catos-iso/efiboot/loader/entries/01-archiso-x86_64-linux.conf @@ -1,7 +1,5 @@ title Cat OS install medium (x86_64, UEFI) sort-key 01 linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux -initrd /%INSTALL_DIR%/boot/intel-ucode.img -initrd /%INSTALL_DIR%/boot/amd-ucode.img initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img options archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% copytoram=no diff --git a/catos-iso/efiboot/loader/entries/02-archiso-x86_64-speech-linux.conf b/catos-iso/efiboot/loader/entries/02-archiso-x86_64-speech-linux.conf index b8e39d4..4ee44ec 100644 --- a/catos-iso/efiboot/loader/entries/02-archiso-x86_64-speech-linux.conf +++ b/catos-iso/efiboot/loader/entries/02-archiso-x86_64-speech-linux.conf @@ -1,7 +1,5 @@ title Cat OS install medium (x86_64, UEFI) with speech sort-key 02 linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux -initrd /%INSTALL_DIR%/boot/intel-ucode.img -initrd /%INSTALL_DIR%/boot/amd-ucode.img initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img options archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% accessibility=on copytoram=no diff --git a/catos-iso/grub/grub.cfg b/catos-iso/grub/grub.cfg index 612ddc6..25f5d6d 100644 --- a/catos-iso/grub/grub.cfg +++ b/catos-iso/grub/grub.cfg @@ -26,7 +26,7 @@ timeout=15 timeout_style=menu # GRUB init tune for accessibility -play 600 988 1 1319 4 +# play 600 988 1 1319 4 # Menu entries @@ -34,14 +34,21 @@ menuentry "CatOS install medium (x86_64, UEFI)" --class arch --class gnu-linux - set gfxpayload=keep search --no-floppy --set=root --label %ARCHISO_LABEL% linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% copytoram=no cow_spacesize=1G - initrd /%INSTALL_DIR%/boot/intel-ucode.img /%INSTALL_DIR%/boot/amd-ucode.img /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img + initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img +} + +menuentry "CatOS install medium (x86_64, UEFI) Legacy Hardware (GPU nomodeset)" --class arch --class gnu-linux --class gnu --class os --id 'archlinux' { + set gfxpayload=keep + search --no-floppy --set=root --label %ARCHISO_LABEL% + linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% copytoram=no cow_spacesize=1G module_blacklist=nvidia,nvidia_modeset,nvidia_uvm,nvidia_drm nomodeset + initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img } menuentry "CatOS install medium with speakup screen reader (x86_64, UEFI)" --hotkey s --class arch --class gnu-linux --class gnu --class os --id 'archlinux-accessibility' { set gfxpayload=keep search --no-floppy --set=root --label %ARCHISO_LABEL% linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% accessibility=on copytoram=no cow_spacesize=1G - initrd /%INSTALL_DIR%/boot/intel-ucode.img /%INSTALL_DIR%/boot/amd-ucode.img /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img + initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img } if [ "${grub_platform}" == "efi" ]; then diff --git a/catos-iso/packages.x86_64 b/catos-iso/packages.x86_64 index 9fc386b..c33eedd 100644 --- a/catos-iso/packages.x86_64 +++ b/catos-iso/packages.x86_64 @@ -1,24 +1,48 @@ alsa-utils amd-ucode -arch-install-scripts archinstall +arch-install-scripts +archlinux-appstream-data +ark b43-fwcutter base +base-devel bind +bluedevil +bluez brltty broadcom-wl btrfs-progs +catos-branding +catos-calamares +catos-calamares-config +catos-fcitx5-themes +catos-fix-storage +catos-folder-color +catos-grub-theme-dark +catos-how +catos-html-wallpaper +catos-kde-settings +catos-kde-theme +catos-label +catos-linuxbox +catos-ocr +catos-qrcode +catos-shortcut +catos-software-center +catos-wallpaper-effects clonezilla -#cloud-init +corekeyboard cryptsetup darkhttpd ddrescue -dhclient dhcpcd diffutils +distrobox dmidecode dmraid dnsmasq +dolphin dosfstools e2fsprogs edk2-shell @@ -26,31 +50,58 @@ efibootmgr espeakup ethtool exfatprogs +eza f2fs-tools +fastfetch fatresize +fcitx5-chinese-addons +fcitx5-im +fcitx5-material-color +fcitx5-pinyin-moegirl +fcitx5-pinyin-zhwiki +firefox +firefox-i18n-zh-cn +fish +flatpak fsarchiver -gnu-netcat +fwupd gpart +gparted gpm gptfdisk grml-zsh-config grub +gtkmm3 +gwenview hdparm hyperv +imagemagick intel-ucode irssi iw iwd jfsutils +kate +kdeconnect +kdialog +ki18n5 +kio-admin kitty-terminfo +konsole +kwalletmanager +kwin-decoration-sierra-breeze-enhanced-for-catos less lftp +lib32-mesa +lib32-vulkan-intel +lib32-vulkan-radeon libfido2 libusb-compat linux linux-atm linux-firmware linux-firmware-marvell +linux-headers livecd-sounds lsscsi lvm2 @@ -61,181 +112,99 @@ mc mdadm memtest86+ memtest86+-efi +mesa mkinitcpio mkinitcpio-archiso mkinitcpio-nfs-utils modemmanager mtools -#nano +nano nbd ndisc6 nfs-utils nilfs-utils nmap +noto-fonts-emoji ntfs-3g nvme-cli -open-iscsi -open-vm-tools +ocs-url +octopi +okular openconnect +open-iscsi openssh +open-vm-tools openvpn +os-prober partclone parted partimage pcsclite +plasma +plasma6-applets-panel-colorizer +podman +power-profiles-daemon ppp pptpclient pv +python-pip qemu-guest-agent +qt6-virtualkeyboard refind -#reflector -#reiserfsprogs rp-pppoe rsync rxvt-unicode-terminfo screen +sddm sdparm sg3_utils smartmontools sof-firmware +spectacle squashfs-tools sudo syslinux +system-config-printer systemd-resolvconf tcpdump +tela-icon-theme-git terminus-font testdisk +timeshift tmux tpm2-tss +ttf-jetbrains-mono +ttf-jetbrains-mono-nerd udftools +unrar usb_modeswitch usbmuxd usbutils vim -#virtualbox-guest-utils-nox # Replaced with virtualbox-guest-utils below +virtualbox-guest-utils vpnc +vulkan-intel +vulkan-radeon wireless-regdb wireless_tools wpa_supplicant +wqy-zenhei wvdial +xf86-input-vmmouse +xf86-video-amdgpu +xf86-input-elographics +xf86-input-evdev +xf86-input-libinput +xf86-input-synaptics +xf86-input-vmmouse +xf86-input-void +xf86-video-amdgpu +xf86-video-fbdev +xf86-video-qxl xfsprogs xl2tpd -zsh - -# everything above comes from archiso releng folder -####################################################### -### Cat OS ### -####################################################### -base-devel -python-pip yay -plasma -#plasma-wayland-session -konsole -dolphin -kate -sddm -wqy-zenhei -ark -okular -firefox -firefox-i18n-zh-cn -gwenview -fish -kwalletmanager -ttf-jetbrains-mono -imagemagick -#catos-aurorae -#papirus-icon-theme -catos-theme -catos-theme2 -#catos-plasmoids -#catos-services -#grub-theme-vimix-color-1080p-git -catos-grub-theme-dark -#klassy -#os-prober -linux-headers -kdialog -timeshift -octopi -unrar -kio-admin -kdeconnect -#catos-pkghello -spectacle -catos-ocr -catos-qrcode -catos-folder-color -catos-shortcut -catos-wallpaper-effects -catos-label -catos-fcitx5-themes -####################kde discover########################### -archlinux-appstream-data -packagekit-qt5 -#packagekit-qt6 -flatpak -fwupd -#######################vmware########################## -#gtkmm -#gtkmm3 -#open-vm-tools -#xf86-input-vmmouse -#xf86-video-vmware -####################################################### -#nvidia -#docker -######################fcitx5############################ -fcitx5-im -fcitx5-chinese-addons -fcitx5-pinyin-moegirl -fcitx5-pinyin-zhwiki -fcitx5-material-color -noto-fonts-emoji -####################################################### -catos-calamares -#alci-calamares -catos-calamares-config -####################Linux Box########################### -podman -distrobox -catos-linuxbox -catos-how -################Fix kde discover ############ -ocs-url -#qt5 -##kde6 -power-profiles-daemon -#panel custom -plasma6-applets-panel-colorizer -catos-html-wallpaper -kwin-decoration-sierra-breeze-enhanced-for-catos -#######bluetooth######## -bluez -bluedevil -#catos software center -ki18n5 -catos-software-center - -# =============== -# VM - VMware -# =========== -xf86-input-vmmouse -xf86-video-vmware -open-vm-tools -gtkmm3 - -# =============== -# VM - VirtualBox -# =============== -virtualbox-guest-utils - -# virtual keyboard -qt6-virtualkeyboard -corekeyboard - -system-config-printer -os-prober -tela-icon-theme-git -catos-fix-storage +zsh +chwd +nvidia-utils +nvidia-module-extractor diff --git a/catos-iso/pacman.conf b/catos-iso/pacman.conf index d78fff4..b7fa8b7 100644 --- a/catos-iso/pacman.conf +++ b/catos-iso/pacman.conf @@ -31,6 +31,7 @@ Architecture = auto # Misc options #UseSyslog Color +ILoveCandy #NoProgressBar # We cannot check disk space from within a chroot environment #CheckSpace @@ -86,8 +87,8 @@ Include = /etc/pacman.d/mirrorlist #[multilib-testing] #Include = /etc/pacman.d/mirrorlist -#[multilib] -#Include = /etc/pacman.d/mirrorlist +[multilib] +Include = /etc/pacman.d/mirrorlist # An example of a custom package repository. See the pacman manpage for # tips on creating your own repositories. @@ -97,15 +98,20 @@ Include = /etc/pacman.d/mirrorlist [archlinuxcn] SigLevel = Never Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch +Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch +Server = https://mirror.nju.edu.cn/archlinuxcn/$arch [arch4edu] SigLevel = Never Server = https://mirrors.cernet.edu.cn/arch4edu/$arch +Server = https://mirrors.tuna.tsinghua.edu.cn/arch4edu/$arch +Server = https://mirror.nju.edu.cn/arch4edu/$arch -[catos] +[catos-extra] SigLevel = Never -Server = https://pkgs.catos.info/$arch - - +Server = file:///var/catos-extra +[catos] +SigLevel = Never +Server = https://pkgs.catos.info/$arch \ No newline at end of file diff --git a/catos-iso/profiledef.sh b/catos-iso/profiledef.sh index 74ea97e..d157271 100644 --- a/catos-iso/profiledef.sh +++ b/catos-iso/profiledef.sh @@ -8,13 +8,11 @@ iso_application="CatOS Live/Rescue CD" iso_version="$(date +%Y.%m.%d)" install_dir="arch" buildmodes=('iso') -bootmodes=('bios.syslinux.mbr' 'bios.syslinux.eltorito' - 'uefi-ia32.grub.esp' 'uefi-x64.grub.esp' - 'uefi-ia32.grub.eltorito' 'uefi-x64.grub.eltorito') +bootmodes=('bios.syslinux' 'uefi.grub') arch="x86_64" pacman_conf="pacman.conf" airootfs_image_type="squashfs" -#airootfs_image_tool_options=('-comp' 'xz' '-Xbcj' 'x86' '-b' '1M' '-Xdict-size' '1M') +# airootfs_image_tool_options=('-comp' 'xz' '-Xbcj' 'x86' '-b' '1M' '-Xdict-size' '1M') airootfs_image_tool_options=('-comp' 'zstd') file_permissions=( ["/etc/shadow"]="0:0:400" @@ -23,4 +21,7 @@ file_permissions=( ["/usr/local/bin/choose-mirror"]="0:0:755" ["/usr/local/bin/Installation_guide"]="0:0:755" ["/usr/local/bin/livecd-sound"]="0:0:755" + ["/usr/local/bin/nvidia-module-loader"]="0:0:755" + ["/usr/local/bin/remove-nvidia"]="0:0:755" + ["/usr/local/bin/removeun"]="0:0:755" ) diff --git a/catos-iso/syslinux/archiso_pxe-linux.cfg b/catos-iso/syslinux/archiso_pxe-linux.cfg index 44c97a0..ab906ba 100644 --- a/catos-iso/syslinux/archiso_pxe-linux.cfg +++ b/catos-iso/syslinux/archiso_pxe-linux.cfg @@ -5,7 +5,7 @@ It allows you to install CatOS or perform system maintenance. ENDTEXT MENU LABEL CatOS install medium (x86_64, NBD) LINUX ::/%INSTALL_DIR%/boot/x86_64/vmlinuz-linux -INITRD ::/%INSTALL_DIR%/boot/intel-ucode.img,::/%INSTALL_DIR%/boot/amd-ucode.img,::/%INSTALL_DIR%/boot/x86_64/initramfs-linux.img +INITRD ::/%INSTALL_DIR%/boot/x86_64/initramfs-linux.img APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% archiso_nbd_srv=${pxeserver} cms_verify=y copytoram=no SYSAPPEND 3 @@ -16,7 +16,7 @@ It allows you to install CatOS or perform system maintenance. ENDTEXT MENU LABEL CatOS install medium (x86_64, NFS) LINUX ::/%INSTALL_DIR%/boot/x86_64/vmlinuz-linux -INITRD ::/%INSTALL_DIR%/boot/intel-ucode.img,::/%INSTALL_DIR%/boot/amd-ucode.img,::/%INSTALL_DIR%/boot/x86_64/initramfs-linux.img +INITRD ::/%INSTALL_DIR%/boot/x86_64/initramfs-linux.img APPEND archisobasedir=%INSTALL_DIR% archiso_nfs_srv=${pxeserver}:/run/archiso/bootmnt cms_verify=y copytoram=no SYSAPPEND 3 @@ -27,6 +27,6 @@ It allows you to install CatOS or perform system maintenance. ENDTEXT MENU LABEL CatOS install medium (x86_64, HTTP) LINUX ::/%INSTALL_DIR%/boot/x86_64/vmlinuz-linux -INITRD ::/%INSTALL_DIR%/boot/intel-ucode.img,::/%INSTALL_DIR%/boot/amd-ucode.img,::/%INSTALL_DIR%/boot/x86_64/initramfs-linux.img +INITRD ::/%INSTALL_DIR%/boot/x86_64/initramfs-linux.img APPEND archisobasedir=%INSTALL_DIR% archiso_http_srv=http://${pxeserver}/ cms_verify=y copytoram=no SYSAPPEND 3 diff --git a/catos-iso/syslinux/archiso_sys-linux.cfg b/catos-iso/syslinux/archiso_sys-linux.cfg index 31ad48b..d71dc56 100644 --- a/catos-iso/syslinux/archiso_sys-linux.cfg +++ b/catos-iso/syslinux/archiso_sys-linux.cfg @@ -5,7 +5,7 @@ It allows you to install CatOS or perform system maintenance. ENDTEXT MENU LABEL CatOS install medium (x86_64, BIOS) LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux -INITRD /%INSTALL_DIR%/boot/intel-ucode.img,/%INSTALL_DIR%/boot/amd-ucode.img,/%INSTALL_DIR%/boot/x86_64/initramfs-linux.img +INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% copytoram=no cow_spacesize=1G # Accessibility boot option @@ -16,5 +16,5 @@ It allows you to install CatOS or perform system maintenance with speech feedbac ENDTEXT MENU LABEL CatOS install medium (x86_64, BIOS) with ^speech LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux -INITRD /%INSTALL_DIR%/boot/intel-ucode.img,/%INSTALL_DIR%/boot/amd-ucode.img,/%INSTALL_DIR%/boot/x86_64/initramfs-linux.img +INITRD /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% accessibility=on copytoram=no cow_spacesize=1G