From 34fcf638d57f87b072f661d35d3e5f7e0262b472 Mon Sep 17 00:00:00 2001 From: Salt Date: Sun, 29 Nov 2020 22:06:29 -0600 Subject: [PATCH] Working on more gentoostrap setup --- gentoostrap.sh | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/gentoostrap.sh b/gentoostrap.sh index 54be0c5..cb85b3b 100755 --- a/gentoostrap.sh +++ b/gentoostrap.sh @@ -92,8 +92,8 @@ build-gentoo() { curl -s http://distfiles.gentoo.org/releases/amd64/autobuilds/current-stage3-amd64-systemd/ \ | grep -oe 'stage3-amd64-systemd-20.*\.tar\.xz' \ | sed 's/^stage3.*">//g' \ - | uniq \ | sort \ + | uniq \ | head -n 1 )" stage3file="$(mktemp "tmp.$USER.$_name.XXXXXX-stage3.tar.xz" -p "/tmp")" @@ -123,6 +123,13 @@ build-gentoo() { nameserver 8.8.8.8 nameserver 8.8.4.4 EOF + # Timezone + cp /etc/timezone "$_optdest/etc/timezone" + # Locale + cat <<-EOF > "$_optdest/etc/locale.gen" + en_US ISO-8859-1 + en_US.UTF-8 UTF-8 + EOF # Now we need to pivot into a chroot and finish configuration natively # Buuuut... since we're using systemd, we get to just spawn a systemd-nspawn container @@ -132,7 +139,36 @@ build-gentoo() { } build-gentoo-chroot() { # Build Gentoo, but from within the chroot environment - : + log "Building Gentoo from within chroot" + + # Sync repositories + log "Getting ebuild repositories" + emerge-webrsync + + # Get the stable plasma/systemd profile and select it + profile=$( + eselect profile list \ + | grep -ie 'stable' \ + | grep -ie 'plasma/systemd' \ + | sort \ + | uniq \ + | head -n 1 \ + | grep -oP '\[\K[^\]]+' + ) + log "Setting profile $profile" + eselect profile set "$profile" + + # BEHOLD! + emerge -DNuv @world + # Configure timezone + emerge --config sys-libs/timezone-data + # Locales + locale-gen + eselect locale set en_US.utf8 + env-update + . /etc/profile + + # Build a kernel } # Main