|
@@ -50,6 +50,9 @@ CONFIG_FILENAME=
|
50
|
50
|
# Optional ssh public key to allow
|
51
|
51
|
SSH_PUBKEY="no"
|
52
|
52
|
|
|
53
|
+# Whether this is a generic image for mass redistribution on the interwebs
|
|
54
|
+GENERIC_IMAGE="no"
|
|
55
|
+
|
53
|
56
|
enable_eatmydata_override() {
|
54
|
57
|
chroot $rootdir apt-get install --no-install-recommends -y eatmydata
|
55
|
58
|
if [ -x $rootdir/usr/bin/eatmydata ] && \
|
|
@@ -181,6 +184,33 @@ admin_user_sudo() {
|
181
|
184
|
echo "$MY_USERNAME ALL=(ALL) ALL" >> $rootdir/etc/sudoers
|
182
|
185
|
}
|
183
|
186
|
|
|
187
|
+create_generic_image() {
|
|
188
|
+ if [[ $GENERIC_IMAGE == "no" ]]; then
|
|
189
|
+ return
|
|
190
|
+ fi
|
|
191
|
+ # Don't install any configuration. This will be a base system
|
|
192
|
+ CONFIG_FILENAME=
|
|
193
|
+ # The presence of this file indicates that the initial
|
|
194
|
+ # setup has not yet been completed
|
|
195
|
+ touch $rootdir/home/$MY_USERNAME/.initial_setup
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+ cat >> /home/$MY_USERNAME/.bashrc <<EOF
|
|
199
|
+if [ -f ~/.initial_setup ]; then
|
|
200
|
+ clear
|
|
201
|
+ echo '>>> Freedombone system initial setup <<<'
|
|
202
|
+ echo ''
|
|
203
|
+ echo 'The first thing you need to do is to change your password, otherwise'
|
|
204
|
+ echo 'your system will be insecure. Your password should be at least 10'
|
|
205
|
+ echo 'characters long and contain letters and numbers. Do this now:'
|
|
206
|
+ passwd
|
|
207
|
+ sudo su
|
|
208
|
+ freedombone menuconfig
|
|
209
|
+ rm ~/.initial_setup
|
|
210
|
+fi
|
|
211
|
+EOF
|
|
212
|
+}
|
|
213
|
+
|
184
|
214
|
continue_installation() {
|
185
|
215
|
# If a configuration file exists then run with it
|
186
|
216
|
# otherwise the interactive installer can be used
|
|
@@ -298,6 +328,7 @@ chroot "$rootdir" apt-get update
|
298
|
328
|
configure_ssh
|
299
|
329
|
configure_networking
|
300
|
330
|
admin_user_sudo
|
|
331
|
+create_generic_image
|
301
|
332
|
continue_installation
|
302
|
333
|
|
303
|
334
|
cd /
|