OpenWrt support on rt2600ac (synology) 2021

alright, if it's too late we can continue on a later time :slight_smile:

Do I need to prep an USB key with a specific image on it ?

commands executed:

(IPQ) # setenv wrtgo 'usb start; ext2load usb 0:1 $kload $wrtkernelusb; run wrtbootarg; bootm $kload'
(IPQ) # printenv
Unknown command 'printenv' - try 'help'
(IPQ) # setenv wrtbootarg 'setenv bootargs console=ttyMSM0,115200n8 init=/sbin/init root=/dev/sda2 rootwait'
(IPQ) # bootcmd=run wrtgo
Unknown command 'bootcmd=run' - try 'help'
(IPQ) # setenv bootcmd 'run wrtgo'
(IPQ) #

kernel and rootfs.tar.gz

hmmmm wonder why printenv does not work... did I forget the command.... maybe use 'help' to check...

changed that bit... re-entering again is ok... we are not saving so...

My mistake, I tried the arrow up key as I'm used to SSH :wink: and it got inserted into the serial console command :slight_smile:
I'm prepping a usb key onto my debian box now, but I have to be honest I've never done this before from commandline. How do you prep the usbkey from commandline so it boots? :blush:

NAME                  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                     8:0    1  14.9G  0 disk
├─sda1                  8:1    1   300M  0 part
└─sda2                  8:2    1   900M  0 part
1 Like

your second partition is too small (3Mb) make the first one 300M or something... (i see your not root above... most of the commands below will need sudo then if you need them)

usb-stick-sample-prep

fdisk /dev/sdX
n
p
[enter]
[enter]
300M
[enter]
t
83
[enter]

n
p
[enter]
[enter]
900M
[enter]
t
83
[enter]

w

mkfs.ext2 /dev/sdX1
mkfs.ext4 /dev/sdX2

mkdir $HOME/p1; mount /dev/sdX1 $HOME/p1
mkdir $HOME/p2; mount /dev/sdX2 $HOME/p2

cp kernel $HOME/p1/
cp rootfs.tar.gz $HOME/p2/; (cd $HOME/p2; tar -xvzf rootfs.tar.gz)
sync

umount $HOME/p1
umount $HOME/p2

(p.s. i have automated scripts for all this stuff... but it's good to learn at least for the first time)

You missed some enters and sometimes a partition number but lol, that's impressive just by heart :smiley:

**:~/p1# ls -l
total 4125
-rw-r--r-- 1 root root 4194304 Jul  5 22:20 kernel
drwx------ 2 root root   12288 Jul  5 22:18 lost+found

***:~/p2# ls -l
total 30256
drwxr-xr-x  7 root root    12288 Aug 29  2020 bin
drwxr-xr-x  2 root root     4096 Aug 29  2020 dev
drwxr-xr-x 32 root root     4096 Aug 29  2020 etc
drwxr-xr-x  2 root root     4096 Aug 29  2020 files
-rwxr-xr-x  1 root root       78 Aug 29  2020 init
drwxr-xr-x 11 root root     4096 Aug 29  2020 lib
drwx------  2 root root    16384 Jul  5 22:19 lost+found
drwxr-xr-x  2 root root     4096 Aug 29  2020 mnt
drwxr-xr-x  2 root root     4096 Aug 29  2020 overlay
drwxr-xr-x  2 root root     4096 Aug 29  2020 proc
drwxr-xr-x  2 root root     4096 Aug 29  2020 rom
drwxr-xr-x  3 root root     4096 Aug 29  2020 root
-rw-r--r--  1 root root 30886363 Jul  5 22:20 rootfs.tar.gz
drwxr-xr-x  2 root root     4096 Aug 29  2020 sbin
drwxr-xr-x  2 root root     4096 Aug 29  2020 sys
-rw-r--r--  1 root root      340 Aug 29  2020 systeminfo.compile.txt
drwxrwxrwt  2 root root     4096 Aug 29  2020 tmp
drwxr-xr-x  7 root root     4096 Aug 29  2020 usr
lrwxrwxrwx  1 root root        3 Aug 29  2020 var -> tmp
drwxr-xr-x  4 root root     4096 Aug 29  2020 www
1 Like
blkid | grep sdX

need to see filesystem type

looks good...

Ok, stupid question, front blue or back USB port on the RT2600AC ? :smiley:

good question... the rear one... blue one is a bit odd...(for booting)

Ok it's in, how do I boot it?

run bootcmd

(IPQ) # run bootcmd
(Re)start USB...
USB0:   Register 2000240 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
USB1:   Register 2000240 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 1 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
** No boot file defined **
Wrong Image Format for bootm command
ERROR: can't get kernel image!

Strong advice, create a rt2600ac device profile/ dts as early as possible, while you're still in the no-changes-to-the-flash phase - there are things in the nbg6817 profile (dual-firmware/ sysupgrade support in particular) that would be actively harmful (clobbering spi-nor partitions) on a different device.

need to see printenv... try help...

you didn't re-enter this line after I changed it;

wrtgo=usb start; ext2load usb 0:1 $kload $wrtkernelusb; run wrtbootarg; bootm $kload
setenv wrtgo 'usb start; ext2load usb 0:1 $kload kernel; run wrtbootarg; bootm $kload'

Good catch, it's booting now.

1 Like

sysupgrade has usb support... so if I build a new image i'll post it that one is a few months old...

Okay, next step? :stuck_out_tongue:

Edit: and seriously thanks for learning me all this. I really love to tinker around with these things.

1 Like

your done... due to it being late and whatnot my brains not in a good state to look at code in detail but the root=/dev/sda2 did not get passed from uboot 'run wrtbootarg'

Kernel command line: rootfstype=squashfs,ext4 rootwait noinitrd

you can manually try setting what is in there into 'bootargs' or see if you can find the problem...

otherwise may have to wait till tommorrow till my brain has healed... just dont type 'saveenv' !!!
(every time you power off the router you have to enter all the uboot commands again... pita... but this was a rush job so it's for the best)

and to be honest... synology locking down their .pat files just motivates me to open-up/defeat their combobulated shiz-nizzle...

We'll look into it on a later time as it's getting quite late here too :wink: and it's a little bit too advanced for me to figure out myself. Thanks and have a great sleep.

1 Like
setenv bootargs 'console=ttyMSM0,115200n8 init=/sbin/init root=/dev/sda2 rootwait'
setenv wrtgo 'usb start; ext2load usb 0:1 $kload kernel; bootm $kload'
run wrtgo

1 Like

Ran it, don't see an immediate difference. I've PM'd the output.

1 Like