3 Commits

Author SHA1 Message Date
Jay Larson
3150e81315 The following changes were made:
* Added SHELL = /bin/bash to Makefile
  * Added REPO (core)
  * Added grub as dependency
  * Added bc and gcc as BUILDDEPS
  * Removed modules.dep from package
  * Added Module.symvers to package
2018-03-22 11:01:02 -05:00
Jay Larson
9c94dc2f94 The following changes were made:
* Split off libc files into separate package (linux-libc)
  * Corrected issue with missing files in linux-headers
2017-06-11 17:00:57 -05:00
Jay Larson
4c7bb6a047 The following changes were made:
* Added dependency for linux-firmware to kernel package
  * Re-built with updated Makefile.snaplinux to correct package name/version
  * Other various tweaks to correct package names and versions
  * etc/modprobe.d/usb.conf now managed by usher
  * Makefile will now use LOCALVERSION from config for the build version
2017-06-02 11:34:52 -05:00
7 changed files with 78 additions and 28 deletions

View File

@@ -8,15 +8,18 @@
# 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.
SHELL = /bin/bash
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/
REPO = core
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.
export SNAPVER = 6 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')
@@ -24,19 +27,24 @@ 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 := $(KERNVER)-$(SNAPVER) export VERSION := $(KERNVER)-$(SNAPVER)
export DEPENDS = grub,mkinitramfs,linux-firmware
export BUILDDEPS = bc,gcc
# This overrids the package file name in Makefile.snaplinux # This overrids the package file name in Makefile.snaplinux
# This is necessary due to the kernel version string being # This is necessary due to the kernel version string being
# a part of the package name # a part of the package name
SNAP = $(PACKAGE)-$(SNAPVER).snap PACKAGE = $(shell echo $(PWD)|sed 's/.*\///')-$(SNAPVER)
PKGFILE = $(PACKAGE).snap
LINUX-DOC := $(PWD)/linux-doc-$(KERNVER) LINUX-DOC := $(PWD)/linux-doc-$(KERNVER)
LINUX-DOC-ROOT := $(LINUX-DOC)/ROOT LINUX-DOC-ROOT := $(LINUX-DOC)/ROOT
LINUX-FIRMWARE := $(PWD)/linux-firmware-$(KERNVER) 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
LINUX-LIBC := $(PWD)/linux-libc
LINUX-LIBC-ROOT := $(LINUX-LIBC)/ROOT
include /usr/share/snap/Makefile.snaplinux include /usr/share/snap/Makefile.snaplinux
@@ -44,24 +52,41 @@ $(LINUX-DOC-ROOT): $(LINUX-HEADERS-ROOT)
@install -v -d $(LINUX-DOC)/SNAP && \ @install -v -d $(LINUX-DOC)/SNAP && \
install -v -d $(LINUX-DOC-ROOT) && \ install -v -d $(LINUX-DOC-ROOT) && \
install -d -m 755 \ install -d -m 755 \
$(LINUX-DOC-ROOT)/usr/share/doc/linux-$(VERSION) && \ $(LINUX-DOC-ROOT)/usr/share/doc/linux-$(KERNVER) && \
cp -r $(SRCDIR)/Documentation/* \ cp -r $(SRCDIR)/Documentation/* \
$(LINUX-DOC-ROOT)/usr/share/doc/linux-$(VERSION) && \ $(LINUX-DOC-ROOT)/usr/share/doc/linux-$(KERNVER) && \
find $(LINUX-DOC-ROOT) -name \*.txt -o -name \*.html \ find $(LINUX-DOC-ROOT) -name \*.txt -o -name \*.html \
-exec gzip {} \; && \ -exec gzip {} \; && \
cd $(LINUX-DOC) && make -f ../Makefile.linux-doc && mv *.snap ../ cd $(LINUX-DOC) && make -f ../Makefile.linux-doc && mv *.snap ../
$(LINUX-HEADERS-ROOT): $(LINUX-FIRMWARE-ROOT) $(LINUX-HEADERS-ROOT): $(LINUX-LIBC-ROOT)
@HDR=$(LINUX-HEADERS-ROOT)/usr/src/linux-headers-$(VERSION) && \ @HEADERS=$(LINUX-HEADERS-ROOT)/usr/src/linux-headers-$(VERSION) && \
install -v -d $(LINUX-HEADERS)/SNAP && \ 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) && \ install -v -d -m 755 $(LINUX-HEADERS-ROOT)/lib/modules/$(VERSION) && \
ln -sf /usr/src/linux-headers-$(VERSION) \ ln -sf /usr/src/linux-headers-$(VERSION) \
$(LINUX-HEADERS-ROOT)/lib/modules/$(VERSION)/source && \ $(LINUX-HEADERS-ROOT)/lib/modules/$(VERSION)/build && \
cd $(SRCDIR) && make headers_install INSTALL_HDR_PATH=$$HDR && \ cd $(SRCDIR) && find {include,arch/x86*} \( -name \*.h -o \
-name Kbuild -o -name Makefile -o -name \*.conf \) \
-exec cp --parents {} $$HEADERS \; && \
find scripts/ -type f -exec cp --parents {} $$HEADERS \; && \
cp {.config,Makefile,Module.symvers} $$HEADERS && \
cp -vp arch/x86/kernel/asm-offsets.s \
$$HEADERS/arch/x86/kernel/asm-offsets.s && \
cd $(LINUX-HEADERS) && make -f ../Makefile.linux-headers && \ cd $(LINUX-HEADERS) && make -f ../Makefile.linux-headers && \
mv *.snap ../ mv *.snap ../
$(LINUX-LIBC-ROOT): $(LINUX-FIRMWARE-ROOT)
install -v -d $(LINUX-LIBC)/SNAP && \
install -v -d $(LINUX-LIBC-ROOT) && \
install -v -d -m 755 $(LINUX-LIBC-ROOT)/usr && \
cd $(SRCDIR) && make headers_install \
INSTALL_HDR_PATH=$(LINUX-LIBC-ROOT)/usr && \
cd $(LINUX-LIBC) && make -f ../Makefile.linux-libc && 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)/lib/firmware && \ install -v -d $(LINUX-FIRMWARE-ROOT)/lib/firmware && \
@@ -87,7 +112,7 @@ $(SRCDIR)/Makefile: $(ARCHIVE)
$(SRCDIR)/arch/x86_64/boot/bzImage: $(SRCDIR)/Makefile $(SRCDIR)/arch/x86_64/boot/bzImage: $(SRCDIR)/Makefile
@cd $(SRCDIR) && make mrproper && \ @cd $(SRCDIR) && make mrproper && \
cp $(PWD)/SNAP/config .config && make cp $(PWD)/SNAP/config .config && CONFIG_MODVERSIONS=1 make
$(ROOT): $(LINUX-DOC-ROOT) $(ROOT): $(LINUX-DOC-ROOT)
@if [ -d $(ROOT) ]; then \ @if [ -d $(ROOT) ]; then \
@@ -98,16 +123,18 @@ $(ROOT): $(LINUX-DOC-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 $(ROOT)/lib/modules/$(VERSION)/{build,source,modules.dep*} && \
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/linux-$(VERSION) && \
install -m 644 .config $(ROOT)/boot/config-$(VERSION) && \ install -m 644 .config $(ROOT)/boot/config-$(VERSION) && \
install -m 644 System.map \ install -m 644 System.map \
$(ROOT)/boot/System.map-$(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-$(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) && \
install -m 644 Module.symvers $(ROOT)/lib/modules/$(VERSION)
test: $(ROOT) test: $(ROOT)
@cd $(SRCDIR); \ @cd $(SRCDIR); \
@@ -117,6 +144,7 @@ clean:
@rm -rvf $(ROOT) \ @rm -rvf $(ROOT) \
$(LINUX-DOC) \ $(LINUX-DOC) \
$(LINUX-FIRMWARE) \ $(LINUX-FIRMWARE) \
$(LINUX-LIBC) \
$(LINUX-HEADERS) \ $(LINUX-HEADERS) \
$(SNAPINFO) \ $(SNAPINFO) \
$(MANIFEST) \ $(MANIFEST) \

View File

@@ -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 =
REPO = main
BRIEF = Documentation for The Linux kernel BRIEF = Documentation for The Linux kernel
DESC = Detailed documentation describing the Linux kernel DESC = Detailed documentation describing the Linux kernel
SNAP = $(PACKAGE)-$(SNAPVER).snap PACKAGE = $(shell echo $(PWD)|sed 's/.*\///')
PKGFILE = $(PACKAGE)-$(SNAPVER).snap
include /usr/share/snap/Makefile.snaplinux include /usr/share/snap/Makefile.snaplinux

View File

@@ -9,9 +9,8 @@
# GNU General Public License for more details. # GNU General Public License for more details.
DEPENDS = DEPENDS =
REPO = main
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
VERSION = $(KERNVER)-$(SNAPVER)
SNAP = $(PACKAGE)-$(SNAPVER).snap
include /usr/share/snap/Makefile.snaplinux include /usr/share/snap/Makefile.snaplinux

View File

@@ -8,9 +8,12 @@
# 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 = linux-libc
REPO = dev
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
SNAP = $(PACKAGE)-$(SNAPVER).snap PACKAGE = $(shell echo $(PWD)|sed 's/.*\///')
PKGFILE = $(PACKAGE).snap
include /usr/share/snap/Makefile.snaplinux include /usr/share/snap/Makefile.snaplinux

16
Makefile.linux-libc Normal file
View File

@@ -0,0 +1,16 @@
# 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 =
REPO = dev
BRIEF = Userspace linux header files
DESC = This provides the header files necessary for compiling user space applications for Linux
include /usr/share/snap/Makefile.snaplinux

View File

@@ -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="-6" CONFIG_LOCALVERSION="-9"
# 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

View File

@@ -7,22 +7,23 @@ case $1 in
exit 0 exit 0
;; ;;
postinst) postinst)
if [[ ${TARGET} ]]; then
echo "Running within ${TARGET} for kernel ${VERSION}"
chroot ${TARGET} mkinitramfs ${VERSION}
chroot ${TARGET} grub-mkconfig -o /boot/grub/grub.cfg
else
echo "Running for kernel ${VERSION}" echo "Running for kernel ${VERSION}"
mkinitramfs ${VERSION} mkinitramfs ${VERSION}
grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig -o /boot/grub/grub.cfg
if [ ! -f /etc/modprobe.d/usb.conf ]; then
cp /usr/share/linux-${VERSION}/usb.conf /etc/modprobe.d/usb.conf
fi fi
;; ;;
prerm) prerm)
exit 0 exit 0
;; ;;
postrm) postrm)
exit 0 if [ -f /boot/initrd.img-${VERSION} ]; then
rm /boot/initrd.img-${VERSION}
fi
grub-mkconfig -o /boot/grub/grub.cfg
;; ;;
esac esac