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
27c278a7
Commit
27c278a7
authored
Oct 13, 2015
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ubuntu-cloud: Replace .tar.gz by .tar.xz and don't auto-generate missing tarballs
Signed-off-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
Acked-by:
Serge E. Hallyn
<
serge.hallyn@ubuntu.com
>
parent
0a2dddd4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
42 deletions
+4
-42
lxc-ubuntu-cloud.in
templates/lxc-ubuntu-cloud.in
+4
-42
No files found.
templates/lxc-ubuntu-cloud.in
View file @
27c278a7
...
@@ -297,7 +297,7 @@ else
...
@@ -297,7 +297,7 @@ else
[
"
$stream
"
=
"daily"
]
||
echo
"You may try with '--stream=daily'"
[
"
$stream
"
=
"daily"
]
||
echo
"You may try with '--stream=daily'"
exit
exit
fi
fi
url2
=
`
echo
$url1
|
sed
-e
's/.tar.gz/-root\0/'
`
url2
=
`
echo
$url1
|
sed
-e
's/.tar.gz/-root\0/'
-e
's/.tar.gz/.tar.xz/'
`
fi
fi
filename
=
`
basename
$url2
`
filename
=
`
basename
$url2
`
...
@@ -307,44 +307,6 @@ wgetcleanup()
...
@@ -307,44 +307,6 @@ wgetcleanup()
rm
-f
$filename
rm
-f
$filename
}
}
buildcleanup
()
{
cd
$rootfs
umount
-l
$cache
/
$xdir
||
true
rm
-rf
$cache
}
# if the release doesn't have a *-rootfs.tar.gz, then create one from the
# cloudimg.tar.gz by extracting the .img, mounting it loopback, and creating
# a tarball from the mounted image.
build_root_tgz
()
{
url
=
$1
filename
=
$2
xdir
=
`
mktemp
-d
-p
.
`
tarname
=
`
basename
$url
`
imgname
=
"
$release
-*-cloudimg-
$arch
.img"
trap
buildcleanup EXIT SIGHUP SIGINT SIGTERM
if
[
$flushcache
-eq
1
-o
!
-f
$cache
/
$tarname
]
;
then
rm
-f
$tarname
echo
"Downloading cloud image from
$url
"
wget
$url
||
{
echo
"Couldn't find cloud image
$url
."
;
exit
1
;
}
fi
echo
"Creating new cached cloud image rootfs"
tar
--wildcards
-zxf
"
$tarname
"
"
$imgname
"
mount
-o
loop
$imgname
$xdir
(
cd
$xdir
;
tar
--numeric-owner
-cpzf
"../
$filename
"
.
)
umount
$xdir
rm
-f
$tarname
$imgname
rmdir
$xdir
echo
"New cloud image cache created"
trap
EXIT
trap
SIGHUP
trap
SIGINT
trap
SIGTERM
}
do_extract_rootfs
()
{
do_extract_rootfs
()
{
cd
$cache
cd
$cache
...
@@ -355,7 +317,7 @@ do_extract_rootfs() {
...
@@ -355,7 +317,7 @@ do_extract_rootfs() {
trap
wgetcleanup EXIT SIGHUP SIGINT SIGTERM
trap
wgetcleanup EXIT SIGHUP SIGINT SIGTERM
if
[
!
-f
$filename
]
;
then
if
[
!
-f
$filename
]
;
then
wget
$url2
||
build_root_tgz
$url1
$filename
wget
$url2
fi
fi
trap
EXIT
trap
EXIT
trap
SIGHUP
trap
SIGHUP
...
@@ -366,10 +328,10 @@ do_extract_rootfs() {
...
@@ -366,10 +328,10 @@ do_extract_rootfs() {
mkdir
-p
$rootfs
mkdir
-p
$rootfs
cd
$rootfs
cd
$rootfs
if
[
$in_userns
-eq
1
]
;
then
if
[
$in_userns
-eq
1
]
;
then
tar
--anchored
--exclude
=
"dev/*"
--numeric-owner
-xp
z
f
"
$cache
/
$filename
"
tar
--anchored
--exclude
=
"dev/*"
--numeric-owner
-xp
J
f
"
$cache
/
$filename
"
mkdir
-p
$rootfs
/dev/pts/
mkdir
-p
$rootfs
/dev/pts/
else
else
tar
--numeric-owner
-xp
z
f
"
$cache
/
$filename
"
tar
--numeric-owner
-xp
J
f
"
$cache
/
$filename
"
fi
fi
}
}
...
...
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