blob: 9fdbd7a053c3bb426982827facf8b6b13ac3d280 (
plain)
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
#!/bin/bash
var_DEFAULTFS="/boot:32:ext2:+ swap:256:swap /:7500:ext3 /home:*:ext3"
var_TARGET_DIR="/mnt"
var_RUNTIME_PACKAGES=
var_PKG_FILE=/home/arch/fifa/runtime/package-list
var_UI_TYPE="cli" # set to cli or dia for dialog
###### Phases ( can be overridden by more specific procedures) ######
#TODO: warn user that this is a low-interactivity 'common-defaults' installation. ask the user if he really, really wants this, we will probably override his data
phase_preparation=(\
select_source \
runtime_network \
runtime_packages)
phase_basics=(\
set_clock \
prepare_disks)
phase_system=(\
package_list \
install_packages \
auto_fstab \
auto_network \
auto_locale \
configure_system \
mkinitcpio \
locales \
install_bootloader)
phase_finish=(msg_report)
###### Workers ( can be overridden by more specific procedures) ######
worker_select_source ()
{
var_PKG_SOURCE_TYPE='cd'
var_FILE_URL="file:///src/core/pkg"
var_SYNC_URL=
var_MIRRORLIST="/etc/pacman.d/mirrorlist"
# if you override to use ftp (or ask user and he chooses ftp) don't forget to configure the network and to select_mirrors
}
worker_runtime_network ()
{
#network is assumed to be functional for now because we do it first with /arch/setup. once that falls away, we'll need to implement it here
true
}
worker_runtime_packages ()
{
for pkg in $var_RUNTIME_PACKAGES
do
$PACMAN -Sy --noconfirm --needed $pkg
done
}
worker_set_clock ()
{
HARDWARECLOCK=utc
TIMEZONE=`tzselect`
HWCLOCK_PARAMS=" --utc"
if [ "$TIMEZONE" != "" -a -e "/usr/share/zoneinfo/$TIMEZONE" ]
then
cp "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime
fi
/sbin/hwclock --hctosys $HWCLOCK_PARAMS --noadjfile
#TODO: user must set date/time and store it
}
worker_prepare_disks ()
{
partition # use lib-archboot function by default
# in official installer: autoprepare or diy first partitions, then mountpoints
}
# Put the list of packages to be installed in $TARGET_PACKAGES
worker_package_list ()
{
#TODO: sensible list of packages. maybe just 'base'
true
}
worker_install_packages ()
{
target_prepare_pacman core #TODO: it would be better if this was a separate worker, i think
[ -z "$TARGET_PACKAGES" ] && die_error "No packages listed to be installed!"
installpkg
}
worker_auto_fstab ()
{
if [ "$S_MKFS" = "1" -o "$S_MKFSAUTO" = "1" ]; then
target_configure_fstab
fi
}
worker_auto_network ()
{
[ "$S_DHCP" = 1 ] && target_configure_network dhcp "$PROXY_HTTP" "$PROXY_FTP"
[ "$S_DHCP" != 1 ] && target_configure_network fixed "$PROXY_HTTP" "$PROXY_FTP"
}
worker_auto_locale ()
{
target_configure_inital_locale
}
worker_configure_system ()
{
#TODO: what to do here?
true
}
worker_mkinitcpio ()
{
run_mkinitcpio
}
worker_locales ()
{
target_locale_gen
}
worker_install_bootlader ()
{
#TODO: ask which disk, install grub on it
true
}
worker_msg_report ()
{
show_report
}
|