[Bug 1651170] Re: run_scripts_optional sets 'y' value but call_scripts checks for 'optional' value
Wladimir Mutel
mwg at mwg.dp.ua
Tue Dec 20 12:27:23 UTC 2016
The fix is looking pretty simple, either compare the variable to "xy"
string, or assign it "optional" instead of "y"
** Also affects: initramfs-tools (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to initramfs-tools in Ubuntu.
https://bugs.launchpad.net/bugs/1651170
Title:
run_scripts_optional sets 'y' value but call_scripts checks for
'optional' value
Status in initramfs-tools:
New
Status in initramfs-tools package in Ubuntu:
New
Bug description:
I looked into my initramfs and found there big graphics modules for hardware which I don't have.
I found a place where these modules were copied into initramfs, it was in /usr/share/initramfs-tools/hooks/framebuffer
Also I found a recipe on the Internet, advising to put 'FRAMEBUFFER=n' into initramfs.conf to exclude optional hooks and scipts which have OPTION=FRAMEBUFFER in them from initramfs creation
I tried to set this option and to update my initramfs, but did not succeed
So I examined mkinitramfs and related scripts and found this sequence in /usr/share/initramfs-tools/hook-functions :
run_scripts_optional()
{
call_scripts_optional=y
run_scripts "$@"
}
...
run_scripts()
{
...
call_scripts $scriptdir
}
...
call_scripts()
{
...
for cs_x in ${runlist}; do
...
if [ x"$call_scripts_optional" = "xoptional" ]; then
option=$(sed '/^OPTION=/!d;$d;s/^OPTION=//;s/[[:space:]]*$//' "${initdir}/${cs_x}")
[ -z "${option}" ] || eval test -n \"\${$option}\" -a \"\${$option}\" != \"n\" || continue
fi
...
done
...
}
As you see, variable 'call_scripts_optional' is set to vaue 'y' in
run_scripts_optional function, but then it is checked for having
'optional' value in call_scripts function
This is observed at least in up-to-date Ubuntu Xenial and Zesty
I will also check equivalent scripts in Debian testing/unstable and report my finding in a comment below.
To manage notifications about this bug go to:
https://bugs.launchpad.net/initramfs-tools/+bug/1651170/+subscriptions
More information about the foundations-bugs
mailing list