-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
user/lxc: bump version to 6.0.3 and fix lxc-create template scripts
- Loading branch information
Showing
5 changed files
with
129 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- a/templates/lxc-busybox.in | ||
+++ b/templates/lxc-busybox.in | ||
@@ -260,7 +260,7 @@ EOF | ||
return 0 | ||
} | ||
|
||
-if ! options=$(getopt -o hp:n: -l help,rootfs:,path:,name:,mapped-uid:,mapped-gid:,busybox-path: -- "$@"); then | ||
+if ! options=$(ugetopt -o hp:n: -l help,rootfs:,path:,name:,mapped-uid:,mapped-gid:,busybox-path: -- "$@"); then | ||
usage | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- a/templates/lxc-download.in | ||
+++ b/templates/lxc-download.in | ||
@@ -137,7 +137,7 @@ EOF | ||
return 0 | ||
} | ||
|
||
-if ! options=$(getopt -o d:r:a:hl -l dist:,release:,arch:,help,list,variant:,\ | ||
+if ! options=$(ugetopt -o d:r:a:hl -l dist:,release:,arch:,help,list,variant:,\ | ||
server:,flush-cache,force-cache,verbose,name:,path:,\ | ||
rootfs:,mapped-uid:,mapped-gid: -- "$@"); then | ||
usage | ||
@@ -413,10 +413,10 @@ if [ ! -e "${configfile}" ]; then | ||
fi | ||
|
||
## Extract all the network config entries | ||
-sed -i -e "/lxc.net.0/{w ${LXC_PATH}/config-network" -e "d}" "${LXC_PATH}/config" | ||
+gsed -i -e "/lxc.net.0/{w ${LXC_PATH}/config-network" -e "d}" "${LXC_PATH}/config" | ||
|
||
## Extract any other config entry | ||
-sed -i -e "/lxc./{w ${LXC_PATH}/config-auto" -e "d}" "${LXC_PATH}/config" | ||
+gsed -i -e "/lxc./{w ${LXC_PATH}/config-auto" -e "d}" "${LXC_PATH}/config" | ||
|
||
## Append the defaults | ||
{ | ||
@@ -471,17 +471,17 @@ OLD_IFS=${IFS} | ||
IFS=";" | ||
for file in ${TEMPLATE_FILES}; do | ||
[ ! -f "${file}" ] && continue | ||
- sed -i "s#LXC_NAME#${LXC_NAME}#g" "${file}" | ||
- sed -i "s#LXC_PATH#${LXC_PATH}#g" "${file}" | ||
- sed -i "s#LXC_ROOTFS#${LXC_ROOTFS}#g" "${file}" | ||
- sed -i "s#LXC_TEMPLATE_CONFIG#${LXC_TEMPLATE_CONFIG}#g" "${file}" | ||
- sed -i "s#LXC_HOOK_DIR#${LXC_HOOK_DIR}#g" "${file}" | ||
+ gsed -i "s#LXC_NAME#${LXC_NAME}#g" "${file}" | ||
+ gsed -i "s#LXC_PATH#${LXC_PATH}#g" "${file}" | ||
+ gsed -i "s#LXC_ROOTFS#${LXC_ROOTFS}#g" "${file}" | ||
+ gsed -i "s#LXC_TEMPLATE_CONFIG#${LXC_TEMPLATE_CONFIG}#g" "${file}" | ||
+ gsed -i "s#LXC_HOOK_DIR#${LXC_HOOK_DIR}#g" "${file}" | ||
done | ||
IFS=${OLD_IFS} | ||
|
||
# prevent mingetty from calling vhangup(2) since it fails with userns on CentOS / Oracle | ||
if [ -f "${LXC_ROOTFS}/etc/init/tty.conf" ]; then | ||
- sed -i 's|mingetty|mingetty --nohangup|' "${LXC_ROOTFS}/etc/init/tty.conf" | ||
+ gsed -i 's|mingetty|mingetty --nohangup|' "${LXC_ROOTFS}/etc/init/tty.conf" | ||
fi | ||
|
||
if [ -n "${LXC_MAPPED_UID}" ] && [ "${LXC_MAPPED_UID}" != "-1" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- a/templates/lxc-local.in | ||
+++ b/templates/lxc-local.in | ||
@@ -72,7 +72,7 @@ EOF | ||
} | ||
|
||
# Show usage and exit if invalid arguments are passed | ||
-if ! options=$(getopt -o hm:f: -l help,metadata:,fstree:,no-dev:,name:,path:,rootfs:,mapped-uid:,mapped-gid: -- "$@"); then | ||
+if ! options=$(ugetopt -o hm:f: -l help,metadata:,fstree:,no-dev:,name:,path:,rootfs:,mapped-uid:,mapped-gid: -- "$@"); then | ||
usage | ||
exit 1 | ||
fi | ||
@@ -184,7 +184,7 @@ extract_config() { | ||
# The config will be merged later. | ||
|
||
# Extract all the network config entries | ||
- sed -i -e "/lxc.net.0/{w ${LXC_PATH}/config-network" -e "d}" "${LXC_PATH}/config" | ||
+ gsed -i -e "/lxc.net.0/{w ${LXC_PATH}/config-network" -e "d}" "${LXC_PATH}/config" | ||
|
||
if [ -e "${LXC_PATH}/config-network" ]; then | ||
echo "Extracted network config to: ${LXC_PATH}/config-network" | ||
@@ -192,7 +192,7 @@ extract_config() { | ||
fi | ||
|
||
# Extract any other config entry | ||
- sed -i -e "/lxc./{w ${LXC_PATH}/config-extra" -e "d}" "${LXC_PATH}/config" | ||
+ gsed -i -e "/lxc./{w ${LXC_PATH}/config-extra" -e "d}" "${LXC_PATH}/config" | ||
|
||
if [ -e "${LXC_PATH}/config-extra" ]; then | ||
echo "Extracted additional config to: ${LXC_PATH}/config-extra" | ||
@@ -342,11 +342,11 @@ replace_template_vars() { | ||
for file in ${TEMPLATE_FILES}; do | ||
[ ! -f "${file}" ] && continue | ||
|
||
- sed -i "s#LXC_NAME#${LXC_NAME}#g" "${file}" | ||
- sed -i "s#LXC_PATH#${LXC_PATH}#g" "${file}" | ||
- sed -i "s#LXC_ROOTFS#${LXC_ROOTFS}#g" "${file}" | ||
- sed -i "s#LXC_TEMPLATE_CONFIG#${LXC_TEMPLATE_CONFIG}#g" "${file}" | ||
- sed -i "s#LXC_HOOK_DIR#${LXC_HOOK_DIR}#g" "${file}" | ||
+ gsed -i "s#LXC_NAME#${LXC_NAME}#g" "${file}" | ||
+ gsed -i "s#LXC_PATH#${LXC_PATH}#g" "${file}" | ||
+ gsed -i "s#LXC_ROOTFS#${LXC_ROOTFS}#g" "${file}" | ||
+ gsed -i "s#LXC_TEMPLATE_CONFIG#${LXC_TEMPLATE_CONFIG}#g" "${file}" | ||
+ gsed -i "s#LXC_HOOK_DIR#${LXC_HOOK_DIR}#g" "${file}" | ||
done | ||
IFS=${OLD_IFS} | ||
} | ||
@@ -355,7 +355,7 @@ fix_tty() { | ||
# prevent mingetty from calling vhangup(2) since it fails with userns on CentOS / Oracle | ||
if [ -f "${LXC_ROOTFS}/etc/init/tty.conf" ]; then | ||
echo "Patching ${LXC_ROOTFS}/etc/init/tty.conf to prevent mingetty from calling vhangup." | ||
- sed -i 's|mingetty|mingetty --nohangup|' "${LXC_ROOTFS}/etc/init/tty.conf" | ||
+ gsed -i 's|mingetty|mingetty --nohangup|' "${LXC_ROOTFS}/etc/init/tty.conf" | ||
fi | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- a/templates/lxc-oci.in | ||
+++ b/templates/lxc-oci.in | ||
@@ -250,7 +250,7 @@ EOF | ||
return 0 | ||
} | ||
|
||
-if ! options=$(getopt -o u:h -l help,url:,username:,password:,no-cache,dhcp,name:,path:,rootfs:,mapped-uid:,mapped-gid:,mount-helper: -- "$@"); then | ||
+if ! options=$(ugetopt -o u:h -l help,url:,username:,password:,no-cache,dhcp,name:,path:,rootfs:,mapped-uid:,mapped-gid:,mount-helper: -- "$@"); then | ||
usage | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters