diff options
-rwxr-xr-x | gentoox_build.sh | 10 | ||||
-rwxr-xr-x | install.sh | 17 |
2 files changed, 16 insertions, 11 deletions
diff --git a/gentoox_build.sh b/gentoox_build.sh index f321ded..4667fe7 100755 --- a/gentoox_build.sh +++ b/gentoox_build.sh @@ -202,7 +202,7 @@ if [[ ! -f '/tmp/gentoox-kernelpatches-applied' ]]; then fi cd /usr/src -rm -f \$KERNEL_CONFIG_DIFF +rm -f $KERNEL_CONFIG_DIFF #mkdir -p /usr/share/genkernel/distfiles/ #wget https://www.busybox.net/downloads/busybox-1.20.2.tar.bz2 -d /usr/share/genkernel/distfiles/ #cho -e '\nMAKEOPTS="-j12"' >> /etc/genkernel.conf @@ -222,7 +222,7 @@ genkernel --microcode --luks --lvm --mdadm --btrfs --disklabel initramfs # --zfs XZ_OPT="--lzma1=preset=9e,dict=128MB,nice=273,depth=200,lc=4" tar --lzma -cf /usr/src/kernel-gentoox.tar.lzma /boot/*\${KERNELVERSION}* -C /lib/modules/ . emerge -v grub:2 -sed -i "s/#GRUB_CMDLINE_LINUX_DEFAULT=\"\"/GRUB_CMDLINE_LINUX_DEFAULT=\"zswap.enabled=1 zswap.compressor=lz4 zswap.max_pool_percent=20 zswap.zpool=z3fold\"/" /etc/default/grub +sed -i "s/#GRUB_CMDLINE_LINUX_DEFAULT=\"\"/GRUB_CMDLINE_LINUX_DEFAULT=\"zswap.enabled=1 zswap.compressor=lz4 zswap.max_pool_percent=20 zswap.zpool=z3fold dobtrfs\"/" /etc/default/grub sed -i "s/#GRUB_GFXMODE=640x480/GRUB_GFXMODE=auto/" /etc/default/grub sed -i "s/#GRUB_GFXPAYLOAD_LINUX=/GRUB_GFXPAYLOAD_LINUX=keep/" /etc/default/grub #rc-update add zfs-import boot @@ -400,10 +400,10 @@ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DKDE_INSTALL_LI make install cd / -#echo "root:$rootpassword" | chpasswd -yes "$rootpassword" | passwd root +#echo "root:\$rootpassword" | chpasswd +yes $rootpassword | passwd root useradd $username -yes "$userpassword" | passwd "$username" +yes $userpassword | passwd $username gpasswd -a $username wheel gpasswd -a $username weston-launch @@ -12,11 +12,13 @@ echo -e 'Welcome to the GentooX setup, the installation script mainly consists o \tGentooX uses openSUSE-style BTRFS root partition & subvolumes for snapshotting with snapper \tGentooX requires minimum of 16GB of space, and use of BTRFS is hardcoded -mounting target partition to /mnt/install -unsquashfs -f -i -d /mnt/install/ /mnt/cdrom/image.squashfs -/usr/local/sbin/genfstab -U >> /mnt/install/etc/fstab -/usr/local/sbin/arch-chroot /mnt/install/ -grub-install --target=x86_64-efi for UEFI mode or grub-install --target=i386-pc (BIOS only)' +Manual installation can be done via: + mounting target partition to /mnt/install + unsquashfs -f -i -d /mnt/install/ /mnt/cdrom/image.squashfs + /usr/local/sbin/genfstab -U >> /mnt/install/etc/fstab + /usr/local/sbin/arch-chroot /mnt/install/ + grub-install --target=x86_64-efi for UEFI mode or grub-install --target=i386-pc (BIOS only) + grub-mkconfig -o /boot/grub/grub.cfg' declare -A PART_SCHEME @@ -88,6 +90,7 @@ setup_btrfs () { } +echo -e "\nDetected drives:\n$(lsblk | grep disk)" while :; do echo read -erp "Automatic partitioning (a) or manual partitioning (will launch gparted)? [a/m] " -n 1 partitioning_mode @@ -141,6 +144,8 @@ mount --rbind /sys /mnt/install/sys cd /mnt/install/ cat <<HEREDOC | chroot . source /etc/profile && export PS1="(chroot) \$PS1" +if [[ -d /sys/firmware/efi/ ]]; then UEFI_MODE=y; fi +if [[ -z $drive ]]; then drive=$(echo $partition | sed 's/[0-9]\+\$//'); fi sensors-detect --auto rc-update add lm_sensors default NCORES=\$(getconf _NPROCESSORS_ONLN) @@ -151,9 +156,9 @@ sed -i -r "s/^NTHREADS=\"([^\"]*)\"$/NTHREADS=\"\$NCORES\"/g" /etc/portage/make. if [[ ! -z $UEFI_MODE ]]; then grub-install --target=x86_64-efi else - if [[ -z \$drive ]]; then drive=\$(echo \$partition | sed 's/[0-9]\+$//'); fi grub-install --target=i386-pc $drive fi +grub-mkconfig -o /boot/grub/grub.cfg HEREDOC umount -l /mnt/install/boot/efi /mnt/install/var /mnt/install/usr/local /mnt/install/tmp /mnt/install/srv /mnt/install/root /mnt/install/opt /mnt/install/home /mnt/install/boot/grub/x86_64-efi /mnt/install/boot/grub/i386-pc /mnt/install/.snapshots /mnt/install |