Bug#452444: honor ip=
El Thursday 22 November 2007 23:50:18 Daniel Baumann va escriure:
> Anton Lundin wrote:
> > the live script doesn't care about ip= parameters like which interface
> > to do dhcp on and so on so this patch adds code to do this.
>
> you probably forgot to attach the patch.
>
> > Its not nice and should probably be abstracted to a separate fuction to
> > run in all the diffrent cases, and not just the nfs-root case.
>
> actually, initramfs-tools should be refactured for this, in order to let
> the different initramfs-tools hooks (like live-initramfs) use it and
> share the code, rather than to implement/copy the same code again.
>
> anyone got spare time to look into the issue?
Hello list,
yes,
I was thinking in populating the file /live.vars
already that is lightly used but moving it to /etc/live.vars
that file could become part of the live-initramfs package and of the
live-helpers package also,
live-helpers can populate that with initial values and at start of the LiveOS,
live-initramfs scripts can modify or add options.
After, the hooks can import /etc/live.vars to get all the options converted
into variables.
Observe:
the procedure really_export ()
actually is used, but that have not a wide use
/etc/live.vars will not contain export sentences, only variable assignments,
example:
********************
DEBUG="Yes"
HOSTNAME=pcdebianlive
********************
and every option in the live-initramfs procedures will be written to this
file.
really_export ()
{
local STRING="${1}"
local VALUE="$(eval echo -n \${$STRING})"
set_option "/etc/live.vars" "${STRING}" "${VALUE}"
eval export "${STRING}"="${VALUE}"
}
set_option ()
{
local filename=${1}
local option=${2}
local value=${3}
if grep "^${option}=" ${filename} > /dev/null
then
sed -i -e "s/^${option}=.*/${option}=${value}/" ${filename}
else
echo "${option}=${value}" >> ${filename}
fi
}
at the end, the live script will move the file /etc/live.vars
to /root/etc/live.vars
then also the procedures in /etc/init.d/* could import that.
Some observations about ?
Best regards,
Jordi Pujol
Reply to: