mirror of
https://github.com/bohanyang/debi.git
synced 2026-09-27 14:36:20 +00:00
Compare commits
7
Commits
212de4be3b
...
a4772230b2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4772230b2 | ||
|
|
887d3c4a23 | ||
|
|
47ce372bb6 | ||
|
|
b5b37cbf44 | ||
|
|
e4c84ac328 | ||
|
|
8b42031edf | ||
|
|
b9b5203202 |
@@ -22,7 +22,7 @@ sudo ./debi.sh --cdn --network-console --ethx --bbr --user root --password <新
|
||||
* `--ethx` 网卡名称使用传统形式,如 `eth0` 而不是 `ens3`
|
||||
* `--cloud-kernel` 安装占用空间较小的 `cloud` 内核,但可能会导致 UEFI 启动的机器(如 Oracle、Azure 及 Hyper-V、Google Cloud 等)VNC 黑屏。BIOS 启动的普通 VPS 则没有此问题。
|
||||
* 默认时区为 UTC,添加 `--timezone Asia/Shanghai` 可使用中国时区。
|
||||
* 默认使用 Debian 官方 CDN 镜像源(deb.debian.org),添加 `--china` 可使用阿里云镜像源。
|
||||
* 默认使用 Debian 官方 CDN 镜像源(deb.debian.org),添加 `--ustc` 可使用中科大镜像源。
|
||||
|
||||
如果没有报错可以重启:
|
||||
|
||||
@@ -98,12 +98,24 @@ Otherwise, you can run this command to revert all changes made by the script:
|
||||
|
||||
## Available Options
|
||||
|
||||
### Presets
|
||||
|
||||
| Region | Alias | Mirror | DNS | NTP |
|
||||
|--------|----------------|--------------------------------------|------------|---------------------|
|
||||
| Global | Default | https://deb.debian.org | Google | time.google.com |
|
||||
| Global | `--cloudflare` | https://deb.debian.org | Cloudflare | time.cloudflare.com |
|
||||
| Global | `--aws` | https://cdn-aws.deb.debian.org | Google | time.aws.com |
|
||||
| China | `--ustc` | https://mirrors.ustc.edu.cn | DNSPod | time.amazonaws.cn |
|
||||
| China | `--tuna` | https://mirrors.tuna.tsinghua.edu.cn | DNSPod | time.amazonaws.cn |
|
||||
| China | `--aliyun` | https://mirrors.aliyun.com | AliDNS | time.amazonaws.cn |
|
||||
|
||||
* `--interface <string>` Manually select a network interface, e.g. eth1
|
||||
* `--ethx` Disable *Consistent Network Device Naming* to get interface names like *ethX* back
|
||||
* `--ip <string>` Disable the auto network config (DHCP) and configure a static IP address, e.g. `10.0.0.2`, `1.2.3.4/24`, `2001:2345:6789:abcd::ef/48`
|
||||
* `--netmask <string>` e.g. `255.255.255.0`, `ffff:ffff:ffff:ffff::`
|
||||
* `--gateway <string>` e.g. `10.0.0.1`, `none` if no gateway
|
||||
* `--dns '8.8.8.8 8.8.4.4'` (Default IPv6 DNS: `2001:4860:4860::8888 2001:4860:4860::8844`)
|
||||
* `--dns '8.8.8.8 8.8.4.4'`
|
||||
* `--dns6 '2001:4860:4860::8888 2001:4860:4860::8844'` (effective only if IPv6 is specified)
|
||||
* `--hostname <string>` FQDN hostname (includes the domain name), e.g. `server1.example.com`
|
||||
* `--network-console` Enable the network console of the installer. `ssh installer@ip` to connect
|
||||
* `--version 12` Supports: `10`, `11`, `12`, `13`
|
||||
@@ -123,7 +135,7 @@ Otherwise, you can run this command to revert all changes made by the script:
|
||||
* `--authorized-keys-url <string>` URL to your authorized keys for SSH authentication. e.g. `https://github.com/torvalds.keys`
|
||||
* `--sudo-with-password` Require password when the user invokes `sudo` command
|
||||
* `--timezone UTC` e.g. `Asia/Shanghai` for China (UTC+8) https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
|
||||
* `--ntp 0.debian.pool.ntp.org`
|
||||
* `--ntp time.google.com`
|
||||
* `--no-disk-partitioning, --no-part` **(Manual installation)** Proceed disk partitioning manually in VNC or remote console
|
||||
* `--disk <string>` Manually select a disk for installation. **Please remember to specify this when more than one disk is available!** e.g. `/dev/sda`
|
||||
* `--no-force-gpt` By default, GPT rather than MBR partition table will be created. This option disables it.
|
||||
@@ -152,25 +164,3 @@ Otherwise, you can run this command to revert all changes made by the script:
|
||||
* `--force-lowmem <integer>` Valid values: 0, 1, 2. Force [low memory level](https://salsa.debian.org/installer-team/lowmem). Useful if your machine has memory less than 500M where level 2 is set (see issue #45). `--force-lowmem 1` may solve it.
|
||||
* `--dry-run` Print generated preseed and GRUB entry without downloading the installer and actually saving them
|
||||
* `--cidata ./cidata-example` Custom data for cloud-init. **VM provider's data source will be IGNORED.** See example.
|
||||
|
||||
### Presets
|
||||
|
||||
### `--cdn`
|
||||
|
||||
* `--mirror-protocol https`
|
||||
* `--mirror-host deb.debian.org`
|
||||
* `--security-repository mirror`
|
||||
|
||||
### `--aws`
|
||||
|
||||
* `--mirror-protocol https`
|
||||
* `--mirror-host cdn-aws.deb.debian.org`
|
||||
* `--security-repository mirror`
|
||||
|
||||
### `--china`
|
||||
|
||||
* `--dns '223.5.5.5 223.6.6.6'`
|
||||
* `--mirror-protocol https`
|
||||
* `--mirror-host mirrors.aliyun.com`
|
||||
* `--security-repository mirror`
|
||||
* `--ntp ntp.aliyun.com`
|
||||
|
||||
@@ -197,6 +197,7 @@ ip=
|
||||
netmask=
|
||||
gateway=
|
||||
dns='8.8.8.8 8.8.4.4'
|
||||
dns6='2001:4860:4860::8888 2001:4860:4860::8844'
|
||||
hostname=
|
||||
network_console=false
|
||||
set_debian_version 12
|
||||
@@ -211,7 +212,7 @@ password=
|
||||
authorized_keys_url=
|
||||
sudo_with_password=false
|
||||
timezone=UTC
|
||||
ntp=0.debian.pool.ntp.org
|
||||
ntp=time.google.com
|
||||
disk_partitioning=true
|
||||
disk=
|
||||
force_gpt=true
|
||||
@@ -245,25 +246,33 @@ cidata=
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
--cdn)
|
||||
mirror_host=deb.debian.org
|
||||
;;
|
||||
--aws)
|
||||
mirror_host=cdn-aws.deb.debian.org
|
||||
ntp=time.aws.com
|
||||
;;
|
||||
--cloudflare)
|
||||
dns='1.1.1.1 1.0.0.1'
|
||||
dns6='2606:4700:4700::1111 2606:4700:4700::1001'
|
||||
ntp=time.cloudflare.com
|
||||
;;
|
||||
--aliyun)
|
||||
dns='223.5.5.5 223.6.6.6'
|
||||
dns6='2400:3200::1 2400:3200:baba::1'
|
||||
mirror_host=mirrors.aliyun.com
|
||||
ntp=ntp.aliyun.com
|
||||
ntp=time.amazonaws.cn
|
||||
;;
|
||||
--ustc|--china)
|
||||
dns='119.29.29.29'
|
||||
dns6='2402:4e00::'
|
||||
mirror_host=mirrors.ustc.edu.cn
|
||||
ntp=time.ustc.edu.cn
|
||||
ntp=time.amazonaws.cn
|
||||
;;
|
||||
--tuna)
|
||||
dns='119.29.29.29'
|
||||
dns6='2402:4e00::'
|
||||
mirror_host=mirrors.tuna.tsinghua.edu.cn
|
||||
ntp=ntp.tuna.tsinghua.edu.cn
|
||||
ntp=time.amazonaws.cn
|
||||
;;
|
||||
--interface)
|
||||
interface=$2
|
||||
@@ -285,6 +294,10 @@ while [ $# -gt 0 ]; do
|
||||
dns=$2
|
||||
shift
|
||||
;;
|
||||
--dns6)
|
||||
dns6=$2
|
||||
shift
|
||||
;;
|
||||
--hostname)
|
||||
hostname=$2
|
||||
shift
|
||||
@@ -570,7 +583,7 @@ EOF
|
||||
echo "d-i netcfg/get_ipaddress string $ip" | $save_preseed
|
||||
[ -n "$netmask" ] && echo "d-i netcfg/get_netmask string $netmask" | $save_preseed
|
||||
[ -n "$gateway" ] && echo "d-i netcfg/get_gateway string $gateway" | $save_preseed
|
||||
[ -z "${ip%%*:*}" ] && [ -n "${dns%%*:*}" ] && dns='2001:4860:4860::8888 2001:4860:4860::8844'
|
||||
[ -z "${ip%%*:*}" ] && [ -n "${dns%%*:*}" ] && dns="$dns6"
|
||||
[ -n "$dns" ] && echo "d-i netcfg/get_nameservers string $dns" | $save_preseed
|
||||
echo 'd-i netcfg/confirm_static boolean true' | $save_preseed
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user