@@ -8,11 +8,6 | |||
|
8 | 8 | # Install and setup fstab |
|
9 | 9 | install_readonly files/mount/fstab "${ETC_DIR}/fstab" |
|
10 | 10 | |
|
11 | if [ "$ENABLE_UBOOTUSB" = true ] ; then | |
|
12 | sed -i "s/mmcblk0p1/sda1/" "${ETC_DIR}/fstab" | |
|
13 | sed -i "s/mmcblk0p2/sda2/" "${ETC_DIR}/fstab" | |
|
14 | fi | |
|
15 | ||
|
16 | 11 | # Add usb/sda disk root partition to fstab |
|
17 | 12 | if [ "$ENABLE_SPLITFS" = true ] && [ "$ENABLE_CRYPTFS" = false ] ; then |
|
18 | 13 | sed -i "s/mmcblk0p2/sda1/" "${ETC_DIR}/fstab" |
@@ -28,11 +23,19 if [ "$ENABLE_CRYPTFS" = true ] ; then | |||
|
28 | 23 | echo "${CRYPTFS_MAPPING} /dev/mmcblk0p2 none luks,initramfs" >> "${ETC_DIR}/crypttab" |
|
29 | 24 | |
|
30 | 25 | if [ "$ENABLE_SPLITFS" = true ] ; then |
|
31 | # Add usb/sda disk to crypttab | |
|
26 | # Add usb/sda1 disk to crypttab | |
|
32 | 27 | sed -i "s/mmcblk0p2/sda1/" "${ETC_DIR}/crypttab" |
|
33 | 28 | fi |
|
34 | 29 | fi |
|
35 | 30 | |
|
31 | if [ "$ENABLE_USBBOOT" = true ] ; then | |
|
32 | sed -i "s/mmcblk0p1/sda1/" "${ETC_DIR}/fstab" | |
|
33 | sed -i "s/mmcblk0p2/sda2/" "${ETC_DIR}/fstab" | |
|
34 | ||
|
35 | # Add usb/sda2 disk to crypttab | |
|
36 | sed -i "s/mmcblk0p2/sda2/" "${ETC_DIR}/crypttab" | |
|
37 | fi | |
|
38 | ||
|
36 | 39 | # Generate initramfs file |
|
37 | 40 | if [ "$ENABLE_INITRAMFS" = true ] ; then |
|
38 | 41 | if [ "$ENABLE_CRYPTFS" = true ] ; then |
@@ -39,10 +39,14 else | |||
|
39 | 39 | fi |
|
40 | 40 | |
|
41 | 41 | # Setup firmware boot cmdline |
|
42 |
if [ "$ENABLE_ |
|
|
43 |
CMDLINE="dwc_otg.lpm_enable=0 root=/dev/sda |
|
|
42 | if [ "$ENABLE_USBBOOT" = true ] ; then | |
|
43 | CMDLINE="dwc_otg.lpm_enable=0 root=/dev/sda2 rootfstype=ext4 rootflags=commit=100,data=writeback elevator=deadline console=tty1 rootwait init=/bin/systemd" | |
|
44 | 44 | else |
|
45 | CMDLINE="dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootflags=commit=100,data=writeback elevator=deadline rootwait console=tty1 init=/bin/systemd" | |
|
45 | if [ "$ENABLE_SPLITFS" = true ] ; then | |
|
46 | CMDLINE="dwc_otg.lpm_enable=0 root=/dev/sda1 rootfstype=ext4 rootflags=commit=100,data=writeback elevator=deadline console=tty1 rootwait init=/bin/systemd" | |
|
47 | else | |
|
48 | CMDLINE="dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootflags=commit=100,data=writeback elevator=deadline console=tty1 rootwait init=/bin/systemd" | |
|
49 | fi | |
|
46 | 50 | fi |
|
47 | 51 | |
|
48 | 52 | # Add encrypted root partition to cmdline.txt |
@@ -50,7 +54,11 if [ "$ENABLE_CRYPTFS" = true ] ; then | |||
|
50 | 54 | if [ "$ENABLE_SPLITFS" = true ] ; then |
|
51 | 55 | CMDLINE=$(echo "${CMDLINE}" | sed "s/sda1/mapper\/${CRYPTFS_MAPPING} cryptdevice=\/dev\/sda1:${CRYPTFS_MAPPING}/") |
|
52 | 56 | else |
|
53 | CMDLINE=$(echo "${CMDLINE}" | sed "s/mmcblk0p2/mapper\/${CRYPTFS_MAPPING} cryptdevice=\/dev\/mmcblk0p2:${CRYPTFS_MAPPING}/") | |
|
57 | if [ "$ENABLE_USBBOOT" = true ] ; then | |
|
58 | CMDLINE=$(echo "${CMDLINE}" | sed "s/sda2/mapper\/${CRYPTFS_MAPPING} cryptdevice=\/dev\/sda2:${CRYPTFS_MAPPING}/") | |
|
59 | else | |
|
60 | CMDLINE=$(echo "${CMDLINE}" | sed "s/mmcblk0p2/mapper\/${CRYPTFS_MAPPING} cryptdevice=\/dev\/mmcblk0p2:${CRYPTFS_MAPPING}/") | |
|
61 | fi | |
|
54 | 62 | fi |
|
55 | 63 | fi |
|
56 | 64 | |
@@ -59,6 +67,11 if [ "$ENABLE_PRINTK" = true ] ; then | |||
|
59 | 67 | install_readonly files/sysctl.d/83-rpi-printk.conf "${ETC_DIR}/sysctl.d/83-rpi-printk.conf" |
|
60 | 68 | fi |
|
61 | 69 | |
|
70 | # Enable Kernel messages on standard output | |
|
71 | if [ "$KERNEL_SECURITY" = true ] ; then | |
|
72 | install_readonly files/sysctl.d/84-rpi-ASLR.conf "${ETC_DIR}/sysctl.d/84-rpi-ASLR.conf" | |
|
73 | fi | |
|
74 | ||
|
62 | 75 | # Install udev rule for serial alias - serial0 = console serial1=bluetooth |
|
63 | 76 | install_readonly files/etc/99-com.rules "${LIB_DIR}/udev/rules.d/99-com.rules" |
|
64 | 77 |
@@ -79,7 +79,7 if [ "$ENABLE_UBOOT" = true ] ; then | |||
|
79 | 79 | fi |
|
80 | 80 | |
|
81 | 81 | # instead of sd, boot from usb device |
|
82 |
if [ "$ENABLE_UBOOT |
|
|
82 | if [ "$ENABLE_USBBOOT" = true ] ; then | |
|
83 | 83 | sed -i "s|mmc|usb|g" "${BOOT_DIR}/uboot.mkimage" |
|
84 | 84 | fi |
|
85 | 85 |
@@ -158,7 +158,7 ENABLE_MINBASE=${ENABLE_MINBASE:=false} | |||
|
158 | 158 | ENABLE_REDUCE=${ENABLE_REDUCE:=false} |
|
159 | 159 | ENABLE_UBOOT=${ENABLE_UBOOT:=false} |
|
160 | 160 | UBOOTSRC_DIR=${UBOOTSRC_DIR:=""} |
|
161 |
ENABLE_UBOOT |
|
|
161 | ENABLE_USBBOOT=${ENABLE_USBBOOT=false} | |
|
162 | 162 | ENABLE_FBTURBO=${ENABLE_FBTURBO:=false} |
|
163 | 163 | ENABLE_VIDEOCORE=${ENABLE_VIDEOCORE:=false} |
|
164 | 164 | ENABLE_NEXMON=${ENABLE_NEXMON:=false} |
@@ -325,17 +325,6 case "$RPI_MODEL" in | |||
|
325 | 325 | ;; |
|
326 | 326 | esac |
|
327 | 327 | |
|
328 | if [ "$ENABLE_UBOOTUSB" = true ] ; then | |
|
329 | if [ "$ENABLE_UBOOT" = false ] ; then | |
|
330 | echo "error: Enabling UBOOTUSB requires u-boot to be enabled" | |
|
331 | exit 1 | |
|
332 | fi | |
|
333 | if [ "$RPI_MODEL" != 3 ] || [ "$RPI_MODEL" != 3P ] ; then | |
|
334 | echo "error: Enabling UBOOTUSB requires Raspberry 3" | |
|
335 | exit 1 | |
|
336 | fi | |
|
337 | fi | |
|
338 | ||
|
339 | 328 | # Raspberry PI 0,3,3P with Bluetooth and Wifi onboard |
|
340 | 329 | if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then |
|
341 | 330 | # Include bluetooth packages on supported boards |
@@ -421,6 +410,13 if [ "$ENABLE_UBOOT" = true ] ; then | |||
|
421 | 410 | APT_INCLUDES="${APT_INCLUDES},device-tree-compiler,bison,flex,bc" |
|
422 | 411 | fi |
|
423 | 412 | |
|
413 | if [ "$ENABLE_USBBOOT" = true ] ; then | |
|
414 | if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 1P ] || [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 2 ]; then | |
|
415 | echo "error: Booting from USB alone is only supported by Raspberry Pi 3 and 3P" | |
|
416 | exit 1 | |
|
417 | fi | |
|
418 | fi | |
|
419 | ||
|
424 | 420 | # Check if root SSH (v2) public key file exists |
|
425 | 421 | if [ -n "$SSH_ROOT_PUB_KEY" ] ; then |
|
426 | 422 | if [ ! -f "$SSH_ROOT_PUB_KEY" ] ; then |
General Comments 0
Vous devez vous connecter pour laisser un commentaire.
Se connecter maintenant