@@ -8,7 +8,7 | |||
|
8 | 8 | # Install and setup fstab |
|
9 | 9 | install_readonly files/mount/fstab "${ETC_DIR}/fstab" |
|
10 | 10 | |
|
11 |
if [ "$ENABLE_UBOOT |
|
|
11 | if [ "$ENABLE_USBBOOT" = true ] ; then | |
|
12 | 12 | sed -i "s/mmcblk0p1/sda1/" "${ETC_DIR}/fstab" |
|
13 | 13 | sed -i "s/mmcblk0p2/sda2/" "${ETC_DIR}/fstab" |
|
14 | 14 | fi |
@@ -44,6 +44,20 if [ "$ENABLE_INITRAMFS" = true ] ; then | |||
|
44 | 44 | fi |
|
45 | 45 | |
|
46 | 46 | if [ "$CRYPTFS_DROPBEAR" = true ]; then |
|
47 | # Get cdir from NET_ADDRESS e.g. 24 | |
|
48 | cdir=$(${NET_ADDRESS} | cut -d '/' -f2) | |
|
49 | ||
|
50 | # Convert cdir ro netmask e.g. 24 to 255.255.255.0 | |
|
51 | NET_MASK=$(cdr2mask "$cdir") | |
|
52 | ||
|
53 | # Write static ip settings to "${ETC_DIR}"/initramfs-tools/initramfs.conf | |
|
54 | sed -i "\$aIP=${NET_ADDRESS}::${NET_GATEWAY}:${NET_MASK}:${HOSTNAME}:" "${ETC_DIR}"/initramfs-tools/initramfs.conf | |
|
55 | ||
|
56 | # Regenerate initramfs | |
|
57 | chroot_exec mkinitramfs -o "/boot/firmware/initramfs-${KERNEL_VERSION}" "${KERNEL_VERSION}" | |
|
58 | fi | |
|
59 | ||
|
60 | if [ "$CRYPTFS_DROPBEAR" = true ]; then | |
|
47 | 61 |
|
|
48 | 62 |
|
|
49 | 63 |
|
@@ -54,7 +54,7 if [ "$ENABLE_KEYGEN" = true] ; then | |||
|
54 | 54 | fi |
|
55 | 55 | |
|
56 | 56 | # Setup firmware boot cmdline |
|
57 |
if [ "$ENABLE_UBOOT |
|
|
57 | if [ "$ENABLE_USBBOOT" = true ] ; then | |
|
58 | 58 | CMDLINE="dwc_otg.lpm_enable=0 root=/dev/sda2 rootfstype=ext4 rootflags=commit=100,data=writeback elevator=deadline rootwait init=/bin/systemd" |
|
59 | 59 | else |
|
60 | 60 | if [ "$ENABLE_SPLITFS" = true ] ; then |
@@ -69,7 +69,7 if [ "$ENABLE_CRYPTFS" = true ] ; then | |||
|
69 | 69 | if [ "$ENABLE_SPLITFS" = true ] ; then |
|
70 | 70 | CMDLINE=$(echo "${CMDLINE}" | sed "s/sda1/mapper\/${CRYPTFS_MAPPING} cryptdevice=\/dev\/sda1:${CRYPTFS_MAPPING}/") |
|
71 | 71 | else |
|
72 |
if [ "$ENABLE_UBOOT |
|
|
72 | if [ "$ENABLE_USBBOOT" = true ] ; then | |
|
73 | 73 | CMDLINE=$(echo "${CMDLINE}" | sed "s/sda2/mapper\/${CRYPTFS_MAPPING} cryptdevice=\/dev\/sda2:${CRYPTFS_MAPPING}/") |
|
74 | 74 | else |
|
75 | 75 | CMDLINE=$(echo "${CMDLINE}" | sed "s/mmcblk0p2/mapper\/${CRYPTFS_MAPPING} cryptdevice=\/dev\/mmcblk0p2:${CRYPTFS_MAPPING}/") |
@@ -57,20 +57,6 else # ENABLE_DHCP=false | |||
|
57 | 57 | -e "0,/NTP=\$/ s|NTP=\$|NTP=${NET_NTP_1}|"\ |
|
58 | 58 | -e "0,/NTP=\$/ s|NTP=\$|NTP=${NET_NTP_2}|"\ |
|
59 | 59 | "${ETC_DIR}/systemd/network/eth.network" |
|
60 | ||
|
61 | if [ "$CRYPTFS_DROPBEAR" = true ] ; then | |
|
62 | # Get cdir from NET_ADDRESS e.g. 24 | |
|
63 | cdir=$(${NET_ADDRESS} | cut -d '/' -f2) | |
|
64 | ||
|
65 | # Convert cdir ro netmask e.g. 24 to 255.255.255.0 | |
|
66 | NET_MASK=$(cdr2mask "$cdir") | |
|
67 | ||
|
68 | # Write static ip settings to "${ETC_DIR}"/initramfs-tools/initramfs.conf | |
|
69 | sed -i "\$aIP=${NET_ADDRESS}::${NET_GATEWAY}:${NET_MASK}:${HOSTNAME}:" "${ETC_DIR}"/initramfs-tools/initramfs.conf | |
|
70 | ||
|
71 | # Regenerate initramfs | |
|
72 | chroot_exec mkinitramfs -o "/boot/firmware/initramfs-${KERNEL_VERSION}" "${KERNEL_VERSION}" | |
|
73 | fi | |
|
74 | 60 | fi |
|
75 | 61 | |
|
76 | 62 | # Remove empty settings from network configuration |
@@ -159,7 +159,7 ENABLE_MINBASE=${ENABLE_MINBASE:=false} | |||
|
159 | 159 | ENABLE_REDUCE=${ENABLE_REDUCE:=false} |
|
160 | 160 | ENABLE_UBOOT=${ENABLE_UBOOT:=false} |
|
161 | 161 | UBOOTSRC_DIR=${UBOOTSRC_DIR:=""} |
|
162 |
ENABLE_UBOOT |
|
|
162 | ENABLE_USBBOOT=${ENABLE_USBBOOT=false} | |
|
163 | 163 | ENABLE_FBTURBO=${ENABLE_FBTURBO:=false} |
|
164 | 164 | ENABLE_VIDEOCORE=${ENABLE_VIDEOCORE:=false} |
|
165 | 165 | ENABLE_NEXMON=${ENABLE_NEXMON:=false} |
@@ -433,11 +433,13 fi | |||
|
433 | 433 | # Add device-tree-compiler required for building the U-Boot bootloader |
|
434 | 434 | if [ "$ENABLE_UBOOT" = true ] ; then |
|
435 | 435 | APT_INCLUDES="${APT_INCLUDES},device-tree-compiler,bison,flex,bc" |
|
436 | #else | |
|
437 | # if [ "$ENABLE_UBOOTUSB" = true ] ; then | |
|
438 | # echo "error: Enabling UBOOTUSB requires u-boot to be enabled" | |
|
439 | # exit 1 | |
|
440 | # fi | |
|
436 | fi | |
|
437 | ||
|
438 | if [ "$ENABLE_USBBOOT" = true ] ; then | |
|
439 | if ["$RPI_MODEL" != 3 ] || ["$RPI_MODEL" != 3P ] ; then | |
|
440 | echo "error: Booting from USB alone is only supported by Raspberry Pi 3 and 3P" | |
|
441 | exit 1 | |
|
442 | fi | |
|
441 | 443 | fi |
|
442 | 444 | |
|
443 | 445 | # Check if root SSH (v2) public key file exists |
General Comments 0
Vous devez vous connecter pour laisser un commentaire.
Se connecter maintenant