Skip to content
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

v94 #82

Merged
merged 5 commits into from
Oct 7, 2015
Merged

v94 #82

Changes from 1 commit
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
Prev Previous commit
Next Next commit
v94
Fourdee committed Oct 5, 2015
commit 15a87ff4ddda6a463ae8a40f14e774369cb85912
4 changes: 3 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

v94
(xx/xx/15)
(xx/10/15)
New Image: DietPi for Raspberry Pi (Jessie) has been released.

New Features:

Changes:
35 changes: 19 additions & 16 deletions dietpi/boot
Original file line number Diff line number Diff line change
@@ -45,24 +45,23 @@
}

Partition_SD(){

#Stop Services
/DietPi/dietpi/dietpi-services stop

# Get starting partition sector for partition 2 / ext4
local partition_start=$(parted /dev/mmcblk0 -ms unit s p | grep ':ext4::;' | sed 's/:/ /g' | sed 's/s//g' | awk '{ print $2 }')
cat << _EOF_ | fdisk /dev/mmcblk0
p
d
2
n
p
2
$(parted /dev/mmcblk0 -ms unit s p | grep ':ext4::;' | sed 's/:/ /g' | sed 's/s//g' | awk '{ print $2 }')

#Recreate partition to full size of MicroSd card
echo -e "p
d
2
n
p
2
$partition_start
p
w

p
w
" | fdisk /dev/mmcblk0
_EOF_

}

@@ -217,8 +216,10 @@
/DietPi/dietpi/dietpi-banner 0
echo -e " The system will reboot to start the filesystem prep. \n Nearly done. \n"

echo -e "-2" > /DietPi/dietpi/.install_stage
echo -2 > /DietPi/dietpi/.install_stage

#SystemD. Does not process the ExecStop section of a service, if the same service is still running an ExecStart. So we must manually do what we need before reboot.
/DietPi/dietpi/conf/dietpi-service stop
reboot

#----------------------------------------------------------------
@@ -229,8 +230,10 @@
/DietPi/dietpi/dietpi-banner 0
echo -e " The system will reboot, This will complete the filesystem expansion \n"

echo -e "-1" > /DietPi/dietpi/.install_stage
echo -1 > /DietPi/dietpi/.install_stage

#SystemD. Does not process the ExecStop section of a service, if the same service is still running an ExecStart. So we must manually do what we need before reboot.
/DietPi/dietpi/conf/dietpi-service stop
reboot

#----------------------------------------------------------------
@@ -261,7 +264,7 @@
echo -e " Default Login:\n Username = root\n Password = dietpi\n"

#Set Install Stage index to trigger DietPi-Software installation on login
echo -e "0" > /DietPi/dietpi/.install_stage
echo 0 > /DietPi/dietpi/.install_stage

fi

14 changes: 7 additions & 7 deletions dietpi/conf/dietpi-service
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/bin/sh
#!/bin/bash -e
### BEGIN INIT INFO
# Provides: dietpi-service
# Required-Start: $local_fs
# Should-Start:
# Required-Stop: $local_fs
# Required-Stop: $local_fs
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: DietPi boot shutdown reboot.
### END INIT INFO

#-- commands for update --
#update-rc.d -f dietpi-service remove
#rm /etc/init.d/dietpi-service
#cp /DietPi/dietpi/conf/dietpi-service /etc/init.d/dietpi-service
#chmod +x /etc/init.d/dietpi-service
#update-rc.d dietpi-service defaults 00 80
# update-rc.d -f dietpi-service remove
# rm /etc/init.d/dietpi-service
# cp /DietPi/dietpi/conf/dietpi-service /etc/init.d/dietpi-service
# chmod +x /etc/init.d/dietpi-service
# update-rc.d dietpi-service defaults 00 80

NAME="dietpi-service"

29 changes: 20 additions & 9 deletions dietpi/dietpi-services
Original file line number Diff line number Diff line change
@@ -37,34 +37,44 @@
"haproxy"
)

FP_TEMP="/tmp/.dietpi-services_installed"

#/////////////////////////////////////////////////////////////////////////////////////
# Main
#/////////////////////////////////////////////////////////////////////////////////////
#Info
echo -e "\n DietPi-Services"
echo -e " Mode: $1"
echo -e " Please wait......"

#Find installed services
dpkg --get-selections > "$FP_TEMP"

#disable
if [ "$1" = "disable" ]; then
for ((i=0; i<${#aSERVICES[@]}; i++))
do
update-rc.d -f ${aSERVICES[$i]} disable &> /dev/null
if (( $(grep -ci -m1 "${aSERVICES[$i]}" "$FP_TEMP") == 1 )); then
update-rc.d -f ${aSERVICES[$i]} disable &> /dev/null

#+Jessie(SystemD)
systemctl disable ${aSERVICES[$i]} &> /dev/null
fi

done

echo -e " Completed"

#start/stop/restart
else
echo -e "\n DietPi-Services"
echo -e " Mode: $1"
echo -e " Please wait......"

dpkg --get-selections > /tmp/.dietpi-services_installed

for ((i=0; i<${#aSERVICES[@]}; i++))
do
if (( $(grep -ci -m1 "${aSERVICES[$i]}" /tmp/.dietpi-services_installed) == 1 )); then
if (( $(grep -ci -m1 "${aSERVICES[$i]}" "$FP_TEMP") == 1 )); then
service ${aSERVICES[$i]} $1 &> /dev/null
fi
done

rm /tmp/.dietpi-services_installed

#Non-service based control for specific software
/etc/raspimjpeg_init $1 &> /dev/null
/etc/deluge_init $1 &> /dev/null
@@ -83,6 +93,7 @@
fi

#-----------------------------------------------------------------------------------
rm "$FP_TEMP"
unset aSERVICES
#-----------------------------------------------------------------------------------
exit
4 changes: 0 additions & 4 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
@@ -3608,17 +3608,13 @@ _EOF_
"" "────Desktops────────────────────────────────" "off" \
"LXDE" "Ultra lightweight desktop." $desktop_w \
"" "────Media Systems───────────────────────────" "off" \
"Kodi" "Your very own media centre / player." $kodi_w \
"HiFi" "Web interface music / radio player." $hifi_w \
"MiniDLNA" "Media streaming server (DLNA, UPnP)." $minidlna_w \
"SubSonic" "Web interface media streaming server." $subsonic_w \
"SqueezeBox" "Logitech Media Server." $squeezeboxserver_w \
"" "────BitTorrent──────────────────────────────" "off" \
"Transmission" "BitTorrent server with web interface." $transmission_w \
"Deluge" "BitTorrent server with web interface." $deluge_w \
"" "────Gaming──────────────────────────────────" "off" \
"RetroPie" "Gaming: Turn your RPi into a gaming system." $retropie_w \
"OpenTyrian" "Gaming: A classic retro game, addictive." $opentyrian_w \
"" "────Cloud / Backups─────────────────────────" "off" \
"OwnCloud" "Your very own cloud (eg: dropbox)." $owncloud_w \
"" "────Forums / Blogs─────────────────────────" "off" \
3 changes: 3 additions & 0 deletions dietpi/finalise
Original file line number Diff line number Diff line change
@@ -26,6 +26,9 @@
#Stop services
/DietPi/dietpi/dietpi-services stop

#Disable services
/DietPi/dietpi/dietpi-services disable

#////////////////////////////////////
#Unmount Drives
umount /dev/sda[1-9]
3 changes: 3 additions & 0 deletions dietpi/login
Original file line number Diff line number Diff line change
@@ -86,6 +86,9 @@
#Ubuntu
elif (( $DISTRO == 2 )); then
startx -- -depth 16
#Jessie
elif (( $DISTRO == 3 )); then
startx
fi
#RetroPie/Emulation station
elif (( $AUTO_BOOT_INDEX == 3 )); then
44 changes: 41 additions & 3 deletions dietpi/patch_file
Original file line number Diff line number Diff line change
@@ -657,10 +657,48 @@ _EOF_
#Remove from /etc/bash.bashrc
#alias update='apt-get update && apt-get autoremove && apt-get upgrade && apt-get clean'

#Update DietPi-Service
update-rc.d -f dietpi-service remove
rm /etc/init.d/dietpi-service
cp /DietPi/dietpi/conf/dietpi-service /etc/init.d/dietpi-service
chmod +x /etc/init.d/dietpi-service
update-rc.d dietpi-service defaults 00 80

#Disable NTP
/DietPi/dietpi/dietpi-services disable
rm /etc/init.d/ntp &> /dev/null

#Jessie
# Remove init.d version of rc.local as we have setup a systemd rc.local.
#update-rc.d -f rc.local remove
#rm /etc/init.d/rc.local
if (( $DISTRO == 3 )); then
#New rc.local
cat << _EOF_ > /etc/rc.local
#!/bin/sh -e
/DietPi/dietpi/dietpi-services start
/DietPi/dietpi/dietpi-banner 0
echo -e " Default Login:\n Username = root\n Password = dietpi\n"
exit 0
_EOF_

#update rc-local service
update-rc.d -f rc.local remove
rm /etc/init.d/rc.local &> /dev/null
cat << _EOF_ > /etc/systemd/system/rc-local.service
[Unit]
Description=/etc/rc.local Compatibility
After=dietpi-service.service

[Service]
Type=idle
ExecStart=/etc/rc.local
StandardOutput=tty
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
_EOF_
systemctl enable rc-local.service
fi

#-------------------------------------------------------------------------------

fi