##// END OF EJS Templates
p
Unknown -
r611:230e22969801
parent child
Show More
@@ -7,6 +7,14
7
7
8 # Install and setup timezone
8 # Install and setup timezone
9 echo "${TIMEZONE}" > "${ETC_DIR}/timezone"
9 echo "${TIMEZONE}" > "${ETC_DIR}/timezone"
10 if [ -f "${ETC_DIR}/localtime" ]; then
11 # 1. If 11-apt.sh upgrades the package 'tzdata', '/etc/localtime' was created
12 # because 'dpkg-reconfigure -f noninteractive tzdata' was executed by apt-get.
13 # 2. If '/etc/localtime' exists, our execution of 'dpkg-reconfigure -f noninteractive tzdata'
14 # will ignore the our timezone set in '/etc/timezone'.
15 # 3. Removing /etc/localtime will solve this.
16 rm -f "${ETC_DIR}/localtime"
17 fi
10 chroot_exec dpkg-reconfigure -f noninteractive tzdata
18 chroot_exec dpkg-reconfigure -f noninteractive tzdata
11
19
12 # Install and setup default locale and keyboard configuration
20 # Install and setup default locale and keyboard configuration
@@ -33,8 +33,10 if [ "$ENABLE_USBBOOT" = true ] ; then
33 sed -i "s/mmcblk0p2/sda2/" "${ETC_DIR}/fstab"
33 sed -i "s/mmcblk0p2/sda2/" "${ETC_DIR}/fstab"
34
34
35 # Add usb/sda2 disk to crypttab
35 # Add usb/sda2 disk to crypttab
36 if [ "$ENABLE_CRYPTFS" = true ] ; then
36 sed -i "s/mmcblk0p2/sda2/" "${ETC_DIR}/crypttab"
37 sed -i "s/mmcblk0p2/sda2/" "${ETC_DIR}/crypttab"
37 fi
38 fi
39 fi
38
40
39 # Generate initramfs file
41 # Generate initramfs file
40 if [ "$ENABLE_INITRAMFS" = true ] ; then
42 if [ "$ENABLE_INITRAMFS" = true ] ; then
@@ -55,9 +57,6 if [ "$ENABLE_INITRAMFS" = true ] ; then
55
57
56 # Write static ip settings to "${ETC_DIR}"/initramfs-tools/initramfs.conf
58 # Write static ip settings to "${ETC_DIR}"/initramfs-tools/initramfs.conf
57 sed -i "\$aIP=${NET_ADDRESS}::${NET_GATEWAY}:${NET_MASK}:${HOSTNAME}:" "${ETC_DIR}"/initramfs-tools/initramfs.conf
59 sed -i "\$aIP=${NET_ADDRESS}::${NET_GATEWAY}:${NET_MASK}:${HOSTNAME}:" "${ETC_DIR}"/initramfs-tools/initramfs.conf
58
59 # Regenerate initramfs
60 chroot_exec mkinitramfs -o "/boot/firmware/initramfs-${KERNEL_VERSION}" "${KERNEL_VERSION}"
61 fi
60 fi
62
61
63 if [ "$CRYPTFS_DROPBEAR" = true ]; then
62 if [ "$CRYPTFS_DROPBEAR" = true ]; then
@@ -83,6 +82,7 if [ "$ENABLE_INITRAMFS" = true ] ; then
83
82
84 # Save Keys - convert with putty from rsa/openssh to puttkey
83 # Save Keys - convert with putty from rsa/openssh to puttkey
85 cp -f "${ETC_DIR}"/dropbear-initramfs/id_rsa "${BASEDIR}"/dropbear_initramfs_key.rsa
84 cp -f "${ETC_DIR}"/dropbear-initramfs/id_rsa "${BASEDIR}"/dropbear_initramfs_key.rsa
85 fi
86
86
87 # Get unlock script
87 # Get unlock script
88 install_exec files/initramfs/crypt_unlock.sh "${ETC_DIR}"/initramfs-tools/hooks/crypt_unlock.sh
88 install_exec files/initramfs/crypt_unlock.sh "${ETC_DIR}"/initramfs-tools/hooks/crypt_unlock.sh
@@ -92,7 +92,6 if [ "$ENABLE_INITRAMFS" = true ] ; then
92
92
93 # Enable Dropbear inside initramfs
93 # Enable Dropbear inside initramfs
94 sed -i "54 i sleep 5" "${R}"/usr/share/initramfs-tools/scripts/init-premount/dropbear
94 sed -i "54 i sleep 5" "${R}"/usr/share/initramfs-tools/scripts/init-premount/dropbear
95 fi
96 else
95 else
97 # Disable SSHD inside initramfs
96 # Disable SSHD inside initramfs
98 printf "#\n# DROPBEAR: [ y | n ]\n#\n\nDROPBEAR=n\n" >> "${ETC_DIR}/initramfs-tools/initramfs.conf"
97 printf "#\n# DROPBEAR: [ y | n ]\n#\n\nDROPBEAR=n\n" >> "${ETC_DIR}/initramfs-tools/initramfs.conf"
@@ -104,13 +103,11 if [ "$ENABLE_INITRAMFS" = true ] ; then
104 # Dummy mapping required by mkinitramfs
103 # Dummy mapping required by mkinitramfs
105 echo "0 1 crypt $(echo "${CRYPTFS_CIPHER}" | cut -d ':' -f 1) ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0 7:0 4096" | chroot_exec dmsetup create "${CRYPTFS_MAPPING}"
104 echo "0 1 crypt $(echo "${CRYPTFS_CIPHER}" | cut -d ':' -f 1) ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0 7:0 4096" | chroot_exec dmsetup create "${CRYPTFS_MAPPING}"
106
105
107 # Generate initramfs with encrypted root partition support
108 chroot_exec mkinitramfs -o "/boot/firmware/initramfs-${KERNEL_VERSION}" "${KERNEL_VERSION}"
109
110 # Remove dummy mapping
106 # Remove dummy mapping
111 chroot_exec cryptsetup close "${CRYPTFS_MAPPING}"
107 chroot_exec cryptsetup close "${CRYPTFS_MAPPING}"
112 else
108 else
109
110 fi
113 # Generate initramfs without encrypted root partition support
111 # Generate initramfs without encrypted root partition support
114 chroot_exec mkinitramfs -o "/boot/firmware/initramfs-${KERNEL_VERSION}" "${KERNEL_VERSION}"
112 chroot_exec mkinitramfs -o "/boot/firmware/initramfs-${KERNEL_VERSION}" "${KERNEL_VERSION}"
115 fi
113 fi
116 fi
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant