Hi, I am wondering how to implement the following customer's requirement : The system is a stand alone embedded system with no operator (with Linux). There is one SSD for the system's usage (and that is where the system loads from). The requirement is to have a duplication of the Linux Image, and that syslinux should calculate CRC of "the first image" (say bzImage_1). If the CRC is correct then load the image, if the CRC is not correct, than syslinux should try "the other image" (say bzImage_2). If even that is no good do nothing. Any suggestions as to how to implement the requirement ? Thanks Mau
On Wed, Mar 19, 2014 at 4:16 PM, Mau Z <zmau1962 at gmail.com> wrote:> Hi, > > I am wondering how to implement the following customer's requirement : > The system is a stand alone embedded system with no operator (with Linux). > There is one SSD for the system's usage (and that is where the system loads > from). > > The requirement is to have a duplication of the Linux Image, and that > syslinux should calculate CRC of "the first image" (say bzImage_1). > If the CRC is correct then load the image, if the CRC is not correct, than > syslinux should try "the other image" (say bzImage_2). > If even that is no good do nothing. > > Any suggestions as to how to implement the requirement ?A custom COM32 module. Look at ifcpu.c32 for an example of an if-else module and the crypto functions in com32/util/ -- -Gene
On Wed, Mar 19, 2014 at 4:30 PM, Gene Cumm <gene.cumm at gmail.com> wrote:> On Wed, Mar 19, 2014 at 4:16 PM, Mau Z <zmau1962 at gmail.com> wrote: >> Hi, >> >> I am wondering how to implement the following customer's requirement : >> The system is a stand alone embedded system with no operator (with Linux). >> There is one SSD for the system's usage (and that is where the system loads >> from). >> >> The requirement is to have a duplication of the Linux Image, and that >> syslinux should calculate CRC of "the first image" (say bzImage_1). >> If the CRC is correct then load the image, if the CRC is not correct, than >> syslinux should try "the other image" (say bzImage_2). >> If even that is no good do nothing. >> >> Any suggestions as to how to implement the requirement ? > > A custom COM32 module. Look at ifcpu.c32 for an example of an if-else > module and the crypto functions in com32/util/And com32/lib/zlib/crc32.c -- -Gene
On 03/19/2014 01:30 PM, Gene Cumm wrote:> On Wed, Mar 19, 2014 at 4:16 PM, Mau Z <zmau1962 at gmail.com> wrote: >> Hi, >> >> I am wondering how to implement the following customer's requirement : >> The system is a stand alone embedded system with no operator (with Linux). >> There is one SSD for the system's usage (and that is where the system loads >> from). >> >> The requirement is to have a duplication of the Linux Image, and that >> syslinux should calculate CRC of "the first image" (say bzImage_1). >> If the CRC is correct then load the image, if the CRC is not correct, than >> syslinux should try "the other image" (say bzImage_2). >> If even that is no good do nothing. >> >> Any suggestions as to how to implement the requirement ? > > A custom COM32 module. Look at ifcpu.c32 for an example of an if-else > module and the crypto functions in com32/util/ >Or we could make the Linux loader (load_linux.c) throw an error on a bad CRC, which is probably a good idea anyway. Then the ONERROR option can be used for the fallback. -hpa
Mau Z <zmau1962 at gmail.com> writes:> I am wondering how to implement the following customer's requirement : > The system is a stand alone embedded system with no operator (with Linux). > There is one SSD for the system's usage (and that is where the system loads > from). > > The requirement is to have a duplication of the Linux Image, and that > syslinux should calculate CRC of "the first image" (say bzImage_1). > If the CRC is correct then load the image, if the CRC is not correct, than > syslinux should try "the other image" (say bzImage_2). > If even that is no good do nothing. > > Any suggestions as to how to implement the requirement ?You should be able to implement this logic via the embedded Lua interpreter. I don't know whether the performance would be acceptable, though (at least without resorting to C coding). -- Regards, Feri.
Thanks all, It should be quick, so it will be implemented in C. Maybe I should have stated that I am not an expert in syslinux (intelligent but no expert). I think that I understand the "custom COM32 module" option : I simply have to change the code (and begin by looking into the files that were suggested). As for Peter's suggestion, I am not sure if I understood. Is this an option which already exists ? How do I activate it ? BTW, The binary file will probably be tar + gzip. Does anybody know if there is a "gzip built in CRC test" ? The easiest way would be to let gzip test the file..... It must be better than what I can do. Is there any code example ? Or maybe another beginning point ? Thanks Mau On Thu, Mar 20, 2014 at 12:45 PM, Ferenc Wagner <wferi at niif.hu> wrote:> Mau Z <zmau1962 at gmail.com> writes: > > > I am wondering how to implement the following customer's requirement : > > The system is a stand alone embedded system with no operator (with > Linux). > > There is one SSD for the system's usage (and that is where the system > loads > > from). > > > > The requirement is to have a duplication of the Linux Image, and that > > syslinux should calculate CRC of "the first image" (say bzImage_1). > > If the CRC is correct then load the image, if the CRC is not correct, > than > > syslinux should try "the other image" (say bzImage_2). > > If even that is no good do nothing. > > > > Any suggestions as to how to implement the requirement ? > > You should be able to implement this logic via the embedded Lua > interpreter. I don't know whether the performance would be acceptable, > though (at least without resorting to C coding). > -- > Regards, > Feri. >