##// END OF EJS Templates
Added ENABLE_SWAP...
Yannick Schinko -
r520:4faf10532824
parent child
Show More
@@ -0,0 +1,5
1 logger -t "rc.firstboot" "Restarting dphys-swapfile"
2
3 if systemctl is-enabled dphys-swapfile ; then
4 systemctl restart dphys-swapfile
5 fi
@@ -93,6 +93,9 Set default system timezone. All available timezones can be found in the `/usr/s
93 93 ##### `EXPANDROOT`=true
94 94 Expand the root partition and filesystem automatically on first boot.
95 95
96 ##### `ENABLE_SWAP`=true
97 Enable swap. The size of the swapfile is chosen relative to the size of the root partition. It'll use the `dphys-swapfile` package for that.
98
96 99 ##### `ENABLE_QEMU`=false
97 100 Generate kernel (`vexpress_defconfig`), file system image (`qcow2`) and DTB files that can be used for QEMU full system emulation (`vexpress-A15`). The output files are stored in the `$(pwd)/images/qemu` directory. You can find more information about running the generated image in the QEMU section of this readme file.
98 101
@@ -10,28 +10,33 cat files/firstboot/10-begin.sh > "${ETC_DIR}/rc.firstboot"
10 10
11 11 # Ensure openssh server host keys are regenerated on first boot
12 12 if [ "$ENABLE_SSHD" = true ] ; then
13 cat files/firstboot/21-generate-ssh-keys.sh >> "${ETC_DIR}/rc.firstboot"
13 cat files/firstboot/20-generate-ssh-keys.sh >> "${ETC_DIR}/rc.firstboot"
14 14 fi
15 15
16 16 # Prepare filesystem auto expand
17 17 if [ "$EXPANDROOT" = true ] ; then
18 18 if [ "$ENABLE_CRYPTFS" = false ] ; then
19 cat files/firstboot/22-expandroot.sh >> "${ETC_DIR}/rc.firstboot"
19 cat files/firstboot/30-expandroot.sh >> "${ETC_DIR}/rc.firstboot"
20
21 # Restart dphys-swapfile so the size of the swap file is relative to the resized root partition
22 if [ "$ENABLE_SWAP" = true ] ; then
23 cat files/firstboot/31-restart-dphys-swapfile.sh >> "${ETC_DIR}/rc.firstboot"
24 fi
20 25 else
21 26 # Regenerate initramfs to remove encrypted root partition auto expand
22 cat files/firstboot/23-regenerate-initramfs.sh >> "${ETC_DIR}/rc.firstboot"
27 cat files/firstboot/33-regenerate-initramfs.sh >> "${ETC_DIR}/rc.firstboot"
23 28 fi
24 29 fi
25 30
26 31 # Ensure that dbus machine-id exists
27 cat files/firstboot/24-generate-machineid.sh >> "${ETC_DIR}/rc.firstboot"
32 cat files/firstboot/40-generate-machineid.sh >> "${ETC_DIR}/rc.firstboot"
28 33
29 34 # Create /etc/resolv.conf symlink
30 cat files/firstboot/25-create-resolv-symlink.sh >> "${ETC_DIR}/rc.firstboot"
35 cat files/firstboot/41-create-resolv-symlink.sh >> "${ETC_DIR}/rc.firstboot"
31 36
32 37 # Configure automatic network interface names
33 38 if [ "$ENABLE_IFNAMES" = true ] ; then
34 cat files/firstboot/26-config-ifnames.sh >> "${ETC_DIR}/rc.firstboot"
39 cat files/firstboot/42-config-ifnames.sh >> "${ETC_DIR}/rc.firstboot"
35 40 fi
36 41
37 42 # Finalize rc.firstboot script
1 NO CONTENT: file renamed from files/firstboot/21-generate-ssh-keys.sh to files/firstboot/20-generate-ssh-keys.sh
1 NO CONTENT: file renamed from files/firstboot/22-expandroot.sh to files/firstboot/30-expandroot.sh
1 NO CONTENT: file renamed from files/firstboot/23-regenerate-initramfs.sh to files/firstboot/33-regenerate-initramfs.sh
1 NO CONTENT: file renamed from files/firstboot/24-generate-machineid.sh to files/firstboot/40-generate-machineid.sh
1 NO CONTENT: file renamed from files/firstboot/25-create-resolv-symlink.sh to files/firstboot/41-create-resolv-symlink.sh
1 NO CONTENT: file renamed from files/firstboot/26-config-ifnames.sh to files/firstboot/42-config-ifnames.sh
@@ -83,6 +83,7 USER_PASSWORD=${USER_PASSWORD:=raspberry}
83 83 DEFLOCAL=${DEFLOCAL:="en_US.UTF-8"}
84 84 TIMEZONE=${TIMEZONE:="Europe/Berlin"}
85 85 EXPANDROOT=${EXPANDROOT:=true}
86 ENABLE_SWAP=${ENABLE_SWAP:=true}
86 87
87 88 # Keyboard settings
88 89 XKB_MODEL=${XKB_MODEL:=""}
@@ -484,6 +485,11 if [ "$EXPANDROOT" = true ] ; then
484 485 APT_INCLUDES="${APT_INCLUDES},parted"
485 486 fi
486 487
488 # Add dphys-swapfile package, required to enable swap
489 if [ "$ENABLE_SWAP" = true ] ; then
490 APT_INCLUDES="${APT_INCLUDES},dphys-swapfile"
491 fi
492
487 493 # Add dbus package, recommended if using systemd
488 494 if [ "$ENABLE_DBUS" = true ] ; then
489 495 APT_INCLUDES="${APT_INCLUDES},dbus"
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant