7 |
# Niels Rogalla <niro@magellan-linux.de> |
# Niels Rogalla <niro@magellan-linux.de> |
8 |
# |
# |
9 |
|
|
10 |
# ignore the environment |
# setup locales |
11 |
LC_ALL=C |
TEXTDOMAIN=installer |
12 |
|
|
13 |
# include dir |
# include dir |
14 |
INSTALLER_LIBDIR="%LIBDIR%" |
INSTALLER_LIBDIR="%LIBDIR%" |
15 |
|
|
28 |
${INSTALLER_LIBDIR}/functions/common.sh \ |
${INSTALLER_LIBDIR}/functions/common.sh \ |
29 |
${INSTALLER_LIBDIR}/functions/common-dialogs.sh \ |
${INSTALLER_LIBDIR}/functions/common-dialogs.sh \ |
30 |
${INSTALLER_LIBDIR}/functions/hwdetection.sh \ |
${INSTALLER_LIBDIR}/functions/hwdetection.sh \ |
31 |
|
${INSTALLER_LIBDIR}/functions/bootloader.sh \ |
32 |
|
${INSTALLER_LIBDIR}/functions/initrd-tools.sh \ |
33 |
${INSTALLER_LIBDIR}/functions/installer-dialogs.sh |
${INSTALLER_LIBDIR}/functions/installer-dialogs.sh |
34 |
do |
do |
35 |
if [ -e ${inc} ] |
if [ -e ${inc} ] |
40 |
fi |
fi |
41 |
done |
done |
42 |
|
|
|
# TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 ! |
|
|
# -> now in images.conf |
|
|
CDIMAGENAME="" |
|
|
TOTALLINES="" |
|
|
CURRENTLINE=0 |
|
|
if [ -e /mnt/cdrom/system/images.conf ] |
|
|
then |
|
|
source /mnt/cdrom/system/images.conf |
|
|
# check if all required variables are set |
|
|
[[ -z ${CDIMAGENAME} ]] && die "CDIMAGENAME is empty in /mnt/cdrom/system/images.conf" |
|
|
[[ -z ${TOTALLINES} ]] && die "TOTALLINES is empty in /mnt/cdrom/system/images.conf" |
|
|
else |
|
|
die "/mnt/cdrom/system/images.conf not found" |
|
|
fi |
|
|
|
|
43 |
### System/Config Version |
### System/Config Version |
44 |
VERSION="%VERSIONTAG%" |
VERSION="%VERSIONTAG%" |
45 |
TITLE="${DEFAULT_TITLE} - ${VERSION}" |
TITLE="${DEFAULT_TITLE} - ${VERSION}" |
46 |
|
|
47 |
# some sane defaults |
# some sane defaults |
48 |
CDROOT="${DEFAULT_CDROOT}" |
LIVEROOT="${DEFAULT_LIVEROOT}" |
49 |
|
IMAGEROOT="${DEFAULT_IMAGEROOT}" |
50 |
INSTALLROOT="${DEFAULT_INSTALLROOT}" |
INSTALLROOT="${DEFAULT_INSTALLROOT}" |
51 |
KERNELPKG="${DEFAULT_KERNELPKG}" |
KERNELPKG="${DEFAULT_KERNELPKG}" |
52 |
KERNELOPTS="${DEFAULT_KERNELOPTS}" |
KERNELOPTS="${DEFAULT_KERNELOPTS}" |
57 |
FORMFACTOR="${DEFAULT_FORMFACTOR}" |
FORMFACTOR="${DEFAULT_FORMFACTOR}" |
58 |
FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}" |
FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}" |
59 |
|
|
60 |
################################################# |
# TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 ! |
61 |
# DIALOG BOXEN # |
# -> now in images.conf |
62 |
################################################# |
CDIMAGENAME="" |
63 |
|
TOTALLINES="" |
64 |
|
CURRENTLINE=0 |
65 |
|
if [ -e ${IMAGEROOT}/images.conf ] |
66 |
|
then |
67 |
|
source ${IMAGEROOT}/images.conf |
68 |
|
# check if all required variables are set |
69 |
|
[[ -z ${CDIMAGENAME} ]] && die "CDIMAGENAME is empty in ${IMAGEROOT}/images.conf" |
70 |
|
[[ -z ${TOTALLINES} ]] && die "TOTALLINES is empty in ${IMAGEROOT}/images.conf" |
71 |
|
else |
72 |
|
die "${IMAGEROOT}/images.conf not found" |
73 |
|
fi |
74 |
|
|
75 |
|
### helper scripts ### |
76 |
|
|
77 |
trap_exit() |
trap_exit() |
78 |
{ |
{ |
86 |
exit 1 |
exit 1 |
87 |
} |
} |
88 |
|
|
89 |
dialog_die() |
install_meter() |
90 |
{ |
{ |
91 |
ERROR="$1" |
while [[ ${CURRENTLINE} != ${TOTALLINES} ]] |
92 |
RETVAL="$?" |
do |
93 |
dialog_install_failure |
CURRENTLINE=$(grep -c . /tmp/install.log) |
94 |
exit 1 |
PERCENT=$(( ${CURRENTLINE} * 100 / ${TOTALLINES})) |
95 |
|
echo ${PERCENT} |
96 |
|
sleep 1 |
97 |
|
done |
98 |
|
rm -f /tmp/install.log |
99 |
|
return 0 |
100 |
} |
} |
101 |
|
|
102 |
dialog_warning() |
install_mount_rootfs() |
103 |
{ |
{ |
104 |
local retval |
local opts |
105 |
|
|
106 |
yesnobox $"\Z1 !!! Warning !!! \Zn\n\n\This harddrive will be irreversibly erased.\n\n\Do you want to continue ?" |
if [[ -n ${SWAPHDD} ]] |
|
retval=$? |
|
|
if [[ ${retval} -eq 1 ]] |
|
107 |
then |
then |
108 |
clear |
swapon ${SWAPHDD} || die |
|
echo $"The process was aborted." |
|
|
exit 1 |
|
109 |
fi |
fi |
110 |
} |
if [[ -n ${ROOTHDD} ]] |
|
|
|
|
dialog_setup_hdd_info() |
|
|
{ |
|
|
local SHDD="${HDD//\/dev\/}" |
|
|
|
|
|
messagebox -h $"[ Harddrive partitioning ]" \ |
|
|
$"\nPlease create 1 partition.\n\n\[ \Z3${SHDD}1\Zn ] type: \Z3linux\Zn with the whole diskspace\n\Please mark ${SHDD}1 \Z3bootable\Zn." |
|
|
} |
|
|
|
|
|
dialog_setup_hdd_info_auto() |
|
|
{ |
|
|
local SHDD="${HDD//\/dev\/}" |
|
|
|
|
|
messagebox -h $"[ Harddrive partitioning ]" \ |
|
|
$"\Z1Warning!\Zn\n\nAll data on disk [ \Z3${HDD}\Zn ] will be erased!" |
|
|
} |
|
|
|
|
|
dialog_setup_system_menu() |
|
|
{ |
|
|
local mode |
|
|
local retval |
|
|
|
|
|
mode=$(dialog \ |
|
|
--backtitle "${TITLE}" \ |
|
|
--title "[ Festplatten Partitionierung ]" \ |
|
|
--cancel-label "Abbrechen" \ |
|
|
--ok-label "Weiter" \ |
|
|
--stdout \ |
|
|
--colors \ |
|
|
--menu "\nWaehlen Sie die Installations-Methode" 14 70 5 \ |
|
|
"1" "Automatisches Setup (Empfohlen)" \ |
|
|
"" "" \ |
|
|
"" "\Z1Experten Modi:\Zn" \ |
|
|
"2" "Normale IDE-Disk (Manuell)" \ |
|
|
retval=$? |
|
|
[[ ${retval} -eq 1 ]] && return 1 |
|
|
if [[ ${retval} -eq 0 ]] |
|
111 |
then |
then |
112 |
case "${mode}" in |
mount -t ${FORMAT_FILESYSTEM_ROOTHDD} ${ROOTHDD} ${INSTALL_ROOT} || die |
|
"1") run_install_auto ;; |
|
|
"2") run_install_normal ;; |
|
|
"") dialog_setup_system_menu;; |
|
|
esac |
|
113 |
fi |
fi |
114 |
} |
if [[ -n ${BOOTHDD} ]] |
|
|
|
|
dialog_hardware_detection() |
|
|
{ |
|
|
local i |
|
|
local hwtmp |
|
|
|
|
|
if [ -x $(type -P mktemp) ] |
|
115 |
then |
then |
116 |
hwtmp="$(mktemp)" |
install -d ${INSTALL_ROOT}/boot || die |
117 |
else |
mount -t ${FORMAT_FILESYSTEM_BOOTHDD} ${BOOTHDD} ${INSTALL_ROOT}/boot || die |
|
hwtmp="/tmp/hwtmp.sh" |
|
118 |
fi |
fi |
119 |
|
|
120 |
run_hardware_detection_disks |
cd ${INSTALL_ROOT} || die |
121 |
|
} |
|
echo "dialog \\" > ${hwtmp} |
|
|
echo "--backtitle \"${TITLE}\" \\" >> ${hwtmp} |
|
|
echo "--ok-label \"Weiter\" \\" >> ${hwtmp} |
|
|
echo "--stdout \\" >> ${hwtmp} |
|
|
echo "--colors \\" >> ${hwtmp} |
|
|
echo "--msgbox \"Gefundene Hardware:\n\n \\" >> ${hwtmp} |
|
|
echo " Festplatten:\n \\" >> ${hwtmp} |
|
|
|
|
|
if [[ ! -z ${ALL_DISKS} ]] |
|
|
then |
|
|
for i in ${ALL_DISKS} |
|
|
do |
|
|
echo " \\Z3${i}\\Zn\n \\" >> ${hwtmp} |
|
|
done |
|
|
fi |
|
122 |
|
|
|
if [[ ! -z ${ALL_CDROMS} ]] |
|
|
then |
|
|
echo " \n \\" >> ${hwtmp} |
|
|
echo " CDROM Laufwerke:\n \\" >> ${hwtmp} |
|
|
for i in ${ALL_CDROMS} |
|
|
do |
|
|
echo " \\Z3${i}\\Zn\n \\" >> ${hwtmp} |
|
|
done |
|
|
fi |
|
123 |
|
|
124 |
# other devices |
mount_rootfs() |
125 |
run_hardware_detection |
{ |
126 |
case "${SPECIALDEVICE}" in |
local retval |
|
zotac*) echo " \n\n\n \\Z2Zotac Device erkannt.\\Zn \\" >> ${hwtmp} ;; |
|
|
rangee) echo " \n\n\n \\Z2Rangee Device erkannt.\\Zn \\" >> ${hwtmp} ;; |
|
|
maxdata) echo " \n\n\n \\Z2Maxdata Device erkannt.\\Zn \\" >> ${hwtmp} ;; |
|
|
*) echo " \n\n\n \\ZnStandard Device erkannt.\\Zn \\" >> ${hwtmp} ;; |
|
|
esac |
|
|
if [[ ${FORMFACTOR} = laptop ]] |
|
|
then |
|
|
echo " \n \\ZnFormfactor Laptop, Powersave Modus 'ondemand' wird aktiviert.\\Zn \\" >> ${hwtmp} |
|
|
fi |
|
|
|
|
|
echo " \" 14 70" >> ${hwtmp} |
|
|
chmod a+x ${hwtmp} |
|
|
${hwtmp} |
|
127 |
|
|
128 |
# remove tmp file |
if [[ -n ${SWAPHDD} ]] |
|
if [[ -f ${hwtmp} ]] |
|
129 |
then |
then |
130 |
rm ${hwtmp} |
swapon ${SWAPHDD} || dialog_die $"Could not enable swap space '${SWAPHDD}'" |
131 |
fi |
fi |
|
} |
|
|
|
|
|
dialog_setup_hdd_partitions_manual() |
|
|
{ |
|
|
local i |
|
132 |
|
|
133 |
if [[ -z ${installdevs} ]] |
if [[ -n ${ROOTHDD} ]] |
134 |
then |
then |
135 |
dialog \ |
if is_mounted --location "${INSTALLROOT}" |
|
--backtitle "${TITLE}" \ |
|
|
--ok-label "Beenden" \ |
|
|
--msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70 |
|
|
exit 1 |
|
|
else |
|
|
|
|
|
echo "dialog \\" > /tmp/hddtmp.sh |
|
|
echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh |
|
|
echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh |
|
|
echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh |
|
|
echo "--stdout \\" >> /tmp/hddtmp.sh |
|
|
echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh |
|
|
|
|
|
for i in ${installdevs} |
|
|
do |
|
|
echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh |
|
|
done |
|
|
echo -e "\n" >> /tmp/hddtmp.sh |
|
|
|
|
|
chmod a+x /tmp/hddtmp.sh |
|
|
HDD="$(/tmp/hddtmp.sh)" |
|
|
RES=$? |
|
|
[[ ${RES} -eq 1 ]] && return 1 |
|
|
if [[ ${RES} -eq 0 ]] |
|
136 |
then |
then |
137 |
dialog_setup_hdd_info |
echo $"${INSTALLROOT} already mounted" >&2 |
138 |
setup_hdd_partitions_manual |
else |
139 |
|
mount "${ROOTHDD}" "${INSTALLROOT}" || dialog_die $"Could not mount rootfs - drive '${ROOTHDD}' -> '${INSTALLROOT}'" |
140 |
fi |
fi |
141 |
fi |
fi |
|
} |
|
142 |
|
|
143 |
dialog_setup_hdd_partitions_auto() |
[[ -d ${INSTALLROOT}/boot ]] || install -d ${INSTALLROOT}/boot |
|
{ |
|
|
local i |
|
144 |
|
|
145 |
if [[ -z ${installdevs} ]] |
if [[ -n ${BOOTHDD} ]] |
146 |
then |
then |
147 |
dialog \ |
if is_mounted --location "${INSTALLROOT}"/boot |
148 |
--backtitle "${TITLE}" \ |
then |
149 |
--ok-label "Beenden" \ |
echo $"${INSTALLROOT}/boot already mounted" >&2 |
150 |
--msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70 |
else |
151 |
exit 1 |
mount "${BOOTHDD}" "${INSTALLROOT}"/boot || dialog_die $"Could not mount bootfs - drive '${BOOTHDD}' -> '${INSTALLROOT}/boot'" |
|
else |
|
|
|
|
|
echo "dialog \\" > /tmp/hddtmp.sh |
|
|
echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh |
|
|
echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh |
|
|
echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh |
|
|
echo "--stdout \\" >> /tmp/hddtmp.sh |
|
|
echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh |
|
|
|
|
|
for i in ${installdevs} |
|
|
do |
|
|
echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh |
|
|
done |
|
|
echo -e "\n" >> /tmp/hddtmp.sh |
|
|
|
|
|
chmod a+x /tmp/hddtmp.sh |
|
|
HDD="$(/tmp/hddtmp.sh)" |
|
|
RES=$? |
|
|
[[ ${RES} -eq 1 ]] && return 1 |
|
|
if [[ ${RES} -eq 0 ]] |
|
|
then |
|
|
dialog_setup_hdd_info_auto |
|
|
dialog_setup_hdd_create_partitions |
|
|
setup_hdd_partitions_auto |
|
152 |
fi |
fi |
153 |
fi |
fi |
154 |
} |
} |
155 |
|
|
156 |
run_hardware_detection_disks() |
umount_rootfs() |
157 |
{ |
{ |
158 |
local bootdev |
is_mounted --location ${INSTALLROOT}/boot && umount ${INSTALLROOT}/boot |
159 |
|
is_mounted --location ${INSTALLROOT} && umount ${INSTALLROOT} |
160 |
|
|
161 |
# all disks but exclude ramdisks |
if [[ -n ${SWAPHDD} ]] |
|
export ALL_DISKS=$(get_hwinfo disk | sed '/\/dev\/ram[0-9].*/d') |
|
|
# remove the boot device from ALL_DISKS if it was an usbstick |
|
|
if [[ $(grep '[[:space:]]/mnt/cdrom[[:space:]]' /proc/mounts | cut -d' ' -f3) != iso9660 ]] |
|
162 |
then |
then |
163 |
bootdev="$(grep '[[:space:]]/mnt/cdrom[[:space:]]' /proc/mounts | cut -d' ' -f1 | sed 's:[0-9]::g')" |
swapoff ${SWAPHDD} || die |
|
export ALL_DISKS=$(echo "${ALL_DISKS}" | grep -v "${bootdev}") |
|
164 |
fi |
fi |
|
export ALL_CDROMS="$(get_hwinfo cdrom)" |
|
165 |
} |
} |
166 |
|
|
167 |
dialog_setup_hdd_create_partitions() |
install_do_reboot() |
|
{ |
|
|
dialog \ |
|
|
--backtitle "${TITLE}" \ |
|
|
--infobox "Erstelle Disk Partitionen ..." 3 70 |
|
|
} |
|
|
|
|
|
dialog_setup_hdd_format() |
|
|
{ |
|
|
dialog \ |
|
|
--backtitle "${TITLE}" \ |
|
|
--infobox "Erstelle Datei-Systeme ..." 3 70 |
|
|
} |
|
|
|
|
|
dialog_install_settings() |
|
|
{ |
|
|
dialog \ |
|
|
--backtitle "${TITLE}" \ |
|
|
--infobox "Speichere System-Einstellungen ..." 3 70 |
|
|
} |
|
|
|
|
|
dialog_install_system_image() |
|
|
{ |
|
|
dialog \ |
|
|
--backtitle "${TITLE}" \ |
|
|
--gauge "Kopiere System-Image ..." 6 80 |
|
|
} |
|
|
|
|
|
dialog_install_meter() |
|
|
{ |
|
|
while [[ ${CURRENTLINE} != ${TOTALLINES} ]] |
|
|
do |
|
|
CURRENTLINE=$(grep -c . /tmp/install.log) |
|
|
PERCENT=$(( ${CURRENTLINE} * 100 / ${TOTALLINES})) |
|
|
echo ${PERCENT} |
|
|
sleep 1 |
|
|
done |
|
|
rm -f /tmp/install.log |
|
|
return 0 |
|
|
} |
|
|
|
|
|
|
|
|
dialog_install_bootsector() |
|
|
{ |
|
|
dialog \ |
|
|
--backtitle "${TITLE}" \ |
|
|
--infobox "Schreibe den Bootsektor ..." 3 70 |
|
|
} |
|
|
|
|
|
dialog_install_successful() |
|
|
{ |
|
|
dialog \ |
|
|
--backtitle "${TITLE}" \ |
|
|
--colors \ |
|
|
--msgbox "Die Installation war \Z2erfolgreich\Zn." 5 81 |
|
|
} |
|
|
|
|
|
dialog_install_failure() |
|
|
{ |
|
|
dialog \ |
|
|
--backtitle "${TITLE}" \ |
|
|
--colors \ |
|
|
--msgbox "Die Installation ist \Z1Fehlgeschlagen\Zn.\n\n\ |
|
|
Fehler bei ${ERROR}, RetVal: ${RETVAL} \ |
|
|
" 10 81 |
|
|
} |
|
|
|
|
|
dialog_main() |
|
168 |
{ |
{ |
169 |
METHOD=0 |
reboot |
|
|
|
|
while [[ ${METHOD} -le 2 ]] |
|
|
do |
|
|
METHOD=$(dialog \ |
|
|
--backtitle "${TITLE}" \ |
|
|
--no-cancel \ |
|
|
--ok-label "Weiter" \ |
|
|
--stdout \ |
|
|
--menu "Konfiguration" 14 70 5 \ |
|
|
"1" "AutoSta_LX installieren" \ |
|
|
"2" "Uebersicht gefundener Laufwerke" \ |
|
|
"3" "Beenden und neustarten" \ |
|
|
"4" "Beenden und eine Shell starten") |
|
|
RES=$? |
|
|
[[ ${RES} -eq 1 ]] && exit 1 |
|
|
if [[ ${RES} -eq 0 ]] |
|
|
then |
|
|
case ${METHOD} in |
|
|
"1") dialog_setup_system_menu ;; |
|
|
"2") dialog_hardware_detection ;; |
|
|
"3") install_do_reboot ;; |
|
|
"4") /bin/bash --login -i ;; |
|
|
esac |
|
|
fi |
|
|
done |
|
170 |
} |
} |
171 |
|
|
|
################################################# |
|
|
# Install Komandos # |
|
|
################################################# |
|
172 |
run_hardware_detection() |
run_hardware_detection() |
173 |
{ |
{ |
174 |
local hwinfo |
local hwinfo |
180 |
local removable=0 |
local removable=0 |
181 |
if [[ ! -z $(echo "${hwinfo}" | grep -i zotac) ]] |
if [[ ! -z $(echo "${hwinfo}" | grep -i zotac) ]] |
182 |
then |
then |
183 |
for i in /sys/block/[hs]d*/removable |
#for i in /sys/block/[hs]d*/removable |
184 |
do |
#do |
185 |
if [[ $(< ${i}) = 1 ]] |
# if [[ $(< ${i}) = 1 ]] |
186 |
then |
# then |
187 |
removable=1 |
# removable=1 |
188 |
fi |
# fi |
189 |
done |
#done |
190 |
|
# smartcard = udevadm info -n /dev/sda -a | grep -i 'configuration.*card' |
191 |
|
|
192 |
# only add this for grub legacy, grub2 detect these settings on its own |
# only add this for grub legacy, grub2 detect these settings on its own |
193 |
export GRUBLEGACYOPTS="rootdelay=8" |
export GRUBLEGACYOPTS="rootdelay=8" |
227 |
fi |
fi |
228 |
} |
} |
229 |
|
|
230 |
hdd_size_below_256mb() |
run_hardware_detection_disks() |
231 |
{ |
{ |
232 |
local hdd="$1" |
local bootdev |
|
local size |
|
|
local retval |
|
|
[[ -z ${hdd} ]] && dialog_die "Error: get_hdd_size() no \$hdd given!" |
|
233 |
|
|
234 |
size=$(fdisk -l ${hdd} | grep "Disk.*${hdd}" | sed 's:.*,\ \(.*\)\ byte.*:\1:') |
# all disks but exclude ramdisks |
235 |
if [[ ${size} -le 257000000 ]] |
export ALL_DISKS=$(get_hwinfo disk | sed '/\/dev\/ram[0-9].*/d') |
236 |
|
# remove the boot device from ALL_DISKS if it was an usbstick |
237 |
|
if [[ $(grep '[[:space:]]${LIVEROOT}[[:space:]]' /proc/mounts | cut -d' ' -f3) != iso9660 ]] |
238 |
then |
then |
239 |
retval="0" |
bootdev=$(grep "[[:space:]]${LIVEROOT}[[:space:]]" /proc/mounts | cut -d' ' -f1 | sed 's:[0-9]::g') |
240 |
else |
export ALL_DISKS=$(echo "${ALL_DISKS}" | grep -v "${bootdev}") |
|
retval="1" |
|
241 |
fi |
fi |
242 |
|
export ALL_CDROMS="$(get_hwinfo cdrom)" |
|
return "${retval}" |
|
243 |
} |
} |
244 |
|
|
245 |
setup_hdd_partitions_auto() |
setup_hdd_partitions() |
246 |
{ |
{ |
247 |
ROOTHDD="${HDD}1" |
case "${INSTALL_METHOD}" in |
248 |
|
auto) |
249 |
|
BOOTHDD="" |
250 |
|
SWAPHDD="" |
251 |
|
ROOTHDD="${HDD}1" |
252 |
|
;; |
253 |
|
normal) |
254 |
|
BOOTHDD="${HDD}1" |
255 |
|
SWAPHDD="${HDD}2" |
256 |
|
ROOTHDD="${HDD}3" |
257 |
|
;; |
258 |
|
esac |
259 |
|
|
260 |
# run this only if FDISKPARTITIONBELOW256MB is not already 1 |
# sanity check - should not happen |
261 |
if [[ ${FDISKPARTIONBELOW256MB} != 1 ]] |
if is_mounted --device "${ROOTHDD}" |
262 |
|
then |
263 |
|
echo "partition: device ${ROOTHDD} is already mounted, umount it" >&2 |
264 |
|
umount "${ROOTHDD}" |
265 |
|
fi |
266 |
|
if [[ -n ${BOOTHDD} ]] |
267 |
then |
then |
268 |
if hdd_size_below_256mb ${HDD} |
if is_mounted --device "${BOOTHDD}" |
269 |
then |
then |
270 |
FDISKPARTIONBELOW256MB=1 |
echo "partition: device ${BOOTHDD} is already mounted, umount it" >&2 |
271 |
else |
umount "${BOOTHDD}" |
|
FDISKPARTIONBELOW256MB=0 |
|
272 |
fi |
fi |
273 |
fi |
fi |
274 |
|
|
275 |
## delete disk |
if [[ ${INSTALL_METHOD} = auto ]] |
|
dd if=/dev/zero of=${HDD} count=1 &> /dev/null || dialog_die |
|
|
|
|
|
if [[ ${FDISKPARTIONBELOW256MB} = 1 ]] |
|
276 |
then |
then |
277 |
## setup one bootable partition |
# run this only if FDISKPARTITIONBELOW256MB is not already 1 |
278 |
#1. n= new disk |
if [[ ${FDISKPARTIONBELOW256MB} != 1 ]] |
279 |
#2. p= primary disk |
then |
280 |
#3. 1= first partition |
if device_minimum_size "${HDD}" 256 |
281 |
#4. 2= default sector start // small disk needs more space for grub2 mbr sector |
then |
282 |
#5. ''= defaul sector end |
FDISKPARTIONBELOW256MB=1 |
283 |
#6. a= bootable flag |
else |
284 |
#7. 1= boot flag for partition 1 |
FDISKPARTIONBELOW256MB=0 |
285 |
#8. w= write/quit |
fi |
286 |
fdisk ${HDD} &> /dev/null << EOF |
fi |
287 |
|
|
288 |
|
## delete disk |
289 |
|
dd if=/dev/zero of=${HDD} count=1 &> /dev/null || dialog_die |
290 |
|
|
291 |
|
if [[ ${FDISKPARTIONBELOW256MB} = 1 ]] |
292 |
|
then |
293 |
|
## setup one bootable partition |
294 |
|
#1. n= new disk |
295 |
|
#2. p= primary disk |
296 |
|
#3. 1= first partition |
297 |
|
#4. 2= default sector start // small disk needs more space for grub2 mbr sector |
298 |
|
#5. ''= defaul sector end |
299 |
|
#6. a= bootable flag |
300 |
|
#7. 1= boot flag for partition 1 |
301 |
|
#8. w= write/quit |
302 |
|
fdisk ${HDD} &> /dev/null << EOF |
303 |
n |
n |
304 |
p |
p |
305 |
1 |
1 |
309 |
1 |
1 |
310 |
w |
w |
311 |
EOF |
EOF |
312 |
else |
else |
313 |
## setup one bootable partition |
## setup one bootable partition |
314 |
#1. n= new disk |
#1. n= new disk |
315 |
#2. p= primary disk |
#2. p= primary disk |
316 |
#3. 1= first partition |
#3. 1= first partition |
317 |
#4. ''= default sector start |
#4. ''= default sector start |
318 |
#5. ''= defaul sector end |
#5. ''= defaul sector end |
319 |
#6. a= bootable flag |
#6. a= bootable flag |
320 |
#7. 1= boot flag for partition 1 |
#7. 1= boot flag for partition 1 |
321 |
#8. w= write/quit |
#8. w= write/quit |
322 |
fdisk ${HDD} &> /dev/null << EOF |
fdisk ${HDD} &> /dev/null << EOF |
323 |
n |
n |
324 |
p |
p |
325 |
1 |
1 |
329 |
1 |
1 |
330 |
w |
w |
331 |
EOF |
EOF |
332 |
|
fi |
333 |
|
else |
334 |
|
cfdisk ${HDD} || dialog_die |
335 |
fi |
fi |
336 |
} |
} |
337 |
|
|
|
setup_hdd_partitions_manual() |
|
|
{ |
|
|
ROOTHDD="${HDD}1" |
|
|
|
|
|
## hdds partitionieren manual |
|
|
cfdisk ${HDD} || dialog_die |
|
|
} |
|
|
|
|
338 |
setup_hdd_format() |
setup_hdd_format() |
339 |
{ |
{ |
340 |
mke2fs -j -q ${ROOTHDD} || dialog_die |
if [[ -n ${SWAPHDD} ]] |
|
} |
|
|
|
|
|
install_mount_rootfs() |
|
|
{ |
|
|
mount ${ROOTHDD} ${INSTALLROOT} || dialog_die |
|
|
install -d ${INSTALLROOT}/boot || dialog_die |
|
|
cd ${INSTALLROOT} || dialog_die |
|
|
} |
|
|
|
|
|
install_system_image() |
|
|
{ |
|
|
tar xvjpf ${CDROOT}/system/${CDIMAGENAME} -C ${INSTALLROOT} |
|
|
} |
|
|
|
|
|
install_bootsector_chroot() |
|
|
{ |
|
|
local my_roothdd |
|
|
local grubconf=${INSTALLROOT}/boot/grub/grub.conf |
|
|
local grub2conf=/boot/grub/grub.cfg |
|
|
|
|
|
# check for grub2 |
|
|
if [[ -f ${INSTALLROOT}/sbin/grub-mkconfig ]] |
|
341 |
then |
then |
342 |
# needed by grub-mkconfig on the first run |
# sanity check - should not happen |
343 |
if [[ ! -f ${INSTALLROOT}/boot/grub/video.lst ]] |
if is_mounted --device "${SWAPHDD}" |
344 |
then |
then |
345 |
install -m0644 ${INSTALLROOT}/lib/grub/*/video.lst ${INSTALLROOT}/boot/grub/video.lst || dialog_die |
echo "format: device ${SWAPHDD} is already mounted, umount it" >&2 |
346 |
|
umount "${SWAPHDD}" |
347 |
fi |
fi |
348 |
|
mkswap ${SWAPHDD} || die |
349 |
|
fi |
350 |
|
|
351 |
# set kernelopts |
if [[ -n ${BOOTHDD} ]] |
352 |
if [[ -f ${INSTALLROOT}/etc/conf.d/grub ]] |
then |
353 |
|
# sanity check - should not happen |
354 |
|
if is_mounted --device "${BOOTHDD}" |
355 |
then |
then |
356 |
sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLROOT}/etc/conf.d/grub || dialog_die |
echo "format: device ${BOOTHDD} is already mounted, umount it" >&2 |
357 |
else |
umount "${BOOTHDD}" |
|
echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" > ${INSTALLROOT}/etc/conf.d/grub || dialog_die |
|
358 |
fi |
fi |
|
echo 'grub-mkdevicemap' > ${INSTALLROOT}/root/.installrc || dialog_die |
|
|
echo "LC_ALL=C grub-mkconfig -o ${grub2conf} &> /dev/null" >> ${INSTALLROOT}/root/.installrc || dialog_die |
|
|
echo "grub-install --no-floppy ${HDD} &> /dev/null" >> ${INSTALLROOT}/root/.installrc || dialog_die |
|
|
echo "exit 0" >> ${INSTALLROOT}/root/.installrc || dialog_die |
|
359 |
|
|
360 |
# grub-legacy |
mkfs."${FORMAT_FILESYSTEM}" -q "${BOOTHDD}" || dialog_die |
361 |
else |
fi |
|
### grubconf schreiben |
|
|
source ${INSTALLROOT}/boot/kernelversion |
|
362 |
|
|
363 |
#for alx only |
if [[ -n ${ROOTHDD} ]] |
364 |
if [ -e ${INSTALLROOT}/etc/alx_version ] |
then |
365 |
|
# sanity check - should not happen |
366 |
|
if is_mounted --device "${ROOTHDD}" |
367 |
then |
then |
368 |
OLD_ALXVER="${ALXVER}" |
echo "format: device ${ROOTHDD} is already mounted, umount it" >&2 |
369 |
source ${INSTALLROOT}/etc/alx_version |
umount "${ROOTHDD}" |
|
KRNVER="ALX-${ALXVER}" |
|
|
ALXVER="${OLD_ALXVER}" |
|
370 |
fi |
fi |
371 |
|
|
372 |
[[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX" |
mkfs."${FORMAT_FILESYSTEM}" -q "${ROOTHDD}" || dialog_die |
373 |
[[ -z ${KRNINITRD} ]] && KRNINITRD="initrd" |
fi |
374 |
[[ -z ${KRNIMG} ]] && KRNIMG="vmlinuz" |
} |
|
|
|
|
# uuid support |
|
|
if is_uuid_supported |
|
|
then |
|
|
my_roothdd="UUID=$(get_uuid ${ROOTHDD})" |
|
|
else |
|
|
my_roothdd="${ROOTHDD}" |
|
|
fi |
|
375 |
|
|
376 |
: > ${grubconf} || dialog_die |
install_system_image() |
377 |
echo "default 0" >> ${grubconf} || dialog_die |
{ |
378 |
echo "timeout 3" >> ${grubconf} || dialog_die |
pushd ${INSTALLROOT} > /dev/null |
379 |
# using current root password |
tar xvjpf ${IMAGEROOT}/${CDIMAGENAME} -C ${INSTALLROOT} |
380 |
echo "password --md5 $(cat ${INSTALLROOT}/etc/shadow | grep root | cut -d: -f2)" >> ${grubconf} || dialog_die |
popd > /dev/null |
381 |
|
} |
382 |
|
|
383 |
echo >> ${grubconf} || dialog_die |
install_system_settings() |
384 |
echo "# normal boot" >> ${grubconf} || dialog_die |
{ |
385 |
echo "title ${KRNVER}" >> ${grubconf} || dialog_die |
local CONFIG |
|
echo "root (hd0,0)" >> ${grubconf} || dialog_die |
|
|
echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS}" >> ${grubconf} || dialog_die |
|
|
if is_initrd_supported |
|
|
then |
|
|
echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || dialog_die |
|
|
fi |
|
386 |
|
|
387 |
echo >> ${grubconf} || dialog_die |
# write fstab |
388 |
echo "# admin boot" >> ${grubconf} || dialog_die |
CONFIG="${INSTALLROOT}/etc/fstab" |
389 |
echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || dialog_die |
clearconfig |
390 |
echo "lock" >> ${grubconf} || dialog_die |
if [[ -n ${BOOTHDD} ]] |
391 |
echo "root (hd0,0)" >> ${grubconf} || dialog_die |
then |
392 |
echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} hardware-auto-detection" >> ${grubconf} || dialog_die |
addconfig -e "UUID=$(get_uuid ${BOOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t1 1" |
393 |
if is_initrd_supported |
fi |
394 |
then |
if [[ -n ${ROOTHDD} ]] |
395 |
echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || dialog_die |
then |
396 |
fi |
addconfig -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" |
397 |
|
fi |
398 |
|
if [[ -n ${SWAPHDD} ]] |
399 |
|
then |
400 |
|
addconfig -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0" |
401 |
|
fi |
402 |
|
addconfig -e "proc\t/proc\tproc\tdefaults\t0 0" |
403 |
|
addconfig -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" |
404 |
|
|
405 |
echo >> ${grubconf} || dialog_die |
# install network config skeleton |
406 |
echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || dialog_die |
CONFIG="${INSTALLROOT}/etc/conf.d/net.eth0" |
407 |
echo "lock" >> ${grubconf} || dialog_die |
clearconfig |
408 |
echo "root (hd0,0)" >> ${grubconf} || dialog_die |
addconfig 'ONBOOT="yes"' |
409 |
echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} alx-reset-settings" >> ${grubconf} || dialog_die |
addconfig 'NETWORKING="dhcp"' |
410 |
if is_initrd_supported |
|
411 |
|
# intel framebuffer quirk |
412 |
|
CONFIG="${INSTALLROOT}/etc/splash/splash.conf" |
413 |
|
if [ -e ${CONFIG} ] && [ -e /proc/fb ] |
414 |
|
then |
415 |
|
if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]] |
416 |
then |
then |
417 |
echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || dialog_die |
fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:') |
418 |
|
[[ ${fbdev} != 0 ]] && sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${CONFIG} || dialog_die |
419 |
fi |
fi |
|
|
|
|
# bootsector schreiben chrooted schreiben (lfs/magellan) |
|
|
cat > ${INSTALLROOT}/root/.installrc << CHROOTEOF |
|
|
/usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null |
|
|
root (hd0,0) |
|
|
setup (hd0) |
|
|
quit |
|
|
EOF |
|
|
exit 0 |
|
|
CHROOTEOF |
|
420 |
fi |
fi |
421 |
|
} |
422 |
|
|
|
## enter chroot |
|
|
mount -t proc proc ${INSTALLROOT}/proc |
|
|
mount -t sysfs sysfs ${INSTALLROOT}/sys |
|
|
mount -o bind /dev ${INSTALLROOT}/dev |
|
|
chroot ${INSTALLROOT} /bin/bash --rcfile /root/.installrc -i |
|
|
umount ${INSTALLROOT}/proc |
|
|
umount ${INSTALLROOT}/sys |
|
|
umount ${INSTALLROOT}/dev |
|
|
rm ${INSTALLROOT}/root/.installrc |
|
|
} |
|
|
|
|
|
is_initrd_supported() |
|
|
{ |
|
|
# only generate initrds if the cmd exists |
|
|
[[ -x ${INSTALLROOT}/sbin/mkinitrd ]] && return 0 |
|
|
return 1 |
|
|
} |
|
|
|
|
|
install_initrd_chroot() |
|
|
{ |
|
|
# only generate initrds if the cmd exists |
|
|
is_initrd_supported || return 0 |
|
|
|
|
|
DISKMODS="sd_mod" |
|
|
OLDPATAMODS="amd74xx piix sis5513 via82cxxx" |
|
|
PATAMODS="ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via" |
|
|
SATAMODS="sata_via sata_sis sata_nv" |
|
|
DRMMODS="i915 mga nouveau r128 radeon savage sis tdfx ttm via" |
|
|
OTHERMODS="" |
|
|
case ${SPECIALDEVICE} in |
|
|
zotac_intel) FBMODS=""; DRMMODS="i915" ;; |
|
|
zotac_nvidia) FBMODS=""; DRMMODS="nouveau" ;; |
|
|
rangee) FBMODS="" ;; ## fallback to vesafb, viafb does not run on all CLE266 boards |
|
|
# not working with kms enabled drivers -> segfaults |
|
|
#maxdata) FBMODS="i810fb" ;; ## check for maxdata / i810/ i815 Chipsets and disable KMS and use i810fb frambuffer |
|
|
maxdata) FBMODS="" ;; |
|
|
*) FBMODS="uvesafb" ;; |
|
|
esac |
|
423 |
|
|
424 |
if [[ ${FORMFACTOR} = laptop ]] |
### installer dialogs ### |
|
then |
|
|
OTHERMODS="acpi-cpufreq cpufreq_ondemand cpufreq_conservative cpufreq_powersave" |
|
|
fi |
|
425 |
|
|
426 |
# install an appropriate uvesafb.conf |
dialog_die() |
427 |
install -d ${INSTALLROOT}/etc/modprobe.d || dialog_die |
{ |
428 |
echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" > ${INSTALLROOT}/etc/modprobe.d/uvesafb.conf || dialog_die |
ERROR="$1" |
429 |
|
RETVAL="$?" |
430 |
|
dialog_install_failure |
431 |
|
exit 1 |
432 |
|
} |
433 |
|
|
434 |
# install an appropriate viafb.conf |
dialog_warning() |
435 |
echo "options viafb viafb_mode=1024x768 viafb_refresh=60" > ${INSTALLROOT}/etc/modprobe.d/viafb.conf || dialog_die |
{ |
436 |
|
local retval |
437 |
|
|
438 |
# install an appropriate i810fb.conf |
yesnobox $"\Z1 !!! Warning !!! \Zn\n\n\This harddrive will be irreversibly erased.\n\n\Do you want to continue ?" |
439 |
echo "options i810fb xres=1024 yres=768 bpp=16 mtrr=1 hsync1=30 hsync2=62 vsync1=30 vsync2=60" > ${INSTALLROOT}/etc/modprobe.d/i810fb.conf || dialog_die |
retval=$? |
440 |
|
if [[ ${retval} -eq 1 ]] |
441 |
|
then |
442 |
|
clear |
443 |
|
echo $"The process was aborted." |
444 |
|
exit 1 |
445 |
|
fi |
446 |
|
} |
447 |
|
|
|
cat > ${INSTALLROOT}/root/.installrc << CHROOTEOF |
|
|
echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS} ${OTHERMODS}\"" > /etc/conf.d/mkinitrd |
|
|
mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null |
|
|
exit 0 |
|
|
CHROOTEOF |
|
448 |
|
|
449 |
## enters chroot |
### installer tasks ### |
|
mount -t proc proc ${INSTALLROOT}/proc |
|
|
mount -t sysfs sysfs ${INSTALLROOT}/sys |
|
|
mount -o bind /dev ${INSTALLROOT}/dev |
|
|
chroot ${INSTALLROOT} /bin/bash --rcfile /root/.installrc -i |
|
|
umount ${INSTALLROOT}/proc |
|
|
umount ${INSTALLROOT}/sys |
|
|
umount ${INSTALLROOT}/dev |
|
|
rm ${INSTALLROOT}/root/.installrc |
|
|
} |
|
450 |
|
|
451 |
is_uuid_supported() |
task_setup_system_menu() |
452 |
{ |
{ |
453 |
if [[ -x $(type -P busybox.mkinitrd) ]] |
local mode |
454 |
|
local retval |
455 |
|
|
456 |
|
mode="$(dialog_setup_system_menu)" |
457 |
|
retval=$? |
458 |
|
[[ ${retval} -eq 1 ]] && return 1 |
459 |
|
if [[ ${retval} -eq 0 ]] |
460 |
then |
then |
461 |
# only detect uuids if supported |
case "${mode}" in |
462 |
if [[ ! -z $(busybox.mkinitrd | grep blkid) ]] |
"1") run_install auto ;; |
463 |
then |
"2") run_install normal ;; |
464 |
return 0 |
"") task_setup_system_menu;; |
465 |
fi |
esac |
466 |
fi |
fi |
|
|
|
|
return 1 |
|
467 |
} |
} |
468 |
|
|
469 |
get_uuid() |
task_hardware_detection() |
470 |
{ |
{ |
471 |
local UUID |
local message |
472 |
local SEC_TYPE |
|
473 |
local TYPE |
run_hardware_detection_disks |
474 |
|
|
475 |
local dev="$1" |
message+=$"Harddrives:\n" |
|
[[ -z ${dev} ]] && dialog_die "no dev given" |
|
476 |
|
|
477 |
# check if given device is already an UUID |
if [[ ! -z ${ALL_DISKS} ]] |
|
if [[ ${dev/UUID=/}x != ${dev}x ]] |
|
478 |
then |
then |
479 |
eval "${dev}" |
for i in ${ALL_DISKS} |
480 |
else |
do |
481 |
eval $(busybox.mkinitrd blkid ${dev} | grep "${dev}:" | sed 's/.*:\ //') |
message+="\Z3${i}\Zn " |
482 |
|
done |
483 |
|
message+="\n" |
484 |
fi |
fi |
|
echo "${UUID}" |
|
|
} |
|
485 |
|
|
486 |
install_system_settings() |
if [[ ! -z ${ALL_CDROMS} ]] |
|
{ |
|
|
# schreibe fstab |
|
|
if is_uuid_supported |
|
487 |
then |
then |
488 |
echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die |
message+="\n" |
489 |
else |
message+=$"Optical disk drives:\n" |
490 |
echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die |
for i in ${ALL_CDROMS} |
491 |
|
do |
492 |
|
message+="\Z3${i}\Zn" |
493 |
|
done |
494 |
|
message+="\n" |
495 |
fi |
fi |
|
# not needed busybox loads all with swapon -a, even if not mentioned in fstab |
|
|
#echo -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die |
|
|
echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die |
|
|
echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die |
|
496 |
|
|
497 |
# install network config skeleton |
# other devices |
498 |
install -m0644 ${INSTALLROOT}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLROOT}/etc/conf.d/ || dialog_die |
run_hardware_detection |
499 |
|
case "${SPECIALDEVICE}" in |
500 |
|
zotac*) message+=$"\n\Z2Zotac device detected.\Zn" ;; |
501 |
|
rangee) message+=$"\n\Z2Rangee device detected.\Zn" ;; |
502 |
|
maxdata) message+=$"\n\Z2Maxdata device detected.\Zn" ;; |
503 |
|
*) message+=$"\n\ZnCommon device detected.\Zn" ;; |
504 |
|
esac |
505 |
|
if [[ ${FORMFACTOR} = laptop ]] |
506 |
|
then |
507 |
|
message+=$"\n\ZnFormfactor Laptop, activating 'ondemand' powersaving mode.\Zn" |
508 |
|
fi |
509 |
|
|
510 |
# intel framebufer quirk |
messagebox -y 12 -h $"Detected hardware:" "${message}" |
511 |
if [[ -e /proc/fb ]] |
} |
512 |
|
|
513 |
|
task_setup_hdd_partitions() |
514 |
|
{ |
515 |
|
local i |
516 |
|
local retval |
517 |
|
|
518 |
|
if [[ -z ${ALL_DISKS} ]] |
519 |
then |
then |
520 |
if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]] |
dialog_no_harddrive_found |
521 |
|
exit 1 |
522 |
|
else |
523 |
|
HDD=$(dialog_select_target_harddrive) |
524 |
|
retval=$? |
525 |
|
[[ ${retval} -eq 1 ]] && return 1 |
526 |
|
if [[ ${retval} -eq 0 ]] |
527 |
then |
then |
528 |
fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:') |
dialog_setup_hdd_info |
529 |
if [[ ${fbdev} != 0 ]] |
setup_hdd_partitions |
|
then |
|
|
sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALLROOT}/etc/splash/splash.conf || dialog_die |
|
|
fi |
|
530 |
fi |
fi |
531 |
fi |
fi |
532 |
} |
} |
533 |
|
|
534 |
install_umount_rootfs() |
task_main() |
535 |
{ |
{ |
536 |
cd / |
local method=0 |
537 |
umount ${INSTALLROOT}/boot || dialog_die |
local retval |
|
umount ${INSTALLROOT} || dialog_die |
|
|
} |
|
538 |
|
|
539 |
install_do_reboot() |
while [[ ${method} -le 2 ]] |
540 |
{ |
do |
541 |
reboot |
method=$(dialog_main) |
542 |
|
retval=$? |
543 |
|
[[ ${retval} -eq 1 ]] && exit 1 |
544 |
|
if [[ ${retval} -eq 0 ]] |
545 |
|
then |
546 |
|
case ${method} in |
547 |
|
"1") task_setup_system_menu ;; |
548 |
|
"2") task_hardware_detection ;; |
549 |
|
"3") install_do_reboot ;; |
550 |
|
"4") /bin/bash --login -i ;; |
551 |
|
esac |
552 |
|
fi |
553 |
|
done |
554 |
} |
} |
555 |
|
|
556 |
################################################# |
run_install() |
|
# Install Ablauf Scripte # |
|
|
################################################# |
|
|
|
|
|
run_install_normal() |
|
557 |
{ |
{ |
558 |
dialog_hardware_detection |
local method="$1" |
559 |
|
|
560 |
dialog_setup_hdd_partitions_manual |
task_hardware_detection |
|
dialog_setup_hdd_format |
|
|
setup_hdd_format > /dev/null |
|
|
install_mount_rootfs |
|
|
(install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image |
|
561 |
|
|
562 |
dialog_install_settings |
case "${method}" in |
563 |
sleep 1 |
auto) |
564 |
install_system_settings |
export INSTALL_METHOD="${method}" |
565 |
install_initrd_chroot |
;; |
566 |
|
normal) |
567 |
dialog_install_bootsector |
export INSTALL_METHOD="${method}" |
568 |
install_bootsector_chroot |
;; |
569 |
|
*) |
570 |
install_umount_rootfs |
die "Unknown install method '${method}', aborting." |
571 |
dialog_install_successful |
;; |
572 |
} |
esac |
|
|
|
|
run_install_auto() |
|
|
{ |
|
|
dialog_hardware_detection |
|
573 |
|
|
574 |
dialog_setup_hdd_partitions_auto |
task_setup_hdd_partitions |
575 |
dialog_setup_hdd_format |
dialog_setup_hdd_format |
576 |
setup_hdd_format > /dev/null |
setup_hdd_format > /dev/null |
577 |
install_mount_rootfs |
mount_rootfs |
578 |
(install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image |
(install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | install_meter | dialog_install_system_image |
579 |
|
|
580 |
dialog_install_settings |
dialog_install_settings |
581 |
sleep 1 |
sleep 1 |
582 |
install_system_settings |
install_system_settings |
583 |
install_initrd_chroot |
if is_initrd_supported |
584 |
|
then |
585 |
|
dialog_install_initrd |
586 |
|
initrd_config |
587 |
|
initrd_install |
588 |
|
fi |
589 |
|
|
590 |
dialog_install_bootsector |
dialog_install_bootsector |
591 |
install_bootsector_chroot |
bootloader_config |
592 |
|
bootloader_install |
593 |
|
|
594 |
install_umount_rootfs |
umount_rootfs |
595 |
dialog_install_successful |
dialog_install_successful |
596 |
} |
} |
597 |
|
|
598 |
# set some proper traps |
# set some proper traps |
599 |
trap "trap_exit" SIGINT SIGQUIT |
trap "trap_exit" SIGINT SIGQUIT |
600 |
|
|
601 |
dialog_main |
task_main |
602 |
|
|
603 |
exit 0 |
exit 0 |