Bug#452444: honor ip=
Hello list,
here is attached my own vision of the problem to sharing parameters between
procedures,
the file /etc/live.vars contains all relevant variables for live-initramfs and
is populated with the procedure really_export ()
I consider the file /etc/live.conf like an initial bash program to configure
the live system and to fill live.vars with some configuration values.
in the startup scripts/live does the job of interpreting /proc/cmdline and
fill live.vars
the programs import "live vars" through scripts/live-functions
when the startup process ends, the file live.vars is copied to the live
filesystem.
After, working in a started system, other bash programs can import live.vars
to get all the variable values.
example,
we need a routine to configure X11 for an Nvidia card,
all job of interpreting parameters is done importing live.vars
like that (that is a sample, not the full code), observe the variables
NVIDIATWINVIEW and TWINVIEWORIENTATION:
/etc/init.d/live-nvidia
#!/bin/sh
PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin
# Read configuration variable file if it is present
[ -r /etc/live.vars ] && . /etc/live.vars
# Load the VERBOSE setting and other rcS variables
[ -f /etc/default/rcS ] && . /etc/default/rcS
configuredisplay() {
[ -n "$NVIDIATWINVIEW" ] && twinview="--twinview"
[ -n "$TWINVIEWORIENTATION" ] && \
orientation="--twinview-orientation=${TWINVIEWORIENTATION}"
nvidia-xconfig $twinview $orientation > /dev/null
}
case "$1" in
start)
configuredisplay
;;
stop|restart|reload|force-reload|status)
[ "$VERBOSE" != no ] && log_end_msg 0
;;
*)
echo "Usage: $0 {start|stop|reload|force-reload|restart}"
;;
esac
exit 0
Best regards,
Jordi Pujol
-------------- next part --------------
A non-text attachment was scrubbed...
Name: live-initramfs_1.110.7-1-mod-jp.tar.bz2
Type: application/x-tbz
Size: 62046 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/debian-live-devel/attachments/20071130/ebcf09a5/attachment-0001.bin
Reply to: