##// END OF EJS Templates
export everything to support manual executing of scripts...
Unknown -
r324:378e21af8a46
parent child
Show More
@@ -21,21 +21,6 else
21 echo "No precompiled kernel repositories were added"
21 echo "No precompiled kernel repositories were added"
22 fi
22 fi
23
23
24 #autconfigure best apt server to not spam ftp.debian.org
25 #rm files/apt/sources.list
26 #netselect-apt does not know buster yet
27 if [ "$RELEASE" = "buster" ] ; then
28 RLS=testing
29 else
30 RLS="$RELEASE"
31 fi
32
33 if [ "$ENABLE_NONFREE" = true ] ; then
34 netselect-apt --arch "$RELEASE_ARCH" --tests 10 --sources --nonfree --outfile "${ETC_DIR}/apt/sources.list" -d "$RLS"
35 else
36 netselect-apt --arch "$RELEASE_ARCH" --tests 10 --sources --outfile "${ETC_DIR}/apt/sources.list" -d "$RLS"
37 fi
38
39 #ipinfo=$(curl ipinfo.io | grep country )
24 #ipinfo=$(curl ipinfo.io | grep country )
40 #grep -o '\"[^"]*\"' $ipinfo | tr -d '"'
25 #grep -o '\"[^"]*\"' $ipinfo | tr -d '"'
41 #grep -Po '"country":.*?[^\\]",' $(curl ipinfo.io | grep country )
26 #grep -Po '"country":.*?[^\\]",' $(curl ipinfo.io | grep country )
@@ -73,6 +73,7 if [ "$ENABLE_UBOOT" = true ] ; then
73
73
74 if [ "$SET_ARCH" = 64 ] ; then
74 if [ "$SET_ARCH" = 64 ] ; then
75 echo "Setting up config.txt to boot 64bit uboot"
75 echo "Setting up config.txt to boot 64bit uboot"
76 printf "\n# Enable CPU 64 bit mode\narm_control=0x200\n" >> "${BOOT_DIR}/config.txt"
76 printf "\n# Tell u-boot a 64bit kernel is used\narm_64bit=1\n" >> "${BOOT_DIR}/config.txt"
77 printf "\n# Tell u-boot a 64bit kernel is used\narm_64bit=1\n" >> "${BOOT_DIR}/config.txt"
77 printf "\n# Device tree start addr\ndevice_tree_address=0x100\n" >> "${BOOT_DIR}/config.txt"
78 printf "\n# Device tree start addr\ndevice_tree_address=0x100\n" >> "${BOOT_DIR}/config.txt"
78 printf "\n# Device tree stop adrr\ndevice_tree_end=0x8000\n" >> "${BOOT_DIR}/config.txt"
79 printf "\n# Device tree stop adrr\ndevice_tree_end=0x8000\n" >> "${BOOT_DIR}/config.txt"
@@ -40,141 +40,141 echo -n -e "\n#\n# RPi2/3 Bootstrap Settings\n#\n"
40 set -x
40 set -x
41
41
42 # Raspberry Pi model configuration
42 # Raspberry Pi model configuration
43 RPI_MODEL=${RPI_MODEL:=2}
43 export RPI_MODEL=${RPI_MODEL:=2}
44
44
45 # Debian release
45 # Debian release
46 RELEASE=${RELEASE:=buster}
46 export RELEASE=${RELEASE:=buster}
47
47
48 #Kernel Branch
48 #Kernel Branch
49 KERNEL_BRANCH=${KERNEL_BRANCH:=""}
49 export KERNEL_BRANCH=${KERNEL_BRANCH:=""}
50
50
51 # URLs
51 # URLs
52 KERNEL_URL=${KERNEL_URL:=https://github.com/raspberrypi/linux}
52 export KERNEL_URL=${KERNEL_URL:=https://github.com/raspberrypi/linux}
53 FIRMWARE_URL=${FIRMWARE_URL:=https://github.com/raspberrypi/firmware/raw/master/boot}
53 export FIRMWARE_URL=${FIRMWARE_URL:=https://github.com/raspberrypi/firmware/raw/master/boot}
54 WLAN_FIRMWARE_URL=${WLAN_FIRMWARE_URL:=https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm}
54 export WLAN_FIRMWARE_URL=${WLAN_FIRMWARE_URL:=https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm}
55 FBTURBO_URL=${FBTURBO_URL:=https://github.com/ssvb/xf86-video-fbturbo.git}
55 export FBTURBO_URL=${FBTURBO_URL:=https://github.com/ssvb/xf86-video-fbturbo.git}
56 UBOOT_URL=${UBOOT_URL:=https://git.denx.de/u-boot.git}
56 export UBOOT_URL=${UBOOT_URL:=https://git.denx.de/u-boot.git}
57
57
58 # Firmware directory: Blank if download from github
58 # Firmware directory: Blank if download from github
59 RPI_FIRMWARE_DIR=${RPI_FIRMWARE_DIR:=""}
59 export RPI_FIRMWARE_DIR=${RPI_FIRMWARE_DIR:=""}
60
60
61 # Build directories
61 # Build directories
62 BASEDIR=${BASEDIR:=$(pwd)/images/${RELEASE}}
62 export BASEDIR=${BASEDIR:=$(pwd)/images/${RELEASE}}
63 BUILDDIR="${BASEDIR}/build"
63 export BUILDDIR="${BASEDIR}/build"
64
64
65 # Prepare date string for default image file name
65 # Prepare date string for default image file name
66 DATE="$(date +%Y-%m-%d)"
66 DATE="$(date +%Y-%m-%d)"
67 if [ -z "$KERNEL_BRANCH" ] ; then
67 if [ -z "$KERNEL_BRANCH" ] ; then
68 IMAGE_NAME=${IMAGE_NAME:=${BASEDIR}/${DATE}-${KERNEL_ARCH}-CURRENT-rpi${RPI_MODEL}-${RELEASE}-${RELEASE_ARCH}}
68 export IMAGE_NAME=${IMAGE_NAME:=${BASEDIR}/${DATE}-${KERNEL_ARCH}-CURRENT-rpi${RPI_MODEL}-${RELEASE}-${RELEASE_ARCH}}
69 else
69 else
70 IMAGE_NAME=${IMAGE_NAME:=${BASEDIR}/${DATE}-${KERNEL_ARCH}-${KERNEL_BRANCH}-rpi${RPI_MODEL}-${RELEASE}-${RELEASE_ARCH}}
70 export IMAGE_NAME=${IMAGE_NAME:=${BASEDIR}/${DATE}-${KERNEL_ARCH}-${KERNEL_BRANCH}-rpi${RPI_MODEL}-${RELEASE}-${RELEASE_ARCH}}
71 fi
71 fi
72
72
73 # Chroot directories
73 # Chroot directories
74 R="${BUILDDIR}/chroot"
74 export R="${BUILDDIR}/chroot"
75 ETC_DIR="${R}/etc"
75 export ETC_DIR="${R}/etc"
76 LIB_DIR="${R}/lib"
76 export LIB_DIR="${R}/lib"
77 BOOT_DIR="${R}/boot/firmware"
77 export BOOT_DIR="${R}/boot/firmware"
78 KERNEL_DIR="${R}/usr/src/linux"
78 export KERNEL_DIR="${R}/usr/src/linux"
79 WLAN_FIRMWARE_DIR="${R}/lib/firmware/brcm"
79 export WLAN_FIRMWARE_DIR="${R}/lib/firmware/brcm"
80
80
81 # General settings
81 # General settings
82 SET_ARCH=${SET_ARCH:=32}
82 export SET_ARCH=${SET_ARCH:=32}
83 HOSTNAME=${HOSTNAME:=rpi${RPI_MODEL}-${RELEASE}}
83 export HOSTNAME=${HOSTNAME:=rpi${RPI_MODEL}-${RELEASE}}
84 PASSWORD=${PASSWORD:=raspberry}
84 export PASSWORD=${PASSWORD:=raspberry}
85 USER_PASSWORD=${USER_PASSWORD:=raspberry}
85 export USER_PASSWORD=${USER_PASSWORD:=raspberry}
86 DEFLOCAL=${DEFLOCAL:="en_US.UTF-8"}
86 export DEFLOCAL=${DEFLOCAL:="en_US.UTF-8"}
87 TIMEZONE=${TIMEZONE:="Europe/Berlin"}
87 export TIMEZONE=${TIMEZONE:="Europe/Berlin"}
88 EXPANDROOT=${EXPANDROOT:=true}
88 export EXPANDROOT=${EXPANDROOT:=true}
89
89
90 # Keyboard settings
90 # Keyboard settings
91 XKB_MODEL=${XKB_MODEL:=""}
91 export XKB_MODEL=${XKB_MODEL:=""}
92 XKB_LAYOUT=${XKB_LAYOUT:=""}
92 export XKB_LAYOUT=${XKB_LAYOUT:=""}
93 XKB_VARIANT=${XKB_VARIANT:=""}
93 export XKB_VARIANT=${XKB_VARIANT:=""}
94 XKB_OPTIONS=${XKB_OPTIONS:=""}
94 export XKB_OPTIONS=${XKB_OPTIONS:=""}
95
95
96 # Network settings (DHCP)
96 # Network settings (DHCP)
97 ENABLE_DHCP=${ENABLE_DHCP:=true}
97 export ENABLE_DHCP=${ENABLE_DHCP:=true}
98
98
99 # Network settings (static)
99 # Network settings (static)
100 NET_ADDRESS=${NET_ADDRESS:=""}
100 export NET_ADDRESS=${NET_ADDRESS:=""}
101 NET_GATEWAY=${NET_GATEWAY:=""}
101 export NET_GATEWAY=${NET_GATEWAY:=""}
102 NET_DNS_1=${NET_DNS_1:=""}
102 export NET_DNS_1=${NET_DNS_1:=""}
103 NET_DNS_2=${NET_DNS_2:=""}
103 export NET_DNS_2=${NET_DNS_2:=""}
104 NET_DNS_DOMAINS=${NET_DNS_DOMAINS:=""}
104 export NET_DNS_DOMAINS=${NET_DNS_DOMAINS:=""}
105 NET_NTP_1=${NET_NTP_1:=""}
105 export NET_NTP_1=${NET_NTP_1:=""}
106 NET_NTP_2=${NET_NTP_2:=""}
106 export NET_NTP_2=${NET_NTP_2:=""}
107
107
108 # APT settings
108 # APT settings
109 APT_PROXY=${APT_PROXY:=""}
109 export APT_PROXY=${APT_PROXY:=""}
110 APT_SERVER=${APT_SERVER:="ftp.debian.org"}
110 export APT_SERVER=${APT_SERVER:="ftp.debian.org"}
111
111
112 # Feature settings
112 # Feature settings
113 ENABLE_CONSOLE=${ENABLE_CONSOLE:=true}
113 export ENABLE_CONSOLE=${ENABLE_CONSOLE:=true}
114 ENABLE_I2C=${ENABLE_I2C:=false}
114 export ENABLE_I2C=${ENABLE_I2C:=false}
115 ENABLE_SPI=${ENABLE_SPI:=false}
115 export ENABLE_SPI=${ENABLE_SPI:=false}
116 ENABLE_IPV6=${ENABLE_IPV6:=true}
116 export ENABLE_IPV6=${ENABLE_IPV6:=true}
117 ENABLE_SSHD=${ENABLE_SSHD:=true}
117 export ENABLE_SSHD=${ENABLE_SSHD:=true}
118 ENABLE_NONFREE=${ENABLE_NONFREE:=false}
118 export ENABLE_NONFREE=${ENABLE_NONFREE:=false}
119 ENABLE_WIRELESS=${ENABLE_WIRELESS:=false}
119 export ENABLE_WIRELESS=${ENABLE_WIRELESS:=false}
120 ENABLE_SOUND=${ENABLE_SOUND:=true}
120 export ENABLE_SOUND=${ENABLE_SOUND:=true}
121 ENABLE_DBUS=${ENABLE_DBUS:=true}
121 export ENABLE_DBUS=${ENABLE_DBUS:=true}
122 ENABLE_HWRANDOM=${ENABLE_HWRANDOM:=true}
122 export ENABLE_HWRANDOM=${ENABLE_HWRANDOM:=true}
123 ENABLE_MINGPU=${ENABLE_MINGPU:=false}
123 export ENABLE_MINGPU=${ENABLE_MINGPU:=false}
124 ENABLE_XORG=${ENABLE_XORG:=false}
124 export ENABLE_XORG=${ENABLE_XORG:=false}
125 ENABLE_WM=${ENABLE_WM:=""}
125 export ENABLE_WM=${ENABLE_WM:=""}
126 ENABLE_RSYSLOG=${ENABLE_RSYSLOG:=true}
126 export ENABLE_RSYSLOG=${ENABLE_RSYSLOG:=true}
127 ENABLE_USER=${ENABLE_USER:=true}
127 export ENABLE_USER=${ENABLE_USER:=true}
128 USER_NAME=${USER_NAME:="pi"}
128 export USER_NAME=${USER_NAME:="pi"}
129 ENABLE_ROOT=${ENABLE_ROOT:=false}
129 export ENABLE_ROOT=${ENABLE_ROOT:=false}
130 ENABLE_QEMU=${ENABLE_QEMU:=false}
130 export ENABLE_QEMU=${ENABLE_QEMU:=false}
131
131
132 # SSH settings
132 # SSH settings
133 SSH_ENABLE_ROOT=${SSH_ENABLE_ROOT:=false}
133 export SSH_ENABLE_ROOT=${SSH_ENABLE_ROOT:=false}
134 SSH_DISABLE_PASSWORD_AUTH=${SSH_DISABLE_PASSWORD_AUTH:=false}
134 export SSH_DISABLE_PASSWORD_AUTH=${SSH_DISABLE_PASSWORD_AUTH:=false}
135 SSH_LIMIT_USERS=${SSH_LIMIT_USERS:=false}
135 export SSH_LIMIT_USERS=${SSH_LIMIT_USERS:=false}
136 SSH_ROOT_PUB_KEY=${SSH_ROOT_PUB_KEY:=""}
136 export SSH_ROOT_PUB_KEY=${SSH_ROOT_PUB_KEY:=""}
137 SSH_USER_PUB_KEY=${SSH_USER_PUB_KEY:=""}
137 export SSH_USER_PUB_KEY=${SSH_USER_PUB_KEY:=""}
138
138
139 # Advanced settings
139 # Advanced settings
140 ENABLE_MINBASE=${ENABLE_MINBASE:=false}
140 export ENABLE_MINBASE=${ENABLE_MINBASE:=false}
141 ENABLE_REDUCE=${ENABLE_REDUCE:=false}
141 export ENABLE_REDUCE=${ENABLE_REDUCE:=false}
142 ENABLE_UBOOT=${ENABLE_UBOOT:=false}
142 export ENABLE_UBOOT=${ENABLE_UBOOT:=false}
143 UBOOTSRC_DIR=${UBOOTSRC_DIR:=""}
143 export UBOOTSRC_DIR=${UBOOTSRC_DIR:=""}
144 ENABLE_FBTURBO=${ENABLE_FBTURBO:=false}
144 export ENABLE_FBTURBO=${ENABLE_FBTURBO:=false}
145 FBTURBOSRC_DIR=${FBTURBOSRC_DIR:=""}
145 export FBTURBOSRC_DIR=${FBTURBOSRC_DIR:=""}
146 ENABLE_HARDNET=${ENABLE_HARDNET:=false}
146 export export ENABLE_HARDNET=${ENABLE_HARDNET:=false}
147 ENABLE_IPTABLES=${ENABLE_IPTABLES:=false}
147 export ENABLE_IPTABLES=${ENABLE_IPTABLES:=false}
148 ENABLE_SPLITFS=${ENABLE_SPLITFS:=false}
148 export ENABLE_SPLITFS=${ENABLE_SPLITFS:=false}
149 ENABLE_INITRAMFS=${ENABLE_INITRAMFS:=false}
149 export ENABLE_INITRAMFS=${ENABLE_INITRAMFS:=false}
150 ENABLE_IFNAMES=${ENABLE_IFNAMES:=true}
150 export ENABLE_IFNAMES=${ENABLE_IFNAMES:=true}
151 DISABLE_UNDERVOLT_WARNINGS=${DISABLE_UNDERVOLT_WARNINGS:=}
151 export DISABLE_UNDERVOLT_WARNINGS=${DISABLE_UNDERVOLT_WARNINGS:=}
152
152
153 # Kernel compilation settings
153 # Kernel compilation settings
154 BUILD_KERNEL=${BUILD_KERNEL:=true}
154 export BUILD_KERNEL=${BUILD_KERNEL:=true}
155 KERNEL_REDUCE=${KERNEL_REDUCE:=false}
155 export KERNEL_REDUCE=${KERNEL_REDUCE:=false}
156 KERNEL_THREADS=${KERNEL_THREADS:=1}
156 export KERNEL_THREADS=${KERNEL_THREADS:=1}
157 KERNEL_HEADERS=${KERNEL_HEADERS:=true}
157 export KERNEL_HEADERS=${KERNEL_HEADERS:=true}
158 KERNEL_MENUCONFIG=${KERNEL_MENUCONFIG:=false}
158 export KERNEL_MENUCONFIG=${KERNEL_MENUCONFIG:=false}
159 KERNEL_REMOVESRC=${KERNEL_REMOVESRC:=true}
159 export KERNEL_REMOVESRC=${KERNEL_REMOVESRC:=true}
160 KERNEL_OLDDEFCONFIG=${KERNEL_OLDDEFCONFIG:=false}
160 export KERNEL_OLDDEFCONFIG=${KERNEL_OLDDEFCONFIG:=false}
161 KERNEL_CCACHE=${KERNEL_CCACHE:=false}
161 export KERNEL_CCACHE=${KERNEL_CCACHE:=false}
162
162
163 # Kernel compilation from source directory settings
163 # Kernel compilation from source directory settings
164 KERNELSRC_DIR=${KERNELSRC_DIR:=""}
164 export KERNELSRC_DIR=${KERNELSRC_DIR:=""}
165 KERNELSRC_CLEAN=${KERNELSRC_CLEAN:=false}
165 export KERNELSRC_CLEAN=${KERNELSRC_CLEAN:=false}
166 KERNELSRC_CONFIG=${KERNELSRC_CONFIG:=true}
166 export KERNELSRC_CONFIG=${KERNELSRC_CONFIG:=true}
167 KERNELSRC_PREBUILT=${KERNELSRC_PREBUILT:=false}
167 export KERNELSRC_PREBUILT=${KERNELSRC_PREBUILT:=false}
168
168
169 # Reduce disk usage settings
169 # Reduce disk usage settings
170 REDUCE_APT=${REDUCE_APT:=true}
170 export REDUCE_APT=${REDUCE_APT:=true}
171 REDUCE_DOC=${REDUCE_DOC:=true}
171 export REDUCE_DOC=${REDUCE_DOC:=true}
172 REDUCE_MAN=${REDUCE_MAN:=true}
172 export REDUCE_MAN=${REDUCE_MAN:=true}
173 REDUCE_VIM=${REDUCE_VIM:=false}
173 export REDUCE_VIM=${REDUCE_VIM:=false}
174 REDUCE_BASH=${REDUCE_BASH:=false}
174 export REDUCE_BASH=${REDUCE_BASH:=false}
175 REDUCE_HWDB=${REDUCE_HWDB:=true}
175 export REDUCE_HWDB=${REDUCE_HWDB:=true}
176 REDUCE_SSHD=${REDUCE_SSHD:=true}
176 export REDUCE_SSHD=${REDUCE_SSHD:=true}
177 REDUCE_LOCALE=${REDUCE_LOCALE:=true}
177 export REDUCE_LOCALE=${REDUCE_LOCALE:=true}
178
178
179 # Encrypted filesystem settings
179 # Encrypted filesystem settings
180 ENABLE_CRYPTFS=${ENABLE_CRYPTFS:=false}
180 ENABLE_CRYPTFS=${ENABLE_CRYPTFS:=false}
@@ -187,15 +187,33 CRYPTFS_XTSKEYSIZE=${CRYPTFS_XTSKEYSIZE:=512}
187 CHROOT_SCRIPTS=${CHROOT_SCRIPTS:=""}
187 CHROOT_SCRIPTS=${CHROOT_SCRIPTS:=""}
188
188
189 # Packages required in the chroot build environment
189 # Packages required in the chroot build environment
190 APT_INCLUDES=${APT_INCLUDES:=""}
190 export APT_INCLUDES=${APT_INCLUDES:=""}
191 APT_INCLUDES="${APT_INCLUDES},apt-transport-https,apt-utils,ca-certificates,debian-archive-keyring,dialog,sudo,systemd,sysvinit-utils,locales,keyboard-configuration,console-setup"
191 APT_INCLUDES="${APT_INCLUDES},apt-transport-https,apt-utils,ca-certificates,debian-archive-keyring,dialog,sudo,systemd,sysvinit-utils,locales,keyboard-configuration,console-setup"
192
192
193 # Packages required for bootstrapping
193 # Packages required for bootstrapping
194 REQUIRED_PACKAGES="debootstrap debian-archive-keyring qemu-user-static binfmt-support dosfstools rsync bmap-tools whois git bc psmisc dbus sudo netselect-apt"
194 export REQUIRED_PACKAGES="debootstrap debian-archive-keyring qemu-user-static binfmt-support dosfstools rsync bmap-tools whois git bc psmisc dbus sudo netselect-apt"
195 MISSING_PACKAGES=""
195 export MISSING_PACKAGES=""
196
196
197 # Packages installed for c/c++ build environment in chroot (keep empty)
197 # Packages installed for c/c++ build environment in chroot (keep empty)
198 COMPILER_PACKAGES=""
198 export COMPILER_PACKAGES=""
199
200 #autconfigure best apt server to not spam ftp.debian.org
201 #rm files/apt/sources.list
202 #netselect-apt does not know buster yet
203 if [ "$RELEASE" = "buster" ] ; then
204 RLS=testing
205 else
206 RLS="$RELEASE"
207 fi
208
209 rm "${ETC_DIR}/apt/sources.list"
210
211 if [ "$ENABLE_NONFREE" = true ] ; then
212 netselect-apt --arch "$RELEASE_ARCH" --tests 10 --sources --nonfree --outfile "${ETC_DIR}/apt/sources.list" -d "$RLS"
213 else
214 netselect-apt --arch "$RELEASE_ARCH" --tests 10 --sources --outfile "${ETC_DIR}/apt/sources.list" -d "$RLS"
215 fi
216 APT_SERVER=$(grep -m 1 http /etc/apt/sources.list | cut -d ' ' -f 2)
199
217
200 #make script easier and more stable to use with convenient setup switch. Just setup SET_ARCH and RPI_MODEL and your good to go!
218 #make script easier and more stable to use with convenient setup switch. Just setup SET_ARCH and RPI_MODEL and your good to go!
201 if [ -n "$SET_ARCH" ] ; then
219 if [ -n "$SET_ARCH" ] ; then
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant