44 |
GRUB2GFXPAYLOAD="" |
GRUB2GFXPAYLOAD="" |
45 |
FORMFACTOR="" |
FORMFACTOR="" |
46 |
FORMAT_FILESYSTEM="" |
FORMAT_FILESYSTEM="" |
47 |
|
FORMAT_FILESYSTEM_BOOTHDD="" |
48 |
|
FORMAT_FILESYSTEM_ROOTHDD="" |
49 |
FDISKPARTIONBELOW256MB=0 |
FDISKPARTIONBELOW256MB=0 |
50 |
SPECIALDEVICE="" |
SPECIALDEVICE="" |
51 |
FLASHDISK=0 |
FLASHDISK=0 |
166 |
--ok-label "Weiter" \ |
--ok-label "Weiter" \ |
167 |
--stdout \ |
--stdout \ |
168 |
--colors \ |
--colors \ |
169 |
--menu "\nWaehlen Sie die Installations-Methode" 14 70 5 \ |
--menu "\nWaehlen Sie die Installations-Methode" 14 70 6 \ |
170 |
"1" "Automatisches Setup (Empfohlen)" \ |
"1" "Automatisches Setup (Empfohlen)" \ |
171 |
"" "" \ |
"" "" \ |
172 |
"" "\Z1Experten Modi:\Zn" \ |
"" "\Z1Experten Modi:\Zn" \ |
181 |
"1") run_install auto ;; |
"1") run_install auto ;; |
182 |
"2") run_install normal ;; |
"2") run_install normal ;; |
183 |
"3") run_install single ;; |
"3") run_install single ;; |
184 |
"3") run_install flash ;; |
"4") run_install flash ;; |
185 |
"") dialog_setup_system_menu;; |
"") dialog_setup_system_menu;; |
186 |
esac |
esac |
187 |
fi |
fi |
192 |
local i |
local i |
193 |
local hwtmp |
local hwtmp |
194 |
|
|
195 |
if [ -x $(which mktemp &> /dev/null) ] |
if [ -x $(type -P mktemp) ] |
196 |
then |
then |
197 |
hwtmp="$(mktemp)" |
hwtmp="$(mktemp)" |
198 |
else |
else |
371 |
--no-cancel \ |
--no-cancel \ |
372 |
--ok-label "Weiter" \ |
--ok-label "Weiter" \ |
373 |
--stdout \ |
--stdout \ |
374 |
--menu "Konfiguration" 14 70 5 \ |
--menu "Konfiguration" 14 70 6 \ |
375 |
"1" "AutoSta_LX installieren" \ |
"1" "AutoSta_LX installieren" \ |
376 |
"2" "Uebersicht gefundener Laufwerke" \ |
"2" "Uebersicht gefundener Laufwerke" \ |
377 |
"3" "Beenden und neustarten" \ |
"3" "Beenden und neustarten" \ |
596 |
fi |
fi |
597 |
if [[ -n ${BOOTHDD} ]] |
if [[ -n ${BOOTHDD} ]] |
598 |
then |
then |
599 |
# f2fs is not grub/grub2 compatible |
mkfs.${FORMAT_FILESYSTEM_BOOTHDD} -q ${BOOTHDD} || die |
|
if [[ ${FORMAT_FILESYSTEM} = f2fs ]] |
|
|
then |
|
|
mkfs.ext2 -q ${BOOTHDD} || die |
|
|
else |
|
|
mkfs.${FORMAT_FILESYSTEM} -q ${BOOTHDD} || die |
|
|
fi |
|
600 |
fi |
fi |
601 |
if [[ -n ${ROOTHDD} ]] |
if [[ -n ${ROOTHDD} ]] |
602 |
then |
then |
603 |
mkfs.${FORMAT_FILESYSTEM} -q ${ROOTHDD} || die |
mkfs.${FORMAT_FILESYSTEM_ROOTHDD} -q ${ROOTHDD} || die |
604 |
fi |
fi |
605 |
} |
} |
606 |
|
|
614 |
fi |
fi |
615 |
if [[ -n ${ROOTHDD} ]] |
if [[ -n ${ROOTHDD} ]] |
616 |
then |
then |
617 |
# be safe here, append file system type to mount |
mount -t ${FORMAT_FILESYSTEM_ROOTHDD} ${ROOTHDD} ${INSTALL_ROOT} || die |
|
# just in case the f2fs module was not autoloaded |
|
|
[[ ${FORMAT_FILESYSTEM} = f2fs ]] && opts="-t fs2fs" |
|
|
mount ${opts} ${ROOTHDD} ${INSTALL_ROOT} || die |
|
618 |
fi |
fi |
619 |
if [[ -n ${BOOTHDD} ]] |
if [[ -n ${BOOTHDD} ]] |
620 |
then |
then |
621 |
install -d ${INSTALL_ROOT}/boot || die |
install -d ${INSTALL_ROOT}/boot || die |
622 |
mount ${BOOTHDD} ${INSTALL_ROOT}/boot || die |
mount -t ${FORMAT_FILESYSTEM_BOOTHDD} ${BOOTHDD} ${INSTALL_ROOT}/boot || die |
623 |
fi |
fi |
624 |
|
|
625 |
cd ${INSTALL_ROOT} || die |
cd ${INSTALL_ROOT} || die |
652 |
sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALL_ROOT}/etc/conf.d/grub || die |
sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALL_ROOT}/etc/conf.d/grub || die |
653 |
sed -i "s:^\(export GRUB_GFXPAYLOAD_LINUX=\).*:\1\"${GRUB2GFXPAYLOAD}\":" ${INSTALL_ROOT}/etc/conf.d/grub || die |
sed -i "s:^\(export GRUB_GFXPAYLOAD_LINUX=\).*:\1\"${GRUB2GFXPAYLOAD}\":" ${INSTALL_ROOT}/etc/conf.d/grub || die |
654 |
else |
else |
655 |
echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" > ${INSTALL_ROOT}/etc/conf.d/grub || die |
CONFIG=${INSTALL_ROOT}/etc/conf.d/grub |
656 |
echo "export GRUB_GFXPAYLOAD_LINUX=\"${GRUB2GFXPAYLOAD}\"" >> ${INSTALL_ROOT}/etc/conf.d/grub || die |
clearconfig |
657 |
|
addconfig "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" |
658 |
|
addconfig "export GRUB_GFXPAYLOAD_LINUX=\"${GRUB2GFXPAYLOAD}\"" |
659 |
fi |
fi |
660 |
CONFIG=${INSTALL_ROOT}/.installrc |
CONFIG=${INSTALL_ROOT}/.installrc |
661 |
clearconfig |
clearconfig |
754 |
# only generate initrds if the cmd exists |
# only generate initrds if the cmd exists |
755 |
is_initrd_supported || return 0 |
is_initrd_supported || return 0 |
756 |
|
|
757 |
FSMODS="${FORMAT_FILESYSTEM}" |
FSMODS="${FORMAT_FILESYSTEM_BOOTHDD} ${FORMAT_FILESYSTEM_ROOTHDD}" |
758 |
DISKMODS="sd_mod" |
DISKMODS="sd_mod" |
759 |
OLDPATAMODS="amd74xx piix sis5513 via82cxxx" |
OLDPATAMODS="amd74xx piix sis5513 via82cxxx" |
760 |
PATAMODS="ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via" |
PATAMODS="ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via" |
771 |
*) FBMODS="uvesafb" ;; |
*) FBMODS="uvesafb" ;; |
772 |
esac |
esac |
773 |
|
|
|
# add a filesystems recoqnized by the bootloader if the current ${FORMAT_FILESYSTEM} is not supported |
|
|
case "${FORMAT_FILESYSTEM}" in |
|
|
f2fs) FSMODS+=" ext2" ;; |
|
|
esac |
|
|
|
|
774 |
if [[ ${FORMFACTOR} = laptop ]] |
if [[ ${FORMFACTOR} = laptop ]] |
775 |
then |
then |
776 |
OTHERMODS="acpi-cpufreq cpufreq_ondemand cpufreq_conservative cpufreq_powersave" |
OTHERMODS="acpi-cpufreq cpufreq_ondemand cpufreq_conservative cpufreq_powersave" |
806 |
# use the blkid from util-linux instead of busybox |
# use the blkid from util-linux instead of busybox |
807 |
if [[ ${FORMAT_FILESYSTEM} = f2fs ]] |
if [[ ${FORMAT_FILESYSTEM} = f2fs ]] |
808 |
then |
then |
809 |
if [[ -x $(which blkid &> /dev/null) ]] |
if [[ -x $(type -P blkid) ]] |
810 |
then |
then |
811 |
return 0 |
return 0 |
812 |
fi |
fi |
813 |
else |
else |
814 |
if [[ -x $(which busybox.mkinitrd &> /dev/null) ]] |
if [[ -x $(type -P busybox.mkinitrd) ]] |
815 |
then |
then |
816 |
# only detect uuids if supported |
# only detect uuids if supported |
817 |
if [[ ! -z $(busybox.mkinitrd | grep blkid) ]] |
if [[ ! -z $(busybox.mkinitrd | grep blkid) ]] |
854 |
|
|
855 |
install_system_settings() |
install_system_settings() |
856 |
{ |
{ |
857 |
# schreibe fstab |
local CONFIG |
858 |
if is_uuid_supported |
local fstype |
859 |
|
|
860 |
|
# write fstab |
861 |
|
CONFIG=${INSTALL_ROOT}/etc/fstab |
862 |
|
clearconfig |
863 |
|
|
864 |
|
if [[ -n ${BOOTHDD} ]] |
865 |
then |
then |
866 |
if [[ -n ${BOOTHDD} ]] |
if is_uuid_supported |
|
then |
|
|
echo -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALL_ROOT}/etc/fstab || die |
|
|
fi |
|
|
if [[ -n ${ROOTHDD} ]] |
|
|
then |
|
|
echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALL_ROOT}/etc/fstab || die |
|
|
fi |
|
|
else |
|
|
if [[ -n ${BOOTHDD} ]] |
|
867 |
then |
then |
868 |
echo -e "${BOOTHDD}\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALL_ROOT}/etc/fstab || die |
addconfig -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\t${FORMAT_FILESYSTEM_BOOTHDD}\tnoatime,noauto\t1 1" |
869 |
|
else |
870 |
|
addconfig -e "${BOOTHDD}\t/boot\t${FORMAT_FILESYSTEM_BOOTHDD}\tnoatime,noauto\t1 1" |
871 |
fi |
fi |
872 |
if [[ -n ${ROOTHDD} ]] |
fi |
873 |
|
|
874 |
|
if [[ -n ${ROOTHDD} ]] |
875 |
|
then |
876 |
|
if is_uuid_supported |
877 |
then |
then |
878 |
echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALL_ROOT}/etc/fstab || die |
addconfig -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM_ROOTHDD}\tnoatime\t0 0" |
879 |
|
else |
880 |
|
addconfig -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM_ROOTHDD}\tnoatime\t0 0" |
881 |
fi |
fi |
882 |
fi |
fi |
883 |
|
|
884 |
# not needed busybox loads all with swapon -a, even if not mentioned in fstab |
# not needed busybox loads all with swapon -a, even if not mentioned in fstab |
885 |
#echo -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0" >> ${INSTALL_ROOT}/etc/fstab || die |
#addconfig -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0" |
886 |
echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALL_ROOT}/etc/fstab || die |
addconfig -e "proc\t/proc\tproc\tdefaults\t0 0" |
887 |
echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALL_ROOT}/etc/fstab || die |
addconfig -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" |
888 |
|
|
889 |
# install network config skeleton |
# install network config skeleton |
890 |
install -m0644 ${INSTALL_ROOT}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALL_ROOT}/etc/conf.d/ || die |
install -m0644 ${INSTALL_ROOT}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALL_ROOT}/etc/conf.d/ || die |
943 |
|
|
944 |
case "${method}" in |
case "${method}" in |
945 |
auto) |
auto) |
946 |
|
export FORMAT_FILESYSTEM_BOOTHDD="" |
947 |
|
export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}" |
948 |
export INSTALL_METHOD="${method}" |
export INSTALL_METHOD="${method}" |
949 |
;; |
;; |
950 |
normal) |
normal) |
951 |
|
export FORMAT_FILESYSTEM_BOOTHDD="${FORMAT_FILESYSTEM}" |
952 |
|
export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}" |
953 |
export INSTALL_METHOD="${method}" |
export INSTALL_METHOD="${method}" |
954 |
;; |
;; |
955 |
single) |
single) |
956 |
|
export FORMAT_FILESYSTEM_BOOTHDD="" |
957 |
|
export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}" |
958 |
export INSTALL_METHOD="${method}" |
export INSTALL_METHOD="${method}" |
959 |
;; |
;; |
960 |
flash) |
flash) |
961 |
export FORMAT_FILESYSTEM="f2fs" |
export FORMAT_FILESYSTEM="f2fs" |
962 |
|
export FORMAT_FILESYSTEM_BOOTHDD="ext2" |
963 |
|
export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}" |
964 |
export INSTALL_METHOD="${method}" |
export INSTALL_METHOD="${method}" |
965 |
;; |
;; |
966 |
*) |
*) |
967 |
echo "Unknown install method '${method}', aborting." |
die "Unknown install method '${method}', aborting." |
|
exit 1 |
|
968 |
;; |
;; |
969 |
esac |
esac |
970 |
|
|