Compare commits
4 Commits
v3.36.37-3
...
v3.16.37-7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c7bb6a047 | ||
|
|
2d3bc3ed38 | ||
|
|
752e624285 | ||
|
|
2de20ac6fa |
72
Makefile
72
Makefile
@@ -9,43 +9,75 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
export SRCPKG = $(shell echo $(PWD)|sed 's/.*\///')
|
export SRCPKG = $(shell echo $(PWD)|sed 's/.*\///')
|
||||||
export DEPENDS = mkinitramfs
|
|
||||||
export ARCH = x86_64
|
export ARCH = x86_64
|
||||||
export URL = https://www.kernel.org/
|
export URL = https://www.kernel.org/
|
||||||
BRIEF = The Linux kernel
|
BRIEF = The Linux kernel
|
||||||
DESC = Linux is a clone of the operating system Unix, written from scratch \
|
DESC = Linux is a clone of the operating system Unix, written from scratch \
|
||||||
by Linus Torvalds with assistance from a loosely-knit team of hackers \
|
by Linus Torvalds with assistance from a loosely-knit team of hackers \
|
||||||
across the Net.
|
across the Net.
|
||||||
SNAPVER = 3
|
export SNAPVER = $(shell grep '^CONFIG_LOCALVERSION=' SNAP/config| \
|
||||||
|
sed 's/.*="\-\|"$$//g')
|
||||||
|
|
||||||
ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1)
|
ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1)
|
||||||
TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n')
|
TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n')
|
||||||
SRCDIR := $(shell tar -tf $(ARCHIVE)|head -1|sed 's/\/.*//')
|
SRCDIR := $(shell tar -tf $(ARCHIVE)|head -1|sed 's/\/.*//')
|
||||||
PATCHDIR := $(PWD)/SRC/patches
|
PATCHDIR := $(PWD)/SRC/patches
|
||||||
export KERNVER := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')
|
export KERNVER := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')
|
||||||
export VERSION := $(SNAPVER)
|
export VERSION := $(KERNVER)-$(SNAPVER)
|
||||||
|
export DEPENDS = mkinitramfs,linux-firmware
|
||||||
|
|
||||||
|
# This overrids the package file name in Makefile.snaplinux
|
||||||
|
# This is necessary due to the kernel version string being
|
||||||
|
# a part of the package name
|
||||||
|
|
||||||
|
PACKAGE = $(shell echo $(PWD)|sed 's/.*\///')-$(SNAPVER)
|
||||||
|
PKGFILE = $(PACKAGE).snap
|
||||||
|
|
||||||
|
LINUX-DOC := $(PWD)/linux-doc-$(KERNVER)
|
||||||
|
LINUX-DOC-ROOT := $(LINUX-DOC)/ROOT
|
||||||
LINUX-FIRMWARE := $(PWD)/linux-firmware
|
LINUX-FIRMWARE := $(PWD)/linux-firmware
|
||||||
LINUX-FIRMWARE-ROOT := $(LINUX-FIRMWARE)/ROOT
|
LINUX-FIRMWARE-ROOT := $(LINUX-FIRMWARE)/ROOT
|
||||||
LINUX-HEADERS := $(PWD)/linux-headers-$(KERNVER)
|
LINUX-HEADERS := $(PWD)/linux-headers-$(KERNVER)-$(SNAPVER)
|
||||||
LINUX-HEADERS-ROOT := $(LINUX-HEADERS)/ROOT
|
LINUX-HEADERS-ROOT := $(LINUX-HEADERS)/ROOT
|
||||||
|
|
||||||
include /usr/share/snap/Makefile.snaplinux
|
include /usr/share/snap/Makefile.snaplinux
|
||||||
|
|
||||||
|
$(LINUX-DOC-ROOT): $(LINUX-HEADERS-ROOT)
|
||||||
|
@install -v -d $(LINUX-DOC)/SNAP && \
|
||||||
|
install -v -d $(LINUX-DOC-ROOT) && \
|
||||||
|
install -d -m 755 \
|
||||||
|
$(LINUX-DOC-ROOT)/usr/share/doc/linux-$(KERNVER) && \
|
||||||
|
cp -r $(SRCDIR)/Documentation/* \
|
||||||
|
$(LINUX-DOC-ROOT)/usr/share/doc/linux-$(KERNVER) && \
|
||||||
|
find $(LINUX-DOC-ROOT) -name \*.txt -o -name \*.html \
|
||||||
|
-exec gzip {} \; && \
|
||||||
|
cd $(LINUX-DOC) && make -f ../Makefile.linux-doc && mv *.snap ../
|
||||||
|
|
||||||
$(LINUX-HEADERS-ROOT): $(LINUX-FIRMWARE-ROOT)
|
$(LINUX-HEADERS-ROOT): $(LINUX-FIRMWARE-ROOT)
|
||||||
@install -v -d $(LINUX-HEADERS)/SNAP && \
|
@HEADERS=$(LINUX-HEADERS-ROOT)/usr/src/linux-headers-$(VERSION) && \
|
||||||
|
install -v -d $(LINUX-HEADERS)/SNAP && \
|
||||||
install -v -d $(LINUX-HEADERS-ROOT) && \
|
install -v -d $(LINUX-HEADERS-ROOT) && \
|
||||||
|
install -v -d -m 755 $$HEADERS && \
|
||||||
|
install -v -d -m 755 $$HEADERS/arch/x86/kernel && \
|
||||||
|
install -v -d -m 755 $$HEADERS/arch/x86/include && \
|
||||||
|
install -v -d -m 755 $(LINUX-HEADERS-ROOT)/lib/modules/$(VERSION) && \
|
||||||
|
ln -sf /usr/src/linux-headers-$(VERSION) \
|
||||||
|
$(LINUX-HEADERS-ROOT)/lib/modules/$(VERSION)/build && \
|
||||||
cd $(SRCDIR) && make headers_install \
|
cd $(SRCDIR) && make headers_install \
|
||||||
INSTALL_HDR_PATH=$(LINUX-HEADERS-ROOT)/usr && \
|
INSTALL_HDR_PATH=$(LINUX-HEADERS-ROOT)/usr && \
|
||||||
cd $(LINUX-HEADERS) && make -f \
|
cp -vrp {include,Makefile,Module.symvers,scripts} $$HEADERS && \
|
||||||
../Makefile.linux-headers-$(KERNVER) && \
|
cp -vrp arch/x86/include/uapi $$HEADERS/arch/x86/include/uapi && \
|
||||||
|
cp -vp arch/x86/Makefile $$HEADERS/arch/x86/Makefile && \
|
||||||
|
cp -vp arch/x86/kernel/asm-offsets.s \
|
||||||
|
$$HEADERS/arch/x86/kernel/asm-offsets.s && \
|
||||||
|
cd $(LINUX-HEADERS) && make -f ../Makefile.linux-headers && \
|
||||||
mv *.snap ../
|
mv *.snap ../
|
||||||
|
|
||||||
$(LINUX-FIRMWARE-ROOT): $(SRCDIR)/arch/x86_64/boot/bzImage
|
$(LINUX-FIRMWARE-ROOT): $(SRCDIR)/arch/x86_64/boot/bzImage
|
||||||
@install -v -d $(LINUX-FIRMWARE)/SNAP && \
|
@install -v -d $(LINUX-FIRMWARE)/SNAP && \
|
||||||
install -v -d $(LINUX-FIRMWARE-ROOT) && \
|
install -v -d $(LINUX-FIRMWARE-ROOT)/lib/firmware && \
|
||||||
cd $(SRCDIR) && make firmware_install \
|
cd $(SRCDIR) && make firmware_install \
|
||||||
INSTALL_FW_PATH=$(LINUX-FIRMWARE-ROOT) && \
|
INSTALL_FW_PATH=$(LINUX-FIRMWARE-ROOT)/lib/firmware && \
|
||||||
cd $(LINUX-FIRMWARE) && make -f \
|
cd $(LINUX-FIRMWARE) && make -f \
|
||||||
../Makefile.linux-firmware && mv *.snap ../
|
../Makefile.linux-firmware && mv *.snap ../
|
||||||
|
|
||||||
@@ -65,13 +97,10 @@ $(SRCDIR)/Makefile: $(ARCHIVE)
|
|||||||
@touch $(SRCDIR)/Makefile
|
@touch $(SRCDIR)/Makefile
|
||||||
|
|
||||||
$(SRCDIR)/arch/x86_64/boot/bzImage: $(SRCDIR)/Makefile
|
$(SRCDIR)/arch/x86_64/boot/bzImage: $(SRCDIR)/Makefile
|
||||||
@cd $(SRCDIR); \
|
@cd $(SRCDIR) && make mrproper && \
|
||||||
make mrproper
|
cp $(PWD)/SNAP/config .config && make
|
||||||
@cp SNAP/config-$(KERNVER)-$(VERSION) $(SRCDIR)/.config
|
|
||||||
@cd $(SRCDIR); \
|
|
||||||
make
|
|
||||||
|
|
||||||
$(ROOT): $(LINUX-HEADERS-ROOT)
|
$(ROOT): $(LINUX-DOC-ROOT)
|
||||||
@if [ -d $(ROOT) ]; then \
|
@if [ -d $(ROOT) ]; then \
|
||||||
touch $(ROOT); \
|
touch $(ROOT); \
|
||||||
else \
|
else \
|
||||||
@@ -80,17 +109,17 @@ $(ROOT): $(LINUX-HEADERS-ROOT)
|
|||||||
|
|
||||||
@cd $(SRCDIR); \
|
@cd $(SRCDIR); \
|
||||||
make modules_install INSTALL_MOD_PATH=$(ROOT) && \
|
make modules_install INSTALL_MOD_PATH=$(ROOT) && \
|
||||||
|
rm $(ROOT)/lib/modules/$(VERSION)/{build,source} && \
|
||||||
rm -rf $(ROOT)/lib/firmware && \
|
rm -rf $(ROOT)/lib/firmware && \
|
||||||
install -d -m 755 $(ROOT)/boot && \
|
install -d -m 755 $(ROOT)/boot && \
|
||||||
install -d -m 755 $(ROOT)/etc/modprobe.d && \
|
install -d -m 755 $(ROOT)/etc/modprobe.d && \
|
||||||
install -d -m 755 $(ROOT)/usr/share/doc/linux-$(KERNVER)-$(VERSION) && \
|
install -d -m 755 $(ROOT)/usr/share/linux-$(VERSION) && \
|
||||||
install -m 644 .config $(ROOT)/boot/config-$(KERNVER)-$(VERSION) && \
|
install -m 644 .config $(ROOT)/boot/config-$(VERSION) && \
|
||||||
install -m 644 System.map \
|
install -m 644 System.map \
|
||||||
$(ROOT)/boot/System.map-$(KERNVER)-$(VERSION) && \
|
$(ROOT)/boot/System.map-$(VERSION) && \
|
||||||
install -m 644 arch/x86_64/boot/bzImage \
|
install -m 644 arch/x86_64/boot/bzImage \
|
||||||
$(ROOT)/boot/vmlinuz-$(KERNVER)-$(VERSION) && \
|
$(ROOT)/boot/vmlinuz-$(VERSION) && \
|
||||||
install -m 644 ../SNAP/usb.conf $(ROOT)/etc/modprobe.d/usb.conf && \
|
install -m 644 ../SNAP/usb.conf $(ROOT)/usr/share/linux-$(VERSION)
|
||||||
cp -r Documentation/* $(ROOT)/usr/share/doc/linux-$(KERNVER)-$(VERSION)
|
|
||||||
|
|
||||||
test: $(ROOT)
|
test: $(ROOT)
|
||||||
@cd $(SRCDIR); \
|
@cd $(SRCDIR); \
|
||||||
@@ -98,6 +127,7 @@ test: $(ROOT)
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -rvf $(ROOT) \
|
@rm -rvf $(ROOT) \
|
||||||
|
$(LINUX-DOC) \
|
||||||
$(LINUX-FIRMWARE) \
|
$(LINUX-FIRMWARE) \
|
||||||
$(LINUX-HEADERS) \
|
$(LINUX-HEADERS) \
|
||||||
$(SNAPINFO) \
|
$(SNAPINFO) \
|
||||||
|
|||||||
17
Makefile.linux-doc
Normal file
17
Makefile.linux-doc
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# This file is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License version 2 as
|
||||||
|
# published by the Free Software Foundation here:
|
||||||
|
# (http://www.gnu.org/licenses/gpl-2.0.html)
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
DEPENDS =
|
||||||
|
BRIEF = Documentation for The Linux kernel
|
||||||
|
DESC = Detailed documentation describing the Linux kernel
|
||||||
|
PACKAGE = $(shell echo $(PWD)|sed 's/.*\///')
|
||||||
|
PKGFILE = $(PACKAGE)-$(SNAPVER).snap
|
||||||
|
|
||||||
|
include /usr/share/snap/Makefile.snaplinux
|
||||||
@@ -11,7 +11,5 @@
|
|||||||
DEPENDS =
|
DEPENDS =
|
||||||
BRIEF = Firmware for the Linux kernel
|
BRIEF = Firmware for the Linux kernel
|
||||||
DESC = This provides the firmware necessary for some Linux kernel modules
|
DESC = This provides the firmware necessary for some Linux kernel modules
|
||||||
SNAPVER = 0
|
|
||||||
VERSION = $(KERNVER)-$(SNAPVER)
|
|
||||||
|
|
||||||
include /usr/share/snap/Makefile.snaplinux
|
include /usr/share/snap/Makefile.snaplinux
|
||||||
|
|||||||
@@ -8,8 +8,11 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
DEPENDS =
|
||||||
BRIEF = Header files for The Linux kernel
|
BRIEF = Header files for The Linux kernel
|
||||||
DESC = This provides the header files that are generally used to compile \
|
DESC = This provides the header files that are generally used to compile \
|
||||||
kernel modules
|
kernel modules
|
||||||
|
PACKAGE = $(shell echo $(PWD)|sed 's/.*\///')
|
||||||
|
PKGFILE = $(PACKAGE).snap
|
||||||
|
|
||||||
include /usr/share/snap/Makefile.snaplinux
|
include /usr/share/snap/Makefile.snaplinux
|
||||||
@@ -50,7 +50,7 @@ CONFIG_BUILDTIME_EXTABLE_SORT=y
|
|||||||
CONFIG_INIT_ENV_ARG_LIMIT=32
|
CONFIG_INIT_ENV_ARG_LIMIT=32
|
||||||
CONFIG_CROSS_COMPILE=""
|
CONFIG_CROSS_COMPILE=""
|
||||||
# CONFIG_COMPILE_TEST is not set
|
# CONFIG_COMPILE_TEST is not set
|
||||||
CONFIG_LOCALVERSION="-3"
|
CONFIG_LOCALVERSION="-7"
|
||||||
# CONFIG_LOCALVERSION_AUTO is not set
|
# CONFIG_LOCALVERSION_AUTO is not set
|
||||||
CONFIG_HAVE_KERNEL_GZIP=y
|
CONFIG_HAVE_KERNEL_GZIP=y
|
||||||
CONFIG_HAVE_KERNEL_BZIP2=y
|
CONFIG_HAVE_KERNEL_BZIP2=y
|
||||||
39
SNAP/usher
39
SNAP/usher
@@ -7,39 +7,22 @@ case $1 in
|
|||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
postinst)
|
postinst)
|
||||||
KERNEL_VER=`ls -C1rt ${TARGET}/boot/vmlinuz*|sed 's/.*vmlinuz-//'`
|
|
||||||
|
|
||||||
if [[ ${TARGET} ]]; then
|
if [[ ${TARGET} ]]; then
|
||||||
echo "Running within ${TARGET} for kernel $KERNEL_VER"
|
echo "Running within ${TARGET} for kernel ${VERSION}"
|
||||||
|
|
||||||
if ! mountpoint -q ${TARGET}/dev; then
|
chroot ${TARGET} mkinitramfs ${VERSION}
|
||||||
mount -t devtmpfs none ${TARGET}/dev
|
chroot ${TARGET} grub-mkconfig -o /boot/grub/grub.cfg
|
||||||
fi
|
|
||||||
if ! mountpoint -q ${TARGET}/proc; then
|
|
||||||
mount -t proc none ${TARGET}/proc
|
|
||||||
fi
|
|
||||||
if ! mountpoint -q ${TARGET}/sys; then
|
|
||||||
mount -t sysfs none ${TARGET}/sys
|
|
||||||
fi
|
|
||||||
|
|
||||||
chroot ${TARGET} /bin/bash -c "/sbin/mkinitramfs $KERNEL_VER"
|
|
||||||
chroot ${TARGET} /bin/bash -c \
|
|
||||||
"/sbin/grub-mkconfig -o /boot/grub/grub.cfg"
|
|
||||||
|
|
||||||
if mountpoint -q ${TARGET}/dev; then
|
|
||||||
umount ${TARGET}/dev
|
|
||||||
fi
|
|
||||||
if mountpoint -q ${TARGET}/proc; then
|
|
||||||
umount ${TARGET}/proc
|
|
||||||
fi
|
|
||||||
if mountpoint -q ${TARGET}/sys; then
|
|
||||||
umount ${TARGET}/sys
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "Running for kernel $KERNEL_VER"
|
echo "Running for kernel ${VERSION}"
|
||||||
mkinitramfs $KERNEL_VER
|
|
||||||
|
mkinitramfs ${VERSION}
|
||||||
grub-mkconfig -o /boot/grub/grub.cfg
|
grub-mkconfig -o /boot/grub/grub.cfg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -f ${TARGET}/etc/modprobe.d/usb.conf ]; then
|
||||||
|
cp ${TARGET}/usr/share/linux-${VERSION}/usb.conf \
|
||||||
|
${TARGET}/etc/modprobe.d/usb.conf
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
prerm)
|
prerm)
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user