From 3ab0d04b34ffdb4b4a7dbc1a091148ee4cfae361 Mon Sep 17 00:00:00 2001 From: JBBgameich Date: Sun, 9 Jul 2017 13:31:43 +0200 Subject: [PATCH 1/2] Preconfigure SSH on device --- halium-install | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/halium-install b/halium-install index 6dd67cb..138ea6d 100755 --- a/halium-install +++ b/halium-install @@ -38,6 +38,11 @@ do_shell() adb shell "$@" } +do_chroot() +{ + do_shell "chroot /cache/system $@" +} + convert_android_img() { 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 -" do_shell "[ -e /cache/system/SWAP.swap ] && mv /cache/system/SWAP.swap /data/SWAP.img" echo "[done]" +echo "Generating SSH host keys on the device" +do_chroot "rm /etc/dropbear/dropbear_rsa_host_key" +do_chroot "dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key" + +echo "Changing password needed for root ssh login" +do_chroot passwd root + echo -n "adding android system image to installation ... " convert_android_img ANDROID_DIR="/data" From 141f1bedbc99c9a8a82767d605f9ea525a36b0ee Mon Sep 17 00:00:00 2001 From: JBBgameich Date: Mon, 17 Jul 2017 21:24:20 +0200 Subject: [PATCH 2/2] Use full paths --- halium-install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/halium-install b/halium-install index 138ea6d..554b681 100755 --- a/halium-install +++ b/halium-install @@ -196,11 +196,11 @@ do_shell "[ -e /cache/system/SWAP.swap ] && mv /cache/system/SWAP.swap /data/SWA echo "[done]" echo "Generating SSH host keys on the device" -do_chroot "rm /etc/dropbear/dropbear_rsa_host_key" -do_chroot "dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key" +do_chroot "/bin/rm /etc/dropbear/dropbear_rsa_host_key" +do_chroot "/usr/bin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key" echo "Changing password needed for root ssh login" -do_chroot passwd root +do_chroot "/usr/bin/passwd root" echo -n "adding android system image to installation ... " convert_android_img