19 |
|
|
20 |
# locations |
# locations |
21 |
CDPATH="/mnt/cdrom" |
CDPATH="/mnt/cdrom" |
22 |
INSTALLPATH="/mnt/magellan" |
INSTALL_ROOT="/mnt/magellan" |
23 |
|
|
24 |
# default system settings |
# default system settings |
25 |
# standard kernel opts |
# standard kernel opts |
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 |
52 |
### linecount of system.tar.gz -1 ! |
### linecount of system.tar.gz -1 ! |
53 |
CURRENTLINE=0 |
CURRENTLINE=0 |
54 |
#TOTALLINES=11072 # -> now in images.conf |
#TOTALLINES=11072 # -> now in images.conf |
93 |
;; |
;; |
94 |
normal) dialog_setup_hdd_info_normal ;; |
normal) dialog_setup_hdd_info_normal ;; |
95 |
single) dialog_setup_hdd_info_single ;; |
single) dialog_setup_hdd_info_single ;; |
96 |
|
flash) dialog_setup_hdd_info_flash ;; |
97 |
esac |
esac |
98 |
} |
} |
99 |
|
|
127 |
Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81 |
Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81 |
128 |
} |
} |
129 |
|
|
130 |
|
dialog_setup_hdd_info_flash() |
131 |
|
{ |
132 |
|
local SHDD="$(echo ${HDD} | sed 's/\/dev\///')" |
133 |
|
|
134 |
|
dialog \ |
135 |
|
--colors \ |
136 |
|
--title "[ Festplatten Partitionierung ]" \ |
137 |
|
--backtitle "${TITLE}" \ |
138 |
|
--ok-label "Weiter" \ |
139 |
|
--msgbox "\nBitte legen Sie 2 Partitionen an.\n\n\ |
140 |
|
[ \Z3${SHDD}1\Zn ] Typ: \Z3Linux\Zn mit ca. 50MB\n\ |
141 |
|
[ \Z3${SHDD}2\Zn ] Typ: \Z3Linux \Zn mit dem Rest (min. 256MB)\n\n\ |
142 |
|
Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81 |
143 |
|
} |
144 |
|
|
145 |
dialog_setup_hdd_info_auto() |
dialog_setup_hdd_info_auto() |
146 |
{ |
{ |
147 |
local SHDD="$(echo $HDD | sed 's/\/dev\///')" |
local SHDD="$(echo $HDD | sed 's/\/dev\///')" |
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" \ |
173 |
"2" "Normale IDE-Disk (Manuell)" \ |
"2" "Normale IDE-Disk (Manuell)" \ |
174 |
"3" "Normale IDE Disk (Single)") |
"3" "Normale IDE Disk (Single)" \ |
175 |
|
"4" "Flash SDHC/NAND oder USBStick (Manuell)") |
176 |
RES=$? |
RES=$? |
177 |
[[ ${RES} -eq 1 ]] && return 1 |
[[ ${RES} -eq 1 ]] && return 1 |
178 |
if [[ ${RES} -eq 0 ]] |
if [[ ${RES} -eq 0 ]] |
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 |
|
"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 |
240 |
then |
then |
241 |
echo " \n \\ZnFormfactor Laptop, Powersave Modus 'ondemand' wird aktiviert.\\Zn \\" >> ${hwtmp} |
echo " \n \\ZnFormfactor Laptop, Powersave Modus 'ondemand' wird aktiviert.\\Zn \\" >> ${hwtmp} |
242 |
fi |
fi |
243 |
|
if [[ ${FLASHDISK} = 1 ]] |
244 |
|
then |
245 |
|
echo " \n \\ZnFlash Speicher erkannt, F2FS wird als Dateisystem benutzt.\\Zn \\" >> ${hwtmp} |
246 |
|
fi |
247 |
|
|
248 |
echo " \" 14 70" >> ${hwtmp} |
echo " \" 14 70" >> ${hwtmp} |
249 |
chmod a+x ${hwtmp} |
chmod a+x ${hwtmp} |
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" \ |
408 |
if [[ $(< ${i}) = 1 ]] |
if [[ $(< ${i}) = 1 ]] |
409 |
then |
then |
410 |
removable=1 |
removable=1 |
411 |
|
# we assume that all removable disks are flash disks |
412 |
|
export FLASHDISK=1 |
413 |
fi |
fi |
414 |
done |
done |
415 |
|
|
516 |
SWAPHDD="" |
SWAPHDD="" |
517 |
ROOTHDD="${HDD}1" |
ROOTHDD="${HDD}1" |
518 |
;; |
;; |
519 |
|
|
520 |
|
flash) |
521 |
|
BOOTHDD="${HDD}1" |
522 |
|
SWAPHDD="" |
523 |
|
ROOTHDD="${HDD}2" |
524 |
|
;; |
525 |
esac |
esac |
526 |
|
|
527 |
if [[ ${INSTALL_METHOD} = auto ]] |
if [[ ${INSTALL_METHOD} = auto ]] |
540 |
## delete disk |
## delete disk |
541 |
dd if=/dev/zero of=${HDD} count=1 &> /dev/null || die |
dd if=/dev/zero of=${HDD} count=1 &> /dev/null || die |
542 |
|
|
543 |
if [[ ${FDISKPARTIONBELOW256MB} = 1 ]] |
if [[ ${FLASHDISK} = 1 ]] |
544 |
then |
then |
545 |
## setup one bootable partition |
if [[ ${FDISKPARTIONBELOW256MB} = 1 ]] |
546 |
#1. n= new disk |
then |
547 |
#2. p= primary disk |
## setup one bootable partition |
548 |
#3. 1= first partition |
# 1. n= new disk |
549 |
#4. 2= default sector start // small disk needs more space for grub2 mbr sector |
# 2. p= primary disk |
550 |
#5. ''= defaul sector end |
# 3. 1= first partition |
551 |
#6. a= bootable flag |
# 4. 2= default sector start // small disk needs more space for grub2 mbr sector |
552 |
#7. 1= boot flag for partition 1 |
# 5. ''= defaul sector end |
553 |
#8. w= write/quit |
# 6. a= bootable flag |
554 |
fdisk ${HDD} &> /dev/null << EOF |
# 7. 1= boot flag for partition 1 |
555 |
|
# 8. n= new disk |
556 |
|
#10. p= primary disk |
557 |
|
#11. 2= second partition |
558 |
|
#12. ''= default sector start |
559 |
|
#13. ''= defaul sector end |
560 |
|
#14. w= write/quit |
561 |
|
fdisk ${HDD} &> /dev/null << EOF |
562 |
n |
n |
563 |
p |
p |
564 |
1 |
1 |
565 |
2 |
2 |
566 |
|
+100M |
567 |
|
a |
568 |
|
1 |
569 |
|
n |
570 |
|
p |
571 |
|
2 |
572 |
|
|
573 |
|
|
574 |
|
w |
575 |
|
EOF |
576 |
|
else |
577 |
|
## setup one bootable partition |
578 |
|
# 1. n= new disk |
579 |
|
# 2. p= primary disk |
580 |
|
# 3. 1= first partition |
581 |
|
# 4. ''= default sector start |
582 |
|
# 5. ''= defaul sector end |
583 |
|
# 6. a= bootable flag |
584 |
|
# 7. 1= boot flag for partition 1 |
585 |
|
# 8. n= new disk |
586 |
|
#10. p= primary disk |
587 |
|
#11. 2= second partition |
588 |
|
#12. ''= default sector start |
589 |
|
#13. ''= defaul sector end |
590 |
|
#14. w= write/quit |
591 |
|
fdisk ${HDD} &> /dev/null << EOF |
592 |
|
n |
593 |
|
p |
594 |
|
1 |
595 |
|
|
596 |
|
+100M |
597 |
a |
a |
598 |
1 |
1 |
599 |
|
n |
600 |
|
p |
601 |
|
2 |
602 |
|
|
603 |
|
|
604 |
w |
w |
605 |
EOF |
EOF |
606 |
|
fi |
607 |
else |
else |
608 |
## setup one bootable partition |
if [[ ${FDISKPARTIONBELOW256MB} = 1 ]] |
609 |
#1. n= new disk |
then |
610 |
#2. p= primary disk |
## setup one bootable partition |
611 |
#3. 1= first partition |
#1. n= new disk |
612 |
#4. ''= default sector start |
#2. p= primary disk |
613 |
#5. ''= defaul sector end |
#3. 1= first partition |
614 |
#6. a= bootable flag |
#4. 2= default sector start // small disk needs more space for grub2 mbr sector |
615 |
#7. 1= boot flag for partition 1 |
#5. ''= defaul sector end |
616 |
#8. w= write/quit |
#6. a= bootable flag |
617 |
fdisk ${HDD} &> /dev/null << EOF |
#7. 1= boot flag for partition 1 |
618 |
|
#8. w= write/quit |
619 |
|
fdisk ${HDD} &> /dev/null << EOF |
620 |
|
n |
621 |
|
p |
622 |
|
1 |
623 |
|
2 |
624 |
|
|
625 |
|
a |
626 |
|
1 |
627 |
|
w |
628 |
|
EOF |
629 |
|
else |
630 |
|
## setup one bootable partition |
631 |
|
#1. n= new disk |
632 |
|
#2. p= primary disk |
633 |
|
#3. 1= first partition |
634 |
|
#4. ''= default sector start |
635 |
|
#5. ''= defaul sector end |
636 |
|
#6. a= bootable flag |
637 |
|
#7. 1= boot flag for partition 1 |
638 |
|
#8. w= write/quit |
639 |
|
fdisk ${HDD} &> /dev/null << EOF |
640 |
n |
n |
641 |
p |
p |
642 |
1 |
1 |
646 |
1 |
1 |
647 |
w |
w |
648 |
EOF |
EOF |
649 |
|
fi |
650 |
fi |
fi |
651 |
else |
else |
652 |
## hdds partitionieren manuell |
## hdds partitionieren manuell |
656 |
|
|
657 |
setup_hdd_format() |
setup_hdd_format() |
658 |
{ |
{ |
659 |
|
install -d /tmp |
660 |
|
:> /tmp/format.log |
661 |
|
|
662 |
if [[ -n ${SWAPHDD} ]] |
if [[ -n ${SWAPHDD} ]] |
663 |
then |
then |
664 |
mkswap ${SWAPHDD} || die |
mkswap ${SWAPHDD} || die |
665 |
fi |
fi |
666 |
if [[ -n ${BOOTHDD} ]] |
if [[ -n ${BOOTHDD} ]] |
667 |
then |
then |
668 |
mkfs.${FORMAT_FILESYSTEM} -q ${BOOTHDD} || die |
mkfs.${FORMAT_FILESYSTEM_BOOTHDD} ${BOOTHDD} &> /tmp/format.log || die |
669 |
fi |
fi |
670 |
if [[ -n ${ROOTHDD} ]] |
if [[ -n ${ROOTHDD} ]] |
671 |
then |
then |
672 |
mkfs.${FORMAT_FILESYSTEM} -q ${ROOTHDD} || die |
mkfs.${FORMAT_FILESYSTEM_ROOTHDD} ${ROOTHDD} &> /tmp/format.log || die |
673 |
fi |
fi |
674 |
} |
} |
675 |
|
|
676 |
install_mount_rootfs() |
install_mount_rootfs() |
677 |
{ |
{ |
678 |
|
local opts |
679 |
|
|
680 |
if [[ -n ${SWAPHDD} ]] |
if [[ -n ${SWAPHDD} ]] |
681 |
then |
then |
682 |
swapon ${SWAPHDD} || die |
swapon ${SWAPHDD} || die |
683 |
fi |
fi |
684 |
if [[ -n ${ROOTHDD} ]] |
if [[ -n ${ROOTHDD} ]] |
685 |
then |
then |
686 |
mount ${ROOTHDD} ${INSTALLPATH} || die |
mount -t ${FORMAT_FILESYSTEM_ROOTHDD} ${ROOTHDD} ${INSTALL_ROOT} || die |
687 |
fi |
fi |
688 |
if [[ -n ${BOOTHDD} ]] |
if [[ -n ${BOOTHDD} ]] |
689 |
then |
then |
690 |
install -d ${INSTALLPATH}/boot || die |
install -d ${INSTALL_ROOT}/boot || die |
691 |
mount ${BOOTHDD} ${INSTALLPATH}/boot || die |
mount -t ${FORMAT_FILESYSTEM_BOOTHDD} ${BOOTHDD} ${INSTALL_ROOT}/boot || die |
692 |
fi |
fi |
693 |
|
|
694 |
cd ${INSTALLPATH} || die |
cd ${INSTALL_ROOT} || die |
695 |
} |
} |
696 |
|
|
697 |
install_system_image() |
install_system_image() |
698 |
{ |
{ |
699 |
tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH} |
tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALL_ROOT} |
700 |
} |
} |
701 |
|
|
702 |
install_bootsector_chroot() |
install_bootsector_chroot() |
703 |
{ |
{ |
704 |
local my_roothdd |
local my_roothdd |
705 |
local grubconf=${INSTALLPATH}/boot/grub/grub.conf |
local grubconf=${INSTALL_ROOT}/boot/grub/grub.conf |
706 |
local grub2conf=/boot/grub/grub.cfg |
local grub2conf=/boot/grub/grub.cfg |
707 |
local CONFIG |
local CONFIG |
708 |
|
|
709 |
# check for grub2 |
# check for grub2 |
710 |
if [[ -f ${INSTALLPATH}/sbin/grub-mkconfig ]] |
if [[ -f ${INSTALL_ROOT}/sbin/grub-mkconfig ]] |
711 |
then |
then |
712 |
# needed by grub-mkconfig on the first run |
# needed by grub-mkconfig on the first run |
713 |
if [[ ! -f ${INSTALLPATH}/boot/grub/video.lst ]] |
if [[ ! -f ${INSTALL_ROOT}/boot/grub/video.lst ]] |
714 |
then |
then |
715 |
install -m0644 ${INSTALLPATH}/lib/grub/*/video.lst ${INSTALLPATH}/boot/grub/video.lst || die |
install -m0644 ${INSTALL_ROOT}/lib/grub/*/video.lst ${INSTALL_ROOT}/boot/grub/video.lst || die |
716 |
fi |
fi |
717 |
|
|
718 |
# set kernelopts |
# set kernelopts |
719 |
if [[ -f ${INSTALLPATH}/etc/conf.d/grub ]] |
if [[ -f ${INSTALL_ROOT}/etc/conf.d/grub ]] |
720 |
then |
then |
721 |
sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLPATH}/etc/conf.d/grub || die |
sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALL_ROOT}/etc/conf.d/grub || die |
722 |
sed -i "s:^\(export GRUB_GFXPAYLOAD_LINUX=\).*:\1\"${GRUB2GFXPAYLOAD}\":" ${INSTALLPATH}/etc/conf.d/grub || die |
sed -i "s:^\(export GRUB_GFXPAYLOAD_LINUX=\).*:\1\"${GRUB2GFXPAYLOAD}\":" ${INSTALL_ROOT}/etc/conf.d/grub || die |
723 |
else |
else |
724 |
echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" > ${INSTALLPATH}/etc/conf.d/grub || die |
CONFIG=${INSTALL_ROOT}/etc/conf.d/grub |
725 |
echo "export GRUB_GFXPAYLOAD_LINUX=\"${GRUB2GFXPAYLOAD}\"" >> ${INSTALLPATH}/etc/conf.d/grub || die |
clearconfig |
726 |
|
addconfig "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" |
727 |
|
addconfig "export GRUB_GFXPAYLOAD_LINUX=\"${GRUB2GFXPAYLOAD}\"" |
728 |
fi |
fi |
729 |
CONFIG=${INSTALLPATH}/.installrc |
CONFIG=${INSTALL_ROOT}/.installrc |
730 |
clearconfig |
clearconfig |
731 |
addconfig 'grub-mkdevicemap' |
addconfig 'grub-mkdevicemap' |
732 |
addconfig "LC_ALL=C grub-mkconfig -o ${grub2conf} &> /dev/null" |
addconfig "LC_ALL=C grub-mkconfig -o ${grub2conf} &> /dev/null" |
736 |
# grub-legacy |
# grub-legacy |
737 |
else |
else |
738 |
### grubconf schreiben |
### grubconf schreiben |
739 |
source ${INSTALLPATH}/boot/kernelversion |
source ${INSTALL_ROOT}/boot/kernelversion |
740 |
|
|
741 |
#for alx only |
#for alx only |
742 |
if [ -e ${INSTALLPATH}/etc/alx_version ] |
if [ -e ${INSTALL_ROOT}/etc/alx_version ] |
743 |
then |
then |
744 |
OLD_ALXVER="${ALXVER}" |
OLD_ALXVER="${ALXVER}" |
745 |
source ${INSTALLPATH}/etc/alx_version |
source ${INSTALL_ROOT}/etc/alx_version |
746 |
KRNVER="ALX-${ALXVER}" |
KRNVER="ALX-${ALXVER}" |
747 |
ALXVER="${OLD_ALXVER}" |
ALXVER="${OLD_ALXVER}" |
748 |
fi |
fi |
764 |
addconfig "default 0" |
addconfig "default 0" |
765 |
addconfig "timeout 3" |
addconfig "timeout 3" |
766 |
# using current root password |
# using current root password |
767 |
addconfig "password --md5 $(cat ${INSTALLPATH}/etc/shadow | grep root | cut -d: -f2)" |
addconfig "password --md5 $(cat ${INSTALL_ROOT}/etc/shadow | grep root | cut -d: -f2)" |
768 |
addconfig |
addconfig |
769 |
addconfig "# normal boot" |
addconfig "# normal boot" |
770 |
addconfig "title ${KRNVER}" |
addconfig "title ${KRNVER}" |
795 |
fi |
fi |
796 |
|
|
797 |
# write bootsector chrooted (lfs/magellan) |
# write bootsector chrooted (lfs/magellan) |
798 |
CONFIG=${INSTALLPATH}/.installrc |
CONFIG=${INSTALL_ROOT}/.installrc |
799 |
clearconfig |
clearconfig |
800 |
addconfig '/usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null' |
addconfig '/usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null' |
801 |
addconfig 'root (hd0,0)' |
addconfig 'root (hd0,0)' |
812 |
is_initrd_supported() |
is_initrd_supported() |
813 |
{ |
{ |
814 |
# only generate initrds if the cmd exists |
# only generate initrds if the cmd exists |
815 |
[[ -x ${INSTALLPATH}/sbin/mkinitrd ]] && return 0 |
[[ -x ${INSTALL_ROOT}/sbin/mkinitrd ]] && return 0 |
816 |
return 1 |
return 1 |
817 |
} |
} |
818 |
|
|
823 |
# only generate initrds if the cmd exists |
# only generate initrds if the cmd exists |
824 |
is_initrd_supported || return 0 |
is_initrd_supported || return 0 |
825 |
|
|
826 |
|
FSMODS="${FORMAT_FILESYSTEM_BOOTHDD} ${FORMAT_FILESYSTEM_ROOTHDD}" |
827 |
DISKMODS="sd_mod" |
DISKMODS="sd_mod" |
828 |
OLDPATAMODS="amd74xx piix sis5513 via82cxxx" |
OLDPATAMODS="amd74xx piix sis5513 via82cxxx" |
829 |
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" |
846 |
fi |
fi |
847 |
|
|
848 |
# install an appropriate uvesafb.conf |
# install an appropriate uvesafb.conf |
849 |
CONFIG=${INSTALLPATH}/etc/modprobe.d/uvesafb.conf |
CONFIG=${INSTALL_ROOT}/etc/modprobe.d/uvesafb.conf |
850 |
clearconfig |
clearconfig |
851 |
addconfig "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" |
addconfig "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" |
852 |
|
|
853 |
# install an appropriate viafb.conf |
# install an appropriate viafb.conf |
854 |
CONFIG=${INSTALLPATH}/etc/modprobe.d/viafb.conf |
CONFIG=${INSTALL_ROOT}/etc/modprobe.d/viafb.conf |
855 |
clearconfig |
clearconfig |
856 |
addconfig "options viafb viafb_mode=1024x768 viafb_refresh=60" |
addconfig "options viafb viafb_mode=1024x768 viafb_refresh=60" |
857 |
|
|
858 |
# install an appropriate i810fb.conf |
# install an appropriate i810fb.conf |
859 |
CONFIG=${INSTALLPATH}/etc/modprobe.d/i810fb.conf |
CONFIG=${INSTALL_ROOT}/etc/modprobe.d/i810fb.conf |
860 |
clearconfig |
clearconfig |
861 |
addconfig "options i810fb xres=1024 yres=768 bpp=16 mtrr=1 hsync1=30 hsync2=62 vsync1=30 vsync2=60" |
addconfig "options i810fb xres=1024 yres=768 bpp=16 mtrr=1 hsync1=30 hsync2=62 vsync1=30 vsync2=60" |
862 |
|
|
863 |
CONFIG=${INSTALLPATH}/.installrc |
CONFIG=${INSTALL_ROOT}/.installrc |
864 |
clearconfig |
clearconfig |
865 |
addconfig 'echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS} ${OTHERMODS}\"" > /etc/conf.d/mkinitrd' |
addconfig 'echo "MODULES=\"${FSMODS} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS} ${OTHERMODS}\"" > /etc/conf.d/mkinitrd' |
866 |
addconfig 'mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null' |
addconfig 'mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null' |
867 |
addconfig 'exit 0' |
addconfig 'exit 0' |
868 |
## enter chroot |
## enter chroot |
871 |
|
|
872 |
is_uuid_supported() |
is_uuid_supported() |
873 |
{ |
{ |
874 |
if [[ -x $(which busybox.mkinitrd &> /dev/null) ]] |
# f2fs needs special treatments as the old busybox does not support this fs |
875 |
|
# use the blkid from util-linux instead of busybox |
876 |
|
if [[ ${FORMAT_FILESYSTEM} = f2fs ]] |
877 |
then |
then |
878 |
# only detect uuids if supported |
if [[ -x $(type -P blkid) ]] |
|
if [[ ! -z $(busybox.mkinitrd | grep blkid) ]] |
|
879 |
then |
then |
880 |
return 0 |
return 0 |
881 |
|
fi |
882 |
|
else |
883 |
|
if [[ -x $(type -P busybox.mkinitrd) ]] |
884 |
|
then |
885 |
|
# only detect uuids if supported |
886 |
|
if [[ ! -z $(busybox.mkinitrd | grep blkid) ]] |
887 |
|
then |
888 |
|
return 0 |
889 |
|
fi |
890 |
fi |
fi |
891 |
fi |
fi |
892 |
|
|
898 |
local UUID |
local UUID |
899 |
local SEC_TYPE |
local SEC_TYPE |
900 |
local TYPE |
local TYPE |
901 |
|
local blkidcmd |
902 |
|
|
903 |
local dev="$1" |
local dev="$1" |
904 |
[[ -z ${dev} ]] && die "no dev given" |
[[ -z ${dev} ]] && die "no dev given" |
908 |
then |
then |
909 |
eval "${dev}" |
eval "${dev}" |
910 |
else |
else |
911 |
eval $(busybox.mkinitrd blkid ${dev} | grep "${dev}:" | sed 's/.*:\ //') |
# f2fs needs special treatments as the old busybox does not support this fs |
912 |
|
# use the blkid from util-linux instead of busybox |
913 |
|
if [[ ${FORMAT_FILESYSTEM} = f2fs ]] |
914 |
|
then |
915 |
|
blkidcmd="blkid" |
916 |
|
else |
917 |
|
blkidcmd="busybox.mkinitrd blkid" |
918 |
|
fi |
919 |
|
eval $(${blkidcmd} ${dev} | grep "${dev}:" | sed 's/.*:\ //') |
920 |
fi |
fi |
921 |
echo "${UUID}" |
echo "${UUID}" |
922 |
} |
} |
923 |
|
|
924 |
install_system_settings() |
install_system_settings() |
925 |
{ |
{ |
926 |
# schreibe fstab |
local CONFIG |
927 |
if is_uuid_supported |
local fstype |
928 |
|
|
929 |
|
# write fstab |
930 |
|
CONFIG=${INSTALL_ROOT}/etc/fstab |
931 |
|
clearconfig |
932 |
|
|
933 |
|
if [[ -n ${BOOTHDD} ]] |
934 |
then |
then |
935 |
if [[ -n ${BOOTHDD} ]] |
if is_uuid_supported |
|
then |
|
|
echo -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die |
|
|
fi |
|
|
if [[ -n ${ROOTHDD} ]] |
|
|
then |
|
|
echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
|
|
fi |
|
|
else |
|
|
if [[ -n ${BOOTHDD} ]] |
|
936 |
then |
then |
937 |
echo -e "${BOOTHDD}\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die |
addconfig -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\t${FORMAT_FILESYSTEM_BOOTHDD}\tnoatime,noauto\t1 1" |
938 |
|
else |
939 |
|
addconfig -e "${BOOTHDD}\t/boot\t${FORMAT_FILESYSTEM_BOOTHDD}\tnoatime,noauto\t1 1" |
940 |
fi |
fi |
941 |
if [[ -n ${ROOTHDD} ]] |
fi |
942 |
|
|
943 |
|
if [[ -n ${ROOTHDD} ]] |
944 |
|
then |
945 |
|
if is_uuid_supported |
946 |
then |
then |
947 |
echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
addconfig -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM_ROOTHDD}\tnoatime\t0 0" |
948 |
|
else |
949 |
|
addconfig -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM_ROOTHDD}\tnoatime\t0 0" |
950 |
fi |
fi |
951 |
fi |
fi |
952 |
|
|
953 |
# 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 |
954 |
#echo -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
#addconfig -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0" |
955 |
echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
addconfig -e "proc\t/proc\tproc\tdefaults\t0 0" |
956 |
echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
addconfig -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" |
957 |
|
|
958 |
# install network config skeleton |
# install network config skeleton |
959 |
install -m0644 ${INSTALLPATH}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLPATH}/etc/conf.d/ || die |
install -m0644 ${INSTALL_ROOT}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALL_ROOT}/etc/conf.d/ || die |
960 |
|
|
961 |
# intel framebufer quirk |
# intel framebufer quirk |
962 |
if [[ -e /proc/fb ]] |
if [[ -e /proc/fb ]] |
966 |
fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:') |
fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:') |
967 |
if [[ ${fbdev} != 0 ]] |
if [[ ${fbdev} != 0 ]] |
968 |
then |
then |
969 |
sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALLPATH}/etc/splash/splash.conf || die |
sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALL_ROOT}/etc/splash/splash.conf || die |
970 |
fi |
fi |
971 |
fi |
fi |
972 |
fi |
fi |
977 |
cd / |
cd / |
978 |
if [[ -n ${BOOTHDD} ]] |
if [[ -n ${BOOTHDD} ]] |
979 |
then |
then |
980 |
umount ${INSTALLPATH}/boot || die |
umount ${INSTALL_ROOT}/boot || die |
981 |
fi |
fi |
982 |
if [[ -n ${ROOTHDD} ]] |
if [[ -n ${ROOTHDD} ]] |
983 |
then |
then |
984 |
umount ${INSTALLPATH} || die |
umount ${INSTALL_ROOT} || die |
985 |
fi |
fi |
986 |
if [[ -n ${SWAPHDD} ]] |
if [[ -n ${SWAPHDD} ]] |
987 |
then |
then |
1012 |
|
|
1013 |
case "${method}" in |
case "${method}" in |
1014 |
auto) |
auto) |
1015 |
|
if [[ ${FLASHDISK} = 1 ]] |
1016 |
|
then |
1017 |
|
export FORMAT_FILESYSTEM="f2fs" |
1018 |
|
export FORMAT_FILESYSTEM_BOOTHDD="ext2" |
1019 |
|
export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}" |
1020 |
|
else |
1021 |
|
export FORMAT_FILESYSTEM_BOOTHDD="" |
1022 |
|
export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}" |
1023 |
|
fi |
1024 |
export INSTALL_METHOD="${method}" |
export INSTALL_METHOD="${method}" |
1025 |
;; |
;; |
1026 |
normal) |
normal) |
1027 |
|
export FORMAT_FILESYSTEM_BOOTHDD="${FORMAT_FILESYSTEM}" |
1028 |
|
export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}" |
1029 |
export INSTALL_METHOD="${method}" |
export INSTALL_METHOD="${method}" |
1030 |
;; |
;; |
1031 |
single) |
single) |
1032 |
|
export FORMAT_FILESYSTEM_BOOTHDD="" |
1033 |
|
export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}" |
1034 |
|
export INSTALL_METHOD="${method}" |
1035 |
|
;; |
1036 |
|
flash) |
1037 |
|
export FORMAT_FILESYSTEM="f2fs" |
1038 |
|
export FORMAT_FILESYSTEM_BOOTHDD="ext2" |
1039 |
|
export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}" |
1040 |
export INSTALL_METHOD="${method}" |
export INSTALL_METHOD="${method}" |
1041 |
;; |
;; |
1042 |
*) |
*) |
1043 |
echo "Unknown install method '${method}', aborting." |
die "Unknown install method '${method}', aborting." |
|
exit 1 |
|
1044 |
;; |
;; |
1045 |
esac |
esac |
1046 |
|
|