Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
dbf21ae6
Commit
dbf21ae6
authored
Jun 12, 2015
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #558 from cloudnull/template-cache-var
Added container-cache option to templates
parents
3814bc62
6dc6f80b
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
32 additions
and
17 deletions
+32
-17
lxc-centos.in
templates/lxc-centos.in
+2
-1
lxc-cirros.in
templates/lxc-cirros.in
+3
-2
lxc-debian.in
templates/lxc-debian.in
+5
-3
lxc-download.in
templates/lxc-download.in
+3
-1
lxc-fedora.in
templates/lxc-fedora.in
+2
-1
lxc-gentoo.in
templates/lxc-gentoo.in
+3
-1
lxc-openmandriva.in
templates/lxc-openmandriva.in
+2
-1
lxc-opensuse.in
templates/lxc-opensuse.in
+3
-2
lxc-ubuntu-cloud.in
templates/lxc-ubuntu-cloud.in
+4
-3
lxc-ubuntu.in
templates/lxc-ubuntu.in
+5
-2
No files found.
templates/lxc-centos.in
View file @
dbf21ae6
...
...
@@ -761,7 +761,8 @@ then
fi
fi
cache_base
=
@LOCALSTATEDIR@/cache/lxc/centos/
$basearch
# Allow the cache base to be set by environment variable
cache_base
=
${
LXC_CACHE_PATH
:-
"@LOCALSTATEDIR@/cache/lxc"
}
/centos/
$basearch
# Let's do something better for the initial root password.
# It's not perfect but it will defeat common scanning brute force
...
...
templates/lxc-cirros.in
View file @
dbf21ae6
...
...
@@ -58,10 +58,11 @@ am_in_userns() {
in_userns
=
0
[
$(
am_in_userns
)
=
"yes"
]
&&
in_userns
=
1
# Allow the cache base to be set by environment variable
if
[
$(
id
-u
)
-eq
0
]
;
then
CACHE_D
=
"@LOCALSTATEDIR@/cache/lxc/cirros"
CACHE_D
=
${
LXC_CACHE_PATH
:-
"@LOCALSTATEDIR@/cache/lxc/cirros"
}
else
CACHE_D
=
"
$HOME
/.cache/lxc/cirros"
CACHE_D
=
${
LXC_CACHE_PATH
:-
"
$HOME
/.cache/lxc/cirros"
}
fi
error
()
{
echo
"
$@
"
1>&2
;
}
...
...
templates/lxc-debian.in
View file @
dbf21ae6
...
...
@@ -37,6 +37,8 @@ MIRROR=${MIRROR:-http://http.debian.net/debian}
SECURITY_MIRROR
=
${
SECURITY_MIRROR
:-
http
://security.debian.org/
}
LOCALSTATEDIR
=
"@LOCALSTATEDIR@"
LXC_TEMPLATE_CONFIG
=
"@LXCTEMPLATECONFIG@"
# Allows the lxc-cache directory to be set by environment variable
LXC_CACHE_PATH
=
${
LXC_CACHE_PATH
:-
"
$LOCALSTATEDIR
/cache/lxc"
}
configure_debian
()
{
...
...
@@ -293,10 +295,10 @@ copy_debian()
install_debian
()
{
cache
=
"
$LOCALSTATEDIR
/cache/lxc/debian"
rootfs
=
$1
release
=
$2
arch
=
$3
cache
=
"
$4
/debian"
mkdir
-p
$LOCALSTATEDIR
/lock/subsys/
(
flock
-x
9
...
...
@@ -412,7 +414,7 @@ EOF
clean
()
{
cache
=
"
$LOCALSTATEDIR
/cache/lxc/debian"
cache
=
${
LXC_CACHE_PATH
:-
"
$LOCALSTATEDIR
/cache/lxc/debian"
}
if
[
!
-e
$cache
]
;
then
exit
0
...
...
@@ -575,7 +577,7 @@ if [ -z "$rootfs" ]; then
fi
fi
install_debian
$rootfs
$release
$arch
install_debian
$rootfs
$release
$arch
$LXC_CACHE_PATH
if
[
$?
-ne
0
]
;
then
echo
"failed to install debian"
exit
1
...
...
templates/lxc-download.in
View file @
dbf21ae6
...
...
@@ -380,7 +380,9 @@ else
LXC_CACHE_BASE
=
"
$HOME
/.cache/lxc/"
fi
LXC_CACHE_PATH
=
"
$LXC_CACHE_BASE
/download/
$DOWNLOAD_DIST
"
# Allow the setting of the LXC_CACHE_PATH with the usage of environment variables.
LXC_CACHE_PATH
=
${
LXC_CACHE_PATH
:-
"
$LXC_CACHE_BASE
"
}
LXC_CACHE_PATH
=
$LXC_CACHE_PATH
/download/
$DOWNLOAD_DIST
LXC_CACHE_PATH
=
"
$LXC_CACHE_PATH
/
$DOWNLOAD_RELEASE
/
$DOWNLOAD_ARCH
/"
LXC_CACHE_PATH
=
"
$LXC_CACHE_PATH
/
$DOWNLOAD_VARIANT
"
...
...
templates/lxc-fedora.in
View file @
dbf21ae6
...
...
@@ -1281,7 +1281,8 @@ then
fi
fi
cache_base
=
@LOCALSTATEDIR@/cache/lxc/fedora/
$basearch
# Allow the cache base to be set by environment variable
cache_base
=
${
LXC_CACHE_PATH
:-
"@LOCALSTATEDIR@/cache/lxc"
}
/fedora/
$basearch
# Let's do something better for the initial root password.
# It's not perfect but it will defeat common scanning brute force
...
...
templates/lxc-gentoo.in
View file @
dbf21ae6
...
...
@@ -805,6 +805,7 @@ do
-w
|
--password
)
forced_password
=
1
;
password
=
$2
;
shift
2
;;
-s
|
--settings
)
settings
=
$2
;
shift
2
;;
-m
|
--mirror
)
mirror
=
$2
;
shift
2
;;
--container-cache
)
containercache
=
$2
;
shift
2
;;
--tty
)
[[
$2
-lt
6
]]
&&
tty
=
$2
;
shift
2
;;
--autologin
)
autologin
=
1
;
shift
1
;;
--
)
shift
1
;
break
;;
...
...
@@ -812,7 +813,8 @@ do
esac
done
cacheroot
=
"@LOCALSTATEDIR@/cache/lxc/gentoo"
# Allow the cache path to be set by environment variable
cacheroot
=
"
${
LXC_CACHE_PATH
:-
"@LOCALSTATEDIR@/cache/lxc"
}
/gentoo"
portage_cache
=
"
${
cacheroot
}
/portage.tbz"
cachefs
=
"
${
cacheroot
}
/rootfs-
${
arch
}
-
${
variant
}
"
...
...
templates/lxc-openmandriva.in
View file @
dbf21ae6
...
...
@@ -42,7 +42,8 @@ export PATH=$PATH:/usr/sbin:/usr/bin:/sbin:/bin
#Configurations
#distro=cooker
hostarch
=
$(
uname
-m
)
cache_base
=
@LOCALSTATEDIR@/cache/lxc/openmandriva/
$arch
# Allow the cache base to be set by environment variable
cache_base
=
"
${
LXC_CACHE_PATH
:-
@LOCALSTATEDIR@/cache/lxc/openmandriva/
$arch
}
"
default_path
=
@LXCPATH@
default_profile
=
default
root_password
=
root
...
...
templates/lxc-opensuse.in
View file @
dbf21ae6
...
...
@@ -227,7 +227,8 @@ copy_opensuse()
install_opensuse
()
{
cache
=
"@LOCALSTATEDIR@/cache/lxc/opensuse/
$DISTRO
"
# Allow the cache base to be set by environment variable
cache
=
"
${
LXC_CACHE_PATH
:-
@LOCALSTATEDIR@/cache/lxc/opensuse/
$DISTRO
}
"
rootfs
=
$1
mkdir
-p
@LOCALSTATEDIR@/lock/subsys/
(
...
...
@@ -350,7 +351,7 @@ EOF
clean
()
{
cache
=
"
@LOCALSTATEDIR@/cache/lxc/opensuse
"
cache
=
"
${
LXC_CACHE_PATH
:-
@LOCALSTATEDIR@/cache/lxc/opensuse
}
"
if
[
!
-e
$cache
]
;
then
exit
0
...
...
templates/lxc-ubuntu-cloud.in
View file @
dbf21ae6
...
...
@@ -274,10 +274,11 @@ type wget
# determine the url, tarball, and directory names
# download if needed
cache
=
"
$STATE_DIR
/cache/lxc/cloud-
$release
"
# Allow the cache base to be set by environment variable
cache
=
${
LXC_CACHE_PATH
:-
"
$STATE_DIR
/cache/lxc"
}
/cloud-
$release
if
[
$in_userns
-eq
1
]
;
then
STATE_DIR
=
"
$HOME
/.cache/lxc
/
"
cache
=
"
$HOME
/.cache/lxc/cloud-
$release
"
STATE_DIR
=
"
$HOME
/.cache/lxc"
cache
=
${
LXC_CACHE_PATH
:-
"
$STATE_DIR
"
}
/cloud-
$release
fi
mkdir
-p
$cache
...
...
templates/lxc-ubuntu.in
View file @
dbf21ae6
...
...
@@ -41,6 +41,8 @@ set -e
LOCALSTATEDIR
=
"@LOCALSTATEDIR@"
LXC_TEMPLATE_CONFIG
=
"@LXCTEMPLATECONFIG@"
# Allows the lxc-cache directory to be set by environment variable
LXC_CACHE_PATH
=
${
LXC_CACHE_PATH
:-
"
$LOCALSTATEDIR
/cache/lxc"
}
if
[
-r
/etc/default/lxc
]
;
then
.
/etc/default/lxc
...
...
@@ -423,7 +425,7 @@ install_ubuntu()
rootfs
=
$1
release
=
$2
flushcache
=
$3
cache
=
"
$
LOCALSTATEDIR
/cache/lxc
/
$release
"
cache
=
"
$
4
/
$release
"
mkdir
-p
$LOCALSTATEDIR
/lock/subsys/
(
...
...
@@ -703,6 +705,7 @@ flushcache=0
packages
=
""
user
=
"ubuntu"
password
=
"ubuntu"
while
true
do
case
"
$1
"
in
...
...
@@ -787,7 +790,7 @@ if [ -z "$rootfs" ]; then
fi
fi
install_ubuntu
$rootfs
$release
$flushcache
install_ubuntu
$rootfs
$release
$flushcache
$LXC_CACHE_PATH
if
[
$?
-ne
0
]
;
then
echo
"failed to install ubuntu
$release
"
exit
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment