mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-25 20:28:21 +00:00
mkpatch change: It is now possible to call mkpatch for the I2C
package, even after the kernel was also patched for lm_sensors.
This means generating diffs now works always.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@552 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
daf8ee4263
commit
e489331dbd
1 file changed
+24
-27
+24
-27
@@ -367,7 +367,7 @@ EOF
|
|||||||
|
|
||||||
# This generates diffs for drivers/i2c/Config.in
|
# This generates diffs for drivers/i2c/Config.in
|
||||||
# Several adapter drivers that are included in the lm_sensors package are
|
# Several adapter drivers that are included in the lm_sensors package are
|
||||||
# added at the bottom.
|
# added at the first and onlu sensors marker.
|
||||||
# Of course, care is taken old lines are removed.
|
# Of course, care is taken old lines are removed.
|
||||||
# $_[0]: sensors package root (like /tmp/sensors)
|
# $_[0]: sensors package root (like /tmp/sensors)
|
||||||
# $_[1]: Linux kernel tree (like /usr/src/linux)
|
# $_[1]: Linux kernel tree (like /usr/src/linux)
|
||||||
@@ -382,13 +382,12 @@ sub gen_drivers_i2c_Config_in
|
|||||||
open OUTPUT,">$package_root/$package_file"
|
open OUTPUT,">$package_root/$package_file"
|
||||||
or die "Can't open $package_root/$package_file";
|
or die "Can't open $package_root/$package_file";
|
||||||
while(<INPUT>) {
|
while(<INPUT>) {
|
||||||
if (m@CONFIG_I2C_MAINBOARD@) {
|
if (m@sensors code starts here@) {
|
||||||
$_ = <INPUT> while not m@^ fi$@;
|
print OUTPUT;
|
||||||
$_ = <INPUT>;
|
while (<INPUT>) {
|
||||||
$_ = <INPUT> if m@^$@;
|
last if m@sensors code ends here@;
|
||||||
}
|
}
|
||||||
if (m@^fi@) {
|
print OUTPUT << 'EOF';
|
||||||
print OUTPUT << 'EOF'
|
|
||||||
bool 'I2C mainboard interfaces' CONFIG_I2C_MAINBOARD
|
bool 'I2C mainboard interfaces' CONFIG_I2C_MAINBOARD
|
||||||
if [ "$CONFIG_I2C_MAINBOARD" = "y" ]; then
|
if [ "$CONFIG_I2C_MAINBOARD" = "y" ]; then
|
||||||
dep_tristate ' Acer Labs ALI 1533 and 1543C' CONFIG_I2C_ALI5X3 $CONFIG_I2C_MAINBOARD
|
dep_tristate ' Acer Labs ALI 1533 and 1543C' CONFIG_I2C_ALI5X3 $CONFIG_I2C_MAINBOARD
|
||||||
@@ -424,14 +423,12 @@ sub gen_drivers_i2c_Makefile
|
|||||||
open OUTPUT,">$package_root/$package_file"
|
open OUTPUT,">$package_root/$package_file"
|
||||||
or die "Can't open $package_root/$package_file";
|
or die "Can't open $package_root/$package_file";
|
||||||
while(<INPUT>) {
|
while(<INPUT>) {
|
||||||
while (m@CONFIG_I2C_ALI5X3@ or m@CONFIG_I2C_HYDRA@ or m@CONFIG_I2C_PIIX4@ or
|
if (m@sensors code starts here@) {
|
||||||
m@CONFIG_I2C_VIA@ or m@CONFIG_I2C_ISA@) {
|
print OUTPUT;
|
||||||
$_ = <INPUT> while not m@^endif@;
|
while (<INPUT>) {
|
||||||
$_ = <INPUT>;
|
last if m@sensors code ends here@;
|
||||||
$_ = <INPUT> if m@^$@;
|
}
|
||||||
}
|
print OUTPUT << 'EOF';
|
||||||
if (m@Rules.make@) {
|
|
||||||
print OUTPUT << 'EOF'
|
|
||||||
ifeq ($(CONFIG_I2C_ALI5X3),y)
|
ifeq ($(CONFIG_I2C_ALI5X3),y)
|
||||||
L_OBJS += i2c-ali5x3.o
|
L_OBJS += i2c-ali5x3.o
|
||||||
else
|
else
|
||||||
@@ -492,21 +489,20 @@ sub gen_drivers_i2c_i2c_core_c
|
|||||||
my ($package_root,$kernel_root) = @_;
|
my ($package_root,$kernel_root) = @_;
|
||||||
my $kernel_file = "drivers/i2c/i2c-core.c";
|
my $kernel_file = "drivers/i2c/i2c-core.c";
|
||||||
my $package_file = $temp;
|
my $package_file = $temp;
|
||||||
my $right_place = 0;
|
my $patch_nr = 1;
|
||||||
|
|
||||||
open INPUT,"$kernel_root/$kernel_file"
|
open INPUT,"$kernel_root/$kernel_file"
|
||||||
or die "Can't open `$kernel_root/$kernel_file'";
|
or die "Can't open `$kernel_root/$kernel_file'";
|
||||||
open OUTPUT,">$package_root/$package_file"
|
open OUTPUT,">$package_root/$package_file"
|
||||||
or die "Can't open $package_root/$package_file";
|
or die "Can't open $package_root/$package_file";
|
||||||
while(<INPUT>) {
|
while(<INPUT>) {
|
||||||
while (m@CONFIG_I2C_ALI5X3@ or m@CONFIG_I2C_HYDRA@ or m@CONFIG_I2C_PIIX4@ or
|
if (m@sensors code starts here@) {
|
||||||
m@CONFIG_I2C_VIA@ or m@CONFIG_I2C_ISA@) {
|
print OUTPUT;
|
||||||
$_ = <INPUT> while not m@#endif@;
|
while (<INPUT>) {
|
||||||
$_ = <INPUT>;
|
last if m@sensors code ends here@;
|
||||||
}
|
}
|
||||||
if (m@^int __init i2c_init_all@) {
|
if ($patch_nr == 1) {
|
||||||
$right_place = 1;
|
print OUTPUT << 'EOF';
|
||||||
print OUTPUT << 'EOF';
|
|
||||||
#ifdef CONFIG_I2C_ALI5X3
|
#ifdef CONFIG_I2C_ALI5X3
|
||||||
extern int i2c_ali5x3_init(void);
|
extern int i2c_ali5x3_init(void);
|
||||||
#endif
|
#endif
|
||||||
@@ -523,8 +519,7 @@ sub gen_drivers_i2c_i2c_core_c
|
|||||||
extern int i2c_isa_init(void);
|
extern int i2c_isa_init(void);
|
||||||
#endif
|
#endif
|
||||||
EOF
|
EOF
|
||||||
}
|
} elsif ($patch_nr == 2) {
|
||||||
if ($right_place and m@return 0;@) {
|
|
||||||
print OUTPUT << 'EOF';
|
print OUTPUT << 'EOF';
|
||||||
#ifdef CONFIG_I2C_ALI5X3
|
#ifdef CONFIG_I2C_ALI5X3
|
||||||
i2c_ali5x3_init();
|
i2c_ali5x3_init();
|
||||||
@@ -542,6 +537,8 @@ EOF
|
|||||||
i2c_isa_init();
|
i2c_isa_init();
|
||||||
#endif
|
#endif
|
||||||
EOF
|
EOF
|
||||||
|
}
|
||||||
|
$patch_nr ++;
|
||||||
}
|
}
|
||||||
print OUTPUT;
|
print OUTPUT;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user