diff --git a/Makefile b/Makefile index 25ad8b4..a8af0ed 100644 --- a/Makefile +++ b/Makefile @@ -188,16 +188,17 @@ ifeq ($(DASH),YES) endif touch $(SYSTOOLS) -$(GRUB): $(PREPROOT) configs/grub.conf $(KERNEL) scripts/grub-headless.sed +$(GRUB): $(PREPROOT) configs/grub.cfg $(KERNEL) scripts/grub-headless.sed ifneq ($(EXTERNAL_KERNEL),YES) @scripts/echo Installing Grub - $(inroot) $(EMERGE) -nN $(USEPKG) sys-boot/grub-static - cp configs/grub.conf $(CHROOT)/boot/grub/grub.conf + $(inroot) $(EMERGE) -nN $(USEPKG) sys-boot/grub + mkdir -p $(CHROOT)/boot/grub + cp configs/grub.cfg $(CHROOT)/boot/grub/grub.cfg ifeq ($(VIRTIO),YES) - sed -i 's/sda/vda/' $(CHROOT)/boot/grub/grub.conf + sed -i 's/sda/vda/' $(CHROOT)/boot/grub/grub.cfg endif ifeq ($(HEADLESS),YES) - sed -i -f scripts/grub-headless.sed $(CHROOT)/boot/grub/grub.conf + sed -i -f scripts/grub-headless.sed $(CHROOT)/boot/grub/grub.cfg endif endif $(inroot) ln -nsf /run/systemd/resolve/resolv.conf /etc/resolv.conf @@ -244,7 +245,7 @@ endif $(RAW_IMAGE): $(STAGE4_TARBALL) scripts/grub.shell scripts/motd.sh @scripts/echo Installing files to `basename $(RAW_IMAGE)` qemu-img create -f raw $(RAW_IMAGE).tmp $(DISK_SIZE) - parted -s $(RAW_IMAGE).tmp mklabel gpt + parted -s $(RAW_IMAGE).tmp mklabel msdos parted -s $(RAW_IMAGE).tmp mkpart primary 1 $(DISK_SIZE) parted -s $(RAW_IMAGE).tmp set 1 boot on sync @@ -255,8 +256,8 @@ $(RAW_IMAGE): $(STAGE4_TARBALL) scripts/grub.shell scripts/motd.sh tar -xf $(STAGE4_TARBALL) --numeric-owner $(COPY_ARGS) -C $(CHROOT) scripts/motd.sh $(EXTERNAL_KERNEL) $(VIRTIO) $(DISK_SIZE) $(SWAP_SIZE) $(DASH) $(ARCH) > $(CHROOT)/etc/motd ifneq ($(EXTERNAL_KERNEL),YES) - echo '(hd0) ' $(RAW_IMAGE).tmp > device-map - $(CHROOT)/sbin/grub --device-map=device-map --no-floppy --batch < scripts/grub.shell + echo '(hd0) ' `cat partitions` > device-map + $(CHROOT)/usr/sbin/grub-install --no-floppy --grub-mkdevicemap=device-map --directory=$(CHROOT)/usr/lib/grub/i386-pc --boot-directory=$(CHROOT)/boot `cat partitions` endif umount $(CHROOT) rmdir $(CHROOT) diff --git a/configs/grub.cfg b/configs/grub.cfg new file mode 100644 index 0000000..83057c7 --- /dev/null +++ b/configs/grub.cfg @@ -0,0 +1,10 @@ +insmod part_msdos +set timeout=2 +set default=0 +set fallback=1 +set graphics=0 + +menuentry "Gentoo Linux" { + set root=(hd0,1) + linux /boot/vmlinuz root=/dev/sda1 rootfstype=ext4 net.ifnames=0 init=/usr/lib/systemd/systemd quiet +} diff --git a/configs/grub.conf b/configs/grub.conf deleted file mode 100644 index e0afae0..0000000 --- a/configs/grub.conf +++ /dev/null @@ -1,7 +0,0 @@ -default 0 -timeout 5 - -title Gentoo Linux -root (hd0,0) -kernel /boot/vmlinuz root=/dev/sda1 rootfstype=ext4 net.ifnames=0 init=/usr/lib/systemd/systemd quiet - diff --git a/scripts/grub-headless.sed b/scripts/grub-headless.sed index eb531fe..3bef1b9 100644 --- a/scripts/grub-headless.sed +++ b/scripts/grub-headless.sed @@ -1,3 +1,4 @@ 1iserial --speed=9600 --unit=0 --word=8 --parity=no --stop=1\ -1iterminal --timeout=2 serial console\ -s/^\(kernel .*\)$/\1 console=ttyS0/ +1iterminal_input serial\ +1iterminal_output serial\ +s/^\([ \t]*linux .*\)$/\1 console=tty0 console=ttyS0,38400n8/