Build script update, ssh and signign keys
This commit is contained in:
parent
b08fa47aeb
commit
6f99b444a6
24
build.sh
24
build.sh
@ -5,17 +5,33 @@
|
||||
|
||||
echo "[+] Starting build script..."
|
||||
mkdir -p target/overlay/var/www/html
|
||||
|
||||
echo "[+] Cloning buildroot"
|
||||
git clone https://github.com/buildroot/buildroot.git target/buildroot
|
||||
echo "[+] Building the keygen"
|
||||
mkdir -p conf/usr/sbin
|
||||
gcc -lm -static -o conf/usr/sbin/cfgbin keygen/keygen.c
|
||||
strip conf/usr/sbin/cfgbin
|
||||
|
||||
echo "[+] Adding customization files"
|
||||
cp -R buildroot/* target/buildroot # copy buildroot configs
|
||||
cp -R conf/* target/overlay # copy target system config files
|
||||
cp -R webpanel/* target/overlay/var/www/html # copy the webpanel
|
||||
cp -R update/* target/overlay #copy the update script and certificate
|
||||
|
||||
echo "[+] Building the keygen"
|
||||
mkdir -p target/overlay/usr/sbin
|
||||
gcc -lm -static -o target/overlay/usr/sbin/cfgbin keygen/keygen.c
|
||||
strip target/overlay/usr/sbin/cfgbin
|
||||
|
||||
echo "[+] Generating Update Key"
|
||||
mkdir -p target/keys
|
||||
openssl genrsa -out target/keys/signingkey.pem 2048
|
||||
openssl rsa -in target/keys/signingkey.pem -outform PEM -pubout -out target/keys/signingpub.pem
|
||||
cp target/keys/signingpub.pem target/overlay/pub.pem
|
||||
|
||||
echo "[+] Generating Monitoring SSH Key"
|
||||
ssh-keygen -t ecdsa -f target/keys/sshkey -q -N ""
|
||||
mkdir -p target/overlay/root/.ssh
|
||||
cp target/keys/sshkey target/overlay/root/.ssh/authorized_keys
|
||||
chmod -R 600 target/overlay/root/.ssh/
|
||||
|
||||
echo "[+] Building the image"
|
||||
N=`grep -c '^processor' /proc/cpuinfo`
|
||||
cd target/buildroot
|
||||
|
@ -7,8 +7,8 @@ case "$1" in
|
||||
test -f /etc/serial || exit 0
|
||||
test -f /etc/ssid || exit 0
|
||||
test -f /etc/wpa || exit 0
|
||||
$SSID=`cat /etc/ssid`
|
||||
$WPA=`cat /etc/wpa`
|
||||
SSID=`cat /etc/ssid`
|
||||
WPA=`cat /etc/wpa`
|
||||
sed -i "s/{{SSID}}/$SSID/g" /etc/hostapd.conf
|
||||
sed -i "s/{{WPA}}/$WPA/g" /etc/hostapd.conf
|
||||
;;
|
||||
|
Loading…
Reference in New Issue
Block a user