Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
abuild
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
24
Issues
24
List
Boards
Labels
Service Desk
Milestones
Merge Requests
17
Merge Requests
17
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
abuild
Commits
715129c3
Commit
715129c3
authored
Sep 30, 2011
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
buildlab: make work in vservers
parent
43f888ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
7 deletions
+33
-7
buildlab.in
buildlab.in
+33
-7
No files found.
buildlab.in
View file @
715129c3
...
@@ -54,6 +54,37 @@ runpart() {
...
@@ -54,6 +54,37 @@ runpart() {
$part
||
die
"
$part
failed"
$part
||
die
"
$part
failed"
}
}
is_vserver
()
{
egrep
-q
'^VxID:[[:space:]]*[0-9]+'
/proc/self/status
}
do_chroot_open
()
{
local
path
=
"
$1
"
if
is_vserver
;
then
# vserver does not allow us mount or create devices
# but we can create hard links as long as chroot is
# on same filesystem as real root
rmdir
"
$path
"
/proc
"
$path
"
/sys
"
$path
"
/dev 2>/dev/null
ln
/dev
"
$path
"
/dev
ln
/proc
"
$path
"
/proc
ln
/sys
"
$path
"
/sys
else
mkdir
-p
"
$path
"
/dev
"
$path
"
/proc
"
$path
"
/sys
mount
-o
bind
/dev
"
$path
"
/dev
||
return
1
mount
-o
bind
/proc
"
$path
"
/proc
mount
-o
bind
/sys
"
$path
"
/sys
fi
}
do_chroot_close
()
{
local
path
=
"
$1
"
if
is_vserver
;
then
rmdir
"
$path
"
/dev
"
$path
"
/proc
"
$path
"
/sys
else
umount
"
$path
"
/dev
"
$path
"
/proc
"
$path
"
/sys
fi
}
do_chroot_action
()
{
do_chroot_action
()
{
local
path
=
"
$1
"
local
path
=
"
$1
"
...
@@ -61,10 +92,7 @@ do_chroot_action() {
...
@@ -61,10 +92,7 @@ do_chroot_action() {
msg
"Doing chroot action '
$command
' in '
$path
'..."
msg
"Doing chroot action '
$command
' in '
$path
'..."
mount
-o
bind
/dev
"
$path
"
/dev
do_chroot_open
"
$path
"
||
return
1
mount
-o
bind
/proc
"
$path
"
/proc
mount
-o
bind
/sys
"
$path
"
/sys
shift
;
shift
;
# XXX: we have to do this because busybox clobbers us, bleah.
# XXX: we have to do this because busybox clobbers us, bleah.
...
@@ -72,9 +100,7 @@ do_chroot_action() {
...
@@ -72,9 +100,7 @@ do_chroot_action() {
chroot
"
$path
"
/bin/sh /.chroot-action.sh
chroot
"
$path
"
/bin/sh /.chroot-action.sh
rm
"
$path
"
/.chroot-action.sh
rm
"
$path
"
/.chroot-action.sh
umount
"
$path
"
/dev
do_chroot_close
umount
"
$path
"
/proc
umount
"
$path
"
/sys
}
}
update_chroot
()
{
update_chroot
()
{
...
...
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