Skip to content

Preconfigure SSH on device #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions halium-install
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 "/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 "/usr/bin/passwd root"

echo -n "adding android system image to installation ... "
convert_android_img
ANDROID_DIR="/data"
Expand Down