cdrom: Add grub.cfg that allows to install IPFire
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 31 May 2018 13:57:12 +0000 (14:57 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 14 Jul 2018 12:43:51 +0000 (13:43 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/cdrom/grub-efi.cfg
config/cdrom/grub.cfg [new file with mode: 0644]
lfs/cdrom

index 6dd9511..8ce7150 100644 (file)
@@ -1,2 +1,2 @@
-search --file --no-floppy --set=root /EFI/BOOT/grub.cfg
-set prefix=($root)/EFI/BOOT/
+search.fs_label "NAME VERSION ARCH" root
+set prefix=($root)/EFI/BOOT
diff --git a/config/cdrom/grub.cfg b/config/cdrom/grub.cfg
new file mode 100644 (file)
index 0000000..f2c2a3b
--- /dev/null
@@ -0,0 +1,34 @@
+set default="1"
+
+function load_video {
+  insmod efi_gop
+  insmod efi_uga
+  insmod video_bochs
+  insmod video_cirrus
+  insmod all_video
+}
+
+load_video
+set gfxpayload=keep
+insmod gzio
+insmod part_gpt
+insmod ext2
+
+set timeout=60
+
+menuentry 'Install NAME VERSION ARCH' --class ipfire --class gnu-linux --class gnu --class os {
+       linux /boot/isolinux/vmlinuz
+       initrd /boot/isolinux/instroot
+}
+
+submenu 'Other Installation Options -->' {
+       menuentry 'Install NAME VERSION (Text Mode)' --class ipfire --class gnu-linux --class gnu --class os {
+               linux /boot/isolinux/vmlinuz novga
+               initrd /boot/isolinux/instroot
+       }
+
+       menuentry 'Unattended installation' --class ipfire --class gnu-linux --class gnu --class os {
+               linux /boot/isolinux/vmlinuz installer.unattended
+               initrd /boot/isolinux/instroot
+       }
+}
index d21f69c..08cbcb7 100644 (file)
--- a/lfs/cdrom
+++ b/lfs/cdrom
@@ -36,8 +36,8 @@ else
 endif
 
 ISO_ARGS = -J -r -v \
 endif
 
 ISO_ARGS = -J -r -v \
-       -A "$(NAME) $(VERSION)" \
-       -V "$(NAME)_$(VERSION)" \
+       -A "$(NAME) $(VERSION) $(BUILD_ARCH)" \
+       -V "$(NAME) $(VERSION) $(BUILD_ARCH)" \
        -no-emul-boot \
        -boot-load-size 4 \
        -boot-info-table \
        -no-emul-boot \
        -boot-load-size 4 \
        -boot-info-table \
@@ -46,7 +46,7 @@ ISO_ARGS = -J -r -v \
 
 # Only build a stub ISO for ARM
 ifeq "$(BUILD_PLATFORM)" "arm"
 
 # Only build a stub ISO for ARM
 ifeq "$(BUILD_PLATFORM)" "arm"
-       ISO_ARGS = -J -r -V "$(NAME)_$(VERSION)"
+       ISO_ARGS = -J -r -V "$(NAME) $(VERSION) $(BUILD_ARCH)"
 endif
 
 ISOHYBRID_ARGS =
 endif
 
 ISOHYBRID_ARGS =
@@ -125,11 +125,15 @@ ifeq "$(EFI)" "1"
        dd if=/dev/zero of=/install/cdrom/boot/isolinux/efiboot.img bs=1k count=1440
        mkdosfs -F 12 -n "IPFIRE_EFI" /install/cdrom/boot/isolinux/efiboot.img
 
        dd if=/dev/zero of=/install/cdrom/boot/isolinux/efiboot.img bs=1k count=1440
        mkdosfs -F 12 -n "IPFIRE_EFI" /install/cdrom/boot/isolinux/efiboot.img
 
+       # Generate embedded GRUB configuration
+       sed -e "s/NAME/$(NAME)/g" -e "s/VERSION/$(VERSION)/g" -e "s/ARCH/$(BUILD_ARCH)/g" \
+               $(DIR_SRC)/config/cdrom/grub-efi.cfg > /tmp/grub-efi.cfg
+
        # Build a GRUB EFI image
        grub-mkimage \
                --format=$(BUILD_ARCH)-efi \
                --output=/tmp/boot$(EFI_ARCH).efi \
        # Build a GRUB EFI image
        grub-mkimage \
                --format=$(BUILD_ARCH)-efi \
                --output=/tmp/boot$(EFI_ARCH).efi \
-               --config=$(DIR_SRC)/config/cdrom/grub-efi.cfg \
+               --config=/tmp/grub-efi.cfg \
                --compression=xz \
                --prefix=/EFI/BOOT \
                $(GRUB_EFI_MODULES)
                --compression=xz \
                --prefix=/EFI/BOOT \
                $(GRUB_EFI_MODULES)
@@ -144,7 +148,12 @@ ifeq "$(EFI)" "1"
 
        # Cleanup
        umount /install/efiboot.img
 
        # Cleanup
        umount /install/efiboot.img
-       rm -rf /install/efiboot.img /tmp/boot$(EFI_ARCH).efi
+       rm -rf /install/efiboot.img /tmp/boot$(EFI_ARCH).efi /tmp/grub-efi.cfg
+
+       # Install GRUB configuration
+       mkdir -pv /install/cdrom/EFI/BOOT
+       sed -e "s/NAME/$(NAME)/g" -e "s/VERSION/$(VERSION)/g" -e "s/ARCH/$(BUILD_ARCH)/g" \
+               < $(DIR_SRC)/config/cdrom/grub.cfg > /install/cdrom/EFI/BOOT/grub.cfg
 endif
 
        cp /usr/share/hwdata/pci.ids                /install/cdrom/boot/isolinux/pci.ids
 endif
 
        cp /usr/share/hwdata/pci.ids                /install/cdrom/boot/isolinux/pci.ids