Skip to content

Commit

Permalink
v131
Browse files Browse the repository at this point in the history
+ FStrim on finalize. Stable when using sync so far.
+ WiFi country code GB by default, same as Raspbian:
https://github.com/Fourdee/DietPi/issues/515#issuecomment-247980082
  • Loading branch information
Fourdee committed Sep 19, 2016
1 parent 86e1b62 commit 8a27839
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 21 deletions.
29 changes: 20 additions & 9 deletions PREP_SYSTEM_FOR_DIETPI.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
# - Sections with '#???', are optional, depending on the device and its specs. (eg: does it need bluetooth?)
#------------------------------------------------------------------------------------------------


#------------------------------------------------------------------------------------------------
#Packages
#------------------------------------------------------------------------------------------------

#Jessie , unified apt sources.
rm /etc/apt/sources.list.d/deb-multimedia.list

Expand Down Expand Up @@ -57,7 +62,7 @@ rm /etc/apt/sources.list.d/deb-multimedia.list
# deb-src http://ftp.debian.org/debian jessie-backports main contrib non-free
# deb-src http://ftp.debian.org/debian jessie-proposed-updates contrib non-free main

# - Everything else (not including RPi)
# - Everything else (excluding RPi!)
cat << _EOF_ > /etc/apt/sources.list
deb http://ftp.debian.org/debian jessie main contrib non-free
deb http://ftp.debian.org/debian jessie-updates main contrib non-free
Expand All @@ -84,29 +89,38 @@ apt-get purge libpod-* libpeas-* isc-dhcp-server gnome-* fonts-dejavu* eject dns
apt-get purge toilet toilet-fonts w-scan vlan weather-util* sysbench stress apt-transport-* cmake cmake-data device-tree-co* fping hddtemp haveged hostapd i2c-tools iperf ir-keytable libasound2* libmtp* libusb-dev lirc lsof ncurses-term pkg-config unicode-data rfkill pv mtp-tools m4 screen alsa-utils armbian-* autotools-dev bind9-host btrfs-tools bridge-utils cpufrequtils dvb-apps dtv-scan-table* evtest f3 figlet gcc gcc-4.8-* git git-man iozone3 ifenslave
apt-get purge -y linux-jessie-root-*

#+RPi
apt-get purge libraspberrypi-doc

#rm /etc/apt/sources.list.d/armbian.list
rm /etc/init.d/resize2fs
systemctl daemon-reload
rm /etc/update-motd.d/*


#+ dev packages
apt-get purge '\-dev$'
apt-get purge linux-headers*
apt-get purge '\-dev$' linux-headers*


apt-get autoremove --purge -y


#install
#install packages
echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile
apt-get install -y hfsplus iw debconf-utils xz-utils ifmetric fbset wpasupplicant resolvconf bc dbus bzip2 psmisc bash-completion cron whiptail sudo ntp ntfs-3g dosfstools parted hdparm pciutils usbutils zip htop wput wget fake-hwclock dphys-swapfile curl unzip ca-certificates console-setup console-data console-common keyboard-configuration wireless-tools wireless-regdb crda --no-install-recommends

#??? bluetooth if onboard device
apt-get install -y bluetooth

#FOURDEE: apt-get install pi-bluetooth #for desktop in dietpi-software?

#firmware
apt-get install -y firmware-realtek firmware-ralink firmware-brcm80211 firmware-atheros -y --no-install-recommends

#------------------------------------------------------------------------------------------------
#DIETPI STUFF
#------------------------------------------------------------------------------------------------

#Delete any non-root user (eg: pi)
userdel -f pi

Expand All @@ -116,8 +130,7 @@ rm -R /media
rm -R /tmp/*
rm -R /selinux

#DIETPI STUFF
#Create folders
#Create DietPi common folders
mkdir /DietPi

mkdir -p /mnt/dietpi_userdata
Expand Down Expand Up @@ -169,7 +182,6 @@ rm /etc/init.d/ntp &> /dev/null
#/etc/sysctl.conf | Check for a previous entry before adding this
echo -e "vm.swappiness=1" >> /etc/sysctl.conf

#----------------------------------------------------
#rc.local
cat << _EOF_ > /etc/rc.local
#!/bin/bash
Expand Down Expand Up @@ -292,7 +304,6 @@ echo -e "options 8188eu rtw_power_mgnt=0" > /etc/modprobe.d/8188eu.conf
#Set swapfile size
echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile

#--------SYSTEMD---------
#nano /etc/systemd/logind.conf
#NAutoVTs=1

Expand Down Expand Up @@ -347,7 +358,7 @@ systemctl daemon-reload

dpkg-reconfigure tzdata #Europe > London
dpkg-reconfigure keyboard-configuration #Keyboard must be plugged in for this to work!
dpkg-reconfigure locales # en_GB.UTF8
dpkg-reconfigure locales # en_GB.UTF8 as default and only installed locale

#??? RPI ONLY: Scroll lock fix for RPi by Midwan: https://github.com/Fourdee/DietPi/issues/474#issuecomment-243215674
cat << _EOF_ > /etc/udev/rules.d/50-leds.rules
Expand Down
2 changes: 1 addition & 1 deletion dietpi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ wifi_hotspot_key=dietpihotspot
wifi_hotspot_channel=3

#WiFi country code. 2 character value (eg GB US DE JP): https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
wifi_country_code=
wifi_country_code=GB

#Serial Console: Set to 1 if you require a serial console during 1st run of DietPi.
serial_console_enabled=0
Expand Down
14 changes: 7 additions & 7 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -736,16 +736,16 @@ _EOF_
aSOFTWARE_AVAIL_HW_ARCH[$index_current,1]=0

#------------------
index_current=112
# index_current=112

aSOFTWARE_WHIP_NAME[$index_current]='UrBackup client'
aSOFTWARE_WHIP_DESC[$index_current]='full system backup client'
aSOFTWARE_CATEGORY_INDEX[$index_current]=4
aSOFTWARE_TYPE[$index_current]=0
aSOFTWARE_ONLINEDOC_URL[$index_current]='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
# aSOFTWARE_WHIP_NAME[$index_current]='UrBackup client'
# aSOFTWARE_WHIP_DESC[$index_current]='full system backup client'
# aSOFTWARE_CATEGORY_INDEX[$index_current]=4
# aSOFTWARE_TYPE[$index_current]=0
# aSOFTWARE_ONLINEDOC_URL[$index_current]='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

#No deb packages for ARMv6:
aSOFTWARE_AVAIL_HW_ARCH[$index_current,1]=0
# aSOFTWARE_AVAIL_HW_ARCH[$index_current,1]=0

#------------------
index_current=49
Expand Down
14 changes: 10 additions & 4 deletions dietpi/finalise
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,16 @@

fi

#////////////////////////////////////
#Copy Network Interface conf
cp /DietPi/dietpi/conf/network_interfaces /etc/network/interfaces
systemctl daemon-reload

#////////////////////////////////////
# WiFi country code to GB
/DietPi/dietpi/func/dietpi-set_hardware wifi enable # Must be enabled to set.
/DietPi/dietpi/func/dietpi-set_hardware wificountrycode GB
iw reg get

#Copy Network Interface conf
cp /DietPi/dietpi/conf/network_interfaces /etc/network/interfaces

# Disable wifi and bluetooth modules on all devices.
/DietPi/dietpi/func/dietpi-set_hardware bluetooth disable
Expand Down Expand Up @@ -253,7 +257,9 @@ _EOF_
# fi

#TRIM root FS
#fstrim -v /
sync
fstrim -v /
sync

#////////////////////////////////////
#Set Init .install_stage to -3 (first boot)
Expand Down

0 comments on commit 8a27839

Please sign in to comment.