Commit 1d1774b1 by Bogdan Purcareata Committed by Stéphane Graber

use susv3 head arguments

Without enabling INCLUDE_SUSv2 in busybox, we need to use head's -n argument, rather than -#. Signed-off-by: 's avatarChristopher Larson <kergoth@gmail.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 5c4734bc
......@@ -77,7 +77,7 @@ print_cgroups() {
awk '$1 !~ /#/ && $3 == mp { print $2; } ; END { exit(0); } ' "mp=$1" "$2" ;
}
CGROUP_MNT_PATH=`print_cgroups cgroup /proc/self/mounts | head -1`
CGROUP_MNT_PATH=`print_cgroups cgroup /proc/self/mounts | head -n 1`
KVER_MAJOR=$($GREP '^# Linux' $CONFIG | \
sed -r 's/.* ([0-9])\.[0-9]{1,2}\.[0-9]{1,3}.*/\1/')
if [ "$KVER_MAJOR" = "2" ]; then
......
......@@ -59,7 +59,7 @@ for template in ubuntu ubuntu-cloud; do
lxc-wait -n $name -s RUNNING || FAIL "waiting for $template container to run"
for tries in `seq 1 20`; do
lxcip=$(lxc-info -i -n $name -H | head -1)
lxcip=$(lxc-info -i -n $name -H | head -n 1)
[ -z "$lxcip" ] || break
sleep 1
done
......
......@@ -189,7 +189,7 @@ EOF
if [ "$nics" -eq 1 ] && ! grep -q "^lxc.network.hwaddr" $path/config; then
# see http://sourceforge.net/tracker/?func=detail&aid=3411497&group_id=163076&atid=826303
hwaddr="fe:$(dd if=/dev/urandom bs=8 count=1 2>/dev/null |od -t x8 | \
head -1 |awk '{print $2}' | cut -c1-10 |\
head -n 1 |awk '{print $2}' | cut -c1-10 |\
sed 's/\(..\)/\1:/g; s/.$//')"
echo "lxc.network.hwaddr = $hwaddr" >> $path/config
fi
......
......@@ -382,7 +382,7 @@ container_config_create()
# generate a hwaddr for the container with a high mac address
# see http://sourceforge.net/tracker/?func=detail&aid=3411497&group_id=163076&atid=826303
local hwaddr="fe:`dd if=/dev/urandom bs=8 count=1 2>/dev/null |od -t x8 | \
head -1 |awk '{print $2}' | cut -c1-10 |\
head -n 1 |awk '{print $2}' | cut -c1-10 |\
sed 's/\(..\)/\1:/g; s/.$//'`"
cat <<EOF >> $cfg_dir/config || die "unable to create $cfg_dir/config"
# Container configuration for Oracle Linux $container_release_major.$container_release_minor
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment