1 |
#!/bin/sh |
#!/bin/sh |
2 |
# |
# |
3 |
# $Header: /home/cvsd/alx-cvs/alx-src/alxinstall-ng/bin/alxinstall-ng.sh,v 1.8 2008-06-27 22:43:02 niro Exp $ |
# $Header: /home/cvsd/alx-cvs/alx-src/alxinstall-ng/bin/alxinstall-ng.sh,v 1.15 2008-06-28 00:37:45 niro Exp $ |
4 |
# |
# |
5 |
# AutoSta_LX Installation Script |
# AutoSta_LX Installation Script |
6 |
# |
# |
17 |
#Includes |
#Includes |
18 |
source /usr/lib/alxinstall-ng/functions/findhdd.sh > /dev/null |
source /usr/lib/alxinstall-ng/functions/findhdd.sh > /dev/null |
19 |
### bugfix ############################### |
### bugfix ############################### |
20 |
cdromdev="`echo $cdromdev|sed -e 's/ //'`" |
cdromdev="$(echo ${cdromdev} | sed 's/ //')" |
21 |
######################################## |
######################################## |
22 |
|
|
23 |
### System/Config Version |
### System/Config Version |
24 |
VERSION="0.3" |
VERSION="0.3.1" |
25 |
TITLE="alxinstall-ng - ${VERSION}" |
TITLE="alxinstall-ng - ${VERSION}" |
26 |
|
|
|
#CONFIGS_TEMPLATE="/opt/alx-config/configs" |
|
|
|
|
27 |
CDPATH="/mnt/cdrom" |
CDPATH="/mnt/cdrom" |
28 |
INSTALLPATH="/mnt/magellan" |
INSTALLPATH="/mnt/magellan" |
29 |
|
|
266 |
{ |
{ |
267 |
while [[ ${CURRENTLINE} != ${TOTALLINES} ]] |
while [[ ${CURRENTLINE} != ${TOTALLINES} ]] |
268 |
do |
do |
269 |
CURRENTLINE=$(grep --count . /tmp/install.log) |
CURRENTLINE=$(grep -c . /tmp/install.log) |
270 |
PERCENT=$(expr ${CURRENTLINE} \* 100 / ${TOTALLINES}) |
PERCENT=$(( ${CURRENTLINE} * 100 / ${TOTALLINES})) |
271 |
echo ${PERCENT} |
echo ${PERCENT} |
272 |
sleep 1 |
sleep 1 |
273 |
done |
done |
318 |
"3" "Beenden und neustarten" \ |
"3" "Beenden und neustarten" \ |
319 |
"4" "Beenden und eine Shell starten") |
"4" "Beenden und eine Shell starten") |
320 |
RES=$? |
RES=$? |
321 |
if [[ ${RES} -eq 1 ]] && exit 1 |
[[ ${RES} -eq 1 ]] && exit 1 |
322 |
if [[ ${RES} -eq 0 ]] |
if [[ ${RES} -eq 0 ]] |
323 |
then |
then |
324 |
case ${METHOD} in |
case ${METHOD} in |
423 |
|
|
424 |
## enters chroot |
## enters chroot |
425 |
mount -t proc proc ${INSTALLPATH}/proc |
mount -t proc proc ${INSTALLPATH}/proc |
426 |
mount -t sysfs sysfs ${INSTALLPATH}/sysfs |
mount -t sysfs sysfs ${INSTALLPATH}/sys |
427 |
|
mount -o bind /dev ${INSTALLPATH}/dev |
428 |
|
chroot ${INSTALLPATH} /bin/bash --rcfile /root/.bashrc -i |
429 |
|
umount ${INSTALLPATH}/proc |
430 |
|
umount ${INSTALLPATH}/sys |
431 |
|
umount ${INSTALLPATH}/dev |
432 |
|
rm ${INSTALLPATH}/root/.bashrc |
433 |
|
} |
434 |
|
|
435 |
|
install_mkinitrd_chroot() |
436 |
|
{ |
437 |
|
cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF |
438 |
|
echo "MODULES=\"ext3 amd74xx piix sis5513 via82cxxx\"" > /etc/conf.d/mkinitrd |
439 |
|
mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null |
440 |
|
exit 0 |
441 |
|
CHROOTEOF |
442 |
|
|
443 |
|
## enters chroot |
444 |
|
mount -t proc proc ${INSTALLPATH}/proc |
445 |
|
mount -t sysfs sysfs ${INSTALLPATH}/sys |
446 |
mount -o bind /dev ${INSTALLPATH}/dev |
mount -o bind /dev ${INSTALLPATH}/dev |
447 |
chroot ${INSTALLPATH} /bin/bash --rcfile /root/.bashrc -i |
chroot ${INSTALLPATH} /bin/bash --rcfile /root/.bashrc -i |
448 |
umount ${INSTALLPATH}/proc |
umount ${INSTALLPATH}/proc |
459 |
echo -e "${SWAPHDD}\tswap\tswap\tpri=1\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
echo -e "${SWAPHDD}\tswap\tswap\tpri=1\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
460 |
echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
461 |
echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
462 |
|
|
463 |
|
# install network config skeleton |
464 |
|
install -m0644 ${INSTALLPATH}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLPATH}/etc/conf.d/ || die |
465 |
} |
} |
466 |
|
|
467 |
install_system_settings_flash() |
install_system_settings_flash() |
511 |
dialog_install_settings |
dialog_install_settings |
512 |
sleep 1 |
sleep 1 |
513 |
install_system_settings |
install_system_settings |
514 |
|
install_mkinitrd_chroot |
515 |
install_umount_rootfs |
install_umount_rootfs |
516 |
dialog_install_successful |
dialog_install_successful |
517 |
} |
} |
532 |
dialog_install_settings |
dialog_install_settings |
533 |
sleep 1 |
sleep 1 |
534 |
install_system_settings_flash |
install_system_settings_flash |
535 |
|
install_mkinitrd_chroot |
536 |
install_umount_rootfs_flash |
install_umount_rootfs_flash |
537 |
dialog_install_successful |
dialog_install_successful |
538 |
} |
} |