Skip to content

Commit 3ab0d04

Browse files
committed
Preconfigure SSH on device
1 parent 7a70fb4 commit 3ab0d04

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

halium-install

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ do_shell()
3838
adb shell "$@"
3939
}
4040

41+
do_chroot()
42+
{
43+
do_shell "chroot /cache/system $@"
44+
}
45+
4146
convert_android_img()
4247
{
4348
if file $SYSIMG | grep -v ": Linux rev 1.0 ext4" >/dev/null; then
@@ -190,6 +195,13 @@ do_shell "cd /cache/system && zcat /recovery/$TARBALL | tar xf -"
190195
do_shell "[ -e /cache/system/SWAP.swap ] && mv /cache/system/SWAP.swap /data/SWAP.img"
191196
echo "[done]"
192197

198+
echo "Generating SSH host keys on the device"
199+
do_chroot "rm /etc/dropbear/dropbear_rsa_host_key"
200+
do_chroot "dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key"
201+
202+
echo "Changing password needed for root ssh login"
203+
do_chroot passwd root
204+
193205
echo -n "adding android system image to installation ... "
194206
convert_android_img
195207
ANDROID_DIR="/data"

0 commit comments

Comments
 (0)