##// END OF EJS Templates
vidal -
r771:4df6af10b471 Fusion
parent child
Show More
@@ -13,6 +13,9 sed -i "s/^RaspberryPI/${HOSTNAME}/" "${ETC_DIR}/hostname"
13 install_readonly files/network/hosts "${ETC_DIR}/hosts"
13 install_readonly files/network/hosts "${ETC_DIR}/hosts"
14 sed -i "s/RaspberryPI/${HOSTNAME}/" "${ETC_DIR}/hosts"
14 sed -i "s/RaspberryPI/${HOSTNAME}/" "${ETC_DIR}/hosts"
15
15
16 # Ensure /etc/systemd/network directory is available
17 mkdir -p "${ETC_DIR}/systemd/network"
18
16 # Setup hostname entry with static IP
19 # Setup hostname entry with static IP
17 if [ "$NET_ETH_ADDRESS" != "" ] ; then
20 if [ "$NET_ETH_ADDRESS" != "" ] ; then
18 NET_IP=$(echo "${NET_ETH_ADDRESS}" | cut -f 1 -d'/')
21 NET_IP=$(echo "${NET_ETH_ADDRESS}" | cut -f 1 -d'/')
@@ -68,6 +71,7 fi
68
71
69
72
70 if [ "$ENABLE_WIRELESS" = true ] ; then
73 if [ "$ENABLE_WIRELESS" = true ] ; then
74 mkdir -p "${ETC_DIR}/wpa_supplicant"
71 if [ "$ENABLE_WIFI_DHCP" = true ] ; then
75 if [ "$ENABLE_WIFI_DHCP" = true ] ; then
72 # Enable DHCP configuration for interface eth0
76 # Enable DHCP configuration for interface eth0
73 sed -i -e "s/DHCP=.*/DHCP=yes/" -e "/DHCP/q" "${ETC_DIR}/systemd/network/wlan0.network"
77 sed -i -e "s/DHCP=.*/DHCP=yes/" -e "/DHCP/q" "${ETC_DIR}/systemd/network/wlan0.network"
@@ -94,19 +98,18 if [ "$ENABLE_WIRELESS" = true ] ; then
94 fi
98 fi
95 fi
99 fi
96
100
97 if [ -z "$NET_WIFI_SSID" ] && [ -z "$NET_WIFI_PSK" ] ; then
101 if [ ! -z "$NET_WIFI_SSID" ] && [ ! -z "$NET_WIFI_PSK" ] ; then
98 printf "
102 chroot_exec printf "
99 ctrl_interface=/run/wpa_supplicant
103 ctrl_interface=/run/wpa_supplicant
100 ctrl_interface_group=wheel
101 update_config=1
104 update_config=1
102 eapol_version=1
105 eapol_version=1
103 ap_scan=1
106 ap_scan=1
104 fast_reauth=1
107 fast_reauth=1
105
108
106 " > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
109 " > "${ETC_DIR}/wpa_supplicant/wpa_supplicant-wlan0.conf"
107
110
108 #Configure WPA_supplicant
111 #Configure WPA_supplicant
109 chroot_exec wpa_passphrase "$NET_SSID" "$NET_WPAPSK" >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
112 chroot_exec wpa_passphrase "$NET_WIFI_SSID" "$NET_WIFI_PSK" >> "${ETC_DIR}/wpa_supplicant/wpa_supplicant-wlan0.conf"
110
113
111 chroot_exec systemctl enable wpa_supplicant.service
114 chroot_exec systemctl enable wpa_supplicant.service
112 chroot_exec systemctl enable wpa_supplicant@wlan0.service
115 chroot_exec systemctl enable wpa_supplicant@wlan0.service
@@ -75,7 +75,11 if [ "$ENABLE_REDUCE" = true ] ; then
75
75
76 # Remove sound utils and libraries
76 # Remove sound utils and libraries
77 if [ "$ENABLE_SOUND" = false ] ; then
77 if [ "$ENABLE_SOUND" = false ] ; then
78 chroot_exec apt-get -qq -y purge alsa-utils libsamplerate0 libasound2 libasound2-data
78 if [ "$ENABLE_BLUETOOTH" = false ] ; then
79 chroot_exec apt-get -qq -y purge alsa-utils libsamplerate0 libasound2 libasound2-data
80 else
81 chroot_exec apt-get -qq -y purge alsa-utils libsamplerate0
82 fi
79 fi
83 fi
80
84
81 # Remove GPU kernels
85 # Remove GPU kernels
@@ -91,6 +95,9 if [ "$ENABLE_REDUCE" = true ] ; then
91 rm -f "${R}/boot/vmlinuz-*"
95 rm -f "${R}/boot/vmlinuz-*"
92 rm -f "${R}/boot/initrd.img-*"
96 rm -f "${R}/boot/initrd.img-*"
93 fi
97 fi
98
99 #Reduce BOOT
100 #Only necessary files for my gen pi
94
101
95 # Clean APT list of repositories
102 # Clean APT list of repositories
96 rm -fr "${R}/var/lib/apt/lists/*"
103 rm -fr "${R}/var/lib/apt/lists/*"
@@ -1,4 +1,4
1 #!/bin/sh
1 #!/bin/bash
2 ########################################################################
2 ########################################################################
3 # rpi23-gen-image.sh 2015-2017
3 # rpi23-gen-image.sh 2015-2017
4 #
4 #
@@ -806,7 +806,7 CHROOT_SIZE=$(expr "$(du -s "${R}" | awk '{ print $1 }')")
806
806
807 # Calculate the amount of needed 512 Byte sectors
807 # Calculate the amount of needed 512 Byte sectors
808 TABLE_SECTORS=$(expr 1 \* 1024 \* 1024 \/ 512)
808 TABLE_SECTORS=$(expr 1 \* 1024 \* 1024 \/ 512)
809 FRMW_SECTORS=$(expr 64 \* 1024 \* 1024 \/ 512)
809 FRMW_SECTORS=$(expr 128 \* 1024 \* 1024 \/ 512)
810 ROOT_OFFSET=$(expr "${TABLE_SECTORS}" + "${FRMW_SECTORS}")
810 ROOT_OFFSET=$(expr "${TABLE_SECTORS}" + "${FRMW_SECTORS}")
811
811
812 # The root partition is EXT4
812 # The root partition is EXT4
@@ -834,8 +834,8 EOM
834 ${TABLE_SECTORS},${ROOT_SECTORS},83
834 ${TABLE_SECTORS},${ROOT_SECTORS},83
835 EOM
835 EOM
836
836
837 ## Setup temporary loop devices
837 # Setup temporary loop devices
838 FRMW_LOOP="$(losetup -o 1M --sizelimit 64M -f --show "$IMAGE_NAME"-frmw.img)"
838 FRMW_LOOP="$(losetup -o 1M --sizelimit 128M -f --show "$IMAGE_NAME"-frmw.img)"
839 ROOT_LOOP="$(losetup -o 1M -f --show "$IMAGE_NAME"-root.img)"
839 ROOT_LOOP="$(losetup -o 1M -f --show "$IMAGE_NAME"-root.img)"
840 # ENABLE_SPLITFS=false
840 # ENABLE_SPLITFS=false
841 else
841 else
@@ -849,8 +849,8 ${ROOT_OFFSET},${ROOT_SECTORS},83
849 EOM
849 EOM
850
850
851 # Setup temporary loop devices
851 # Setup temporary loop devices
852 FRMW_LOOP="$(losetup -o 1M --sizelimit 64M -f --show "$IMAGE_NAME".img)"
852 FRMW_LOOP="$(losetup -o 1M --sizelimit 128M -f --show "$IMAGE_NAME".img)"
853 ROOT_LOOP="$(losetup -o 65M -f --show "$IMAGE_NAME".img)"
853 ROOT_LOOP="$(losetup -o 129M -f --show "$IMAGE_NAME".img)"
854 fi
854 fi
855
855
856 if [ "$ENABLE_CRYPTFS" = true ] ; then
856 if [ "$ENABLE_CRYPTFS" = true ] ; then
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant