What is the correct way to add a line into /etc/modules.conf?
I want to add 'alias char-major-89 i2c-dev'
This will be part of a mini HowTo for lm_sensors.
My attempt at this follows, and is based on /etc/e-smith/templates/modules.conf/10parport-aliases [5.6b7]
====
Modify /etc/modules.conf via a template fragment
Make the templates-custom directory.
# mkdir -p /etc/e-smith/templates-custom/etc/modules.conf
Create a new template for i2c, using pico or your favourite editor.
# pico /etc/e-smith/templates-custom/etc/modules.conf/10i2c
{
foreach my $line
(
"alias char-major-89 i2c-dev"
)
{
unless (exists $lines{$line})
{
push @lines, $line;
}
}
"";
}
Expand the template.
# /sbin/e-smith/expand-template /etc/modules.conf
====
Is this the correct way or is there another way?
Ian Wells