1#! /bin/sh 2 3. $srcdir/strip-reloc-subr.sh 4 5testfiles hello_i386.ko hello_x86_64.ko hello_ppc64.ko hello_s390.ko \ 6 hello_aarch64.ko hello_m68k.ko hello_riscv64.ko hello_csky.ko \ 7 hello_arc_hs4.ko 8 9# Most simple hello world kernel module for various architectures. 10# Make sure that it contains debuginfo with CONFIG_DEBUG_INFO=y. 11# :::::::::::::: 12# Makefile 13# :::::::::::::: 14# obj-m := hello.o 15# hello-y := init.o exit.o 16# 17# all: 18# make -C /lib/modules/$(shell uname -r)/build M=$(PWD) \ 19# CONFIG_DEBUG_INFO=y modules 20# :::::::::::::: 21# init.c 22# :::::::::::::: 23# #include <linux/kernel.h> 24# #include <linux/module.h> 25# 26# int init_module(void) 27# { 28# printk(KERN_INFO "Hello, world!\n"); 29# return 0; 30# } 31# :::::::::::::: 32# exit.c 33# :::::::::::::: 34# #include <linux/kernel.h> 35# #include <linux/module.h> 36# 37# void cleanup_module() 38# { 39# printk(KERN_INFO "Goodbye, World!\n"); 40# } 41runtest hello_i386.ko 1 42runtest hello_x86_64.ko 1 43runtest hello_ppc64.ko 1 44runtest hello_s390.ko 1 45runtest hello_aarch64.ko 1 46runtest hello_m68k.ko 1 47runtest hello_riscv64.ko 1 48runtest hello_csky.ko 1 49runtest hello_arc_hs4.ko 1 50 51exit $runtest_status 52