##// END OF EJS Templates
Merge pull request #220 from VonOx/custom-firstboot...
drtyhlpr -
r743:55670e666952 Fusion
parent child
Show More
@@ -1,56 +1,63
1 1 #
2 2 # First boot actions
3 3 #
4 4
5 5 # Load utility functions
6 6 . ./functions.sh
7 7
8 8 # Prepare rc.firstboot script
9 9 cat files/firstboot/10-begin.sh > "${ETC_DIR}/rc.firstboot"
10 10
11 11 # Prepare filesystem auto expand
12 12 if [ "$EXPANDROOT" = true ] ; then
13 13 if [ "$ENABLE_CRYPTFS" = false ] ; then
14 14 cat files/firstboot/20-expandroot.sh >> "${ETC_DIR}/rc.firstboot"
15 15 else
16 16 # Regenerate initramfs to remove encrypted root partition auto expand
17 17 cat files/firstboot/21-regenerate-initramfs.sh >> "${ETC_DIR}/rc.firstboot"
18 18 fi
19 19
20 20 # Restart dphys-swapfile so the size of the swap file is relative to the resized root partition
21 21 if [ "$ENABLE_DPHYSSWAP" = true ] ; then
22 22 cat files/firstboot/23-restart-dphys-swapfile.sh >> "${ETC_DIR}/rc.firstboot"
23 23 fi
24 24 fi
25 25
26 26 # Ensure openssh server host keys are regenerated on first boot
27 27 if [ "$SSH_ENABLE" = true ] ; then
28 28 cat files/firstboot/30-generate-ssh-keys.sh >> "${ETC_DIR}/rc.firstboot"
29 29 fi
30 30
31 31 if [ "$ENABLE_DBUS" = true ] ; then
32 32 # Ensure that dbus machine-id exists
33 33 cat files/firstboot/40-generate-machineid.sh >> "${ETC_DIR}/rc.firstboot"
34 34 fi
35 35
36 36 # Create /etc/resolv.conf symlink
37 37 cat files/firstboot/41-create-resolv-symlink.sh >> "${ETC_DIR}/rc.firstboot"
38 38
39 39 # Configure automatic network interface names
40 40 if [ "$ENABLE_IFNAMES" = true ] ; then
41 41 cat files/firstboot/42-config-ifnames.sh >> "${ETC_DIR}/rc.firstboot"
42 42 fi
43 43
44 # Execute custom firstboot scripts
45 if [ -d "custom.d/firstboot" ] ; then
46 for SCRIPT in custom.d/firstboot/*.sh; do
47 . "$SCRIPT"
48 done
49 fi
50
44 51 # Finalize rc.firstboot script
45 52 cat files/firstboot/99-finish.sh >> "${ETC_DIR}/rc.firstboot"
46 53 chmod +x "${ETC_DIR}/rc.firstboot"
47 54
48 55 # Install default rc.local if it does not exist
49 56 if [ ! -f "${ETC_DIR}/rc.local" ] ; then
50 57 install_exec files/etc/rc.local "${ETC_DIR}/rc.local"
51 58 fi
52 59
53 60 # Add rc.firstboot script to rc.local
54 61 sed -i '/exit 0/d' "${ETC_DIR}/rc.local"
55 62 echo /etc/rc.firstboot >> "${ETC_DIR}/rc.local"
56 63 echo exit 0 >> "${ETC_DIR}/rc.local"
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant