Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs225
vm
Commits
e57f2639
Commit
e57f2639
authored
8 years ago
by
Jeffrey Tolar
Browse files
Options
Downloads
Patches
Plain Diff
Add flag to only build the VirtualBox image
parent
71c2a2f0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
create_vm.sh
+10
-1
10 additions, 1 deletion
create_vm.sh
with
10 additions
and
1 deletion
create_vm.sh
+
10
−
1
View file @
e57f2639
#!/bin/bash
# x86_64 or x86
ARCH
=
x86
ARCH
=
x86_64
BUILD
=
1
DISK
=
vm_
$ARCH
.img
DEFAULT_USER
=
dev
...
...
@@ -59,6 +60,8 @@ m() {
echo
"
$@
"
}
if
[[
-n
"
$BUILD
"
]]
;
then
rm
-f
$DISK
m
"Creating disk image..."
...
...
@@ -75,6 +78,7 @@ n
a
w
fdiskEOF
fi
# -n $BUILD
m
"Mounting virtual drive... (requires sudo)"
...
...
@@ -84,8 +88,10 @@ sudo losetup --partscan "$loopdev" $DISK
trap
"sudo losetup -d
$loopdev
"
EXIT
if
[[
-n
"
$BUILD
"
]]
;
then
m
"Creating filesystem... (requires sudo)"
sudo
mkfs.ext3
${
loopdev
}
p1
fi
# -n $BUILD
mkdir
-p
root
...
...
@@ -94,6 +100,7 @@ sudo mount ${loopdev}p1 root/
trap
"sudo umount
${
loopdev
}
p1 ; sudo losetup -d
$loopdev
"
EXIT
if
[[
-n
"
$BUILD
"
]]
;
then
if
[[
$ARCH
==
"x86_64"
]]
;
then
sudo
pacstrap
-C
pacman-x86_64.conf
-c
-G
root/
"
${
PACKAGES
[@]
}
"
else
...
...
@@ -264,6 +271,8 @@ xfceConfigEOF
chrootEOF
fi
# -n $BUILD
# Open a root shell
#sudo arch-chroot root/
...
...
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