2017-11-16 22:20:57 +00:00
|
|
|
#!/bin/sh
|
2017-08-24 21:07:36 +00:00
|
|
|
|
2017-11-16 22:20:57 +00:00
|
|
|
# Copyright 2017 Attila Szollosi
|
2017-08-24 21:07:36 +00:00
|
|
|
#
|
|
|
|
# This file is part of postmarketos-android-recovery-installer.
|
|
|
|
#
|
|
|
|
# postmarketos-android-recovery-installer is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# postmarketos-android-recovery-installer is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with postmarketos-android-recovery-installer. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2017-12-22 18:39:44 +00:00
|
|
|
exec >> /pmos.log 2>&1
|
|
|
|
set -ex
|
2017-11-16 22:20:57 +00:00
|
|
|
|
2017-08-24 21:07:36 +00:00
|
|
|
# shellcheck source=pmos_install_functions
|
2017-11-16 22:20:57 +00:00
|
|
|
. /bin/pmos_install_functions
|
2017-08-24 21:07:36 +00:00
|
|
|
|
|
|
|
extract_partition_table
|
|
|
|
set_subpartitions
|
2017-11-16 22:20:57 +00:00
|
|
|
echo "Set the password of the encrypted rootfs."
|
|
|
|
cryptsetup luksAddKey -d /lukskey "$ROOT_PARTITION"
|
2017-08-24 21:07:36 +00:00
|
|
|
# Remove temporary keyfile
|
2017-11-16 22:20:57 +00:00
|
|
|
cryptsetup luksRemoveKey "$ROOT_PARTITION" /lukskey
|
2017-08-24 21:07:36 +00:00
|
|
|
echo "Successfully added key to the LUKS device."
|