From d82ee289c3cc405a0ba1e402f3f2dea8b10a67e1 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 21 Dec 2023 19:24:13 -0500 Subject: [PATCH 1/5] Add github action to codespell master on push and PRs --- .github/workflows/codespell.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..7373aff --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,22 @@ +--- +name: Codespell + +on: + push: + branches: [master] + pull_request: + branches: [master] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Codespell + uses: codespell-project/actions-codespell@v2 From 25a9876ad49ee6dc2599c5dc65e6b6019bdedc68 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 21 Dec 2023 19:24:13 -0500 Subject: [PATCH 2/5] Add rudimentary codespell config --- .codespellrc | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..dfb8f7a --- /dev/null +++ b/.codespellrc @@ -0,0 +1,6 @@ +[codespell] +skip = .git,*.pdf,*.svg,go.sum,.codespellrc +check-hidden = true +# ignore-regex = +# ist -- unfortunate variable +ignore-words-list = ist From abd2889464f5d006f4ec9c760d1d010931e6f16a Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 21 Dec 2023 19:25:10 -0500 Subject: [PATCH 3/5] [DATALAD RUNCMD] Do interactive fixing of some ambigous typos === Do not change lines below === { "chain": [], "cmd": "codespell -w -i 3 -C 2 ./grub-btrfsd", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- grub-btrfsd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-btrfsd b/grub-btrfsd index df7abef..92a0f01 100755 --- a/grub-btrfsd +++ b/grub-btrfsd @@ -204,7 +204,7 @@ setup() { } create_grub_menu() { - # create the grub submenu of the whole grub menu, depending on wether the submenu already exists + # create the grub submenu of the whole grub menu, depending on whether the submenu already exists # and gives feedback if it worked if grep "snapshots-btrfs" "${GRUB_BTRFS_GRUB_DIRNAME:-/boot/grub}"/grub.cfg; then if /etc/grub.d/41_snapshots-btrfs; then @@ -258,7 +258,7 @@ daemon_function() { set_snapshot_dir log "${BASHPID}: detected Timeshift startup, PID is: $timeshift_pid" "${CYAN}" vlog "${BASHPID}: new snapshots directory is $snapdir" "${CYAN}" - (create_grub_menu) # create the grub menu once immidiatly in a forking process. Snapshots from commandline using timeshift --create need this + (create_grub_menu) # create the grub menu once immediately in a forking process. Snapshots from commandline using timeshift --create need this } fi runs=false From 98a5bbe8c5dd2fde9330876728aa120ce8dcd5a6 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 21 Dec 2023 19:25:13 -0500 Subject: [PATCH 4/5] [DATALAD RUNCMD] run codespell throughout fixing typo automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- 41_snapshots-btrfs | 6 +++--- Makefile | 2 +- README.md | 2 +- config | 8 ++++---- manpages/grub-btrfs.8.man | 8 ++++---- manpages/grub-btrfs.8.org | 8 ++++---- temp/grub-btrfs.8 | 8 ++++---- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/41_snapshots-btrfs b/41_snapshots-btrfs index de52ea1..e63aae1 100755 --- a/41_snapshots-btrfs +++ b/41_snapshots-btrfs @@ -108,7 +108,7 @@ if [ -n "${GRUB_BTRFS_PROTECTION_AUTHORIZED_USERS}" ] ; then protection_authorized_users="--users ${GRUB_BTRFS_PROTECTION_AUTHORIZED_USERS} " fi -## Probe informations of Root and Boot devices +## Probe information of Root and Boot devices # Probe info "Root partition" root_device=$(${grub_probe} --target=device /) # Root device root_uuid=$(${grub_probe} --device ${root_device} --target="fs_uuid" 2>/dev/null) # UUID of the root device @@ -174,7 +174,7 @@ if [[ -d "$grub_btrfs_mount_point" ]]; then done if [[ "$wait" != true ]]; then if ! rm -d "$grub_btrfs_mount_point" >/dev/null 2>&1; then - printf "Unable to delete %s: Device or ressource is busy\n" "$grub_btrfs_mount_point" >&2; + printf "Unable to delete %s: Device or resource is busy\n" "$grub_btrfs_mount_point" >&2; fi fi fi @@ -315,7 +315,7 @@ snapshot_list() fi [[ ! -d "$grub_btrfs_mount_point/$path_snapshot/boot" ]] && continue; # Discard snapshots without /boot folder - # Parse Snapper & timeshift informations + # Parse Snapper & timeshift information local type_snapshot="N/A" local description_snapshot="N/A" if [[ -s "$grub_btrfs_mount_point/${path_snapshot%"/"*}/$snapper_info" ]] ; then diff --git a/Makefile b/Makefile index 91477a1..fce73c4 100644 --- a/Makefile +++ b/Makefile @@ -147,7 +147,7 @@ help: @echo " BOOT_DIR_FEDORA | path | boot data location (Fedora, RHEL, CentOS, Rocky...) | '/boot/grub2'" @echo " SHARE_DIR | path | shared data location | '\$$(DESTDIR)\$$(PREFIX)/share'" @echo " LIB_DIR | path | system libraries location | '\$$(DESTDIR)\$$(PREFIX)/lib'" - @echo " PKGNAME | name | name of the ditributed package | 'grub-btrfs'" + @echo " PKGNAME | name | name of the distributed package | 'grub-btrfs'" @echo " INITCPIO | bool | include mkinitcpio hook | false" @echo " SYSTEMD | bool | include unit files | true" @echo " OPENRC | bool | include OpenRc daemon | false" diff --git a/README.md b/README.md index ebd59a3..99805da 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ To manually generate grub snapshot entries you can run `sudo /etc/grub.d/41_snap * On **Fedora** use `grub2-mkconfig -o /boot/grub2/grub.cfg` * On **Debian and Ubuntu based** distributions `update-grub` is a script that runs `grub-mkconfig ...` -This process can be automated to occur whenever you create or delete snaphots but this process is slightly different depending upon your distributions choice on init system. See the relevant instructions for your init system below. +This process can be automated to occur whenever you create or delete snapshots but this process is slightly different depending upon your distributions choice on init system. See the relevant instructions for your init system below. ### ⚙️ Customization: diff --git a/config b/config index 2d2c388..0329f0a 100644 --- a/config +++ b/config @@ -49,14 +49,14 @@ GRUB_BTRFS_VERSION=4.12-master-2023-04-28T16:26:00+00:00 # Default: ("") #GRUB_BTRFS_CUSTOM_MICROCODE=("custom-ucode.img" "custom-uc.img "custom_ucode.cpio") -# Additonal kernel command line parameters that should be passed to the kernel +# Additional kernel command line parameters that should be passed to the kernel # when booting a snapshot. # For dracut based distros this could be useful to pass "rd.live.overlay.overlayfs=1" # or "rd.live.overlay.readonly=1" to the Kernel for booting snapshots read only. # Default: "" #GRUB_BTRFS_SNAPSHOT_KERNEL_PARAMETERS="rd.live.overlay.overlayfs=1" -# Comma seperated mount options to be used when booting a snapshot. +# Comma separated mount options to be used when booting a snapshot. # They can be defined here as well as in the "/" line inside the respective snapshots' # "/etc/fstab" files. Mount options found in both places are combined, and this variable # takes priority over `fstab` entries. @@ -107,14 +107,14 @@ GRUB_BTRFS_IGNORE_PREFIX_PATH=("var/lib/docker" "@var/lib/docker" "@/var/lib/doc # Location where grub-btrfs.cfg should be saved. # Some distributions (like OpenSuSE) store those files at the snapshot directory -# instead of boot. Be aware that this direcory must be available for grub during +# instead of boot. Be aware that this directory must be available for grub during # startup of the system. # Default: $GRUB_BTRFS_GRUB_DIRNAME #GRUB_BTRFS_GBTRFS_DIRNAME="/boot/grub" # Location of the directory where Grub searches for the grub-btrfs.cfg file. # Some distributions (like OpenSuSE) store those file at the snapshot directory -# instead of boot. Be aware that this direcory must be available for grub during +# instead of boot. Be aware that this directory must be available for grub during # startup of the system. # Default: "\${prefix}" # This is a grub variable that resolves to where grub is # installed. (like /boot/grub, /boot/efi/grub) diff --git a/manpages/grub-btrfs.8.man b/manpages/grub-btrfs.8.man index 2e4892a..f620a76 100644 --- a/manpages/grub-btrfs.8.man +++ b/manpages/grub-btrfs.8.man @@ -82,7 +82,7 @@ Example: \fCGRUB_BTRFS_SHOW_SNAPSHOTS_FOUND="false"\fP .SS "\fCGRUB_BTRFS_ROOTFLAGS\fP" .PP -Comma seperated mount options to be used when booting a snapshot. +Comma separated mount options to be used when booting a snapshot. They can be defined here as well as in the “/” line inside the respective snapshots’ “/etc/fstab” files. Mount options found in both places are combined, and this variable takes priority over `fstab` entries. @@ -116,7 +116,7 @@ Example: \fCGRUB_BTRFS_NKERNEL=("kernel\-5.19.4\-custom" "vmlinux\-5.19.4\-custo .SS "\fCGRUB_BTRFS_SNAPSHOT_KERNEL_PARAMETERS\fP" .PP -Additonal kernel command line parameters that should be passed to the kernelwhen +Additional kernel command line parameters that should be passed to the kernelwhen booting a snapshot. For dracut based distros this could be useful to pass “rd.live.overlay.overlayfs=1” or “rd.live.overlay.readonly=1” to the Kernel for booting read only snapshots. @@ -190,7 +190,7 @@ Example: \fCGRUB_BTRFS_GRUB_DIRNAME="/boot/grub2"\fP .PP Location where grub-btrfs.cfg should be saved. Some distributions (like OpenSuSE) store those file at the snapshot directory -instead of boot. Be aware that this direcory must be available for grub during +instead of boot. Be aware that this directory must be available for grub during startup of the system. .IP \(em 4 Default: \fC$GRUB_BTRFS_GRUB_DIRNAME\fP @@ -201,7 +201,7 @@ Example: \fCGRUB_BTRFS_GBTRFS_DIRNAME="/.snapshots"\fP .PP Location of the directory where Grub searches for the grub-btrfs.cfg file. Some distributions (like OpenSuSE) store those file at the snapshot directory -instead of boot. Be aware that this direcory must be available for grub during +instead of boot. Be aware that this directory must be available for grub during startup of the system. .IP \(em 4 Default: “\${prefix}” (This is a grub variable that resolves to where grub is diff --git a/manpages/grub-btrfs.8.org b/manpages/grub-btrfs.8.org index 51d1b0b..f5202b3 100644 --- a/manpages/grub-btrfs.8.org +++ b/manpages/grub-btrfs.8.org @@ -58,7 +58,7 @@ Show snapshots found during run "grub-mkconfig" - Example: ~GRUB_BTRFS_SHOW_SNAPSHOTS_FOUND="false"~ *** ~GRUB_BTRFS_ROOTFLAGS~ -Comma seperated mount options to be used when booting a snapshot. +Comma separated mount options to be used when booting a snapshot. They can be defined here as well as in the "/" line inside the respective snapshots' "/etc/fstab" files. Mount options found in both places are combined, and this variable takes priority over `fstab` entries. @@ -84,7 +84,7 @@ Customs kernel, initramfs and microcodes that are not detected can be added in t ~GRUB_BTRFS_CUSTOM_MICROCODE=("custom-ucode.img" "custom-uc.img "custom_ucode.cpio")~ *** ~GRUB_BTRFS_SNAPSHOT_KERNEL_PARAMETERS~ -Additonal kernel command line parameters that should be passed to the kernelwhen +Additional kernel command line parameters that should be passed to the kernelwhen booting a snapshot. For dracut based distros this could be useful to pass "rd.live.overlay.overlayfs=1" or "rd.live.overlay.readonly=1" to the Kernel for booting read only snapshots. @@ -139,7 +139,7 @@ For example, on Fedora with EFI : "/boot/efi/EFI/fedora" *** ~GRUB_BTRFS_GBTRFS_DIRNAME~ Location where grub-btrfs.cfg should be saved. Some distributions (like OpenSuSE) store those file at the snapshot directory - instead of boot. Be aware that this direcory must be available for grub during + instead of boot. Be aware that this directory must be available for grub during startup of the system. - Default: ~$GRUB_BTRFS_GRUB_DIRNAME~ - Example: ~GRUB_BTRFS_GBTRFS_DIRNAME="/.snapshots"~ @@ -147,7 +147,7 @@ For example, on Fedora with EFI : "/boot/efi/EFI/fedora" *** ~GRUB_BTRFS_GBTRFS_SEARCH_DIRNAME~ Location of the directory where Grub searches for the grub-btrfs.cfg file. Some distributions (like OpenSuSE) store those file at the snapshot directory -instead of boot. Be aware that this direcory must be available for grub during +instead of boot. Be aware that this directory must be available for grub during startup of the system. - Default: "\${prefix}" (This is a grub variable that resolves to where grub is installed. (like /boot/grub, /boot/efi/grub)) diff --git a/temp/grub-btrfs.8 b/temp/grub-btrfs.8 index 2e4892a..f620a76 100644 --- a/temp/grub-btrfs.8 +++ b/temp/grub-btrfs.8 @@ -82,7 +82,7 @@ Example: \fCGRUB_BTRFS_SHOW_SNAPSHOTS_FOUND="false"\fP .SS "\fCGRUB_BTRFS_ROOTFLAGS\fP" .PP -Comma seperated mount options to be used when booting a snapshot. +Comma separated mount options to be used when booting a snapshot. They can be defined here as well as in the “/” line inside the respective snapshots’ “/etc/fstab” files. Mount options found in both places are combined, and this variable takes priority over `fstab` entries. @@ -116,7 +116,7 @@ Example: \fCGRUB_BTRFS_NKERNEL=("kernel\-5.19.4\-custom" "vmlinux\-5.19.4\-custo .SS "\fCGRUB_BTRFS_SNAPSHOT_KERNEL_PARAMETERS\fP" .PP -Additonal kernel command line parameters that should be passed to the kernelwhen +Additional kernel command line parameters that should be passed to the kernelwhen booting a snapshot. For dracut based distros this could be useful to pass “rd.live.overlay.overlayfs=1” or “rd.live.overlay.readonly=1” to the Kernel for booting read only snapshots. @@ -190,7 +190,7 @@ Example: \fCGRUB_BTRFS_GRUB_DIRNAME="/boot/grub2"\fP .PP Location where grub-btrfs.cfg should be saved. Some distributions (like OpenSuSE) store those file at the snapshot directory -instead of boot. Be aware that this direcory must be available for grub during +instead of boot. Be aware that this directory must be available for grub during startup of the system. .IP \(em 4 Default: \fC$GRUB_BTRFS_GRUB_DIRNAME\fP @@ -201,7 +201,7 @@ Example: \fCGRUB_BTRFS_GBTRFS_DIRNAME="/.snapshots"\fP .PP Location of the directory where Grub searches for the grub-btrfs.cfg file. Some distributions (like OpenSuSE) store those file at the snapshot directory -instead of boot. Be aware that this direcory must be available for grub during +instead of boot. Be aware that this directory must be available for grub during startup of the system. .IP \(em 4 Default: “\${prefix}” (This is a grub variable that resolves to where grub is From 4ff82352bb5d63ed75f73bce8dc57dd73490aa82 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 21 Dec 2023 19:25:54 -0500 Subject: [PATCH 5/5] Fix indentation after codespell --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fce73c4..26cec21 100644 --- a/Makefile +++ b/Makefile @@ -147,7 +147,7 @@ help: @echo " BOOT_DIR_FEDORA | path | boot data location (Fedora, RHEL, CentOS, Rocky...) | '/boot/grub2'" @echo " SHARE_DIR | path | shared data location | '\$$(DESTDIR)\$$(PREFIX)/share'" @echo " LIB_DIR | path | system libraries location | '\$$(DESTDIR)\$$(PREFIX)/lib'" - @echo " PKGNAME | name | name of the distributed package | 'grub-btrfs'" + @echo " PKGNAME | name | name of the distributed package | 'grub-btrfs'" @echo " INITCPIO | bool | include mkinitcpio hook | false" @echo " SYSTEMD | bool | include unit files | true" @echo " OPENRC | bool | include OpenRc daemon | false"