summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/install/install-get-partition23
-rw-r--r--templates/interfaces/l2tpv3/node.def9
-rw-r--r--templates/interfaces/l2tpv3/node.tag/encap/node.def6
-rw-r--r--templates/interfaces/l2tpv3/node.tag/endpoint/local-ip/node.def6
-rw-r--r--templates/interfaces/l2tpv3/node.tag/endpoint/node.def1
-rw-r--r--templates/interfaces/l2tpv3/node.tag/endpoint/remote-ip/node.def6
-rw-r--r--templates/interfaces/l2tpv3/node.tag/mtu/node.def14
7 files changed, 23 insertions, 42 deletions
diff --git a/scripts/install/install-get-partition b/scripts/install/install-get-partition
index 4b2c25b3..f6ddb830 100755
--- a/scripts/install/install-get-partition
+++ b/scripts/install/install-get-partition
@@ -33,8 +33,6 @@ ROOT_PARTITION_TYPE=''
PARTITION=''
# default file system type
ROOT_FSTYPE='ext4'
-# default start of root partition
-ROOT_OFFSET="1024S" # 512K align for SSD etc
warn_of_dire_consequences () {
# Give the user a requisite warning that we are about to nuke their drive
@@ -672,8 +670,7 @@ make_filesystem () {
create_partitions() {
ldrive=$1
root_part_size=$2
- start_offset=$3
- initialize_fs=$4
+ initialize_fs=$3
# Make sure there is enough space on drive
size=$(get_drive_size "$ldrive")
@@ -700,7 +697,7 @@ create_partitions() {
lecho "Creating root partition on /dev/$ldrive"
- # make the root partition
+ # Make the root partition
output=$(parted --script --align optimal /dev/$ldrive mkpart primary 0% $root_part_size)
status=$?
if [ "$status" != 0 ]; then
@@ -728,17 +725,6 @@ create_partitions() {
fi
}
-# adjust root filesystem options
-set_root_fstype () {
- local drv=$1
- local sz=$(get_drive_size "$drv")
-
- # if disk is small, then don't waste space aligning
- if (( $sz < 10000 )); then
- ROOT_OFFSET="64S" # 32K align
- fi
-}
-
# ask for user input on the parted and skip setup methods
# $1 is whether or not to run parted
# sets globals INSTALL_DRIVE, ROOT_PARTITION, CONFIG_PARTITION
@@ -758,8 +744,6 @@ setup_method_manual() {
'INSTALL_DRIVE'
done
- set_root_fstype "$INSTALL_DRIVE"
-
# Unmount the install drive if it is mounted
unmount "$INSTALL_DRIVE"
@@ -816,7 +800,6 @@ setup_method_auto () {
# check to make sure the drive is large enough to hold the image
if [ -n "$INSTALL_DRIVE" ]; then
- set_root_fstype "$INSTALL_DRIVE"
lsize=$(get_drive_size "$INSTALL_DRIVE")
total=$ROOT_MIN
if [ "$total" -gt "$lsize" ]; then
@@ -861,7 +844,7 @@ setup_method_auto () {
echo
# now take the data and create the partitions
- create_partitions "$INSTALL_DRIVE" "$root_part_size" $ROOT_OFFSET "yes"
+ create_partitions "$INSTALL_DRIVE" "$root_part_size" "yes"
# mark data partition as bootable
lecho "Marking /dev/$INSTALL_DRIVE partition 1 as bootable"
output=$(parted -s /dev/$INSTALL_DRIVE set 1 boot on 2>&1)
diff --git a/templates/interfaces/l2tpv3/node.def b/templates/interfaces/l2tpv3/node.def
index 924d27b7..d609cb65 100644
--- a/templates/interfaces/l2tpv3/node.def
+++ b/templates/interfaces/l2tpv3/node.def
@@ -10,10 +10,6 @@ commit:expression: $VAR(./local-ip/) != "" ; \
"Must configure the l2tpv3 local-ip for $VAR(@)"
commit:expression: $VAR(./remote-ip/) != "" ; \
"Must configure the l2tpv3 remote-ip for $VAR(@)"
-commit:expression: $VAR(./endpoint/local-ip/) != "" ; \
- "Must configure the l2tpv3 endpoint local-ip for $VAR(@)"
-commit:expression: $VAR(./endpoint/remote-ip/) != "" ; \
- "Must configure the l2tpv3 endpoint remote-ip for $VAR(@)"
commit:expression: $VAR(./tunnel-id/) != "" ; \
"Must configure the l2tpv3 tunnel-id for $VAR(@)"
commit:expression: $VAR(./peer-tunnel-id/) != "" ; \
@@ -26,6 +22,9 @@ commit:expression: $VAR(./peer-session-id/) != "" ; \
begin:
[ -d /sys/module/l2tp_eth ] || sudo modprobe l2tp_eth
[ -d /sys/module/l2tp_netlink ] || sudo modprobe l2tp_netlink
+ if [ "$VAR(./encap/@)" = "ip" ] && [ ! -d /sys/module/l2tp_ip ] ; then
+ sudo modprobe l2tp_ip
+ fi
create:
for i in `seq 1 $VAR(./wait/@)`
@@ -36,8 +35,6 @@ create:
ip l2tp add tunnel tunnel_id $VAR(./tunnel-id/@) peer_tunnel_id $VAR(./peer-tunnel-id/@) udp_sport $VAR(./sport/@) udp_dport $VAR(./dport/@) encap $VAR(./encap/@) local $VAR(./local-ip/@) remote $VAR(./remote-ip/@) ||
echo "ip l2tp add tunnel tunnel_id $VAR(./tunnel-id/@) peer_tunnel_id $VAR(./peer-tunnel-id/@) udp_sport $VAR(./sport/@) udp_dport $VAR(./dport/@) encap $VAR(./encap/@) local $VAR(./local-ip/@) remote $VAR(./remote-ip/@)"
ip l2tp add session tunnel_id $VAR(./tunnel-id/@) session_id $VAR(./session-id/@) peer_session_id $VAR(./peer-session-id/@) || echo "ip l2tp add session tunnel_id $VAR(./tunnel-id/@) session_id $VAR(./session-id/@) peer_session_id $VAR(./peer-session-id/@)"
- ip addr add $VAR(./endpoint/local-ip/@) peer $VAR(./endpoint/remote-ip/@) dev $VAR(@) || echo "ip addr add $VAR(./endpoint/local-ip/@) peer $VAR(./endpoint/remote-ip/@) dev $VAR(@)"
- ip link set $VAR(@) up mtu 1500
delete:
ip link set $VAR(@) down
diff --git a/templates/interfaces/l2tpv3/node.tag/encap/node.def b/templates/interfaces/l2tpv3/node.tag/encap/node.def
index c3726314..f5d4eb9d 100644
--- a/templates/interfaces/l2tpv3/node.tag/encap/node.def
+++ b/templates/interfaces/l2tpv3/node.tag/encap/node.def
@@ -1,7 +1,7 @@
-help: Encryption algorithm
+help: Encapsulation type
type: txt
default: "udp"
syntax:expression: $VAR(@) in "ip", "udp"; "must be ip, or udp"
-val_help: udp; udp encryption (default)
-val_help: ip; ip encryption
+val_help: udp; udp encapsulation (default)
+val_help: ip; ip encapsulation
diff --git a/templates/interfaces/l2tpv3/node.tag/endpoint/local-ip/node.def b/templates/interfaces/l2tpv3/node.tag/endpoint/local-ip/node.def
deleted file mode 100644
index f443d9ec..00000000
--- a/templates/interfaces/l2tpv3/node.tag/endpoint/local-ip/node.def
+++ /dev/null
@@ -1,6 +0,0 @@
-type: ipv4net, ipv6net
-help: Endpoint IP address for this l2tpv3 [REQUIRED]
-val_help: ipv4net; Endpoint IPv4 address for this l2tpv3 [REQUIRED]
-val_help: ipv6net; Endpoint IPv6 address for this l2tpv3 [REQUIRED]
-
-syntax:expression: exec "/opt/vyatta/sbin/valid_address $VAR(@)"
diff --git a/templates/interfaces/l2tpv3/node.tag/endpoint/node.def b/templates/interfaces/l2tpv3/node.tag/endpoint/node.def
deleted file mode 100644
index d199b6f6..00000000
--- a/templates/interfaces/l2tpv3/node.tag/endpoint/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: l2tpv3 of Endpoint IP address
diff --git a/templates/interfaces/l2tpv3/node.tag/endpoint/remote-ip/node.def b/templates/interfaces/l2tpv3/node.tag/endpoint/remote-ip/node.def
deleted file mode 100644
index 6e1bcf80..00000000
--- a/templates/interfaces/l2tpv3/node.tag/endpoint/remote-ip/node.def
+++ /dev/null
@@ -1,6 +0,0 @@
-type: ipv4net, ipv6net
-help: Peer Endpoint IP address for this l2tpv3 [REQUIRED]
-val_help: ipv4net; Peer Endpoint IPv4 address for this l2tpv3 [REQUIRED]
-val_help: ipv6net; Peer Endpoint IPv6 address for this l2tpv3 [REQUIRED]
-
-syntax:expression: exec "/opt/vyatta/sbin/valid_address $VAR(@)"
diff --git a/templates/interfaces/l2tpv3/node.tag/mtu/node.def b/templates/interfaces/l2tpv3/node.tag/mtu/node.def
new file mode 100644
index 00000000..57cbe3ad
--- /dev/null
+++ b/templates/interfaces/l2tpv3/node.tag/mtu/node.def
@@ -0,0 +1,14 @@
+type: u32
+priority: 381
+help: Maximum Transmission Unit (MTU)
+syntax:expression: $VAR(@) >= 68 && $VAR(@) <= 9000; "Must be between 68-9000"
+val_help: u32:68-9000; Maximum Transmission Unit (MTU)
+
+update:
+ if [ -d /sys/class/net/$VAR(../@) ] ; then
+ ip link set $VAR(../@) mtu $VAR(@)
+ fi
+delete:
+ if [ -d /sys/class/net/$VAR(../@) ] ; then
+ ip link set $VAR(../@) mtu 1488
+ fi