mirror of
https://github.com/suiryc/archlinux-initrd-ssh-cryptsetup.git
synced 2025-12-16 01:28:57 +03:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32f45a9121 | ||
|
|
7d866bdfca | ||
|
|
8e5153d002 | ||
|
|
22da78cdef | ||
|
|
d34b39b77f | ||
|
|
8f92d149eb |
72
ChangeLog
72
ChangeLog
@@ -1,75 +1,107 @@
|
|||||||
|
2025-11-15 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
||||||
|
|
||||||
|
* v1.1-2
|
||||||
|
Removed 11-dm-initramfs.rules, which was added to 10-dm.rules.
|
||||||
|
See: https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio/-/commit/589e0397ea55e61a08fdbcab52ad4639d382f08e
|
||||||
|
|
||||||
|
Use full version (pkgver and pkgrel) for source archive name.
|
||||||
|
Sometimes we need to change the sources, but only for minor external
|
||||||
|
dependencies diff (e.g. adding/removing upstream source), in which
|
||||||
|
case we wish to only bump pkgrel.
|
||||||
|
|
||||||
|
|
||||||
|
2022-03-24 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
||||||
|
|
||||||
|
* v1.1-1
|
||||||
|
Refactored install script to more easily spot code coming from other
|
||||||
|
nominal hooks.
|
||||||
|
Updated install script message with latest available options.
|
||||||
|
|
||||||
|
Removed dependency to '/lib/libnss_files.so', as it does not exist and
|
||||||
|
should not be needed anymore.
|
||||||
|
Prevents unwanted warning when building initcpio
|
||||||
|
==> ERROR: file not found: `/lib/libnss_files.so'
|
||||||
|
See: https://bugs.archlinux.org/task/73702
|
||||||
|
|
||||||
|
|
||||||
2021-11-13 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
2021-11-13 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
||||||
|
|
||||||
* v1.0-1
|
* v1.0-1
|
||||||
Option to use login shell instead of cryptsetup unlocking script
|
Option to use login shell instead of cryptsetup unlocking script.
|
||||||
Option to re-enable Wake-on-LAN on network device
|
Option to re-enable Wake-on-LAN on network device.
|
||||||
|
|
||||||
|
|
||||||
2021-11-12 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
2021-11-12 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
||||||
|
|
||||||
* v0.9-2
|
* v0.9-2
|
||||||
Use SHA256 checksums instead of MD5
|
Use SHA256 checksums instead of MD5.
|
||||||
|
|
||||||
|
|
||||||
2021-10-24 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
2021-10-24 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
||||||
|
|
||||||
* v0.9-1
|
* v0.9-1
|
||||||
Try to print network devices information when interface setup fails
|
Try to print network devices information when interface setup fails.
|
||||||
|
|
||||||
|
|
||||||
2021-08-15 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
2021-08-15 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
||||||
|
|
||||||
* v0.8-1
|
* v0.8-1
|
||||||
Include 'libgcc_s.so.1' which is necessary for (at least) proper LUKS v2 handling
|
Include 'libgcc_s.so.1' which is necessary for (at least) proper LUKS
|
||||||
|
v2 handling.
|
||||||
|
|
||||||
|
|
||||||
2020-07-14 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
2020-07-14 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
||||||
|
|
||||||
* v0.7-1
|
* v0.7-1
|
||||||
Dropped 'dsa' private key support; added 'ed25519' private key support
|
Dropped 'dsa' private key support; added 'ed25519' private key support.
|
||||||
|
|
||||||
|
|
||||||
2018-03-13 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
2018-03-13 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
||||||
|
|
||||||
* v0.6-1
|
* v0.6-1
|
||||||
Dropped '-m' option when calling dropbear (latest ArchLinux version does not handle it)
|
Dropped '-m' option when calling dropbear (latest ArchLinux version
|
||||||
|
does not handle it).
|
||||||
|
|
||||||
|
|
||||||
2017-06-25 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
2017-06-25 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
||||||
|
|
||||||
* v0.5-1
|
* v0.5-1
|
||||||
Fixed cryptsetup additional arguments handling: were not properly passed
|
Fixed cryptsetup additional arguments handling: were not properly
|
||||||
|
passed.
|
||||||
|
|
||||||
|
|
||||||
2017-06-25 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
2017-06-25 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
||||||
|
|
||||||
* v0.4-1
|
* v0.4-1
|
||||||
Fixed TRIM option handling in /etc/crypttab: 'discard' ('allow-discards' being the switch name to use in cryptsetup)
|
Fixed TRIM option handling in /etc/crypttab: 'discard'
|
||||||
|
('allow-discards' being the switch name to use in cryptsetup).
|
||||||
|
|
||||||
|
|
||||||
2015-11-22 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
2015-11-22 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
||||||
|
|
||||||
* v0.3-1
|
* v0.3-1
|
||||||
Added configurable timeout for ipconfig
|
Added configurable timeout for ipconfig.
|
||||||
Moved configuration file from /etc/dropbear/initrd.env to /etc/initcpio/sshcs_env
|
Moved configuration file from /etc/dropbear/initrd.env to
|
||||||
|
/etc/initcpio/sshcs_env.
|
||||||
|
|
||||||
|
|
||||||
2014-05-20 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
2014-05-20 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
||||||
|
|
||||||
* v0.2-1
|
* v0.2-1
|
||||||
Removed unnecessary dependency: psmisc
|
Removed unnecessary dependency: psmisc.
|
||||||
Added configurable timeout to unlock devices before automatic poweroff
|
Added configurable timeout to unlock devices before automatic poweroff.
|
||||||
|
|
||||||
|
|
||||||
2014-05-19 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
2014-05-19 Julien Coloos <julien.coloos [at] gmail [dot] com>
|
||||||
|
|
||||||
* v0.1-1
|
* v0.1-1
|
||||||
|
|
||||||
* Code adapted from dropbear_initrd_encrypt (https://aur.archlinux.org/packages/dropbear_initrd_encrypt/)
|
Code adapted from dropbear_initrd_encrypt.
|
||||||
Reworked code
|
See: https://aur.archlinux.org/packages/dropbear_initrd_encrypt/
|
||||||
Dropped non-LUKS support
|
|
||||||
Rely on /etc/crypttab
|
|
||||||
Handle multiple devices to unlock
|
|
||||||
Merged dropbear and encryptssh hooks
|
|
||||||
Better resources cleanup
|
|
||||||
|
|
||||||
|
Reworked code.
|
||||||
|
Dropped non-LUKS support.
|
||||||
|
Rely on /etc/crypttab.
|
||||||
|
Handle multiple devices to unlock.
|
||||||
|
Merged dropbear and encryptssh hooks.
|
||||||
|
Better resources cleanup.
|
||||||
|
|||||||
8
PKGBUILD
8
PKGBUILD
@@ -1,7 +1,7 @@
|
|||||||
# Maintainer: Julien Coloos <julien.coloos [at] gmail [dot] com>
|
# Maintainer: Julien Coloos <julien.coloos [at] gmail [dot] com>
|
||||||
pkgname=initrd-ssh-cryptsetup
|
pkgname=initrd-ssh-cryptsetup
|
||||||
pkgver=1.0
|
pkgver=1.1
|
||||||
pkgrel=1
|
pkgrel=2
|
||||||
pkgdesc="Allows to remotely unlock LUKS-encrypted devices over SSH"
|
pkgdesc="Allows to remotely unlock LUKS-encrypted devices over SSH"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
url="https://github.com/suiryc/archlinux-$pkgname"
|
url="https://github.com/suiryc/archlinux-$pkgname"
|
||||||
@@ -9,8 +9,8 @@ license=('GPL3')
|
|||||||
depends=('dropbear' 'cryptsetup' 'mkinitcpio-nfs-utils' 'iproute2' 'ethtool')
|
depends=('dropbear' 'cryptsetup' 'mkinitcpio-nfs-utils' 'iproute2' 'ethtool')
|
||||||
install=$pkgname.install
|
install=$pkgname.install
|
||||||
changelog='ChangeLog'
|
changelog='ChangeLog'
|
||||||
source=("http://julien.coloos.free.fr/archlinux/$pkgname-$pkgver.tar.xz" "$pkgname.install")
|
source=("http://julien.coloos.free.fr/archlinux/$pkgname-$pkgver-$pkgrel.tar.xz" "$pkgname.install")
|
||||||
sha256sums=('de6ef287ecfd57614835fec1fcaa01eb3a7f999d42a749e20b6747671320508f'
|
sha256sums=('bfd3e55ef8d3dd9e0b24f5b6b708a41520ee426ed980366f7ffbd12e30b5230b'
|
||||||
'b84978b3c2ef32208c2b104ee2d3ce8aaec26da0bd4e9e1c83942f373bbf6285')
|
'b84978b3c2ef32208c2b104ee2d3ce8aaec26da0bd4e9e1c83942f373bbf6285')
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ For example:
|
|||||||
## Building notes
|
## Building notes
|
||||||
1. Modify the sources (features in `src`, and/or package building files)
|
1. Modify the sources (features in `src`, and/or package building files)
|
||||||
2. If `src` was modified
|
2. If `src` was modified
|
||||||
* bump `pkgver` in `PKGBUILD`
|
* bump `pkgver`, or `pkgrel`, in `PKGBUILD`
|
||||||
* archive the `src` folder in `$pkgname-$pkgver.tar.xz` file; e.g.: `tar -cJf initrd-ssh-cryptsetup-$(grep "^pkgver=" PKGBUILD | cut -d'=' -f2).tar.xz src`
|
* archive the `src` folder in `$pkgname-$pkgver-$pkgrel.tar.xz` file; e.g.: `tar -cJf initrd-ssh-cryptsetup-$(grep "^pkgver=" PKGBUILD | cut -d'=' -f2)-$(grep "^pkgrel=" PKGBUILD | cut -d'=' -f2).tar.xz src`
|
||||||
* upload the archive on the online repository (pointed by `PKGBUILD`)
|
* upload the archive on the online repository (pointed by `PKGBUILD`)
|
||||||
3. Update ChangeLog
|
3. Update ChangeLog
|
||||||
4. Update `PKGBUILD`
|
4. Update `PKGBUILD`
|
||||||
|
|||||||
@@ -52,56 +52,70 @@ build() {
|
|||||||
|
|
||||||
sshcs_check_keys
|
sshcs_check_keys
|
||||||
|
|
||||||
add_checked_modules "/drivers/net/"
|
# Note: parts of this script (modules/binaries/files added) are the same than
|
||||||
# Note: parts of this script (modules/binaries added) are the same than the
|
# other install scripts (/usr/lib/initcpio/install/):
|
||||||
# 'encrypt' install script (/usr/lib/initcpio/install/encrypt) which is the
|
# - 'encryp': nominal support of encrypted volumes at boot time
|
||||||
# nominal one to deal with encrypted volumes at boot time.
|
# - 'net': network tools
|
||||||
add_module dm-crypt
|
|
||||||
# Note: crypto modules are necessary
|
## Modules
|
||||||
if [ -n "${CRYPTO_MODULES}" ]; then
|
# (from 'encrypt')
|
||||||
|
add_module 'dm-crypt'
|
||||||
|
add_module 'dm-integrity'
|
||||||
|
if [[ $CRYPTO_MODULES ]]; then
|
||||||
local mod
|
local mod
|
||||||
for mod in ${CRYPTO_MODULES}; do
|
for mod in $CRYPTO_MODULES; do
|
||||||
add_module "${mod}"
|
add_module "$mod"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
add_all_modules "/crypto/"
|
add_all_modules '/crypto/'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Note: dmsetup is necessary for device mapper features
|
# (from 'net')
|
||||||
add_binary "cryptsetup"
|
add_checked_modules '/drivers/net/'
|
||||||
add_binary "dmsetup"
|
|
||||||
add_binary "dropbear"
|
|
||||||
add_binary "ip"
|
|
||||||
add_binary "/usr/lib/initcpio/ipconfig" "/bin/ipconfig"
|
|
||||||
add_binary "ethtool"
|
|
||||||
|
|
||||||
# Our hook files
|
|
||||||
|
## Binaries
|
||||||
|
# (from 'encrypt')
|
||||||
|
add_binary 'cryptsetup'
|
||||||
|
# cryptsetup calls pthread_create(), which dlopen()s libgcc_s.so.1
|
||||||
|
# Note: at least necessary for LUKS v2 volumes.
|
||||||
|
# Also see similar/related bug reports (e.g. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=950254).
|
||||||
|
add_binary '/usr/lib/libgcc_s.so.1'
|
||||||
|
|
||||||
|
# (from 'net')
|
||||||
|
add_binary '/usr/lib/initcpio/ipconfig' '/bin/ipconfig'
|
||||||
|
|
||||||
|
# (ours)
|
||||||
|
# Note: dmsetup is necessary for device mapper features
|
||||||
|
add_binary 'dmsetup'
|
||||||
|
add_binary 'dropbear'
|
||||||
|
add_binary 'ip'
|
||||||
|
add_binary 'ethtool'
|
||||||
|
|
||||||
|
|
||||||
|
## Other files
|
||||||
|
# (from 'encrypt')
|
||||||
|
# cryptsetup-related files
|
||||||
|
map add_udev_rule \
|
||||||
|
'10-dm.rules' \
|
||||||
|
'13-dm-disk.rules' \
|
||||||
|
'95-dm-notify.rules'
|
||||||
|
|
||||||
|
# (ours)
|
||||||
|
# Our script and options
|
||||||
[ -e "${sshcs_env}" ] && add_file "${sshcs_env}"
|
[ -e "${sshcs_env}" ] && add_file "${sshcs_env}"
|
||||||
# Note: use /usr/local/bin, even though everything actually points to /usr/bin
|
# Note: use /usr/local/bin, even though everything actually points to /usr/bin
|
||||||
# in initramfs.
|
# in initramfs.
|
||||||
add_file "/usr/lib/initcpio/hooks/ssh-cryptsetup-tools" "/usr/local/bin/ssh-cryptsetup-tools"
|
add_file '/usr/lib/initcpio/hooks/ssh-cryptsetup-tools' '/usr/local/bin/ssh-cryptsetup-tools'
|
||||||
|
|
||||||
# auth-related files
|
|
||||||
add_file "/lib/libnss_files.so"
|
|
||||||
|
|
||||||
# SSH-related files
|
# SSH-related files
|
||||||
add_file "${dropbear_authorized_keys}" "/root/.ssh/authorized_keys"
|
add_file "${dropbear_authorized_keys}" '/root/.ssh/authorized_keys'
|
||||||
for keytype in "${dropbear_key_types[@]}"; do
|
for keytype in "${dropbear_key_types[@]}"; do
|
||||||
add_file "${dropbear_keyfile_prefix}${keytype}${dropbear_keyfile_suffix}"
|
add_file "${dropbear_keyfile_prefix}${keytype}${dropbear_keyfile_suffix}"
|
||||||
done
|
done
|
||||||
|
|
||||||
# cryptsetup-related files
|
# crypt partitions
|
||||||
add_file "${etc_crypttab}"
|
add_file "${etc_crypttab}"
|
||||||
add_file "/usr/lib/udev/rules.d/10-dm.rules"
|
|
||||||
add_file "/usr/lib/udev/rules.d/13-dm-disk.rules"
|
|
||||||
add_file "/usr/lib/udev/rules.d/95-dm-notify.rules"
|
|
||||||
add_file "/usr/lib/initcpio/udev/11-dm-initramfs.rules" "/usr/lib/udev/rules.d/11-dm-initramfs.rules"
|
|
||||||
|
|
||||||
# At least with LUKS v2 volumes, cryptsetup calls pthread_cancel(), which
|
|
||||||
# dlopen()s libgcc_s.so.1.
|
|
||||||
# See the nominal 'encrypt' module, and similar/related bug reports (e.g.
|
|
||||||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=950254).
|
|
||||||
add_binary "/usr/lib/libgcc_s.so.1"
|
|
||||||
|
|
||||||
add_runscript
|
add_runscript
|
||||||
}
|
}
|
||||||
@@ -117,13 +131,25 @@ LUKS encrypted devices to unlock are derived from '/etc/crypttab', which must
|
|||||||
be present.
|
be present.
|
||||||
Some options can be set in '/etc/initcpio/sshcs_env' (file is sourced in
|
Some options can be set in '/etc/initcpio/sshcs_env' (file is sourced in
|
||||||
initrd shell):
|
initrd shell):
|
||||||
* 'sshcs_opt_timeout_ipconfig': time (s) to configure IP
|
* 'sshcs_opt_debug': whether to be more verbose about ongoing actions
|
||||||
- default: 10 seconds
|
- default: '0'
|
||||||
* 'sshcs_opt_listen': listening port (22 by default)
|
- any non-zero value to enable
|
||||||
* 'sshcs_opt_timeout_poweroff': time (s) to unlock devices before automatic
|
* 'sshcs_opt_net_wol': Wake-on-LAN option to set on network device
|
||||||
powering off
|
- default: 'g' (MagicPacket™)
|
||||||
- default (and minimum value): 2 minutes
|
- usually WOL is disabled once in initramfs shell
|
||||||
|
- set empty to not change network device WOL setting
|
||||||
|
* 'sshcs_opt_timeout_ipconfig': time (in seconds) to configure IP
|
||||||
|
- default: '10'
|
||||||
|
* 'sshcs_opt_listen': SSH listening port
|
||||||
|
- default: '22'
|
||||||
|
* 'sshcs_opt_timeout_poweroff': time (in seconds) to unlock devices before
|
||||||
|
automatic powering off
|
||||||
|
- default (and minimum value): '120' (2 minutes)
|
||||||
- negative value to deactivate
|
- negative value to deactivate
|
||||||
|
* 'sshcs_opt_use_shell': whether to start a full 'ash' shell
|
||||||
|
- default: '0'
|
||||||
|
- '1' to enable
|
||||||
|
- when disabled (the default), a script to unlock devices is executed instead
|
||||||
|
|
||||||
Each SSH server key ('dropbear_rsa_host_key', 'dropbear_ecdsa_host_key' and
|
Each SSH server key ('dropbear_rsa_host_key', 'dropbear_ecdsa_host_key' and
|
||||||
'dropbear_ed25519_host_key' in '/etc/dropbear' folder) is imported from OpenSSH
|
'dropbear_ed25519_host_key' in '/etc/dropbear' folder) is imported from OpenSSH
|
||||||
|
|||||||
Reference in New Issue
Block a user