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
da161bc1
Unverified
Commit
da161bc1
authored
May 10, 2019
by
Christian Brauner
Committed by
GitHub
May 10, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2993 from Rachid-Koucha/patch-9
New --bbpath option and unecessary --rootfs checks
parents
e269d99b
5f0fb855
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
15 deletions
+26
-15
lxc-busybox.in
templates/lxc-busybox.in
+26
-15
No files found.
templates/lxc-busybox.in
View file @
da161bc1
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
LXC_MAPPED_UID
=
LXC_MAPPED_UID
=
LXC_MAPPED_GID
=
LXC_MAPPED_GID
=
BUSYBOX_EXE
=
BUSYBOX_EXE
=
`
which busybox
`
# Make sure the usual locations are in PATH
# Make sure the usual locations are in PATH
export
PATH
=
$PATH
:/usr/sbin:/usr/bin:/sbin:/bin
export
PATH
=
$PATH
:/usr/sbin:/usr/bin:/sbin:/bin
...
@@ -266,19 +266,26 @@ usage() {
...
@@ -266,19 +266,26 @@ usage() {
LXC busybox image builder
LXC busybox image builder
Special arguments:
Special arguments:
[ -h | --help ]: Print this help message and exit.
[ -h | --help ]: Print this help message and exit.
LXC internal arguments (do not pass manually!):
[ --name <name> ]: The container name
LXC internal arguments:
[ --path <path> ]: The path to the container
[ --rootfs <rootfs> ]: The path to the container's rootfs
[ --name <name> ]: The container name
[ --mapped-uid <map> ]: A uid map (user namespaces)
[ --path <path> ]: The path to the container
[ --mapped-gid <map> ]: A gid map (user namespaces)
[ --rootfs <rootfs> ]: The path to the container's rootfs (default: config or <path>/rootfs)
[ --mapped-uid <map> ]: A uid map (user namespaces)
[ --mapped-gid <map> ]: A gid map (user namespaces)
BUSYBOX template specific arguments:
[ --busybox-path <path> ]: busybox pathname (default:
${
BUSYBOX_EXE
}
)
EOF
EOF
return
0
return
0
}
}
if
!
options
=
$(
getopt
-o
hp:n:
-l
help
,rootfs:,path:,name:,mapped-uid:,mapped-gid:
--
"
$@
"
)
;
then
if
!
options
=
$(
getopt
-o
hp:n:
-l
help
,rootfs:,path:,name:,mapped-uid:,mapped-gid:
,busybox-path:
--
"
$@
"
)
;
then
usage
usage
exit
1
exit
1
fi
fi
...
@@ -293,21 +300,25 @@ do
...
@@ -293,21 +300,25 @@ do
--rootfs
)
rootfs
=
$2
;
shift
2
;;
--rootfs
)
rootfs
=
$2
;
shift
2
;;
--mapped-uid
)
LXC_MAPPED_UID
=
$2
;
shift
2
;;
--mapped-uid
)
LXC_MAPPED_UID
=
$2
;
shift
2
;;
--mapped-gid
)
LXC_MAPPED_GID
=
$2
;
shift
2
;;
--mapped-gid
)
LXC_MAPPED_GID
=
$2
;
shift
2
;;
--busybox-path
)
BUSYBOX_EXE
=
$2
;
shift
2
;;
--
)
shift
1
;
break
;;
--
)
shift
1
;
break
;;
*
)
break
;;
*
)
break
;;
esac
esac
done
done
# Check that we have all variables we need
# Check that we have all variables we need
if
[
-z
"
${
name
}
"
]
||
[
-z
"
${
path
}
"
]
||
[
-z
"
${
rootfs
}
"
]
;
then
if
[
-z
"
${
name
}
"
]
||
[
-z
"
${
path
}
"
]
;
then
echo
"ERROR: Please pass the name
, path, and rootfs
for the container"
1>&2
echo
"ERROR: Please pass the name
and path
for the container"
1>&2
exit
1
exit
1
fi
fi
# Make sure busybox is present
# Make sure busybox is present
BUSYBOX_EXE
=
`
which busybox
`
if
[
-z
"
${
BUSYBOX_EXE
}
"
]
;
then
if
[
$?
-ne
0
]
;
then
echo
"ERROR: Please pass a pathname for busybox binary"
1>&2
echo
"ERROR: Failed to find busybox binary"
1>&2
exit
1
fi
if
[
!
-x
"
${
BUSYBOX_EXE
}
"
]
;
then
echo
"ERROR: Failed to find busybox binary (
${
BUSYBOX_EXE
}
)"
1>&2
exit
1
exit
1
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