Skip to content

Commit

Permalink
[script] add devmode script
Browse files Browse the repository at this point in the history
  • Loading branch information
htruong committed Mar 5, 2018
1 parent 7573342 commit 236ca18
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 0 additions & 2 deletions make-crankshaft.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ set_up_loopdevs() {
cp precompiled/libaasdk.so ${TEMP_CHROOT_DIR}/usr/local/lib/
tar -xvf precompiled/libQt5_OpenGLES2.tar.xz -C ${TEMP_CHROOT_DIR}/

cp precompiled/brightness_max.sh ${TEMP_CHROOT_DIR}/usr/local/sbin/

cp precompiled/systemd_services/*.service ${TEMP_CHROOT_DIR}/etc/systemd/system/
cp precompiled/opt/* ${TEMP_CHROOT_DIR}/opt/crankshaft/

Expand Down
7 changes: 2 additions & 5 deletions precompiled/opt/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ if [ `gpio -g read $DEV_PIN` -eq 0 ] ; then

# ... but we don't see it being enabled
if ! [ -f $DEV_FILE ]; then
systemctl disable autoapp.service
systemctl start regenerate_ssh_host_keys.service
systemctl enable ssh
/opt/crankshaft/devmode.sh enable
touch $DEV_FILE
reboot
fi
Expand All @@ -26,8 +24,7 @@ else
# ... but there is a dev file
if [ -f $DEV_FILE ]; then
mount -o remount,rw /
systemctl enable autoapp.service
systemctl disable ssh
/opt/crankshaft/devmode.sh disable
rm -f $DEV_FILE
reboot
fi
Expand Down
10 changes: 6 additions & 4 deletions scripts/customize-image-pi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@

print_banner() {
echo "---- WELCOME TO THE RASPBERRY PI IMAGE CUSTOMIZER --------------"
sleep 1
echo " Congratulations, we have gone a long way."
sleep 1
echo " I will prepare some software for you, sit tight."
sleep 1
echo ""
echo ""
echo ""
Expand Down Expand Up @@ -64,12 +61,17 @@ house_keeping() {
chown root:root /etc/wpa_supplicant/wpa_supplicant.conf
fi

# set the hostname
echo "crankshaft" > /etc/hostname
sed -i "s/raspberrypi/crankshaft/" /etc/hosts

# enable the startup actions
systemctl enable splashscreen.service
systemctl enable autoapp.service
systemctl enable crankshaft_startup.service

systemctl disable resize2fs_once.service
/opt/crankshaft/devmode.sh disable
}


Expand Down
6 changes: 6 additions & 0 deletions scripts/read-only-fs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ WD_TARGET=1
# START INSTALL ------------------------------------------------------------
# All selections have been validated at this point...


# Given a filename, a regex pattern to match and a replacement string:
# Replace string if found, else no change.
# (# $1 = filename, $2 = pattern to match, $3 = replacement)
Expand Down Expand Up @@ -84,6 +85,11 @@ mark_script_run() {
echo
echo "Starting installation..."


# disable failed units due to readonly fs
systemctl disable systemd-rfkill.service


echo "Removing unwanted packages..."
#apt-get remove -y --force-yes --purge triggerhappy cron logrotate dbus \
# dphys-swapfile xserver-common lightdm fake-hwclock
Expand Down

0 comments on commit 236ca18

Please sign in to comment.