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
adbde0cc
Unverified
Commit
adbde0cc
authored
Jan 27, 2019
by
Christian Brauner
Committed by
GitHub
Jan 27, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2809 from Rachid-Koucha/patch-6
Installation of default.script for udhcpc
parents
3309e10c
1c9bca6b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
lxc-busybox.in
templates/lxc-busybox.in
+17
-2
No files found.
templates/lxc-busybox.in
View file @
adbde0cc
...
@@ -23,6 +23,8 @@
...
@@ -23,6 +23,8 @@
LXC_MAPPED_UID
=
LXC_MAPPED_UID
=
LXC_MAPPED_GID
=
LXC_MAPPED_GID
=
BUSYBOX_EXE
=
# 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
...
@@ -128,7 +130,13 @@ EOF
...
@@ -128,7 +130,13 @@ EOF
# writable and readable for other
# writable and readable for other
chmod
644
"
${
rootfs
}
/etc/inittab"
||
return
1
chmod
644
"
${
rootfs
}
/etc/inittab"
||
return
1
cat
<<
EOF
>> "
${
rootfs
}
/usr/share/udhcpc/default.script"
# Look for the pathname of "default.script" from the help of udhcpc
DEF_SCRIPT
=
`
${
BUSYBOX_EXE
}
udhcpc
-h
2>&1 |
grep
--
'-s,--script PROG'
|
cut
-d
'/'
-f2-
|
cut
-d
')'
-f1
`
DEF_SCRIPT_DIR
=
`
dirname
/
${
DEF_SCRIPT
}
`
mkdir
-p
${
rootfs
}
/
${
DEF_SCRIPT_DIR
}
chmod
644
${
rootfs
}
/
${
DEF_SCRIPT_DIR
}
||
return
1
cat
<<
EOF
>>
${
rootfs
}
/
${
DEF_SCRIPT
}
#!/bin/sh
#!/bin/sh
case "\
$1
" in
case "\
$1
" in
deconfig)
deconfig)
...
@@ -162,7 +170,7 @@ esac
...
@@ -162,7 +170,7 @@ esac
exit 0
exit 0
EOF
EOF
chmod
744
"
${
rootfs
}
/usr/share/udhcpc/default.script"
chmod
744
${
rootfs
}
/
${
DEF_SCRIPT
}
return
"
${
res
}
"
return
"
${
res
}
"
}
}
...
@@ -297,6 +305,13 @@ if [ -z "${name}" ] || [ -z "${path}" ] || [ -z "${rootfs}" ]; then
...
@@ -297,6 +305,13 @@ if [ -z "${name}" ] || [ -z "${path}" ] || [ -z "${rootfs}" ]; then
exit
1
exit
1
fi
fi
# Make sure busybox is present
BUSYBOX_EXE
=
`
which busybox
`
if
[
$?
-ne
0
]
;
then
echo
"ERROR: Failed to find busybox binary"
exit
1
fi
# detect rootfs
# detect rootfs
config
=
"
$path
/config"
config
=
"
$path
/config"
if
[
-z
"
$rootfs
"
]
;
then
if
[
-z
"
$rootfs
"
]
;
then
...
...
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