From 883dc7792c9ded24211969d851819da1b01aaca3 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 12 Mar 2009 07:04:17 -0300 Subject: Don't print errors for version checks, since we allow such checks at the out-of-tree buildings From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/check.pl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'v4l/scripts') diff --git a/v4l/scripts/check.pl b/v4l/scripts/check.pl index 4958e281b..975041c4a 100755 --- a/v4l/scripts/check.pl +++ b/v4l/scripts/check.pl @@ -87,6 +87,10 @@ $pwd =~ s|/[^/]+\n$||; sub print_err() { + if ($err =~ m/LINUX_VERSION_CODE/) { + return; + } + if ($err) { printf STDERR "%s/%s: In '%s':\n", $pwd, $file, $errline; printf STDERR "%s/%s:%d: %s\n", $pwd, $file, $ln_numb, $err; -- cgit v1.2.3 From 043985e41c1b3527cb1574753b3fd71c707a3d39 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Fri, 13 Mar 2009 03:59:20 -0700 Subject: build: have make_kconfig.pl ignore comments From: Trent Piepho It was already ignoring lines that had only comments. But lines with some non-comment code and then a comment at the end didn't have the comment stripped. Some modules had incorrect dependencies added because comments at the end of a "depends on" line were treated as modules names. I strip the comments from the string that is parsed by the script, but preserve the original line so it can be printed out with the comment still in it when making v4l/Kconfig. Priority: normal Signed-off-by: Trent Piepho --- v4l/scripts/make_kconfig.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index 57c663c00..8683ee4d8 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -277,11 +277,13 @@ sub open_kconfig($$) { my $in_help = 0; my $default_seen = 0; my $if; + my $line; print "Opening $file\n" if $debug; open $in, '<', $file or die "File not found: $file"; push @kconfigfiles, $file; while (<$in>) { + $line = $_; # In our Kconfig files, the first non-help line after the # help text always has no indention. Technically, the # help text is ended by just by the indention decreasing, @@ -303,7 +305,7 @@ sub open_kconfig($$) { print OUT "\tdefault n\n"; } print OUT "\tdepends on VIDEO_KERNEL_VERSION\n"; - $_ = sprintf($disabled_msg, $minver{$key}); + $line = sprintf($disabled_msg, $minver{$key}); } next; } @@ -319,10 +321,13 @@ sub open_kconfig($$) { } next if (/^\s*#/ || /^\s*$/); # skip comments and blank lines + # Erase any comments on this line + s/(? Date: Sat, 14 Mar 2009 19:06:08 +0100 Subject: v4l-dvb: replace remaining references to the old mailinglist. From: Hans Verkuil Priority: normal Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_kconfig.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index 8683ee4d8..cfe53a636 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -576,8 +576,8 @@ config VIDEO_KERNEL_VERSION requiring a newer kernel is that no one has tested them with an older one yet. - If the driver works, please post a report at V4L mailing list: - video4linux-list\@redhat.com. + If the driver works, please post a report to the V4L mailing list: + linux-media\@vger.kernel.org. Unless you know what you are doing, you should answer N. -- cgit v1.2.3 From 941ed87d34bcef83a8a1854d701aab846ba9e7a1 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 29 Mar 2009 05:42:13 -0300 Subject: Added a script to run the tree merge procedure From: Mauro Carvalho Chehab hgimport was recommending a basic merge procedure. However, with some troubles: - The procedure only works if the pulled tree creates a new head; - The merge message should be manually written; - No sanity checks were done before doing the merge; - No error status were done. The new perl script implements a better way to handle it, doing the necessary checks. hgimport was updated to recommend the script usage. Priority: normal Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/do_merge.pl | 175 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100755 v4l/scripts/do_merge.pl (limited to 'v4l/scripts') diff --git a/v4l/scripts/do_merge.pl b/v4l/scripts/do_merge.pl new file mode 100755 index 000000000..1ceb0ce75 --- /dev/null +++ b/v4l/scripts/do_merge.pl @@ -0,0 +1,175 @@ +#!/usr/bin/perl + +my $merge_tree=shift or die "Should specify the pulled tree"; + +sub hgrcuser($) +{ + my $file = shift; + my $ui = 0; + open IN, '<', $file; + while () { + $ui = 1 if (/^\s*\[ui\]/); + if ($ui && /^\s*username\s*=\s*(\S.*?)\s*$/) { + close IN; + return($1); + } + } + close IN; + return(""); +} + +sub check_heads() +{ + my $count=0; + open IN, 'hg heads|'; + while () { + if (m/^[Cc]hangeset:/) { + $count++; + } + } + close IN; + return $count; +} + +sub curr_changeset() +{ + my $changeset = -1; + + open IN, 'hg heads|'; + while () { + if (m/^[Cc]hangeset:\s*(\d+)/) { + if ($changeset < 0) { + $changeset = $1; + } else { + if ($1 < $changeset) { + $changeset = $1; + } + } + } + } + close IN; + return $changeset; +} + +sub check_status() +{ + my $count=0; + open IN, 'hg status -m -a -d -r|'; + while () { + $count++; + } + close IN; + return $count; +} + +sub rollback() +{ + print "Rolling back hg pull $merge_tree\n"; + system("hg rollback"); + system("hg update -C"); + exit -1; +} + +#################### +# Determine username + +# Get Hg username from environment +my $user = $ENV{HGUSER}; + +# Didn't work? Try the repo's .hgrc file +if ($user eq "") { + my $hgroot = `hg root`; + chomp($hgroot); + $user = hgrcuser("$hgroot/.hg/hgrc"); +} +# Ok, try ~/.hgrc next +if ($user eq "") { + $user = hgrcuser("$ENV{HOME}/.hgrc"); +} + +# Still no luck? Try some other environment variables +if ($user eq "") { + my $name = $ENV{CHANGE_LOG_NAME}; + my $email = $ENV{CHANGE_LOG_EMAIL_ADDRESS}; + $user = "$name <$email>" if ($name ne "" || $email ne ""); +} + +# Last try to come up with something +if ($user eq "") { + print "User not known. Can't procceed\n"; + exit -1; +} + +###################### +# Do some sanity tests + +print "Checking if everything is ok, before applying the new tree.\n"; + +my $n_heads = check_heads(); +die "Your tree currently have more than one head (it has $n_heads heads). Can't procceed\n" if ($n_heads > 1); + +my $dirty = check_status(); +die "Your tree currently has changes. Can't procceed\n" if ($dirty); + +my $curr_cs = curr_changeset(); + +########### +# Pull tree + +print "hg pull $merge_tree\n"; + +my $ret = system("hg pull $merge_tree"); +die "Couldn't pull from $merge_tree\n" if ($ret); + +############################# +# Merge and commit, if needed + +$n_heads = check_heads(); +if ($n_heads > 2) { + print "The merged tree have more than one head (it has $n_heads heads). Can't procceed.\n"; + rollback(); +} + +if ($n_heads == 2) { + print "Merging the new changesets\n"; + + $ret = system("hg merge"); + if ($ret) { + print "hg merge failed. Can't procceed.\n"; + rollback(); + } + + print "Committing the new tree\n"; + # Write the commit message + $msg= "merge: $merge_tree\n\nFrom: $user\n\nSigned-off-by: $user\n"; + $ret=system("hg commit -m '$msg'"); + if ($ret) { + print "hg commit failed. Can't procceed.\n"; + rollback(); + } +} + +##################### +# Test resulting tree + +print "Testing if the build didn't break compilation. Only errors and warnings will be displayed. Please wait.\n"; +$ret = system ('make all|grep -v "^ CC"|grep -v "^ LD"'); +if ($ret) { + print "Build failed. Can't procceed.\n"; + + # To avoid the risk of doing something really bad, let's ask the user to run hg strip + print "Your tree is dirty. Since hg has only one rollback level, you'll need to use, instead:"; + print "\thg strip $curr_cs; hg update -C"; + print "You'll need to have hg mq extension enabled for hg strip to work.\n"; + + exit -1; +} + +############################## +# Everything is ok, let's push + +print "Pushing the new tree at the remote repository specified at .hg/hgrc\n"; +$ret=system ("hg push"); +if ($ret) { + print "hg push failed. Don't forget to do the push later.\n"; +} -- cgit v1.2.3 From dd151ee816f6d89d08edda36da27880b88c32fae Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 29 Mar 2009 05:51:18 -0300 Subject: do_merge.pl: Do a small fix at the building part of the script From: Mauro Carvalho Chehab Priority: normal Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/do_merge.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/do_merge.pl b/v4l/scripts/do_merge.pl index 1ceb0ce75..0a4433a21 100755 --- a/v4l/scripts/do_merge.pl +++ b/v4l/scripts/do_merge.pl @@ -153,7 +153,7 @@ if ($n_heads == 2) { # Test resulting tree print "Testing if the build didn't break compilation. Only errors and warnings will be displayed. Please wait.\n"; -$ret = system ('make all|grep -v "^ CC"|grep -v "^ LD"'); +$ret = system ('make all|egrep -v "^\s*CC"|egrep -v "^\s*LD"'); if ($ret) { print "Build failed. Can't procceed.\n"; -- cgit v1.2.3 From 82753c8a0c338f489a20e0554eac589a390ac6bb Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 14 Apr 2009 11:02:14 -0300 Subject: backport commit 758021bfa9ea25c58e62d2f68512628b19502ce7 From: Mauro Carvalho Chehab Author: Takashi Iwai Date: Mon Jan 12 15:17:09 2009 +0100 drivers/media: Convert to snd_card_create() Convert from snd_card_new() to the new snd_card_create() function. While here, backport also cx231xx-audio upstream changes for using snd_card_create(). kernel-sync: Priority: normal Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_config_compat.pl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index 423dcff77..2fc37d06d 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -254,6 +254,25 @@ sub check_pci_ioremap_bar() close INNET; } +sub check_snd_card_create() +{ + my $file = "$kdir/include/sound/core.h"; + my $need_compat = 1; + + open IN, "<$file" or die "File not found: $file"; + while () { + if (m/snd_card_create/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_SND_CARD_CREATE\n"; + } + close IN; +} + sub check_other_dependencies() { check_spin_lock(); @@ -269,6 +288,7 @@ sub check_other_dependencies() check_net_dev(); check_usb_endpoint_type(); check_pci_ioremap_bar(); + check_snd_card_create(); } # Do the basic rules -- cgit v1.2.3 From d54ae5db8294db9af22f394d69591b8cf500ddc8 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 14 Apr 2009 11:11:08 -0300 Subject: Fix compatibility for usb_endpoint_type and 2.6.30 From: Mauro Carvalho Chehab compat.h: usb_endpoint_type can be found on ch9.h header Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_config_compat.pl | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index 2fc37d06d..e94bf2803 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -218,21 +218,22 @@ sub check_net_dev() sub check_usb_endpoint_type() { - my $file = "$kdir/include/linux/usb.h"; - my $need_compat = 1; - - open INNET, "<$file" or die "File not found: $file"; - while () { - if (m/usb_endpoint_type/) { - $need_compat = 0; - last; + my @files = ( "$kdir/include/linux/usb.h", "$kdir/include/linux/usb/ch9.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or die "File not found: $file"; + while () { + if (m/usb_endpoint_type/) { + close IN; + # definition found. No need for compat + return; + } } + close IN; } - if ($need_compat) { - $out.= "\n#define NEED_USB_ENDPOINT_TYPE 1\n"; - } - close INNET; + # definition not found. This means that we need compat + $out.= "\n#define NEED_USB_ENDPOINT_TYPE 1\n"; } sub check_pci_ioremap_bar() -- cgit v1.2.3 From 8cc78392269a77c3aed220bb457e991924480779 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 14 Apr 2009 11:27:26 -0300 Subject: compat.h: improve detection for need poll_schedule() From: Mauro Carvalho Chehab Priority: normal Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_config_compat.pl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index e94bf2803..32b111f4e 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -274,6 +274,28 @@ sub check_snd_card_create() close IN; } +sub check_poll_schedule() +{ + + + my @files = ( "$kdir//include/linux/poll.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or die "File not found: $file"; + while () { + if (m/poll_schedule/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + # definition not found. This means that we need compat + $out.= "\n#define NEED_POLL_SCHEDULE 1\n"; +} + sub check_other_dependencies() { check_spin_lock(); @@ -290,6 +312,7 @@ sub check_other_dependencies() check_usb_endpoint_type(); check_pci_ioremap_bar(); check_snd_card_create(); + check_poll_schedule(); } # Do the basic rules -- cgit v1.2.3 From 635283a5dcc470c8dc22d6cabaf1eac4e3e08bf4 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 14 Apr 2009 15:03:39 -0300 Subject: fix backport compilation, when ch9.h file doesn't exist From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_config_compat.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index 32b111f4e..3c2b623ca 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -218,10 +218,12 @@ sub check_net_dev() sub check_usb_endpoint_type() { + my $nfiles = 0; my @files = ( "$kdir/include/linux/usb.h", "$kdir/include/linux/usb/ch9.h" ); foreach my $file ( @files ) { - open IN, "<$file" or die "File not found: $file"; + open IN, "<$file" or next; + $nfiles++; while () { if (m/usb_endpoint_type/) { close IN; @@ -232,6 +234,8 @@ sub check_usb_endpoint_type() close IN; } + die "Usb headers not found" if (!$nfiles); + # definition not found. This means that we need compat $out.= "\n#define NEED_USB_ENDPOINT_TYPE 1\n"; } -- cgit v1.2.3 From 07aa0071b7731c08909ed2ea7ab99a62fa934ff0 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 9 May 2009 06:24:32 -0300 Subject: Kbuild: add a new target to check for section mismatches From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/do_merge.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/do_merge.pl b/v4l/scripts/do_merge.pl index 0a4433a21..1a6bbb1ee 100755 --- a/v4l/scripts/do_merge.pl +++ b/v4l/scripts/do_merge.pl @@ -153,7 +153,10 @@ if ($n_heads == 2) { # Test resulting tree print "Testing if the build didn't break compilation. Only errors and warnings will be displayed. Please wait.\n"; -$ret = system ('make all|egrep -v "^\s*CC"|egrep -v "^\s*LD"'); +$ret = system ('make allmodconfig'); +if (!ret) { + $ret = system ('make mismatch|egrep -v "^\s*CC"|egrep -v "^\s*LD"'); +} if ($ret) { print "Build failed. Can't procceed.\n"; -- cgit v1.2.3 From f3af4e568a54988e9528814b67c25afef45b81fb Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 23 May 2009 10:20:58 -0300 Subject: gentree.pl: Remove some unused vars From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/gentree.pl | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) mode change 100755 => 100644 v4l/scripts/gentree.pl (limited to 'v4l/scripts') diff --git a/v4l/scripts/gentree.pl b/v4l/scripts/gentree.pl old mode 100755 new mode 100644 index 1968bb334..b9053f464 --- a/v4l/scripts/gentree.pl +++ b/v4l/scripts/gentree.pl @@ -22,8 +22,8 @@ # If gentree knows the result of an expression, that directive will be # "processed", otherwise it will be an "other". gentree knows the value # of LINUX_VERSION_CODE, BTTV_VERSION_CODE, the KERNEL_VERSION(x,y,z) -# macro, numeric constants like 0 and 1, and a few defines like MM_KERNEL -# and STV0297_CS2. +# macro, numeric constants like 0 and 1, and a few defines like +# I2C_CLASS_TV_DIGITAL # # An exception is if the comment "/*KEEP*/" appears after the expression, # in which case that directive will be considered an "other" and not @@ -55,22 +55,10 @@ my %defs = ( 'LINUX_VERSION_CODE' => $LINUXCODE, 'BTTV_VERSION_CODE' => $BTTVCODE, '_COMPAT_H' => 0, - 'MM_KERNEL' => ($extra =~ /-mm/)?1:0, - 'BROKEN_XAWTV' => 0, - 'STV0297_CS2' => 0, - 'HAVE_VIDEO_BUF_DVB' => 1, - 'I2C_PEC' => 1, - 'I2C_DF_DUMMY' => 0, - 'CONFIG_XC3028' => 0, - 'HAVE_XC2028'=> 0, - 'HAVE_XC3028' => 0, 'I2C_CLASS_TV_ANALOG' => 1, 'I2C_CLASS_TV_DIGITAL' => 1, 'OLD_XMIT_LOCK' => 0, 'COMPAT_SND_CTL_BOOLEAN_MONO' => 0, - 'CONFIG_VIVI_SCATTER' => 0, - 'CONFIG_BIGPHYS_AREA' => 0, - 'BUZ_USE_HIMEM' => 1, 'NEED_SOUND_DRIVER_H' => 0, 'TTUSB_KERNEL' => 1, 'NO_PCM_LOCK' => 0, -- cgit v1.2.3