-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path07-final-touches.bash
More file actions
executable file
·31 lines (26 loc) · 1 KB
/
07-final-touches.bash
File metadata and controls
executable file
·31 lines (26 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
#
# This is the last step before booting the VM. It reverts some
# chagnes made to the VM and sets the root password.
#
# This script is only intended to be run once.
#
# Note: This script uses 'sudo'.
#
if [ -z $UB_CONFIGURED ]; then
echo "Please execute 'guest.bash' to configure the environment first."
exit 1
fi
# Initialise some helpers
. ${UB_HOME}/functions.bash
(cd ${U_RELEASE}-${U_ARCH}-bootstrap
linfo "Working in: ${U_RELEASE}-${U_ARCH}-bootstrap and VM: ${VM_ROOT}"
# Unmount first in case this script is being run standalone.
${UB_HOME}/11-umount-image.bash || die
${UB_HOME}/10-mount-image.bash || die
linfo "Reverting the apt sources changes"
cat ${UB_HOME}/source.list.template | awk '{gsub("{{MIRROR}}", "'${U_MIRROR}'");print}' > tmp/source.list.live
sudo cp tmp/source.list.live ${VM_ROOT}/etc/apt/sources.list.live || die
sudo cp ${VM_ROOT}/etc/apt/sources.list.live ${VM_ROOT}/etc/apt/sources.list || die
${UB_HOME}/11-umount-image.bash || die
)