Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-image
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
snf-image
Commits
abfd86f0
Commit
abfd86f0
authored
10 years ago
by
Nikos Skalkotos
Browse files
Options
Downloads
Patches
Plain Diff
Add a networking driver for Debian derived OSes
parent
6c41630a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
snf-image-helper/networking/Makefile.am
+1
-1
1 addition, 1 deletion
snf-image-helper/networking/Makefile.am
snf-image-helper/networking/debian.sh.in
+82
-0
82 additions, 0 deletions
snf-image-helper/networking/debian.sh.in
with
83 additions
and
1 deletion
snf-image-helper/networking/Makefile.am
+
1
−
1
View file @
abfd86f0
networkingdir
=
$(
libdir
)
/
$(
PACKAGE
)
/networking
dist_networking_SCRIPTS
=
dist_networking_SCRIPTS
=
debian.sh
edit
=
sed
\
-e
's|@sysconfdir[@]|
$(
sysconfdir
)
|g'
\
...
...
This diff is collapsed.
Click to expand it.
snf-image-helper/networking/debian.sh.in
0 → 100644
+
82
−
0
View file @
abfd86f0
#! /bin/bash
# Copyright (C) 2015 GRNET S.A.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
set
-e
.
"@commondir@/common.sh"
INTERFACES
=
"
$SNF_IMAGE_TARGET
/etc/network/interfaces"
networking_opts
"
$@
"
# initialize
if
[
"
$initialize
"
=
yes
]
;
then
if
[
-f
"
$INTERFACES
"
]
;
then
mv
"
$INTERFACES
"
"
${
INTERFACES
}
.snf-image-
$RANDOM
"
fi
cat
>
"
$INTERFACES
"
<<
EOF
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# Entries were automatically added by snf-image's ConfigureNetwork task.
# The loopback network interface
auto lo
iface lo inet loopback
EOF
exit
0
fi
# finalize
if
[
"
$finalize
"
=
yes
]
;
then
exit
0
fi
nic
=
"auto eth
${
index
}
\n
"
nic+
=
"allow-hotplug eth
${
index
}
\n
"
if
[
"
$ipv4
"
=
"dhcp"
]
;
then
nic+
=
"iface eth
${
index
}
inet dhcp
\n
"
elif
[
"
$ipv4
"
=
"static"
]
;
then
netmask
=
"
$(
cidr2mask
"
${
SUBNET
##*/
}
"
)
"
nic+
=
"iface eth
${
index
}
inet static
\n
"
nic+
=
" address
$IP
\n
"
nic+
=
" netmask
$netmask
\n
"
if
[
-n
"
$GATEWAY
"
]
;
then
nic+
=
" gateway
$GATEWAY
\n
"
fi
fi
if
[
"
$ipv6
"
=
"dhcp"
]
;
then
nic+
=
"iface eth
${
index
}
inet6 dhcp
\n
"
elif
[
"
$ipv6
"
=
"slaac"
]
;
then
nic+
=
"iface eth
${
index
}
inet6 auto
\n
"
nic+
=
" privext 0
\n
"
elif
[
"
$ipv6
"
=
"slaac_dhcp"
]
;
then
nic+
=
"iface eth
${
index
}
inet6 auto
\n
"
nic+
=
" privext 0
\n
"
nic+
=
" dhcp 1
\n
"
fi
echo
-e
"
$nic
"
>>
"
$INTERFACES
"
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment