Ensure that cryptsetup is always available
This commit is contained in:
parent
565e289b3c
commit
c0c4325eff
|
@ -782,7 +782,7 @@ chroot "$rootdir" apt-get install -y avahi-daemon avahi-utils avahi-discover ava
|
||||||
chroot "$rootdir" apt-get install -y iptables dnsutils net-tools network-manager iputils-ping
|
chroot "$rootdir" apt-get install -y iptables dnsutils net-tools network-manager iputils-ping
|
||||||
chroot "$rootdir" apt-get install -y libnss-mdns libnss-myhostname libnss-gw-name nano man ntp
|
chroot "$rootdir" apt-get install -y libnss-mdns libnss-myhostname libnss-gw-name nano man ntp
|
||||||
chroot "$rootdir" apt-get install -y locales locales-all debconf wireless-tools wpasupplicant
|
chroot "$rootdir" apt-get install -y locales locales-all debconf wireless-tools wpasupplicant
|
||||||
chroot "$rootdir" apt-get install -y usbutils
|
chroot "$rootdir" apt-get install -y usbutils cryptsetup zsh pinentry-curses
|
||||||
|
|
||||||
sed -i "s|#host-name=.*|host-name=${PROJECT_NAME}|g" $rootdir/etc/avahi/avahi-daemon.conf
|
sed -i "s|#host-name=.*|host-name=${PROJECT_NAME}|g" $rootdir/etc/avahi/avahi-daemon.conf
|
||||||
sed -i "s|host-name=.*|host-name=${PROJECT_NAME}|g" $rootdir/etc/avahi/avahi-daemon.conf
|
sed -i "s|host-name=.*|host-name=${PROJECT_NAME}|g" $rootdir/etc/avahi/avahi-daemon.conf
|
||||||
|
|
|
@ -547,10 +547,16 @@ function create_tomb {
|
||||||
tomb >> /var/log/${PROJECT_NAME}.log
|
tomb >> /var/log/${PROJECT_NAME}.log
|
||||||
fi
|
fi
|
||||||
TOMB_TEMP_PASSWORD="$(openssl rand -base64 32 | cut -c1-30)"
|
TOMB_TEMP_PASSWORD="$(openssl rand -base64 32 | cut -c1-30)"
|
||||||
|
echo "$TOMB_TEMP_PASSWORD" > /mnt/ramdisk/${tomb_name}.tomb.pass
|
||||||
tomb forge /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe
|
tomb forge /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe
|
||||||
tomb lock /tmp/${tomb_name}.tomb -k /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe
|
tomb lock /tmp/${tomb_name}.tomb -k /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe
|
||||||
tomb open /tmp/${tomb_name}.tomb -k /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe
|
tomb open /tmp/${tomb_name}.tomb -k /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe
|
||||||
|
# update /etc/crypttab so that the rest of the os has access
|
||||||
|
cryptsetup luksAddKey --key-file=/mnt/ramdisk/${tomb_name}.tomb.key /tmp/${tomb_name}.tomb newkey --password="${TOMB_TEMP_PASSWORD}"
|
||||||
|
|
||||||
|
# stop stuff from popping up
|
||||||
pkill caja
|
pkill caja
|
||||||
|
|
||||||
# clear the temporary password
|
# clear the temporary password
|
||||||
TOMB_TEMP_PASSWORD=
|
TOMB_TEMP_PASSWORD=
|
||||||
}
|
}
|
||||||
|
@ -563,6 +569,12 @@ function setup_amnesic_data {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# clear crypttab
|
||||||
|
if [ -f /etc/crypttab ]; then
|
||||||
|
shred -zu /etc/crypttab
|
||||||
|
touch /etc/crypttab
|
||||||
|
fi
|
||||||
|
|
||||||
tomb_name=log
|
tomb_name=log
|
||||||
create_tomb ${tomb_name} $TOMB_LOG_SIZE_MB
|
create_tomb ${tomb_name} $TOMB_LOG_SIZE_MB
|
||||||
if [ -d /media/${tomb_name} ]; then
|
if [ -d /media/${tomb_name} ]; then
|
||||||
|
|
Loading…
Reference in New Issue