├── .gitignore ├── TODO ├── benchmarks ├── builder-notes ├── hackbench └── hackbench.c ├── chardev.txt ├── configs ├── .gitignore ├── 5.15.y ├── 5.16.y ├── 6.3.y ├── bubbles │ └── .config ├── frame │ ├── 5.19.y │ └── 6.6.y ├── goomy │ └── .config ├── gregkh_config ├── kvm │ ├── .config │ └── .version ├── mb │ ├── config │ └── small_config ├── mini │ ├── config-2.6.30 │ ├── config-2.6.31 │ └── config-2.6.32 ├── pixel │ ├── 3.10-rc6 │ └── 3.9 ├── quad │ ├── .config │ └── .version ├── sam │ └── .config ├── t43 │ └── config ├── thread │ ├── .config │ ├── 5.10.y │ └── stable └── thunder │ ├── .config │ └── 5.11.y ├── forms └── patch_bot ├── git ├── email_template │ ├── driver-2.6.git-patches │ ├── staging-2.6.git-patches │ ├── staging-2.6.git-patches.save │ ├── tty-2.6.git-patches │ └── usb-2.6.git-patches ├── mk_msg ├── mk_patches ├── old │ ├── aoe-2.6.19-rc2.git-patches │ ├── docs-2.6.git-patches │ ├── dorelease │ ├── g_foo │ ├── hwmon-2.6.19-rc2.git-patches │ ├── i2c-2.6.18.git-patches │ ├── make_tree │ ├── parent │ ├── pci-2.6.git-patches │ ├── uio-2.6.git-patches │ └── w1-2.6.18-rc1.git-patches └── push_git ├── lf_usb.ids ├── longterm ├── .gitignore ├── added-to-longterm-version ├── apply_it ├── do_it_all ├── mbox2send └── s.sh ├── notes ├── report ├── char-misc.git-patches ├── driver-core-report.txt ├── driver-core.git-patches ├── driver_core-state-2.6.18-rc6.txt ├── driver_core-state.txt ├── pci-report.txt ├── pci-state-2.6.18-rc6.txt ├── pci-state.txt ├── staging.git-patches ├── tty.git-patches ├── usb-report.txt ├── usb-state-2.6.18-rc6.txt ├── usb-state.txt └── usb.git-patches ├── scripts ├── added-to-gregkh ├── aws_provision ├── count_lines ├── device_attr_ro.pl ├── device_attr_rw.pl ├── device_attr_wo.pl ├── fix_in_what_release ├── fix_patch ├── fixed_in_version ├── fixes_search ├── fixes_search.old ├── generate_cc_list ├── generate_cid.sh ├── install ├── mainline-when.py ├── make_kernel_shortlog.pl ├── make_patchsets ├── make_patchsets.new ├── mime_dump ├── mime_dump.greg ├── mimedump ├── opensnoop.bt ├── reformat ├── revert_stable ├── set_it_up.sh ├── stable_search ├── startup.sh ├── sysfs_benchmark ├── syzbot_search ├── test_stable │ ├── pt │ ├── test_stable_docker │ ├── test_stable_ssh │ └── tt ├── trace_kernel_build.sh ├── update-gregkh ├── what_commits_per_release └── x.sh ├── stable ├── .gitignore ├── added-to-stable-version ├── apply_it ├── apply_it_from_email ├── bad_stable_from_email ├── configs │ ├── 5.10.y │ ├── 5.15.y │ ├── 5.4.y │ ├── 6.1.y │ ├── 6.12.y │ ├── 6.14.y │ ├── 6.15.y │ ├── 6.6.y │ └── old │ │ ├── 3.0.y │ │ ├── 3.10.y │ │ ├── 3.11.y │ │ ├── 3.12.y │ │ ├── 3.13.y │ │ ├── 3.14.y │ │ ├── 3.15.y │ │ ├── 3.16.y │ │ ├── 3.17.y │ │ ├── 3.18.y │ │ ├── 3.19.y │ │ ├── 3.4.y │ │ ├── 3.8.y │ │ ├── 3.9.y │ │ ├── 4.0.y │ │ ├── 4.1.y │ │ ├── 4.14.y │ │ ├── 4.16.y │ │ ├── 4.17.y │ │ ├── 4.19.y │ │ ├── 4.2.y │ │ ├── 4.20.y │ │ ├── 4.3.y │ │ ├── 4.4.y │ │ ├── 4.5.y │ │ ├── 4.9.y │ │ ├── 5.0.y │ │ ├── 5.1.y │ │ ├── 5.11.y │ │ ├── 5.12.y │ │ ├── 5.13.y │ │ ├── 5.14.y │ │ ├── 5.16.y │ │ ├── 5.17.y │ │ ├── 5.18.y │ │ ├── 5.19.y │ │ ├── 5.2.y │ │ ├── 5.3.y │ │ ├── 5.5.y │ │ ├── 5.6.y │ │ ├── 5.7.y │ │ ├── 5.8.y │ │ ├── 5.9.y │ │ ├── 6.0.y │ │ ├── 6.10.y │ │ ├── 6.11.y │ │ ├── 6.13.y │ │ ├── 6.2.y │ │ ├── 6.3.y │ │ ├── 6.4.y │ │ ├── 6.5.y │ │ ├── 6.7.y │ │ ├── 6.8.y │ │ └── 6.9.y ├── da ├── dave_split.pl ├── del_p ├── do_it_all ├── do_sasha.sh ├── dotag ├── email_to_c2p ├── email_to_c2p_helper ├── generate_rcs ├── generate_rcs2 ├── interdif ├── justfile ├── make_diff ├── make_release ├── make_rolling_links ├── pick_gcc ├── s.sh ├── send_email ├── tested-by ├── tuxbuild │ ├── all.yaml │ ├── arm32.plan │ ├── one_s390.yaml │ ├── oneshot.yaml │ ├── run_all.sh │ ├── run_arm32.sh │ ├── run_one.sh │ ├── run_one_s390.sh │ ├── run_x86.sh │ ├── s390.yaml │ └── x86.yaml ├── update ├── update_all_branches └── version_bump ├── test ├── .gitignore ├── branch_switch_test.sh ├── bugs │ ├── dma_thread.c │ ├── kernbug.c │ └── zero_read.c ├── buildtest ├── clone_test.sh ├── pstate ├── test-staging └── xb └── work ├── .git-prompt.sh ├── .gitignore ├── configs ├── char-misc ├── driver-core ├── rust ├── staging ├── tty ├── tty.version ├── usb └── usb.version ├── justfile ├── platform_files.txt └── scripts ├── do.sh ├── githooks ├── applypatch-msg ├── prepare-commit-msg ├── sendemail-validate └── sendemail-validate.old ├── merge_main ├── mk_msg ├── path ├── pull_request ├── push ├── push.sh ├── verify_fixes.sh ├── verify_signedoff.sh └── work_sync /.gitignore: -------------------------------------------------------------------------------- 1 | # directories to ignore 2 | compilers/ 3 | drivers/ 4 | e/ 5 | gregkh-stable/ 6 | gregkh/ 7 | intern/ 8 | kdbus/ 9 | ltsi/ 10 | next/ 11 | patches/ 12 | tab/ 13 | tmp/ 14 | tools/ 15 | torvalds/ 16 | trees/ 17 | cve/ 18 | vulns/ 19 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | Things I don't want to forget, might as well track them here. 2 | 3 | - kernfs_mutex should be pushed down, multi-threaded reads from sysfs is hitting this. 4 | 5 | - cdev stuff 6 | 7 | - buy a power controller for ktest: 8 | http://www.digital-loggers.com/lpc.html 9 | 10 | - cross compilers from David Howwells http://people.redhat.com/~dhowells/cross/ into openSUSE. 11 | 12 | - make dev_printk() "smarter" about finding a "real" device to print from, to 13 | make it more useful for people (see input thread for why this is needed) 14 | 15 | - kernel patches to make llvm build/link 16 | http://git.linuxfoundation.org/?p=llvm-setup.git;a=tree;hb=HEAD 17 | 18 | - remove __devX as it's pretty much pointless 19 | 20 | - git quiltimport -c 2 (only apply X number of patches...) 21 | 22 | - no more attributes, use attribute groups 23 | 24 | - no more device_create_file(), use groups 25 | 26 | - DEVICE_ATTR_R*, not "raw" ones if at all possible. 27 | 28 | - sysfs binary file creation moved to groups for all drivers 29 | 30 | - no more driver calls to sysfs_* at all if possible. 31 | 32 | - PCI MSI sysfs files, an attribute group instead of a kobject mess? 33 | 34 | kernel_fpu_begin()/end 35 | - only do it once, and then restore on return to userspace only if set. 36 | 37 | - move more function pointers into read-only structures. Like tty ops and usb and others. 38 | -------------------------------------------------------------------------------- /benchmarks/builder-notes: -------------------------------------------------------------------------------- 1 | ---------------------------------- 2 | Equinox builder instance: 3 | 4 | $ ./kcbench -s 5.15 -o /dev/shm/ -m 5 | Processor: AMD EPYC 7502P 32-Core Processor [48 CPUs] 6 | Cpufreq; Memory: Unknown; 257618 MiB 7 | Linux running: 4.19.0-17-amd64 [x86_64] 8 | Compiler: gcc (Debian 8.3.0-6) 8.3.0 9 | Linux compiled: 5.15.0 [/home/gregkh/.cache/kcbench/linux-5.15/] 10 | Config; Environment: allmodconfig; CCACHE_DISABLE="1" 11 | Build command: make vmlinux modules 12 | Filling caches: This might take a while... Done 13 | Run 1 (-j 48): 401.67 seconds / 8.96 kernels/hour [P:4428%] 14 | Run 2 (-j 48): 401.83 seconds / 8.96 kernels/hour [P:4427%] 15 | Run 3 (-j 54): 401.65 seconds / 8.96 kernels/hour [P:4452%] 16 | Run 4 (-j 54): 401.49 seconds / 8.97 kernels/hour [P:4454%] 17 | Run 5 (-j 24): ^Ac560.51 seconds / 6.42 kernels/hour [P:2391%] 18 | Run 6 (-j 24): 558.85 seconds / 6.44 kernels/hour [P:2399%] 19 | Run 7 (-j 29): 505.41 seconds / 7.12 kernels/hour [P:2876%] 20 | Run 8 (-j 29): 505.59 seconds / 7.12 kernels/hour [P:2878%] 21 | 22 | $ ./kcbenchrate -o /dev/shm/ -s 5.15 -v 23 | [NOTE] Downloading source of Linux 5.15; this might take a while... 24 | 25 | WARNING: Rate run still experimental. Use at your own risk! 26 | 27 | Processor: AMD EPYC 7502P 32-Core Processor [64 CPUs] 28 | Cpufreq; Memory: Unknown; 257615 MiB 29 | Linux running: 4.19.0-17-amd64 [x86_64] 30 | Compiler: gcc (Debian 8.3.0-6) 8.3.0 31 | Linux compiled: 5.15.0 [/home/gregkh/.cache/kcbench/linux-5.15] 32 | Config; Environment: defconfig; CCACHE_DISABLE="1" 33 | Build command: make vmlinux 34 | [INFO] Running 'make --silent -C '/home/gregkh/.cache/kcbench/linux-5.15' O='/dev/shm/kcbenchrate/worker.template/kcbench.tmp/' -j '64' defconfig'. 35 | Starting 64 workers: ................................................................ All launched, starting to measure. 36 | 64 workers completed 64 kernels so far (avrg: 1415.63 s/run) with a rate of 162.75 kernels/hour. 37 | 64 workers completed 128 kernels so far (avrg: 1415.95 s/run) with a rate of 162.72 kernels/hour. 38 | 39 | 40 | 41 | ---------------------------------- 42 | old-style colo-builder-box: 43 | 44 | $ ./kcbench -o ~/tmp/ -s 5.15 -m 45 | Processor: Intel Core Processor (Broadwell) [40 CPUs] 46 | Cpufreq; Memory: Unknown; 120740 MiB 47 | Linux running: 5.15.11-200.fc35.x86_64 [x86_64] 48 | Compiler: gcc (GCC) 11.2.1 20211203 (Red Hat 11.2.1-7) 49 | Linux compiled: 5.15.0 [/home/gregkh/.cache/kcbench/linux-5.15/] 50 | Config; Environment: allmodconfig; CCACHE_DISABLE="1" 51 | Build command: make vmlinux modules 52 | Filling caches: This might take a while... Done 53 | Run 1 (-j 40): 1087.33 seconds / 3.31 kernels/hour [P:3662%, 8851 maj. pagefaults] 54 | Run 2 (-j 40): 1091.40 seconds / 3.30 kernels/hour [P:3649%, 9283 maj. pagefaults] 55 | Run 3 (-j 46): 1088.90 seconds / 3.31 kernels/hour [P:3690%, 7156 maj. pagefaults] 56 | Run 4 (-j 46): 1093.40 seconds / 3.29 kernels/hour [P:3681%, 7469 maj. pagefaults] 57 | 58 | 59 | ---------------------------------- 60 | workstation: 61 | 62 | $ ./kcbench -s 5.15 -o /dev/shm/ -m 63 | Processor: AMD Ryzen Threadripper 3970X 32-Core Processor [64 CPUs] 64 | Cpufreq; Memory: schedutil [acpi-cpufreq]; 257679 MiB 65 | Linux running: 5.16.2-arch1-1 [x86_64] 66 | Compiler: gcc (GCC) 11.1.0 67 | Linux compiled: 5.15.0 [/home/gregkh/.cache/kcbench/linux-5.15/] 68 | Config; Environment: allmodconfig; CCACHE_DISABLE="1" 69 | Build command: make vmlinux modules 70 | Filling caches: This might take a while... Done 71 | Run 1 (-j 64): 390.46 seconds / 9.22 kernels/hour [P:5806%, 12974 maj. pagefaults] 72 | Run 2 (-j 64): 391.27 seconds / 9.20 kernels/hour [P:5803%, 12972 maj. pagefaults] 73 | Run 3 (-j 71): 399.18 seconds / 9.02 kernels/hour [P:5725%, 11822 maj. pagefaults] 74 | Run 4 (-j 71): 391.20 seconds / 9.20 kernels/hour [P:5844%, 11629 maj. pagefaults] 75 | Run 5 (-j 32): 488.53 seconds / 7.37 kernels/hour [P:3156%, 9134 maj. pagefaults] 76 | Run 6 (-j 32): 488.95 seconds / 7.36 kernels/hour [P:3150%, 8448 maj. pagefaults] 77 | Run 7 (-j 38): 461.76 seconds / 7.80 kernels/hour [P:3722%, 8009 maj. pagefaults] 78 | Run 8 (-j 38): 461.32 seconds / 7.80 kernels/hour [P:3723%, 7662 maj. pagefaults] 79 | 80 | 81 | -------------------------------------------------------------------------------- /benchmarks/hackbench: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregkh/gregkh-linux/82938d8ad3124f589bb5c0dfc3004ff439bc072e/benchmarks/hackbench -------------------------------------------------------------------------------- /chardev.txt: -------------------------------------------------------------------------------- 1 | print_hex_dump_bytes - need dev_dbg_print_hex_dump_bytes() 2 | 3 | 4 | 5 | What we have today: 6 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); 7 | extern int register_chrdev_region(dev_t, unsigned, const char *); 8 | extern int __register_chrdev(unsigned int major, unsigned int baseminor, 9 | unsigned int count, const char *name, 10 | const struct file_operations *fops); 11 | extern void __unregister_chrdev(unsigned int major, unsigned int baseminor, 12 | unsigned int count, const char *name); 13 | extern void unregister_chrdev_region(dev_t, unsigned); 14 | extern void chrdev_show(struct seq_file *,off_t); 15 | 16 | static inline int register_chrdev(unsigned int major, const char *name, 17 | const struct file_operations *fops) 18 | { 19 | return __register_chrdev(major, 0, 256, name, fops); 20 | } 21 | 22 | static inline void unregister_chrdev(unsigned int major, const char *name) 23 | { 24 | __unregister_chrdev(major, 0, 256, name); 25 | } 26 | 27 | Then there is the whole cdev.h stuff: 28 | cdev_init(struct cdev *, const struct file_operations) 29 | cdev_alloc(void) 30 | cdev_del(struct cdev *) 31 | cdev_add(struct cdev *, dev_t, unsigned) 32 | 33 | 34 | What we want: 35 | 36 | Register a char dev for a region and assign it a file operations. 37 | Unregister the region. 38 | That's it. 39 | 40 | 41 | Need: 42 | fops 43 | owner of module (different at times from fops) 44 | major/minor range, or dynamic 45 | name (for /proc) 46 | 47 | Watch out, i_cdev is a cdev in the inode, and it can be embedded within 48 | something else that grabs it when open() is called, so we need to know 49 | the size of struct cdev in drivers, it can't just be a "token". 50 | 51 | Today: 52 | register needs: 53 | cdev_init 54 | cdev_add 55 | register_chrdev_region, with same options as cdev_add() had 56 | 57 | unregister: 58 | cdev_del 59 | unregister_chrdev_region 60 | 61 | 62 | register_chrdev() and unregister_chrdev() are the "simple" ones, need to 63 | combine cdev with those somehow to make things easier for poeple to keep 64 | from the cdev_init/add/del mess. 65 | 66 | Unless we really want to force everyone to do this? It might be nicer... 67 | 68 | 69 | 70 | Proposal: 71 | cdev * cdev_create(major, minor, fops, name, private); 72 | cdev_destroy(* cdev); 73 | 74 | Can break cdev_create() into two parts: 75 | cdev_init() 76 | cdev_register() 77 | then after cdev_init(), can do "special" things if needed: 78 | - different module owner 79 | - different private 80 | - anything else? 81 | 82 | TODO - talk with Kay about better names 83 | 84 | set inode pointer to be cdev *. 85 | once have cdev *: 86 | void *cdev_private(cdev *) 87 | gets private back 88 | - can get anything else back with accessor function, not 89 | direct as we don't want to expose structure to 90 | anything outside of the cdev core to prevent people 91 | from poking with things directly. But is this really 92 | good? 93 | 94 | -------------------------------------------------------------------------------- /configs/.gitignore: -------------------------------------------------------------------------------- 1 | !.config 2 | !.version 3 | -------------------------------------------------------------------------------- /configs/kvm/.version: -------------------------------------------------------------------------------- 1 | 2018 2 | -------------------------------------------------------------------------------- /configs/quad/.version: -------------------------------------------------------------------------------- 1 | 1470 2 | -------------------------------------------------------------------------------- /forms/patch_bot: -------------------------------------------------------------------------------- 1 | Hi, 2 | 3 | This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him 4 | a patch that has triggered this response. He used to manually respond 5 | to these common problems, but in order to save his sanity (he kept 6 | writing the same thing over and over, yet to different people), I was 7 | created. Hopefully you will not take offence and will fix the problem 8 | in your patch and resubmit it so that it can be accepted into the Linux 9 | kernel tree. 10 | 11 | You are receiving this message because of the following common error(s) 12 | as indicated below: 13 | 14 | - Your patch breaks the build. 15 | 16 | - Your patch contains warnings and/or errors noticed by the 17 | scripts/checkpatch.pl tool. 18 | 19 | - Your patch is malformed (tabs converted to spaces, linewrapped, etc.) 20 | and can not be applied. Please read the file, 21 | Documentation/email-clients.txt in order to fix this. 22 | 23 | - Your patch does not have a Signed-off-by: line. Please read the 24 | kernel file, Documentation/SubmittingPatches and resend it after 25 | adding that line. Note, the line needs to be in the body of the 26 | email, before the patch, not at the bottom of the patch or in the 27 | email signature. 28 | 29 | - Your patch was sent privately to Greg. Kernel development is done in 30 | public, please always cc: a public mailing list with a patch 31 | submission. Using the tool, scripts/get_maintainer.pl on the patch 32 | will tell you what mailing list to cc. 33 | 34 | - Your patch did many different things all at once, making it difficult 35 | to review. All Linux kernel patches need to only do one thing at a 36 | time. If you need to do multiple things (such as clean up all coding 37 | style issues in a file/driver), do it in a sequence of patches, each 38 | one doing only one thing. This will make it easier to review the 39 | patches to ensure that they are correct, and to help alleviate any 40 | merge issues that larger patches can cause. 41 | 42 | - Your patch did not apply to any known trees that Greg is in control 43 | of. Possibly this is because you made it against Linus's tree, not 44 | the linux-next tree, which is where all of the development for the 45 | next version of the kernel is at. Please refresh your patch against 46 | the linux-next tree, or even better yet, the development tree 47 | specified in the MAINTAINERS file for the subsystem you are submitting 48 | a patch for, and resend it. 49 | 50 | - You sent multiple patches, yet no indication of which ones should be 51 | applied in which order. Greg could just guess, but if you are 52 | receiving this email, he guessed wrong and the patches didn't apply. 53 | Please read the section entitled "The canonical patch format" in the 54 | kernel file, Documentation/SubmittingPatches for a description of how 55 | to do this so that Greg has a chance to apply these correctly. 56 | 57 | - You did not specify a description of why the patch is needed, or 58 | possibly, any description at all, in the email body. Please read the 59 | section entitled "The canonical patch format" in the kernel file, 60 | Documentation/SubmittingPatches for what is needed in order to 61 | properly describe the change. 62 | 63 | - You did not write a descriptive Subject: for the patch, allowing Greg, 64 | and everyone else, to know what this patch is all about. Please read 65 | the section entitled "The canonical patch format" in the kernel file, 66 | Documentation/SubmittingPatches for what a proper Subject: line should 67 | look like. 68 | 69 | If you wish to discuss this problem further, or you have questions about 70 | how to resolve this issue, please feel free to respond to this email and 71 | Greg will reply once he has dug out from the pending patches received 72 | from other developers. 73 | 74 | thanks, 75 | 76 | greg k-h's patch email bot 77 | -------------------------------------------------------------------------------- /git/email_template/staging-2.6.git-patches: -------------------------------------------------------------------------------- 1 | From: Greg KH 2 | To: Linus Torvalds , Andrew Morton 3 | Cc: linux-kernel@vger.kernel.org, devel@linuxdriverproject.org 4 | Subject: [GIT PATCH] STAGING fixes for 2.6.34-git 5 | 6 | Here are a bunch of tiny staging bugfixes and a few new device ids for 7 | your 2.6.34-git tree. 8 | 9 | Please pull from: 10 | master.kernel.org:/pub/scm/linux/kernel/git/gregkh/staging-2.6.git/ 11 | 12 | All of these patches have been in the linux-next and mm trees. 13 | 14 | The patches will be sent as a follow-on to this message to the 15 | driver-devel list for people to see. 16 | 17 | thanks, 18 | 19 | greg k-h 20 | 21 | -------------- 22 | 23 | drivers/staging/dt3155/dt3155_drv.c | 4 ++-- 24 | drivers/staging/hv/Hv.c | 2 +- 25 | drivers/staging/hv/RndisFilter.c | 1 + 26 | drivers/staging/hv/netvsc_drv.c | 3 +-- 27 | drivers/staging/iio/accel/lis3l02dq_core.c | 2 +- 28 | drivers/staging/iio/accel/lis3l02dq_ring.c | 3 +++ 29 | drivers/staging/iio/adc/max1363_core.c | 2 ++ 30 | drivers/staging/iio/industrialio-core.c | 3 ++- 31 | drivers/staging/iio/light/tsl2563.c | 2 ++ 32 | drivers/staging/iio/ring_sw.c | 2 +- 33 | drivers/staging/rt2860/usb_main_dev.c | 1 + 34 | drivers/staging/rtl8192su/r8192U_core.c | 3 +++ 35 | drivers/staging/usbip/usbip_event.c | 3 +++ 36 | drivers/staging/vme/bridges/vme_tsi148.c | 3 ++- 37 | 14 files changed, 25 insertions(+), 9 deletions(-) 38 | 39 | --------------- 40 | 41 | Andrew Morton (1): 42 | Staging: iio: fix up the iio_get_new_idr_val comment 43 | 44 | Chris Largret (1): 45 | Staging: rt2860: add Belkin F5D8055 Wireless-N USB Dongle device id 46 | 47 | Cyrill Gorcunov (1): 48 | Staging: hv: Fix up memory leak on HvCleanup 49 | 50 | Dan Carpenter (1): 51 | Staging: iio: test for failed allocation 52 | 53 | Eric Lescouet (1): 54 | staging: usbip: Fix deadlock 55 | 56 | H Hartley Sweeten (1): 57 | Staging: dt3155: fix 50Hz configuration 58 | 59 | Haiyang Zhang (1): 60 | Staging: hv: Fix a bug affecting IPv6 61 | 62 | Jonathan Cameron (2): 63 | staging: iio: lis3l02dq - incorrect ws used in container of call. 64 | staging: iio: ring_sw: Fix incorrect test on successful read of last value, causes infinite loop 65 | 66 | Martyn Welch (1): 67 | Staging: vme: Re-introduce necessary brackets 68 | 69 | Pavel Roskin (1): 70 | Staging: rtl8192su: add USB ID for 0bda:8171 71 | 72 | Richard Airlie (1): 73 | staging: rtl8192su: add Support for Belkin F5D8053 v6 74 | 75 | Rodrigo Linfati (1): 76 | Staging: add Add Sitecom WL-349 to rtl8192su 77 | 78 | Sonic Zhang (1): 79 | staging: iio: Function iio_get_new_idr_val() return negative value if fails. 80 | 81 | Stephen Hemminger (1): 82 | Staging: hv: name network device ethX rather than sethX 83 | 84 | Wolfram Sang (2): 85 | Staging: iio: light: fix dangling pointers 86 | Staging: iio: adc: fix dangling pointers 87 | 88 | -------------------------------------------------------------------------------- /git/email_template/tty-2.6.git-patches: -------------------------------------------------------------------------------- 1 | From: Greg KH 2 | To: Linus Torvalds , Andrew Morton 3 | Cc: linux-kernel@vger.kernel.org 4 | Subject: [GIT PATCH] TTY patches for 2.6.35 5 | 6 | Here's the tty patches for the .35 merge window. 7 | 8 | Nothing big here, just some new drivers and assorted minor fixes and the 9 | like. Details are below in the shortlog. 10 | 11 | Please pull from: 12 | master.kernel.org:/pub/scm/linux/kernel/git/gregkh/tty-2.6.git/ 13 | 14 | These patches have been in the linux-next tree and -mm for a while now. 15 | 16 | Patches will be sent to the linux-kernel mailing list, if anyone wants 17 | to see them. 18 | 19 | thanks, 20 | 21 | greg k-h 22 | 23 | ------------ 24 | 25 | drivers/char/Kconfig | 10 +- 26 | drivers/char/Makefile | 1 + 27 | drivers/char/isicom.c | 8 +- 28 | drivers/char/n_gsm.c | 2763 ++++++++++++++++++++++++++++++++++++++ 29 | drivers/char/serial167.c | 223 +--- 30 | drivers/char/tty_buffer.c | 2 +- 31 | drivers/serial/Kconfig | 82 ++- 32 | drivers/serial/Makefile | 2 + 33 | drivers/serial/altera_jtaguart.c | 504 +++++++ 34 | drivers/serial/altera_uart.c | 570 ++++++++ 35 | drivers/serial/bfin_sport_uart.c | 209 ++- 36 | drivers/serial/bfin_sport_uart.h | 27 +- 37 | drivers/serial/timbuart.c | 25 +- 38 | drivers/serial/uartlite.c | 32 +- 39 | include/linux/altera_jtaguart.h | 16 + 40 | include/linux/altera_uart.h | 14 + 41 | include/linux/gsmmux.h | 25 + 42 | include/linux/serial_core.h | 4 + 43 | include/linux/tty.h | 3 +- 44 | 19 files changed, 4196 insertions(+), 324 deletions(-) 45 | create mode 100644 drivers/char/n_gsm.c 46 | create mode 100644 drivers/serial/altera_jtaguart.c 47 | create mode 100644 drivers/serial/altera_uart.c 48 | create mode 100644 include/linux/altera_jtaguart.h 49 | create mode 100644 include/linux/altera_uart.h 50 | create mode 100644 include/linux/gsmmux.h 51 | 52 | --------------- 53 | 54 | Alan Cox (1): 55 | tty: n_gsm line discipline 56 | 57 | Christoph Egger (1): 58 | serial: Tidy REMOTE_DEBUG 59 | 60 | Dan Carpenter (1): 61 | serial: isicomm: handle running out of slots 62 | 63 | Johan Hovold (1): 64 | tty: fix obsolete comment on tty_insert_flip_string_fixed_flag 65 | 66 | John Linn (1): 67 | serial: uartlite: move from byte accesses to word accesses 68 | 69 | Mike Frysinger (4): 70 | serial: bfin_sport_uart: drop useless status masks 71 | serial: bfin_sport_uart: pull in bfin_sport.h for SPORT defines 72 | serial: bfin_sport_uart: drop the experimental markings 73 | serial: bfin_sport_uart: drop redundant cpu depends 74 | 75 | Pavan Savoy (1): 76 | serial: TTY: new ldiscs for staging 77 | 78 | Randy Dunlap (1): 79 | tty: n_gsm: depends on NET 80 | 81 | Richard Röjfors (1): 82 | serial: timbuart: make sure last byte is sent when port is closed 83 | 84 | Roel Kluin (1): 85 | serial: two branches the same in timbuart_set_mctrl() 86 | 87 | Sonic Zhang (9): 88 | serial: bfin_sport_uart: work around anomaly 05000473 (make 32bit fifo read atomic) 89 | serial: bfin_sport_uart: shorten the SPORT TX waiting loop 90 | serial: bfin_sport_uart: remove unused peripheral pin lists 91 | serial: bfin_sport_uart: add missing mapbase initialization 92 | serial: bfin_sport_uart: rename early platform driver class string 93 | serial: bfin_sport_uart: add support for CTS/RTS via GPIOs 94 | serial: bfin_sport_uart: protect changes to uart_port 95 | serial: bfin_sport_uart: zero sport_uart_port if allocated dynamically 96 | serial: bfin_sport_uart: only enable SPORT TX if data is to be sent 97 | 98 | Tobias Klauser (3): 99 | serial: Add driver for the Altera JTAG UART 100 | serial: Add driver for the Altera UART 101 | serial: bfin_sport_uart: Use resource size to fix off-by-one error 102 | 103 | -------------------------------------------------------------------------------- /git/email_template/usb-2.6.git-patches: -------------------------------------------------------------------------------- 1 | From: Greg KH 2 | To: Linus Torvalds , Andrew Morton 3 | Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org 4 | Subject: [GIT PATCH] USB fixes for 2.6.34-git 5 | 6 | Here are a number of USB bugfixes and new device ids for your 2.6.34-git 7 | tree. 8 | 9 | The majority are musb bugfixes, and a variety of other fixes for 10 | problems reported by people, and a few new device ids. 11 | 12 | I also added a wrapper for an api call that we are renaming, so as to 13 | make the merge with linux-next easier (the other kernel trees can now 14 | take those patches.) The bigger rename will happen in .35, but this is 15 | here now to make everyone's lives easier. 16 | 17 | Please pull from: 18 | master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6.git/ 19 | 20 | All of these patches have been in the linux-next and mm trees. 21 | 22 | The full patches will be sent to the linux-usb mailing list, if anyone 23 | wants to see them. 24 | 25 | thanks, 26 | 27 | greg k-h 28 | 29 | ------------ 30 | 31 | arch/arm/plat-omap/include/plat/usb.h | 2 +- 32 | drivers/usb/class/cdc-acm.c | 3 + 33 | drivers/usb/core/Kconfig | 2 +- 34 | drivers/usb/core/generic.c | 2 +- 35 | drivers/usb/core/inode.c | 4 +- 36 | drivers/usb/core/usb.c | 20 ++++---- 37 | drivers/usb/gadget/s3c-hsotg.c | 7 ++- 38 | drivers/usb/host/ohci-at91.c | 2 + 39 | drivers/usb/host/ohci-hub.c | 2 +- 40 | drivers/usb/host/oxu210hp-hcd.c | 6 +- 41 | drivers/usb/host/sl811-hcd.c | 6 +- 42 | drivers/usb/host/xhci-mem.c | 65 +++++++++++++++++++++++++++ 43 | drivers/usb/host/xhci.h | 4 ++ 44 | drivers/usb/musb/Kconfig | 2 +- 45 | drivers/usb/musb/Makefile | 2 +- 46 | drivers/usb/musb/blackfin.c | 8 +--- 47 | drivers/usb/musb/davinci.c | 2 + 48 | drivers/usb/musb/musb_core.c | 77 ++++++++++++++++++-------------- 49 | drivers/usb/musb/musb_core.h | 2 +- 50 | drivers/usb/musb/musb_host.c | 1 + 51 | drivers/usb/musb/omap2430.c | 3 - 52 | drivers/usb/musb/tusb6010.c | 13 ++++++ 53 | drivers/usb/musb/tusb6010_omap.c | 22 ++++++--- 54 | drivers/usb/serial/option.c | 10 ++++ 55 | drivers/usb/serial/pl2303.c | 1 + 56 | drivers/usb/serial/pl2303.h | 1 + 57 | drivers/usb/serial/ti_usb_3410_5052.c | 2 +- 58 | include/linux/usb.h | 18 ++++++- 59 | 28 files changed, 206 insertions(+), 83 deletions(-) 60 | 61 | --------------- 62 | 63 | Ajay Kumar Gupta (2): 64 | musb: fix power field to hold all possible values 65 | musb: save and restore missing bus control register 66 | 67 | Alan Stern (2): 68 | USB: don't choose configs with no interfaces 69 | USB: OHCI: don't look at the root hub to get the number of ports 70 | 71 | Anand Gadiyar (1): 72 | USB: fix build on OMAPs if CONFIG_PM_RUNTIME is not set 73 | 74 | Dan Carpenter (3): 75 | musb: potential use after free 76 | USB: fix testing the wrong variable in fs_create_by_name() 77 | USB: oxu210hp: release spinlock on error path 78 | 79 | Daniel Mack (1): 80 | USB: rename usb_buffer_alloc() and usb_buffer_free() 81 | 82 | Dominik Brodowski (1): 83 | USB: option: add ID for ZTE MF 330 84 | 85 | Greg Kroah-Hartman (1): 86 | USB: serial: option: add cinterion device id 87 | 88 | Julia Lawall (1): 89 | USB: gadget: s3c-hsotg: Add missing unlock 90 | 91 | Mahesh Kuruganti (1): 92 | USB: serial: option: ZTEAC8710 Support with Device ID 0xffff 93 | 94 | Michael Hennerich (1): 95 | USB: sl811-hcd: Fix device disconnect 96 | 97 | Patrice Vilchez (1): 98 | USB: ohci-at91: fix power management hanging 99 | 100 | Randy Dunlap (1): 101 | USB: ti_usb: fix printk format warning 102 | 103 | Russ Nelson (1): 104 | USB: cdc-acm: add another device quirk 105 | 106 | Sarah Sharp (2): 107 | USB: xhci: properly set the "Mult" field of the endpoint context. 108 | USB: xhci: properly set endpoint context fields for periodic eps. 109 | 110 | Sergei Shtylyov (8): 111 | MUSB: Blackfin: don't fake blackfin_interrupt() result 112 | musb_core: don't touch 'musb->clock' in musb_free() 113 | musb_core: don't prevent disabling clock on driver unload 114 | MUSB: DaVinci: fix musb_platform_init() error cleanup path 115 | MUSB: OMAP: don't call clk_put() 116 | musb_core: don't call musb_platform_exit() twice 117 | MUSB: fix DaVinci glue layer dependency 118 | musb_core: fix musb_init_controller() error cleanup path 119 | 120 | Simone Contini (1): 121 | USB: serial: pl2303: Hybrid reader Uniform HCR331 122 | 123 | Tony Lindgren (1): 124 | usb: Fix tusb6010 for DMA API 125 | 126 | -------------------------------------------------------------------------------- /git/mk_msg: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TMP_FILE=$1 4 | 5 | echo > $TMP_FILE 6 | #git diff origin..HEAD | diffstat -p1 >> $TMP_FILE 7 | git diff -M --stat --summary origin..HEAD >> $TMP_FILE 8 | echo >> $TMP_FILE 9 | echo "---------------" >> $TMP_FILE 10 | echo >> $TMP_FILE 11 | git log --no-merges origin..HEAD | git shortlog >> $TMP_FILE 12 | git format-patch -M -n origin..HEAD 13 | 14 | echo "git send-email --to linux-pci@atrey.karlin.mff.cuni.cz --no-chain-reply-to *.patch" 15 | 16 | -------------------------------------------------------------------------------- /git/mk_patches: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git format-patch -k -M -N staging-next..HEAD 4 | -------------------------------------------------------------------------------- /git/old/aoe-2.6.19-rc2.git-patches: -------------------------------------------------------------------------------- 1 | From: Greg KH 2 | To: Linus Torvalds , Andrew Morton 3 | Cc: linux-kernel@vger.kernel.org, 4 | Subject: [GIT PATCH] AOE fixes and update for 2.6.19-rc2 5 | 6 | Here are some ATA over Ethernet patches against your current git tree. 7 | They all have been in the -mm tree for a few months. 8 | 9 | Please pull from: 10 | rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/aoe-2.6.git/ 11 | or from: 12 | master.kernel.org:/pub/scm/linux/kernel/git/gregkh/aoe-2.6.git/ 13 | if it isn't synced up yet. 14 | 15 | The full patch series will sent to the linux-kernel mailing list, if 16 | anyone wants to see them. 17 | 18 | thanks, 19 | 20 | greg k-h 21 | 22 | 23 | drivers/block/aoe/aoe.h | 30 ++-- 24 | drivers/block/aoe/aoeblk.c | 44 +++--- 25 | drivers/block/aoe/aoechr.c | 18 +-- 26 | drivers/block/aoe/aoecmd.c | 303 ++++++++++++++++++++++++++++--------------- 27 | drivers/block/aoe/aoedev.c | 52 +++++-- 28 | drivers/block/aoe/aoemain.c | 10 + 29 | drivers/block/aoe/aoenet.c | 9 + 30 | 7 files changed, 287 insertions(+), 179 deletions(-) 31 | 32 | --------------- 33 | 34 | Ed L Cashin: 35 | aoe: eliminate isbusy message 36 | aoe: update copyright date 37 | aoe: remove unused NARGS enum 38 | aoe: zero copy write 1 of 2 39 | aoe: jumbo frame support 1 of 2 40 | aoe: clean up printks via macros 41 | aoe: jumbo frame support 2 of 2 42 | aoe: improve retransmission heuristics 43 | aoe: zero copy write 2 of 2 44 | aoe: module parameter for device timeout 45 | aoe: use bio->bi_idx 46 | aoe: remove sysfs comment 47 | aoe: update driver version 48 | aoe: revert printk macros 49 | 50 | Greg Kroah-Hartman: 51 | aoe: fix sysfs_create_file warnings 52 | 53 | -------------------------------------------------------------------------------- /git/old/docs-2.6.git-patches: -------------------------------------------------------------------------------- 1 | From: Greg KH 2 | To: Linus Torvalds , Andrew Morton 3 | Cc: linux-kernel@vger.kernel.org 4 | Subject: [GIT PATCH] Documentation patches for 2.6.22 5 | 6 | Here are some patches that add some translations of some procedural 7 | documentation files to the Documentation/ tree. 8 | 9 | I know that kernel development is in English, but translations of a 10 | small subset of documentation files that go over procedures and how to 11 | get involved in the community is something that I feel is important and 12 | will bring in more developers in the end. Having these files in the 13 | kernel tree is a good way to keep a central location that all can see 14 | and easily find, instead of hiding them away on different web sites that 15 | might be harder to update by anyone who needs to do so. 16 | 17 | These files change _very_ slowly over time, and are quite easy to keep 18 | up to date by the translators. 19 | 20 | These patches have been in the -mm tree for a large number of months. 21 | 22 | Please pull from: 23 | master.kernel.org:/pub/scm/linux/kernel/git/gregkh/docs-2.6.git/ 24 | 25 | Patches will be sent as a follow-on to this message to lkml for people 26 | to see. 27 | 28 | thanks, 29 | 30 | greg k-h 31 | 32 | 33 | Documentation/ja_JP/HOWTO | 650 +++++++++++++++++++++++++++ 34 | Documentation/ja_JP/stable_api_nonsense.txt | 263 +++++++++++ 35 | Documentation/zh_CN/HOWTO | 536 ++++++++++++++++++++++ 36 | Documentation/zh_CN/stable_api_nonsense.txt | 157 +++++++ 37 | 4 files changed, 1606 insertions(+), 0 deletions(-) 38 | create mode 100644 Documentation/ja_JP/HOWTO 39 | create mode 100644 Documentation/ja_JP/stable_api_nonsense.txt 40 | create mode 100644 Documentation/zh_CN/HOWTO 41 | create mode 100644 Documentation/zh_CN/stable_api_nonsense.txt 42 | 43 | --------------- 44 | 45 | IKEDA, Munehiro (1): 46 | Documentation: add Japanese translated stable_api_nonsense.txt 47 | 48 | Li Yang (2): 49 | HOWTO: add Chinese translation of Documentation/HOWTO 50 | zh_CN/HOWTO: update URLs of git trees 51 | 52 | TripleX (1): 53 | Chinese translation of Documentation/stable_api_nonsense.txt 54 | 55 | Tsugikazu Shibata (1): 56 | HOWTO: add Japanese translation of Documentation/HOWTO 57 | 58 | -------------------------------------------------------------------------------- /git/old/dorelease: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # build -stable release from current -stable series 3 | # Copyright (c) 2005 Chris Wright 4 | 5 | if [ $# -ne 1 ]; then 6 | echo -e "Usage:\t $0 release_number\ne.g.\t $0 2.6.11.12" 7 | exit 1 8 | fi 9 | 10 | #if [ -z "${GIT_GPG_KEY}" ]; then 11 | # echo -e "Error:\tMust set GIT_GPG_KEY env variable" 12 | # exit 1 13 | #fi 14 | # 15 | #git-tag -u "${GIT_GPG_KEY}" -m "this is a TEST" vTest 16 | #exit 0 17 | 18 | RELEASE=$1 19 | REL_ARRAY=(${RELEASE//./ }) 20 | BASE=${REL_ARRAY[0]}.${REL_ARRAY[1]}.${REL_ARRAY[2]} 21 | REL=${REL_ARRAY[3]} 22 | LAST=$(($REL - 1)) 23 | if [ $LAST -eq 0 ]; then 24 | LAST_REL=${BASE} 25 | else 26 | LAST_REL=${BASE}.${LAST} 27 | fi 28 | 29 | RELEASE=2.6.18-rc4 30 | BASE=2.6.17 31 | LAST_REL=2.6.18-rc3 32 | REL=rc3 33 | 34 | 35 | echo "creating stable release $RELEASE (base $BASE last version $LAST_REL)" 36 | echo "[ret] to continue ^C to quit" 37 | read 38 | 39 | RELDIR="../release-$RELEASE" 40 | mkdir $RELDIR 41 | 42 | # apply patches 43 | #quilt series | while read PATCH 44 | #do 45 | # cat $PATCH >> $RELDIR/apply.mbox 46 | #done 47 | #git-applymbox $RELDIR/apply.mbox 48 | #rm $RELDIR/apply.mbox 49 | 50 | # update EXTRAVERSION 51 | #vim +/^EXTRAVERSION Makefile 52 | 53 | # check that the EXTRAVERSION change is all that's outstanding 54 | echo 55 | echo "**** About to commit ****" 56 | echo 57 | git-diff-files -p 58 | 59 | echo "[ret] to continue" 60 | read 61 | 62 | # commit EXTRAVERSION change 63 | #git-update-cache Makefile 64 | #RELEASE_COMMIT=$(echo "Linux $RELEASE" | git-commit-tree $(git-write-tree) -p HEAD) 65 | #echo $RELEASE_COMMIT > .git/HEAD 66 | 67 | # tag it 68 | #git-tag-script -u ${GIT_GPG_KEY} -m "This is the $RELEASE stable release" v$RELEASE 69 | 70 | BASE_COMMIT="$(git-cat-file tag $(cat .git/refs/tags/v${BASE}) | grep object | cut -d" " -f2)" 71 | LAST_COMMIT="$(git-cat-file tag $(cat .git/refs/tags/v${LAST_REL}) | grep object | cut -d" " -f2)" 72 | RELEASE_COMMIT="$(git-cat-file tag $(cat .git/refs/tags/v${RELEASE}) | grep object | cut -d" " -f2)" 73 | 74 | echo "BASE_COMMIT=$BASE_COMMIT" 75 | echo "LAST_COMMIT=$LAST_COMMIT" 76 | echo "RELEASE_COMMIT=$RELEASE_COMMIT" 77 | 78 | # build release materials, tarball, base patch, incr patch, changelog 79 | git-tar-tree HEAD linux-$RELEASE | gzip -9 > $RELDIR/linux-${RELEASE}.tar.gz 80 | git-diff-tree -p $BASE_COMMIT $RELEASE_COMMIT | gzip -9 > $RELDIR/patch-${RELEASE}.gz 81 | git-diff-tree -p $LAST_COMMIT $RELEASE_COMMIT | gzip -9 > $RELDIR/patch-${LAST_REL}-${REL}.gz 82 | zcat $RELDIR/patch-${LAST_REL}-${REL}.gz | diffstat -p1 > $RELDIR/diffstat-${LAST_REL}-${REL} 2>/dev/null 83 | git log ${LAST_COMMIT}..${RELEASE_COMMIT} > $RELDIR/ChangeLog-$RELEASE 84 | < $RELDIR/ChangeLog-$RELEASE git-shortlog > $RELDIR/shortlog-$RELEASE 85 | 86 | echo "ready to upload files" 87 | echo "scp $RELDIR/* master.kernel.org:$RELDIR/" 88 | echo "don't forget to update LATEST-IS" 89 | -------------------------------------------------------------------------------- /git/old/g_foo: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Make a log of changes in a GIT branch. 4 | # 5 | # This script was originally written by (c) Ross Vandegrift. 6 | # Adapted to his scripts set by (c) Petr Baudis, 2005. 7 | # Major optimizations by (c) Phillip Lougher. 8 | # Rendered trivial by Linus Torvalds. 9 | # Added -L|-R option by James Bottomley 10 | # 11 | # Takes an id resolving to a commit to start from (HEAD by default). 12 | # 13 | # Hacked into pieces by gregkh. 14 | # 15 | # use by running: 16 | # cd my_git_tree 17 | # ../g_foo ../clean_linus_tree 18 | # a bunch of log messages will go by, I think it's wrong. 19 | # a bunch of individual patches will be in /tmp/ starting with git-* 20 | # that's the patches that are in your tree and not the "clean" one. 21 | # 22 | 23 | tmpfile=/tmp/git_changes.$$ 24 | 25 | diffsearch=- 26 | remote="$1" 27 | shift; 28 | 29 | if [ -z "$base" ]; then 30 | base=$(cat .git/HEAD) || exit 1 31 | fi 32 | 33 | git-rev-tree $base | sort -rn > ${tmpfile}.base 34 | if [ -n "$remote" ]; then 35 | [ -d $remote/.git ] || exit 1 36 | pushd $remote > /dev/null 37 | git-rev-tree $(cat .git/HEAD) | sort -rn > ${tmpfile}.remote 38 | diff -u ${tmpfile}.base ${tmpfile}.remote | grep "^${diffsearch}[^${diffsearch}]" | cut -c 1- > ${tmpfile}.diff 39 | rm -f ${tmpfile}.base ${tmpfile}.remote 40 | mv ${tmpfile}.diff ${tmpfile}.base 41 | if [ $diffsearch = "-" ]; then 42 | popd > /dev/null 43 | fi 44 | fi 45 | 46 | [ -s "${tmpfile}.base" ] || exit 0 47 | 48 | # if you want to play with this, just use the commits in the ${tmpfile}.base file to 49 | # do something with now. 50 | 51 | ### gregkh 52 | #echo "${tmpfile}.base" 53 | patch_num=999 54 | cat ${tmpfile}.base | while read time commit parents; do 55 | git-rev-list --pretty ^${parents%:*} ${commit%:*} 56 | 57 | file=/tmp/git-$patch_num.patch 58 | # write the original author out as first line of the file: 59 | # git-rev-list --pretty ${commit%:*} ${parents%:*} | grep "^Author" | cut -f 2 -d "<" | cut -f 1 -d ">" > $file 60 | git-cat-file commit ${commit%:*} | grep "^author" | cut -f 2 -d "<" | cut -f 1 -d ">" > $file 61 | # write out the subject of the file: 62 | # git-rev-list --header ${commit%:*} ${parents%:*} | head -n 7 | tail -n 1 >> $file 63 | git-cat-file commit ${commit%:*} | head -n 6 | tail -n 1 >> $file 64 | # write out the whole patch 65 | # git-diff-tree -p -v ${commit%:*} ${parents%:*} >> $file 66 | cg-mkpatch -r ${commit%:*} >> $file 67 | let patch_num-- 68 | done 69 | rm -f ${tmpfile}.base 70 | -------------------------------------------------------------------------------- /git/old/hwmon-2.6.19-rc2.git-patches: -------------------------------------------------------------------------------- 1 | From: Greg KH 2 | To: Linus Torvalds , Andrew Morton 3 | Cc: linux-kernel@vger.kernel.org, lm-sensors@lm-sensors.org, Jean Delvare 4 | Subject: [GIT PATCH] HWMon fixes for 2.6.19-rc2 5 | 6 | Here are some hwmon fixes for 2.6.19-rc2. 7 | 8 | They have all been in the -mm tree for a while. 9 | 10 | Please pull from: 11 | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/hwmon-2.6.git/ 12 | or from: 13 | master.kernel.org:/pub/scm/linux/kernel/git/gregkh/hwmon-2.6.git/ 14 | if it isn't synced up yet. 15 | 16 | The full patch series will sent to the sensors mailing list, if anyone 17 | wants to see them. 18 | 19 | thanks, 20 | 21 | greg k-h 22 | 23 | Documentation/hwmon/adm9240 | 2 - 24 | Documentation/hwmon/f71805f | 2 - 25 | Documentation/hwmon/k8temp | 13 ++++-- 26 | Documentation/hwmon/smsc47m1 | 4 +- 27 | Documentation/hwmon/w83627ehf | 6 +-- 28 | MAINTAINERS | 6 +++ 29 | drivers/hwmon/Kconfig | 10 +++-- 30 | drivers/hwmon/adm9240.c | 4 +- 31 | drivers/hwmon/lm78.c | 12 +++--- 32 | drivers/hwmon/smsc47m1.c | 11 +++-- 33 | drivers/hwmon/w83627ehf.c | 11 ++++- 34 | drivers/hwmon/w83781d.c | 30 ++++++++------ 35 | drivers/hwmon/w83791d.c | 85 +++++++++++++++++++++++++++-------------- 36 | drivers/i2c/busses/i2c-isa.c | 2 - 37 | 14 files changed, 124 insertions(+), 74 deletions(-) 38 | 39 | --------------- 40 | 41 | Grant Coady: 42 | adm9240: Update Grant Coady's email address 43 | 44 | Jean Delvare: 45 | hwmon: Fix documentation typos 46 | smsc47m1: List the SMSC LPC47M112 as supported 47 | hwmon: Let w83781d and lm78 load again 48 | hwmon: Fix debug messages in w83781d 49 | 50 | Jim Cromie: 51 | w83791d: Fix unchecked return status 52 | 53 | Rudolf Marek: 54 | k8temp: Documentation update 55 | w83627ehf: Fix the detection of fan5 56 | 57 | -------------------------------------------------------------------------------- /git/old/make_tree: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$1 4 | 5 | mkdir $DIR 6 | cd $DIR 7 | mkdir .git 8 | cp ~/linux/git/bleed-2.6.git/HEAD .git/ 9 | cp -rl ~/linux/git/bleed-2.6.git/objects/ .git/objects/ 10 | 11 | sh ~/linux/git/update_to_head 12 | 13 | 14 | -------------------------------------------------------------------------------- /git/old/parent: -------------------------------------------------------------------------------- 1 | gregkh@master.kernel.org:/pub/scm/linux/kernel/git/gregkh/devfs-2.6.git 2 | -------------------------------------------------------------------------------- /git/old/pci-2.6.git-patches: -------------------------------------------------------------------------------- 1 | From: Greg KH 2 | To: Linus Torvalds , Andrew Morton 3 | Cc: linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz, pcihpd-discuss@lists.sourceforge.net, Guennadi Liakhovetski 4 | Subject: [GIT PATCH] PCI fixes for 2.6.25-rc6 git tree 5 | 6 | Here are two PCI fixes for your 2.6.25-rc6 git tree. 7 | 8 | They are: 9 | - revert a troublesome PCI patch 10 | - iommu lockdep reporting fix 11 | 12 | Please pull from: 13 | master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6.git/ 14 | 15 | All of these patches have been in the -mm tree for a while, as well as 16 | -next. 17 | 18 | thanks, 19 | 20 | greg k-h 21 | 22 | 23 | ------------- 24 | 25 | drivers/pci/intel-iommu.c | 7 +++++++ 26 | drivers/pci/pci.c | 21 --------------------- 27 | include/linux/pci.h | 4 ---- 28 | 3 files changed, 7 insertions(+), 25 deletions(-) 29 | 30 | --------------- 31 | 32 | Andrew Morton (1): 33 | PCI: revert "pcie: utilize pcie transaction pending bit" 34 | 35 | Mark Gross (1): 36 | PCI: iova: lockdep false alarm fix 37 | 38 | -------------------------------------------------------------------------------- /git/old/uio-2.6.git-patches: -------------------------------------------------------------------------------- 1 | From: Greg KH 2 | To: Linus Torvalds , Andrew Morton 3 | Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, Benedikt Spranger , Hans J. Koch 4 | Subject: [GIT PATCH] UIO patches for 2.6.22 5 | 6 | Here are the UIO (Userspace I/O driver framework) patches for 2.6.22 7 | 8 | They have been revamped from the last time you have seen them, and they 9 | include a real driver, the Hilscher CIF DeviceNet and Profibus card 10 | controller, which is being used in production systems with this driver 11 | framework right now. The kernel driver they replaced was a total mess, 12 | with over 60+ ioctls to try to control the different aspects of the 13 | device. See the last patch in this series for more details on this 14 | driver. 15 | 16 | These patches include full documentation, are self-contained from the 17 | rest of the kernel, and have been in the -mm tree for the past few 18 | months with no complaints. 19 | 20 | Please pull from: 21 | master.kernel.org:/pub/scm/linux/kernel/git/gregkh/uio-2.6.git/ 22 | 23 | Patches will be sent as a follow-on to this message to lkml for people 24 | to see. 25 | 26 | thanks, 27 | 28 | greg k-h 29 | 30 | 31 | Documentation/DocBook/kernel-api.tmpl | 4 + 32 | Documentation/DocBook/uio-howto.tmpl | 611 ++++++++++++++++++++++++++++ 33 | drivers/Kconfig | 1 + 34 | drivers/Makefile | 1 + 35 | drivers/uio/Kconfig | 29 ++ 36 | drivers/uio/Makefile | 2 + 37 | drivers/uio/uio.c | 701 +++++++++++++++++++++++++++++++++ 38 | drivers/uio/uio_cif.c | 156 ++++++++ 39 | include/linux/uio_driver.h | 91 +++++ 40 | 9 files changed, 1596 insertions(+), 0 deletions(-) 41 | create mode 100644 Documentation/DocBook/uio-howto.tmpl 42 | create mode 100644 drivers/uio/Kconfig 43 | create mode 100644 drivers/uio/Makefile 44 | create mode 100644 drivers/uio/uio.c 45 | create mode 100644 drivers/uio/uio_cif.c 46 | create mode 100644 include/linux/uio_driver.h 47 | 48 | --------------- 49 | 50 | Hans J. Koch (2): 51 | UIO: Add the User IO core code 52 | UIO: Documentation 53 | 54 | Hans-Jürgen Koch (1): 55 | UIO: Hilscher CIF card driver 56 | 57 | -------------------------------------------------------------------------------- /git/old/w1-2.6.18-rc1.git-patches: -------------------------------------------------------------------------------- 1 | From: Greg KH 2 | To: Linus Torvalds , Andrew Morton 3 | Cc: linux-kernel@vger.kernel.org, Evgeniy Polyakov 4 | Subject: [GIT PATCH] W1 patches for 2.6.18-rc1 5 | 6 | Here are some tiny w1 patches that have been in the -mm tree for a 7 | while. They fix a bug, remove an unneeded .h file, and update the 8 | MAINTAINERS file. 9 | 10 | Please pull from: 11 | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/w1-2.6.git/ 12 | or from: 13 | master.kernel.org:/pub/scm/linux/kernel/git/gregkh/w1-2.6.git/ 14 | if it isn't synced up yet. 15 | 16 | The full patch series will sent to the linux-kernel mailing list, if 17 | anyone wants to see them. 18 | 19 | thanks, 20 | 21 | greg k-h 22 | 23 | 24 | MAINTAINERS | 1 - 25 | drivers/w1/masters/ds2482.c | 2 +- 26 | drivers/w1/w1_io.h | 36 ------------------------------------ 27 | 3 files changed, 1 insertions(+), 38 deletions(-) 28 | delete mode 100644 drivers/w1/w1_io.h 29 | 30 | --------------- 31 | 32 | Adrian Bunk: 33 | w1: remove drivers/w1/w1.h 34 | 35 | Ben Gardner: 36 | w1: fix idle check loop in ds2482 37 | 38 | Evgeniy Polyakov: 39 | W1: remove w1 mail list from lm_sensors. 40 | 41 | -------------------------------------------------------------------------------- /git/push_git: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | PWD=`pwd` 3 | BASE=`basename $PWD` 4 | GITTREE="gregkh@master.kernel.org:/pub/scm/linux/kernel/git/gregkh/$BASE.git" 5 | echo -n "push to '$GITTREE'?" 6 | read -n 1 YES 7 | 8 | echo "YES = '$YES'" 9 | 10 | if [ "$YES" == "y" ]; then 11 | git push $GITTREE 12 | fi 13 | -------------------------------------------------------------------------------- /lf_usb.ids: -------------------------------------------------------------------------------- 1 | # Linux Foundation USB id list. 2 | 3 | 1d6b Linux Foundation 4 | 0001 1.1 root hub 5 | 0002 2.0 root hub 6 | 0003 3.0 root hub 7 | 0010 USB Debug Target 8 | 0011 USB GDB Target 9 | 0100 PTP Gadget 10 | 0101 Audio Gadget 11 | 0102 EEM Gadget 12 | 0103 NCM (Ethernet) Gadget 13 | 0104 Multifunction Composite Gadget 14 | 0105 FunctionFS Gadget 15 | 0106 Composite Gadget: ACM + Mass Storage 16 | 0107 Embedded Hub Gadgetg 17 | 0200 Qemu Audio Device 18 | 0246 BlueZ Host Stack 19 | 0247 BlueZ for Android 20 | 21 | 22 | -------------------------------------------------------------------------------- /longterm/.gitignore: -------------------------------------------------------------------------------- 1 | linux-2.6* 2 | longterm-queue* 3 | release-* 4 | s 5 | -------------------------------------------------------------------------------- /longterm/added-to-longterm-version: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | KERNEL_MINOR_VERSION=$1 4 | shift 5 | echo "VERSION=$KERNEL_MINOR_VERSION" 6 | 7 | #KERNEL_MINOR_VERSION='32' 8 | KERNEL="2.6.$KERNEL_MINOR_VERSION" 9 | 10 | EMAIL_ADDRESS='' 11 | 12 | STABLE='' 13 | STABLE_COMMITS='' 14 | 15 | extract_addr() 16 | { 17 | read l 18 | read l 19 | read l 20 | read l 21 | a=$(echo "$l" | sed -n -e 's/.*<\(.*@[^>]*\).*/\1/p') 22 | echo $a 23 | } 24 | 25 | if [ x"$SMTP_SERVER" = x ] 26 | then 27 | SMTP_SERVER=localhost:25 28 | fi 29 | 30 | if [ x"$EMAIL_ADDRESS" = x ] 31 | then 32 | echo "You must set the EMAIL_ADDRESS environment variable to your email address" 33 | exit 1 34 | fi 35 | FROM=$EMAIL_ADDRESS 36 | 37 | TO="" 38 | CC="" 39 | 40 | author() 41 | { 42 | first_author="" 43 | TXT=$2 44 | if [ ! -f $TXT ] 45 | then 46 | echo "$TXT is missing" 47 | exit 1 48 | fi 49 | author="" 50 | while read l 51 | do 52 | # skip the Message-ID: line so we don't send email to the wrong place 53 | ## echo "$l" 54 | reply=$(echo "$l" | grep -i Message-ID:) 55 | if [ x"$reply" != x ] 56 | then 57 | continue 58 | fi 59 | 60 | # if this is the start of the diff, then it's time to stop looking 61 | diff=$(echo "$l" | grep "^---") 62 | if [ x"$diff" != x ] 63 | then 64 | ## echo "diffstart!!!!!" 65 | break 66 | fi 67 | 68 | for x in $l 69 | do 70 | a=$(echo "$x" | sed -n -e 's/.*<\(.*@[^>]*\).*/\1/p') 71 | if [ x"$a" != x ] 72 | then 73 | if [ x"$author" == x ] 74 | then 75 | author=$a 76 | first_author=$a 77 | else 78 | author="$author $a" 79 | fi 80 | fi 81 | done 82 | done < $TXT 83 | author=$(echo "$author" | tr ' ' '\n' | grep -v "$first_author" | 84 | sort | uniq) 85 | author="$first_author $author" 86 | eval $1=$(echo $author | sed -e 's/ /,/g') 87 | if [ x"$3" != x ] 88 | then 89 | eval $3=$first_author 90 | fi 91 | } 92 | 93 | 94 | 95 | reply() 96 | { 97 | PATCH=$1 98 | # patch_name=$(stripit $1) 99 | # PATCH=$P/patches/$patch_name.patch 100 | # TXT=$P/txt/$patch_name.txt 101 | # if [ ! -f $TXT ] 102 | # then 103 | # echo $TXT is missing 104 | # exit 1 105 | # fi 106 | echo "PATCH=$PATCH" 107 | # SUBJECT=`grep "Subject:" $PATCH` 108 | SUBJECT=`grep "Subject:" $PATCH | sed s/Subject\:\ //` 109 | # SUBJECT=$(head -n 2 $PATCH | tail -n 1) 110 | MESSAGE_ID=`grep -i "^Message-ID:" $PATCH | cut -f 2 -d ' ' | cut -f 2 -d '<' | cut -f 1 -d '>'` 111 | author AUTHOR $1 FIRST_AUTHOR 112 | ## echo "author said $AUTHOR" 113 | ## echo "first_author said $FIRST_AUTHOR" 114 | if [ x"$AUTHOR" == "x" ] 115 | then 116 | echo "nobody to notify" 117 | exit 0 118 | fi 119 | to="" 120 | for i in $(echo "$AUTHOR" | sed -e 's/,/ /g') 121 | do 122 | if ! echo "$TO" | grep "$i" 123 | then 124 | to=$to" -to $i" 125 | fi 126 | done 127 | if [ x"$cc" != x ] 128 | then 129 | cc="-cc $cc" 130 | fi 131 | 132 | # SUBJECT="patch $PATCH added to $KERNEL-stable tree" 133 | 134 | CHARSET=$(guess-charset "$PATCH") 135 | if test "x$CHARSET" = "ANSI_X3.4-1968"; then 136 | CHARSET= 137 | else 138 | CHARCMD="-charset=$CHARSET" 139 | fi 140 | 141 | ID=`make_message_id` 142 | 143 | ## echo "makemail -to $AUTHOR -from=$FROM -subject=\"$SUBJECT\" -date=\"$(date -R)\" -reply_to=$MESSAGE_ID --message=$ID $CHARCMD" 144 | # echo "smtpsend -server=$SMTP_SERVER $to -from=$FROM" 145 | 146 | 147 | ( 148 | echo 149 | echo "This is a note to let you know that I've just added the patch titled" 150 | echo 151 | echo " $SUBJECT" 152 | echo 153 | echo "to the $KERNEL-longterm tree which can be found at:" 154 | echo " http://www.kernel.org/git/?p=linux/kernel/git/longterm/longterm-queue-$KERNEL.git;a=summary" 155 | echo 156 | echo "The filename of the patch is:" 157 | echo " " `basename "$PATCH"` 158 | echo "and it can be found in the queue-$KERNEL subdirectory." 159 | echo 160 | echo "If you, or anyone else, feels it should not be added to the $KERNEL longterm tree," 161 | echo "please let know about it." 162 | echo 163 | echo 164 | cat $PATCH 165 | echo 166 | echo 167 | echo -n "Patches currently in longterm-queue-$KERNEL which might be from " 168 | echo "$FIRST_AUTHOR are" 169 | echo 170 | grep -lR $FIRST_AUTHOR /home/gregkh/linux/longterm/longterm-queue-$KERNEL/queue-$KERNEL/ 2> /dev/null | 171 | sed -e 's/\/home\/gregkh\/linux\/longterm\/longterm-queue-$KERNEL\///' 172 | ) | 173 | makemail -to "$AUTHOR" \ 174 | -from="$FROM" \ 175 | -cc="$STABLE, $STABLE_COMMITS" \ 176 | -subject="Patch \"$SUBJECT\" has been added to the $KERNEL-longterm tree" \ 177 | -date="$(date -R)" \ 178 | -reply_to="$MESSAGE_ID" \ 179 | -message_id="$ID" \ 180 | "$CHARCMD" \ 181 | | \ 182 | ~/bin/msmtp-enqueue.sh -a coco "$to" 183 | #msmtp $to 184 | } 185 | 186 | for patch_file in $* 187 | do 188 | reply $patch_file 189 | echo "acknowledged $patch_file" 190 | ## echo "-----------------------------------------------" 191 | ## echo 192 | done 193 | -------------------------------------------------------------------------------- /longterm/apply_it: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Text color variables 4 | txtund=$(tput sgr 0 1) # Underline 5 | txtbld=$(tput bold) # Bold 6 | txtred=$(tput setaf 1) # Red 7 | txtgrn=$(tput setaf 2) # Green 8 | txtylw=$(tput setaf 3) # Yellow 9 | txtblu=$(tput setaf 4) # Blue 10 | txtpur=$(tput setaf 5) # Purple 11 | txtcyn=$(tput setaf 6) # Cyan 12 | txtwht=$(tput setaf 7) # White 13 | txtrst=$(tput sgr0) # Text reset 14 | 15 | PATCH=$1 16 | if [ "$PATCH" == "" ] ; then 17 | echo "you need a patch!" 18 | exit 19 | fi 20 | 21 | #echo "PATCH=$PATCH" 22 | 23 | apply_it () 24 | { 25 | VERSION=$1 26 | DIR="linux-2.6.$VERSION.y" 27 | # echo "DIR=$DIR" 28 | 29 | echo -n "${txtrst}Applying $PATCH to $DIR " 30 | 31 | cd $DIR 32 | quilt import ../$PATCH &> /dev/null 33 | quilt push &> /dev/null 34 | if [ $? -ne 0 ] ; then 35 | echo "${txtred} FAILED${txtrst}" 36 | else 37 | quilt ref &> /dev/null 38 | echo "${txtgrn} SUCCEEDED${txtrst}" 39 | fi 40 | cd .. 41 | } 42 | 43 | #apply_it 33 44 | apply_it 32 45 | 46 | -------------------------------------------------------------------------------- /longterm/do_it_all: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VERSION=$1 4 | if [ "$VERSION" == "" ] ; then 5 | echo "you need a version!" 6 | exit 7 | fi 8 | echo "VERSION=$VERSION" 9 | DIR="queue-2.6.$VERSION" 10 | 11 | 12 | # create a temp directory and copy the patches there 13 | # FIXME, use a "real" temp directory name, not just tmp, as that messes things 14 | # up when the script is run twice at the same time for different versions. 15 | mkdir ../tmp 16 | git ls-files -o | grep queue-2\.6\.$VERSION | xargs -i cp {} -v ../tmp/ 17 | 18 | # create a commit message 19 | # FIXME, use a "real" temporary file name, not just 'commit.msg' 20 | echo "2.6.${VERSION}-stable patches" > commit.msg 21 | echo "" >> commit.msg 22 | echo "added patches:" >> commit.msg 23 | for file in `ls ../tmp/` 24 | do 25 | echo " `basename $file`" >> commit.msg 26 | done 27 | 28 | # add the files and commit them to git 29 | git add $DIR 30 | git commit $DIR -F commit.msg 31 | rm commit.msg 32 | 33 | # do notification for the authors that the patches are now added to the tree. 34 | for file in `ls ../tmp/` 35 | do 36 | ../added-to-longterm-version $VERSION ../tmp/$file 37 | done 38 | 39 | rm -rf ../tmp/ 40 | 41 | ONLINE=`gregkh_machine_online` 42 | # Only push if we have a network connection 43 | if [ "$ONLINE" = "1" ] ; then 44 | git push kroah.com && git push 45 | fi 46 | 47 | -------------------------------------------------------------------------------- /longterm/mbox2send: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -W 2 | # 3 | # This takes a mbox of email, created with 'quilt mail --mbox' 4 | # and formats it in the proper way to send off a -longterm kernel review. 5 | # 6 | # This means: 7 | # - strip off some quilt headers and the threading 8 | # - add some text at the top of every message. 9 | # 10 | # Written in perl because the bash version is broken, it doesn't pass 11 | # through the patch correctly :( 12 | # 13 | 14 | my $line; 15 | 16 | my $version = shift; 17 | 18 | if ($version eq "") { 19 | print "must provide kernel version number\n"; 20 | die; 21 | } 22 | 23 | my $mbox = shift; 24 | 25 | if ($mbox eq "") { 26 | print "must provide the name of the mbox file\n"; 27 | die; 28 | } 29 | 30 | $mboxnew = "$mbox.new"; 31 | chomp($mboxnew); 32 | 33 | open MBOX, "$mbox" || die "Failed to open $mbox"; 34 | open FILE, ">$mboxnew" || die "Failed to create $mboxnew"; 35 | 36 | my $header = "true"; 37 | my $eat = "false"; 38 | 39 | while ($line = ) { 40 | $eat = "false"; 41 | 42 | if ($header eq "false") { 43 | if ($line =~ m/^From /) { 44 | # start of a message, this is the header 45 | $header = "true"; 46 | } 47 | } 48 | 49 | if ($header eq "true") { 50 | # strip out References line 51 | if ($line =~ m/^References:/) { 52 | # eat the line 53 | $eat = "true"; 54 | } 55 | # strip out the Content-Disposition line 56 | if ($line =~ m/Content-Disposition:/) { 57 | # eat the line 58 | $eat = "true"; 59 | 60 | # we are now out of the header 61 | $header = "false"; 62 | 63 | # write out our custom header too 64 | print FILE "\n"; 65 | print FILE "2.6.$version-longterm review patch. If anyone has any objections, please let me know.\n"; 66 | print FILE "\n"; 67 | print FILE "------------------\n"; 68 | } 69 | } 70 | 71 | if ($eat eq "false") { 72 | print FILE $line; 73 | } 74 | } 75 | close MBOX; 76 | close FILE; 77 | 78 | print "# New mailbox is in $mboxnew\n"; 79 | print "# To send the patches out, do:\n"; 80 | print "cat $mboxnew | formail -A \"In-Reply-To: \" -s msmtp-enqueue.sh\n"; 81 | -------------------------------------------------------------------------------- /longterm/s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | USER=`whoami` 4 | 5 | DIR=/home/$USER/linux/longterm 6 | SCRIPT_DIR=/home/$USER/linux/scripts 7 | KERNEL_DIR=$DIR/linux-2.6.32.y 8 | 9 | cd $DIR 10 | cat - > $DIR/foo.patch 11 | #perl $DIR/x.pl 12 | dos2unix $DIR/foo.patch 13 | $SCRIPT_DIR/fix_patch $DIR/foo.patch 14 | #vim -T xterm $DIR/foo.patch 15 | ${VISUAL:-${EDITOR:-vi}} "$DIR/foo.patch" < /dev/tty 16 | file=`rename-patch $DIR/foo.patch` 17 | echo "filename is $file" 18 | cd $KERNEL_DIR 19 | pwd 20 | #quilt import $DIR/$file 21 | quilt import $file 22 | quilt push && quilt ref && quilt pop && quilt push 23 | 24 | -------------------------------------------------------------------------------- /notes: -------------------------------------------------------------------------------- 1 | # run dyad rust tests for all cves created 2 | RUN_INTEGRATION_TESTS=1 cargo test -- --ignored 3 | 4 | lore_reply () { 5 | if [[ "${1}" == "" ]] || [[ ! "${1}" =~ "lore.kernel.org" ]]; then 6 | echo "First (only) argument should be a LORE link" 7 | return 8 | fi 9 | 10 | mbox=$(mktemp --suffix=.mbox) 11 | b4 mbox -n $mbox $1 12 | mutt -f $mbox 13 | } 14 | 15 | 16 | building a initrd: 17 | in busybox _install dir: 18 | find . -print0 | cpio --null -ov --format=newc | gzip -9v > ../initramfs-busybox-x86.cpio.gz 19 | 20 | 21 | qemu kernel image: 22 | qemu-system-x86_64 -kernel arch/x86_64/boot/bzImage -initrd ../tools/initramfs-busybox-x86.cpio.gz -nographic -append "console=ttyS0" -enable-kvm 23 | 24 | old-style qemu-kvm: 25 | qemu-kvm -m 512 -kernel ./arch/x86/boot/bzImage -serial stdio -append "root=/dev/sda2 console=tty0 console=ttyS0" -snapshot /dev/sda 26 | 27 | 28 | cross-compile: 29 | $ CROSS_COMPILE=mipsel-linux-gnu- ARCH=mips make 30 | 31 | make ARCH=arm64 CROSS_COMPILE=~/linux/compilers/gcc-11.1.0-nolibc/aarch64-linux/bin/aarch64-linux- -j100 32 | 33 | kernel doc testing: 34 | scripts/kernel-doc -Wall -none -v ...your file... 35 | 36 | 37 | Intel patch review complaints: 38 | x86-patch-review@intel.com 39 | 40 | Dynamic debug function information 41 | $ alias ddcmd='echo $* > /proc/dynamic_debug/control' 42 | # add function to all enabled messages 43 | $ ddcmd '+f' 44 | -------------------------------------------------------------------------------- /report/char-misc.git-patches: -------------------------------------------------------------------------------- 1 | From: Greg KH 2 | To: Linus Torvalds , Andrew Morton , Arnd Bergmann 3 | Cc: linux-kernel@vger.kernel.org 4 | Subject: [GIT PATCH] char and misc patches for 3.3 5 | 6 | Here are the char/misc patches for the 3.3 merge. 7 | 8 | Not much here at all, just some minor driver updates, and a few 9 | cleanups. Nothing exciting overall. 10 | 11 | Please pull from: 12 | git.kernel.org:/pub/scm/linux/kernel/git/gregkh/char-misc.git/ char-misc-next 13 | 14 | All of these patches have been in the linux-next and mm trees for a 15 | while now. 16 | 17 | The patches will be sent as a follow-on to this message to lkml for 18 | people to see. 19 | 20 | thanks, 21 | 22 | greg k-h 23 | 24 | ------------ 25 | 26 | drivers/misc/ad525x_dpot-i2c.c | 10 +--- 27 | drivers/misc/ad525x_dpot-spi.c | 97 ++++++++++++++++------------------------ 28 | drivers/misc/ad525x_dpot.c | 24 +++++----- 29 | drivers/misc/ad525x_dpot.h | 8 +--- 30 | drivers/misc/bmp085.c | 2 +- 31 | drivers/misc/isl29020.c | 2 +- 32 | drivers/misc/ti-st/st_core.c | 18 ++++++-- 33 | drivers/misc/ti-st/st_kim.c | 84 ++++++++++++++++++++++------------ 34 | drivers/s390/char/tape_class.h | 1 - 35 | fs/char_dev.c | 6 +- 36 | 10 files changed, 126 insertions(+), 126 deletions(-) 37 | 38 | --------------- 39 | 40 | Greg Kroah-Hartman (2): 41 | s390: tape_class.h: remove kobj_map.h inclusion 42 | char_dev.c: fix up some whitespace errors 43 | 44 | Jesper Juhl (2): 45 | BMP085: Remove redundant semi-colon from return statement 46 | isl29020: Remove a redundant semi-colon from return statement 47 | 48 | Michael Hennerich (1): 49 | misc: ad525x_dpot: Add support for SPI module device table matching 50 | 51 | Pavan Savoy (3): 52 | drivers:misc: ti-st: protect registrations 53 | drivers:misc: ti-st: flush UART upon fw failure 54 | drivers:misc: ti-st: DEBUG uart, baud rate mods 55 | 56 | -------------------------------------------------------------------------------- /report/driver-core-report.txt: -------------------------------------------------------------------------------- 1 | Here's a summary of the current state of the Linux Driver core and sysfs 2 | subsystems. 3 | 4 | If the information in here is incorrect, or anyone knows of any 5 | outstanding issues not listed here, please let me know. 6 | 7 | List of outstanding regressions from 2.6.15: 8 | - none known. 9 | 10 | List of outstanding regressions from older kernel versions: 11 | - none known. 12 | 13 | There are no outstanding bugs for these subsystems in the 14 | bugzilla.kernel.org system that I know of. If this is not true, please 15 | point me at the bugs you feel I should know about. 16 | 17 | Future stuff: 18 | All of the patches that will be sent in for 2.6.17 can be found in my 19 | quilt tree at 20 | http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ and 21 | are included automagically in the -mm releases. 22 | 23 | Here's a summary of the changes that can be found there: 24 | - There's a big pending AOE driver update that missed the 2.6.16 25 | cut-off timeframe. If you use this driver, I would recommend 26 | getting these patches. 27 | - pollable sysfs attributes will be coming soon. I think Neil 28 | is going to rework the existing patches, due to some issues 29 | found in -mm reviews, but the functionality should remain the 30 | same (adds a new sysfs function you can call to let userspace 31 | know that a sysfs file has changed contents. Use this instead 32 | of the old uevent interface to notify userspace in an easier 33 | manner.) 34 | - change semaphores to mutexes. 35 | - module sysfs file refcount fixes 36 | - EXPORT_SYMBOL_GPL_FUTURE() addition. 37 | - relayfs as a stand-alone filesystem is gone, to be replaced 38 | with the ability to use relayfs files from within sysfs. 39 | - other minor bugfixes. 40 | 41 | I am currently working on allowing struct device to be bound to a struct 42 | class as part of the migration away from struct class_device and toward 43 | allowing everything to be a struct device in the sysfs device tree. 44 | That work is being tested out on the "usbfs2" work which adds a dev file 45 | to every USB endpoint in the system, allowing async-io to be used from 46 | userspace instead of the ioctl mess we have in usbfs today. If anyone 47 | is interested in this work, look in my patch queue for the initial cut 48 | of it. It will be rapidly changing this week as I get the time to work 49 | more on it. 50 | 51 | The above mentioned changes, do not change any existing sysfs or driver 52 | core apis, but only add a few more functions. So there are no API 53 | changes coming in the near future that I am aware of. 54 | 55 | 56 | It is also noted that a lot of people still don't know how to use a 57 | kobject properly, and that more sysfs files are containing more than one 58 | value (hey, look a table of numbers in the cpufreq file...) Please be 59 | aware that people will be walking around with big sticks and whacking 60 | the fingers of any programmers who do this. When in doubt, _please_ ask 61 | how to do this kind of low-level programming as it is very easy to get 62 | wrong... 63 | 64 | Also the kernel/userspace API documentation patch is pending me getting 65 | the chance to work on it today or tomorrow, don't worry, I haven't 66 | forgotten about it :) 67 | 68 | 69 | Was this summary useful for people? Anything that I should add to it? 70 | 71 | thanks, 72 | 73 | greg k-h 74 | -------------------------------------------------------------------------------- /report/driver-core.git-patches: -------------------------------------------------------------------------------- 1 | From: Greg KH 2 | To: Linus Torvalds , Andrew Morton 3 | Cc: linux-kernel@vger.kernel.org 4 | Subject: [GIT PATCH] driver core patches for 3.3-rc1 5 | 6 | I tried to create a signed tag for this pull request. It's call 7 | "driver-core-3.3-rc1-bugfixes" in the repo below, but when I did: 8 | git request-pull master git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/ driver-core-3.3-rc1-bugfixes > msg.txt 9 | 10 | I got the text below, no signed tag with the wording that I added to it 11 | that I could see. Now I am still using git 1.7.8.3, is that why? If 12 | so, I'll go build 1.7.9 as I see that is now out today. 13 | 14 | Did I mess something up? I created the tag with: 15 | git tag -u kroah.com -s driver-core-3.3-rc1-bugfixes driver-core-linus 16 | 17 | Could it be that the tag and the branch are at the same point in the 18 | tree right now? Or something else? 19 | 20 | The wording I put in the tag is: 21 | Here are some patches for the 3.3-rc1 tree. 22 | 23 | It contains the removal of the sysdev code, now that all users 24 | of it are gone, as well as some sysfs bugfixes that have been 25 | reported by users. There are also some documentation updates 26 | here as well. 27 | 28 | 29 | All of these have been in the linux-next tree for the past week. 30 | 31 | thanks, 32 | 33 | greg k-h 34 | 35 | ------------------- 36 | 37 | The following changes since commit dcd6c92267155e70a94b3927bce681ce74b80d1f: 38 | 39 | Linux 3.3-rc1 (2012-01-19 15:04:48 -0800) 40 | 41 | are available in the git repository at: 42 | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/ driver-core-linus 43 | 44 | Alan Stern (1): 45 | Documentation update for the driver model core 46 | 47 | Eric W. Biederman (1): 48 | sysfs: Complain bitterly about attempts to remove files from nonexistent directories. 49 | 50 | Greg Kroah-Hartman (2): 51 | driver core: remove drivers/base/sys.c and include/linux/sysdev.h 52 | stable: update documentation to ask for kernel version 53 | 54 | Randy Dunlap (3): 55 | kernel-doc: fix new warnings in device.h 56 | kernel-doc: fix new warnings in debugfs 57 | kernel-doc: fix new warnings in driver-core 58 | 59 | Wolfram Sang (1): 60 | Documentation: devres: add allocation functions to list of supported calls 61 | 62 | majianpeng (1): 63 | base/core.c:fix typo in comment in function device_add 64 | 65 | Documentation/driver-model/devres.txt | 4 + 66 | Documentation/stable_kernel_rules.txt | 3 +- 67 | drivers/base/Makefile | 2 +- 68 | drivers/base/bus.c | 9 +- 69 | drivers/base/core.c | 17 ++- 70 | drivers/base/sys.c | 383 --------------------------------- 71 | fs/debugfs/file.c | 2 +- 72 | fs/sysfs/file.c | 6 + 73 | fs/sysfs/inode.c | 5 +- 74 | include/linux/device.h | 15 +- 75 | include/linux/sysdev.h | 164 -------------- 76 | 11 files changed, 49 insertions(+), 561 deletions(-) 77 | delete mode 100644 drivers/base/sys.c 78 | delete mode 100644 include/linux/sysdev.h 79 | -------------------------------------------------------------------------------- /report/driver_core-state-2.6.18-rc6.txt: -------------------------------------------------------------------------------- 1 | From: Greg KH 2 | To: torvalds@osdl.org, Andrew Morton 3 | Cc: linux-kernel@vger.kernel.org 4 | Subject: State of the Linux Driver Core Subsystem for 2.6.18-rc6 5 | 6 | Here's a summary of the current state of the Linux Driver core 7 | subsystem, as of 2.6.18-rc6. 8 | 9 | If the information in here is incorrect, or anyone knows of any 10 | outstanding issues not listed here, please let me know. 11 | 12 | List of outstanding regressions from 2.6.17: 13 | - none known. 14 | 15 | List of outstanding regressions from older kernel versions: 16 | - none known. 17 | 18 | 19 | There are no currently open Driver core or sysfs bugs in bugzilla. 20 | 21 | 22 | Future patches that are currently in my quilt tree (as found at 23 | http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 24 | ) for the Driver core subsystem are as follows. All of these will be 25 | submitted for inclusion into 2.6.19, except as noted: 26 | 27 | - PHYSDEV* values in uevents are now depreciated. 28 | - sysfs poll behavior was made consistent 29 | - suspend sequence was changed. We now let the drivers know 30 | much more about what is going on in the suspend sequence. The 31 | PCI subsystem was modified to pass this information down to 32 | all PCI drivers, if they wish to know. 33 | - Lots of other power management changes, including better 34 | in-kernel documentation of what needs to be done for drivers. 35 | See the documentation for details. 36 | - struct device got some more fields and functions to handle the 37 | conversion from class_device to device properly. 38 | - Lots of sysfs and driver core functions were marked with 39 | __must_fix to help fix up driver bugs where they fail to 40 | handle errors returned by the driver core. This is now a 41 | configuration option so that it can be turned off for those 42 | who don't like 1542 new compiler warnings in their build. 43 | Patches are in other trees to fix these warnings. 44 | - The driver core was changed to allow multi-threaded device 45 | probing. This means that every device added to the system 46 | gets a new kernel thread in which to do the probe sequence. 47 | The PCI subsystem was modified to allow PCI drivers to do this 48 | (this is made a configuration option, as it breaks numerous 49 | boxes if enabled). It does have the potential to speed up the 50 | boot sequence a lot for some machines, and is even measurable 51 | on single processor laptops. 52 | - Numerous class subsystems were changed from using the struct 53 | class_device to use struct device. This moves the directory 54 | for the class device to be in the /sys/devices/ tree, where it 55 | should have gone originally. Note that this requires an 56 | updated version of udev for most older distributions to handle 57 | properly. Because of this, these patches will not be 58 | submitted for inclusion until all older udevs have been 59 | patched to work with this change (a task I am currently 60 | working on.) This will probably not go into 2.6.19 because of 61 | this. 62 | 63 | For API changes, the suspend/resume sequence got new functions, passing 64 | those functions down to the pci drivers to use. struct device had some 65 | fields added to it, and there are some new driver core functions for 66 | creating devices that are associated with classes. None of these 67 | changes will break older code, as things were only added, not renamed or 68 | removed from the API. 69 | 70 | The class_device changes do move things around in sysfs, so userspace 71 | tools will need to be updated when those changes make it into the kernel 72 | tree (note, this will probably not happen for 2.6.19, but if it does, 73 | everyone will be forewarned about it a lot.) Kay Sievers has a great 74 | document he is working on for how to properly use sysfs from userspace, 75 | hopefully that will be finished and posted for others to comment on 76 | soon. 77 | 78 | thanks, 79 | 80 | greg k-h 81 | 82 | -------------------------------------------------------------------------------- /report/pci-report.txt: -------------------------------------------------------------------------------- 1 | Here's a summary of the current state of the Linux PCI and PCI Hotplug 2 | subsystems. 3 | 4 | If the information in here is incorrect, or anyone knows of any 5 | outstanding issues not listed here, please let me know. 6 | 7 | List of outstanding regressions from 2.6.15: 8 | - none known. 9 | 10 | List of outstanding regressions from older kernel versions: 11 | - some cardbus users still have issues with the change to the 12 | PCI resource allocation stuff. 13 | http://bugzilla.kernel.org/show_bug.cgi?id=5736 shows this 14 | issue, but seems to be stalled for now :( 15 | 16 | Here is a list of the current outstanding bugs for the PCI subsystem as 17 | tracked at bugzilla.kernel.org. If anyone can help out with any of 18 | these, please add information to the bug reports. 19 | 20 | * 5736 [greg@kroah.com] - pci broken on PIIX/ICH laptop (CARDBUS_IO_SIZE 21 | too small?). 22 | 23 | 24 | Future stuff: 25 | Wow, for a subsystem that no one cared about for a long time (PCI 26 | Hotplug) all of a sudden we have so many patches floating around that 27 | it is difficult to handle all of them. If you are interested in the 28 | changes in this area that will be coming in 2.6.17, please see my 29 | quilt tree at 30 | http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 31 | 32 | Summary of the changes found there are: 33 | - shpchp driver reworks that fix issues and handle the module 34 | being able to be unloaded properly 35 | - acpiphp driver changes to try to be able to work properly for 36 | laptop docking stations. There is still remaining work to do 37 | in this area. 38 | - We have unstable patches to handle multi-domain PCI busses for 39 | i386 and x86 arches in this tree. Unfortunately they still 40 | seem to break NUMA and other random boxes, so they will not be 41 | heading for mainline any time soon. If anyone has one of 42 | these boxes and wishes to work on this, please let me know. 43 | - MSI cleanups and fixes to get things to work on ia64. 44 | - Other minor PCI and PCI bug fixes. 45 | 46 | 47 | I still have a few outstanding patches in my TODO queue that I have not 48 | applied to my quilt tree. These patches do the following: 49 | - boot parameter to disable MSI 50 | - various PCI quirks added 51 | - remove PCI_LEGACY_PROC functionality. 52 | - more acpiphp driver fixes. 53 | - kzalloc cleanup for drivers/pci 54 | - cpqphp driver cleanups as found by the Coverty checker. 55 | - other minor things. 56 | 57 | I hope to get to these by the end of the week, depending on other 2.6.16 58 | stabilization work. If you don't hear back from me by then, and you 59 | have sent me a PCI or PCI Hotplug patch, please resend it and poke me 60 | about it. 61 | 62 | No new PCI driver API changes are pending that I am aware of. 63 | 64 | Was this summary useful for people? Anything that I should add to it? 65 | 66 | thanks, 67 | 68 | greg k-h 69 | -------------------------------------------------------------------------------- /report/pci-state-2.6.18-rc6.txt: -------------------------------------------------------------------------------- 1 | From: Greg KH 2 | To: torvalds@osdl.org, Andrew Morton 3 | Cc: linux-pci@atrey.karlin.mff.cuni.cz, linux-kernel@vger.kernel.org 4 | Subject: State of the Linux PCI Subsystem for 2.6.18-rc6 5 | 6 | Here's a summary of the current state of the Linux PCI subsystem, as of 7 | 2.6.18-rc6. 8 | 9 | If the information in here is incorrect, or anyone knows of any 10 | outstanding issues not listed here, please let me know. 11 | 12 | List of outstanding regressions from 2.6.17: 13 | - none known. 14 | 15 | List of outstanding regressions from older kernel versions: 16 | - none known. 17 | 18 | 19 | If interested, the list of all currently open PCI bugs can be seen at: 20 | http://bugzilla.kernel.org/showdependencytree.cgi?id=5829&hide_resolved=1 21 | 22 | 23 | Future patches that are currently in my quilt tree (as found at 24 | http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 25 | ) for the PCI subsystem are as follows. All of these will be submitted 26 | for inclusion into 2.6.19, except as noted: 27 | 28 | - MSI rework currently being tested out in the -mm tree. 29 | - PCI Express AER implementation. 30 | - few minor PCI Hotplug driver fixes and cleanups. 31 | - resource minor tweak. 32 | - PCI sort device lists in breadth-first to fix the regression 33 | of PCI device order from the 2.4 kernel tree. This can be 34 | disabled by a command line option if anyone is wed to the old 35 | 2.6 buggy way. 36 | 37 | Note that there are some PCI API changes that happen in my driver tree. 38 | See that status report for details on those changes (nothing was done to 39 | break anything, only new stuff was added.) 40 | 41 | No other new PCI driver API changes are pending that I am aware of. The 42 | PCI sort order change will affect some people's userspace ordering of 43 | network devices, restoring it to the proper 2.4 ordering. It was never 44 | intended that this be broken, and since no one has noticed this for the 45 | past 3 years, it was not broken in a severe way. 46 | 47 | thanks, 48 | 49 | greg k-h 50 | 51 | -------------------------------------------------------------------------------- /report/pci-state.txt: -------------------------------------------------------------------------------- 1 | From: Greg KH 2 | To: torvalds@osdl.org, Andrew Morton 3 | Cc: linux-pci@atrey.karlin.mff.cuni.cz, linux-kernel@vger.kernel.org 4 | Subject: State of the Linux PCI Subsystem for 2.6.23-rc8 5 | 6 | Here's a summary of the current state of the Linux PCI subsystem, as of 7 | 2.6.23-rc8. 8 | 9 | If the information in here is incorrect, or anyone knows of any 10 | outstanding issues not listed here, please let me know. 11 | 12 | List of outstanding regressions from 2.6.22: 13 | - none known. 14 | 15 | List of outstanding regressions from older kernel versions: 16 | - none known. 17 | 18 | 19 | If interested, the list of all currently open PCI bugs can be seen at: 20 | http://bugzilla.kernel.org/showdependencytree.cgi?id=5829&hide_resolved=1 21 | 22 | 23 | Future patches that are currently in my quilt tree (as found at 24 | http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 25 | ) for the PCI subsystem are as follows. All of these will be submitted 26 | for inclusion into 2.6.24, except as noted. The diffstat of these 27 | patches is included at the bottom of this message for those that are 28 | interested. 29 | 30 | - various pci quirks for different devices 31 | - pci hotplug driver kthread conversion 32 | - pci hotplug bugfixes 33 | - pci express hotplug tweaks and fixes 34 | - minor bugfixes and cleanups 35 | - MSI documentation update 36 | 37 | - pci bridge device rework. Note, this was reported to break 38 | Andrew's x86-64 box, but he lost the picture he took of the 39 | oops. Others reported that it worked just fine on their 40 | boxes. I'm still a little hesitant of sending this to 2.6.24 41 | until I can track down what happened here. 42 | 43 | There are no PCI api changes scheduled for 2.6.24. 44 | 45 | 46 | thanks, 47 | 48 | greg k-h 49 | 50 | ---------------------------- 51 | 52 | Diffstat of the current pci-2.6 quilt queue: 53 | 54 | Documentation/DMA-API.txt | 3 55 | Documentation/MSI-HOWTO.txt | 69 ------------ 56 | arch/i386/kernel/pci-dma.c | 3 57 | arch/i386/kernel/reboot_fixups.c | 6 + 58 | arch/i386/pci/common.c | 10 + 59 | arch/i386/pci/fixup.c | 47 ++++++++ 60 | arch/i386/pci/irq.c | 39 +++++++ 61 | arch/x86_64/kernel/pci-dma.c | 1 62 | drivers/pci/bus.c | 17 ++- 63 | drivers/pci/hotplug/cpqphp_core.c | 2 64 | drivers/pci/hotplug/cpqphp_ctrl.c | 74 ++++--------- 65 | drivers/pci/hotplug/ibmphp_hpc.c | 57 ++-------- 66 | drivers/pci/hotplug/pciehp_core.c | 24 +--- 67 | drivers/pci/hotplug/pciehp_ctrl.c | 20 +-- 68 | drivers/pci/hotplug/pciehp_hpc.c | 209 ++++++++++---------------------------- 69 | drivers/pci/hotplug/pciehp_pci.c | 24 ++-- 70 | drivers/pci/pci-driver.c | 3 71 | drivers/pci/pci.c | 5 72 | drivers/pci/pci.h | 2 73 | drivers/pci/pcie/Kconfig | 9 - 74 | drivers/pci/probe.c | 82 +++++++------- 75 | drivers/pci/quirks.c | 43 ------- 76 | drivers/pci/remove.c | 6 - 77 | include/linux/pci.h | 4 78 | include/linux/pci_ids.h | 3 79 | include/linux/pci_regs.h | 6 - 80 | lib/swiotlb.c | 1 81 | 27 files changed, 316 insertions(+), 453 deletions(-) 82 | -------------------------------------------------------------------------------- /report/tty.git-patches: -------------------------------------------------------------------------------- 1 | From: Greg KH 2 | To: Linus Torvalds , Andrew Morton 3 | Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org 4 | Subject: [GIT PATCH] TTY/serial patches for 3.3-rc1 5 | 6 | Here are some tty/serial patches for 3.3-rc1 7 | 8 | Big thing here is the movement of the 8250 serial drivers to their own 9 | directory, now that the patch churn has calmed down. 10 | 11 | Other than that, only minor stuff (omap patches were reverted as they 12 | were found to be wrong), and another broken driver removed from the 13 | system. 14 | 15 | Please pull from: 16 | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-3.1-rc1 17 | 18 | All of these patches have been in the -mm and -next trees for a while. 19 | 20 | Patches will be sent to the linux-serial mailing list, if anyone wants 21 | to see them. 22 | 23 | thanks, 24 | 25 | greg k-h 26 | 27 | ------------ 28 | 29 | Documentation/DocBook/device-drivers.tmpl | 1 - 30 | MAINTAINERS | 2 +- 31 | drivers/tty/serial/{ => 8250}/8250.c | 0 32 | drivers/tty/serial/{ => 8250}/8250.h | 0 33 | drivers/tty/serial/{ => 8250}/8250_accent.c | 0 34 | drivers/tty/serial/{ => 8250}/8250_acorn.c | 0 35 | drivers/tty/serial/{ => 8250}/8250_boca.c | 0 36 | drivers/tty/serial/{ => 8250}/8250_dw.c | 0 37 | drivers/tty/serial/{ => 8250}/8250_early.c | 0 38 | drivers/tty/serial/{ => 8250}/8250_exar_st16c554.c | 0 39 | drivers/tty/serial/{ => 8250}/8250_fourport.c | 0 40 | drivers/tty/serial/{ => 8250}/8250_fsl.c | 0 41 | drivers/tty/serial/{ => 8250}/8250_gsc.c | 0 42 | drivers/tty/serial/{ => 8250}/8250_hp300.c | 0 43 | drivers/tty/serial/{ => 8250}/8250_hub6.c | 0 44 | drivers/tty/serial/{ => 8250}/8250_mca.c | 0 45 | drivers/tty/serial/{ => 8250}/8250_pci.c | 0 46 | drivers/tty/serial/{ => 8250}/8250_pnp.c | 0 47 | drivers/tty/serial/8250/Kconfig | 280 ++++++++++++++++ 48 | drivers/tty/serial/8250/Makefile | 20 ++ 49 | drivers/tty/serial/{ => 8250}/m32r_sio.c | 0 50 | drivers/tty/serial/{ => 8250}/m32r_sio.h | 0 51 | drivers/tty/serial/{ => 8250}/m32r_sio_reg.h | 0 52 | drivers/tty/serial/{ => 8250}/serial_cs.c | 0 53 | drivers/tty/serial/Kconfig | 283 +---------------- 54 | drivers/tty/serial/Makefile | 20 +- 55 | drivers/tty/serial/amba-pl011.c | 30 ++- 56 | drivers/tty/serial/jsm/jsm_driver.c | 1 + 57 | drivers/tty/serial/max3107-aava.c | 344 -------------------- 58 | drivers/tty/serial/omap-serial.c | 4 +- 59 | drivers/tty/serial/serial_core.c | 6 +- 60 | drivers/tty/tty_port.c | 12 +- 61 | 32 files changed, 346 insertions(+), 657 deletions(-) 62 | rename drivers/tty/serial/{ => 8250}/8250.c (100%) 63 | rename drivers/tty/serial/{ => 8250}/8250.h (100%) 64 | rename drivers/tty/serial/{ => 8250}/8250_accent.c (100%) 65 | rename drivers/tty/serial/{ => 8250}/8250_acorn.c (100%) 66 | rename drivers/tty/serial/{ => 8250}/8250_boca.c (100%) 67 | rename drivers/tty/serial/{ => 8250}/8250_dw.c (100%) 68 | rename drivers/tty/serial/{ => 8250}/8250_early.c (100%) 69 | rename drivers/tty/serial/{ => 8250}/8250_exar_st16c554.c (100%) 70 | rename drivers/tty/serial/{ => 8250}/8250_fourport.c (100%) 71 | rename drivers/tty/serial/{ => 8250}/8250_fsl.c (100%) 72 | rename drivers/tty/serial/{ => 8250}/8250_gsc.c (100%) 73 | rename drivers/tty/serial/{ => 8250}/8250_hp300.c (100%) 74 | rename drivers/tty/serial/{ => 8250}/8250_hub6.c (100%) 75 | rename drivers/tty/serial/{ => 8250}/8250_mca.c (100%) 76 | rename drivers/tty/serial/{ => 8250}/8250_pci.c (100%) 77 | rename drivers/tty/serial/{ => 8250}/8250_pnp.c (100%) 78 | create mode 100644 drivers/tty/serial/8250/Kconfig 79 | create mode 100644 drivers/tty/serial/8250/Makefile 80 | rename drivers/tty/serial/{ => 8250}/m32r_sio.c (100%) 81 | rename drivers/tty/serial/{ => 8250}/m32r_sio.h (100%) 82 | rename drivers/tty/serial/{ => 8250}/m32r_sio_reg.h (100%) 83 | rename drivers/tty/serial/{ => 8250}/serial_cs.c (100%) 84 | delete mode 100644 drivers/tty/serial/max3107-aava.c 85 | 86 | --------------- 87 | 88 | Alan Cox (1): 89 | serial: Kill off Moorestown code 90 | 91 | Greg Kroah-Hartman (2): 92 | Revert "tty: serial: OMAP: transmit FIFO threshold interrupts don't wake the chip" 93 | Revert "tty: serial: OMAP: ensure FIFO levels are set correctly in non-DMA mode" 94 | 95 | Jiri Slaby (1): 96 | TTY: fix UV serial console regression 97 | 98 | Lucas Kannebley Tavares (2): 99 | Updated TTY MAINTAINERS info 100 | jsm: Fixed EEH recovery error 101 | 102 | Paul Gortmaker (1): 103 | serial: group all the 8250 related code together 104 | 105 | Paul Walmsley (2): 106 | tty: serial: OMAP: ensure FIFO levels are set correctly in non-DMA mode 107 | tty: serial: OMAP: transmit FIFO threshold interrupts don't wake the chip 108 | 109 | Rabin Vincent (1): 110 | serial: amba-pl011: lock console writes against interrupts 111 | 112 | Randy Dunlap (1): 113 | docbook: don't use serial_core.h in device-drivers book 114 | 115 | Shreshtha Kumar Sahu (1): 116 | amba-pl011: do not disable RTS during shutdown 117 | 118 | Shubhrajyoti D (2): 119 | omap-serial :Make the suspend/resume functions depend on CONFIG_PM_SLEEP. 120 | omap-serial: make serial_omap_restore_context depend on CONFIG_PM_RUNTIME 121 | 122 | Simon Glass (1): 123 | serial: Fix wakeup init logic to speed up startup 124 | 125 | -------------------------------------------------------------------------------- /report/usb-report.txt: -------------------------------------------------------------------------------- 1 | Here's a summary of the current state of the Linux USB subsystem. 2 | 3 | If the information in here is incorrect, or anyone knows of any 4 | outstanding issues not listed here, please let me know. 5 | 6 | List of outstanding regressions from 2.6.15: 7 | - none known. 8 | 9 | List of outstanding regressions from older kernel versions: 10 | - one nasty bug, http://bugzilla.kernel.org/show_bug.cgi?id=6078 11 | is plaguing some people since 2.6.15 came out. Right now some 12 | people have reported that 2.6.16-rc5 fixes the issue, and none 13 | of the Linux USB developers can duplicate it. No one has 14 | reported that it is still present in 2.6.16-rc5 either, so we 15 | don't know if this is fixed yet or not. 16 | - omninet driver is broken since 2.6.13 or so. Currently being 17 | debugged. 18 | 19 | Here is a list of the current outstanding bugs for the USB subsystem as 20 | tracked at bugzilla.kernel.org. Note that a lot of these are still 21 | sitting in the NEEDSINFO state waiting for people to reply with more 22 | information or testing. If anyone can help out with any of these, 23 | please add information to the bug reports. 24 | 25 | * 3505 [dbrownell@users.sourceforge.net] - usb-storage since at least 26 | 2.6.3: destroy's partitions on hdd and stick. 27 | * 4724 [vojtech@suse.cz] - USB error causes system to become 28 | unresponsive to input. 29 | * 5086 [greg@kroah.com] - unplugging webcam when stv680 is in use 30 | freezes the whole system. 31 | * 5325 [greg@kroah.com] - Processes in D state after printing big jobs. 32 | * 5386 [drivers_input-devices@kernel-bugs.osdl.org] - rmmod usbhid 33 | crashes. 34 | * 5640 [mdharm-usb@one-eyed-alien.net] - System doesn' shutdown when a 35 | device is connected to USB 1.1 root hub. 36 | * 5652 [mdharm-usb@one-eyed-alien.net] - Built in card reader doesn't 37 | work anymore. 38 | * 5682 [dbrownell@users.sourceforge.net] - USB hard drive disconnects 39 | (2.6.7-2.6.13) or is never recognized (2.6.14) with ehci_hcd. 40 | * 5742 [greg@kroah.com] - Suspend resume does not work on Inspiron 8200 41 | if usbhid module is loaded. 42 | * 5744 [dbrownell@users.sourceforge.net] - usbnet connection to sharp 43 | zaurus SL-5600 buggy since kernel 2.6.14. 44 | * 5753 [greg@kroah.com] - Problem initializing CSR bluetooth through 45 | usb. 46 | * 5777 [greg@kroah.com] - ehci-hcd re-load necessary to use kbd on 47 | docking station hub. 48 | * 5835 [dbrownell@users.sourceforge.net] - High Speed USB devices don't 49 | work when ehci_hcd loaded, work if removed. 50 | * 5894 [stern@rowland.harvard.edu] - usb-storage freezes during large 51 | file transfers. 52 | * 6078 [greg@kroah.com] - USB "device not accepting address XX, error 53 | -71" problem. 54 | * 6081 [mdharm-usb@one-eyed-alien.net] - Pendrive (Pentadrive 256MB) 55 | not working. 56 | 57 | 58 | Future patches that are currently in my quilt tree (as found at 59 | http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 60 | ) for the USB subsystem: 61 | 62 | - UHCI reworks hopefully making it easier to maintain and fixes 63 | a few power management issues 64 | - kzalloc fixes for the drivers/usb/ tree 65 | - ehci support for new controller type, and fixes for others. 66 | - USB gadget driver updates 67 | - USB video driver additions and updates. 68 | - HID error handling rework 69 | - semaphore to mutex rework 70 | - other minor bugfixes that are not really critical or too big 71 | to go into 2.6.16 at this period of time. 72 | 73 | No new USB driver API changes are pending that I am aware of. 74 | 75 | 76 | Was this summary useful for people? Anything that I should add to it? 77 | 78 | thanks, 79 | 80 | greg k-h 81 | -------------------------------------------------------------------------------- /report/usb-state-2.6.18-rc6.txt: -------------------------------------------------------------------------------- 1 | From: Greg KH 2 | To: torvalds@osdl.org, Andrew Morton 3 | Cc: linux-usb-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org 4 | Subject: State of the Linux USB Subsystem for 2.6.18-rc6 5 | 6 | Here's a summary of the current state of the Linux USB subsystem, as of 7 | 2.6.18-rc6. 8 | 9 | If the information in here is incorrect, or anyone knows of any 10 | outstanding issues not listed here, please let me know. 11 | 12 | List of outstanding regressions from 2.6.17: 13 | - none known. 14 | 15 | List of outstanding regressions from older kernel versions: 16 | - none known. 17 | 18 | There are a few outstanding patches waiting for Linus to pull from at: 19 | master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6.git/ 20 | as per a previous email message to him. 21 | 22 | If interested, the list of all currently open USB bugs can be seen at: 23 | http://bugzilla.kernel.org/showdependencytree.cgi?id=5089&hide_resolved=1 24 | 25 | 26 | Future patches that are currently in my quilt tree (as found at 27 | http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 28 | ) for the USB subsystem are as follows. All of these will be submitted 29 | for inclusion into 2.6.19, except as noted: 30 | 31 | - USB core reworks to get suspend working better for the USB 32 | core and drivers. 33 | - Initial framework for USB autosuspend (final patches enabling 34 | this are not included as they caused problems on my machines, 35 | they might be reworked and make it into 2.6.19 depending on 36 | the issues involved). 37 | - OHCI changes to avoid root hub polling (this makes 38 | dynamic-tick mechanisms work much better and takes USB off of 39 | the list of the worse offenders of timer ticks in the kernel.) 40 | - helper functions for detecting usb endpoints instead of having 41 | to remember those crazy bit fields all the time. All drivers 42 | are converted to use them, fixing a few bugs in the process. 43 | - some wireless USB infrastructure patches to make the future 44 | wireless driver merge easier. 45 | - __must_check fixes to enable the whole USB subsystem to build 46 | without compiler warnings anymore. 47 | - a number of new drivers: 48 | - aircable bluetoot dongle driver 49 | - adutux driver 50 | - vibrator driver 51 | - moschip 7840 usb-serial driver 52 | - moschip 7720 usb-serial driver (not ready for 2.6.19) 53 | - serqt usb-serial driver (not ready for 2.6.19) 54 | - ability to multi-thread the USB probe process. Probably not 55 | going to go into 2.6.19 as Alan Stern has come up with a 56 | better way to do this. I just need to integrate it into the 57 | tree sometime in the near future. 58 | - other minor bugfixes that are not really critical or too big 59 | to go into 2.6.18 at this period of time. 60 | 61 | No new USB driver API changes are pending that I am aware of. 62 | 63 | 64 | thanks, 65 | 66 | greg k-h 67 | 68 | -------------------------------------------------------------------------------- /scripts/added-to-gregkh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #. patchfns 2>/dev/null || 4 | #. /usr/lib/patch-scripts/patchfns 2>/dev/null || 5 | #. $PATCHSCRIPTS_LIBDIR/patchfns 2>/dev/null || 6 | #{ 7 | # echo "Impossible to find my library 'patchfns'." 8 | # echo "Check your install, or go to the right directory" 9 | # exit 1 10 | #} 11 | 12 | EMAIL_ADDRESS='' 13 | 14 | extract_addr() 15 | { 16 | read l 17 | read l 18 | read l 19 | read l 20 | a=$(echo "$l" | sed -n -e 's/.*<\(.*@[^>]*\).*/\1/p') 21 | echo $a 22 | } 23 | 24 | if [ x"$SMTP_SERVER" = x ] 25 | then 26 | SMTP_SERVER=localhost:25 27 | fi 28 | 29 | if [ x"$EMAIL_ADDRESS" = x ] 30 | then 31 | echo "You must set the EMAIL_ADDRESS environment variable to your email address" 32 | exit 1 33 | fi 34 | FROM=$EMAIL_ADDRESS 35 | 36 | TO="" 37 | CC="" 38 | 39 | author() 40 | { 41 | first_author="" 42 | TXT=$2 43 | if [ ! -f $TXT ] 44 | then 45 | echo "$TXT is missing" 46 | exit 1 47 | fi 48 | author="" 49 | while read l 50 | do 51 | # skip the Message-ID: line so we don't send email to the wrong place 52 | echo "$l" 53 | reply=$(echo "$l" | grep -i Message-ID:) 54 | if [ x"$reply" != x ] 55 | then 56 | continue 57 | fi 58 | 59 | # if this is the start of the diff, then it's time to stop looking 60 | diff=$(echo "$l" | grep "^---") 61 | if [ x"$diff" != x ] 62 | then 63 | echo "diffstart!!!!!" 64 | break 65 | fi 66 | 67 | for x in $l 68 | do 69 | a=$(echo "$x" | sed -n -e 's/.*<\(.*@[^>]*\).*/\1/p') 70 | if [ x"$a" != x ] 71 | then 72 | if [ x"$author" == x ] 73 | then 74 | author=$a 75 | first_author=$a 76 | else 77 | author="$author $a" 78 | fi 79 | fi 80 | done 81 | done < $TXT 82 | author=$(echo "$author" | tr ' ' '\n' | grep -v "$first_author" | 83 | sort | uniq) 84 | author="$first_author $author" 85 | eval $1=$(echo $author | sed -e 's/ /,/g') 86 | if [ x"$3" != x ] 87 | then 88 | eval $3=$first_author 89 | fi 90 | } 91 | 92 | 93 | 94 | reply() 95 | { 96 | PATCH=$1 97 | # patch_name=$(stripit $1) 98 | # PATCH=$P/patches/$patch_name.patch 99 | # TXT=$P/txt/$patch_name.txt 100 | # if [ ! -f $TXT ] 101 | # then 102 | # echo $TXT is missing 103 | # exit 1 104 | # fi 105 | echo "PATCH=$PATCH" 106 | # SUBJECT=`grep "Subject:" $PATCH` 107 | SUBJECT=`grep "Subject:" $PATCH | sed s/Subject\:\ //` 108 | # SUBJECT=$(head -n 2 $PATCH | tail -n 1) 109 | MESSAGE_ID=`grep -i "^Message-ID:" $PATCH | cut -f 2 -d ' ' | cut -f 2 -d '<' | cut -f 1 -d '>'` 110 | author AUTHOR $1 FIRST_AUTHOR 111 | echo "author said $AUTHOR" 112 | echo "first_author said $FIRST_AUTHOR" 113 | if [ x"$AUTHOR" == "x" ] 114 | then 115 | echo "nobody to notify" 116 | exit 0 117 | fi 118 | to="" 119 | for i in $(echo "$AUTHOR" | sed -e 's/,/ /g') 120 | do 121 | if ! echo "$TO" | grep "$i" 122 | then 123 | to=$to" -to $i" 124 | fi 125 | done 126 | if [ x"$cc" != x ] 127 | then 128 | cc="-cc $cc" 129 | fi 130 | 131 | CHARSET=$(guess-charset "$PATCH") 132 | if test "x$CHARSET" = "ANSI_X3.4-1968"; then 133 | CHARSET= 134 | else 135 | CHARCMD="-charset=$CHARSET" 136 | fi 137 | 138 | ID=`make_message_id` 139 | 140 | echo "makemail -to $AUTHOR -from=$FROM -subject=\"patch $PATCH added to gregkh tree\" -date=\"$(date -R)\" -reply_to=$MESSAGE_ID -message=$ID $CHARCMD" 141 | # echo "smtpsend -server=$SMTP_SERVER $to -from=$FROM" 142 | 143 | 144 | ( 145 | echo 146 | echo "This is a note to let you know that I've just added the patch titled" 147 | echo 148 | echo " $SUBJECT" 149 | echo 150 | echo "to my gregkh-2.6 tree which can be found in directory form at:" 151 | echo " http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/" 152 | echo " and in git form at:" 153 | echo " git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/patches.git" 154 | echo 155 | echo "The filename of this patch is:" 156 | echo " $PATCH" 157 | echo 158 | echo "The patch will show up in the next release of the linux-next tree" 159 | echo "(usually sometime within the next 24 hours during the week.)" 160 | echo 161 | echo "If this patch meets the merge guidelines for a bugfix, it should be" 162 | echo "merged into Linus's tree before the next major kernel release." 163 | echo "If not, it will be merged into Linus's tree during the next merge window." 164 | echo 165 | echo "Either way, you will probably be copied on the patch when it gets sent" 166 | echo "to Linus for merging so that others can see what is happening in kernel" 167 | echo "development." 168 | echo 169 | echo "If you have any questions about this process, please let me know." 170 | echo 171 | echo 172 | cat $PATCH 173 | echo 174 | # echo 175 | # echo -n "Patches currently in gregkh-2.6 which might be from " 176 | # echo "$FIRST_AUTHOR are" 177 | # echo 178 | # grep -lR $FIRST_AUTHOR /home/gregkh/linux/patches/ 2> /dev/null | 179 | # sed -e 's/\/home\/gregkh\/linux\/patches\///' 180 | ) | 181 | makemail -to "$AUTHOR" -from="$FROM" \ 182 | -subject="patch \"$SUBJECT\" added to gregkh-2.6 tree" \ 183 | -date="$(date -R)" \ 184 | -reply_to="$MESSAGE_ID" \ 185 | -message_id="$ID" \ 186 | "$CHARCMD" | \ 187 | ~/bin/msmtp-enqueue.sh -a coco $to 188 | } 189 | 190 | for patch_file in $* 191 | do 192 | reply $patch_file 193 | echo "acknowledged $patch_file" 194 | echo "-----------------------------------------------" 195 | echo 196 | done 197 | -------------------------------------------------------------------------------- /scripts/aws_provision: -------------------------------------------------------------------------------- 1 | # first time creating an instance 2 | sudo yum update 3 | sudo yum install gcc make quilt git tree mutt 4 | mkdir linux 5 | mkdir linux/stable 6 | mkdir tmp 7 | cd linux/stable 8 | git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git 9 | cd linux-stable 10 | git checkout -t -b linux-3.0.y origin/linux-3.0.y 11 | git checkout -t -b linux-3.4.y origin/linux-3.4.y 12 | git checkout -t -b linux-3.5.y origin/linux-3.5.y 13 | 14 | # do at every boot 15 | sudo mount -t tmpfs tmpfs -o size=40G tmp 16 | cd linux/stable/linux-stable 17 | git fetch 18 | git checkout linux-3.0.y && git pull 19 | git checkout linux-3.4.y && git pull 20 | git checkout linux-3.5.y && git pull 21 | git checkout linux-3.6.y && git pull 22 | cd 23 | 24 | echo "machine is up and running" | mutt -s "machine is up and running" -- greg@kroah.com 25 | sleep 3 26 | sudo /etc/init.d/sendmail restart 27 | 28 | -------------------------------------------------------------------------------- /scripts/device_attr_ro.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # SPDX-License-Identifier: GPL-2.0 3 | # (c) 2017 Joe Perches 4 | 5 | # script to convert DEVICE_ATTR uses with permissions of 0444 to DEV_ATTR_RO 6 | 7 | my $perms_to_match = qr{ 8 | S_IRUGO 9 | | 0444 10 | }x; 11 | 12 | my $args_to_match = qr{ 13 | (\w+)\s*,\s* 14 | \(?\s*($perms_to_match)\s*\)?\s*,\s* 15 | (\w+)\s*,\s* 16 | NULL 17 | }x; 18 | 19 | local $/; 20 | 21 | while (<>) { 22 | my $file = $_; 23 | my $file_copy = $file; 24 | 25 | # strip comments from file_copy (regex from perlfaq) 26 | $file_copy =~ s#/\*[^*]*\*+([^/*][^*]*\*+)*/|//([^\\]|[^\n][\n]?)*?\n|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#defined $3 ? $3 : ""#gse; 27 | 28 | # for each declaration of DEVICE_ATTR 29 | while ($file =~ m/\bDEVICE_ATTR\s*\(\s*$args_to_match\s*\)/g) { 30 | my $var = $1; 31 | my $perms = $2; 32 | my $show = $3; 33 | 34 | # find the count of uses of the various function names 35 | my $count_show = () = ($file_copy =~ /\b$show\b/g); 36 | my $count_var_show = () = ($file_copy =~ /\b${var}_show\b/g); 37 | my $show_declared = () = ($file_copy =~ /\bstatic\s+ssize_t\s+(?:__ref\s+|__used\s+)?$show\b/g); 38 | 39 | # if the show function is locally declared 40 | # rename it to the normal name 41 | if (($count_show == 2) && 42 | ($count_var_show == 0) && 43 | ($show_declared == 1)) { 44 | $file =~ s/\b$show\b/${var}_show/g; 45 | } 46 | my $matched = qr{ 47 | ${var}\s*,\s* 48 | \(?\s*$perms_to_match\s*\)?\s*,\s* 49 | ${var}_show\s*,\s* 50 | NULL 51 | }x; 52 | 53 | # Rename this use 54 | $file =~ s/\bDEVICE_ATTR\s*\(\s*$matched\s*\)/DEVICE_ATTR_RO(${var})/; 55 | } 56 | print $file; 57 | } 58 | -------------------------------------------------------------------------------- /scripts/device_attr_rw.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # SPDX-License-Identifier: GPL-2.0 3 | # (c) 2017 Joe Perches 4 | 5 | # script to convert DEVICE_ATTR uses with permissions of 0644 to DEV_ATTR_RW 6 | 7 | my $perms_to_match = qr{ 8 | S_IRUGO\s*\|\s*S_IWUSR 9 | | S_IWUSR\s*\|\s*S_IRUGO 10 | | 0644 11 | }x; 12 | 13 | my $args_to_match = qr{ 14 | (\w+)\s*,\s* 15 | \(?\s*($perms_to_match)\s*\)?\s*,\s* 16 | (\w+)\s*,\s* 17 | (\w+) 18 | }x; 19 | 20 | local $/; 21 | 22 | while (<>) { 23 | my $file = $_; 24 | my $file_copy = $file; 25 | 26 | # strip comments from file_copy (regex from perlfaq) 27 | $file_copy =~ s#/\*[^*]*\*+([^/*][^*]*\*+)*/|//([^\\]|[^\n][\n]?)*?\n|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#defined $3 ? $3 : ""#gse; 28 | 29 | # for each declaration of DEVICE_ATTR 30 | while ($file =~ m/\bDEVICE_ATTR\s*\(\s*$args_to_match\s*\)/g) { 31 | my $var = $1; 32 | my $perms = $2; 33 | my $show = $3; 34 | my $store = $4; 35 | 36 | # find the count of uses of the various function names 37 | my $count_show = () = ($file_copy =~ /\b$show\b/g); 38 | my $count_store = () = ($file_copy =~ /\b$store\b/g); 39 | my $count_var_show = () = ($file_copy =~ /\b${var}_show\b/g); 40 | my $count_var_store = () = ($file_copy =~ /\b${var}_store\b/g); 41 | my $show_declared = () = ($file_copy =~ /\bstatic\s+ssize_t\s+(?:__ref\s+|__used\s+)?$show\b/g); 42 | my $store_declared = () = ($file_copy =~ /\bstatic\s+ssize_t\s+(?:__ref\s+|__used\s+)?$store\b/g); 43 | 44 | # if the show/store functions are locally declared 45 | # rename them to the normal names 46 | if (($count_show == 2) && 47 | ($count_store == 2) && 48 | ($count_var_show == 0) && 49 | ($count_var_store == 0) && 50 | ($show_declared == 1) && 51 | ($store_declared == 1)) { 52 | $file =~ s/\b$show\b/${var}_show/g; 53 | $file =~ s/\b$store\b/${var}_store/g; 54 | } 55 | my $matched = qr{ 56 | ${var}\s*,\s* 57 | \(?\s*$perms_to_match\s*\)?\s*,\s* 58 | ${var}_show\s*,\s* 59 | ${var}_store 60 | }x; 61 | 62 | # Rename this use 63 | $file =~ s/\bDEVICE_ATTR\s*\(\s*$matched\s*\)/DEVICE_ATTR_RW(${var})/; 64 | } 65 | print $file; 66 | } 67 | -------------------------------------------------------------------------------- /scripts/device_attr_wo.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # SPDX-License-Identifier: GPL-2.0 3 | # (c) 2017 Joe Perches 4 | 5 | # script to convert DEVICE_ATTR uses with permissions of 0644 to DEV_ATTR_RW 6 | 7 | my $perms_to_match = qr{ 8 | S_IWUSR 9 | | 0200 10 | }x; 11 | 12 | my $args_to_match = qr{ 13 | (\w+)\s*,\s* 14 | \(?\s*($perms_to_match)\s*\)?\s*,\s* 15 | NULL\s*,\s* 16 | (\w+) 17 | }x; 18 | 19 | local $/; 20 | 21 | while (<>) { 22 | my $file = $_; 23 | my $file_copy = $file; 24 | 25 | # strip comments from file_copy (regex from perlfaq) 26 | $file_copy =~ s#/\*[^*]*\*+([^/*][^*]*\*+)*/|//([^\\]|[^\n][\n]?)*?\n|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#defined $3 ? $3 : ""#gse; 27 | 28 | # for each declaration of DEVICE_ATTR 29 | while ($file =~ m/\bDEVICE_ATTR\s*\(\s*$args_to_match\s*\)/g) { 30 | my $var = $1; 31 | my $perms = $2; 32 | my $store = $3; 33 | 34 | # find the count of uses of the various function names 35 | my $count_store = () = ($file_copy =~ /\b$store\b/g); 36 | my $count_var_store = () = ($file_copy =~ /\b${var}_store\b/g); 37 | my $store_declared = () = ($file_copy =~ /\bstatic\s+ssize_t\s+(?:__ref\s+|__used\s+)?$store\b/g); 38 | 39 | # if the store function is locally declared 40 | # rename it to the normal name 41 | if (($count_store == 2) && 42 | ($count_var_store == 0) && 43 | ($store_declared == 1)) { 44 | $file =~ s/\b$store\b/${var}_store/g; 45 | } 46 | my $matched = qr{ 47 | ${var}\s*,\s* 48 | \(?\s*$perms_to_match\s*\)?\s*,\s* 49 | NULL\s*,\s* 50 | ${var}_store 51 | }x; 52 | 53 | # Rename this use 54 | $file =~ s/\bDEVICE_ATTR\s*\(\s*$matched\s*\)/DEVICE_ATTR_WO(${var})/; 55 | } 56 | print $file; 57 | } 58 | -------------------------------------------------------------------------------- /scripts/fix_in_what_release: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # SPDX-License-Identifier: GPL-2.0 3 | # 4 | # Copyright 2018, Greg Kroah-Hartman 5 | # 6 | # Find what release(s) a specific git commit is in. 7 | # 8 | # Yes, we can just use 'git describe --contains' but that ends up being slower 9 | # than just grepping the commit logs. We also want to catch the releases where 10 | # we have backported fixes to different stable releases. So this script tries 11 | # to poke around in the log files to figure it all out. 12 | # 13 | # kernel git commit e586b3b0baee is a fun one to use for testing this out. 14 | # 15 | 16 | # Location of all of the kernel log files 17 | # git repo is at: github.com:gregkh/kernel-history.git 18 | LOG_LOCATION="/home/gregkh/kernel-history/logs" 19 | 20 | # Location of all of the patches that have ever been added to the stable trees 21 | # git repo is at git.kernel.org:/pub/scm/linux/kernel/git/stable/stable-queue.git 22 | STABLE_QUEUE="/home/gregkh/linux/stable/stable-queue" 23 | 24 | # Location of the "latest" git tree for when patches are not found in the 25 | # stable tree at the moment. This is the "fall-back" that we can use the 26 | # slower 'git decribe --contains' on. 27 | LATEST_TREE="/home/gregkh/linux/work/torvalds" 28 | 29 | id=$1 30 | 31 | if [ "${id}" == "" ] ; then 32 | echo "$0 ID" 33 | exit 1 34 | fi 35 | 36 | # Array of places we find 37 | output=() 38 | 39 | # Look in the kernel log text files first 40 | cd ${LOG_LOCATION} || exit 41 | releases=$(git grep -l -i "${id}") 42 | # We do not want to catch the places where this commit has been "fixed" by other commits, so filter out those files 43 | #releases=`git grep ${id} | grep -v -i "Fixes:" | cut -f 1 -d ':'` 44 | for release in ${releases}; do 45 | release=${release#log-} # delete "log-" off of the front of any match 46 | output+=("${release}") 47 | # echo -n "${release} " 48 | done 49 | 50 | # Then look in the stable queue patches themselves 51 | cd ${STABLE_QUEUE} || exit 52 | releases=$(git grep -l -i "${id}") 53 | for release in ${releases}; do 54 | release=${release#releases\/} # delete "releases/" off of the front of any match 55 | release=${release%\/*} # only keep the front kernel release directory of a match, not the patch itself 56 | output+=("${release}") 57 | # echo -n "${release} " 58 | done 59 | 60 | # if we have found nothing, let's try the fallback and do the old and 61 | # slow 'git describe --contains' to try to find at least some hint of 62 | # where this commit might be at. 63 | if [ "${output[0]}" == "" ] ; then 64 | cd "${LATEST_TREE}" || exit 65 | output=$(git describe --contains "${id}") 66 | fi 67 | 68 | # sort the list of releases and put them in a new array called "sorted" 69 | readarray -t sorted < <(for release in "${output[@]}"; do echo "${release}"; done | sort -V | uniq) 70 | 71 | # print them out all on one line, with ' ' inbetween them 72 | (IFS=' ' ; printf '%s\n' "${sorted[*]}") 73 | 74 | -------------------------------------------------------------------------------- /scripts/fix_patch: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for PATCH in $* 4 | do 5 | TMPFILE=`mktemp example.XXXXXX` || exit 1 6 | 7 | #echo "TMPFILE=$TMPFILE" 8 | perl ~/linux/scripts/mime_dump --headers From,Date,Subject,To,Cc,Message-ID,Content-Disposition -F -f $PATCH > $TMPFILE 9 | mv $TMPFILE $PATCH 10 | 11 | formail -k -X From: -X Subject: -X From -X To: -X Cc: -X Date: -X Message-ID: -X Content-Disposition: -X Content-Type: -X MIME-Version: < $PATCH > $TMPFILE 12 | mv $TMPFILE $PATCH 13 | dos2unix -q $PATCH 14 | 15 | done 16 | 17 | -------------------------------------------------------------------------------- /scripts/fixed_in_version: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Text color variables 4 | txtund=$(tput sgr 0 1) # Underline 5 | txtbld=$(tput bold) # Bold 6 | txtred=$(tput setaf 1) # Red 7 | txtgrn=$(tput setaf 2) # Green 8 | txtylw=$(tput setaf 3) # Yellow 9 | txtblu=$(tput setaf 4) # Blue 10 | txtpur=$(tput setaf 5) # Purple 11 | txtcyn=$(tput setaf 6) # Cyan 12 | txtwht=$(tput setaf 7) # White 13 | txtrst=$(tput sgr0) # Text reset 14 | 15 | # Location of all of the patches that have ever been added to the stable trees 16 | # git repo is at git.kernel.org:/pub/scm/linux/kernel/git/stable/stable-queue.git 17 | STABLE_QUEUE="/home/gregkh/linux/stable/stable-queue" 18 | 19 | find_fix() { 20 | FIX=$1 21 | 22 | if [[ ${FIX} =~ [[:xdigit:]]{12} ]] ; then 23 | id=${BASH_REMATCH[0]} 24 | else 25 | echo "${txtred}try 2${txtrst}" 26 | id=$(echo "${FIX}" | sed -e 's/^[ \t]*//' | cut -f 2 -d ':' | sed -e 's/^[ \t]*//' | cut -f 1 -d ' ') 27 | fi 28 | 29 | if [ "${id}" == "" ] ; then 30 | echo "${txtpur}Can not parse fixes line:${txtrst}" 31 | echo "fixes=\"${FIX}\"" 32 | echo "" 33 | exit 1 34 | fi 35 | 36 | long_id=$(cd ~/linux/stable/linux-stable/ && git log -1 --format="%H" "${id}") 37 | if [ "${long_id}" == "" ] ; then 38 | echo "${txtred}id: '${id}' is not really a valid git commit id${txtrst}" 39 | echo "" 40 | exit 1 41 | fi 42 | 43 | echo -n "${txtylw}id: '${long_id}'${txtrst} is in: " 44 | 45 | #COMMIT_ID=`cat - | ~/bin/get_commit_id.sh` 46 | #COMMIT_ID=`cat - | grep -i "fixes:" | head -n 1 | sed -s 's/ //g' | cut -f 2 -d ':'` 47 | #COMMIT_ID=`cat - | grep -i "fixes:" | head -n 1 | sed -e 's/^[ \t]*//' | cut -f 2 -d ':' | cut -f 1 -d ' '` 48 | #COMMIT_ID=`cat - | grep -i "fixes:" | head -n 1 | sed -e 's/^[ \t]*//' | cut -f 2 -d ':' | sed -e 's/^[ \t]*//' | cut -f 1 -d ' '` 49 | #echo "$COMMIT_ID" 50 | #exit 51 | 52 | #echo "${txtylw}fixes: '${COMMIT_ID}'${txtrst}" 53 | 54 | 55 | #git describe --contains ${COMMIT_ID} 56 | #release=`git describe --contains ${long_id} | cut -f 1 -d '~'` 57 | #release=$(/home/gregkh/linux/scripts/fix_in_what_release "${long_id}") 58 | #release=$(/home/gregkh/linux/stable/commit_tree/id_found_in "${long_id}") 59 | #release+=" | " 60 | release=$(/home/gregkh/linux/vulns/tools/verhaal/id_found_in "${long_id}") 61 | 62 | # Now look in the stable queue just to be "safe" 63 | if [ -d ${STABLE_QUEUE} ] ; then 64 | GREP="git grep" 65 | cd ${STABLE_QUEUE=} || exit 66 | rs=$(${GREP} -l -i "${long_id}" queue-*) 67 | for r in ${rs}; do 68 | r=${r%\/*} # only keep the front queue release directory of a match, not the patch itself 69 | release+=" ${r}" 70 | done 71 | fi 72 | 73 | echo "${txtcyn}${release}${txtrst}" 74 | echo "" 75 | } 76 | 77 | echo "" 78 | #fixes=`cat - | grep -i "fixes:" | head -n 1` 79 | #fixes=`cat - | grep -i "fixes:"` 80 | #echo "fixes=${fixes}" 81 | #if [ "${fixes}" == "" ] ; then 82 | # echo "${txtpur}No \"Fixes:\" line found :(${txtrst}" 83 | # echo "" 84 | # exit 1 85 | #fi 86 | 87 | lines=$(cat - | grep -i "fixes:" | sed -e 's/^[ \t]*//' | cut -f 2 -d ':' | sed -e 's/^[ \t]*//' | cut -f 1 -d ' ') 88 | #echo "lines=${lines}" 89 | if [ "${lines}" == "" ] ; then 90 | echo "${txtpur}No \"Fixes:\" line found :(${txtrst}" 91 | echo "" 92 | exit 1 93 | fi 94 | 95 | for line in ${lines}; do 96 | # echo "line=${line}" 97 | find_fix "${line}" 98 | done 99 | 100 | -------------------------------------------------------------------------------- /scripts/generate_cc_list: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # SPDX-License-Identifier: GPL-2.0 3 | # 4 | # generate_cc_list 5 | # 6 | # Copyright 2018 (c) Greg Kroah-Hartman 7 | # 8 | # Generate a list of Cc: to add to a patch based on the get_maintainer.pl script 9 | # 10 | # You need to have a set of patches in the directory, and it will create a 11 | # .info file for them with the needed names to add. 12 | 13 | # Have one of the below uncommented out: 14 | 15 | # "fast" option: 16 | # no mailing lists, no git history, just the people listed in the 17 | # maintiners file 18 | OPTIONS="--no-rolestats --nol --nogit --nogit-fallback" 19 | 20 | # "full/slow" option: 21 | # all of the history, mailing lists, anyone who has breathed on the file. 22 | OPTIONS="--no-rolestats" 23 | 24 | for file in ./*patch; do 25 | out=$(echo "${file}" | cut -f 1 -d '-') 26 | out_file="${out}.info" 27 | echo "${file} -> ${out} -> ${out_file}" 28 | rm -f "${out_file}" 29 | ./scripts/get_maintainer.pl ${OPTIONS} "${file}" | while IFS= read -r name; do 30 | echo "Cc: ${name}" >> "${out_file}" 31 | done 32 | done 33 | -------------------------------------------------------------------------------- /scripts/generate_cid.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # SPDX-License-Identifier: GPL-2.0 3 | # 4 | # Copyright (C) 2019 Greg Kroah-Hartman 5 | # 6 | # Given a git range, spit out the Change ID (CID) that are fixed in that release 7 | # 8 | # usage: 9 | # generate_cid.sh GIT_RANGE 10 | # 11 | # 12 | 13 | # if we decide to rename the thing, change it here 14 | prefix="CID-" 15 | 16 | help() 17 | { 18 | echo "error, git range not found" 19 | echo "usage:" 20 | echo " $0 GIT_RANGE" 21 | exit 1 22 | } 23 | 24 | print_sha() 25 | { 26 | sha1=$1 27 | gsr=$(git show -s --abbrev-commit --abbrev=12 --pretty=format:"%h (\"%s\")%n" "${sha1}") 28 | echo "${prefix}${gsr}" 29 | } 30 | 31 | generate_cid() 32 | { 33 | git_range=$1 34 | for c in $(git rev-list --no-merges "${git_range}"); do 35 | # kernel commits have these in 2 different ways: 36 | # " commit 4b2c5a14cd8005a900075f7dfec87473c6ee66fb upstream." 37 | # or 38 | # " [ Upstream commit 3a069024d371125227de3ac8fa74223fcf473520 ]" 39 | # 40 | # Pick out the "first" 40 digit sha1 in the changelog text, which should be the "upstream" id 41 | upstream=$(git log -1 "${c}" | awk '{if(NR>1)print}' | grep -E -o '[0-9a-f]{40}' | head -n 1 ) 42 | if [ "${upstream}" != "" ] ; then 43 | print_sha "${upstream}" 44 | continue 45 | fi 46 | echo "upstream git id not found for ${c}" 47 | done 48 | } 49 | 50 | git_range=$1 51 | 52 | if [ "${git_range}" == "" ] ; then 53 | help 54 | fi 55 | 56 | generate_cid "${git_range}" 57 | exit 0 58 | -------------------------------------------------------------------------------- /scripts/install: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # installs a kernel 4 | # 5 | make modules_install 6 | 7 | # fine out what kernel version this is 8 | for TAG in VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION ; do 9 | eval `sed -ne "/^$TAG/s/ //gp" Makefile` 10 | done 11 | SRC_RELEASE=$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION 12 | 13 | # figure out the arch 14 | #ARCH=`grep "CONFIG_ARCH " include/linux/autoconf.h | cut -f 2 -d "\""` 15 | #ARCH="i386" 16 | ARCH="x86" 17 | 18 | # copy the kernel image 19 | cp arch/$ARCH/boot/bzImage /boot/bzImage-"$SRC_RELEASE" 20 | 21 | # copy the System.map file 22 | cp System.map /boot/System.map-"$SRC_RELEASE" 23 | #ln -sf /boot/System.map-"$SRC_RELEASE" /boot/System.map 24 | 25 | # delete the keys used for this kernel 26 | rm certs/signing_key.* 27 | 28 | echo "Installed $SRC_RELEASE for $ARCH" 29 | 30 | #if [ -f "/etc/os-release" ]; then 31 | # source /etc/os-release 32 | #fi 33 | # 34 | #if [ "${NAME}" = "Arch Linux" ]; then 35 | # # This is arch linux, so make the initrd 36 | # mkinitcpio -k ${SRC_RELEASE}-gregkh -g /boot/initramfs-${SRC_RELEASE}-gregkh.img 37 | #fi 38 | -------------------------------------------------------------------------------- /scripts/make_kernel_shortlog.pl: -------------------------------------------------------------------------------- 1 | #!/bin/perl 2 | # 3 | # make kernel shortlog 4 | # 5 | # Copyright 2017 Greg Kroah-Hartman 6 | # 7 | # released under the GPLv2 only 8 | # 9 | # SPDX-License-Identifier: GPL-2.0 10 | # 11 | # Dumb script to generate a shortlog of one kernel release to another, in 12 | # cronological order of commits. Useful for when you merge in an upstream 13 | # kernel release into your own tree. 14 | # 15 | 16 | use warnings; 17 | use strict; 18 | 19 | my @version_array; 20 | my $version; 21 | my ($email, $name); 22 | my $line; 23 | my ($major_version, $minor_version, $stable_version, $last_version); 24 | 25 | # get the version number of the kernel we are merging from and to, in order to 26 | # diff it properly. The kernel will give this to us automatically by runing 27 | # 'make kernelversion' 28 | 29 | $version = `make kernelversion`; 30 | chomp($version); 31 | 32 | @version_array = split /\./, $version; 33 | $major_version = $version_array[0]; 34 | $minor_version = $version_array[1]; 35 | $stable_version = $version_array[2]; 36 | 37 | $last_version = $stable_version - 1; 38 | 39 | 40 | # get the email and name of the git committer. Use the environment variables 41 | # first if they are present, if not, use the git config values, just like git 42 | # ends up doing. 43 | 44 | $email = $ENV{"GIT_COMMITTER_EMAIL"}; 45 | if ($email eq "") { 46 | $email = `git config --get user.email`; 47 | chomp($email); 48 | $email = "<".$email.">"; 49 | } 50 | 51 | $name = $ENV{"GIT_COMMITTER_NAME"}; 52 | if ($name eq "") { 53 | $name = `git config --get user.name`; 54 | chomp($name); 55 | } 56 | 57 | 58 | # print out the changelog text 59 | 60 | print "Merge $version into android-$major_version.$minor_version\n"; 61 | print "\n"; 62 | print "Changes in $major_version.$minor_version.$stable_version\n"; 63 | 64 | open GIT, "git log --format=\"%s\" --reverse v$major_version.$minor_version.$last_version..v$major_version.$minor_version.$stable_version | " || die "Failed to run git"; 65 | 66 | while ($line = ) { 67 | print "\t$line"; 68 | } 69 | 70 | close GIT; 71 | 72 | print "\n"; 73 | print "Signed-off-by: $name $email\n"; 74 | 75 | exit; 76 | -------------------------------------------------------------------------------- /scripts/make_patchsets: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2005 Greg Kroah-Hartman 4 | # 5 | # Released under the GPL v2 only. 6 | # 7 | # Horrible hack of a script to let kernel maintainers, who use quilt 8 | # export a series of patches in a form that is rolled up, and in-order 9 | # for others to pick up and use. Examples of this is for the -mm releases. 10 | # 11 | 12 | # Here are the things you should modify: 13 | 14 | # AUTHOR is your name, it will be pre-appended to all patches 15 | AUTHOR=gregkh 16 | 17 | # TMP is where you want everything to happen. You need to have a base kernel 18 | # version (specified by KERNEL) in here, all unpacked. This is also where the 19 | # end result files will be placed. 20 | TMP=~/linux/tmp 21 | 22 | # PATCH_DIR is the location of your quilt patches. There should be a file in 23 | # here called "series" and a bunch of patches in subdirectories below that (the 24 | # subdirs are how you divide stuff up by TREES) 25 | PATCH_DIR=~/linux/patches 26 | 27 | # KERNEL is the base kernel version your quilt series is against. You need to 28 | # have this kernel tree already uncompressed and waiting in the TMP directory 29 | if [ -f "$PATCH_DIR/version" ] ; then 30 | KERNEL=`cat $PATCH_DIR/version` 31 | else 32 | KERNEL=2.6.17-rc3-git5 33 | fi 34 | 35 | # TREES is a list of the different sets of kernel patches you wish to produce. 36 | # If you only have one set of patches, this can be a single value. The strings 37 | # here need to have a subdirectory in the PATCH_DIR to get the patches from. 38 | #TREES="driver i2c pci usb devfs" 39 | #TREES="driver pci usb driver-class" 40 | #TREES="driver-core pci usb ldp" 41 | #TREES="driver-core.current usb.current driver-core usb ldp.next ldp" 42 | TREES="driver-core.current tty.current usb.current staging.current driver-core tty usb staging" 43 | 44 | 45 | # Don't touch anything below here, unless you really want to... 46 | 47 | do_it() { 48 | NEW=$BASE-$TREE 49 | CLEAN_TREE="$BASE$OLD_TREE" 50 | BASENAME=`echo "$AUTHOR" "$SERIES" "$TREE" | \ 51 | awk '{ printf("%s-%02d-%s\n", $1, $2, $3, $4);}'` 52 | TMPDIR=$TMP/$BASENAME 53 | 54 | echo "Building series file for $TREE" 55 | chmod 644 $PATCH_DIR/$TREE/*.patch 56 | rm -rf $TMPDIR 57 | mkdir $TMPDIR 58 | echo "Use the 'series' file in this directory to determine the order in" > $TMPDIR/README 59 | echo "which to apply the patches." >> $TMPDIR/README 60 | echo "" >> $TMPDIR/README 61 | echo "These patches are based on the $KERNEL version of the kernel." >> $TMPDIR/README 62 | echo "Applying them to any other kernel version might not work at all." >> $TMPDIR/README 63 | touch $TMPDIR/series 64 | echo "# BASE $KERNEL" >> $TMPDIR/series 65 | echo "# NEXT_BASE $NEXT_BASE" >> $TMPDIR/series 66 | count=1 67 | for x in `grep "^$TREE\/" $PATCH_DIR/series` 68 | do 69 | file=`basename $x` 70 | if [ -f $PATCH_DIR/$x ]; then 71 | cp -a $PATCH_DIR/$x $TMPDIR/$file 72 | echo "$file" >> $TMPDIR/series 73 | let count++ 74 | else 75 | echo "File $PATCH_DIR/$x is not found, aborting!" 76 | exit 1; 77 | fi 78 | done 79 | 80 | echo "Creating $NEW kernel tree" 81 | rm -rf $NEW 82 | cp -alp $CLEAN_TREE $NEW 83 | 84 | # apply quilt series 85 | cd $NEW 86 | QUILT_PATCHES=$TMPDIR QUILT_SERIES=$TMPDIR/series quilt push -aq --quiltrc 87 | #rm $TMPDIR/series 88 | cd .. 89 | 90 | # TODO put "changelog" in patch. 91 | echo "diffing $CLEAN_TREE and $NEW" 92 | rm -f $BASENAME-$KERNEL.patch 93 | diff -Naur -X $CLEAN_TREE/Documentation/dontdiff $CLEAN_TREE $NEW > $BASENAME-$KERNEL.patch 94 | 95 | echo "cleaning up quilt remnants $NEW" 96 | rm -rf $NEW/.pc 97 | 98 | echo "Patch is at $BASENAME-$KERNEL.patch" 99 | echo "Dir of patches is at $TMPDIR" 100 | echo "" 101 | let SERIES++ 102 | } 103 | 104 | BASE=linux-$KERNEL 105 | # make sure we have a base tree to diff off of. 106 | if [ ! -d "$TMP/$BASE" ] ; then 107 | echo "I need $TMP/$BASE present in order to work properly." 108 | exit 1 109 | fi 110 | 111 | # make sure everything is readable by world for when we upload the patches 112 | find $PATCH_DIR -type f | xargs chmod 644 113 | 114 | # initialize some variables 115 | SERIES=1 116 | OLD_TREE="" 117 | NEXT_BASE="" 118 | 119 | # do the work 120 | cd $TMP 121 | 122 | for TREE in $TREES 123 | do 124 | do_it 125 | if [ "X$OLD_TREE" != "X" ] ; then 126 | echo "Cleaning up $BASE$OLD_TREE" 127 | rm -rf $BASE$OLD_TREE 128 | echo "" 129 | fi 130 | OLD_TREE="-$TREE" 131 | NEXT_BASE="$TREE" 132 | done 133 | 134 | # TODO put "changelog" in patch. 135 | 136 | echo "" 137 | echo "diffing $BASE and $NEW" 138 | rm -f $AUTHOR-all-$KERNEL.patch 139 | diff -Naur -X $BASE/Documentation/dontdiff $BASE $NEW > $AUTHOR-all-$KERNEL.patch 140 | echo "Patch is at $AUTHOR-all-$KERNEL.patch" 141 | 142 | 143 | if [ "X$OLD_TREE" != "X" ] ; then 144 | echo "Cleaning up $BASE$OLD_TREE" 145 | rm -rf $BASE$OLD_TREE 146 | fi 147 | 148 | -------------------------------------------------------------------------------- /scripts/make_patchsets.new: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2005 Greg Kroah-Hartman 4 | # 5 | # Released under the GPL v2 only. 6 | # 7 | # Horrible hack of a script to let kernel maintainers, who use quilt 8 | # export a series of patches in a form that is rolled up, and in-order 9 | # for others to pick up and use. Examples of this is for the -mm releases. 10 | # 11 | 12 | # Here are the things you should modify: 13 | 14 | # AUTHOR is your name, it will be pre-appended to all patches 15 | AUTHOR=gregkh 16 | 17 | # TMP is where you want everything to happen. You need to have a base kernel 18 | # version (specified by KERNEL) in here, all unpacked. This is also where the 19 | # end result files will be placed. 20 | TMP=~/linux/tmp 21 | 22 | # PATCH_DIR is the location of your quilt patches. There should be a file in 23 | # here called "series" and a bunch of patches in subdirectories below that (the 24 | # subdirs are how you divide stuff up by TREES) 25 | PATCH_DIR=~/linux/patches 26 | 27 | 28 | # GIT_DIR is where the kernel git tree is at. It will be used to clone 29 | # from, as well as where we get our starting git commit id to base everything 30 | # off of. 31 | GIT_DIR=~/linux/gregkh-2.6 32 | 33 | # KERNEL is the base kernel version your quilt series is against. You need to 34 | # have this kernel tree already uncompressed and waiting in the TMP directory 35 | if [ -f "$PATCH_DIR/version" ] ; then 36 | KERNEL=`cat $PATCH_DIR/version` 37 | else 38 | KERNEL=2.6.17-rc3-git5 39 | fi 40 | 41 | pushd . 42 | cd $GIT_DIR 43 | echo "pwd = `pwd`" 44 | HEAD=`git show | head -n 1 | cut -f 2 -d ' '` 45 | echo "HEAD=$HEAD" 46 | popd 47 | echo "pwd = `pwd`" 48 | 49 | 50 | # TREES is a list of the different sets of kernel patches you wish to produce. 51 | # If you only have one set of patches, this can be a single value. The strings 52 | # here need to have a subdirectory in the PATCH_DIR to get the patches from. 53 | #TREES="driver i2c pci usb devfs" 54 | #TREES="driver pci usb driver-class" 55 | #TREES="driver-core pci usb ldp" 56 | #TREES="driver-core.current usb.current driver-core usb ldp.next ldp" 57 | TREES="driver-core.current tty.current usb.current staging.current driver-core tty usb staging" 58 | 59 | 60 | # Don't touch anything below here, unless you really want to... 61 | 62 | do_it() { 63 | NEW=$BASE-$TREE 64 | CLEAN_TREE="$BASE$OLD_TREE" 65 | BASENAME=`echo "$AUTHOR" "$SERIES" "$TREE" | \ 66 | awk '{ printf("%s-%02d-%s\n", $1, $2, $3, $4);}'` 67 | TMPDIR=$TMP/$BASENAME 68 | 69 | echo "Building series file for $TREE" 70 | chmod 644 $PATCH_DIR/$TREE/*.patch 71 | rm -rf $TMPDIR 72 | mkdir $TMPDIR 73 | echo "Use the 'series' file in this directory to determine the order in" > $TMPDIR/README 74 | echo "which to apply the patches." >> $TMPDIR/README 75 | echo "" >> $TMPDIR/README 76 | # echo "These patches are based on the $KERNEL version of the kernel." >> $TMPDIR/README 77 | echo "These patches are based on the $HEAD git id of the kernel." >> $TMPDIR/README 78 | echo "Applying them to any other kernel version might not work at all." >> $TMPDIR/README 79 | touch $TMPDIR/series 80 | # echo "# BASE $KERNEL" >> $TMPDIR/series 81 | echo "# BASE $HEAD" >> $TMPDIR/series 82 | echo "# NEXT_BASE $NEXT_BASE" >> $TMPDIR/series 83 | count=1 84 | for x in `grep "^$TREE\/" $PATCH_DIR/series` 85 | do 86 | file=`basename $x` 87 | if [ -f $PATCH_DIR/$x ]; then 88 | cp -a $PATCH_DIR/$x $TMPDIR/$file 89 | echo "$file" >> $TMPDIR/series 90 | let count++ 91 | else 92 | echo "File $PATCH_DIR/$x is not found, aborting!" 93 | exit 1; 94 | fi 95 | done 96 | 97 | echo "Creating $NEW kernel tree" 98 | rm -rf $NEW 99 | cp -alp $CLEAN_TREE $NEW 100 | 101 | # apply quilt series 102 | cd $NEW 103 | QUILT_PATCHES=$TMPDIR QUILT_SERIES=$TMPDIR/series quilt push -aq --quiltrc 104 | #rm $TMPDIR/series 105 | cd .. 106 | 107 | # TODO put "changelog" in patch. 108 | echo "diffing $CLEAN_TREE and $NEW" 109 | rm -f $BASENAME-$KERNEL.patch 110 | diff -Naur -X $CLEAN_TREE/Documentation/dontdiff $CLEAN_TREE $NEW > $BASENAME-$KERNEL.patch 111 | 112 | echo "cleaning up quilt remnants $NEW" 113 | rm -rf $NEW/.pc 114 | 115 | echo "Patch is at $BASENAME-$KERNEL.patch" 116 | echo "Dir of patches is at $TMPDIR" 117 | echo "" 118 | let SERIES++ 119 | } 120 | 121 | BASE=linux-$KERNEL 122 | # make sure we have a base tree to diff off of. 123 | if [ ! -d "$TMP/$BASE" ] ; then 124 | echo "I need $TMP/$BASE present in order to work properly." 125 | exit 1 126 | fi 127 | 128 | # create the common base tree to diff off of 129 | BASE=linux-tmp 130 | if [ -d "$TMP/$BASE" ] ; then 131 | rm -rf $TMP/$BASE 132 | fi 133 | git clone ~/linux/gregkh-2.6/ $TMP/$BASE 134 | pushd . 135 | cd $TMP/$BASE 136 | git checkout $HEAD 137 | popd 138 | 139 | # make sure everything is readable by world for when we upload the patches 140 | find $PATCH_DIR -type f | xargs chmod 644 141 | 142 | # initialize some variables 143 | SERIES=1 144 | OLD_TREE="" 145 | NEXT_BASE="" 146 | 147 | # do the work 148 | cd $TMP 149 | 150 | for TREE in $TREES 151 | do 152 | do_it 153 | if [ "X$OLD_TREE" != "X" ] ; then 154 | echo "Cleaning up $BASE$OLD_TREE" 155 | rm -rf $BASE$OLD_TREE 156 | echo "" 157 | fi 158 | OLD_TREE="-$TREE" 159 | NEXT_BASE="$TREE" 160 | done 161 | 162 | # TODO put "changelog" in patch. 163 | 164 | echo "" 165 | echo "diffing $BASE and $NEW" 166 | rm -f $AUTHOR-all-$KERNEL.patch 167 | diff -Naur -X $BASE/Documentation/dontdiff $BASE $NEW > $AUTHOR-all-$KERNEL.patch 168 | echo "Patch is at $AUTHOR-all-$KERNEL.patch" 169 | 170 | 171 | if [ "X$OLD_TREE" != "X" ] ; then 172 | echo "Cleaning up $BASE$OLD_TREE" 173 | rm -rf $BASE$OLD_TREE 174 | fi 175 | 176 | -------------------------------------------------------------------------------- /scripts/mimedump: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | =head1 NAME 4 | 5 | mimedump - dump out the contents of a parsed MIME message 6 | 7 | =head1 DESCRIPTION 8 | 9 | Read a MIME stream from the stdin, and dump its contents to the stdout. 10 | 11 | =head1 SYNOPSIS 12 | 13 | mimedump < mime.containing.mailbox 14 | 15 | =head1 AUTHOR 16 | 17 | Andreas Koenig suggested this, and wrote the original code. 18 | Eryq perverted the hell out of it. 19 | 20 | Modified by James Bottomley purely to flatten mime mailboxes 21 | (i.e. mailbox with mime attachements in -> fully flat plain text 22 | mailbox out) 23 | 24 | =cut 25 | 26 | use MIME::Parser; 27 | 28 | #------------------------------ 29 | # 30 | # dump_entity ENTITY, NAME 31 | # 32 | # Recursive routine for dumping an entity. 33 | # 34 | sub dump_entity { 35 | my ($entity, $name) = @_; 36 | defined($name) or $name = "'anonymous'"; 37 | my $IO; 38 | 39 | # Output the body: 40 | my @parts = $entity->parts; 41 | if (@parts) { # multipart... 42 | my $i; 43 | foreach $i (0 .. $#parts) { # dump each part... 44 | dump_entity($parts[$i], ("$name, part ".(1+$i))); 45 | } 46 | } 47 | else { # single part... 48 | 49 | # Get MIME type, and display accordingly... 50 | my ($type, $subtype) = split('/', $entity->head->mime_type); 51 | my $body = $entity->bodyhandle; 52 | if ($IO = $body->open("r")) { 53 | print FDOUT $_ while (defined($_ = $IO->getline)); 54 | $IO->close; 55 | } 56 | else { # d'oh! 57 | print "$0: couldn't find/open '$name': $!"; 58 | } 59 | } 60 | 1; 61 | } 62 | 63 | #------------------------------ 64 | # 65 | # main 66 | # 67 | sub main { 68 | $message=''; 69 | 70 | open(FDIN, "<".$ARGV[0]) || die("No from file"); 71 | open(FDOUT, ">".$ARGV[1]) || die("No to file"); 72 | 73 | $from = ; 74 | while(1) { 75 | $message=''; 76 | die "Incorrectly formatted mailbox" unless ($from =~ /^From /); 77 | print FDOUT $from; 78 | 79 | $show_line = 1; 80 | while() { 81 | last if (m/^From /); 82 | $message .= $_; 83 | print FDOUT if ($show_line); 84 | $show_line = 0 if (m/^$/); 85 | } 86 | $from = $_; 87 | 88 | # Create a new MIME parser: 89 | my $parser = new MIME::Parser; 90 | 91 | # Create and set the output directory: 92 | (-d "mimedump-tmp") or mkdir "mimedump-tmp",0755 or die "mkdir: $!"; 93 | (-w "mimedump-tmp") or die "can't write to directory"; 94 | $parser->output_dir("mimedump-tmp"); 95 | 96 | # Read the MIME message: 97 | $entity = $parser->parse_data($message) or die "couldn't parse MIME stream"; 98 | 99 | # Dump it out: 100 | dump_entity($entity); 101 | last if(!defined($from)); 102 | } 103 | system("rm -fr mimedump-tmp"); 104 | } 105 | exit(&main ? 0 : -1); 106 | 107 | #------------------------------ 108 | 1; 109 | 110 | -------------------------------------------------------------------------------- /scripts/opensnoop.bt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bpftrace 2 | // SPDX-License-Identifier: Apache-2.0 3 | /* 4 | * snoop and print out the filename of anything opened 5 | * 6 | * Based on opensnoop.bt from Brendan Gregg, but stripped 7 | * down to almost nothing 8 | */ 9 | tracepoint:syscalls:sys_enter_open, 10 | tracepoint:syscalls:sys_enter_openat 11 | { 12 | printf("%s\n", str(args->filename)); 13 | } 14 | -------------------------------------------------------------------------------- /scripts/reformat: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # (c) 2014, Joe Perches 3 | # 4 | # Automate checkpatch modifications and git commits to 5 | # neaten code that doesn't conform to CodingStyle. 6 | # Useful primarily for files in drivers/staging 7 | # 8 | # Licensed under the terms of the GNU GPL License version 2 9 | 10 | declare -ar whitespace_types=( \ 11 | 'whitespace_neatening:spacing,space_before_tab,pointer_location,trailing_whitespace,bracket_space' \ 12 | 'remove_spaces_before_tabs:space_before_tab' \ 13 | 'fix_label_positions:indented_label' \ 14 | 'align_arguments_to_parenthesis:parenthesis_alignment' \ 15 | ) 16 | 17 | declare -ar changecode_types=( \ 18 | 'fix_brace_positions:open_brace,braces,else_after_brace,while_after_brace' \ 19 | 'fix_blank_lines:line_spacing' \ 20 | 'use_standard_attributes:prefer_packed,prefer_aligned' \ 21 | 'remove_unnecessary_externs:avoid_externs' \ 22 | 'update_c90_comment_style:c99_comments' \ 23 | ) 24 | 25 | checkpatch_update () 26 | { 27 | file=$1 28 | 29 | desc=$(echo $2 | cut -f1 -d: | sed 's/_/ /g') 30 | types=$(echo $2 | cut -f2- -d:) 31 | 32 | echo "file: <$file> description: <$desc> types:<$types>" 33 | 34 | ./scripts/checkpatch.pl --file --fix-inplace --strict --types="$types" $file 35 | 36 | checkpatch_fixes=$file.diff 37 | git diff --stat -p --exit-code $file > $checkpatch_fixes 38 | if [ $? == 0 ] ; then 39 | rm -f $checkpatch_fixes 40 | return 41 | fi 42 | 43 | basename=$(basename $file) 44 | if [ "${basename##*.}" == "c" ] ; then 45 | 46 | git checkout $file 47 | obj="$(echo $file | sed 's/\.c$/\.o/')" 48 | if [ -e $obj ] ; then 49 | rm -f $obj 50 | fi 51 | 52 | echo "Compiling original version..." 53 | 54 | ${CROSS_COMPILE}make $obj 55 | 56 | ${CROSS_COMPILE}objdump -D $obj | \ 57 | sed "s/^[[:space:]]\+[0-9a-f]\+//" > $obj.old 58 | 59 | patch -p1 < $checkpatch_fixes 60 | 61 | echo "Compiling modified version..." 62 | 63 | ${CROSS_COMPILE}make $obj 64 | 65 | ${CROSS_COMPILE}objdump -D $obj | \ 66 | sed "s/^[[:space:]]\+[0-9a-f]\+//" > $obj.new 67 | 68 | echo "Comparing objects..." 69 | diff -Nurd $obj.new $obj.old 70 | if [ $? -ne 0 ] ; then 71 | echo "Object differences exist! - Verify changes before commit!" 72 | read -s -p "Press the 'enter' key to continue: " 73 | else 74 | echo "No object differences found" 75 | fi 76 | rm -f $obj.old 77 | rm -f $obj.new 78 | fi 79 | 80 | echo "running checkpatch on possible checkpatch fixes..." 81 | 82 | ./scripts/checkpatch.pl --no-summary --no-signoff $checkpatch_fixes 83 | rm -f $checkpatch_fixes 84 | 85 | echo "Verify checkpatch output and make any necessary changes" 86 | echo "Edit '$file' if appropriate" 87 | read -s -p "Press the 'enter' key to continue: " 88 | 89 | commit_log_file=$(mktemp git_commit.XXXXXX) 90 | 91 | if [ -e $commit_log_file ] ; then 92 | rm -f $commit_log_file 93 | fi 94 | 95 | if [[ $file =~ ^drivers/staging/ ]] ; then 96 | echo -n "staging: " >> $commit_log_file 97 | fi 98 | echo "$(basename $(dirname $file)): checkpatch cleanup: $desc" >> $commit_log_file 99 | echo "" >> $commit_log_file 100 | git diff --exit-code -w $file > /dev/null 101 | if [ $? == 0 ] ; then 102 | echo "whitespace changes only - git diff -w shows no difference" >> $commit_log_file 103 | fi 104 | 105 | git diff $file | cat 106 | 107 | echo "Ready to commit - First verify all diffs and make any necessary changes" 108 | echo "" 109 | read -r -p "Would you like to commit these changes : " response 110 | response=${response,,} 111 | if [[ $response =~ ^(yes|y|)$ ]] ; then 112 | git commit -s -F $commit_log_file -e $file 113 | else 114 | git checkout $file 115 | fi 116 | 117 | rm -f $commit_log_file 118 | } 119 | 120 | which git > /dev/null 121 | if [ $? -ne 0 ] || [ ! -e .git ] ; then 122 | echo "git or git directory not found - run this from the top of the source tree" 123 | exit 1 124 | fi 125 | 126 | for file in "$@" ; do 127 | 128 | if [ ! -f $file ] ; then 129 | echo "Argument '$file' is not a file" 130 | continue 131 | fi 132 | 133 | for type in "${whitespace_types[@]}" ; do 134 | checkpatch_update $file $type 135 | done 136 | 137 | for type in "${changecode_types[@]}" ; do 138 | checkpatch_update $file $type 139 | done 140 | 141 | done 142 | -------------------------------------------------------------------------------- /scripts/revert_stable: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # revert_stable: 4 | # Revert a commit in a stable tree and reference the original commit id 5 | # 6 | # usage: 7 | # revert_stable SHA1 8 | # 9 | # Dumps the message into a file called "revert_msg" which you can then include 10 | # in the changelog text for the revert. 11 | 12 | SHA=$1 13 | 14 | if [[ "${SHA}" == "" ]]; then 15 | echo "Error: forgot to give a sha" 16 | exit 1 17 | fi 18 | 19 | MAINSHA=$(git --no-pager log -n1 ${SHA} | grep -i upstream | grep -oE "[a-f0-9]{40,}") || true 20 | 21 | if [[ "${MAINSHA}" == "" ]]; then 22 | MAINSHA=${SHA} 23 | fi 24 | 25 | LOG=$(git show --format="%s" ${SHA} | head -n 1) 26 | 27 | echo "Revert \"${LOG}\"" > revert_msg 28 | echo "" >> revert_msg 29 | echo "This reverts commit ${SHA} which is" >> revert_msg 30 | echo "commit ${MAINSHA} upstream." >> revert_msg 31 | 32 | git revert -e ${SHA} 33 | -------------------------------------------------------------------------------- /scripts/set_it_up.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2012 Greg Kroah-Hartman 4 | # Copyright 2012 Linux Foundation 5 | # 6 | # Released under the GPLv2 only. 7 | # 8 | # Initialize the linux repo with the remote git trees that I need in order to 9 | # get things done. This consists of the development trees in the work/ 10 | # directory, my local gregkh/ directory and patch queue, and the stable trees. 11 | # 12 | # The work directory is the most complex, it consists of one "root" repo, 13 | # called "torvalds" that is based on Linus's upstream kernel tree. I then 14 | # create multiple trees based on that, each in a separate subdirectory, based 15 | # on the "topic". In each of those trees, I have a 'next' and 'linus' branch 16 | # that is used to send stuff to linux-next and Linus's tree, respectively. 17 | # 18 | # I also do the "work" on branches that are based on these 'next' and 'linus' 19 | # branches, that is what the 'send the email' scripts expect patches to be 20 | # applied to, so they know how to push and notify people when stuff is added. 21 | # 22 | # The main gregkh/ directory is what I do local work on for things not ready to 23 | # be merged upstream. It's also tied to a quilt tree, to save patches in a 24 | # safe place for storage and passing to other machines. 25 | # Yeah, it's a bit complex, but it works for me. 26 | # 27 | 28 | # go into the work directory and set up everything there first. 29 | 30 | cd work/ 31 | 32 | WORK_TREES="driver-core staging tty usb char-misc" 33 | 34 | # First, clone Linus's tree in --bare mode as we are going to work off of that: 35 | # for local testing, to make it faster... 36 | #git clone --bare gregkh@clark:linux/work/torvalds torvalds 37 | git clone --bare git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git torvalds 38 | 39 | cd torvalds 40 | # set up the config 41 | git config remote.origin.fetch +refs/heads/*:refs/heads/* 42 | git config remote.kroah.com.fetch +refs/heads/*:refs/heads/* 43 | git config remote.kroah.com.url git@git.kroah.com:kernel.org/linux.git/ 44 | git config branch.master.remote kroah.com 45 | git config branch.master.merge refs/heads/master 46 | 47 | # write do.sh script 48 | echo "git fetch origin && git push" > do.sh 49 | chmod 755 do.sh 50 | cd .. 51 | 52 | 53 | # now make clones of it for the different work types 54 | for TREE in ${WORK_TREES} 55 | do 56 | echo "*** creating ${TREE} tree" 57 | git clone -s torvalds ${TREE} 58 | 59 | echo "*** setting up the master link" 60 | cd ${TREE} 61 | git remote add temp gitolite@ra.kernel.org:/pub/scm/linux/kernel/git/gregkh/${TREE}.git 62 | git remote rm origin 63 | git remote rename temp origin 64 | 65 | # have the master branch track the remote master 66 | git config branch.master.remote origin 67 | git config branch.master.merge refs/heads/master 68 | 69 | echo "*** setting up kroah.com link" 70 | git remote add kroah.com git@git.kroah.com:kernel/${TREE}.git 71 | 72 | echo "*** fetching from remote repo" 73 | git fetch origin 74 | 75 | echo "*** setting up branches" 76 | git checkout -t -b ${TREE}-linus origin/${TREE}-linus 77 | git checkout -b work-linus ${TREE}-linus 78 | git checkout -t -b ${TREE}-next origin/${TREE}-next 79 | git checkout -b work-next ${TREE}-next 80 | 81 | 82 | cd .. 83 | done 84 | 85 | # make empty files for patch work 86 | touch s s1 s2 87 | 88 | 89 | cd .. 90 | 91 | # clone my local tree, so that I can do stuff 92 | echo "*** Creating gregkh repo" 93 | git clone --shared work/torvalds gregkh 94 | 95 | # clone my patch queue, not much there, but it's a place to work from 96 | echo "*** Cloning patch queue" 97 | git clone gitolite@ra.kernel.org:/pub/scm/linux/kernel/git/gregkh/patches.git patches 98 | cd patches 99 | git remote add kroah.com git@git.kroah.com:kernel/patches.git 100 | cd .. 101 | 102 | # Now for the stable stuff 103 | echo "*** Setting up the Stable directories" 104 | cd stable/ 105 | 106 | # we need the stable-queue first 107 | echo "*** Cloning the stable-queue" 108 | git clone gitolite@ra.kernel.org:/pub/scm/linux/kernel/git/stable/stable-queue.git 109 | cd stable-queue 110 | git remote add kroah.com git@git.kroah.com:kernel/stable-queue.git 111 | cd .. 112 | 113 | echo "*** Cloning the linux-stable tree, will take a while" 114 | git clone gitolite@ra.kernel.org:/pub/scm/linux/kernel/git/stable/linux-stable.git 115 | echo "*** Done, please set up the branches and stable repos as you need." 116 | 117 | cd .. 118 | 119 | echo "*** Also set up longterm/ if you still need it." 120 | 121 | -------------------------------------------------------------------------------- /scripts/stable_search: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | 5 | HOME="/home/gregkh/linux" 6 | TMPDIR="/home/gregkh/tmp" 7 | PREFIX="stable_search_" 8 | TMP_PREFIX="${TMPDIR}/${PREFIX}" 9 | 10 | #KERNEL_RANGE="v4.9..v4.10" 11 | #KERNEL_RANGE="v4.14..v4.15" 12 | KERNEL_RANGE="v4.15..HEAD" 13 | 14 | STABLE_KERNEL="${HOME}/stable/linux-4.15.y" 15 | #STABLE_KERNEL="${HOME}/stable/linux-4.14.y" 16 | LATEST_KERNEL="${HOME}/gregkh" 17 | 18 | cd "${STABLE_KERNEL}" 19 | STABLE_LOG=`mktemp ${TMP_PREFIX}stable_log.XXXXXX` || exit 1 20 | git log v4.14..HEAD > "${STABLE_LOG}" 21 | 22 | cd - 23 | 24 | cd "${LATEST_KERNEL}" 25 | GIT_LOG=`mktemp ${TMP_PREFIX}git_log.XXXXXX` || exit 1 26 | git log --no-merges --format='%h' "${KERNEL_RANGE}" > ${GIT_LOG} 27 | 28 | NOT_STABLE_YET=`mktemp ${TMP_PREFIX}not_stable_yet.XXXXXX` || exit 1 29 | 30 | SYZ_MBOX=`mktemp ${TMP_PREFIX}syzkaller_mbox.XXXXXX` || exit 1 31 | 32 | COMMIT_LOG=`mktemp ${TMP_PREFIX}tmp_log.XXXXX` || exit 1 33 | 34 | while read -r commit 35 | do 36 | #echo "commit = ${commit}" 37 | 38 | # is it in the log already? 39 | present=`grep "${commit}" "${STABLE_LOG}"` 40 | if [ "${present}" == "" ] ; then 41 | echo "${commit}" >> ${NOT_STABLE_YET} 42 | #echo "commit ${commit} is not present!" 43 | 44 | git log -1 --format='%b' ${commit} > ${COMMIT_LOG} 45 | 46 | # is this commit a "fix" for something already in this release? 47 | # fixme... 48 | fixes=`grep -i '^[[:space:]]*Fixes:' ${COMMIT_LOG}` 49 | if [ "${fixes}" != "" ] ; then 50 | fix_commit=`echo ${fixes} | sed -e 's/^[ \t]*//' | cut -f 2 -d ':' | sed -e 's/^[ \t]*//' | cut -f 1 -d ' '` 51 | echo "fixes='${fixes}'" 52 | echo " fix_commit='${fix_commit}'" 53 | fix_release=`git describe --contains ${fix_commit} | cut -f 1 -d '~'` 54 | echo " fix_release='${fix_release}'" 55 | fi 56 | 57 | 58 | # is it a syzkaller reported patch? 59 | grep -i "syzkaller" ${COMMIT_LOG} &> /dev/null 60 | if [ $? -eq 0 ] ; then 61 | #echo "${commit}" >> "${SYZ_MBOX}" 62 | git show --pretty=email ${commit} >> "${SYZ_MBOX}" 63 | echo "commit ${commit} is a syzkaller one!" 64 | fi 65 | fi 66 | done < "${GIT_LOG}" 67 | 68 | rm ${COMMIT_LOG} 69 | rm ${NOT_STABLE_YET} 70 | rm ${GIT_LOG} 71 | rm ${STABLE_LOG} 72 | 73 | -------------------------------------------------------------------------------- /scripts/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # do at every boot 5 | sudo mount -t tmpfs tmpfs -o size=40G tmp 6 | cd linux/stable/linux-stable 7 | git fetch 8 | ~/update_all_branches 9 | #git checkout linux-3.0.y && git pull 10 | #git checkout linux-3.4.y && git pull 11 | ##git checkout linux-3.5.y && git pull 12 | ##git checkout linux-3.6.y && git pull 13 | #git checkout linux-3.7.y && git pull 14 | #git checkout master && git pull 15 | cd 16 | 17 | echo "machine is up and running" | mutt -s "machine is up and running" -- greg@kroah.com 18 | sleep 3 19 | sudo /etc/init.d/sendmail restart 20 | 21 | -------------------------------------------------------------------------------- /scripts/sysfs_benchmark: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sysfs_file="/sys/devices/system/cpu/cpu0/topology/die_id" 4 | 5 | read_file() { 6 | foo=$(<${sysfs_file}) 7 | } 8 | 9 | loop() { 10 | num_loops=$1 11 | 12 | for ((i=0;i<=num_loops;i++)); do 13 | read_file 14 | done 15 | } 16 | 17 | if [ "$#" -ne 2 ]; then 18 | echo "${0} NUM_LOOPS NUM_PROCESSES" 19 | exit 1 20 | fi 21 | 22 | num_loops=$1 23 | num_processes=$2 24 | 25 | echo "Creating ${num_processes} processes that will read ${sysfs_file} ${num_loops} times" 26 | 27 | for ((process=0;process<=num_processes;process++)); do 28 | loop "${num_loops}" & 29 | done 30 | 31 | wait 32 | exit 33 | -------------------------------------------------------------------------------- /scripts/syzbot_search: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # SPDX-License-Identifier: GPL-2.0 3 | # 4 | # Copyright 2018 Greg Kroah-Hartman 5 | # 6 | # Dig out patches that are created based on syzbot reports from Linus's tree that might be good to have backported into the stable trees. 7 | # 8 | # horribly messy right now, probably really inefficient and slow, and requires 9 | # lots of manual setup and poking around in a mbox file afterward. Use at your 10 | # own risk... 11 | # 12 | # 13 | 14 | HOME="/home/gregkh/linux" 15 | TMPDIR="/home/gregkh/tmp" 16 | PREFIX="syzbot_search_" 17 | FIXED_IN="/home/gregkh/linux/scripts/fix_in_what_release" 18 | 19 | 20 | TMP_PREFIX="${TMPDIR}/${PREFIX}" 21 | 22 | BASE_KERNEL="6.4" 23 | 24 | #KERNEL_RANGE="v4.9..v4.10" 25 | #KERNEL_RANGE="v4.14..v4.15" 26 | #KERNEL_RANGE="v4.17..v4.18" 27 | #KERNEL_RANGE="v4.15..v4.16" 28 | #KERNEL_RANGE="v5.0..v5.1" 29 | #KERNEL_RANGE="v5.1..v5.2" 30 | #KERNEL_RANGE="v5.3..v5.4" 31 | #KERNEL_RANGE="v5.4..HEAD" 32 | KERNEL_RANGE="v6.4..HEAD" 33 | 34 | STABLE_KERNEL="${HOME}/stable/linux-${BASE_KERNEL}.y" 35 | #STABLE_KERNEL="${HOME}/stable/linux-4.14.y" 36 | LATEST_KERNEL="${HOME}/gregkh" 37 | 38 | cd "${STABLE_KERNEL}" 39 | STABLE_LOG=`mktemp ${TMP_PREFIX}stable_log.XXXXXX` || exit 1 40 | git log v${BASE_KERNEL}..HEAD > "${STABLE_LOG}" 41 | 42 | cd - 43 | 44 | cd "${LATEST_KERNEL}" 45 | GIT_LOG=`mktemp ${TMP_PREFIX}git_log.XXXXXX` || exit 1 46 | git log --reverse --no-merges --format='%h' "${KERNEL_RANGE}" > ${GIT_LOG} 47 | 48 | NOT_STABLE_YET=`mktemp ${TMP_PREFIX}not_stable_yet.XXXXXX` || exit 1 49 | 50 | SYZ_MBOX=`mktemp ${TMP_PREFIX}syzkaller_mbox.XXXXXX` || exit 1 51 | 52 | COMMIT_LOG=`mktemp ${TMP_PREFIX}tmp_log.XXXXX` || exit 1 53 | 54 | 55 | 56 | 57 | while read -r commit 58 | do 59 | #echo "commit = ${commit}" 60 | 61 | # is it in the log already? 62 | present=`grep "${commit}" "${STABLE_LOG}"` 63 | if [ "${present}" == "" ] ; then 64 | echo "${commit}" >> ${NOT_STABLE_YET} 65 | #echo "commit ${commit} is not present!" 66 | 67 | # git log -1 --format='%b' ${commit} > ${COMMIT_LOG} 68 | 69 | # # is this commit a "fix" for something already in this release? 70 | # # fixme... 71 | # fixes=`grep -i '^[[:space:]]*Fixes:' ${COMMIT_LOG}` 72 | # if [ "${fixes}" != "" ] ; then 73 | # fix_commit=`echo ${fixes} | sed -e 's/^[ \t]*//' | cut -f 2 -d ':' | sed -e 's/^[ \t]*//' | cut -f 1 -d ' '` 74 | # echo "fixes='${fixes}'" 75 | # echo " fix_commit='${fix_commit}'" 76 | # #fix_release=`git describe --contains ${fix_commit} | cut -f 1 -d '~'` 77 | # fix_release=`/home/gregkh/linux/scripts/fix_in_what_release ${fix_commit}` 78 | # echo " fix_release='${fix_release}'" 79 | # fi 80 | 81 | 82 | # is it a syzkaller reported patch? 83 | # grep -i -E "(syzkaller|syzbot)" ${COMMIT_LOG} &> /dev/null 84 | git log -1 --format='%b' ${commit} | grep -i -E "(syzkaller|syzbot)" &> /dev/null 85 | if [ $? -eq 0 ] ; then 86 | #echo "${commit}" >> "${SYZ_MBOX}" 87 | git show --pretty=email ${commit} >> "${SYZ_MBOX}" 88 | echo "commit ${commit} is a syzkaller one!" 89 | fi 90 | fi 91 | done < "${GIT_LOG}" 92 | 93 | rm ${COMMIT_LOG} 94 | rm ${NOT_STABLE_YET} 95 | rm ${GIT_LOG} 96 | rm ${STABLE_LOG} 97 | 98 | echo "# commits are in ${SYZ_MBOX}" 99 | echo "mutt -f ${SYZ_MBOX}" 100 | -------------------------------------------------------------------------------- /scripts/update-gregkh: -------------------------------------------------------------------------------- 1 | rsync -avP -e ssh --delete --exclude=".git" patches/ gregkh@master.kernel.org:/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ 2 | #rsync -avP -e ssh --delete backups/ gregkh@master.kernel.org:/pub/linux/kernel/people/gregkh/backups 3 | 4 | rsync -avP -e ssh --delete tmp/gregkh-* gregkh@master.kernel.org:/pub/linux/kernel/people/gregkh/gregkh-2.6/ 5 | 6 | #scp make_patchsets tmp/*.patch gregkh@master.kernel.org:/pub/linux/kernel/people/gregkh/gregkh-2.6/ 7 | -------------------------------------------------------------------------------- /scripts/what_commits_per_release: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # set to 1 to get some debugging logging messages (or use -v/--verbose option) 4 | DEBUG=0 5 | 6 | # set where the tool was run from, 7 | # the name of our script, 8 | # and the git version of it 9 | DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" 10 | SCRIPT=${0##*/} 11 | SCRIPT_VERSION=$(cd "${DIR}" && git ls-tree --abbrev=12 HEAD | grep "${SCRIPT}" | awk '{print $3}' | head -n 1) 12 | 13 | help() { 14 | echo "Usage: ${SCRIPT} git_range file_list" 15 | exit 1 16 | } 17 | 18 | dbg() { 19 | if [[ ${DEBUG} -ge 1 ]] ; then 20 | echo "$1" 21 | fi 22 | } 23 | 24 | GIT_RANGE=$1 25 | FILE_LIST=$2 26 | 27 | # don't use unset variables 28 | set -o nounset 29 | 30 | if [[ "${FILE_LIST}" == "" || "${GIT_RANGE}" == "" ]] ; then 31 | help 32 | fi 33 | 34 | # Grab the git range being proposed, with no merges 35 | GIT_COMMITS=$(git log --oneline --no-merges ${GIT_RANGE} | cut -f 1 -d ' ') 36 | if [[ "${GIT_COMMITS}" == "" ]] ; then 37 | echo "need a valid git range" 38 | exit 1 39 | fi 40 | 41 | # Iterate over all commits 42 | while IFS= read -r commit; do 43 | dbg "commit=${commit}" 44 | 45 | # Get the list of files modified in this commit 46 | files=$(git diff --name-only "${commit}"^.."${commit}" 2> /dev/null) 47 | while IFS= read -r file; do 48 | dbg " file=${file}" 49 | 50 | # search the list of files to see if the files in this commit are there. 51 | hit=$(grep "${file}" "${FILE_LIST}") 52 | if [[ "${hit}" != "" ]] ; then 53 | echo "$(git show -s --abbrev-commit --abbrev=12 --pretty=format:"%h %s%n" ${commit})" 54 | fi 55 | break 56 | done <<< "${files}" 57 | done <<< "${GIT_COMMITS}" 58 | -------------------------------------------------------------------------------- /scripts/x.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=~/linux 4 | SCRIPTS=${DIR}/scripts 5 | KERNEL_DIR=$DIR/gregkh-2.6 6 | 7 | cd $DIR 8 | cat - > $DIR/foo.patch 9 | #perl $DIR/x.pl 10 | ${SCRIPTS}/fix_patch $DIR/foo.patch 11 | dos2unix $DIR/foo.patch 12 | 13 | #perl $DIR/mime_decode -f $DIR/foo.patch 14 | 15 | #vim -T xterm $DIR/foo.patch 16 | ${VISUAL:-${EDITOR:-vi}} "$DIR/foo.patch" < /dev/tty 17 | file=`rename-patch $DIR/foo.patch` 18 | echo "filename is $file" 19 | cd $KERNEL_DIR 20 | #quilt import $DIR/$file 21 | quilt import $file 22 | quilt push && quilt ref && quilt pop && quilt push 23 | 24 | -------------------------------------------------------------------------------- /stable/.gitignore: -------------------------------------------------------------------------------- 1 | linux-2.6* 2 | linux-3.* 3 | linux-4.* 4 | linux-5.* 5 | linux-6.* 6 | linux-stable 7 | linux-stable-rc 8 | stable-queue 9 | linux-stable 10 | release-* 11 | queue-3.18 12 | old 13 | s 14 | mbox 15 | tmp 16 | scratch/ 17 | commit_tree/ 18 | -------------------------------------------------------------------------------- /stable/apply_it: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Text color variables 4 | txtund=$(tput sgr 0 1) # Underline 5 | txtbld=$(tput bold) # Bold 6 | txtred=$(tput setaf 1) # Red 7 | txtgrn=$(tput setaf 2) # Green 8 | txtylw=$(tput setaf 3) # Yellow 9 | txtblu=$(tput setaf 4) # Blue 10 | txtpur=$(tput setaf 5) # Purple 11 | txtcyn=$(tput setaf 6) # Cyan 12 | txtwht=$(tput setaf 7) # White 13 | txtrst=$(tput sgr0) # Text reset 14 | 15 | PATCH=$1 16 | shift 17 | if [ "$PATCH" == "" ] ; then 18 | echo "you need a patch!" 19 | exit 20 | fi 21 | 22 | #echo "PATCH=$PATCH" 23 | 24 | apply_it () 25 | { 26 | VERSION=$1 27 | DIR="linux-$VERSION.y" 28 | # echo "DIR=$DIR" 29 | 30 | echo "${txtrst}Applying ${txtylw}$PATCH${txtrst} to ${txtcyn}$DIR${txtrst}" 31 | 32 | cd $DIR 33 | 34 | quilt import ../$PATCH &> /dev/null 35 | if [ $? -ne 0 ] ; then 36 | echo "${txtred} FAILED${txtrst} to import" 37 | else 38 | qp-stable -p 39 | # qp-stable 40 | # quilt push &> /dev/null 41 | echo "" 42 | # if [ $? -ne 0 ] ; then 43 | # echo "${txtred} FAILED${txtrst}" 44 | # else 45 | quilt ref &> /dev/null 46 | # echo "${txtgrn} SUCCEEDED${txtrst}" 47 | # fi 48 | fi 49 | 50 | cd .. 51 | } 52 | 53 | VERSION="$1" 54 | 55 | # if a version (or versions) are asked for, do them. 56 | if [ "$VERSION" != "" ] ; then 57 | for VERSION in $* 58 | do 59 | apply_it ${VERSION} 60 | done 61 | else 62 | # no version specified, so get the list of active kernels 63 | for VERSION in $(cat stable-queue/active_kernel_versions); do 64 | apply_it ${VERSION} 65 | done 66 | fi 67 | -------------------------------------------------------------------------------- /stable/apply_it_from_email: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Text color variables 4 | txtund=$(tput sgr 0 1) # Underline 5 | txtbld=$(tput bold) # Bold 6 | txtred=$(tput setaf 1) # Red 7 | txtgrn=$(tput setaf 2) # Green 8 | txtylw=$(tput setaf 3) # Yellow 9 | txtblu=$(tput setaf 4) # Blue 10 | txtpur=$(tput setaf 5) # Purple 11 | txtcyn=$(tput setaf 6) # Cyan 12 | txtwht=$(tput setaf 7) # White 13 | txtrst=$(tput sgr0) # Text reset 14 | 15 | TMPDIR="/home/gregkh/tmp" 16 | 17 | EMAIL=$(mktemp ${TMPDIR}/apply_it.XXXXX) || exit 1 18 | 19 | cat - > "${EMAIL}" 20 | 21 | #COMMIT_ID=`cat - | ~/bin/get_commit_id.sh` 22 | COMMIT_ID=$(cat "${EMAIL}" | grep -i "commit:" | head -n 1 | sed -s 's/ //g' | cut -f 2 -d ':') 23 | 24 | if [ "${COMMIT_ID}" == "" ] ; then 25 | # try to find it on the first line 26 | COMMIT_ID=$(head -n 1 "${EMAIL}" | cut -f 2 -d ' ') 27 | fi 28 | 29 | rm "${EMAIL}" 30 | if [ "${COMMIT_ID}" == "" ] ; then 31 | echo "${txtred}commit id not found!${txtrst}" 32 | exit 1 33 | fi 34 | 35 | echo "${txtgrn}$COMMIT_ID${txtrst}" 36 | 37 | C2P=$(command -v c2p) 38 | 39 | echo "${txtblu}c2p $COMMIT_ID${txtrst}" 40 | #gnome-terminal --command="${C2P} $COMMIT_ID" --geometry=120x30 & 41 | #gnome-terminal --command="${C2P} $COMMIT_ID" & 42 | #terminology --geometry=120x30 --exec "${C2P} ${COMMIT_ID}" 2> /dev/null & 43 | #tilix --geometry=120x30 --command="${C2P} ${COMMIT_ID}" 2> /dev/null & 44 | #tilix --command="${C2P} ${COMMIT_ID}" 45 | #kitty ${C2P} ${COMMIT_ID} & 46 | kitty -o initial_window_width=200 -o initial_window_heigth=220 ${C2P} ${COMMIT_ID} 2> /dev/null & 47 | 48 | 49 | exit 50 | -------------------------------------------------------------------------------- /stable/bad_stable_from_email: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Text color variables 4 | txtund=$(tput sgr 0 1) # Underline 5 | txtbld=$(tput bold) # Bold 6 | txtred=$(tput setaf 1) # Red 7 | txtgrn=$(tput setaf 2) # Green 8 | txtylw=$(tput setaf 3) # Yellow 9 | txtblu=$(tput setaf 4) # Blue 10 | txtpur=$(tput setaf 5) # Purple 11 | txtcyn=$(tput setaf 6) # Cyan 12 | txtwht=$(tput setaf 7) # White 13 | txtrst=$(tput sgr0) # Text reset 14 | 15 | #COMMIT_ID=`cat - | ~/bin/get_commit_id.sh` 16 | COMMIT_ID=`cat - | grep -i "commit:" | head -n 1 | sed -s 's/ //g' | cut -f 2 -d ':'` 17 | #echo "$COMMIT_ID" 18 | #exit 19 | 20 | C2P=`which c2p` 21 | 22 | echo "${txtblu}c2p $COMMIT_ID${txtrst}" 23 | 24 | read -p "What kernel version? " version 25 | 26 | echo "${txtpur}bad_stable ${version} ${COMMIT_ID}${txtrst}" 27 | 28 | tty=`tty` 29 | echo "tty=${tty}" 30 | 31 | #function faketty { script -qfc "$(printf "%q " "$@")"; } 32 | #faketty read -p "What kernel version? " version 33 | # 34 | 35 | exec &>/dev/tty 36 | #exec 2>/dev/tty 1>&2 37 | 38 | tty=`tty` 39 | echo "tty=${tty}" 40 | #echo your stdin is : $(&0 45 | #exec 2>&0 46 | read -p "What kernel version? " version 47 | 48 | echo "version=${version}" 49 | 50 | 51 | #gnome-terminal --command="${C2P} $COMMIT_ID" --geometry=120x30 & 52 | #gnome-terminal --command="${C2P} $COMMIT_ID" & 53 | #terminology --geometry=120x30 --exec "${C2P} ${COMMIT_ID}" 2> /dev/null & 54 | exit 55 | -------------------------------------------------------------------------------- /stable/da: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | NUMBERS=$(git ls-files -o | cut -f 1 -d '/' | cut -f 2 -d '-' | sort --version-sort | uniq) 4 | 5 | for N in ${NUMBERS}; do 6 | echo "../do_it_all ${N}" 7 | ../do_it_all "${N}" 8 | done 9 | 10 | 11 | -------------------------------------------------------------------------------- /stable/dave_split.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -W 2 | # 3 | # convert a stable mbox sent by David Miller to apply to the relevant 4 | # stable kernel tree as a set of patches. 5 | # 6 | # based on c2p, written by me (Greg Kroah-Hartman ) 7 | # 8 | 9 | my $line; 10 | my $firstline = "true"; 11 | my $header_complete = "false"; 12 | my $tmpfile = ""; 13 | my $tmpdir; 14 | my $kernel_version; 15 | my $mbox; 16 | my $tmp; 17 | 18 | 19 | $SIG{__DIE__} = sub 20 | { 21 | # what usually happens is we don't have the git version, so clean up 22 | # the temp file we created. 23 | if ($tmpfile ne "") { 24 | unlink $tmpfile; 25 | } 26 | }; 27 | 28 | sub usage() { 29 | print "$0 mbox kernel_version\n"; 30 | print "Subject:.*\\_.\\_^\\s.*\n"; 31 | exit; 32 | } 33 | 34 | $numArgs = $#ARGV + 1; 35 | if ($numArgs < 2) { 36 | usage(); 37 | } 38 | 39 | # get the mailbox name and test that it is really present 40 | $mbox = shift; 41 | if (!defined($mbox)) { 42 | usage(); 43 | } 44 | unless (-e $mbox) { 45 | print "$mbox does not exist!\n"; 46 | usage(); 47 | } 48 | 49 | # get the kernel version and test that we have a stable tree of that name 50 | $kernel_version = shift; 51 | $tmp = "linux-".$kernel_version.".y"; 52 | unless (-d $tmp) { 53 | print "kernel directory $tmp does not exist!\n"; 54 | usage(); 55 | } 56 | 57 | 58 | # create the temp directory we are going to be using 59 | $tmp = "tmpdir_".$kernel_version."_XXXXX"; 60 | $tmpdir = `mktemp -d $tmp` || die "Failed to run mktemp"; 61 | chomp($tmpdir); 62 | 63 | print "tmpdir=\"$tmpdir\"\n"; 64 | 65 | # Split mbox out into individual messages 66 | #`<$mbox formail -ds sh -c 'cat > $tmpdir/msg.\$FILENO'`; 67 | #`splitmbox.py $mbox $tmpdir/`; 68 | `splitmbox.pl $mbox $tmpdir/`; 69 | 70 | # see if we need to hand-edit anything 71 | $tmp = `grep foo\@bar $tmpdir/*`; 72 | chomp($tmp); 73 | if ($tmp ne "") { 74 | print "formail has a problem with the mbox, please edit it.\n"; 75 | print "error is:\n$tmp\n"; 76 | exit; 77 | } 78 | 79 | # all is good, so let's iterate over the files and handle them one-by-one 80 | my @patches = `ls $tmpdir/`; 81 | foreach my $patch (@patches) { 82 | chomp($patch); 83 | print "patch = $patch\n"; 84 | 85 | `~/linux/scripts/fix_patch $tmpdir/$patch`; 86 | # create temp file to copy this one into 87 | $tmp = "$tmpdir/patch.XXXXX"; 88 | $tmpfile = `mktemp $tmp` || die "failed to run mktemp $tmp"; 89 | #print "tmpfile = $tmpfile"; 90 | 91 | open FILE, ">$tmpfile" || die "Failed to create $tmpfile"; 92 | open (PATCH, "$tmpdir/$patch") || die "failed to read $patch"; 93 | 94 | $firstline = "true"; 95 | $header_complete = "false"; 96 | while ($line = ) { 97 | # We clean up 3 things: 98 | # - Strip the patch number off of the subject 99 | # - add the "From:" line of who wrote the patch 100 | # - add our signed off by 101 | 102 | # clean up the subject line by removing anything in [] 103 | # $line =~ s/^Subject: \[PATCH \d\/\d\]/Subject:/; 104 | # $line =~ s/^Subject: \[PATCH \d\d\/\d\d\]/Subject:/; 105 | # $line =~ s/^Subject: \[PATCH \d\d\d\/\d\d\d\]/Subject:/; 106 | # $line =~ s/^Subject: \[[^()]*\]/Subject:/; 107 | $line =~ s/^Subject: \[[^()]*?\]/Subject:/; # the ? is to not be greedy and stop at the first match 108 | 109 | # add our signed off by if this is the last line in the header 110 | if ($line =~ m/^---$/) { 111 | print FILE "Signed-off-by: Greg Kroah-Hartman \n"; 112 | } 113 | 114 | print FILE $line; 115 | 116 | # figure out who wrote this patch 117 | if ($line =~ m/^From: /) { 118 | $author = $line; 119 | chomp($author); 120 | } 121 | 122 | # if this is the end of the mail header, write the author info. 123 | if ($header_complete eq "false") { 124 | if ($line eq "\n") { 125 | print FILE "$author\n"; 126 | $header_complete = "true"; 127 | } 128 | } 129 | } 130 | close PATCH; 131 | close FILE; 132 | 133 | # system "vim -c \":set syntax=mail\" $tmpfile"; 134 | # system "reset"; 135 | $new_file = `rename-patch $tmpfile`; 136 | chomp($new_file); 137 | system "cd ~/linux/stable && ./apply_it $new_file $kernel_version"; 138 | } 139 | 140 | exit; 141 | 142 | -------------------------------------------------------------------------------- /stable/del_p: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | help() 5 | { 6 | echo "$0 PATCH_NAME VERSION" 7 | exit 1 8 | } 9 | 10 | 11 | delete() 12 | { 13 | local patch=$1 14 | local version=$2 15 | 16 | echo "deleting ${patch} from linux-${version} queue" 17 | 18 | cd linux-"${version}".y || 19 | (echo "directory linux-${version}.y is not found" && return) 20 | 21 | found=$(quilt series | grep "${patch}") 22 | if [[ -z "${found}" ]] ; then 23 | echo "patch ${patch} is not found in linux-${version}.y" 24 | cd .. 25 | return 26 | fi 27 | 28 | quilt pop -qf "${patch}" 29 | # quilt delete -r "${patch}" 30 | if ! quilt delete -r "${patch}" ; then 31 | echo "unable to delete patch ${patch} from linux-${version}.y" 32 | cd .. 33 | return 34 | fi 35 | qp -a 36 | cd .. 37 | } 38 | 39 | PATCH=$1 40 | shift 41 | 42 | if [[ -z "${PATCH}" ]]; then 43 | help 44 | fi 45 | 46 | 47 | VERSION=$1 48 | if [[ -z "${VERSION}" ]]; then 49 | help 50 | fi 51 | 52 | if [ "${VERSION}" == "all" ] ; then 53 | echo "removing ${PATCH} from all versions..." 54 | for VERSION in $(cat stable-queue/active_kernel_versions) 55 | do 56 | delete "${PATCH}" "${VERSION}" 57 | done 58 | else 59 | for VERSION in "$@" 60 | do 61 | delete "${PATCH}" "${VERSION}" 62 | done 63 | fi 64 | -------------------------------------------------------------------------------- /stable/do_it_all: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | txtund=$(tput sgr 0 1) # Underline 4 | txtbld=$(tput bold) # Bold 5 | txtred=$(tput setaf 1) # Red 6 | txtgrn=$(tput setaf 2) # Green 7 | txtylw=$(tput setaf 3) # Yellow 8 | txtblu=$(tput setaf 4) # Blue 9 | txtpur=$(tput setaf 5) # Purple 10 | txtcyn=$(tput setaf 6) # Cyan 11 | txtwht=$(tput setaf 7) # White 12 | txtrst=$(tput sgr0) # Text reset 13 | 14 | 15 | do_it() { 16 | local VERSION=$1 17 | if [ "$VERSION" == "" ] ; then 18 | echo "you need a version!" 19 | exit 20 | fi 21 | # echo "VERSION=$VERSION" 22 | local DIR="queue-$VERSION" 23 | 24 | # create a temp directory and copy the patches there 25 | local TMP_DIR=$(mktemp -d "../stable_patches-${VERSION}-XXXXX") || exit 1 26 | 27 | git ls-files -o | grep "queue-${VERSION}/" | xargs -i cp {} -v "${TMP_DIR}" 28 | 29 | # create a commit message 30 | echo "${VERSION}-stable patches" > commit.msg 31 | echo "" >> commit.msg 32 | echo "added patches:" >> commit.msg 33 | for file in $(ls "${TMP_DIR}") 34 | do 35 | echo " $(basename ${file})" >> commit.msg 36 | done 37 | 38 | # add the files and commit them to git 39 | git add --all "${DIR}" 40 | git commit -F commit.msg 41 | rm commit.msg 42 | 43 | # do notification for the authors that the patches are now added to the tree. 44 | for file in $(ls "${TMP_DIR}") 45 | do 46 | ../added-to-stable-version "${VERSION}" "${TMP_DIR}/$file" 47 | done 48 | 49 | # clean up 50 | rm -rf "${TMP_DIR}" 51 | 52 | ONLINE=$(gregkh_machine_online) 53 | # Only push if we have a network connection 54 | if [ "${ONLINE}" = "1" ] ; then 55 | echo "${txtylw}pushing to${txtrst} ${txtcyn}kroah.com${txtrst}" 56 | git push -q kroah.com master 57 | echo "${txtylw}pushing to${txtrst} ${txtcyn}origin${txtrst}" 58 | git push -q 59 | # kick off a build 60 | REMOTE="bob" /home/gregkh/linux/scripts/test_stable/test_stable_ssh ${VERSION} 61 | fi 62 | } 63 | 64 | for STABLE_VERSION in $* 65 | do 66 | echo "${txtblu}Working on patches for ${txtred}linux-${STABLE_VERSION}.y${txtrst}" 67 | do_it "${STABLE_VERSION}" 68 | done 69 | 70 | -------------------------------------------------------------------------------- /stable/do_sasha.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # take a kernel version, git tree, and tag/branch and turn them into a 4 | # mbox of patches to be applied to the stable tree 5 | # 6 | # run this in a linux-stable tree: 7 | # $0 KERNEL_VERSION GIT_URL TAG 8 | 9 | 10 | VERSION=$1 11 | URL=$2 12 | TAG=$3 13 | 14 | if [ "${TAG}" == "" ] ; then 15 | echo "$0 VERSION GIT_URL TAG/BRANCH" 16 | exit 17 | fi 18 | 19 | BRANCH="linux-${VERSION}.y" 20 | 21 | git branch -D s-${VERSION} 22 | git co -b s-${VERSION} linux-${VERSION}.y 23 | 24 | git pull ${URL} ${TAG} 25 | 26 | git rebase linux-${VERSION}.y 27 | 28 | git fp linux-${VERSION}.y 29 | 30 | cat *patch > mbox.${VERSION} 31 | 32 | 33 | -------------------------------------------------------------------------------- /stable/dotag: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -ne 1 ]; then 4 | echo -e "Usage:\t $0 release_number\ne.g.\t $0 2.6.11.12" 5 | exit 1 6 | fi 7 | 8 | RELEASE=$1 9 | echo "tagging stable release $RELEASE" 10 | echo "[ret] to continue ^C to quit" 11 | read 12 | 13 | 14 | # tag it 15 | #git tag -u kroah.com -m "This is the $RELEASE stable release" v$RELEASE 16 | git tag -u 6092693E -m "This is the $RELEASE stable release" v$RELEASE 17 | 18 | exit 19 | -------------------------------------------------------------------------------- /stable/email_to_c2p: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Take an email, find the git commit id associated with it, save it to a file, 3 | # and then run a separate script in a new terminal window (as mutt doesn't like 4 | # having scripts accept input) that asks for the version that this commit is to 5 | # be applied to, and then runs 'c2p' to take that commit and add it to the 6 | # stable queue. Yeah, it's a mess... 7 | # 8 | # Called from mutt. 9 | 10 | # Text color variables 11 | txtund=$(tput sgr 0 1) # Underline 12 | txtbld=$(tput bold) # Bold 13 | txtred=$(tput setaf 1) # Red 14 | txtgrn=$(tput setaf 2) # Green 15 | txtylw=$(tput setaf 3) # Yellow 16 | txtblu=$(tput setaf 4) # Blue 17 | txtpur=$(tput setaf 5) # Purple 18 | txtcyn=$(tput setaf 6) # Cyan 19 | txtwht=$(tput setaf 7) # White 20 | txtrst=$(tput sgr0) # Text reset 21 | 22 | USER=$(whoami) 23 | TMPDIR="/home/${USER}/tmp" 24 | KERNEL_DIR="/home/${USER}/linux/stable/linux-stable/" 25 | 26 | #EMAIL=$(mktemp ${TMPDIR}/apply_email.XXXXX) || exit 1 27 | EMAIL="/home/${USER}/linux/stable/s" 28 | 29 | cat - > "${EMAIL}" 30 | /home/${USER}/linux/scripts/fix_patch "${EMAIL}" 31 | 32 | COMMIT_ID=$(grep -i upstream ${EMAIL} | grep -oE "[a-f0-9]{40,}") 33 | if [[ "${COMMIT_ID}" == "" ]] ; then 34 | # try to find it in a cherry-pick line 35 | COMMIT_ID=$(grep -i "cherry picked from commit" ${EMAIL} | grep -oE "[a-f0-9]{40,}") 36 | fi 37 | 38 | if [ "${COMMIT_ID}" == "" ] ; then 39 | echo "${txtred}commit id not found!${txtrst}" 40 | rm "${EMAIL}" 41 | exit 1 42 | fi 43 | 44 | #found=$(/home/gregkh/linux/stable/commit_tree/id_found_in "${COMMIT_ID}") 45 | #echo "${txtcyn}COMMIT_ID=${txtgrn}$COMMIT_ID${txtrst} ${txtcyn}Found in=${txtgrn}${found}${txtrst}" 46 | echo "${txtcyn}COMMIT_ID=${txtgrn}$COMMIT_ID${txtrst}" 47 | 48 | kitty -o initial_window_width=200 -o initial_window_heigth=220 /home/${USER}/linux/stable/email_to_c2p_helper ${COMMIT_ID} ${EMAIL} 2> /dev/null 49 | 50 | #rm ${EMAIL} 51 | 52 | exit 0 53 | -------------------------------------------------------------------------------- /stable/email_to_c2p_helper: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Take a commit id, and a file, and then do the following: 3 | # - ask what stable trees to apply this to 4 | # - run c2p with the git id and apply it to those trees 5 | # 6 | # Called from mutt. It's a mess 7 | 8 | # Text color variables 9 | txtund=$(tput sgr 0 1) # Underline 10 | txtbld=$(tput bold) # Bold 11 | txtred=$(tput setaf 1) # Red 12 | txtgrn=$(tput setaf 2) # Green 13 | txtylw=$(tput setaf 3) # Yellow 14 | txtblu=$(tput setaf 4) # Blue 15 | txtpur=$(tput setaf 5) # Purple 16 | txtcyn=$(tput setaf 6) # Cyan 17 | txtwht=$(tput setaf 7) # White 18 | txtrst=$(tput sgr0) # Text reset 19 | 20 | USER=$(whoami) 21 | TMPDIR="/home/${USER}/tmp" 22 | KERNEL_DIR="/home/${USER}/linux/stable/linux-stable/" 23 | 24 | COMMIT_ID=$1 25 | EMAIL=$2 26 | 27 | found=$(/home/gregkh/linux/stable/commit_tree/id_found_in "${COMMIT_ID}") 28 | #echo "${txtcyn}COMMIT_ID=${txtgrn}$COMMIT_ID${txtrst} ${txtcyn}Found in=${txtgrn}${found}${txtrst}" 29 | 30 | subject=$(grep "^Subject:" ${EMAIL}) 31 | echo " ${txtgrn}${subject}${txtrst}" 32 | echo " ${txtcyn}commit ${txtgrn}${COMMIT_ID}${txtrst}" 33 | echo " ${txtcyn}Already in: ${txtgrn}${found}${txtrst}" 34 | echo "" 35 | echo "pick a version to apply this to:" 36 | 37 | 38 | v=$(/home/gregkh/linux/stable/stable-queue/scripts/active_kernel_versions_get.sh) 39 | versions="" 40 | for v1 in ${v}; do 41 | versions+=" ${v1}" 42 | done 43 | 44 | echo "versions= '${versions}'" 45 | 46 | if [[ "${versions}" == "" ]]; then 47 | exit 1 48 | fi 49 | 50 | cd /home/gregkh/linux/stable/linux-stable/ 51 | /home/gregkh/bin/c2p ${COMMIT_ID} ${versions} 52 | 53 | #sleep 1000 54 | 55 | exit 1 56 | 57 | 58 | 59 | EMAIL=$(mktemp ${TMPDIR}/apply_email.XXXXX) || exit 1 60 | 61 | cat - > "${EMAIL}" 62 | /home/gregkh/linux/scripts/fix_patch "${EMAIL}" 63 | 64 | COMMIT_ID=$(grep -i upstream ${EMAIL} | grep -oE "[a-f0-9]{40,}") 65 | if [[ "${COMMIT_ID}" == "" ]] ; then 66 | # try to find it in a cherry-pick line 67 | COMMIT_ID=$(grep -i "cherry picked from commit" | grep -oE "[a-f0-9]{40,}") 68 | fi 69 | 70 | if [ "${COMMIT_ID}" == "" ] ; then 71 | echo "${txtred}commit id not found!${txtrst}" 72 | rm "${EMAIL}" 73 | exit 1 74 | fi 75 | 76 | found=$(/home/gregkh/linux/stable/commit_tree/id_found_in "${COMMIT_ID}") 77 | 78 | echo "${txtcyn}COMMIT_ID=${txtgrn}$COMMIT_ID${txtrst} ${txtcyn}Found in=${txtgrn}${found}${txtrst}" 79 | 80 | COMMIT=$(mktemp ${TMPDIR}/apply_commit.XXXXX) || exit 1 81 | INTERDIFF=$(mktemp ${TMPDIR}/apply_interdif.XXXXX) || exit 1 82 | foo=$(cd ${KERNEL_DIR} && git show --pretty=email ${COMMIT_ID} > ${COMMIT}) 83 | id=$(diff -u --ignore-matching-lines '^[^+-]' ${COMMIT} ${EMAIL} > ${INTERDIFF}) 84 | 85 | #kitty -o initial_window_width=200 -o initial_window_heigth=220 vim ${INTERDIFF} 2> /dev/null 86 | kitty -o initial_window_width=200 -o initial_window_heigth=220 bat --style=changes --paging=always --theme=Dracula ${INTERDIFF} 2> /dev/null 87 | 88 | rm ${COMMIT} 89 | rm ${INTERDIFF} 90 | rm ${EMAIL} 91 | 92 | exit 0 93 | -------------------------------------------------------------------------------- /stable/generate_rcs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | create_kernel() { 4 | VERSION=$1 5 | echo "building kernel ${VERSION}" 6 | cd linux-${VERSION}.y 7 | ../stable-queue/scripts/quilt-mail mbox 8 | } 9 | 10 | for VERSION in $(cat stable-queue/active_kernel_versions); do 11 | create_kernel "${VERSION}" & 12 | done 13 | 14 | wait 15 | 16 | echo "finished" 17 | 18 | -------------------------------------------------------------------------------- /stable/generate_rcs2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #tmux \ 4 | # new-session "cd linux-4.4.y && ../stable-queue/scripts/quilt-mail mbox ; read" \; \ 5 | # split-window "cd linux-4.9.y && ../stable-queue/scripts/quilt-mail mbox ; read" \; \ 6 | # split-window "cd linux-4.14.y && ../stable-queue/scripts/quilt-mail mbox ; read" \; \ 7 | # split-window "cd linux-4.19.y && ../stable-queue/scripts/quilt-mail mbox ; read" \; \ 8 | # split-window "cd linux-5.4.y && ../stable-queue/scripts/quilt-mail mbox ; read" \; \ 9 | # select-layout even-vertical 10 | # 11 | tmux \ 12 | new-session "cd linux-4.4.y && ../stable-queue/scripts/quilt-mail mbox" \; \ 13 | split-window "cd linux-4.9.y && ../stable-queue/scripts/quilt-mail mbox" \; \ 14 | split-window "cd linux-4.14.y && ../stable-queue/scripts/quilt-mail mbox" \; \ 15 | split-window "cd linux-4.19.y && ../stable-queue/scripts/quilt-mail mbox" \; \ 16 | split-window "cd linux-5.4.y && ../stable-queue/scripts/quilt-mail mbox" \; \ 17 | split-window "cd linux-5.10.y && ../stable-queue/scripts/quilt-mail mbox" \; \ 18 | select-layout even-vertical 19 | 20 | 21 | # 22 | # 23 | # 24 | #create_kernel() { 25 | # VERSION=$1 26 | # echo "building kernel ${VERSION}" 27 | # cd linux-${VERSION}.y 28 | # ../stable-queue/scripts/quilt-mail mbox 29 | #} 30 | # 31 | #create_kernel "4.4" & 32 | #create_kernel "4.9" & 33 | #create_kernel "4.14" & 34 | #create_kernel "4.19" & 35 | #create_kernel "5.4" & 36 | #wait 37 | #echo "finished" 38 | 39 | -------------------------------------------------------------------------------- /stable/interdif: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Take an email, find the git commit id associated with it, and do an 3 | # "interdiff" of the two to see what is different and then pipe that diff to a 4 | # window to review used when reviewing stable kernel patches 5 | # 6 | # Called from mutt. Has no affect on any commits, just for checking that 7 | # things are sane. 8 | 9 | # Text color variables 10 | txtund=$(tput sgr 0 1) # Underline 11 | txtbld=$(tput bold) # Bold 12 | txtred=$(tput setaf 1) # Red 13 | txtgrn=$(tput setaf 2) # Green 14 | txtylw=$(tput setaf 3) # Yellow 15 | txtblu=$(tput setaf 4) # Blue 16 | txtpur=$(tput setaf 5) # Purple 17 | txtcyn=$(tput setaf 6) # Cyan 18 | txtwht=$(tput setaf 7) # White 19 | txtrst=$(tput sgr0) # Text reset 20 | 21 | USER=$(whoami) 22 | TMPDIR="/home/${USER}/tmp" 23 | KERNEL_DIR="/home/${USER}/linux/stable/linux-stable/" 24 | 25 | EMAIL=$(mktemp ${TMPDIR}/apply_email.XXXXX) || exit 1 26 | 27 | cat - > "${EMAIL}" 28 | /home/gregkh/linux/scripts/fix_patch "${EMAIL}" 29 | 30 | COMMIT_ID=$(grep -i upstream ${EMAIL} | grep -oE "[a-f0-9]{40,}") 31 | if [[ "${COMMIT_ID}" == "" ]] ; then 32 | # try to find it in a cherry-pick line 33 | COMMIT_ID=$(grep -i "cherry picked from commit" ${EMAIL} | grep -oE "[a-f0-9]{40,}") 34 | fi 35 | 36 | if [ "${COMMIT_ID}" == "" ] ; then 37 | echo "${txtred}commit id not found!${txtrst}" 38 | rm "${EMAIL}" 39 | exit 1 40 | fi 41 | 42 | found=$(/home/gregkh/linux/stable/commit_tree/id_found_in "${COMMIT_ID}") 43 | 44 | echo "${txtcyn}COMMIT_ID=${txtgrn}$COMMIT_ID${txtrst} ${txtcyn}Found in=${txtgrn}${found}${txtrst}" 45 | 46 | COMMIT=$(mktemp ${TMPDIR}/apply_commit.XXXXX) || exit 1 47 | INTERDIFF=$(mktemp ${TMPDIR}/apply_interdif.XXXXX) || exit 1 48 | foo=$(cd ${KERNEL_DIR} && git show --pretty=email ${COMMIT_ID} > ${COMMIT}) 49 | id=$(diff -u --ignore-matching-lines '^[^+-]' ${COMMIT} ${EMAIL} > ${INTERDIFF}) 50 | 51 | #kitty -o initial_window_width=200 -o initial_window_heigth=220 vim ${INTERDIFF} 2> /dev/null 52 | kitty -o initial_window_width=200 -o initial_window_heigth=220 bat --style=changes --paging=always --theme=Dracula ${INTERDIFF} 2> /dev/null 53 | 54 | rm ${COMMIT} 55 | rm ${INTERDIFF} 56 | rm ${EMAIL} 57 | 58 | exit 0 59 | -------------------------------------------------------------------------------- /stable/justfile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S just --justfile 2 | 3 | # show the list of options 4 | _help: 5 | @just --list 6 | 7 | 8 | # Figure out how many patches not applied from each queue 9 | list: 10 | #!/usr/bin/env bash 11 | cd stable-queue 12 | LS_FILES=$(git ls-files -o) 13 | NUMBERS=$(echo "${LS_FILES}" | cut -f 1 -d '/' | cut -f 2 -d '-' | sort --version-sort | uniq) 14 | total=0 15 | echo "patches not committed:" 16 | for N in ${NUMBERS}; do 17 | uncommit=$(echo "${LS_FILES}" | grep "${N}/" | wc -l) 18 | printf " %3s: %4d\n" "${N}" "${uncommit}" 19 | total=$((uncommit + total)) 20 | done 21 | printf " total: %4d\n" "${total}" 22 | 23 | # Print a pretty summary of the current queues 24 | summary: 25 | #!/usr/bin/env bash 26 | cd stable-queue 27 | LS_FILES=$(git ls-files -o) 28 | total=0 29 | total_nc=0 30 | printf " version queued not-committed\n" 31 | for version in $(cat active_kernel_versions | sort --version-sort); do 32 | if [[ -d queue-${version} ]]; then 33 | queued=$(ls queue-${version} | grep -v "^series$" | wc -l) 34 | notcommitted=$(echo "${LS_FILES}" | grep "queue-${version}/" | wc -l) 35 | 36 | printf " %3s: %4d %4d\n" "${version}" "${queued}" "${notcommitted}" 37 | total=$((queued + total)) 38 | total_nc=$((notcommitted + total_nc)) 39 | fi 40 | done 41 | printf " total: %4d %4d\n" "${total}" "${total_nc}" 42 | 43 | 44 | # Collect the "Tested-by:" lines from a -rc series 45 | tested-by mbox='mbox': 46 | @./tested-by {{mbox}} 47 | 48 | # commit patches in a stable queue for specific, or all, kernel trees 49 | commit version='all': 50 | #!/usr/bin/env bash 51 | cd stable-queue 52 | V="{{version}}" 53 | #echo "V=${V}" 54 | if [[ "${V}" != "all" ]]; then 55 | ../do_it_all "${V}" 56 | exit 57 | fi 58 | NUMBERS=$(git ls-files -o | cut -f 1 -d '/' | cut -f 2 -d '-' | sort --version-sort | uniq) 59 | for N in ${NUMBERS}; do 60 | echo "../do_it_all ${N}" 61 | ../do_it_all "${N}" 62 | done 63 | 64 | # create -rc release for current directory 65 | mbox: 66 | cd {{invocation_directory()}}; ../stable-queue/scripts/quilt-mail mbox 67 | 68 | 69 | # sync all scratch directories up 70 | scratch_sync: 71 | #!/usr/bin/env bash 72 | 73 | function do_it 74 | { 75 | local r=$1 76 | local s=$2 77 | echo "Checking out ${s}..." 78 | git checkout --quiet "${s}" 79 | echo "Rebasing ${s} onto ${r}" 80 | git rebase "${r}" 81 | } 82 | 83 | cd scratch 84 | declare -A versions=( \ 85 | ["5.4"]="504" \ 86 | ["5.10"]="510" \ 87 | ["5.15"]="515" \ 88 | ["6.1"]="601" \ 89 | ["6.6"]="606" \ 90 | ["6.12"]="612" \ 91 | ["6.14"]="614" \ 92 | ) 93 | for i in ${!versions[@]}; do 94 | do_it "linux-${i}.y" "s-${versions[$i]}" 95 | done 96 | do_it "master" "s-main" 97 | 98 | # Generate the stable -rc releases for all stable branches 99 | generate_rcs: 100 | ./generate_rcs 101 | -------------------------------------------------------------------------------- /stable/make_diff: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VERSION=`ketchup -m` 4 | HOST="gregkh@geb.kernel.org" 5 | 6 | REL_ARRAY=(${VERSION//./ }) 7 | BASE=${REL_ARRAY[0]}.${REL_ARRAY[1]}.${REL_ARRAY[2]} 8 | REL=${REL_ARRAY[3]} 9 | MINOR=${REL_ARRAY[2]} 10 | 11 | LONGTERM=0 12 | # see if this is a "longterm" kernel or not 13 | if [ $MINOR == "32" ]; then 14 | LONGTERM=1 15 | fi 16 | if [ $MINOR == "33" ]; then 17 | LONGTERM=1 18 | fi 19 | #echo "longterm = $LONGTERM" 20 | 21 | # see if this is 3.X or 2.X 22 | THREE=0 23 | if [ ${REL_ARRAY[0]} == "3" ] ; then 24 | # 3.0 25 | THREE=1 26 | fi 27 | 28 | git diff HEAD --stat > diffstat 29 | echo "# diffstat created" 30 | 31 | git diff HEAD > patch-$VERSION 32 | echo "# $VERSION patch created" 33 | 34 | gpg -a -b patch-${VERSION} 35 | 36 | 37 | DIR="stable-review" 38 | if [ $LONGTERM -eq 1 ]; then 39 | DIR="longterm-review" 40 | fi 41 | 42 | if [ $THREE -eq 1 ]; then 43 | VER="3.0" 44 | else 45 | VER="2.6" 46 | fi 47 | #echo "scp patch-$VERSION gregkh@master.kernel.org:v$VER/$DIR/" 48 | 49 | echo "kup --host=${HOST} put patch-${VERSION} patch-${VERSION}.asc /pub/linux/kernel/v${VER}/${DIR}/patch-${VERSION}.gz" 50 | 51 | -------------------------------------------------------------------------------- /stable/make_release: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # echo out to stdout the steps needed to do a stable kernel release. 4 | # pipe it to another file if you just want to run it that way. 5 | # 6 | 7 | release_it() 8 | { 9 | TREE=$1 10 | TREE_DIR="linux-${1}.y" 11 | 12 | #echo "releasing ${TREE_DIR}" 13 | 14 | if [ ! -d "${TREE_DIR}" ] ; then 15 | echo "kernel directory ${TREE_DIR} must be present..." >&2 16 | exit 17 | fi 18 | 19 | cd "${TREE_DIR}" 20 | OLD_VERSION=$(kv) 21 | 22 | CLEAN=$(git diff Makefile) 23 | cd .. 24 | 25 | if [ "${CLEAN}" != "" ] ; then 26 | echo "${0} has to run with a clean Makefile, exiting..." >&2 27 | exit 28 | fi 29 | 30 | 31 | BASE_VERSION=${OLD_VERSION/-rc?/} 32 | 33 | if [ "${BASE_VERSION}" != "${OLD_VERSION}" ] ; then 34 | echo "${OLD_VERSION} still has a -rc tag, do you mean for that to be there?" 35 | exit 36 | fi 37 | 38 | REL_ARRAY=(${OLD_VERSION//./ }) 39 | MINOR=${REL_ARRAY[2]} 40 | NEW_MINOR=$((MINOR + 1)) 41 | VERSION="${REL_ARRAY[0]}.${REL_ARRAY[1]}.${NEW_MINOR}" 42 | 43 | echo "# About to release ${VERSION}" >&2 44 | echo "#" >&2 45 | echo "# [ret] to continue" >&2 46 | read 47 | echo "# release ${VERSION}" 48 | 49 | # apply the patches to the release-specific directory tree 50 | echo "cd ${TREE_DIR}" 51 | echo "quilt pop -qa" 52 | # kick git a bunch to work before we apply the patches... 53 | echo "git am --abort" 54 | echo "git reset" 55 | echo "git checkout Makefile" 56 | echo "git quiltimport --patches ../stable-queue/queue-${TREE}" 57 | #echo "vim Makefile" 58 | echo "../version_bump" 59 | echo "git commit -a -m \"Linux ${VERSION}\" -e" 60 | echo "../stable-queue/scripts/tag_stable ${VERSION}" 61 | echo "../stable-queue/scripts/dorelease" 62 | 63 | 64 | # move the file in the stable queue to the released location 65 | echo "cd ../stable-queue" 66 | echo "git mv queue-${TREE} releases/${VERSION}" 67 | echo "git commit -a -m \"Linux ${VERSION}\"" 68 | echo "./scripts/tag_stable ${VERSION}" 69 | #echo "git push && git push --tags && git push kroah.com master && git push kroah.com --tags" 70 | echo "git push && git push --tags" 71 | 72 | # pull the release into the linux-stable tree and push it to kernel.org 73 | echo "cd ../linux-stable" 74 | echo "git checkout linux-${TREE}.y" 75 | echo "git pull ../linux-${TREE}.y" 76 | echo "git pull ../linux-${TREE}.y --tags" 77 | echo "git push && git push --tags" 78 | echo "git-archive-signer" 79 | 80 | # return back to home 81 | echo "cd .." 82 | } 83 | 84 | VERSION="$1" 85 | 86 | if [ "$VERSION" == "" ] ; then 87 | echo "$0 KERNEL_BASE_VERSION" >&2 88 | exit 89 | fi 90 | 91 | for VERSION in "$@" 92 | do 93 | release_it "${VERSION}" 94 | done 95 | 96 | -------------------------------------------------------------------------------- /stable/make_rolling_links: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # to move to a new major tree: 4 | # 5 | # git merge -s ours --no-commit v6.0.X 6 | # git read-tree -um v6.0.X 7 | # git commit -s -m "Merge..." 8 | # 9 | 10 | git checkout linux-6.12.y 11 | ver=$(make kernelversion) 12 | git checkout linux-rolling-lts 13 | git merge --no-commit --signoff v$ver; GIT_AUTHOR_DATE=$(git log -1 --format="%aD" v$ver) GIT_COMMITTER_DATE=$(git log -1 --format="%cD" v$ver) git commit -s -m "Merge v$ver" 14 | 15 | git checkout linux-6.14.y 16 | ver=$(make kernelversion) 17 | git checkout linux-rolling-stable 18 | git merge --no-commit --signoff v$ver; GIT_AUTHOR_DATE=$(git log -1 --format="%aD" v$ver) GIT_COMMITTER_DATE=$(git log -1 --format="%cD" v$ver) git commit -s -m "Merge v$ver" 19 | 20 | echo "git push origin linux-rolling-stable linux-rolling-lts" 21 | 22 | -------------------------------------------------------------------------------- /stable/pick_gcc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Build the stable kernel tree with a different version of gcc depending on the 4 | # directory we are in. 5 | # 6 | 7 | RELEASE=$(kv) 8 | 9 | REL_ARRAY=(${RELEASE//./ }) 10 | BASE=${REL_ARRAY[0]}.${REL_ARRAY[1]}.${REL_ARRAY[2]} 11 | MAJOR=${REL_ARRAY[0]} 12 | MINOR=${REL_ARRAY[1]} 13 | 14 | #echo "major=${MAJOR}" 15 | #echo "minor=${MINOR}" 16 | 17 | 18 | cc="" 19 | 20 | case "${MAJOR}" in 21 | 3*) CC="gcc-7";; 22 | 4*) CC="gcc-8";; 23 | *) CC="gcc";; 24 | esac 25 | 26 | BUILD_COMMAND="make CC=${CC} ${@}" 27 | 28 | set -x 29 | 30 | echo "make CC=${CC} ${@}" 31 | #$(CC=${CC} make CC=${CC} ${@}) 32 | 33 | 34 | -------------------------------------------------------------------------------- /stable/s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | USER=`whoami` 4 | 5 | DIR=/home/$USER/linux/stable 6 | SCRIPT_DIR=/home/$USER/linux/scripts 7 | KERNEL_DIR=$DIR/linux-5.4.y 8 | 9 | cd $DIR 10 | cat - > $DIR/foo.patch 11 | #perl $DIR/x.pl 12 | dos2unix $DIR/foo.patch 13 | $SCRIPT_DIR/fix_patch $DIR/foo.patch 14 | #vim -T xterm $DIR/foo.patch 15 | ${VISUAL:-${EDITOR:-vi}} "$DIR/foo.patch" < /dev/tty 16 | file=`rename-patch $DIR/foo.patch` 17 | echo "filename is $file" 18 | cd $KERNEL_DIR 19 | pwd 20 | #quilt import $DIR/$file 21 | quilt import $file 22 | quilt push && quilt ref && quilt pop && quilt push 23 | 24 | -------------------------------------------------------------------------------- /stable/send_email: -------------------------------------------------------------------------------- 1 | cat ~/linux/p1 | formail -A "In-Reply-To: <20090313151749.42863ptymm5f0hic@webmail.oregonstate.edu>" -s msmtp -t 2 | 3 | cat mbox.new | formail -A "In-Reply-To: <20090313151749.42863ptymm5f0hic@webmail.oregonstate.edu>" -s msmtp-enqueue.sh 4 | -------------------------------------------------------------------------------- /stable/tested-by: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # SPDX-License-Identifier: GPL-2.0 3 | # 4 | # Copyright (c) 2020-2021 Greg Kroah-Hartman 5 | # 6 | # extract the initial "Link" for a stable -rc announcement and all of the 7 | # Tested-by lines to be added to the git commit for the release. 8 | # 9 | 10 | mbox=${1} 11 | 12 | if [ "${mbox}" == "" ] ; then 13 | echo "$0 mbox" 14 | exit 1 15 | fi 16 | 17 | TMP_DIR=$(mktemp -d "tmpdir_XXXXX") || exit 1 18 | 19 | #splitmbox.py "${mbox}" "${TMP_DIR}" >/dev/null 20 | #splitmbox.py "${mbox}" "${TMP_DIR}" 21 | splitmbox.pl "${mbox}" "${TMP_DIR}" > /dev/null 22 | 23 | cd "${TMP_DIR}" || exit 1 24 | 25 | out="" 26 | 27 | for file in $(find . -type f | sort); do 28 | #echo "file = ${file}" 29 | from_greg=$(grep "^From: Greg Kroah-Hartman " "${file}") 30 | if [ "${from_greg}" == "" ] ; then 31 | out+=$(grep -i '^Tested-by:\|^Reviewed-by:' "${file}") 32 | else 33 | messageid=$(grep -i --max-count=1 "^Message-id:" "${file}" | cut -f 2 -d '<' | cut -f 1 -d '>') 34 | out+="Link: https://lore.kernel.org/r/${messageid}" 35 | fi 36 | out+=" 37 | " 38 | rm "${file}" 39 | done 40 | cd .. 41 | rmdir "${TMP_DIR}" 42 | 43 | printf '%s' "${out}" 44 | printf '%s' "${out}" | xclip -selection c 45 | #printf '%s' "${out}" | wl-copy 46 | #echo "${out}" 47 | #echo "${out}" | xclip -selection c 48 | 49 | exit 0 50 | 51 | # old version: 52 | #messageid=$(grep -i --max-count=1 "^Message-id:" "${mbox}" | cut -f 2 -d '<' | cut -f 1 -d '>') 53 | #out="Link: https://lore.kernel.org/r/${messageid} 54 | #" 55 | # 56 | #out+=$(grep -i '^Tested-by:\|^Reviewed-by:' ${mbox}) 57 | # 58 | #printf '%s\n' "${out}" 59 | #echo "${out}" | xclip -selection c 60 | 61 | -------------------------------------------------------------------------------- /stable/tuxbuild/arm32.plan: -------------------------------------------------------------------------------- 1 | version: 1 2 | name: arm32 test build 3 | description: build arm32 kernels 4 | jobs: 5 | - build: {toolchain: gcc-10, target_arch: arm, kconfig: allmodconfig} 6 | -------------------------------------------------------------------------------- /stable/tuxbuild/one_s390.yaml: -------------------------------------------------------------------------------- 1 | sets: 2 | - name: one_s390 3 | builds: 4 | 5 | # s390 6 | - {target_arch: s390, toolchain: gcc-9, kconfig: defconfig} 7 | 8 | -------------------------------------------------------------------------------- /stable/tuxbuild/oneshot.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | name: one_x86 3 | description: One x86 allmodconfig build 4 | jobs: 5 | - builds: 6 | # x86_64 7 | - {target_arch: x86_64, toolchain: gcc-12, kconfig: allmodconfig} 8 | -------------------------------------------------------------------------------- /stable/tuxbuild/run_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ~/.local/bin/tuxsuite plan \ 4 | --git-repo 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git' \ 5 | --git-ref queue/5.15 \ 6 | all.yaml 7 | -------------------------------------------------------------------------------- /stable/tuxbuild/run_arm32.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ~/.local/bin/tuxsuite plan \ 4 | --git-repo 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git' \ 5 | --git-ref linux-5.16.y \ 6 | --patch-series /home/gregkh/linux/stable/stable-queue/5.16.patches.tar.gz \ 7 | arm32.plan 8 | -------------------------------------------------------------------------------- /stable/tuxbuild/run_one.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ~/.local/bin/tuxsuite plan \ 4 | --git-repo 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git' \ 5 | --git-ref queue/5.15 \ 6 | oneshot.yaml 7 | -------------------------------------------------------------------------------- /stable/tuxbuild/run_one_s390.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ~/.local/bin/tuxsuite build-set \ 4 | --git-repo 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git' \ 5 | --git-ref queue/4.14 \ 6 | --tux-config one_s390.yaml \ 7 | --set-name one_s390 8 | -------------------------------------------------------------------------------- /stable/tuxbuild/run_x86.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ~/.local/bin/tuxsuite build-set \ 4 | --git-repo 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git' \ 5 | --git-ref queue/5.15 \ 6 | --tux-config x86.yaml \ 7 | --set-name x86 8 | -------------------------------------------------------------------------------- /stable/tuxbuild/s390.yaml: -------------------------------------------------------------------------------- 1 | sets: 2 | - name: x86 3 | builds: 4 | 5 | # x86_64 6 | - {target_arch: x86_64, toolchain: gcc-8, kconfig: allnoconfig} 7 | # - {target_arch: x86_64, toolchain: gcc-8, kconfig: tinyconfig} 8 | - {target_arch: x86_64, toolchain: gcc-8, kconfig: x86_64_defconfig} 9 | - {target_arch: x86_64, toolchain: gcc-9, kconfig: allnoconfig} 10 | # - {target_arch: x86_64, toolchain: gcc-9, kconfig: tinyconfig} 11 | - {target_arch: x86_64, toolchain: gcc-9, kconfig: x86_64_defconfig} 12 | - {target_arch: x86_64, toolchain: gcc-10, kconfig: allnoconfig} 13 | - {target_arch: x86_64, toolchain: gcc-10, kconfig: defconfig} 14 | # - {target_arch: x86_64, toolchain: gcc-10, kconfig: tinyconfig} 15 | - {target_arch: x86_64, toolchain: clang-12, kconfig: allnoconfig} 16 | # - {target_arch: x86_64, toolchain: clang-12, kconfig: tinyconfig} 17 | - {target_arch: x86_64, toolchain: clang-12, kconfig: x86_64_defconfig} 18 | - {target_arch: x86_64, toolchain: clang-11, kconfig: allnoconfig} 19 | # - {target_arch: x86_64, toolchain: clang-11, kconfig: tinyconfig} 20 | - {target_arch: x86_64, toolchain: clang-11, kconfig: x86_64_defconfig} 21 | - {target_arch: x86_64, toolchain: clang-10, kconfig: allnoconfig} 22 | - {target_arch: x86_64, toolchain: clang-10, kconfig: defconfig} 23 | # - {target_arch: x86_64, toolchain: clang-10, kconfig: tinyconfig} 24 | 25 | - {target_arch: x86_64, toolchain: clang-12, kconfig: allmodconfig} 26 | - {target_arch: x86_64, toolchain: gcc-10, kconfig: allmodconfig} 27 | 28 | -------------------------------------------------------------------------------- /stable/tuxbuild/x86.yaml: -------------------------------------------------------------------------------- 1 | sets: 2 | - name: x86 3 | builds: 4 | 5 | # x86_64 6 | - {target_arch: x86_64, toolchain: gcc-8, kconfig: allnoconfig} 7 | # - {target_arch: x86_64, toolchain: gcc-8, kconfig: tinyconfig} 8 | - {target_arch: x86_64, toolchain: gcc-8, kconfig: x86_64_defconfig} 9 | - {target_arch: x86_64, toolchain: gcc-9, kconfig: allnoconfig} 10 | # - {target_arch: x86_64, toolchain: gcc-9, kconfig: tinyconfig} 11 | - {target_arch: x86_64, toolchain: gcc-9, kconfig: x86_64_defconfig} 12 | - {target_arch: x86_64, toolchain: gcc-10, kconfig: allnoconfig} 13 | - {target_arch: x86_64, toolchain: gcc-10, kconfig: defconfig} 14 | # - {target_arch: x86_64, toolchain: gcc-10, kconfig: tinyconfig} 15 | - {target_arch: x86_64, toolchain: clang-12, kconfig: allnoconfig} 16 | # - {target_arch: x86_64, toolchain: clang-12, kconfig: tinyconfig} 17 | - {target_arch: x86_64, toolchain: clang-12, kconfig: x86_64_defconfig} 18 | - {target_arch: x86_64, toolchain: clang-11, kconfig: allnoconfig} 19 | # - {target_arch: x86_64, toolchain: clang-11, kconfig: tinyconfig} 20 | - {target_arch: x86_64, toolchain: clang-11, kconfig: x86_64_defconfig} 21 | - {target_arch: x86_64, toolchain: clang-10, kconfig: allnoconfig} 22 | - {target_arch: x86_64, toolchain: clang-10, kconfig: defconfig} 23 | # - {target_arch: x86_64, toolchain: clang-10, kconfig: tinyconfig} 24 | 25 | - {target_arch: x86_64, toolchain: clang-12, kconfig: allmodconfig} 26 | - {target_arch: x86_64, toolchain: gcc-10, kconfig: allmodconfig} 27 | 28 | -------------------------------------------------------------------------------- /stable/update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # Update hook for stable git tree to email patches we need to care about 4 | # 5 | 6 | # --- Constants 7 | chomp($cwd=`pwd`); 8 | 9 | # --- Command line 10 | $refname=$ARGV[0]; 11 | $oldrev=$ARGV[1]; 12 | $newrev=$ARGV[2]; 13 | 14 | # --- Safety check 15 | if ($ENV{'GIT_DIR'} eq '') { 16 | print STDERR "Don't run this script from the command line."; 17 | print STDERR " (if you want, you could supply GIT_DIR then run"; 18 | print STDERR " $0 )\n"; 19 | exit 1; 20 | } 21 | 22 | if ($refname eq '' || $oldrev eq '' || $newrev eq '') { 23 | print STDERR "Usage: $0 "; 24 | exit 1; 25 | } 26 | 27 | if ($refname ne 'refs/heads/master') { 28 | print STDERR "Branch $refname not master, not generating email\n"; 29 | exit 0; 30 | } 31 | 32 | chomp(@commitlist = `git-rev-list --no-merges $newrev ^$oldrev`); 33 | 34 | foreach $commit (@commitlist) { 35 | # skip if someone else's commit or merge 36 | # $recipients = 'jejb@kernel.org, stable@kernel.org'; 37 | $recipients = 'greg@kroah.com, stable@vger.kernel.org'; 38 | $found = 0; 39 | $subject = ''; 40 | 41 | foreach $_ (`git-log $commit^..$commit`) { 42 | if (/^ \S/ && $subject eq '') { 43 | chomp($subject = substr($_, 4)); 44 | } elsif (/^ cc:.*stable\@kernel\.org/i) { 45 | $found = 1; 46 | last; 47 | } elsif (/^ cc:.*stable\@vger\.kernel\.org/i) { 48 | $found = 1; 49 | last; 50 | } 51 | } 52 | next if (!$found); 53 | @email = ( 54 | # Generate header 55 | "From: Gregs git-bot ", 56 | "To: $recipients", 57 | "Subject: Patch Upstream: $subject", 58 | "X-Git-Oldrev: $oldrev", 59 | "X-Git-Newrev: $newrev", 60 | "", 61 | # body goes here 62 | "commit: $commit", 63 | ); 64 | chomp(@commitlog = `git format-patch -k --stdout $commit^..$commit`); 65 | # get rid of the mbox header 66 | shift @commitlog; 67 | push @email, @commitlog; 68 | open(EMAIL, "| /usr/sbin/sendmail -t") || die; 69 | print EMAIL join("\n", @email); 70 | close(EMAIL); 71 | print "$subject\n"; 72 | } 73 | 74 | exit 0 75 | 76 | -------------------------------------------------------------------------------- /stable/update_all_branches: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git fetch 4 | for branch in $(git branch --list --no-color -vv | grep " behind " | sed -e 's/^ //' | sed -e 's/\* //' | awk '{print $1}' | sort -V); do 5 | echo "Updating $branch" 6 | git checkout -q "${branch}" 7 | git pull 8 | done 9 | -------------------------------------------------------------------------------- /stable/version_bump: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # SPDX-License-Identifier: GPL-2.0 3 | # 4 | # Copyright 2018 Greg Kroah-Hartman 5 | # 6 | # edits the Makefile of a kernel, and bumps the SUBLEVEL version to be one 7 | # greater than what it is now. Used when making stable kernel releases 8 | # 9 | # Must be in the directory of the kernel that you wish to change the version 10 | # of, and the Makefile must be "clean" with no changes in it. 11 | # 12 | # If the second arg is not "", then extraversion will get a -rc1 added to it. 13 | # 14 | # And of course, this whole thing is a horrid hack... 15 | 16 | VERSION=$(kv) 17 | 18 | RC=${1} 19 | 20 | if [ "${RC}" != "" ] ; then 21 | RC=" -rc1" 22 | else 23 | RC="" 24 | fi 25 | 26 | #BASE_VERSION=${VERSION/-rc?/} 27 | # 28 | #if [ ${BASE_VERSION} != ${VERSION} ] ; then 29 | # echo "${VERSION} still has a -rc tag, do you mean for that to be there?" 30 | # exit 31 | #fi 32 | 33 | CLEAN=$(git diff Makefile) 34 | 35 | if [ "${CLEAN}" != "" ] ; then 36 | echo "${0} has to run with a clean Makefile, exiting..." 37 | exit 38 | fi 39 | 40 | REL_ARRAY=(${VERSION//./ }) 41 | MINOR=${REL_ARRAY[2]} 42 | NEW_MINOR=$(($MINOR + 1)) 43 | 44 | echo "${REL_ARRAY[0]}.${REL_ARRAY[1]}.${MINOR} -> ${REL_ARRAY[0]}.${REL_ARRAY[1]}.${NEW_MINOR}${RC/ /}" 45 | 46 | cp Makefile Makefile.orig 47 | rm Makefile 48 | 49 | # 50 | # I fight with sed too much, this should work: 51 | # sed -i -e 's/SUBLEVEL = ${MINOR}/SUBLEVEL = ${NEW_MINOR}/' Makefile.new 52 | # but it doesn't, so abuse bash to just read in the whole Makefile and change a 53 | # single line. I suck. 54 | # 55 | while IFS= read -r line 56 | do 57 | case "$line" in 58 | SUBLEVEL*) printf "%s\n" "${line/${MINOR}/${NEW_MINOR}}" >> Makefile;; 59 | EXTRAVERSION*) printf "%s%s\n" "${line}" "${RC}" >> Makefile;; 60 | *) printf "%s\n" "$line" >> Makefile;; 61 | esac 62 | done < Makefile.orig 63 | 64 | diff -u Makefile.orig Makefile > makefile.patch 65 | mv Makefile.orig Makefile 66 | 67 | patch -s -p0 < makefile.patch 68 | 69 | rm makefile.patch 70 | 71 | #cp Makefile Makefile.new 72 | # 73 | # 74 | # sed -i -e 's/SUBLEVEL = ${MINOR}/SUBLEVEL = ${NEW_MINOR}/' Makefile.new 75 | #echo "sed -i -e 's/SUBLEVEL = ${MINOR}/SUBLEVEL = ${NEW_MINOR}/' Makefile.new" 76 | # 77 | #$(diff -u Makefile Makefile.new > makefile.patch) 78 | 79 | 80 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | linux 2 | patches 3 | log.run1 4 | log.run2 5 | -------------------------------------------------------------------------------- /test/branch_switch_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd test 3 | git co -b old_kernel v4.4 4 | sync 5 | git co -b new_kernel v5.8 6 | sync 7 | -------------------------------------------------------------------------------- /test/bugs/kernbug.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | void fail(const char *msg) 11 | { 12 | perror(msg); 13 | exit(EXIT_FAILURE); 14 | } 15 | 16 | int 17 | main(int argc, char **argv) 18 | { 19 | if (argc != 2) { 20 | fprintf(stderr, "Pass a file name as argument.\n"); 21 | exit(EXIT_FAILURE); 22 | } 23 | 24 | const char *filename = argv[1]; 25 | int fd = open(filename, O_RDONLY | O_NONBLOCK); 26 | 27 | if (fd == -1) fail("open"); 28 | 29 | fd_set rfds; 30 | struct timeval tv; 31 | int retval; 32 | char buf[512]; 33 | 34 | /* Add the file descriptor */ 35 | FD_ZERO(&rfds); 36 | FD_SET(fd, &rfds); 37 | 38 | assert(FD_ISSET(fd, &rfds)); 39 | 40 | while (1) { 41 | /* Wait max five seconds. */ 42 | tv.tv_sec = 5; 43 | tv.tv_usec = 0; 44 | 45 | retval = select(fd+1, &rfds, NULL, NULL, &tv); 46 | 47 | switch (retval) { 48 | case -1: fail("select"); /* Does not return. */ 49 | case 0: printf("Timeout...\n"); break; 50 | default: 51 | retval = read(fd, buf, sizeof(buf)); 52 | printf("Read %d bytes.\n", retval); 53 | 54 | if (retval == 0) { 55 | printf("EOF\n"); 56 | return 0; 57 | } 58 | } 59 | } 60 | 61 | return 0; 62 | } 63 | -------------------------------------------------------------------------------- /test/bugs/zero_read.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | 6 | int main(void) 7 | { 8 | char *filename = "/sys/power/state"; 9 | // char *filename = "/sys/bus/pci/devices/0000:00:00.0/config"; 10 | // char *filename = "/sys/devices/platform/dell_rbu/image_type"; 11 | char buffer[100]; 12 | int fd; 13 | int result; 14 | 15 | printf("filename = %s\n", filename); 16 | fd = open(filename, O_RDONLY | O_NONBLOCK); 17 | printf("fd = %d\n", fd); 18 | result = read(fd, buffer, 0); 19 | printf("result = %d\n", result); 20 | close(fd); 21 | return 0; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /test/buildtest: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | TESTDIR=`pwd` 4 | PATCHDIR="$TESTDIR/patches" 5 | BUILDDIR="$TESTDIR/linux" 6 | LOG="$TESTDIR/log" 7 | GIT_LOCAL="greg@aria:git/patches.git" 8 | GIT_REMOTE="git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/patches.git" 9 | 10 | HOSTNAME=`hostname` 11 | 12 | ONE_SHOT=$1 13 | 14 | echo "PATCHDIR=$PATCHDIR" 15 | echo "BUILDDIR=$BUILDDIR" 16 | 17 | # If we are a machine on the local network, don't download the kernel.org 18 | # version of the patch repo 19 | #if [ $HOSTNAME = "kvm" ]; then 20 | # PATCH_REPO=$GIT_LOCAL 21 | #elif [ $HOSTNAME = "mini" ]; then 22 | # PATCH_REPO=$GIT_LOCAL 23 | #else 24 | PATCH_REPO=$GIT_REMOTE 25 | #fi 26 | 27 | if [ -d $PATCHDIR ]; then 28 | # just pull, don't clone a whole new tree 29 | cd $PATCHDIR 30 | git pull 31 | cd .. 32 | else 33 | # check out latest version of patches 34 | git clone $PATCH_REPO $PATCHDIR 35 | fi 36 | 37 | echo "cleaning up from any previous runs" 38 | rm -rf $BUILDDIR 39 | rm $LOG $LOG.run1 $LOG.run2 40 | 41 | VERSION=`cat $PATCHDIR/version` 42 | 43 | echo "working with kernel version $VERSION" 44 | 45 | # get latest version of kernel based on patch level 46 | mkdir $BUILDDIR 47 | cd $BUILDDIR 48 | ketchup $VERSION 49 | 50 | FAILED=0 51 | J=$(expr $(grep processor /proc/cpuinfo | wc -l) \* 4) 52 | 53 | if [ "X$ONE_SHOTX" == "XX" ] ; then 54 | # do a build first to set a baseline 55 | make allmodconfig 56 | nice -20 make -j$J 2> $LOG.run1 || FAILED=1 57 | if [ "$FAILED" != "0" ]; then 58 | echo "initial build FAILED!" 59 | echo "see $LOG.run1 for what happened" 60 | exit $FAILED 61 | fi 62 | 63 | # now clean up and do a second build with our patches 64 | make distclean 65 | fi 66 | 67 | # apply all patches 68 | QUILT_PATCHES=$PATCHDIR QUILT_SERIES=$PATCHDIR/series quilt push -aq --quiltrc 69 | 70 | # build for allmodconfig 71 | make allmodconfig 72 | #make -j4 &> $LOG 73 | nice -20 make -j$J 2> $LOG.run2 || FAILED=1 74 | if [ "$FAILED" != "0" ]; then 75 | echo "initial build FAILED!" 76 | echo "see $LOG.run2 for what happened" 77 | exit $FAILED 78 | fi 79 | 80 | diff -u $LOG.run1 $LOG.run2 81 | -------------------------------------------------------------------------------- /test/clone_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | git clone -s ../work/torvalds/ test 3 | sync 4 | -------------------------------------------------------------------------------- /test/pstate: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | sudo perf record -C 5 -c 1 -e power:pstate_sample& 4 | sleep .5 5 | foo=$! 6 | taskset -c 5 cat /dev/zero > /dev/null& 7 | bar=$! 8 | sleep 1 9 | kill $bar 10 | sleep .5 11 | sudo kill $foo 12 | 13 | echo "run 'perf script' to get the output" 14 | -------------------------------------------------------------------------------- /test/test-staging: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | TESTDIR=`pwd` 4 | PATCHDIR="$TESTDIR/staging" 5 | BUILDDIR="$TESTDIR/linux-staging" 6 | LOG="$TESTDIR/log-stage" 7 | GIT_LOCAL="greg@aria:git/staging.git" 8 | GIT_REMOTE="git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git" 9 | 10 | HOSTNAME=`hostname` 11 | 12 | ONE_SHOT=$1 13 | 14 | echo "PATCHDIR=$PATCHDIR" 15 | echo "BUILDDIR=$BUILDDIR" 16 | 17 | echo "cleaning up from any previous runs" 18 | rm -rf $BUILDDIR 19 | rm $LOG $LOG.run1 $LOG.run2 20 | 21 | # If we are a machine on the local network, don't download the kernel.org 22 | # version of the patch repo 23 | if [ $HOSTNAME = "kvm" ]; then 24 | PATCH_REPO=$GIT_LOCAL 25 | elif [ $HOSTNAME = "mini" ]; then 26 | PATCH_REPO=$GIT_LOCAL 27 | else 28 | PATCH_REPO=$GIT_REMOTE 29 | fi 30 | 31 | if [ -d $PATCHDIR ]; then 32 | # just pull, don't clone a whole new tree 33 | cd $PATCHDIR 34 | git pull 35 | cd .. 36 | else 37 | # check out latest version of patches 38 | git clone $PATCH_REPO $PATCHDIR 39 | fi 40 | 41 | VERSION=`cat $PATCHDIR/version` 42 | 43 | echo "working with kernel version $VERSION" 44 | 45 | # get latest version of kernel based on patch level 46 | mkdir $BUILDDIR 47 | cd $BUILDDIR 48 | ketchup $VERSION 49 | 50 | FAILED=0 51 | J=$(expr $(grep processor /proc/cpuinfo | wc -l) \* 4) 52 | 53 | if [ "X$ONE_SHOTX" == "XX" ] ; then 54 | # do a build first to set a baseline 55 | make allmodconfig 56 | nice -20 make -j$J 2> $LOG.run1 || FAILED=1 57 | if [ "$FAILED" != "0" ]; then 58 | echo "initial build FAILED!" 59 | echo "see $LOG.run1 for what happened" 60 | exit $FAILED 61 | fi 62 | 63 | # now clean up and do a second build with our patches 64 | make distclean 65 | fi 66 | 67 | # apply all patches 68 | QUILT_PATCHES=$PATCHDIR QUILT_SERIES=$PATCHDIR/series quilt push -aq --quiltrc 69 | 70 | # build for allmodconfig 71 | make allmodconfig 72 | #make -j4 &> $LOG 73 | nice -20 make -j$J 2> $LOG.run2 || FAILED=1 74 | if [ "$FAILED" != "0" ]; then 75 | echo "initial build FAILED!" 76 | echo "see $LOG.run2 for what happened" 77 | exit $FAILED 78 | fi 79 | 80 | diff -u $LOG.run1 $LOG.run2 81 | -------------------------------------------------------------------------------- /test/xb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ x$ARCH == x ] 4 | then 5 | echo '$ARCH' unset 6 | exit 1 7 | fi 8 | 9 | 10 | if [ x"$DISTCC_HOSTS" != x ] 11 | then 12 | DISTCC="distcc" 13 | if [ x$J == x ] 14 | then 15 | J=256 16 | fi 17 | else 18 | if [ x$J == x ] 19 | then 20 | J=$(expr $(grep processor /proc/cpuinfo | wc -l) \* 4) 21 | fi 22 | fi 23 | 24 | XARCH="$ARCH-unknown-linux-gnu" 25 | I=vmlinux 26 | 27 | [ $ARCH = alpha ] && CT=gcc-4.1.0-glibc-2.3.6 28 | [ $ARCH = arm ] && CT=gcc-3.4.5-glibc-2.3.6 29 | [ $ARCH = i386 ] && CT=gcc-4.1.0-glibc-2.3.6 && XARCH=i686-unknown-linux-gnu && I=bzImage 30 | [ $ARCH = ia64 ] && CT=gcc-3.4.5-glibc-2.3.6 31 | [ $ARCH = m68k ] && CT=gcc-4.1.0-glibc-2.3.6 32 | [ $ARCH = mips ] && CT=gcc-3.4.5-glibc-2.3.6 33 | [ $ARCH = s390 ] && CT=gcc-4.1.0-glibc-2.3.6 34 | [ $ARCH = sh ] && CT=gcc-3.4.5-glibc-2.3.6 && XARCH=sh4-unknown-linux-gnu 35 | [ $ARCH = sparc ] && CT=gcc-4.1.0-glibc-2.3.6 36 | [ $ARCH = sparc64 ] && CT=gcc-3.4.5-glibc-2.3.6 37 | [ $ARCH = x86_64 ] && CT=gcc-4.0.2-glibc-2.3.6 && I=bzImage 38 | [ $ARCH = parisc ] && CT=gcc-4.0.2-glibc-2.3.6 && I=bzImage 39 | [ $ARCH = powerpc ] && CT=gcc-4.1.0-glibc-2.3.6 && XARCH=powerpc64-unknown-linux-gnu 40 | 41 | if [ $# -eq 0 ] 42 | then 43 | WHAT="$I modules" 44 | else 45 | WHAT="$*" 46 | fi 47 | 48 | PATH=$PATH:/opt/crosstool/$CT/$XARCH/bin export PATH 49 | 50 | export CROSS_COMPILE=/opt/crosstool/$CT/$XARCH/bin/$XARCH- 51 | 52 | export CC="$DISTCC /opt/crosstool/$CT/$XARCH/bin/$XARCH-gcc" 53 | 54 | FAILED=0 55 | 56 | if [ "$ECHO" != "" ] 57 | then 58 | echo CROSS_COMPILE=$CROSS_COMPILE CC=\"$CC\" make -j$J $* CC=\"$CC\" $WHAT || FAILED=1 59 | else 60 | nice -20 make -j$J $* CC="$CC" $WHAT 2>~/tmp/log-$ARCH || FAILED=1 61 | fi 62 | 63 | cat ~/tmp/log-$ARCH 64 | [ "$FAILED" != "0" ] && echo "**FAILED**" 65 | exit $FAILED 66 | -------------------------------------------------------------------------------- /work/.gitignore: -------------------------------------------------------------------------------- 1 | s 2 | s1 3 | s2 4 | s3 5 | s4 6 | bainbu/ 7 | char-misc/ 8 | debugfs_cleanup/ 9 | driver-core/ 10 | rust/ 11 | spdx/ 12 | staging/ 13 | torvalds/ 14 | tty/ 15 | usb/ 16 | -------------------------------------------------------------------------------- /work/configs/tty.version: -------------------------------------------------------------------------------- 1 | 1713 2 | -------------------------------------------------------------------------------- /work/configs/usb.version: -------------------------------------------------------------------------------- 1 | 1402 2 | -------------------------------------------------------------------------------- /work/justfile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S just --justfile 2 | 3 | # show the list of options 4 | _help: 5 | @just --list 6 | 7 | # Merge main into all branches 8 | merge_main: 9 | #!/usr/bin/env bash 10 | cd {{invocation_directory()}} 11 | git merge main 12 | for branch in $(git branch --list --no-color | cut -f 3 -d ' '); do 13 | echo "Updating $branch" 14 | git checkout "${branch}" 15 | git merge main 16 | done 17 | 18 | # Push all tags 19 | push_tags: 20 | #!/usr/bin/env bash 21 | cd {{invocation_directory()}} 22 | for remote in $(git remote); do 23 | #git push "${remote}" --tags 24 | gum spin --title="Pushing tags to ${remote}" --align=right --show-output -s minidot --show-output -- git push "${remote}" --tags 25 | done 26 | 27 | # push a specific branch/tags 28 | push type: 29 | @cd {{invocation_directory()}}; ../scripts/push {{type}} 30 | 31 | # push testing 32 | pt: 33 | @cd {{invocation_directory()}}; ../scripts/push testing 34 | 35 | # push all branches 36 | push_all: 37 | @cd {{invocation_directory()}}; ../scripts/push all 38 | 39 | # Generate a pull request 40 | pull_request: 41 | @cd {{invocation_directory()}}; ../scripts/pull_request 42 | 43 | # make pull message (obsolete) 44 | x_make_message: 45 | @cd {{invocation_directory()}}; ../scripts/mk_msg x 46 | 47 | # commit all for this branch 48 | commit: 49 | @cd {{invocation_directory()}}; ../scripts/do.sh 50 | 51 | # sync the working branches 52 | work_sync: 53 | @cd {{invocation_directory()}}; ../scripts/work_sync 54 | 55 | # Install the path to the git hooks we want to use for these repos 56 | install_hooks: 57 | @cd {{invocation_directory()}}; git config core.hooksPath /home/gregkh/linux/work/scripts/githooks/ 58 | -------------------------------------------------------------------------------- /work/platform_files.txt: -------------------------------------------------------------------------------- 1 | ./arch/arm/mach-pxa/sharpsl_pm.c 2 | ./arch/sh/drivers/push-switch.c 3 | ./drivers/ata/sata_fsl.c 4 | ./drivers/auxdisplay/img-ascii-lcd.c 5 | ./drivers/crypto/picoxcell_crypto.c 6 | ./drivers/dma/qcom/hidma.c 7 | ./drivers/edac/synopsys_edac.c 8 | ./drivers/fsi/fsi-master-ast-cf.c 9 | ./drivers/fsi/fsi-master-gpio.c 10 | ./drivers/gpu/drm/arm/malidp_drv.c 11 | ./drivers/gpu/drm/exynos/exynos_drm_vidi.c 12 | ./drivers/hwmon/abituguru.c 13 | ./drivers/hwmon/abituguru3.c 14 | ./drivers/hwmon/f71882fg.c 15 | ./drivers/hwmon/i5k_amb.c 16 | ./drivers/hwmon/ibmaem.c 17 | ./drivers/hwmon/pc87360.c 18 | ./drivers/hwmon/pc87427.c 19 | ./drivers/hwmon/s3c-hwmon.c 20 | ./drivers/hwmon/sch5636.c 21 | ./drivers/hwmon/via-cputemp.c 22 | ./drivers/hwmon/vt1211.c 23 | ./drivers/hwmon/w83627ehf.c 24 | ./drivers/hwmon/w83627hf.c 25 | ./drivers/hwmon/w83781d.c 26 | ./drivers/i2c/muxes/i2c-demux-pinctrl.c 27 | ./drivers/input/keyboard/omap-keypad.c 28 | ./drivers/macintosh/therm_windtunnel.c 29 | ./drivers/media/platform/exynos4-is/media-dev.c 30 | ./drivers/mfd/ab3100-otp.c 31 | ./drivers/mfd/sm501.c 32 | ./drivers/mfd/tps65911-comparator.c 33 | ./drivers/mmc/host/android-goldfish.c 34 | ./drivers/mmc/host/omap.c 35 | ./drivers/mmc/host/omap_hsmmc.c 36 | ./drivers/mtd/devices/docg3.c 37 | ./drivers/net/ethernet/ibm/ehea/ehea_main.c 38 | ./drivers/net/ethernet/sun/niu.c 39 | ./drivers/phy/renesas/phy-rcar-gen3-usb2.c 40 | ./drivers/phy/ti/phy-twl4030-usb.c 41 | ./drivers/platform/x86/msi-laptop.c 42 | ./drivers/platform/x86/sony-laptop.c 43 | ./drivers/platform/x86/thinkpad_acpi.c 44 | ./drivers/power/reset/vexpress-poweroff.c 45 | ./drivers/power/supply/ab8500_fg.c 46 | ./drivers/power/supply/max14577_charger.c 47 | ./drivers/power/supply/max77693_charger.c 48 | ./drivers/power/supply/twl4030_charger.c 49 | ./drivers/power/supply/wm8350_power.c 50 | ./drivers/regulator/bd9571mwv-regulator.c 51 | ./drivers/s390/block/dcssblk.c 52 | ./drivers/scsi/ufs/ufs-qcom.c 53 | ./drivers/soc/tegra/pmc.c 54 | ./drivers/soc/versatile/soc-realview.c 55 | ./drivers/staging/greybus/arche-apb-ctrl.c 56 | ./drivers/staging/greybus/arche-platform.c 57 | ./drivers/tty/serial/qcom_geni_serial.c 58 | ./drivers/uio/uio_fsl_elbc_gpcm.c 59 | ./drivers/usb/gadget/udc/dummy_hcd.c 60 | ./drivers/usb/gadget/udc/net2272.c 61 | ./drivers/usb/gadget/udc/renesas_usb3.c 62 | ./drivers/usb/host/fotg210-hcd.c 63 | ./drivers/usb/phy/phy-fsl-usb.c 64 | ./drivers/usb/phy/phy-twl6030-usb.c 65 | ./drivers/video/fbdev/broadsheetfb.c 66 | ./drivers/video/fbdev/fsl-diu-fb.c 67 | ./drivers/video/fbdev/gbefb.c 68 | ./drivers/video/fbdev/mb862xx/mb862xxfbdrv.c 69 | ./drivers/video/fbdev/omap/omapfb_main.c 70 | ./drivers/video/fbdev/s3c2410fb.c 71 | ./drivers/video/fbdev/sh_mobile_lcdcfb.c 72 | -------------------------------------------------------------------------------- /work/scripts/githooks/applypatch-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . git-sh-setup 3 | perl -pi -e 's|^Message-I[Dd]:\s*]+)>?$|Link: https://lore.kernel.org/r/$1|g;' "$1" 4 | test -x "$GIT_DIR/hooks/commit-msg" && 5 | exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} 6 | : 7 | -------------------------------------------------------------------------------- /work/scripts/githooks/prepare-commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sed -i 's|ssh://git@gitolite.kernel.org/|git://git.kernel.org/|g' "$1" 3 | #echo "hi!" 4 | exit 0 5 | -------------------------------------------------------------------------------- /work/scripts/githooks/sendemail-validate: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # SPDX-License-Identifier: GPL-2.0-or-later 3 | 4 | use Mail::Box::Manager; 5 | 6 | my $mgr = Mail::Box::Manager->new; 7 | my $folder = $mgr->open(folder => $ARGV[0], type => 'Mail::Box::Mbox', access => 'rw'); 8 | my $msg = $folder->message(0); 9 | my Mail::Message::Head $head = $msg->head; 10 | 11 | my $msg_id = `/home/gregkh/bin/make_message_id`; 12 | print "msg id = $msg_id\n"; 13 | print $head; 14 | print $head->get('Message-Id'), "\n"; 15 | 16 | $head->delete('Message-Id'); 17 | $head->add("Message-Id: <${msg_id}>"); 18 | print $head; 19 | $folder->close; 20 | 21 | `patatt sign --hook "${ARGV[0]}"` 22 | 23 | -------------------------------------------------------------------------------- /work/scripts/githooks/sendemail-validate.old: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # git send-email hook to provide a custom message-id instead of relying 3 | # on git's own algorithm 4 | # From Christian Brauner and others in this thread: 5 | # https://social.kernel.org/notice/AU5IphRPUsQvvkx732 6 | 7 | export CUSTOM_MESSAGE_ID=$(${HOME}/bin/make_message_id) 8 | echo "new id = '${CUSTOM_MESSAGE_ID}'" 9 | 10 | # Check if there is a line starting with Message-Id:. Stop the search when the 11 | # first empty newline is encountered. This is where the header should end. 12 | perl -ne 'if (/^Message-Id:/) { $found = 1 } elsif (/^$/) { exit } END { exit !$found }' "${1}" 13 | if [ $? -eq 0 ]; then 14 | # If there already is a Message-Id: line we replace it with our custom message id. 15 | perl -i -pe 'if (!$replaced && s/^Message-Id:.*/Message-Id: <$ENV{CUSTOM_MESSAGE_ID}>/) { $replaced = 1 }' "${1}" 16 | else 17 | # If there is no Message-Id: line we insert one right after the Subject: line. 18 | perl -i -pe 'if (/^Subject:/ && !$inserted) { $_ .= "Message-Id: <$ENV{CUSTOM_MESSAGE_ID}>\n"; $inserted = 1 }' "${1}" 19 | fi 20 | 21 | patatt sign --hook "${1}" 22 | 23 | -------------------------------------------------------------------------------- /work/scripts/merge_main: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git merge main 4 | for branch in $(git branch --list --no-color | cut -f 3 -d ' '); do 5 | echo "Updating $branch" 6 | git checkout "${branch}" 7 | git merge main 8 | done 9 | -------------------------------------------------------------------------------- /work/scripts/mk_msg: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #ROOT="master" 4 | ROOT="main" 5 | #ROOT="origin" 6 | #ROOT="c8ddb2713c624f432fa5fe3c7ecffcdda46ea0d4" 7 | #ROOT="cf7d7e5a1980d1116ee152d25dac382b112b9c17" 8 | 9 | MERGE_POINT=$(git merge-base ${ROOT} HEAD) 10 | 11 | if [ "${MERGE_POINT}" == "" ] ; then 12 | echo "unable to find common merge-base!" 13 | exit 1 14 | fi 15 | 16 | PRETTY_MERGE_POINT=$(git show -s --abbrev-commit --abbrev=12 --pretty=format:"%h (\"%s\")%n" ${MERGE_POINT}) 17 | 18 | echo "Merge base is ${PRETTY_MERGE_POINT}" 19 | 20 | TMP_FILE=$1 21 | # 22 | echo > $TMP_FILE 23 | echo "Merge base is ${PRETTY_MERGE_POINT})" >> ${TMP_FILE} 24 | echo >> $TMP_FILE 25 | git diff -M --stat --summary ${MERGE_POINT}..HEAD >> $TMP_FILE 26 | echo >> $TMP_FILE 27 | echo "---------------" >> $TMP_FILE 28 | echo >> $TMP_FILE 29 | git log --no-merges ${MERGE_POINT}..HEAD | git shortlog >> $TMP_FILE 30 | git format-patch -M -n ${MERGE_POINT}..HEAD 31 | 32 | #echo "git send-email --to linux-pci@atrey.karlin.mff.cuni.cz --no-chain-reply-to *.patch" 33 | 34 | -------------------------------------------------------------------------------- /work/scripts/path: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./.git-prompt.sh 4 | 5 | source ./push.sh 6 | 7 | export GIT_PS1_HIDE_IF_PWD_IGNORED=1 8 | BLUE="01;34m" 9 | GREEN="01;32m" 10 | RED="01;31m" 11 | PURPLE="01;35m" 12 | YELLOW="01;33m" 13 | WHITE="01;37m" 14 | 15 | COLOR=$BLUE 16 | #PS1='$(prompt_foo \l)\[\033[${COLOR}\]\w \$\[\033[00m\] ' 17 | #PS1='\[\033[01;34m\]\w \$\[\033[00m\] ' 18 | PS1='\[\033[${COLOR}\]\w $(__git_ps1 "(%s)")\$ \[\033[00m\]' 19 | 20 | -------------------------------------------------------------------------------- /work/scripts/pull_request: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2012,2023 Greg Kroah-Hartman 4 | # 5 | # Make a pull request for Linux based on the current branch and 6 | # the "next" -rc release 7 | # 8 | # Uses `gum` to make things pretty, and a bit simpler for input 9 | # 10 | # usage 11 | # ${script} [VERSION_NUMBER] 12 | # [VERSION_NUMBER] is optional, will be guessed if not present 13 | # 14 | 15 | pwd=$(pwd) 16 | tree=$(basename ${pwd}) 17 | 18 | #echo "tree=${tree}" 19 | 20 | branch=$(git symbolic-ref --short -q HEAD | cut -f2- -d '-' | cut -f2- -d '-') 21 | 22 | #echo "branch=${branch}" 23 | 24 | version=$1 25 | 26 | if [ "${version}" == "" ] ; then 27 | version=$(kv) 28 | # strip off extra ".0" that is in the output of the kernel makefile 29 | version="${version/.0/}" 30 | 31 | # if this branch is "-linus" then we can "guess" that this is a "normal" pull request of bugfixes for the next -rc release 32 | if [ "${branch}" == "linus" ] ; then 33 | # dig out the -rc version, if present 34 | rc=${version: -1} 35 | # bump it by 1 36 | new_rc=$((rc+1)) 37 | #echo "rc=${rc} new_rc=${new_rc}" 38 | # replace the version with the new bumped-by-one rc 39 | # it's a good guess, not always right, but most of the time it is. 40 | version="${version/rc${rc}/rc${new_rc}}" 41 | else 42 | # this is possibly for the "next" -rc1 release 43 | # strip off the -rc chunk 44 | version="${version/-rc*/}" 45 | # dig out the minor number 46 | minor="${version/*./}" 47 | # and the major number 48 | major="${version/.*/}" 49 | #echo "major=${major} minor=${minor}" 50 | # bump minor by one 51 | minor=$((minor+1)) 52 | # reconstruct the version and tack on -rc1 53 | version="${major}.${minor}-rc1" 54 | fi 55 | fi 56 | 57 | #echo "version=${version}" 58 | 59 | q=$(gum input --prompt="# What is the kernel version? " --value="${version}") 60 | 61 | #echo "q=${q}" 62 | 63 | gum style --foreground 44 "# Creating pull request for $(gum style --foreground 212 ${tree}) for $(gum style --foreground 99 ${q})" 64 | 65 | # Not everything is in my named git path, some are shared 66 | name="gregkh" 67 | if [[ "${tree}" == "driver-core" ]]; then 68 | name="driver-core" 69 | fi 70 | 71 | #printf "# Creating pull request for ${tree} for ${version}\n" 72 | printf "git tag -u kroah.com -s $tree-$q $tree-$branch\n"; 73 | printf "git push origin $tree-$q\n"; 74 | printf "echo \"git request-pull main git://git.kernel.org/pub/scm/linux/kernel/git/${name}/$tree.git $tree-$q | sed -e 's|ssh://git@gitolite.kernel.org/|git://git.kernel.org/|g' > msg.txt\" > do.sh\n"; 75 | exit 76 | 77 | # Old-school perl version is below 78 | 79 | #!/usr/bin/perl 80 | 81 | use strict; 82 | 83 | my $pwd = `pwd`; 84 | chomp($pwd); 85 | #print "pwd = $pwd\n"; 86 | my $tree = `basename $pwd`; 87 | chomp($tree); 88 | #print "tree = $tree\n"; 89 | 90 | my $version; 91 | 92 | $version = shift; 93 | if (!defined($version)) { 94 | $version = `kv`; 95 | chomp($version); 96 | } 97 | 98 | my $branch = `git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | cut -f2- -d '-' | cut -f2- -d '-'`; 99 | # doesn't work because the sed regex isn't working due to quoting and I don't feel like figuring it out... 100 | #my $branch = `git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | rev | cut -f2- -d '-' | rev `; 101 | chomp($branch); 102 | #print "$branch\n"; 103 | 104 | print "# What is the kernel version? [$version] "; 105 | my $q = ; 106 | chomp($q); 107 | if ($q eq "") { 108 | $q = $version; 109 | } 110 | print "git tag -u kroah.com -s $tree-$q $tree-$branch\n"; 111 | #print "git tag -u kroah.com -s $tree-$q $tree-next\n"; 112 | print "git push origin $tree-$q\n"; 113 | print "echo \"git request-pull main git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/$tree.git $tree-$q > msg.txt\" > do.sh\n"; 114 | -------------------------------------------------------------------------------- /work/scripts/push: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # colors! 4 | txtund=$(tput sgr 0 1) # Underline 5 | txtbld=$(tput bold) # Bold 6 | txtred=$(tput setaf 1) # Red 7 | txtgrn=$(tput setaf 2) # Green 8 | txtylw=$(tput setaf 3) # Yellow 9 | txtblu=$(tput setaf 4) # Blue 10 | txtpur=$(tput setaf 5) # Purple 11 | txtcyn=$(tput setaf 6) # Cyan 12 | txtwht=$(tput setaf 7) # White 13 | txtrst=$(tput sgr0) # Text reset 14 | 15 | BRANCH=$1 16 | if [ "$BRANCH" == "" ] ; then 17 | echo "must specify branch (linus, testing, next, main), or 'all' or 'tags'" 18 | exit 1 19 | fi 20 | 21 | if [ "${BRANCH}" == "help" ] ; then 22 | echo "linus testing next main all tags" 23 | exit 0 24 | fi 25 | 26 | CURRENT_BRANCH=$(git symbolic-ref --short -q HEAD) 27 | 28 | PWD=$(pwd) 29 | TREE=$(basename "${PWD}") 30 | 31 | # push tags only 32 | if [ "${BRANCH}" == "tags" ] ; then 33 | for remote in $(git remote) 34 | do 35 | git push "${remote}" --tags 36 | done 37 | exit 38 | fi 39 | 40 | # push all branches 41 | if [ "${BRANCH}" == "all" ] ; then 42 | ${BASH_SOURCE[0]} main 43 | ${BASH_SOURCE[0]} linus 44 | ${BASH_SOURCE[0]} next 45 | ${BASH_SOURCE[0]} testing 46 | exit 47 | fi 48 | 49 | if [ "${BRANCH}" == "main" ] ; then 50 | TO_PUSH="main" 51 | else 52 | TO_PUSH="${TREE}-${BRANCH}" 53 | fi 54 | 55 | if [[ "${TO_PUSH}" != "${CURRENT_BRANCH}" ]]; then 56 | #echo "checking out ${TO_PUSH}" 57 | git checkout -q "${TO_PUSH}" 58 | fi 59 | 60 | for remote in $(git remote) 61 | do 62 | repo_text=" ${txtcyn}${TO_PUSH}${txtrst} to ${txtred}${remote}${txtrst}" 63 | pushed_text=" ${txtgrn}pushed${txtrst}${repo_text}" 64 | pushing_text=" ${txtylw}pushing${txtrst}${repo_text}" 65 | # echo -n "${txtylw}pushing${txtrst} " 66 | # echo -n "${txtcyn}${TO_PUSH} ${txtrst}" 67 | # echo -n "${txtylw}to ${txtrst}" 68 | # echo "${txtred}${remote}${txtrst}" 69 | gum spin --title="${pushing_text}" --align=right --show-output -s minidot -- git push -q "${remote}" "${TO_PUSH}" 70 | #git push -q "${remote}" "${TO_PUSH}" 71 | echo "${pushed_text}" 72 | done 73 | 74 | #echo "Switching back to ${CURRENT_BRANCH}" 75 | git checkout -q "${CURRENT_BRANCH}" 76 | -------------------------------------------------------------------------------- /work/scripts/push.sh: -------------------------------------------------------------------------------- 1 | _script() 2 | { 3 | _script_commands=$(/home/gregkh/linux/work/push help) 4 | 5 | local cur prev 6 | COMPREPLY=() 7 | cur="${COMP_WORDS[COMP_CWORD]}" 8 | COMPREPLY=( $(compgen -W "${_script_commands}" -- ${cur}) ) 9 | 10 | return 0 11 | } 12 | complete -o nospace -F _script push 13 | -------------------------------------------------------------------------------- /work/scripts/verify_signedoff.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # SPDX-License-Identifier: GPL-2.0 3 | # 4 | # Copyright (C) 2019 Stephen Rothwell 5 | # Copyright (C) 2019 Greg Kroah-Hartman 6 | # 7 | # Verify that the signed-off-by chain looks correct for a range of git commits. 8 | # 9 | # usage: 10 | # verify_signedoff.sh GIT_RANGE 11 | # 12 | # To test just the HEAD commit do: 13 | # verify_signedoff.sh HEAD^..HEAD 14 | # 15 | # 16 | # Thanks to Stephen Rothwell for the majority of this code 17 | # 18 | 19 | help() 20 | { 21 | echo "error, git range not found" 22 | echo "usage:" 23 | echo " $0 GIT_RANGE" 24 | exit 1 25 | } 26 | 27 | verify_signedoff() 28 | { 29 | git_range=$1 30 | error=false 31 | for c in $(git rev-list --no-merges "${git_range}"); do 32 | ae=$(git log -1 --format='%ae' "$c") 33 | aE=$(git log -1 --format='%aE' "$c") 34 | an=$(git log -1 --format='%an' "$c") 35 | aN=$(git log -1 --format='%aN' "$c") 36 | ce=$(git log -1 --format='%ce' "$c") 37 | cE=$(git log -1 --format='%cE' "$c") 38 | cn=$(git log -1 --format='%cn' "$c") 39 | cN=$(git log -1 --format='%cN' "$c") 40 | sob=$(git log -1 --format='%b' "$c" | grep -i '^[[:space:]]*Signed-off-by:') 41 | 42 | am=false 43 | cm=false 44 | grep -i -q "<$ae>" <<<"$sob" || 45 | grep -i -q "<$aE>" <<<"$sob" || 46 | grep -i -q ":[[:space:]]*${an}[[:space:]]*<" <<<"$sob" || 47 | grep -i -q ":[[:space:]]*${aN}[[:space:]]*<" <<<"$sob" || 48 | am=true 49 | grep -i -q "<$ce>" <<<"$sob" || 50 | grep -i -q "<$cE>" <<<"$sob" || 51 | grep -i -q ":[[:space:]]*${cn}[[:space:]]*<" <<<"$sob" || 52 | grep -i -q ":[[:space:]]*${cN}[[:space:]]*<" <<<"$sob" || 53 | cm=true 54 | 55 | if "$am" || "$cm"; then 56 | printf "Commit %s\n" "$(git show -s --abbrev-commit --abbrev=12 --pretty=format:"%h (\"%s\")%n" "${c}")" 57 | "$am" && printf "\tauthor Signed-off-by missing\n" 58 | "$cm" && printf "\tcommitter Signed-off-by missing\n" 59 | printf "\tauthor email: %s\n" "$ae" 60 | printf "\tcommitter email: %s\n" "$ce" 61 | readarray -t s <<< "${sob}" 62 | printf "\t%s\n" "${s[@]}" 63 | printf "\n" 64 | error=true 65 | fi 66 | done 67 | if "$error"; then 68 | echo "Errors in tree with Signed-off-by, please fix!" 69 | exit 1 70 | fi 71 | } 72 | 73 | git_range=$1 74 | 75 | if [ "${git_range}" == "" ] ; then 76 | help 77 | fi 78 | 79 | verify_signedoff "${git_range}" 80 | exit 0 81 | -------------------------------------------------------------------------------- /work/scripts/work_sync: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # colors! 4 | txtund=$(tput sgr 0 1) # Underline 5 | txtbld=$(tput bold) # Bold 6 | txtred=$(tput setaf 1) # Red 7 | txtgrn=$(tput setaf 2) # Green 8 | txtylw=$(tput setaf 3) # Yellow 9 | txtblu=$(tput setaf 4) # Blue 10 | txtpur=$(tput setaf 5) # Purple 11 | txtcyn=$(tput setaf 6) # Cyan 12 | txtwht=$(tput setaf 7) # White 13 | txtrst=$(tput sgr0) # Text reset 14 | 15 | CURRENT_BRANCH=$(git symbolic-ref --short -q HEAD) 16 | 17 | PWD=$(pwd) 18 | TREE=$(basename "${PWD}") 19 | 20 | branches=("linus" "next" "testing") 21 | 22 | for branch in ${branches[@]}; do 23 | text="${txtcyn}Syncing${txtrst} ${txtgrn}${branch}${txtrst}" 24 | gum spin --title="${text}" --align=right --show-output -s minidot -- git checkout work-${branch} && git merge ${TREE}-${branch} 25 | echo "${txtcyn}Synced${txtrst} ${txtgrn}${branch}${txtrst}" 26 | done 27 | 28 | git checkout --quiet ${CURRENT_BRANCH} 29 | exit 30 | 31 | git checkout work-linus && git merge ${TREE}-linus 32 | git checkout work-next && git merge ${TREE}-next 33 | git checkout work-testing && git merge ${TREE}-testing 34 | 35 | exit 36 | 37 | --------------------------------------------------------------------------------