Merge pull request #40 from saveriomiroddi/add_more_log_information

Add more debugging information to the log
This commit is contained in:
Saverio Miroddi 2019-12-27 10:10:05 +00:00 committed by GitHub
commit f6f322d378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 12 deletions

View File

@ -100,7 +100,7 @@ This project is entirely oriented to community requests, as the target is to fac
Both for feature requests and bugs, [open a GitHub issue](https://github.com/saveriomiroddi/zfs-installer/issues/new). Both for feature requests and bugs, [open a GitHub issue](https://github.com/saveriomiroddi/zfs-installer/issues/new).
For issues, also attach the file `/tmp/install-zfs.log`. It doesn't contain any information aside what required for performing the installation; it can be trivially inspected, as it's a standard Bash debug output. For issues, also attach the content of the directory `/tmp/zfs-installer`. It doesn't contain any information aside what required for performing the installation; it can be trivially inspected, as it's a standard Bash debug output.
## Credits ## Credits

View File

@ -39,6 +39,7 @@ c_default_bpool_tweaks="-o ashift=12"
c_default_rpool_tweaks="-o ashift=12 -O acltype=posixacl -O compression=lz4 -O dnodesize=auto -O relatime=on -O xattr=sa -O normalization=formD" c_default_rpool_tweaks="-o ashift=12 -O acltype=posixacl -O compression=lz4 -O dnodesize=auto -O relatime=on -O xattr=sa -O normalization=formD"
c_zfs_mount_dir=/mnt c_zfs_mount_dir=/mnt
c_installed_os_data_mount_dir=/target c_installed_os_data_mount_dir=/target
c_log_dir="$(dirname "$(mktemp)")/zfs-installer"
c_unpacked_subiquity_dir=/tmp/ubiquity_snap_files c_unpacked_subiquity_dir=/tmp/ubiquity_snap_files
declare -A c_supported_linux_distributions=([Ubuntu]=18.04 [UbuntuServer]=18.04 [LinuxMint]=19 [Debian]=10 [elementary]=5.1) declare -A c_supported_linux_distributions=([Ubuntu]=18.04 [UbuntuServer]=18.04 [LinuxMint]=19 [Debian]=10 [elementary]=5.1)
c_temporary_volume_size=12G # large enough; Debian, for example, takes ~8 GiB. c_temporary_volume_size=12G # large enough; Debian, for example, takes ~8 GiB.
@ -166,21 +167,17 @@ When installing the O/S via $ZFS_OS_INSTALLATION_SCRIPT, the root pool is mounte
function activate_debug { function activate_debug {
print_step_info_header print_step_info_header
exec 5> "$(dirname "$(mktemp)")/install-zfs.log" mkdir -p "$c_log_dir"
exec 5> "$c_log_dir/install.log"
BASH_XTRACEFD="5" BASH_XTRACEFD="5"
set -x set -x
} }
function print_preset_variables { function store_os_distro_information {
cat <<SHELL print_step_info_header
# Preset variables for rerun:
ZFS_SELECTED_DISKS=$(printf "%s," "${v_selected_disks[@]}" | sed 's/.$//') \\ lsb_release --all > "$c_log_dir/lsb_release.log"
ZFS_ENCRYPT_RPOOL=$v_encrypt_rpool ZFS_PASSPHRASE=$v_passphrase \\
ZFS_BPOOL_NAME=$v_bpool_name ZFS_RPOOL_NAME=$v_rpool_name \\
ZFS_BPOOL_TWEAKS="$v_bpool_tweaks" ZFS_RPOOL_TWEAKS="$v_rpool_tweaks" \\
ZFS_SWAP_SIZE=$v_swap_size ZFS_FREE_TAIL_SPACE=$v_free_tail_space
SHELL
} }
function set_distribution_data { function set_distribution_data {
@ -441,6 +438,8 @@ function install_host_zfs_module {
modprobe zfs modprobe zfs
systemctl start zfs-zed systemctl start zfs-zed
fi fi
zfs --version > "$c_log_dir/zfs_updated_module_version.log" 2>&1
} }
function install_host_zfs_module_Debian { function install_host_zfs_module_Debian {
@ -457,6 +456,8 @@ function install_host_zfs_module_Debian {
modprobe zfs modprobe zfs
fi fi
zfs --version > "$c_log_dir/zfs_updated_module_version.log" 2>&1
} }
function install_host_zfs_module_elementary { function install_host_zfs_module_elementary {
@ -1071,7 +1072,7 @@ if [[ $# -ne 0 ]]; then
fi fi
activate_debug activate_debug
trap print_preset_variables ERR store_os_distro_information
set_distribution_data set_distribution_data
check_prerequisites check_prerequisites
display_intro_banner display_intro_banner