Compare commits

..

No commits in common. 'a4772230b20cf3c84d232d6e59abab66d9ffa5c0' and '212de4be3b2c881ab2ad15d5dbdb4cc3b1977c89' have entirely different histories.

  1. 40
      README.md
  2. 25
      debi.sh

@ -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),添加 `--ustc` 可使用中科大镜像源。
* 默认使用 Debian 官方 CDN 镜像源(deb.debian.org),添加 `--china` 可使用阿里云镜像源。
如果没有报错可以重启:
@ -98,24 +98,12 @@ 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'`
* `--dns6 '2001:4860:4860::8888 2001:4860:4860::8844'` (effective only if IPv6 is specified)
* `--dns '8.8.8.8 8.8.4.4'` (Default IPv6 DNS: `2001:4860:4860::8888 2001:4860:4860::8844`)
* `--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`
@ -135,7 +123,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 time.google.com`
* `--ntp 0.debian.pool.ntp.org`
* `--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.
@ -164,3 +152,25 @@ 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,7 +197,6 @@ 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
@ -212,7 +211,7 @@ password=
authorized_keys_url=
sudo_with_password=false
timezone=UTC
ntp=time.google.com
ntp=0.debian.pool.ntp.org
disk_partitioning=true
disk=
force_gpt=true
@ -246,33 +245,25 @@ 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=time.amazonaws.cn
ntp=ntp.aliyun.com
;;
--ustc|--china)
dns='119.29.29.29'
dns6='2402:4e00::'
mirror_host=mirrors.ustc.edu.cn
ntp=time.amazonaws.cn
ntp=time.ustc.edu.cn
;;
--tuna)
dns='119.29.29.29'
dns6='2402:4e00::'
mirror_host=mirrors.tuna.tsinghua.edu.cn
ntp=time.amazonaws.cn
ntp=ntp.tuna.tsinghua.edu.cn
;;
--interface)
interface=$2
@ -294,10 +285,6 @@ while [ $# -gt 0 ]; do
dns=$2
shift
;;
--dns6)
dns6=$2
shift
;;
--hostname)
hostname=$2
shift
@ -583,7 +570,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="$dns6"
[ -z "${ip%%*:*}" ] && [ -n "${dns%%*:*}" ] && dns='2001:4860:4860::8888 2001:4860:4860::8844'
[ -n "$dns" ] && echo "d-i netcfg/get_nameservers string $dns" | $save_preseed
echo 'd-i netcfg/confirm_static boolean true' | $save_preseed
}

Loading…
Cancel
Save