Hello,
I just upgrade to the MPSS 3.4.2 and since filelists are not supported anymore for the base initrd, I tried the overlay feature with a filelist. However, I quickly realized that the files I wanted to add are not ending up in the final initrd image. So I investigated the problem and took a look at the final CPIO. What I found was the following structure:
(base file A content)[filename A] (base file B content)[filename B] [...] (base file Z content)[filename Z] (magic number for cpio end)[TRAILER!!!] (overlay file a content)[filename a] [...] (overlay file z content)[filename z] (magic number for cpio end)[TRAILER!!!]
Obviously the magic number indicating the end of the cpio after the default content and before the overlay files in line 5 is an issue. Then I took a look in the source code of the micctrl receptively the libmpssconfig. The problem seems to be that when adding the overlay it simply extracts the base initrd and appends the overlay at the end of the cpio leaving the file end indicator where it is and adding a second one at then end. To have a quick fix, I patched the genfs.c file to move back before the end indicator of the original initrd and let it simply overwrite it by the overlay files (see patch at the end). This does the trick for me now.
However, it would be great if this bug gets fixed in the next release of MPSS as I only have a very crude fix and it might also affect other users.
oldmask = umask(S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); - if ((cpiofp = fopen(cpioname, "a")) == NULL) { + if ((cpiofp = fopen(cpioname, "r+")) == NULL) { umask(oldmask); return errno; } + // find end of cpio and set file pointer before magic number + buffer[9] = '\0'; + fseek(cpiofp, -9, SEEK_END); + do{ + fread(buffer, sizeof(char), 9, cpiofp); + fseek(cpiofp, -10, SEEK_CUR); + } while(strncmp(buffer,"TRAILER!!!",9)); + + fseek(cpiofp, -109, SEEK_CUR); + follow_dir(menv, top->subdir, "", cpiofp, &inode, &offset, perrs); cpio_trailer(cpiofp, &inode, &offset);