Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Ismael Luceno (8318fc8e451767ee2a4def3cc192c51fb83bfdda)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Ismael Luceno (8318fc8e451767ee2a4def3cc192c51fb83bfdda)
  • Date: Thu, 16 Jun 2016 18:27:23 +0000

GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:

smgl/init.d/DETAILS | 2 -
smgl/init.d/init.d/mountall.sh | 72
+++++++++++++++++++++++++++--------------
2 files changed, 49 insertions(+), 25 deletions(-)

New commits:
commit 3dd4e4c2e087cc841bb034f92e31b56d4916f5c8
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

init.d: Bump version to 2.2.15

commit 3181f276b9e58e64db0e393c1657378334315dc3
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

init.d: Add support for encrypted swap

Also rework the whole start_ecryptfs to support other encryption
schemes.

commit ac657459b17ca33a1f1a294e3421aafd4ab0d303
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

init.d: Improve /tmp cleanup by using find

diff --git a/smgl/init.d/DETAILS b/smgl/init.d/DETAILS
index 342a3f3..74b1d1a 100755
--- a/smgl/init.d/DETAILS
+++ b/smgl/init.d/DETAILS
@@ -1,5 +1,5 @@
SPELL=init.d
- VERSION=2.2.14
+ VERSION=2.2.15
LICENSE[0]=GPL
GATHER_DOCS=off
PATCHLEVEL=1
diff --git a/smgl/init.d/init.d/mountall.sh b/smgl/init.d/init.d/mountall.sh
index 95954c3..e28d806 100755
--- a/smgl/init.d/init.d/mountall.sh
+++ b/smgl/init.d/init.d/mountall.sh
@@ -73,29 +73,53 @@ scanlvm()

start_cryptfs()
{
- if optional_executable /usr/sbin/cryptsetup && [ -f /etc/crypttab ]
- then
- echo "Attempting to open luks encrypted partitions"
- grep -v '^#' /etc/crypttab |
- grep -v '^$' |
- while read line
- do
- parts=( $line )
- echo "Opening ${parts[0]} as ${parts[1]}"
- if cryptsetup isLuks ${parts[0]}
- then
- if [[ -b /dev/mapper/${parts[1]} ]]
- then
- builtin echo "Device already exists maybe its open already"
- else
- cryptsetup luksOpen ${parts[0]} ${parts[1]} < /dev/console >
/dev/console 2>&1
- fi
- else
- builtin echo "Error device ${parts[0]} isn't a luks partition"
- return 1
- fi
- done
- fi
+ optional_executable /usr/sbin/cryptsetup && [ -f /etc/crypttab ] || return
+ echo "Attempting to open encrypted block devices"
+ # TODO implement parsing of options
+ awk '
+ BEGIN {
+ T["loopaes"]
+ T["luks"]
+ T["plain"]
+ T["swap"]
+ T["tcrypt"]
+ }
+ /^#/ || $0=="" {next}
+ {
+ type = $3 in T ? $3 : "luks"
+ print $1, $2, type
+ }
+ ' /etc/crypttab |
+ while read dev name type opts
+ do
+ echo "Opening $dev as $name"
+ if [[ -b /dev/mapper/"$name" ]]
+ then
+ builtin echo "Device already exists, maybe it's open"
+ else
+ case "$type" in
+ swap)
+ type=plain opts="-d /dev/urandom -c aes-xts-plain64"
+ ;;&
+ luks)
+ if ! cryptsetup isLuks "$dev"
+ then
+ builtin echo "Error: $dev isn't a luks device"
+ return 1
+ fi
+ ;;&
+ *)
+ cryptsetup open --type "$type" "$dev" "$name" $opts \
+ </dev/console >/dev/console 2>&1
+ ;;&
+ swap)
+ mkswap /dev/mapper/"$name" &&
+ echo -n "Activating swap..." &&
+ swapon /dev/mapper/"$name"
+ ;;
+ esac
+ fi
+ done
}

start()
@@ -137,7 +161,7 @@ start()

if [ "$CLEAN_TMP" == "yes" ] ; then
echo "Cleaning out /tmp..."
- [ -d /tmp ] && shopt -s dotglob && rm -rf /tmp/* && shopt -u dotglob
+ [ -d /tmp ] && find /tmp -mindepth 1 -delete
evaluate_retval
fi




  • [SM-Commit] GIT changes to master grimoire by Ismael Luceno (8318fc8e451767ee2a4def3cc192c51fb83bfdda), Ismael Luceno, 06/16/2016

Archive powered by MHonArc 2.6.24.

Top of Page