I have been trying to build and customise Alt-F RC4.1 for DNS-320L rev A? & DNS-320 rev B2.
This topic has been opened so I can ask questions, make suggestions, etc.
Still trying to understand how all the svn/buildroot/make/etc work.
First suggested change (only effects developers). New builds can be loaded for testing using a serial console to control u-boot and telling it to download the kernel and rootfs images from a TFTP server. But it seemed a pity that after the kernel booted it still copied an older sqimage from the nand. So I tried to change the actions during init to also download the new sqimage from the same TFTP server. Patches for /etc/init.d/rcS and mkfw.sh attached, also console boot log attached (contains u-boot commands used).
I changed mkfw.sh to:-
Check for tftpboot folder at two "standard" linux tftp server locations, and to not error if none found.
Copy all three image files.
Ensure image files are world readable (required by tftp daemon).
I changed rcS to:-
Check for required tftp parameters in command line tag in /proc/atags.
If all tftp parameters are found it uses them to create a temporary network connection, and do the tftp download, header first (to check sqimage size) then rest of file, in a similar way to the nand code.
Also added a few logger calls.
If anything fails it uses the image from nand as normal.
For non-testing use it just checks /proc/atags, finds nothing interesting and continues normally.
Also needs tftp applet to be enabled in busybox build, I managed to do this, but I think I used a wrong method, it did not produce any change to any svn managed file.
make menuconfig # to configure the build, uses/writes to ./configmake linux26-menuconfig # to fine configure linux, uses/writes $KERNEL/.configmake busybox-menuconfig # to fine configure busybox, uses/writes $BLDDIR/build_arm/busybox-1.20.2/.configmake uclibc-menuconfig # to fine configure uclibc, uses/writes $UCLIBC/.config
What is correct command to reconfigure the busybox config?
The command line fom u-boot seems to be ignored by the kernel, because it is built with CMDLINE_FORCE option.
So /proc/cmdline just shows the kernel's compiled in default. Also attached dump of /proc/atags, I think the kernel also changed the tags (that is why there is a gap in the middle), but did not completely clear the buffer, so seems to have left the tag containing u-boot's command line in the end of the buffer. It works, but not nice to rely on a kernel oddity.
# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not setCONFIG_CMDLINE="console=ttyS0,115200 root=/dev/ram0 init=/init"# CONFIG_CMDLINE_FROM_BOOTLOADER is not set# CONFIG_CMDLINE_EXTEND is not setCONFIG_CMDLINE_FORCE=y# CONFIG_MTD_CMDLINE_PARTS is not set
I would have tried to pass the tftp information from u-boot in a u-boot environment setting, but haven't got fw_printenv/fw_setenv utility to read them from linux.
How do you tell the make system to build this u-boot utility and include it in the root fs?
Hope you like this suggestion, I thought testing would be easier if changes to all three image files could be tested without nand flashing.
I purchased a DNS-320L rev A3 (seemed worth a couple of pounds extra for more ram) and fitted headphone socket to serial console..
Found another tiny difference, DNS-320 is all black, DNS-320L has silver band for switches/leds (blank band for DNS-320LW).
altf=setenv bootargs console=ttyS0,115200 root=/dev/ram0 init=/init; setenv ipaddr 192.168.1.100; setenv serverip 192.168.1.1; tftp 0xa00000 uImage; tftp 0xf00000 urootfs; bootm 0xa00000 0xf00000
[root@dns-320l]# hexdump -Cv /proc/atags00000000 05 00 00 00 01 00 41 54 00 00 00 00 00 00 00 00 |......AT........|00000010 00 00 00 00 04 00 00 00 02 00 41 54 00 00 00 10 |..........AT....|00000020 00 00 00 00 04 00 00 00 02 00 41 54 00 00 00 00 |..........AT....|00000030 00 00 00 00 04 00 00 00 02 00 41 54 00 00 00 00 |..........AT....|00000040 00 00 00 00 04 00 00 00 02 00 41 54 00 00 00 00 |..........AT....|00000050 00 00 00 00 0e 00 00 00 09 00 41 54 63 6f 6e 73 |..........ATcons|00000060 6f 6c 65 3d 74 74 79 53 30 2c 31 31 35 32 30 30 |ole=ttyS0,115200|00000070 20 72 6f 6f 74 3d 2f 64 65 76 2f 72 61 6d 30 20 | root=/dev/ram0 |00000080 69 6e 69 74 3d 2f 69 6e 69 74 00 30 04 00 00 00 |init=/init.0....|00000090 05 00 42 54 40 00 f0 00 00 50 2c 00 0f 00 00 00 |..BT@....P,.....|000000a0 03 04 00 41 0e 00 06 03 ab 21 ef 09 00 84 d7 17 |...A.....!......|000000b0 a9 c2 51 10 00 50 43 00 02 02 00 00 00 00 00 00 |..Q..PC.........|000000c0 00 00 00 00 00 00 00 00 00 00 00 00 dc 05 00 00 |................|000000d0 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 |................|000000e0
I would simplify the code a bit, mainly for space saving reasons. For the same reason I have to see how much does busybox size increases due to the tftp additions. This is an issue for the 323, which has only 8MB of flash and where every byte counts. literally!
make menuconfig # to configure the build, uses/writes to ./configmake linux26-menuconfig # to fine configure linux, uses/writes $KERNEL/.configmake busybox-menuconfig # to fine configure busybox, uses/writes $BLDDIR/build_arm/busybox-1.20.2/.configmake uclibc-menuconfig # to fine configure uclibc, uses/writes $UCLIBC/.config
Changes will go to the build directory, not under svn control, you have to copy then to local/<board> or use 'saveconfig'. When changing boards, sourcing 'exports' for a different board, it will be checked if modification were made and 'exports' will refuse to make changes.
The ./config file controls where to retrieve the uclibc, kernel and busybox config files, as some are shared for the different boards while others specific to a particular board, ./local/<board>
There was a time where a kernel patch was applied that allowed to append (prepend?) args to the default kernel command line, but for some reason I have dropped that. You can still see traces of that in /init (it needs to be cleaned up). It would be better to resurrect that (for all boards) instead of using atags.On the 321/323 (orion SoC), I use kexec to load a new kernel/rootfs instead of using tftp, but for some reason I was not able to make kexec work on the 320/325 (kirkwood Soc) -- that is something I would like to see fixed.
And hasn't the 320 a better case/disk-slots also? I find the 320L very "cheap" in this respect.Also I *hate* the 320L thermal design -- bad design, in my opinion, as no place for natural/convection cooling takes place, as the fan opening is not located at box top. By comparison with the 323/325 with the same disks, the 320L fan turns on/off much more frequently, and the disks get hotter.
My atags don't show any sign of u-boot environment variables except 'bootargs':
I have a u-boot cmd script saved in the u-boot environment, so I only need to type 'run alt' each time:altf=setenv bootargs console=ttyS0,115200 root=/dev/ram0 init=/init; setenv ipaddr 192.168.1.100; setenv serverip 192.168.1.1; tftp 0xa00000 uImage; tftp 0xf00000 urootfs; bootm 0xa00000 0xf00000
The command line fom u-boot seems to be ignored by the kernel, because it is built with CMDLINE_FORCE option. So /proc/cmdline just shows the kernel's compiled in default. Also attached dump of /proc/atags, I think the kernel also changed the tags (that is why there is a gap in the middle), but did not completely clear the buffer, so seems to have left the tag containing u-boot's command line in the end of the buffer. It works, but not nice to rely on a kernel oddity.
On Monday, 19 January 2015 03:02:37 UTC, Andrew G wrote:The command line fom u-boot seems to be ignored by the kernel, because it is built with CMDLINE_FORCE option. So /proc/cmdline just shows the kernel's compiled in default. Also attached dump of /proc/atags, I think the kernel also changed the tags (that is why there is a gap in the middle), but did not completely clear the buffer, so seems to have left the tag containing u-boot's command line in the end of the buffer. It works, but not nice to rely on a kernel oddity.
Correction: I misinterpreted the "od" command output, what I thought was a gap (of zeros) in the middle of /proc/atags was actually repeats of previous line, should have included -v option for "od". With that now understood, it looks all the structure of all the atag data is valid and that the kernel has NOT changed anything.
jcard@flash:~/alt-f> grep CMDLINE local/pkgs/linux-3.10.32.config
CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/ram0 init=/init"# CONFIG_CMDLINE_FROM_BOOTLOADER is not set
CONFIG_CMDLINE_EXTEND=y # DNS-321/323# CONFIG_CMDLINE_FORCE is not set
# CONFIG_MTD_CMDLINE_PARTS is not set
jcard@flash:~/alt-f> grep CMDLINE local/dns325/linux-3.10.32.configCONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not setCONFIG_CMDLINE="console=ttyS0,115200 root=/dev/ram0 init=/init"# CONFIG_CMDLINE_FROM_BOOTLOADER is not set# CONFIG_CMDLINE_EXTEND is not set
CONFIG_CMDLINE_FORCE=y # DNS-320/320L/325
# CONFIG_MTD_CMDLINE_PARTS is not set
I have created a ticket for this, which now has a tentative patch.
I have also implemented getting the sqimage from tftp, as you suggested, but in a simpler way. It's the developer responsibility to set it up right, so error handling is poor. Add to u-boot bootargs 'tftpargs=myip:tftpip[:netmask]'
I have also implemented getting the sqimage from tftp, as you suggested, but in a simpler way. It's the developer responsibility to set it up right, so error handling is poor. Add to u-boot bootargs 'tftpargs=myip:tftpip[:netmask]'
Your line:-
ifconfig eth0 up $myip $netmsk
causes error "ifconfig: SIOCSIFADDR: Invalid argument" when netmsk has a value, the word "netmask" is needed before its value. Suggest use parameter substitution with default value instead:-
ifconfig eth0 up $myip netmask ${netmsk:-255.255.255.0}
To prevent enlarging busybox (with an applet that is only used by developers and even then only once during rcS)
I tried other tftp clients. "curl" made rootfs much larger as included large libcurl and openssl packages.
"tftp-hpa" is not in normal buildroot system, but tried hacking "tftpd-hpa" package to build it.
Then I thought, this is too much bother, is there any download method already built in to your released kernel and rootfs. So tried nfs instead of tftp and it works, with only a change to rcS script, no extra tools or busybox applets needed.
So installed nfs-server on my development machine and used it to export the tftpboot directory:-
# /etc/exports entry
/srv/tftpboot 192.168.61.0/24(ro,all_squash,subtree_check,sync)
Patch to rcS attached.
Works well, does hang for a few minutes if told to use wrong server ip. Script is few lines longer because need to mount/un-mount, but no increase to busybox size for the boxes with small nand chips.
I personally prefer the tftp download rather than nfs, but if you want to keep busybox small,