core: 兼容 xen 磁盘

This commit is contained in:
bin456789 2023-07-09 00:02:06 +08:00
parent 69f2bd2e58
commit 9efe2552e3
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B
4 changed files with 8 additions and 4 deletions

2
ks.cfg
View File

@ -9,7 +9,7 @@ reboot
%include /tmp/include-url-command
# 分区
ignoredisk --only-use="hda|sda|vda|nvme0n1"
ignoredisk --only-use="sda|hda|xda|vda|xvda|nvme0n1"
bootloader # 甲骨文x86输出到控制台添加 --append="console=ttyS0,9600"
clearpart --all --initlabel
reqpart # 如果需要,自动创建 efi 或 biosboot 分区

View File

@ -21,7 +21,9 @@ update_part() {
# ubuntu grownpart
# 找出主硬盘
xda=$(lsblk -dn -o NAME | grep -E 'nvme0n1|.da')
# xda=$(lsblk -dn -o NAME | grep -E 'nvme0n1|.da')
# shellcheck disable=SC2010
xda=$(ls /dev/ | grep -Ex 'sda|hda|xda|vda|xvda|nvme0n1')
# 删除 installer 分区
installer_num=$(readlink -f /dev/disk/by-label/installer | grep -o '[0-9]*$')

View File

@ -137,7 +137,7 @@ fi
# alpine 不自带lsblkliveos安装的软件也会被带到新系统所以不用lsblk
# xda=$(lsblk -dn -o NAME | grep -E 'nvme0n1|.da')
# shellcheck disable=SC2010
xda=$(ls /dev/ | grep -Ex '[shv]da|nvme0n1')
xda=$(ls /dev/ | grep -Ex 'sda|hda|xda|vda|xvda|nvme0n1')
# arm要手动从硬件同步时间避免访问https出错
hwclock -s

View File

@ -8,7 +8,9 @@ cat <<EOF >>/autoinstall.yaml
size: 0
EOF
xda=$(lsblk -dn -o NAME | grep -E 'nvme0n1|.da')
# xda=$(lsblk -dn -o NAME | grep -E 'nvme0n1|.da')
# shellcheck disable=SC2010
xda=$(ls /dev/ | grep -Ex 'sda|hda|xda|vda|xvda|nvme0n1')
# 是用 size 寻找分区number 没什么用
# https://curtin.readthedocs.io/en/latest/topics/storage.html
size_os=$(lsblk -bn -o SIZE /dev/disk/by-label/os)