📄 hello_mod.spec
字号:
%define base %(echo %{_prefix} | sed -e s,/usr.*$,,)%define pfx /opt/freescale/rootfs/%{_target_cpu}%define __os_install_post %{nil}Summary : Hello World module test packageName : hello_modVersion : 1.2Release : 1License : Public Domain, not copyrightedVendor : FreescalePackager : Stuart HughesGroup : Applications/TestSource : %{name}-%{version}.tar.gzBuildRoot : %{_tmppath}/%{name}Prefix : %{pfx}%Description%{summary}Notes:You need to have a built unpacked kernel source tree availablevia $RPM_BUILD_DIR/linux.We build spoofed, so gcc == the cross compilerYou can override: KERNELDIR, ARCH by passing these on the make command line%Prep%setup%Buildif [ ! -f $RPM_BUILD_DIR/linux/Makefile ]then cat <<TXTYou need a built unpacked kernel source tree in:$RPM_BUILD_DIR/linux/Makefileto build kernel modulesTXT exit 1fimake%Installrm -rf $RPM_BUILD_ROOTKVER="`perl -e '$/ = ""; $_ = <>; m,VERSION\s*=\s*(\d)\s*PATCHLEVEL\s*=\s*(\d+)\s*SUBLEVEL\s*=\s*(\d+)\s*EXTRAVERSION[ \t]*=[ \t]*(\S*),m; print "$1.$2.$3$4"' $RPM_BUILD_DIR/linux/Makefile`"mkdir -p $RPM_BUILD_ROOT/%{pfx}/%{base}/lib/modules/$KVER/misc/cp *.ko $RPM_BUILD_ROOT/%{pfx}/%{base}/lib/modules/$KVER/misc/%Cleanrm -rf $RPM_BUILD_ROOT%Files%defattr(-,root,root)%{pfx}/*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -