-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbootstrapconf
executable file
·124 lines (91 loc) · 3.1 KB
/
bootstrapconf
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash -e
# Cleanup
mountpoint /media/ntfs 2>&1> /dev/null && umount /media/ntfs
rm -rf /media/ntfs /tools
userdel pkgbuild
systemctl enable accounts-daemon avahi-daemon bluetooth ModemManager NetworkManager NetworkManager-dispatcher org.cups.cupsd rtkit-daemon systemd-timesyncd teamviewerd upower wpa_supplicant
systemctl enable sshd.socket
install -dm755 /media/ntfs /media/other /media/win
install -dm755 /etc/wpa_supplicant
cat > /etc/fstab << "EOF"
#
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
/dev/sda10 / ext4 noatime,errors=remount-ro 0 1
/dev/sda9 /home ext4 noatime 0 2
/dev/sda8 none swap defaults 0 0
/dev/sda2 /boot vfat defaults 0 0
none /var/tmp tmpfs defaults 0 0
UUID=C228EA6328EA5647 /media/ntfs ntfs defaults 0 0
UUID=3CB8F34AB8F30166 /media/other ntfs defaults 0 0
EOF
useradd -u 1000 -c "Armin K" -s /bin/bash -MU armin
gpasswd -a armin systemd-journal
cat > /etc/hosts << "EOF"
# Begin /etc/hosts
127.0.0.1 localhost localhost.localdomain
::1 localhost localhost.localdomain
127.0.1.1 krejzi
# End /etc/hosts
EOF
echo "krejzi" > /etc/hostname
echo "nameserver 127.0.0.1" > /etc/resolv.conf
ln -sf /usr/share/zoneinfo/Europe/Sarajevo /etc/localtime
cat > /etc/locale.conf << "EOF"
LANG=en_US.UTF-8
EOF
cat > /etc/vconsole.conf << "EOF"
KEYMAP=croat
FONT=Lat2-Terminus16
FONT_MAP=8859-2
EOF
cat > /etc/X11/xorg.conf.d/00-keyboard.conf << "EOF"
# Read and parsed by systemd-localed. It's probably wise not to edit this file
# manually too freely.
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "hr"
Option "XkbModel" "pc105"
EndSection
EOF
#cat > /etc/X11/xorg.conf.d/90-tigervnc.conf << "EOF"
#Section "Module"
# Load "vnc"
#EndSection
#Section "Screen"
# Identifier "Screen0"
# DefaultDepth 24
# Option "SecurityTypes" "VncAuth"
# Option "UserPasswdVerifier" "VncAuth"
# Option "PasswordFile" "/home/armin/.vnc/passwd"
#EndSection
#EOF
echo -e "armin ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/99-local
chmod 440 /etc/sudoers.d/99-local
sed -i "s:#HandleLidSwitch=suspend:HandleLidSwitch=ignore:g" /etc/systemd/logind.conf
sed -i "s:#DefaultTimeoutStopSec=90s:DefaultTimeoutStopSec=30s:g" /etc/systemd/system.conf
systemctl enable gdm
echo "Entering password for user root:"
passwd
echo "Entering password for user armin:"
passwd armin
rm -rf /etc/group- /etc/gshadow- /etc/passwd- /etc/shadow-
cat << "EOF"
Now run the following from outside the chroot
export LFS=/mnt/lfs
install -m444 /etc/machine-id ${LFS}/etc
install -m600 /media/ntfs/Other/Linux/conf/nm/* ${LFS}/etc/NetworkManager/system-connections
install -m644 /media/ntfs/Other/Linux/conf/network/* ${LFS}/etc/systemd/network
install -m600 /media/ntfs/Other/Linux/conf/wpa/* ${LFS}/etc/wpa_supplicant
for D in AccountsService alsa bluetooth \
NetworkManager upower \
systemd/backlight systemd/rfkill
do
rm -rf $LFS/var/lib/${D}
cp -a /var/lib/${D} ${LFS}/var/lib/${D}
done
umount ${LFS}/sources
rmdir ${LFS}/sources
EOF