-
Notifications
You must be signed in to change notification settings - Fork 23
/
04-edit-fstab.sh
executable file
·62 lines (51 loc) · 1.5 KB
/
04-edit-fstab.sh
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
set -e
source .env
echo "================"
echo "04-edit-fstab.sh"
echo "================"
# Functions
infecho () {
echo "[Info] $1"
}
# Notify User
infecho "The env vars that will be used in this script..."
infecho "PP_PARTB = $PP_PARTB"
echo
# Automatic Preflight Checks
if [[ $EUID -ne 0 ]]; then
errecho "This script must be run as root!"
exit 1
fi
# Warning
echo "=== WARNING WARNING WARNING ==="
infecho "I didn't test this so it might also cause WWIII or something."
infecho "I'm not responsible for anything that happens, you should read the script first."
echo "=== WARNING WARNING WARNING ==="
echo
if [ ! -z "$PS1" ]; then
read -p "Continue? [y/N] " -n 1 -r
else
REPLY=y
fi
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
infecho "Mounting root file system..."
mkdir -p rootfs
mount $PP_PARTB rootfs
infecho "Fixing /etc/fstab..."
cat files/fstab > rootfs/etc/fstab
infecho "Ensuring kernel updates won't break everything..."
cat files/yum/fedora.repo > rootfs/etc/yum.repos.d/fedora.repo
infecho "Tweaking gschemas..."
mkdir -p rootfs/usr/share/glib-2.0/schemas/files/
touch rootfs/usr/share/glib-2.0/schemas/files/90_pinephone.gschema.override
cat files/90_pinephone.gschema.override > rootfs/usr/share/glib-2.0/schemas/files/90_pinephone.gschema.override
infecho "Setting system chassis..."
cat files/machine-info > rootfs/etc/machine-info
infecho "Unmounting root file system..."
sleep 3
umount $PP_PARTB
rmdir rootfs
fi