Files
tms-arch-linux-calamares-in…/archiso/airootfs/root/customize_airootfs.sh
2025-12-06 16:50:31 +08:00

25 lines
908 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 更新 pacman 数据库,确保能找到本地仓库的包
pacman -Sy
# 安装本地仓库的 linux 和 linux-headers
# 由于 [custom] 仓库优先级最高pacman 会从这里安装
pacman -S --noconfirm linux linux-headers
# 重新生成 initramfs确保新内核能启动
# 这通常在安装内核时由 pacman 自动处理,但手动安装后最好确认一下
mkinitcpio -P
# 清理 pacman 缓存
pacman -Scc --noconfirm
# 删除本地仓库的数据库文件,避免在最终系统上占用空间
# rm -rf /localrepo/custom.db.tar.gz /localrepo/custom.files.tar.gz
# rm -rf /localrepo/*.pkg.tar.zst
# rmdir /localrepo
# 如果你希望在安装完成后移除本地仓库的定义,可以编辑 pacman.conf
# 但对于 livecd 或安装介质,通常不需要这样做,因为它是临时环境
# sed -i '/^\[custom\]/,/^Server = file:\/\/\/localrepo/d' /etc/pacman.conf