Compare commits
15 Commits
5f6a5bfdac
...
main
Author | SHA1 | Date | |
---|---|---|---|
15d67f2e3f | |||
6fb13a097c | |||
64c66cbd0f | |||
1036ce9c5b | |||
3ae8b53616 | |||
2adac7b94b | |||
9525976fe2 | |||
624d278971 | |||
08f33c33c7 | |||
eadbbea2fd | |||
d7d41eec5b | |||
6fe5d59108 | |||
96b860e0db | |||
d467dd6610 | |||
8ed5849596 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
archzbm_settings.env
|
archzbm_settings.env
|
||||||
|
.idea
|
||||||
|
@@ -111,7 +111,7 @@ Known options are as follows.
|
|||||||
|
|
||||||
### Kernel downgrade
|
### Kernel downgrade
|
||||||
|
|
||||||
By default we install newest `linux` and `linux-headers` packages into a `chroot`. Once we're in that `chroot` we then install newest [AUR zfs-dkms package](https://aur.archlinux.org/packages/zfs-dkms). You may want to override `linux` and `linux-headers` versions we're installing to ensure you end up with a compatible mix between them and `zfs-dkms`.
|
By default we install newest `linux` and `linux-headers` packages into a `chroot`. Once we're in that `chroot` we then install newest [AUR zfs-dkms package](https://aur.archlinux.org/packages/zfs-dkms). You may want to override `linux` and `linux-headers` versions to ensure you end up with a compatible mix between them and `zfs-dkms`.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
```
|
```
|
||||||
@@ -267,7 +267,7 @@ This syntax crutch allows you to use the full range of Dropbear-supported `autho
|
|||||||
|
|
||||||
An interactive questionnaire can guide you through settings and goes like this:
|
An interactive questionnaire can guide you through settings and goes like this:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
To do the questionnaire yourself start this script with the `setup` argument:
|
To do the questionnaire yourself start this script with the `setup` argument:
|
||||||
|
|
||||||
@@ -329,7 +329,7 @@ We strongly suggest to that you:
|
|||||||
- Firstly, refer to a resource such as the [Arch Linux Archive package version list](https://archive.archlinux.org/packages/l/linux/) to find out what newest kernel version this script will install.
|
- Firstly, refer to a resource such as the [Arch Linux Archive package version list](https://archive.archlinux.org/packages/l/linux/) to find out what newest kernel version this script will install.
|
||||||
- Secondly, research if newest [AUR zfs-dkms package](https://aur.archlinux.org/packages/zfs-dkms) is compatible with that kernel. Two reasonable points of contact are AUR and its comments section for `zfs-dkms` where users quickly report issues; and the [github.com/openzfs/zfs issues list](https://github.com/openzfs/zfs/issues).
|
- Secondly, research if newest [AUR zfs-dkms package](https://aur.archlinux.org/packages/zfs-dkms) is compatible with that kernel. Two reasonable points of contact are AUR and its comments section for `zfs-dkms` where users quickly report issues; and the [github.com/openzfs/zfs issues list](https://github.com/openzfs/zfs/issues).
|
||||||
|
|
||||||
An example for this is that `linux-6.6.1.arch1-1-x86_64` released on Wednesday, November 8, 2023 at a time when newest `zfs-dkms` package version [was 2.2.0](https://aur.archlinux.org/cgit/aur.git/commit/?h=zfs-dkms&id=da1b6372c57b16f2781a7fda2b95971bb392c5ee) which did not compile against `linux` 6.6.x.
|
An example for this is that `linux-6.6.1.arch1-1-x86_64` came out on Wednesday, November 8, 2023 at a time when newest `zfs-dkms` package version [was 2.2.0](https://aur.archlinux.org/cgit/aur.git/commit/?h=zfs-dkms&id=da1b6372c57b16f2781a7fda2b95971bb392c5ee) which did not compile against `linux` 6.6.x.
|
||||||
|
|
||||||
You'd then set for example:
|
You'd then set for example:
|
||||||
```
|
```
|
||||||
|
106
setup.sh
106
setup.sh
@@ -70,15 +70,14 @@ function setup_env_vars () {
|
|||||||
|
|
||||||
read -u3 -p 'Please type kernel version to use, leave empty for latest, confirm with <Enter>: ' ARCHZBM_KERNEL_VER
|
read -u3 -p 'Please type kernel version to use, leave empty for latest, confirm with <Enter>: ' ARCHZBM_KERNEL_VER
|
||||||
echo
|
echo
|
||||||
echo
|
|
||||||
|
|
||||||
echo 'Do you want compressed datasets?'
|
echo 'Do you want compressed datasets?'
|
||||||
select arg_compressed in "Compressed" "Uncompressed"; do
|
select arg_compressed in 'Compressed' 'Uncompressed'; do
|
||||||
case "${arg_compressed}" in
|
case "${arg_compressed}" in
|
||||||
Compressed)
|
'Compressed')
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
Uncompressed)
|
'Uncompressed')
|
||||||
ARCHZBM_ZFSPROPS_NO_COMPRESSION='true'
|
ARCHZBM_ZFSPROPS_NO_COMPRESSION='true'
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
@@ -86,12 +85,12 @@ function setup_env_vars () {
|
|||||||
done <&3 && echo
|
done <&3 && echo
|
||||||
|
|
||||||
echo 'Do you want encrypted datasets?'
|
echo 'Do you want encrypted datasets?'
|
||||||
select arg_encrypted in "Encrypted" "Unencrypted"; do
|
select arg_encrypted in 'Encrypted' 'Unencrypted'; do
|
||||||
case "${arg_encrypted}" in
|
case "${arg_encrypted}" in
|
||||||
Encrypted)
|
'Encrypted')
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
Unencrypted)
|
'Unencrypted')
|
||||||
ARCHZBM_ZFSPROPS_NO_ENCRYPTION='true'
|
ARCHZBM_ZFSPROPS_NO_ENCRYPTION='true'
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
@@ -100,13 +99,13 @@ function setup_env_vars () {
|
|||||||
|
|
||||||
if [[ "${arg_encrypted}" = 'Encrypted' ]]; then
|
if [[ "${arg_encrypted}" = 'Encrypted' ]]; then
|
||||||
echo 'Do you want a custom dataset decryption password?'
|
echo 'Do you want a custom dataset decryption password?'
|
||||||
select arg_custom_dataset_pw in "Yes" "No"; do
|
select arg_custom_dataset_pw in 'Yes' 'No (use '"'"'password'"'"')'; do
|
||||||
case "${arg_custom_dataset_pw}" in
|
case "${arg_custom_dataset_pw}" in
|
||||||
Yes)
|
'Yes')
|
||||||
want_custom_dataset_pw='true'
|
want_custom_dataset_pw='true'
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
No)
|
'No (use '"'"'password'"'"')')
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -120,13 +119,13 @@ function setup_env_vars () {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo 'Do you want a custom '"'"'root'"'"' user password?'
|
echo 'Do you want a custom '"'"'root'"'"' user password?'
|
||||||
select arg_custom_root_pw in "Yes" "No"; do
|
select arg_custom_root_pw in 'Yes' 'No (use '"'"'password'"'"')'; do
|
||||||
case "${arg_custom_root_pw}" in
|
case "${arg_custom_root_pw}" in
|
||||||
Yes)
|
'Yes')
|
||||||
want_custom_root_pw='true'
|
want_custom_root_pw='true'
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
No)
|
'No (use '"'"'password'"'"')')
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -153,7 +152,7 @@ function setup_env_vars () {
|
|||||||
|
|
||||||
if [[ "${want_ssh_in_zbm}" ]]; then
|
if [[ "${want_ssh_in_zbm}" ]]; then
|
||||||
echo 'How do you want to assign an IP address in ZFSBootMenu?'
|
echo 'How do you want to assign an IP address in ZFSBootMenu?'
|
||||||
select arg_ip_autoconf_method in "Statically" "Dynamically, DHCP" "Dynamically, BOOTP" "Dynamically, RARP"; do
|
select arg_ip_autoconf_method in 'Statically' 'Dynamically, DHCP' 'Dynamically, BOOTP' 'Dynamically, RARP'; do
|
||||||
case "${arg_ip_autoconf_method}" in
|
case "${arg_ip_autoconf_method}" in
|
||||||
'Statically')
|
'Statically')
|
||||||
ARCHZBM_NET_AUTOCONF='none'
|
ARCHZBM_NET_AUTOCONF='none'
|
||||||
@@ -189,7 +188,7 @@ function setup_env_vars () {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo 'Do you want a custom SSH listening port?'
|
echo 'Do you want a custom SSH listening port?'
|
||||||
select arg_custom_ssh_port in "Yes (let me specify)" "No (keep port 22)"; do
|
select arg_custom_ssh_port in 'Yes (let me specify)' 'No (keep port 22)'; do
|
||||||
case "${arg_custom_ssh_port}" in
|
case "${arg_custom_ssh_port}" in
|
||||||
'Yes (let me specify)')
|
'Yes (let me specify)')
|
||||||
want_custom_ssh_port='true'
|
want_custom_ssh_port='true'
|
||||||
@@ -207,7 +206,7 @@ function setup_env_vars () {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo 'Do you want the SSH daemon to use a custom keepalive send interval?'
|
echo 'Do you want the SSH daemon to use a custom keepalive send interval?'
|
||||||
select arg_custom_ssh_keepalive_intvl in "Yes (let me specify)" "No (keep 1)"; do
|
select arg_custom_ssh_keepalive_intvl in 'Yes (let me specify)' 'No (keep 1)'; do
|
||||||
case "${arg_custom_ssh_keepalive_intvl}" in
|
case "${arg_custom_ssh_keepalive_intvl}" in
|
||||||
'Yes (let me specify)')
|
'Yes (let me specify)')
|
||||||
want_custom_keepalive_intvl='true'
|
want_custom_keepalive_intvl='true'
|
||||||
@@ -283,7 +282,7 @@ function setup_env_vars () {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${want_ssh_in_zbm}" ]]; then
|
if [[ "${want_ssh_in_zbm}" ]]; then
|
||||||
echo 'Do you want to define OS root user'"'"'s SSH pub key?'
|
echo 'Do you want to define OS '"'"'root'"'"' user'"'"'s SSH pub key?'
|
||||||
select arg_root_pub_keys in 'Yes (let me specify)' 'Yes (use ZBM pub keys)' 'No (don'"'"'t enable sshd.service)'; do
|
select arg_root_pub_keys in 'Yes (let me specify)' 'Yes (use ZBM pub keys)' 'No (don'"'"'t enable sshd.service)'; do
|
||||||
case "${arg_root_pub_keys}" in
|
case "${arg_root_pub_keys}" in
|
||||||
'Yes (let me specify)')
|
'Yes (let me specify)')
|
||||||
@@ -430,19 +429,34 @@ function update_pacman_db () {
|
|||||||
systemctl start reflector
|
systemctl start reflector
|
||||||
# In an ISO and for the minimal number of packages we need we do not
|
# In an ISO and for the minimal number of packages we need we do not
|
||||||
# care about partial upgrades
|
# care about partial upgrades
|
||||||
pacman -Syyuu --noconfirm
|
#
|
||||||
|
# Are we better off not attempting an upgrade inside the ISO?
|
||||||
|
# Let's try and find out.
|
||||||
|
# while ! pacman -Syyuu --needed --noconfirm --downloadonly; do
|
||||||
|
# sleep 5
|
||||||
|
# done
|
||||||
|
# pacman -Syyuu --needed --noconfirm
|
||||||
|
pacman -Syy
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_pkgs () {
|
function install_pkgs () {
|
||||||
#1.5
|
#1.5
|
||||||
printf -- '%s\n' 'Installing packages ...'
|
printf -- '%s\n' 'Installing packages ...'
|
||||||
|
while ! pacman -S --needed --noconfirm --downloadonly "${@}"; do
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
pacman -S --needed --noconfirm "${@}"
|
pacman -S --needed --noconfirm "${@}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_zfs () {
|
function install_zfs () {
|
||||||
#1.6
|
#1.6
|
||||||
declare reset_colors='\033[0m'
|
declare reset_colors='\033[0m'
|
||||||
curl -s 'https://raw.githubusercontent.com/eoli3n/archiso-zfs/master/init' | bash
|
if modinfo 'zfs' &>/dev/null; then
|
||||||
|
>&3 printf -- '%s\n' \
|
||||||
|
'ZFS kernel module is loaded, no need to install ...'
|
||||||
|
else
|
||||||
|
curl -s 'https://raw.githubusercontent.com/eoli3n/archiso-zfs/master/init' | bash
|
||||||
|
fi
|
||||||
printf -- "${reset_colors}"
|
printf -- "${reset_colors}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -764,27 +778,29 @@ function install_archlinux () {
|
|||||||
#1.12
|
#1.12
|
||||||
pacman_dl_parallel
|
pacman_dl_parallel
|
||||||
pacman_dont_check_space
|
pacman_dont_check_space
|
||||||
pacstrap /mnt \
|
while ! pacstrap /mnt \
|
||||||
base \
|
base \
|
||||||
base-devel \
|
base-devel \
|
||||||
linux \
|
linux \
|
||||||
linux-headers \
|
linux-headers \
|
||||||
linux-firmware \
|
linux-firmware \
|
||||||
amd-ucode \
|
amd-ucode \
|
||||||
efibootmgr \
|
efibootmgr \
|
||||||
vim \
|
vim \
|
||||||
git \
|
git \
|
||||||
iwd \
|
iwd \
|
||||||
networkmanager \
|
networkmanager \
|
||||||
network-manager-applet \
|
network-manager-applet \
|
||||||
dialog \
|
dialog \
|
||||||
os-prober \
|
os-prober \
|
||||||
reflector \
|
reflector \
|
||||||
bluez \
|
bluez \
|
||||||
bluez-utils \
|
bluez-utils \
|
||||||
man-db \
|
man-db \
|
||||||
xdg-utils \
|
xdg-utils \
|
||||||
xdg-user-dirs
|
xdg-user-dirs; do
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
function gen_fstab () {
|
function gen_fstab () {
|
||||||
@@ -1289,6 +1305,10 @@ function get_disks_with_one_efipart () {
|
|||||||
|
|
||||||
function install_os_in_chroot () {
|
function install_os_in_chroot () {
|
||||||
#2.2
|
#2.2
|
||||||
|
dd if='/dev/zero' of='/swapfile' bs='1M' count='2048'
|
||||||
|
losetup '/dev/loop9' '/swapfile'
|
||||||
|
mkswap '/dev/loop9'
|
||||||
|
swapon '/dev/loop9'
|
||||||
### Reinit keyring
|
### Reinit keyring
|
||||||
# As keyring is initialized at boot, and copied to the install dir with pacstrap, and ntp is running
|
# As keyring is initialized at boot, and copied to the install dir with pacstrap, and ntp is running
|
||||||
# Time changed after keyring initialization, it leads to malfunction
|
# Time changed after keyring initialization, it leads to malfunction
|
||||||
@@ -1296,6 +1316,9 @@ function install_os_in_chroot () {
|
|||||||
rm -rf '/etc/pacman.d/gnupg'
|
rm -rf '/etc/pacman.d/gnupg'
|
||||||
pacman-key --init
|
pacman-key --init
|
||||||
pacman-key --populate archlinux
|
pacman-key --populate archlinux
|
||||||
|
while ! pacman -S archlinux-keyring --noconfirm --downloadonly; do
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
pacman -S archlinux-keyring --noconfirm
|
pacman -S archlinux-keyring --noconfirm
|
||||||
|
|
||||||
locale-gen
|
locale-gen
|
||||||
@@ -1332,6 +1355,9 @@ function install_os_in_chroot () {
|
|||||||
add_syslinux_pacman_hook
|
add_syslinux_pacman_hook
|
||||||
fi
|
fi
|
||||||
add_zbm_pacman_hook
|
add_zbm_pacman_hook
|
||||||
|
swapoff '/dev/loop9'
|
||||||
|
losetup -d '/dev/loop9'
|
||||||
|
rm '/swapfile'
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_root_pw () {
|
function set_root_pw () {
|
||||||
|
Reference in New Issue
Block a user