Merge pull request #3 from grazzolini/develop
* Removed dropbear_initrd_encrypt leftovers. They were conflicting wi…
This commit is contained in:
commit
a16eaf622e
2 changed files with 0 additions and 32 deletions
|
@ -16,7 +16,4 @@ run_cleanuphook ()
|
||||||
if [ -f /var/run/dropbear.pid ]; then
|
if [ -f /var/run/dropbear.pid ]; then
|
||||||
kill `cat /var/run/dropbear.pid`
|
kill `cat /var/run/dropbear.pid`
|
||||||
fi
|
fi
|
||||||
. /ip_opts
|
|
||||||
/sbin/ip addr flush dev "$device"
|
|
||||||
/sbin/ip link set down "$device"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,10 +53,6 @@ generate_keys() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
make_etc_passwd() {
|
|
||||||
echo 'root:x:0:0:root:/:/bin/cryptsetup_shell' > "${TMPDIR}"/passwd
|
|
||||||
}
|
|
||||||
|
|
||||||
build ()
|
build ()
|
||||||
{
|
{
|
||||||
#
|
#
|
||||||
|
@ -82,37 +78,15 @@ build ()
|
||||||
copy_openssh_keys || generate_keys
|
copy_openssh_keys || generate_keys
|
||||||
display_fingerprints
|
display_fingerprints
|
||||||
|
|
||||||
[ -e "${TMPDIR}/passwd" ] && ( grep -q -e '^root:' "${TMPDIR}/passwd" ) || make_etc_passwd
|
|
||||||
|
|
||||||
add_checked_modules "/drivers/net/"
|
add_checked_modules "/drivers/net/"
|
||||||
add_binary "rm"
|
add_binary "rm"
|
||||||
add_binary "killall"
|
add_binary "killall"
|
||||||
add_binary "dropbear"
|
add_binary "dropbear"
|
||||||
|
|
||||||
cat <<SCRIPTEOF > ${TMPDIR}/cryptsetup_shell
|
|
||||||
#!/bin/sh
|
|
||||||
if [ -c "/dev/mapper/control" ]; then
|
|
||||||
if eval /sbin/cryptsetup luksOpen \`cat /.cryptdev\` \`cat /.cryptname\` \`cat /.cryptargs\` ; then
|
|
||||||
echo > /.done
|
|
||||||
killall cryptsetup
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "encryption bootup not succeeded. please wait!"
|
|
||||||
fi
|
|
||||||
SCRIPTEOF
|
|
||||||
|
|
||||||
chmod a+x ${TMPDIR}/cryptsetup_shell
|
|
||||||
|
|
||||||
add_file "${TMPDIR}/cryptsetup_shell" "/bin/cryptsetup_shell"
|
|
||||||
|
|
||||||
echo '/bin/cryptsetup_shell' > "${TMPDIR}"/shells
|
|
||||||
add_file "${TMPDIR}/shells" "/etc/shells"
|
|
||||||
|
|
||||||
cat /etc/dropbear/root_key > "${TMPDIR}"/authorized_keys
|
cat /etc/dropbear/root_key > "${TMPDIR}"/authorized_keys
|
||||||
|
|
||||||
add_dir "/.ssh"
|
add_dir "/.ssh"
|
||||||
add_file "${TMPDIR}/authorized_keys" "/.ssh/authorized_keys"
|
add_file "${TMPDIR}/authorized_keys" "/.ssh/authorized_keys"
|
||||||
add_file "${TMPDIR}/passwd" "/etc/passwd"
|
|
||||||
add_full_dir "/etc/dropbear"
|
add_full_dir "/etc/dropbear"
|
||||||
add_file "/lib/libnss_files.so.2"
|
add_file "/lib/libnss_files.so.2"
|
||||||
add_dir "/var/run"
|
add_dir "/var/run"
|
||||||
|
@ -122,10 +96,7 @@ SCRIPTEOF
|
||||||
add_file "${TMPDIR}/lastlog" "/var/log/lastlog"
|
add_file "${TMPDIR}/lastlog" "/var/log/lastlog"
|
||||||
|
|
||||||
# cleanup
|
# cleanup
|
||||||
rm "${TMPDIR}/cryptsetup_shell"
|
|
||||||
rm "${TMPDIR}/shells"
|
|
||||||
rm "${TMPDIR}/authorized_keys"
|
rm "${TMPDIR}/authorized_keys"
|
||||||
rm "${TMPDIR}/passwd"
|
|
||||||
rm "${TMPDIR}/lastlog"
|
rm "${TMPDIR}/lastlog"
|
||||||
|
|
||||||
add_runscript
|
add_runscript
|
||||||
|
|
Loading…
Reference in a new issue