Permalink
Browse files

Merge pull request #1105 from courtney-miles/gentoo-20170504

Update Gentoo Latest template for Stage3 date 20170504
  • Loading branch information...
2 parents 4618381 + c0dad6b commit 304806b1116203007c658c8c3620fdf334eb370c @mpapis mpapis committed on GitHub May 23, 2017
@@ -19,8 +19,19 @@ mkfs.ext4 /dev/sda4
# mount other partitions
mount /dev/sda4 "$chroot" && cd "$chroot" && mkdir boot && mount /dev/sda1 boot
+if [ -f ~/postinstall-gentoo.tar ]; then
+ echo "Post installation file found. Extracting..."
+ tar xvf ~/postinstall-gentoo.tar && rm ~/postinstall-gentoo.tar
+fi
+
+
# download stage 3, unpack it, delete the stage3 archive file
-wget --tries=5 "$stage3url"
+if [ ! -f $stage3file ]; then
+ wget --tries=5 "$stage3url"
+else
+ echo "Using pre-downloaded file, $stage3file ..."
+fi
+
tar xpf "$stage3file" && rm "$stage3file"
# prepeare chroot, update env
@@ -32,17 +43,21 @@ cp /etc/resolv.conf "$chroot/etc/"
date -u > "$chroot/etc/vagrant_box_build_time"
# retrieve and extract latest portage tarball
-chroot "$chroot" wget --tries=5 "${portageurl}"
+if [ ! -f portage-latest.tar.bz2 ]; then
+ chroot "$chroot" wget --tries=5 "${portageurl}"
+else
+ echo "Using pre-downloaded portage file."
+fi
+
chroot "$chroot" tar -xjpf portage-latest.tar.bz2 -C /usr
chroot "$chroot" rm -rf portage-latest.tar.bz2
chroot "$chroot" env-update
# bring up network interface and sshd on boot (Alt. for new systemd naming scheme, enp0s3)
#chroot "$chroot" /bin/bash <<DATAEOF
-#cd /etc/conf.d
#sed -i "s/eth0/enp0s3/" /etc/udhcpd.conf
-#echo 'config_enp0s3=( "dhcp" )' >> net
-#ln -s net.lo /etc/init.d/net.enp0s3
+#echo 'config_enp0s3=( "dhcp" )' >> /etc/conf.d/net
+#ln -s /etc/init.d/net.lo /etc/init.d/net.enp0s3
#rc-update add net.enp0s3 default
#rc-update add sshd default
#DATAEOF
@@ -1,7 +1,7 @@
require 'net/http'
# Change the file for definitionVariation to one of the .yml configurations in this directory for the box you would like to build.
-definitionVariation = 'gentoo_amd64.yml'
+definitionVariation = 'gentoo_amd64_minimal.yml'
Veewee::Definition.declare_yaml('definition.yml', definitionVariation)
@@ -11,7 +11,16 @@
template_uri = "http://distfiles.gentoo.org/releases/#{arch}/autobuilds/latest-install-#{arch}-minimal.txt"
template_build = Net::HTTP.get_response(URI.parse(template_uri)).body.split(/\n/).last.split(/\ /)
+# If you are finding you need to run this process many times, manually download the stage3 and portage file
+# and tar them together as postinstall-gentoo.tar in your veewee working directory then uncomment the hooks
+# lines below. Refer to setting_*.sh for how to determine the URL for the appropriate stage3 and portage files.
+
Veewee::Definition.declare({
+# :cpu_count => '2',
+# :memory_size => '4096',
:iso_file => template_build.first.split(/\//).last,
- :iso_src => "http://distfiles.gentoo.org/releases/#{arch}/autobuilds/#{template_build.first}"
+ :iso_src => "http://distfiles.gentoo.org/releases/#{arch}/autobuilds/#{template_build.first}",
+# :hooks => {
+# :before_postinstall => Proc.new { definition.box.scp('postinstall-gentoo.tar', 'postinstall-gentoo.tar') }
+# }
})
@@ -16,6 +16,7 @@
- 'passwd<Enter><Wait><Wait>'
- 'vagrant<Enter><Wait>'
- 'vagrant<Enter><Wait>'
+ - 'echo "PermitRootLogin yes" >> /etc/ssh/sshd_config<Enter>'
- '/etc/init.d/sshd start<Enter>'
:kickstart_port: '7122'
:kickstart_timeout: 300
@@ -10,15 +10,17 @@ DATAEOF
chroot "$chroot" emerge grub
# tweak timeout
+chroot "$chroot" sed -i "s/#GRUB_TIMEOUT=/GRUB_TIMEOUT=/g" /etc/default/grub
chroot "$chroot" sed -i "s/GRUB_TIMEOUT=.*/GRUB_TIMEOUT=1/g" /etc/default/grub
+# Force old interface naming convention.
+chroot "$chroot" sed -i "s/#GRUB_CMDLINE_LINUX=/GRUB_CMDLINE_LINUX=/g" /etc/default/grub
+chroot "$chroot" sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0\"/g" /etc/default/grub
# make the disk bootable
chroot "$chroot" /bin/bash <<DATAEOF
source /etc/profile && \
env-update && \
-grep -v rootfs /proc/mounts > /etc/mtab && \
-mkdir -p /boot/grub2 && \
-ln -sf /boot/grub2 /boot/grub && \
-grub2-mkconfig -o /boot/grub/grub.cfg && \
-grub2-install --no-floppy /dev/sda
+mkdir -p /boot/grub && \
+grub-mkconfig -o /boot/grub/grub.cfg && \
+grub-install --no-floppy /dev/sda
DATAEOF
@@ -19,8 +19,8 @@ export accept_keywords="amd64"
export chost="x86_64-pc-linux-gnu"
# kernel version to use
-export kernel_version="3.14.36"
-export kernel_image_version="3.14.36-gentoo"
+export kernel_version="4.9.16"
+export kernel_image_version="4.9.16-gentoo"
# timezone (as a subdirectory of /usr/share/zoneinfo)
export timezone="UTC"
@@ -19,8 +19,8 @@ export accept_keywords="x86"
export chost="i686-pc-linux-gnu"
# kernel version to use
-export kernel_version="3.14.36"
-export kernel_image_version="3.14.36-gentoo"
+export kernel_version="4.9.16"
+export kernel_image_version="4.9.16-gentoo"
# timezone (as a subdirectory of /usr/share/zoneinfo)
export timezone="UTC"

0 comments on commit 304806b

Please sign in to comment.