From 6c47a73d75dab255d950ee77e4b7754d67650482 Mon Sep 17 00:00:00 2001 From: oddlama Date: Sat, 4 Jan 2020 21:55:42 +0100 Subject: [PATCH] Install vanilla kernel. --- README.md | 12 +++++++----- scripts/config.sh | 29 ++++++++++++++++++++--------- scripts/functions.sh | 2 +- scripts/main.sh | 29 +++++++++++++++++++---------- 4 files changed, 47 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 3420c85..fe167dd 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,10 @@ and [Sakaki's EFI Install Guide](https://wiki.gentoo.org/wiki/Sakaki%27s_EFI_Ins What you will get: -* EFIstub kernel * Minimal system configuration +* Temporary vanilla kernel (precompiled by gentoo), in my opinion you + should replace this kernel with a custom made kernel for your system. + See [Kernel](#Kernel) for details on how to achieve that with low effort. What you can get optionally: @@ -21,15 +23,15 @@ What you can get optionally: * EFI secure boot * Initramfs (compiled into the kernel for EFIstub) * Preconfigured sshd -* Ansible (packages, user, ssh) +* Ansible ready (packages, user, ssh) +* Additional packages of your choice (only trivial installations without use flag changes) What you will **NOT** get: (i.e. you will have to do it yourself) * X11 desktop environment -* A user (except root) +* A user for yourself (except `root` obviously) * Any form of RAID -* A specialized kernel (TODO insert links) - +* A specialized kernel, see [Kernel](#Kernel) for details on how to get one. Only necessary configuration is applied to provide a common baseline system. If you need advanced features such as an initramfs or a different diff --git a/scripts/config.sh b/scripts/config.sh index 550e886..41fba80 100644 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -33,15 +33,7 @@ ENABLE_FORMATTING=true ################################################ -# Gentoo configuration - -# The selected gentoo mirror -GENTOO_MIRROR="https://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo" -#GENTOO_MIRROR="https://distfiles.gentoo.org" - -# The stage3 tarball to install -STAGE3_BASENAME="stage3-amd64-hardened+nomultilib" -#STAGE3_BASENAME="stage3-amd64-hardened-selinux+nomultilib" +# System configuration # The timezone for the new system TIMEZONE="Europe/Berlin" @@ -64,3 +56,22 @@ LOCALE="C.utf8" # The default keymap for the system KEYMAP="de-latin1-nodeadkeys" #KEYMAP="us" + + +################################################ +# Gentoo configuration + +# The selected gentoo mirror +GENTOO_MIRROR="https://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo" +#GENTOO_MIRROR="https://distfiles.gentoo.org" + +# The stage3 tarball to install +STAGE3_BASENAME="stage3-amd64-hardened+nomultilib" +#STAGE3_BASENAME="stage3-amd64-hardened-selinux+nomultilib" + +# Default accept keywords (enable testing by default) +#ACCEPT_KEYWORDS="" +ACCEPT_KEYWORDS="~amd64" + +# List of additional packages to install (will be directly passed to emerge) +ADDITIONAL_PACKAGES="app-editors/neovim" diff --git a/scripts/functions.sh b/scripts/functions.sh index e22aeb1..41d6d09 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -315,7 +315,7 @@ gentoo_chroot() { # Copy resolv.conf einfo "Preparing chroot environment" - cp /etc/resolv.conf "$ROOT_MOUNTPOINT/etc/resolv.conf" \ + install --mode=0644 /etc/resolv.conf "$ROOT_MOUNTPOINT/etc/resolv.conf" \ || die "Could not copy resolv.conf" # Mount virtual filesystems diff --git a/scripts/main.sh b/scripts/main.sh index 77aedd7..c964bc0 100755 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -98,22 +98,31 @@ main_install_gentoo_in_chroot() { einfo "Installing git" try emerge --verbose dev-vcs/git - #get kernel + # Install vanilla kernel, to be able to boot the system. + einfo "Installing vanilla kernel" + try emerge --verbose sys-kernel/vanilla-kernel - #compile minimal kernel to boot system - - #reboot? - - #mount boot partition - - #create kernel + # Install additional packages, if any. + if [[ -n "$ADDITIONAL_PACKAGES" ]]; then + einfo "Installing additional packages" + emerge --autounmask-continue=y -- $ADDITIONAL_PACKAGES + fi #create_ansible_user #generate_fresh keys to become mgmnt ansible user #install_ansible - einfo "Gentoo installation complete" - einfo "To chroot into the new system, simply execute the provided 'chroot' wrapper" + if ask "Do you want to assign a root password now?"; then + passwd root + einfo "Root password assigned" + else + passwd -d root + ewarn "Root password cleared, set one as soon as possible!" + fi + + einfo "Gentoo installation complete." + einfo "To chroot into the new system, simply execute the provided 'chroot' wrapper." + einfo "Otherwise, you may now reboot your system." } main_install() {