mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-19 21:17:55 +00:00
Tethering refresh for CDC NCM/CDC EEM mobile phones (tested on GrapheneOS Pixel 6a, no more RNDIS support)
- Add additional requirements to linux config - Add additional CONFIG_MOBILE_TETHERING=y to all maximized board configs - Fix issue under network-recovery-init to NTP sync against NTP server pool - Extend network-recovery-init to first try NTP sync against DNS server returned by DHCP answer - Remove network-recovery-init earlytty and tty0 redirection (console should be setuped properly by init in all cases) - If CONFIG_MOBILE_TETHERING=y added to board config and network-recovery-init called, wait to user input on instructions and warning 30 secs before proceeding (non-blocking) - Machines having STATIC_IP under board config won't benefit of autoatic NTP sync Since network-recovery-init can only be called from recovery shell now, and recovery shell can be guarded by GPG auth, this is PoC code to be used to complement TOTP being out of sync TODO(Future PR): - Refactor into functions and reuse into TOTP/HOTP being out of sync automatically. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
This commit is contained in:
parent
95f9636a1a
commit
7cbcdd8ed7
@ -65,6 +65,7 @@ CONFIG_CAIRO=y
|
||||
CONFIG_FBWHIPTAIL=y
|
||||
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
export CONFIG_TPM=y
|
||||
export CONFIG_BOOTSCRIPT=/bin/gui-init
|
||||
|
@ -14,6 +14,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -14,6 +14,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -17,6 +17,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -17,6 +17,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -17,6 +17,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -17,6 +17,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -17,6 +17,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -17,6 +17,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -17,6 +17,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -17,6 +17,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -18,6 +18,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -17,6 +17,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -16,6 +16,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -16,6 +16,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -31,6 +31,7 @@ CONFIG_CAIRO=y
|
||||
CONFIG_FBWHIPTAIL=y
|
||||
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
export CONFIG_TPM=y
|
||||
export CONFIG_BOOTSCRIPT=/bin/gui-init
|
||||
|
@ -17,6 +17,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -17,6 +17,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -31,6 +31,7 @@ CONFIG_CAIRO=y
|
||||
CONFIG_FBWHIPTAIL=y
|
||||
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
export CONFIG_TPM=y
|
||||
export CONFIG_BOOTSCRIPT=/bin/gui-init
|
||||
|
@ -18,6 +18,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -18,6 +18,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -28,6 +28,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -20,6 +20,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -18,6 +18,9 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
#Additional features
|
||||
export CONFIG_USB_KEYBOARD_REQUIRED=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
@ -44,7 +47,6 @@ CONFIG_TPMTOTP=y
|
||||
#HOTP based remote attestation for supported USB Security dongle
|
||||
#With/Without TPM support
|
||||
CONFIG_HOTPKEY=y
|
||||
export CONFIG_AUTO_BOOT_TIMEOUT=5
|
||||
|
||||
#Nitrokey Storage admin tool
|
||||
CONFIG_NKSTORECLI=n
|
||||
@ -64,14 +66,38 @@ CONFIG_DROPBEAR=y
|
||||
export CONFIG_BOOTSCRIPT=/bin/gui-init
|
||||
export CONFIG_BOOT_REQ_HASH=n
|
||||
export CONFIG_BOOT_REQ_ROLLBACK=n
|
||||
export CONFIG_BOOT_KERNEL_ADD=""
|
||||
export CONFIG_BOOT_KERNEL_REMOVE="intel_iommu=on intel_iommu=igfx_off"
|
||||
export CONFIG_BOOT_KERNEL_ADD="intel_iommu=on intel_iommu=igfx_off"
|
||||
export CONFIG_BOOT_KERNEL_REMOVE="quiet"
|
||||
export CONFIG_BOOT_DEV="/dev/sda1"
|
||||
export CONFIG_BOARD_NAME="Thinkpad X230-hotp-maximized_usb-kb"
|
||||
export CONFIG_FLASHROM_OPTIONS="--force --noverify-all -p internal"
|
||||
|
||||
#Include bits related to ivybridge ME blob download/neutering down to BUP+ROMP
|
||||
BOARD_TARGETS := xx30_me_blobs
|
||||
# xx30-*-maximized boards require of you initially call one of the
|
||||
# following to have gbe.bin ifd.bin and me.bin
|
||||
# - blobs/xx30/download_clean_me.sh
|
||||
# To download Lenovo original ME binary, neuter+deactivate ME, produce
|
||||
# reduced IFD ME region and expanded BIOS IFD region.
|
||||
# - blobs/xx30/extract.sh
|
||||
# To extract from backuped 8M (bottom SPI) ME binary, GBE and IFD blobs.
|
||||
#
|
||||
# This board has two SPI flash chips, an 8 MB that holds the IFD,
|
||||
# the ME image and part of the coreboot image, and a 4 MB one that
|
||||
# has the rest of the coreboot and the reset vector.
|
||||
#
|
||||
# As a consequence, this replaces the need of having to flash x230-flash
|
||||
# and expands available CBFS region (11.5Mb available CBFS space)
|
||||
#
|
||||
# When flashing via an external programmer it is easiest to have
|
||||
# two separate files for these pieces.
|
||||
all: $(board_build)/$(CB_OUTPUT_FILE)
|
||||
@sha256sum $@ | tee -a "$(HASHES)"
|
||||
|
||||
# Generate split 4MB top / 8MB bottom ROMs
|
||||
BOARD_TARGETS += split_8mb4mb
|
||||
all: $(board_build)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-bottom.rom
|
||||
$(board_build)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-bottom.rom: $(board_build)/$(CB_OUTPUT_FILE)
|
||||
$(call do,DD 8MB,$@,dd of=$@ if=$< bs=65536 count=128 skip=0 status=none)
|
||||
@sha256sum $@ | tee -a "$(HASHES)"
|
||||
|
||||
all: $(board_build)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-top.rom
|
||||
$(board_build)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-top.rom: $(board_build)/$(CB_OUTPUT_FILE)
|
||||
$(call do,DD 4MB,$@,dd of=$@ if=$< bs=65536 count=64 skip=128 status=none)
|
||||
@sha256sum $@ | tee -a "$(HASHES)"
|
||||
|
@ -28,6 +28,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -20,6 +20,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config
|
||||
#Additional hardware support
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_LINUX_E1000E=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
CONFIG_CRYPTSETUP2=y
|
||||
CONFIG_FLASHROM=y
|
||||
|
@ -51,6 +51,7 @@ CONFIG_CAIRO=y
|
||||
CONFIG_FBWHIPTAIL=y
|
||||
|
||||
CONFIG_LINUX_USB=y
|
||||
CONFIG_MOBILE_TETHERING=y
|
||||
|
||||
export CONFIG_TPM=y
|
||||
export CONFIG_BOOTSCRIPT=/bin/gui-init
|
||||
|
@ -1141,6 +1141,7 @@ CONFIG_DM_VERITY_FEC=y
|
||||
|
||||
# CONFIG_MACINTOSH_DRIVERS is not set
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_MII=m
|
||||
CONFIG_NET_CORE=y
|
||||
# CONFIG_BONDING is not set
|
||||
# CONFIG_DUMMY is not set
|
||||
@ -1262,7 +1263,48 @@ CONFIG_E1000E_HWTS=y
|
||||
|
||||
# CONFIG_PPP is not set
|
||||
# CONFIG_SLIP is not set
|
||||
# CONFIG_USB_NET_DRIVERS is not set
|
||||
CONFIG_USB_NET_DRIVERS=m
|
||||
# CONFIG_USB_CATC is not set
|
||||
# CONFIG_USB_KAWETH is not set
|
||||
# CONFIG_USB_PEGASUS is not set
|
||||
# CONFIG_USB_RTL8150 is not set
|
||||
# CONFIG_USB_RTL8152 is not set
|
||||
# CONFIG_USB_LAN78XX is not set
|
||||
CONFIG_USB_USBNET=m
|
||||
# CONFIG_USB_NET_AX8817X is not set
|
||||
# CONFIG_USB_NET_AX88179_178A is not set
|
||||
CONFIG_USB_NET_CDCETHER=m
|
||||
CONFIG_USB_NET_CDC_EEM=m
|
||||
CONFIG_USB_NET_CDC_NCM=m
|
||||
# CONFIG_USB_NET_HUAWEI_CDC_NCM is not set
|
||||
# CONFIG_USB_NET_CDC_MBIM is not set
|
||||
# CONFIG_USB_NET_DM9601 is not set
|
||||
# CONFIG_USB_NET_SR9700 is not set
|
||||
# CONFIG_USB_NET_SR9800 is not set
|
||||
# CONFIG_USB_NET_SMSC75XX is not set
|
||||
# CONFIG_USB_NET_SMSC95XX is not set
|
||||
# CONFIG_USB_NET_GL620A is not set
|
||||
# CONFIG_USB_NET_NET1080 is not set
|
||||
# CONFIG_USB_NET_PLUSB is not set
|
||||
# CONFIG_USB_NET_MCS7830 is not set
|
||||
# CONFIG_USB_NET_RNDIS_HOST is not set
|
||||
CONFIG_USB_NET_CDC_SUBSET=m
|
||||
# CONFIG_USB_ALI_M5632 is not set
|
||||
# CONFIG_USB_AN2720 is not set
|
||||
# CONFIG_USB_BELKIN is not set
|
||||
# CONFIG_USB_ARMLINUX is not set
|
||||
# CONFIG_USB_EPSON2888 is not set
|
||||
# CONFIG_USB_KC2190 is not set
|
||||
# CONFIG_USB_NET_ZAURUS is not set
|
||||
# CONFIG_USB_NET_CX82310_ETH is not set
|
||||
# CONFIG_USB_NET_KALMIA is not set
|
||||
# CONFIG_USB_NET_QMI_WWAN is not set
|
||||
# CONFIG_USB_NET_INT51X1 is not set
|
||||
# CONFIG_USB_IPHETH is not set
|
||||
# CONFIG_USB_SIERRA_NET is not set
|
||||
# CONFIG_USB_VL600 is not set
|
||||
# CONFIG_USB_NET_CH9200 is not set
|
||||
# CONFIG_USB_NET_AQC111 is not set
|
||||
# CONFIG_WLAN is not set
|
||||
|
||||
#
|
||||
|
@ -1195,6 +1195,7 @@ CONFIG_DM_VERITY_FEC=y
|
||||
|
||||
# CONFIG_MACINTOSH_DRIVERS is not set
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_MII=m
|
||||
CONFIG_NET_CORE=y
|
||||
# CONFIG_BONDING is not set
|
||||
# CONFIG_DUMMY is not set
|
||||
@ -1316,7 +1317,48 @@ CONFIG_E1000E_HWTS=y
|
||||
|
||||
# CONFIG_PPP is not set
|
||||
# CONFIG_SLIP is not set
|
||||
# CONFIG_USB_NET_DRIVERS is not set
|
||||
CONFIG_USB_NET_DRIVERS=m
|
||||
# CONFIG_USB_CATC is not set
|
||||
# CONFIG_USB_KAWETH is not set
|
||||
# CONFIG_USB_PEGASUS is not set
|
||||
# CONFIG_USB_RTL8150 is not set
|
||||
# CONFIG_USB_RTL8152 is not set
|
||||
# CONFIG_USB_LAN78XX is not set
|
||||
CONFIG_USB_USBNET=m
|
||||
# CONFIG_USB_NET_AX8817X is not set
|
||||
# CONFIG_USB_NET_AX88179_178A is not set
|
||||
CONFIG_USB_NET_CDCETHER=m
|
||||
CONFIG_USB_NET_CDC_EEM=m
|
||||
CONFIG_USB_NET_CDC_NCM=m
|
||||
# CONFIG_USB_NET_HUAWEI_CDC_NCM is not set
|
||||
# CONFIG_USB_NET_CDC_MBIM is not set
|
||||
# CONFIG_USB_NET_DM9601 is not set
|
||||
# CONFIG_USB_NET_SR9700 is not set
|
||||
# CONFIG_USB_NET_SR9800 is not set
|
||||
# CONFIG_USB_NET_SMSC75XX is not set
|
||||
# CONFIG_USB_NET_SMSC95XX is not set
|
||||
# CONFIG_USB_NET_GL620A is not set
|
||||
# CONFIG_USB_NET_NET1080 is not set
|
||||
# CONFIG_USB_NET_PLUSB is not set
|
||||
# CONFIG_USB_NET_MCS7830 is not set
|
||||
# CONFIG_USB_NET_RNDIS_HOST is not set
|
||||
CONFIG_USB_NET_CDC_SUBSET=m
|
||||
# CONFIG_USB_ALI_M5632 is not set
|
||||
# CONFIG_USB_AN2720 is not set
|
||||
# CONFIG_USB_BELKIN is not set
|
||||
# CONFIG_USB_ARMLINUX is not set
|
||||
# CONFIG_USB_EPSON2888 is not set
|
||||
# CONFIG_USB_KC2190 is not set
|
||||
# CONFIG_USB_NET_ZAURUS is not set
|
||||
# CONFIG_USB_NET_CX82310_ETH is not set
|
||||
# CONFIG_USB_NET_KALMIA is not set
|
||||
# CONFIG_USB_NET_QMI_WWAN is not set
|
||||
# CONFIG_USB_NET_INT51X1 is not set
|
||||
# CONFIG_USB_IPHETH is not set
|
||||
# CONFIG_USB_SIERRA_NET is not set
|
||||
# CONFIG_USB_VL600 is not set
|
||||
# CONFIG_USB_NET_CH9200 is not set
|
||||
# CONFIG_USB_NET_AQC111 is not set
|
||||
# CONFIG_WLAN is not set
|
||||
|
||||
#
|
||||
|
@ -1195,6 +1195,7 @@ CONFIG_DM_VERITY_FEC=y
|
||||
|
||||
# CONFIG_MACINTOSH_DRIVERS is not set
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_MII=m
|
||||
CONFIG_NET_CORE=y
|
||||
# CONFIG_BONDING is not set
|
||||
# CONFIG_DUMMY is not set
|
||||
@ -1316,7 +1317,48 @@ CONFIG_E1000E_HWTS=y
|
||||
|
||||
# CONFIG_PPP is not set
|
||||
# CONFIG_SLIP is not set
|
||||
# CONFIG_USB_NET_DRIVERS is not set
|
||||
CONFIG_USB_NET_DRIVERS=m
|
||||
# CONFIG_USB_CATC is not set
|
||||
# CONFIG_USB_KAWETH is not set
|
||||
# CONFIG_USB_PEGASUS is not set
|
||||
# CONFIG_USB_RTL8150 is not set
|
||||
# CONFIG_USB_RTL8152 is not set
|
||||
# CONFIG_USB_LAN78XX is not set
|
||||
CONFIG_USB_USBNET=m
|
||||
# CONFIG_USB_NET_AX8817X is not set
|
||||
# CONFIG_USB_NET_AX88179_178A is not set
|
||||
CONFIG_USB_NET_CDCETHER=m
|
||||
CONFIG_USB_NET_CDC_EEM=m
|
||||
CONFIG_USB_NET_CDC_NCM=m
|
||||
# CONFIG_USB_NET_HUAWEI_CDC_NCM is not set
|
||||
# CONFIG_USB_NET_CDC_MBIM is not set
|
||||
# CONFIG_USB_NET_DM9601 is not set
|
||||
# CONFIG_USB_NET_SR9700 is not set
|
||||
# CONFIG_USB_NET_SR9800 is not set
|
||||
# CONFIG_USB_NET_SMSC75XX is not set
|
||||
# CONFIG_USB_NET_SMSC95XX is not set
|
||||
# CONFIG_USB_NET_GL620A is not set
|
||||
# CONFIG_USB_NET_NET1080 is not set
|
||||
# CONFIG_USB_NET_PLUSB is not set
|
||||
# CONFIG_USB_NET_MCS7830 is not set
|
||||
# CONFIG_USB_NET_RNDIS_HOST is not set
|
||||
CONFIG_USB_NET_CDC_SUBSET=m
|
||||
# CONFIG_USB_ALI_M5632 is not set
|
||||
# CONFIG_USB_AN2720 is not set
|
||||
# CONFIG_USB_BELKIN is not set
|
||||
# CONFIG_USB_ARMLINUX is not set
|
||||
# CONFIG_USB_EPSON2888 is not set
|
||||
# CONFIG_USB_KC2190 is not set
|
||||
# CONFIG_USB_NET_ZAURUS is not set
|
||||
# CONFIG_USB_NET_CX82310_ETH is not set
|
||||
# CONFIG_USB_NET_KALMIA is not set
|
||||
# CONFIG_USB_NET_QMI_WWAN is not set
|
||||
# CONFIG_USB_NET_INT51X1 is not set
|
||||
# CONFIG_USB_IPHETH is not set
|
||||
# CONFIG_USB_SIERRA_NET is not set
|
||||
# CONFIG_USB_VL600 is not set
|
||||
# CONFIG_USB_NET_CH9200 is not set
|
||||
# CONFIG_USB_NET_AQC111 is not set
|
||||
# CONFIG_WLAN is not set
|
||||
|
||||
#
|
||||
|
@ -1138,6 +1138,7 @@ CONFIG_DM_VERITY_FEC=y
|
||||
|
||||
# CONFIG_MACINTOSH_DRIVERS is not set
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_MII=m
|
||||
CONFIG_NET_CORE=y
|
||||
# CONFIG_BONDING is not set
|
||||
# CONFIG_DUMMY is not set
|
||||
@ -1259,7 +1260,48 @@ CONFIG_E1000E_HWTS=y
|
||||
|
||||
# CONFIG_PPP is not set
|
||||
# CONFIG_SLIP is not set
|
||||
# CONFIG_USB_NET_DRIVERS is not set
|
||||
CONFIG_USB_NET_DRIVERS=m
|
||||
# CONFIG_USB_CATC is not set
|
||||
# CONFIG_USB_KAWETH is not set
|
||||
# CONFIG_USB_PEGASUS is not set
|
||||
# CONFIG_USB_RTL8150 is not set
|
||||
# CONFIG_USB_RTL8152 is not set
|
||||
# CONFIG_USB_LAN78XX is not set
|
||||
CONFIG_USB_USBNET=m
|
||||
# CONFIG_USB_NET_AX8817X is not set
|
||||
# CONFIG_USB_NET_AX88179_178A is not set
|
||||
CONFIG_USB_NET_CDCETHER=m
|
||||
CONFIG_USB_NET_CDC_EEM=m
|
||||
CONFIG_USB_NET_CDC_NCM=m
|
||||
# CONFIG_USB_NET_HUAWEI_CDC_NCM is not set
|
||||
# CONFIG_USB_NET_CDC_MBIM is not set
|
||||
# CONFIG_USB_NET_DM9601 is not set
|
||||
# CONFIG_USB_NET_SR9700 is not set
|
||||
# CONFIG_USB_NET_SR9800 is not set
|
||||
# CONFIG_USB_NET_SMSC75XX is not set
|
||||
# CONFIG_USB_NET_SMSC95XX is not set
|
||||
# CONFIG_USB_NET_GL620A is not set
|
||||
# CONFIG_USB_NET_NET1080 is not set
|
||||
# CONFIG_USB_NET_PLUSB is not set
|
||||
# CONFIG_USB_NET_MCS7830 is not set
|
||||
# CONFIG_USB_NET_RNDIS_HOST is not set
|
||||
CONFIG_USB_NET_CDC_SUBSET=m
|
||||
# CONFIG_USB_ALI_M5632 is not set
|
||||
# CONFIG_USB_AN2720 is not set
|
||||
# CONFIG_USB_BELKIN is not set
|
||||
# CONFIG_USB_ARMLINUX is not set
|
||||
# CONFIG_USB_EPSON2888 is not set
|
||||
# CONFIG_USB_KC2190 is not set
|
||||
# CONFIG_USB_NET_ZAURUS is not set
|
||||
# CONFIG_USB_NET_CX82310_ETH is not set
|
||||
# CONFIG_USB_NET_KALMIA is not set
|
||||
# CONFIG_USB_NET_QMI_WWAN is not set
|
||||
# CONFIG_USB_NET_INT51X1 is not set
|
||||
# CONFIG_USB_IPHETH is not set
|
||||
# CONFIG_USB_SIERRA_NET is not set
|
||||
# CONFIG_USB_VL600 is not set
|
||||
# CONFIG_USB_NET_CH9200 is not set
|
||||
# CONFIG_USB_NET_AQC111 is not set
|
||||
# CONFIG_WLAN is not set
|
||||
|
||||
#
|
||||
|
@ -4,58 +4,104 @@
|
||||
|
||||
TRACE_FUNC
|
||||
|
||||
# bring up the ethernet; maybe should do DHCP?
|
||||
# bring up the ethernet interface
|
||||
ifconfig lo 127.0.0.1
|
||||
|
||||
echo "Loading Ethernet network modules..."
|
||||
network_modules="e1000 e1000e igb sfc mdio mlx4_core mlx4_en"
|
||||
for module in `echo $network_modules`; do
|
||||
for module in $(echo $network_modules); do
|
||||
if [ -f /lib/modules/$module.ko ]; then
|
||||
insmod /lib/modules/$module.ko
|
||||
#check if module is already loaded and load it if not
|
||||
lsmod | grep -q $module || insmod /lib/modules/$module.ko
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -e /sys/class/net/eth0 ]; then
|
||||
#Tethering over USB for Mobile phones supporting CDC (Android Pixel 6a+, Librem phone, etc.)
|
||||
if [ -e /lib/modules/cdc_ether.ko ]; then
|
||||
#first enable USB controllers
|
||||
enable_usb
|
||||
echo ""
|
||||
echo "Please verify that your mobile (CDC NCM/EEM tethering compatible phone) is networked in the desired way (WIFI/mobile + VPN/Orbot/etc)"
|
||||
echo "Please connect mobile phone to this machine's fast USB port (blue identified) through a known working data cable"
|
||||
echo "Please enable USB tethering prior of going further (Android: select 'Charging this device via USB' notification and enable tethering option)"
|
||||
read -p "Press Enter to continue now or wait 30 seconds..." -n 1 -r -t 30
|
||||
|
||||
network_modules="mii usbnet cdc_ether cdc_ncm cdc_eem"
|
||||
echo "Loading USB tethering network related modules: $network_modules..."
|
||||
for module in $(echo $network_modules); do
|
||||
if [ -f /lib/modules/$module.ko ]; then
|
||||
#check if module is already loaded and load it if not
|
||||
lsmod | grep -q $module || insmod /lib/modules/$module.ko
|
||||
fi
|
||||
done
|
||||
if ! [ -e /sys/class/net/usb0 ]; then
|
||||
echo ""
|
||||
echo "Tethering USB network interface was NOT detected with loaded kernel modules : $network_modules"
|
||||
echo "Please check your phone's linux drivers requirements"
|
||||
echo "Note that RNDIS kernel module inclusion was discussed and rejected due to security implications and planned deprecation under Linux kernel altogether"
|
||||
echo "CDC NCM/CDC EEM support is known to be available on a majority of Android/GrapheneOS as well as Librem phones"
|
||||
echo "Non-exhaustive exeptions: Pixel 4a* known to only tether over RNDIS and won't be supported"
|
||||
echo "Apple phones won't be supported due to size and complexity of the drivers and toolstack required to support tethering"
|
||||
read -p "Press Enter to continue now or wait 30 seconds..." -n 1 -r -t 30
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -e /sys/class/net/usb0 ]; then
|
||||
dev=usb0
|
||||
echo "USB tethering network interface detected as $dev"
|
||||
elif [ -e /sys/class/net/eth0 ]; then
|
||||
dev=eth0
|
||||
echo "Ethernet network interface detected as $dev"
|
||||
#Randomize eth0 MAC address of maximized boards
|
||||
if echo "$CONFIG_BOARD" | grep -q maximized; then
|
||||
ifconfig eth0 down
|
||||
echo "Generating random MAC address (might take a while)..."
|
||||
ifconfig $dev down
|
||||
echo "Generating random MAC address..."
|
||||
mac=$(generate_random_mac_address)
|
||||
echo "Assigning randomly generated MAC: $mac to eth0..."
|
||||
ifconfig eth0 hw ether $mac
|
||||
ifconfig eth0 up
|
||||
ifconfig $dev hw ether $mac
|
||||
echo "Bringing up $dev... Connect a network cable to the $dev port and make sure status LEDs are on"
|
||||
ifconfig $dev up
|
||||
fi
|
||||
|
||||
# Set up static IP
|
||||
if [ ! -z "$CONFIG_BOOT_STATIC_IP" ]; then
|
||||
ifconfig eth0 $CONFIG_BOOT_STATIC_IP
|
||||
#Get ip from DHCP
|
||||
elif [ -e /sbin/udhcpc ];then
|
||||
if udhcpc -T 1 -q; then
|
||||
if [ -e /sbin/ntpd ]; then
|
||||
DNS_SERVER=$(grep nameserver /etc/resolv.conf|awk -F " " {'print $2'})
|
||||
killall ntpd 2&>1 > /dev/null
|
||||
if ! ntpd -d -N -n -q -p $DNS_SERVER > /dev/ttyprintk; then
|
||||
if ! ntpd -d -d -N -n -q -p ntp.pool.org> /dev/ttyprintk; then
|
||||
echo "NTP sync unsuccessful." > /dev/tty0
|
||||
fi
|
||||
fi
|
||||
hwclock -w
|
||||
echo "" > /dev/tty0
|
||||
date=`date "+%Y-%m-%d %H:%M:%S %Z"`
|
||||
echo "Time: $date" > /dev/tty0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
ifconfig eth0 > /dev/ttyprintk
|
||||
|
||||
if [ -e /bin/dropbear ]; then
|
||||
# Set up the ssh server, allow root logins and log to stderr
|
||||
if [ ! -d /etc/dropbear ]; then
|
||||
mkdir /etc/dropbear
|
||||
fi
|
||||
dropbear -B -R 2>/dev/ttyprintk
|
||||
fi
|
||||
echo "" > /dev/tty0
|
||||
ifconfig eth0 | head -2 > /dev/tty0
|
||||
fi
|
||||
|
||||
# Set up static IP
|
||||
if [ ! -z "$CONFIG_BOOT_STATIC_IP" ]; then
|
||||
echo "Setting static IP: $CONFIG_BOOT_STATIC_IP"
|
||||
ifconfig $dev $CONFIG_BOOT_STATIC_IP
|
||||
echo "No NTP sync with static IP: no DNS server nor gateway defined, set time manually"
|
||||
elif [ -e /sbin/udhcpc ]; then
|
||||
echo "Getting IP from first DHCP server answering. This may take a while..."
|
||||
if udhcpc -T 1 -i $dev -q; then
|
||||
if [ -e /sbin/ntpd ]; then
|
||||
DNS_SERVER=$(grep nameserver /etc/resolv.conf | awk -F " " {'print $2'})
|
||||
killall ntpd 2 &>1 >/dev/null
|
||||
echo "Attempting to sync time with NTP server: $DNS_SERVER..."
|
||||
if ! ntpd -d -N -n -q -p $DNS_SERVER; then
|
||||
echo "NTP sync unsuccessful with DNS server"
|
||||
echo "Attempting NTP time sync with pool.ntp.org..."
|
||||
if ! ntpd -d -d -N -n -q -p pool.ntp.org; then
|
||||
echo "NTP sync unsuccessful."
|
||||
else
|
||||
echo "NTP time sync successful."
|
||||
fi
|
||||
fi
|
||||
echo "Syncing hardware clock with system time in UTC/GMT timezone... NOT LOCAL TIMEZONE!"
|
||||
hwclock -w
|
||||
echo ""
|
||||
date=$(date "+%Y-%m-%d %H:%M:%S %Z")
|
||||
echo "Time: $date"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -e /bin/dropbear ]; then
|
||||
# Set up the ssh server, allow root logins and log to stderr
|
||||
if [ ! -d /etc/dropbear ]; then
|
||||
mkdir /etc/dropbear
|
||||
fi
|
||||
echo "Starting dropbear ssh server..."
|
||||
dropbear -B -R
|
||||
fi
|
||||
echo ""
|
||||
echo "Network setup complete:"
|
||||
ifconfig
|
||||
|
@ -125,6 +125,13 @@ linux_modules-$(CONFIG_LINUX_USB) += drivers/usb/storage/usb-storage.ko
|
||||
#USB modules when a USB keyboard is defined in board config
|
||||
linux_modules-$(CONFIG_SUPPORT_USB_KEYBOARD) += drivers/hid/usbhid/usbhid.ko
|
||||
|
||||
#USB modules for Mobile USB Tethering (Most Android phones, Librem phone, etc)
|
||||
linux_modules-$(CONFIG_MOBILE_TETHERING) += drivers/net/mii.ko
|
||||
linux_modules-$(CONFIG_MOBILE_TETHERING) += drivers/net/usb/usbnet.ko
|
||||
linux_modules-$(CONFIG_MOBILE_TETHERING) += drivers/net/usb/cdc_ether.ko
|
||||
linux_modules-$(CONFIG_MOBILE_TETHERING) += drivers/net/usb/cdc_ncm.ko
|
||||
linux_modules-$(CONFIG_MOBILE_TETHERING) += drivers/net/usb/cdc_eem.ko
|
||||
|
||||
# NVMe driver for winterfell and other servers
|
||||
linux_modules-$(CONFIG_LINUX_NVME) += drivers/nvme/host/nvme.ko
|
||||
linux_modules-$(CONFIG_LINUX_NVME) += drivers/nvme/host/nvme-core.ko
|
||||
|
Loading…
Reference in New Issue
Block a user