-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinst.sh
More file actions
123 lines (103 loc) · 2.78 KB
/
inst.sh
File metadata and controls
123 lines (103 loc) · 2.78 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
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
#! /bin/sh
MACHINE_ARCH=$(uname -p)
MACHINE=$(uname -m)
# set directory where this setupliveimage.img is mounted
FILEDIR=/mnt
# target root file system device
ROOTDEV=$(sysctl -r kern.root_device)
case "${ROOTDEV}" in
(dk[0-9]*)
ROOTPART=${ROOTDEV}
;;
(*)
ROOTPART=${ROOTDEV}a
;;
esac
# default user settings
UID=100
USER="mikutter"
GROUP="users"
SHELL=/usr/pkg/bin/tcsh
#SHELL=/usr/pkg/bin/bash
PASSWORD="Teokure-"
# packages list
RUBY_PKGPREFIX=ruby32
PACKAGES=" \
bash tcsh zsh \
emacs \
medit \
firefox firefox-l10n \
alsa-utils \
alsa-plugins-oss \
alsa-plugins-pulse \
w3m \
vlgothic-ttf ipafont \
droid-ttf \
unifont \
freefont-ttf \
twemoji-color-font-ttf \
jisx0212fonts jisx0213fonts \
jwm \
tango-icon-theme \
ibus \
adwaita-icon-theme \
arandr \
wpa_gui \
mozc-server mozc-tool ibus-mozc mozc-elisp \
kterm mlterm \
git-base \
${RUBY_PKGPREFIX}-mikutter \
webp-pixbuf-loader \
sayaka \
nanotodon \
"
echo "mounting target disk image..."
mount -o async /dev/${ROOTPART} /
echo "copying local /etc settings..."
cp ${FILEDIR}/etc.${MACHINE}/ttys /etc
# copy typical mk.conf file
cp ${FILEDIR}/etc/mk.conf /etc
echo "installing wpa_supplicant(8) settings..."
install -o root -g wheel -m 600 ${FILEDIR}/etc/wpa_supplicant.conf /etc
cp /usr/share/examples/dhcpcd/hooks/10-wpa_supplicant \
/libexec/dhcpcd-hooks
echo "installing packages..."
PACKAGESDIR=${FILEDIR}/packages/${MACHINE_ARCH}
(cd ${PACKAGESDIR}; PKG_RCD_SCRIPTS=YES pkg_add $PACKAGES)
# set mozc as system default of ibus
# XXX: ibus-1.5.x is configured to use dbus and dconf(1)
# requires running Xserver to write configurations,
# so mozc-jp will be configured on the first startup
# by gsettings(1) in .xsession and .xinitrc scripts.
# copy firefox addons settings
# XXX: this would make future pkg_delete(1) complain about extra file
mkdir -p /usr/pkg/lib/firefox/browser/defaults/preferences
cp ${FILEDIR}/firefox/browser/defaults/preferences/firefox-local.js \
/usr/pkg/lib/firefox/browser/defaults/preferences
cp ${FILEDIR}/firefox/defaults/pref/local-prefs.js \
/usr/pkg/lib/firefox/defaults/pref
# add rc.conf definitions for xdm
echo wscons=YES >> /etc/rc.conf
echo xdm=YES >> /etc/rc.conf
# add rc.conf definitions for packages
echo dbus=YES >> /etc/rc.conf
echo avahidaemon=NO >> /etc/rc.conf
# copy sample xorg.conf settings to workaround accelaration issue
cp ${FILEDIR}/etc/xorg.conf.intel-uxa /etc/X11
cp ${FILEDIR}/etc/xorg.conf.vesa /etc/X11
echo "rehash root certificates..."
/usr/sbin/certctl rehash
echo "updating fontconfig cache..."
/usr/X11R7/bin/fc-cache
echo "updating man database..."
/usr/sbin/makemandb
echo "creating user account..."
useradd -m \
-k ${FILEDIR}/skel \
-u $UID \
-g $GROUP \
-G wheel \
-s $SHELL \
-p $(pwhash $PASSWORD) \
$USER
echo "done."