Commit 22e7ad32 authored by 张雪芹's avatar 张雪芹
Browse files

update oscourse shiyan1

parent 53a7df3f
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -2,10 +2,12 @@ obj-m += hello.o

SRC := $(shell pwd)

KERNEL_SRC := $(shell pwd)/../../../../../work-shared/qemuriscv64/kernel-source
all:
	make -C  $(KERNEL_SRC) ARCH=riscv M=$(SRC) modules
	$(MAKE) -C $(KERNEL_SRC) M=$(SRC)

modules_install:
	$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install

clean:
	make -C $(KERNEL_SRC) ARCH=riscv M=$(SRC) clean
	$(MAKE) -C $(KERNEL_SRC) M=$(SRC) clean
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
 
static int __init hello_init(void){
 
	printk(KERN_ALERT"hello kernel.\n");
	printk(KERN_ALERT"hello world!\n");
	return 0;
}
 
+4 −16
Original line number Diff line number Diff line
@@ -6,21 +6,9 @@ SRC_URI = "file://hello.c \

inherit module 

do_copy_files () {
  echo  $WORKDIR
  cp  -f ${WORKDIR}/hello.c ${WORKDIR}/hello-0.1/
  cp  -f ${WORKDIR}/Makefile ${WORKDIR}/hello-0.1/
}
addtask do_copy_files after do_configure before do_compile 
S = "${WORKDIR}"

do_compile() { 
  echo $WORKDIR
  make
}

do_install(  ){
  install -d ${D}/lib/modules/${KERNEL_VERSION}
  cd  ${WORKDIR}/hello-0.1/
  install -m 0644 hello.ko ${D}/lib/modules/${KERNEL_VERSION}
}
# The inherit of module.bbclass will automatically name module packages with
# "kernel-module-" prefix as required by the oe-core build environment.

RPROVIDES:${PN} += "kernel-module-hello"