Jump to content
XPEnology Community

Yet Another Jun's Mod


Recommended Posts

4 hours ago, jumkey said:

I could try patching nvme, but it won't necessarily work. I need some information, can you provide it?
shell
ls /sys/block/*/device/syno_block_info
cat /sys/block/*/device/syno_block_info

 

 i5-8500t, B360 itx , nvme cache*2

=> ds2422+ 

 

Quote

root@jumkey-ds2422:~#
root@jumkey-ds2422:~#
root@jumkey-ds2422:~#
root@jumkey-ds2422:~#
root@jumkey-ds2422:~# ls /sys/block/*/device/syno_block_info
/sys/block/nvme0n1/device/syno_block_info
/sys/block/nvme1n1/device/syno_block_info
/sys/block/sata1/device/syno_block_info
/sys/block/synoboot/device/syno_block_info
root@jumkey-ds2422:~#
root@jumkey-ds2422:~#
root@jumkey-ds2422:~#
root@jumkey-ds2422:~# cat /sys/block/*/device/syno_block_info
pciepath=00:1b.0,00.0
pciepath=00:1d.0,00.0
pciepath=00:17.0
ata_port_no=5
driver=ahci
root@jumkey-ds2422:~#
root@jumkey-ds2422:~#
root@jumkey-ds2422:~#
root@jumkey-ds2422:~#
 

 

Link to comment
Share on other sites

Admittedly I am a little lost and confused by this patch... If I am understanding right, it will help auto populate hdd positions (slots) when building ds920 and ds1621 loaders?

so there will be no need for users to manually map drive positions or slots first? if I am right, does it do this each boot? or once the loader is created its maps all available ports so hot swap hdd will still work? or am I completely wrong?

Link to comment
Share on other sites

15 minutes ago, phone guy said:

Admittedly I am a little lost and confused by this patch... If I am understanding right, it will help auto populate hdd positions (slots) when building ds920 and ds1621 loaders?

so there will be no need for users to manually map drive positions or slots first? if I am right, does it do this each boot? or once the loader is created its maps all available ports so hot swap hdd will still work? or am I completely wrong?

你的理解是对的。有一点我想要说清楚,它不会填充所有硬盘,只会填充型号所支持的最大内置硬盘个数(比如ds920p只会填充4个内置硬盘)。热拔插不会导致pcie地址改变,所以跟dtb没有直接关系

Your understanding is correct.  One thing I want to make clear, it will not fill all the hard drives, it will only fill the maximum number of internal hard drives supported by the model (eg ds920p will only fill 4 internal hard drives)

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, jumkey said:

你的理解是对的。有一点我想要说清楚,它不会填充所有硬盘,只会填充型号所支持的最大内置硬盘个数(比如ds920p只会填充4个内置硬盘)。热拔插不会导致pcie地址改变,所以跟dtb没有直接关系

Your understanding is correct.  One thing I want to make clear, it will not fill all the hard drives, it will only fill the maximum number of internal hard drives supported by the model (eg ds920p will only fill 4 internal hard drives)

 

你好。

Hello. jumkey :)

I always thanksfull to you.

I understand your opinion. "Not all hard drive fill".

but, If I want to fill more hard drive at DS920P, how can I do ?

I was try to find .dts file or other way, but I can't.

I wonder why did you fill only maximum number of supported by model.

and.... Would you let me know how can I fill more hard drive ? automatically or manually.. anyway..

 

Link to comment
Share on other sites

1 hour ago, keerar said:

I wonder why did you fill only maximum number of supported by model.

 

As a general solution, minimize unknown problems
You can try adding the internal port yourself

https://github.com/jumkey/redpill-load/blob/develop/redpill-dtb/releases/install_rd.sh#:~:text=./dtc -I dtb -O dts -o output.dts /etc.defaults/model.dtb

Link to comment
Share on other sites

9 hours ago, dolbycat said:

 

 i5-8500t, B360 itx , nvme cache*2

=> ds2422+ 

 

 

I added nvme support on the test branch,but ds2422p does not support
Can you help test it?

./ext-manager.sh add https://github.com/jumkey/redpill-load/raw/test/redpill-dtb/rpext-index.json

 

Link to comment
Share on other sites

4 hours ago, jumkey said:

I added nvme support on the test branch,but ds2422p does not support
Can you help test it?

./ext-manager.sh add https://github.com/jumkey/redpill-load/raw/test/redpill-dtb/rpext-index.json

 

 

nvme.thumb.jpg.8419a08b9c320f1d4b55828cbc73f1a1.jpg

 

Wow, that's successful.
Both nvme were recognized correctly.

 

At first

when I tested with 1 hdd and 2 nvme, it was recognized and worked well.

 

after turning off the power, I added one HDD.
It recognized 2 hdd and 2 nvme still recognized well.

  • Thanks 1
Link to comment
Share on other sites

In @pocopico's 0.4.6 img for legacy, the first partition is increased from 48mb to 96mb to secure space for the dtc utility to be copied, and it is an image that has been fully upgraded to the latest version 0.7.1.7.
Download it from the Google link below, decompress the gz and record it on a new USB stick.
And rploader.sh on my Github repo blocks the patchdtc function so that there are no errors like the log above, and also blocks the update of rploader.sh itself.

 

It's for the use of the new dtb util of jumkey

 

[tinycore-redpill.v0.7.1.7.img]

https://drive.google.com/file/d/1Jxr0znrDxkqIhcbFPTyll44VwdvuPBu-/view?usp=sharing

 

tc@box:~$ curl --location "https://github.com/PeterSuh-Q3/tinycore-redpill/raw/main/rploader.sh" --output rploader.sh

 

mkdir /mnt/"$(mount | grep -i optional | grep cde | awk -F / '{print $3}' | uniq | cut -c 1-3)3"/auxfiles; sudo ln -s /mnt/"$(mount | grep -i optional | grep cde | awk -F / '{print $3}' | uniq | cut -c 1-3)3"/auxfiles /home/tc/custom-module;

 

./rploader.sh build geminilake-7.1.0-42661

 

./rploader.sh backup now

 

And

 

Share the tincore-redfill.v0.7.1.7.vmdk file.

For the use of the new dtb util of jumkey

This is a file that increased the first partition from 48MB to 96MB, as shown above in img for legacy.

 

[tinycore-redpill.v0.7.1.7.vmdk]

https://drive.google.com/file/d/1UCOzK1LTjLy3-bD2u5feeGblhqYN5UH_/view?usp=sharing

  • Like 1
Link to comment
Share on other sites

On 5/25/2022 at 10:53 AM, jumkey said:

 

I got a hint from the link above and succeeded in expanding it to a 6-bay HDD.

I used tossp's tool-chainhttps://github.com/tossp/redpill-tool-chain )

 

Put the modified ds920p.dts file for your system in the "redpill-tool-chain-master" folder.

 

 

./redpill_tool_chain.sh build ds920p-7.0.1-42218
./redpill_tool_chain.sh auto ds920p-7.0.1-42218

 

rm -r ./images/*.*
dtc -I dts -O dtb ds920p.dts > model_ds920p.dtb
mv model_ds920p.dtb ./custom/extensions/jumkey.dtb/ds920p_42218

 

./redpill_tool_chain.sh auto ds920p-7.0.1-42218

 

 

 

m.jpg.1bb1e753b2669221969afe5f102c4514.jpg

 

Link to comment
Share on other sites

Spoiler

: Starting syslogd ... [  OK  ]
:: Starting scemd
[  111.276929] pin 45 is protected by driver.
[  112.478001] synobios write 3 to /dev/ttyS1 failed
[  112.478466] synobios write 4 to /dev/ttyS1 failed
[  112.479333] synobios write k to /dev/ttyS1 failed
:: Starting services in background
Starting findhostd in flash_rd...
Starting services in flash_rd...
Running /usr/syno/etc/rc.d/J01httpd.sh...
Starting httpd:80 in flash_rd...
Starting httpd:5000 in flash_rd...
Running /usr/syno/etc/rc.d/J03ssdpd.sh...
[  112.506282] EXT4-fs (md0): couldn't mount as ext3 due to feature incompatibilities
[  112.508897] EXT4-fs (md0): mounted filesystem with ordered data mode. Opts: (null)
/usr/bin/minissdpd -i eth0
(15): upnp:rootdevice
(51): uuid:upnp_SynologyNAS-001c42606561::upnp:rootdevice
(62): Synology/synology_broadwellnk_3622xs+/7.0-42218/192.168.177.34
(47): http://192.168.177.34:5000/description-eth0.xml
Connected.
done.
/usr/syno/bin/reg_ssdp_service 192.168.177.34 001c42606561 7.0-42218 synology_broadwellnk_3622xs+ eth0
Running /usr/syno/etc/rc.d/J04synoagentregisterd.sh...
Starting synoagentregisterd...
Running /usr/syno/etc/rc.d/J30DisableNCQ.sh...
[  112.530546] EXT4-fs (md0): couldn't mount as ext3 due to feature incompatibilities
[  112.532071] EXT4-fs (md0): mounted filesystem with ordered data mode. Opts: (null)
[  112.541870] EXT4-fs (md0): couldn't mount as ext3 due to feature incompatibilities
[  112.543074] EXT4-fs (md0): mounted filesystem with ordered data mode. Opts: (null)
Running /usr/syno/etc/rc.d/J80ADTFanControl.sh...
Running /usr/syno/etc/rc.d/J98nbnsd.sh...
Starting nbnsd...
Running /usr/syno/etc/rc.d/J99avahi.sh...
Starting Avahi mDNS/DNS-SD Daemon
[  112.575656] random: avahi-daemon: uninitialized urandom read (4 bytes read, 96 bits of entropy available)
cname_load_conf failed:/var/tmp/nginx/avahi-aliases.conf
[  112.576777] random: avahi-daemon: uninitialized urandom read (8 bytes read, 96 bits of entropy available)
:: Loading module usb-storage[  112.596171] usb-storage 1-3:1.0: USB Mass Storage device detected
[  112.596307] scsi host1: usb-storage 1-3:1.0
[  112.596405] usbcore: registered new interface driver usb-storage
 ... [  OK  ]
:: Loading module hid ... [  OK  ]
:: Loading module usbhid[  112.609290] usbcore: registered new interface driver usbhid
[  112.609353] usbhid: USB HID core driver
 ... [  OK  ]
Excution Error
============ Date ============
Sun May 29 14:10:00 UTC 2022
==============================
starting pid 7473, tty '': '/sbin/getty 115200 console'

Sun May 29 14:10:00 2022

SynologyNAS login: [  113.599914] I/O scheduler elevator not found
[  113.603289] scsi 1:0:0:0: Direct-Access              APPLE SD Card Re              PQ: 0 ANSI: 4
[  113.603823] sd 1:0:0:0: Attached scsi generic sg1 type 0
[  113.605742] I/O scheduler elevator not found
[  113.609043] sd 1:0:0:0: [sdu] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
[  113.612388] sd 1:0:0:0: [sdu] Write Protect is off
[  113.612452] sd 1:0:0:0: [sdu] Mode Sense: 4f 00 00 08
[  113.613040] sd 1:0:0:0: [sdu] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  113.626993]  sdu: sdu1 sdu2 sdu3
[  113.644268] sd 1:0:0:0: [sdu] Attached SCSI removable disk
[  137.464761] random: nonblocking pool is initialized
[  364.369119] EXT4-fs (md0): couldn't mount as ext3 due to feature incompatibilities
[  364.371245] EXT4-fs (md0): mounted filesystem with ordered data mode. Opts: (null)
[  364.615936] EXT4-fs (md0): couldn't mount as ext3 due to feature incompatibilities
[  364.617277] EXT4-fs (md0): mounted filesystem with ordered data mode. Opts: (null)
[  364.635419] EXT4-fs (md0): couldn't mount as ext3 due to feature incompatibilities

 

Has anyone some ideas what the issue can be?

I tried the installation via: ./rploader.sh build broadwellnk-7.0.1-42218-JUN 

with some external driver (redpill-acpid, e1000 and redpill-misc)

 

When I do installation the normal way via: ./rploader.sh build broadwellnk-7.0.1-42218 everything works fine and I am able to successfully install DSM.

 

Link to comment
Share on other sites

13 hours ago, Dreadnought said:
  serial.txt (Reveal hidden contents)

: Starting syslogd ... [  OK  ]
:: Starting scemd
[  111.276929] pin 45 is protected by driver.
[  112.478001] synobios write 3 to /dev/ttyS1 failed
[  112.478466] synobios write 4 to /dev/ttyS1 failed
[  112.479333] synobios write k to /dev/ttyS1 failed
:: Starting services in background
Starting findhostd in flash_rd...
Starting services in flash_rd...
Running /usr/syno/etc/rc.d/J01httpd.sh...
Starting httpd:80 in flash_rd...
Starting httpd:5000 in flash_rd...
Running /usr/syno/etc/rc.d/J03ssdpd.sh...
[  112.506282] EXT4-fs (md0): couldn't mount as ext3 due to feature incompatibilities
[  112.508897] EXT4-fs (md0): mounted filesystem with ordered data mode. Opts: (null)
/usr/bin/minissdpd -i eth0
(15): upnp:rootdevice
(51): uuid:upnp_SynologyNAS-001c42606561::upnp:rootdevice
(62): Synology/synology_broadwellnk_3622xs+/7.0-42218/192.168.177.34
(47): http://192.168.177.34:5000/description-eth0.xml
Connected.
done.
/usr/syno/bin/reg_ssdp_service 192.168.177.34 001c42606561 7.0-42218 synology_broadwellnk_3622xs+ eth0
Running /usr/syno/etc/rc.d/J04synoagentregisterd.sh...
Starting synoagentregisterd...
Running /usr/syno/etc/rc.d/J30DisableNCQ.sh...
[  112.530546] EXT4-fs (md0): couldn't mount as ext3 due to feature incompatibilities
[  112.532071] EXT4-fs (md0): mounted filesystem with ordered data mode. Opts: (null)
[  112.541870] EXT4-fs (md0): couldn't mount as ext3 due to feature incompatibilities
[  112.543074] EXT4-fs (md0): mounted filesystem with ordered data mode. Opts: (null)
Running /usr/syno/etc/rc.d/J80ADTFanControl.sh...
Running /usr/syno/etc/rc.d/J98nbnsd.sh...
Starting nbnsd...
Running /usr/syno/etc/rc.d/J99avahi.sh...
Starting Avahi mDNS/DNS-SD Daemon
[  112.575656] random: avahi-daemon: uninitialized urandom read (4 bytes read, 96 bits of entropy available)
cname_load_conf failed:/var/tmp/nginx/avahi-aliases.conf
[  112.576777] random: avahi-daemon: uninitialized urandom read (8 bytes read, 96 bits of entropy available)
:: Loading module usb-storage[  112.596171] usb-storage 1-3:1.0: USB Mass Storage device detected
[  112.596307] scsi host1: usb-storage 1-3:1.0
[  112.596405] usbcore: registered new interface driver usb-storage
 ... [  OK  ]
:: Loading module hid ... [  OK  ]
:: Loading module usbhid[  112.609290] usbcore: registered new interface driver usbhid
[  112.609353] usbhid: USB HID core driver
 ... [  OK  ]
Excution Error
============ Date ============
Sun May 29 14:10:00 UTC 2022
==============================
starting pid 7473, tty '': '/sbin/getty 115200 console'

Sun May 29 14:10:00 2022

SynologyNAS login: [  113.599914] I/O scheduler elevator not found
[  113.603289] scsi 1:0:0:0: Direct-Access              APPLE SD Card Re              PQ: 0 ANSI: 4
[  113.603823] sd 1:0:0:0: Attached scsi generic sg1 type 0
[  113.605742] I/O scheduler elevator not found
[  113.609043] sd 1:0:0:0: [sdu] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
[  113.612388] sd 1:0:0:0: [sdu] Write Protect is off
[  113.612452] sd 1:0:0:0: [sdu] Mode Sense: 4f 00 00 08
[  113.613040] sd 1:0:0:0: [sdu] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  113.626993]  sdu: sdu1 sdu2 sdu3
[  113.644268] sd 1:0:0:0: [sdu] Attached SCSI removable disk
[  137.464761] random: nonblocking pool is initialized
[  364.369119] EXT4-fs (md0): couldn't mount as ext3 due to feature incompatibilities
[  364.371245] EXT4-fs (md0): mounted filesystem with ordered data mode. Opts: (null)
[  364.615936] EXT4-fs (md0): couldn't mount as ext3 due to feature incompatibilities
[  364.617277] EXT4-fs (md0): mounted filesystem with ordered data mode. Opts: (null)
[  364.635419] EXT4-fs (md0): couldn't mount as ext3 due to feature incompatibilities

 

Has anyone some ideas what the issue can be?

I tried the installation via: ./rploader.sh build broadwellnk-7.0.1-42218-JUN 

with some external driver (redpill-acpid, e1000 and redpill-misc)

 

When I do installation the normal way via: ./rploader.sh build broadwellnk-7.0.1-42218 everything works fine and I am able to successfully install DSM.

 

According to @dolbycat's test results, you can try https://github.com/tossp/redpill-tool-chain 

Link to comment
Share on other sites

TCRP has already been converted to jumkey's new dtc port auto-dynamic mapping method,
Sometimes this method doesn't work well.

In this case, manually model_ds920p.dtb or model_ds1621p.dtb

You just need to prepare the file to compile.

 

It is good to compile the model_#platform.dtb file directly with dtc,
If even this does not work, edit install_rd.sh as shown below

 

You can also add the dtc compilation command one line in advance.
It is a method that can be applied immediately to a case that has succeeded in the actual test.

 

./my.sh DS1621+ noclean

 

cd redpill-load/custom/extensions/redpill-dtb/ds1621p_42661

 

cp /home/tc/ds1621p.dts .

 

lspci -tvnnq

 

ll /sys/block

 

vi ds1621p.dts

...

        internal_slot@1 {

                protocol_type = "sata";

                led_type = "lp3943";

                ahci {

                        pcie_root = "your device information";

                        ata_port = <0x0 your target port number>;

                };

...

:wq!

 

vi install_rd.sh

#add in line 7

./dtc -q -I dts -O dtb ds1621p.dts > model_ds1621p.dtb

:wq!

 

./my.sh DS1621+ noclean

Edited by Peter Suh
Link to comment
Share on other sites

On 5/22/2022 at 4:52 PM, jumkey said:

walk dts file and replace all /internal_slot@%s/ahci/pcie_root with /sys/block/sata%s/device/syno_block_info->pciepath

/internal_slot@%s/ahci/ata_port from /sys/block/sata%s/device/syno_block_info->ata_port_no

 

main code



package org.cafeboy;

import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.CharStreams;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.ParseTree;
import org.antlr.v4.runtime.tree.ParseTreeWalker;
import org.cafeboy.dts.DTSLexer;
import org.cafeboy.dts.DTSParser;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class App {
    public static void main(String[] args) throws IOException {
        if (args.length < 1 || args.length > 2) {
            System.out.println("Usage: java -jar dts.jar <path to dts file> [output path]");
            System.exit(1);
        }
        String filePath = args[0];

        String outFilePath = args.length > 1 ? args[1] : filePath + ".out";

        CharStream input = CharStreams.fromFileName(filePath);

        DTSLexer lexer = new DTSLexer(input);
        CommonTokenStream tokens = new CommonTokenStream(lexer);
        DTSParser parser = new DTSParser(tokens);
        ParseTree tree = parser.dts();
//        System.out.println(tree.toStringTree(parser));
        ParseTreeWalker walker = new ParseTreeWalker();
        Standardizer sta = new Standardizer(tokens);
        walker.walk(sta, tree);

        try (Stream<Path> list = Files.list(Path.of("/sys/block/"))) {
            String prefix = "/sys/block/sata";
            list.filter(path -> path.toString().startsWith(prefix)).forEach(x -> {
                try {
                    String num = x.toString().substring(prefix.length());
                    List<String> lines = Files.readAllLines(x.resolve("device/syno_block_info"));
                    Map<String, String> map = lines.stream()
                            .map(e -> e.split("="))
                            .collect(Collectors.toMap(e -> e[0], e -> e[1]));
                    map.forEach((k, v) -> System.out.printf("%s = %s%n", k, v));
                    //pciepath=00:12.0
                    //ata_port_no=0
                    //driver=ahci
                    if (map.get("driver").equals("ahci")) {
                        sta.put(String.format("/internal_slot@%s/ahci/pcie_root", num), String.format("\"%s\"", map.get("pciepath")));
                        sta.put(String.format("/internal_slot@%s/ahci/ata_port", num), String.format("<0x%02x>", Integer.parseInt(map.get("ata_port_no"))));
                        System.out.println(x);
                    } else {
                        System.out.println("not ahci");
                    }
                } catch (IOException e) {
                    System.out.printf("update path: %s to dts error: %s%n", x, e.getMessage());
                    System.exit(1);
                }
            });
            Files.write(Path.of(outFilePath), sta.rewriter.getText().getBytes());
        } catch (IOException e) {
            System.out.println("update dts error:" + e.getMessage());
            System.exit(1);
        }
    }
}

 

 

@jumkey you probably want to adjust the code to include usb port identification for USB loader to match the connected USB port number, otherwise the loader will not be found and the install will fail at 55% with corrupt file error.

 

 

Edited by pocopico
Link to comment
Share on other sites

5 minutes ago, pocopico said:

 

@jumkey you probably want to adjust the code to include usb port identification for USB loader to match the connected USB port number, otherwise the loader will not be found and the install will fail at 55% with corrupt file error.

 

 

dts includes usb2 and usb3 and I'm not sure how to patch it.
There is a doubt that when the loader is successfully loaded, they will recognize it as /dev/synoboot instead of /dev/usb1

  • Like 1
Link to comment
Share on other sites

44 minutes ago, jumkey said:

dts includes usb2 and usb3 and I'm not sure how to patch it.
There is a doubt that when the loader is successfully loaded, they will recognize it as /dev/synoboot instead of /dev/usb1

 

This is the script that finds the USB port in rploader.sh of pocopico.

Can't we just convert this part to c?

It seems to find the port after matching the information in lsusb by referring to the vid / pid value in user_config.json that is already set.

I made and operated patchusb.sh from the excerpt of only this part, and it worked well.

 

#!/bin/bash

 

TARGET_PLATFORM="$1"

 

    usbpid=$(cat user_config.json | jq '.extra_cmdline .pid' | sed -e 's/"//g' | sed -e 's/0x//g')
    usbvid=$(cat user_config.json | jq '.extra_cmdline .vid' | sed -e 's/"//g' | sed -e 's/0x//g')

    loaderusb=$(lsusb | grep "${usbvid}:${usbpid}" | awk '{print $2 "-"  $4 }' | sed -e 's/://g' | sed -s 's/00//g')

    if [ "${TARGET_PLATFORM}" = "v1000" ]; then
        dtbfile="ds1621p"
    elif [ "${TARGET_PLATFORM}" = "geminilake" ]; then
        dtbfile="ds920p"
    else
        echo "${TARGET_PLATFORM} does not require model.dtc patching "
        return
    fi

    if
        [ ! -z $loaderusb ] && [ -n $loaderusb ]
    then
        echo "Patching USB to include your loader. Loader found in ${loaderusb} port"
        sed -i "/usb_slot\@1 {/!b;n;n;n;n;n;n;n;cusb_port = \"${loaderusb}\";" ${dtbfile}.dts
    else
        echo "Your loader is not in USB, i will not try to patch dtb for USB"
    fi

 

 

 

ds1621.dts

[BEFORE]

 

        usb_slot@1 {

                vbus {
                        syno_gpio = <0x2a 0x1>;
                };

                usb2 {
                        usb_port = "1-2";
                };

                usb3 {
                        usb_port = "2-2";
                };
        };

 

tc@box:~$ ./patchusb.sh v1000
Protocol spec without prior Class and Subclass spec at line 23281
Patching USB to include your loader. Loader found in 3-3 port

 

[AFTER]

 

        usb_slot@1 {

                vbus {
                        syno_gpio = <0x2a 0x1>;
                };

                usb2 {
usb_port = "3-3";
                };

                usb3 {
                        usb_port = "2-2";
                };
        };

Edited by Peter Suh
Link to comment
Share on other sites

54 minutes ago, Peter Suh said:

 

This is the script that finds the USB port in rploader.sh of pocopico.

Can't we just convert this part to c?

It seems to find the port after matching the information in lsusb by referring to the vid / pid value in user_config.json that is already set.

I made and operated patchusb.sh from the excerpt of only this part, and it worked well.

 

#!/bin/bash

 

TARGET_PLATFORM="$1"

 

    usbpid=$(cat user_config.json | jq '.extra_cmdline .pid' | sed -e 's/"//g' | sed -e 's/0x//g')
    usbvid=$(cat user_config.json | jq '.extra_cmdline .vid' | sed -e 's/"//g' | sed -e 's/0x//g')

    loaderusb=$(lsusb | grep "${usbvid}:${usbpid}" | awk '{print $2 "-"  $4 }' | sed -e 's/://g' | sed -s 's/00//g')

    if [ "${TARGET_PLATFORM}" = "v1000" ]; then
        dtbfile="ds1621p"
    elif [ "${TARGET_PLATFORM}" = "geminilake" ]; then
        dtbfile="ds920p"
    else
        echo "${TARGET_PLATFORM} does not require model.dtc patching "
        return
    fi

    if
        [ ! -z $loaderusb ] && [ -n $loaderusb ]
    then
        echo "Patching USB to include your loader. Loader found in ${loaderusb} port"
        sed -i "/usb_slot\@1 {/!b;n;n;n;n;n;n;n;cusb_port = \"${loaderusb}\";" ${dtbfile}.dts
    else
        echo "Your loader is not in USB, i will not try to patch dtb for USB"
    fi

 

 

 

ds1621.dts

[BEFORE]

 

        usb_slot@1 {

                vbus {
                        syno_gpio = <0x2a 0x1>;
                };

                usb2 {
                        usb_port = "1-2";
                };

                usb3 {
                        usb_port = "2-2";
                };
        };

 

tc@box:~$ ./patchusb.sh v1000
Protocol spec without prior Class and Subclass spec at line 23281
Patching USB to include your loader. Loader found in 3-3 port

 

[AFTER]

 

        usb_slot@1 {

                vbus {
                        syno_gpio = <0x2a 0x1>;
                };

                usb2 {
usb_port = "3-3";
                };

                usb3 {
                        usb_port = "2-2";
                };
        };

I have tested almost all models myself on pve, and it turns out that there is no need to patch the usb port of the loader
@dolbycat also tested bare metal installation

 

I'm thinking about trying to use quickjs to implement it, maybe it can reduce the size of ext, low-level language is too difficult for me

  • Like 2
Link to comment
Share on other sites

1 hour ago, jumkey said:

I have tested almost all models myself on pve, and it turns out that there is no need to patch the usb port of the loader
@dolbycat also tested bare metal installation

 

I'm thinking about trying to use quickjs to implement it, maybe it can reduce the size of ext, low-level language is too difficult for me

 

Super ! checking also :D 

 

EDIT : quickjs,  looks that it also creates a large executable. Since junior has most of the required c++ libraries included i think its a better choice. I will give i a try. 

Edited by pocopico
  • Like 2
Link to comment
Share on other sites

Because pocopico's redpill-dtb ext is changed to redpill-dtb-static ext
In TCRP, the dynamic and automatic dtc patch of jumkey was disabled, so the function was branched so that it can be used as a separate option.

 

To update a new function, follow the steps below.

 

./my.sh

 

If you want to use jumkey's dynamic and automatic dtc patch, you can build it with the options below and use it.

 

./my.sh DS920+ jumkey

 

----------------------------------------------------------------------------------------
Usage: ./my.sh <Synology Model Name> <Options>

Options: jumkey, noconfig, noclean, manual

- jumkey  : Option to apply jumkey's dynamic automatic dtc patch extension files (contrary to pocopico's static dtc patch).  

- noconfig: SKIP automatic detection change processing such as SN/Mac/Vid/Pid/SataPortMap of user_config.json file.

- noclean: SKIP the 💊   RedPill LKM/LOAD directory without clearing it with the Clean now command. 
           However, delete the Cache directory and loader.img.

- manual: Options for manual extension processing and manual dtc processing in build action (skipping extension auto detection)

Please type Synology Model Name after ./my.sh

./my.sh DS918+
./my.sh DS3617xs
./my.sh DS3615xs
./my.sh DS3622xs+
./my.sh DVA3221
./my.sh DS920+
./my.sh DS1621+

- for jun mode

./my.sh DS918+J                                                                                                      
./my.sh DS3617xsJ                                                                                                    
./my.sh DS3615xsJ                                                                                                    
./my.sh DS3622xs+J                                                                                                   
./my.sh DVA3221J                                                                                                     
./my.sh DS920+J                                                                                                      
./my.sh DS1621+J  

Edited by Peter Suh
  • Thanks 1
Link to comment
Share on other sites

Refactored redpill-dtb using js, the file size is around 600K

Quote

 

./ext-manager.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-runtime-qjs/rpext-index.json

./ext-manager.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-qjs-dtb/rpext-index.json

 

 

 

Package redpill-runtime-qjs separately for use by other extensions
How to use:

String ascii sorting of extended id needs to be greater than jumkey.qjs.000

Then

Quote

qjs --std my.js

 

  • Like 4
Link to comment
Share on other sites

Hello everyone, I was away for a while and tried again yesterday to build an image on my bare metal computer.
When I build a loader with Tinycore ./rploader.sh build broadwellnk-7.0.1-42218 everything works fine, but I build a loader with ./rploader.sh build broadwellnk-7.0.1-42218-JUNE aborts the installation of the *pat file at 56% and says it is corrupt!
The same Situation happens when I build the loader with ./my.sh DS3622xs+J -June.

What am I doing wrong or how do you create the loader correctly so that it works?

Link to comment
Share on other sites

I try to build ds920p 7.0.1-42281 with redpill tool chain but I get this error

 

[#] Verifying /opt/redpill-load/cache/ds920p_42218.pat file...

[ERR] [!] Checksum mismatch - expected 73053911bd118b432d5a2036dc62d518eed83b78b32c1eb23696d59725a14892 but computed fe2a4648f76adeb65c3230632503ea36bbac64ee88b459eb9bfb5f3b8c8cebb3

 

Can anyone help me?

Link to comment
Share on other sites

How to build "Jumkey-Redpill" using NAS.

 

1.jpg.f5e7a71b35c6b29cc0139b09b5bfff67.jpg

 

First of all, you need "Docker", so install it.

 

Unzip the attached file "redpill-tool-chain-master.zip" and modify "ds918p_user_config.json" for your system.

Copy "redpill-tool-chain-master" folder to your NAS and connect to nas using "Putty".


sudo su -
( Go to the "redpill-tool-chain-master" folder )

 

./redpill_tool_chain.sh add https://raw.githubusercontent.com/jumkey/redpill-load/develop/redpill-misc/rpext-index.json

./redpill_tool_chain.sh build ds918p-7.0.1-42218
./redpill_tool_chain.sh auto ds918p-7.0.1-42218

 

You can find the "boot loader file" in the "image" folder.

 

* I am posting at the request of a member.

redpill-tool-chain-master.zip

  • Like 2
Link to comment
Share on other sites

7 minutes ago, dolbycat said:

How to build "Jumkey-Redpill" using NAS.

 

1.jpg.f5e7a71b35c6b29cc0139b09b5bfff67.jpg

 

First of all, you need "Docker", so install it.

 

Unzip the attached file "redpill-tool-chain-master.zip" and modify "ds918p_user_config.json" for your system.

Copy "redpill-tool-chain-master" folder to your NAS and connect to nas using "Putty".


sudo su -
( Go to the "redpill-tool-chain-master" folder )

 

./redpill_tool_chain.sh add https://raw.githubusercontent.com/jumkey/redpill-load/develop/redpill-misc/rpext-index.json

./redpill_tool_chain.sh build ds918p-7.0.1-42218
./redpill_tool_chain.sh auto ds918p-7.0.1-42218

 

You can find the "boot loader file" in the "image" folder.

 

* I am posting at the request of a member.

redpill-tool-chain-master.zip 33.29 kB · 2 downloads

will this also work with 3622 ??

 

./redpill_tool_chain.sh add https://raw.githubusercontent.com/jumkey/redpill-load/develop/redpill-misc/rpext-index.json

./redpill_tool_chain.sh build ds3622p-7.0.1-42218
./redpill_tool_chain.sh auto ds3622p-7.0.1-42218

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...