Browse Source
Cached CMDLINE doesn't work 100%. For example the following case, 1. dracut starts to run dracut-cmdline.sh. CMDLINE is cached when calling getarg 'rd.break=cmdline'. 2. In 92-parse-ibft.sh, ibft_to_cmdline() calls $(set_ifname ibft xx:xx..) multiple times in each subshell. 3. In 1st call, set_ifname() will check $(getargs ifname) and write out ifname=xxxx accordingly. 4. In 2nd call, set_ifname() will check $(getargs ifname) and it's wrong here. Because in step 3, we introduce a new cmdline arg ifname=xxx, but CMDLINE isn't updated. Thus we fail to get the new ifname arg. It's doable to unset CMDLINE every time after a new cmdline arg is in. But unset should be done in the parent process, because unset CMDLINE in a subshell won't unset CMDLINE in its parent or sibling process. And also it's painful to unset CMDLINE every time. In the future, functions and code snippet could probably separate or move to other file, the unset CMDLINE could malfunction again like this time. So I'm thinking not to cache CMDLINE. It's doesn't hurt to re-read all the cmdline args everytime. Because it's in initramfs, a non cached _getcmdline() should be fast enough. Please consider! Thanks WANG Chaomaster


1 changed files with 16 additions and 17 deletions
Loading…
Reference in new issue