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
9d95ca97
Commit
9d95ca97
authored
Dec 24, 2015
by
Vaidas Kascėnas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optional template parameter -v|--variant tells debootstrap which variant script to use.
Signed-off-by:
Vaidas Kascėnas
<
vaidas@kascenas.lt
>
parent
fbc617e8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
lxc-ubuntu.in
templates/lxc-ubuntu.in
+9
-4
No files found.
templates/lxc-ubuntu.in
View file @
9d95ca97
...
@@ -343,6 +343,9 @@ download_ubuntu()
...
@@ -343,6 +343,9 @@ download_ubuntu()
fi
fi
packages_template
=
"
${
packages_template
}
,
$(
echo
$langpacks
|
sed
's/ /,/g'
)
"
packages_template
=
"
${
packages_template
}
,
$(
echo
$langpacks
|
sed
's/ /,/g'
)
"
if
[
$variant
==
'minbase'
]
;
then
packages_template
=
"
${
packages_template
}
,sudo,ifupdown,isc-dhcp-client"
fi
echo
"Installing packages in template:
${
packages_template
}
"
echo
"Installing packages in template:
${
packages_template
}
"
...
@@ -358,9 +361,9 @@ download_ubuntu()
...
@@ -358,9 +361,9 @@ download_ubuntu()
# download a mini ubuntu into a cache
# download a mini ubuntu into a cache
echo
"Downloading ubuntu
$release
minimal ..."
echo
"Downloading ubuntu
$release
minimal ..."
if
[
-n
"
$(
which qemu-debootstrap
)
"
]
;
then
if
[
-n
"
$(
which qemu-debootstrap
)
"
]
;
then
qemu-debootstrap
--verbose
--components
=
main,universe
--arch
=
$arch
--include
=
${
packages_template
}
$release
$cache
/partial-
$arch
$MIRROR
qemu-debootstrap
--verbose
$(if
[
-n
"
$variant
"
]
;
then
echo
--variant
=
"
$variant
"
;
fi)
--components
=
main,universe
--arch
=
$arch
--include
=
${
packages_template
}
$release
$cache
/partial-
$arch
$MIRROR
else
else
debootstrap
--verbose
--components
=
main,universe
--arch
=
$arch
--include
=
${
packages_template
}
$release
$cache
/partial-
$arch
$MIRROR
debootstrap
--verbose
$(if
[
-n
"
$variant
"
]
;
then
echo
--variant
=
"
$variant
"
;
fi)
--components
=
main,universe
--arch
=
$arch
--include
=
${
packages_template
}
$release
$cache
/partial-
$arch
$MIRROR
fi
fi
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
...
@@ -647,10 +650,11 @@ usage()
...
@@ -647,10 +650,11 @@ usage()
{
{
cat
<<
EOF
cat
<<
EOF
$1
-h|--help [-a|--arch] [-b|--bindhome <user>] [-d|--debug]
$1
-h|--help [-a|--arch] [-b|--bindhome <user>] [-d|--debug]
[-F | --flush-cache] [-r|--release <release>] [ -S | --auth-key <keyfile>]
[-F | --flush-cache] [-r|--release <release>] [
-v|--variant] [
-S | --auth-key <keyfile>]
[--rootfs <rootfs>] [--packages <packages>] [-u|--user <user>] [--password <password>]
[--rootfs <rootfs>] [--packages <packages>] [-u|--user <user>] [--password <password>]
[--mirror <url>] [--security-mirror <url>]
[--mirror <url>] [--security-mirror <url>]
release: the ubuntu release (e.g. precise): defaults to host release on ubuntu, otherwise uses latest LTS
release: the ubuntu release (e.g. precise): defaults to host release on ubuntu, otherwise uses latest LTS
variant: debootstrap variant to use (see debootstrap(8))
bindhome: bind <user>'s home into the container
bindhome: bind <user>'s home into the container
The ubuntu user will not be created, and <user> will have
The ubuntu user will not be created, and <user> will have
sudo access.
sudo access.
...
@@ -662,7 +666,7 @@ EOF
...
@@ -662,7 +666,7 @@ EOF
return
0
return
0
}
}
options
=
$(
getopt
-o
a:b:hp:r:
n:FS:du:
-l
arch
:,bindhome:,help,path:,release
:,name:,flush-cache,auth-key:,debug,rootfs:,packages:,user:,password:,mirror:,security-mirror:
--
"
$@
"
)
options
=
$(
getopt
-o
a:b:hp:r:
v:n:FS:du:
-l
arch
:,bindhome:,help,path:,release:,variant
:,name:,flush-cache,auth-key:,debug,rootfs:,packages:,user:,password:,mirror:,security-mirror:
--
"
$@
"
)
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
usage
$(
basename
$0
)
usage
$(
basename
$0
)
exit
1
exit
1
...
@@ -717,6 +721,7 @@ do
...
@@ -717,6 +721,7 @@ do
--password
)
password
=
$2
;
shift
2
;;
--password
)
password
=
$2
;
shift
2
;;
-F
|
--flush-cache
)
flushcache
=
1
;
shift
1
;;
-F
|
--flush-cache
)
flushcache
=
1
;
shift
1
;;
-r
|
--release
)
release
=
$2
;
shift
2
;;
-r
|
--release
)
release
=
$2
;
shift
2
;;
-v
|
--variant
)
variant
=
$2
;
shift
2
;;
--packages
)
packages
=
$2
;
shift
2
;;
--packages
)
packages
=
$2
;
shift
2
;;
-b
|
--bindhome
)
bindhome
=
$2
;
shift
2
;;
-b
|
--bindhome
)
bindhome
=
$2
;
shift
2
;;
-a
|
--arch
)
arch
=
$2
;
shift
2
;;
-a
|
--arch
)
arch
=
$2
;
shift
2
;;
...
...
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