Skip to content

Commit

Permalink
Add step to create userconf.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
hardillb committed Jan 7, 2023
1 parent 1ecac57 commit 6ddaf06
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
4 changes: 3 additions & 1 deletion create-image
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ if { $64bit == "true" } {
expect "raspberrypi login: "
send "pi\n"
expect "Password: "
send "raspberry\n"
#send "raspberry\n"
send $env(PASSWORD)
send "\n"

expect "$ "
send "sudo apt-get update\n"
Expand Down
18 changes: 18 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

OFFSET=$(fdisk -l $1 | awk '/^[^ ]*1/{ print $2*512 }')
mkdir boot
sudo mount -o loop,offset=$OFFSET $1 boot

read -rsp "Please enter password for pi user: " PASSWORD
echo
PASS=$(echo $PASSWORD | openssl passwd -6 -stdin)
echo "pi:$PASS" > userconf.txt

sudo cp userconf.txt boot/userconf.txt
sudo sync

sudo umount boot
rmdir boot
export PASSWORD
./create-image $1

0 comments on commit 6ddaf06

Please sign in to comment.