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
c898497d
Commit
c898497d
authored
Feb 18, 2017
by
Reto Gantenbein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix undefined arch on initial bootstrap setup
Signed-off-by:
Reto Gantenbein
<
reto.gantenbein@linuxmonk.ch
>
parent
ba54e084
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
lxc-fedora.in
templates/lxc-fedora.in
+13
-11
No files found.
templates/lxc-fedora.in
View file @
c898497d
...
@@ -100,8 +100,8 @@ export PATH=${PATH}:/usr/sbin:/usr/bin:/sbin:/bin
...
@@ -100,8 +100,8 @@ export PATH=${PATH}:/usr/sbin:/usr/bin:/sbin:/bin
# dnf package manager arguments
# dnf package manager arguments
dnf_args
=(
--assumeyes
--best
--allowerasing
--disablerepo
=
*
--enablerepo
=
fedora
--enablerepo
=
updates
)
dnf_args
=(
--assumeyes
--best
--allowerasing
--disablerepo
=
*
--enablerepo
=
fedora
--enablerepo
=
updates
)
# This function is going to setup a minimal
Fedora bootstrap environment
# This function is going to setup a minimal
host-arch native Fedora bootstrap
# which will be used to create new containers on non-Fedora hosts.
#
environment
which will be used to create new containers on non-Fedora hosts.
#
#
bootstrap_fedora
()
bootstrap_fedora
()
{
{
...
@@ -149,7 +149,7 @@ bootstrap_fedora()
...
@@ -149,7 +149,7 @@ bootstrap_fedora()
else
else
if
[
-z
"
${
mirror
}
"
]
if
[
-z
"
${
mirror
}
"
]
then
then
get_mirrors
||
return
$?
get_mirrors
"
${
basearch
}
"
||
return
$?
fi
fi
for
url
in
${
mirror
:
${
mirror_urls
}}
for
url
in
${
mirror
:
${
mirror_urls
}}
do
do
...
@@ -659,12 +659,14 @@ download_fedora()
...
@@ -659,12 +659,14 @@ download_fedora()
#
#
get_mirrors
()
get_mirrors
()
{
{
local
mirror_arch
=
"
${
1
}
"
for
trynumber
in
1 2 3 4
for
trynumber
in
1 2 3 4
do
do
[
"
${
trynumber
}
"
!=
1
]
&&
echo
-n
"Trying again ... "
[
"
${
trynumber
}
"
!=
1
]
&&
echo
-n
"Trying again ... "
# choose some mirrors by parsing directory index
# choose some mirrors by parsing directory index
mirror_urls
=
$(
curl
--silent
--show-error
--fail
"
${
MIRRORLIST_URL
}
?repo=fedora-
${
release
}
&arch=
${
target
_arch
}
"
|
sed
'/^https:/!d'
|
sed
'2,6!d'
)
mirror_urls
=
$(
curl
--silent
--show-error
--fail
"
${
MIRRORLIST_URL
}
?repo=fedora-
${
release
}
&arch=
${
mirror
_arch
}
"
|
sed
'/^https:/!d'
|
sed
'2,6!d'
)
# shellcheck disable=SC2181
# shellcheck disable=SC2181
if
[
$?
-eq
0
]
&&
[
-n
"
${
mirror_urls
}
"
]
if
[
$?
-eq
0
]
&&
[
-n
"
${
mirror_urls
}
"
]
...
@@ -813,7 +815,7 @@ setup_repositories()
...
@@ -813,7 +815,7 @@ setup_repositories()
# if no mirror given, get an appropriate mirror from the mirror list
# if no mirror given, get an appropriate mirror from the mirror list
if
[
-z
"
${
mirror
}
"
]
if
[
-z
"
${
mirror
}
"
]
then
then
get_mirrors
||
return
$?
get_mirrors
"
${
target_arch
}
"
||
return
$?
else
else
# construct release-specific mirror url
# construct release-specific mirror url
mirror
=
"
${
mirror
}
/linux/releases/
${
release
}
/Everything/
${
target_arch
}
/os"
mirror
=
"
${
mirror
}
/linux/releases/
${
release
}
/Everything/
${
target_arch
}
/os"
...
@@ -1044,18 +1046,18 @@ then
...
@@ -1044,18 +1046,18 @@ then
is_fedora
=
true
is_fedora
=
true
fi
fi
basearch
=
${
arch
}
# Map a few architectures to their generic Fedora repository archs.
# Map a few architectures to their generic Fedora repository archs.
# The two ARM archs are a bit of a guesstimate for the v5 and v6
# The two ARM archs are a bit of a guesstimate for the v5 and v6
# archs. V6 should have hardware floating point (Rasberry Pi).
# archs. V6 should have hardware floating point (Rasberry Pi).
# The "arm" arch is safer (no hardware floating point). So
# The "arm" arch is safer (no hardware floating point). So
# there may be cases where we "get it wrong" for some v6 other
# there may be cases where we "get it wrong" for some v6 other
# than RPi.
# than RPi.
case
"
$arch
"
in
basearch
=
${
arch
}
i686
)
basearch
=
i386
;;
case
"
${
arch
}
"
in
armv3l|armv4l|armv5l
)
basearch
=
arm
;;
i686
)
basearch
=
i386
;;
armv6l|armv7l|armv8l
)
basearch
=
armhfp
;;
armv3l|armv4l|armv5l
)
basearch
=
arm
;;
*
)
;;
armv6l|armv7l|armv8l
)
basearch
=
armhfp
;;
*
)
;;
esac
esac
case
"
${
basearch
}
"
in
case
"
${
basearch
}
"
in
...
...
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