Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
aports
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakub Panek
aports
Commits
715129c3
Commit
715129c3
authored
13 years ago
by
Natanael Copa
Browse files
Options
Downloads
Patches
Plain Diff
buildlab: make work in vservers
parent
43f888ad
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
buildlab.in
+33
-7
33 additions, 7 deletions
buildlab.in
with
33 additions
and
7 deletions
buildlab.in
+
33
−
7
View file @
715129c3
...
...
@@ -54,6 +54,37 @@ runpart() {
$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
()
{
local
path
=
"
$1
"
...
...
@@ -61,10 +92,7 @@ do_chroot_action() {
msg
"Doing chroot action '
$command
' in '
$path
'..."
mount
-o
bind
/dev
"
$path
"
/dev
mount
-o
bind
/proc
"
$path
"
/proc
mount
-o
bind
/sys
"
$path
"
/sys
do_chroot_open
"
$path
"
||
return
1
shift
;
# XXX: we have to do this because busybox clobbers us, bleah.
...
...
@@ -72,9 +100,7 @@ do_chroot_action() {
chroot
"
$path
"
/bin/sh /.chroot-action.sh
rm
"
$path
"
/.chroot-action.sh
umount
"
$path
"
/dev
umount
"
$path
"
/proc
umount
"
$path
"
/sys
do_chroot_close
}
update_chroot
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment