diff --git a/config/DS918+/7.0-41890/config.json b/config/DS918+/7.0-41890/config.json index f77859f36..5f2b2c314 100644 --- a/config/DS918+/7.0-41890/config.json +++ b/config/DS918+/7.0-41890/config.json @@ -113,7 +113,8 @@ }, "bootp1_copy": { "@@@PAT@@@/GRUB_VER": "GRUB_VER", - "@@@COMMON@@@/EFI": "EFI" + "@@@COMMON@@@/EFI/boot/SynoBootLoader.conf": "EFI/BOOT/", + "@@@COMMON@@@/EFI/boot/SynoBootLoader.efi": "EFI/BOOT/" }, "bootp2_copy": { "@@@PAT@@@/GRUB_VER": "GRUB_VER", diff --git a/config/DS918+/7.0.1-42218/config.json b/config/DS918+/7.0.1-42218/config.json new file mode 100644 index 000000000..5bea84471 --- /dev/null +++ b/config/DS918+/7.0.1-42218/config.json @@ -0,0 +1,127 @@ +{ + "os": { + "id": "ds918p_42218", + "pat_url": "https://global.download.synology.com/download/DSM/release/7.0.1/42218/DSM_DS918%2B_42218.pat", + "sha256": "4fc59b0f0adfdd96467376f50919dde1bf5dcec74e53452e626f9cf7bd52a38c" + }, + + "files": { + "zlinux": { + "name": "zImage", + "sha256": "0df0fe7b86c269a58933e334cde5056cf5a901f705d6fef5cd750f2981b0ca04" + }, + "ramdisk": { + "name": "rd.gz", + "sha256": "016a99d562b0c06be5f36b4d69a7208ccd2dc816de85c9fb1bba3bf493e1e3ec" + }, + "vmlinux": { + "sha256": "aeeb8fd775f7b3d149e0ad6534c4ada162556e4c5c3d171808b9a1cbd93266cf" + } + }, + + "patches": { + "zlinux": [ + "zImage-001-918p-42218-ramdisk-and-flag-NOP.bsp" + ], + "ramdisk": [ + "@@@COMMON@@@/ramdisk-001-disable-root-pwd.patch", + "@@@COMMON@@@/ramdisk-002-init-script-NEW-name.patch", + "@@@COMMON@@@/ramdisk-003-post-init-script-UPPER.patch" + ] + }, + + "synoinfo": { + "maxdisks": "16", + "internalportcfg": "0xffff", + "esataportcfg": "0x0", + "HddHotplug": "", + "support_led_brightness_adjustment": "", + "support_leds_lp3943": "", + "buzzeroffen": "0xffff", + "rss_server": "http://example.com/null.xml", + "rss_server_ssl": "https://example.com/null.xml", + "small_info_path": "https://example.com/null", + "updateurl": "http://example.com/", + "myds_region_api_base_url": "https://example.com" + }, + + "grub": { + "template": "@@@COMMON@@@/grub-template.conf", + "base_cmdline": { + "sn": "", + "vid": "0x46f4", + "pid": "0x0001", + "mac1": "", + "netif_num": 1, + + "syno_hw_version": "DS918+", + "syno_hdd_powerup_seq": 1, + "HddHotplug": 0, + "vender_format_version": 2, + "console": "ttyS0,115200n8", + "withefi": null, + "elevator": "elevator", + "syno_port_thaw": 1, + "syno_hdd_detect": 0, + "root": "/dev/md0", + "earlycon": "uart8250,io,0x3f8,115200n8" + }, + + "menu_entries": { + "RedPill DS918+ v7.0.1-42218 (USB, Verbose)": { + "options": [ + "savedefault", + "set root=(hd0,msdos1)", + "echo Loading Linux...", + "linux /zImage @@@CMDLINE@@@", + "echo Loading initramfs...", + "initrd /rd.gz /custom.gz", + "echo Starting kernel with USB boot" + ], + "cmdline": { + "earlyprintk": null, + "loglevel": 15, + "log_buf_len": "32M" + } + }, + "RedPill DS918+ v7.0.1-42218 (SATA, Verbose)": { + "options": [ + "savedefault", + "set root=(hd0,msdos1)", + "echo Loading Linux...", + "linux /zImage @@@CMDLINE@@@", + "echo Loading initramfs...", + "initrd /rd.gz /custom.gz", + "echo Starting kernel with SATA boot", + "echo WARNING: SATA boot support on this platform is experimental!" + ], + "cmdline": { + "earlyprintk": null, + "loglevel": 15, + "synoboot_satadom": 2, + "log_buf_len": "32M" + } + } + } + }, + + "extra": { + "compress_rd": false, + "ramdisk_copy": { + "@@@EXT@@@/rp-lkm/redpill-linux-v4.4.180+.ko": "usr/lib/modules/rp.ko", + "@@@COMMON@@@/iosched-trampoline.sh": "usr/sbin/modprobe" + }, + "bootp1_copy": { + "@@@PAT@@@/GRUB_VER": "GRUB_VER", + "@@@COMMON@@@/EFI/boot/SynoBootLoader.conf": "EFI/BOOT/", + "@@@COMMON@@@/EFI/boot/SynoBootLoader.efi": "EFI/BOOT/" + }, + "bootp2_copy": { + "@@@PAT@@@/GRUB_VER": "GRUB_VER", + "@@@COMMON@@@/EFI": "EFI", + "@@@PAT@@@/grub_cksum.syno": "grub_cksum.syno", + "@@@PAT@@@/rd.gz": "rd.gz", + "@@@PAT@@@/zImage": "zImage" + } + } +} diff --git a/config/DS918+/7.0.1-42218/zImage-001-918p-42218-ramdisk-and-flag-NOP.bsp b/config/DS918+/7.0.1-42218/zImage-001-918p-42218-ramdisk-and-flag-NOP.bsp new file mode 100644 index 000000000..8a585b070 Binary files /dev/null and b/config/DS918+/7.0.1-42218/zImage-001-918p-42218-ramdisk-and-flag-NOP.bsp differ diff --git a/config/_common/grub-template.conf b/config/_common/grub-template.conf index 16f6716bf..8bb816fef 100644 --- a/config/_common/grub-template.conf +++ b/config/_common/grub-template.conf @@ -44,5 +44,17 @@ insmod gzio set gfxmode=auto insmod vbe insmod vga +# UEFI +insmod efi_gop +insmod efi_uga + +insmod font +if loadfont ${prefix}/unicode.pf2 +then + insmod gfxterm + set gfxmode=auto + set gfxpayload=keep + terminal_output gfxterm +fi @@@MENU_ENTRIES@@@ diff --git a/ext/boot-image-template.img.gz b/ext/boot-image-template.img.gz index 0be47050e..fc82598dd 100644 Binary files a/ext/boot-image-template.img.gz and b/ext/boot-image-template.img.gz differ diff --git a/ext/build-template-image.txt b/ext/build-template-image.txt index 4beba4744..1eeaccbc1 100644 --- a/ext/build-template-image.txt +++ b/ext/build-template-image.txt @@ -29,6 +29,14 @@ The following settings were detected by ./configure for the binary release: With stack smashing protector: No ******************************************************* +mkdir build-pc && cd build-pc +../configure --prefix=$PWD/usr -sbindir=$PWD/sbin --sysconfdir=$PWD/etc --disable-werror +make && make install +cd .. +mkdir build && cd build +../configure --prefix=$PWD/usr -sbindir=$PWD/sbin --sysconfdir=$PWD/etc --disable-werror --with-platform=efi --target=x86_64 +make && make install + ######################################################################################################################## ### Create the image ######################################################################################################################## @@ -83,8 +91,13 @@ mount /dev/loop8p1 ./temp-mount-p1 --root-directory=$PWD/temp-mount-p1 \ /dev/loop8 # small note: --root-directory MUST be an absolute path (or it will create it in /) +./grub-2.06/build/grub-install \ + --target=x86_64-efi \ + --efi-directory=$PWD/temp-mount-p1 \ + --removable --no-nvram -s --no-bootsector --boot-directory=$PWD/temp-mount-p1/boot sync umount /dev/loop8p1 +losetup -d /dev/loop8 ######################################################################################################################## ### Pack image