From 05f05e3911a5399697255d609c80b65e1b930940 Mon Sep 17 00:00:00 2001 From: David P Date: Thu, 16 Jan 2020 16:09:36 -0300 Subject: updpkg: libre-testing/linux-libre-veyron 4.19.94-1 Signed-off-by: David P --- ...RM-atags-add-support-for-Marvell-s-u-boot.patch | 51 + ...ctl-and-CONFIG-to-disallow-unprivileged-C.patch | 132 + ...gadget-no-TTY-hangup-on-USB-disconnect-WI.patch | 39 + ...dt-retrieve-MAC-addresses-from-Marvell-bo.patch | 47 + .../0003-SMILE-Plug-device-tree-file.patch | 209 + .../0004-fix-mvsdio-eMMC-timing.patch | 38 + ...x-Allow-mac-address-to-be-set-as-a-parame.patch | 95 + .../0006-set-default-cubietruck-led-triggers.patch | 33 + ...odroid-set-higher-minimum-buck2-regulator.patch | 30 + .../0008-ARM-dove-enable-ethernet-on-D3Plug.patch | 31 + libre-testing/linux-libre-veyron/60-linux.hook | 12 - libre-testing/linux-libre-veyron/90-linux.hook | 11 - libre-testing/linux-libre-veyron/ChangeLog | 115 - libre-testing/linux-libre-veyron/PKGBUILD | 296 +- libre-testing/linux-libre-veyron/config | 7543 +++++++++++++++----- libre-testing/linux-libre-veyron/config-c201-v7 | 4892 ------------- .../linux-libre-veyron/config-disable-otg.patch | 14 - libre-testing/linux-libre-veyron/kernel.its | 196 +- .../linux-libre-veyron/linux-4.19.8_lzip-0.patch | 1974 ----- .../linux-libre-veyron/linux-libre-veyron.install | 26 + libre-testing/linux-libre-veyron/linux.install | 38 - libre-testing/linux-libre-veyron/linux.preset | 8 +- 22 files changed, 6823 insertions(+), 9007 deletions(-) create mode 100644 libre-testing/linux-libre-veyron/0001-ARM-atags-add-support-for-Marvell-s-u-boot.patch create mode 100644 libre-testing/linux-libre-veyron/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch create mode 100644 libre-testing/linux-libre-veyron/0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch create mode 100644 libre-testing/linux-libre-veyron/0002-ARM-atags-fdt-retrieve-MAC-addresses-from-Marvell-bo.patch create mode 100644 libre-testing/linux-libre-veyron/0003-SMILE-Plug-device-tree-file.patch create mode 100644 libre-testing/linux-libre-veyron/0004-fix-mvsdio-eMMC-timing.patch create mode 100644 libre-testing/linux-libre-veyron/0005-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch create mode 100644 libre-testing/linux-libre-veyron/0006-set-default-cubietruck-led-triggers.patch create mode 100644 libre-testing/linux-libre-veyron/0007-exynos4412-odroid-set-higher-minimum-buck2-regulator.patch create mode 100644 libre-testing/linux-libre-veyron/0008-ARM-dove-enable-ethernet-on-D3Plug.patch delete mode 100644 libre-testing/linux-libre-veyron/60-linux.hook delete mode 100644 libre-testing/linux-libre-veyron/90-linux.hook delete mode 100644 libre-testing/linux-libre-veyron/ChangeLog delete mode 100644 libre-testing/linux-libre-veyron/config-c201-v7 delete mode 100644 libre-testing/linux-libre-veyron/config-disable-otg.patch delete mode 100644 libre-testing/linux-libre-veyron/linux-4.19.8_lzip-0.patch create mode 100644 libre-testing/linux-libre-veyron/linux-libre-veyron.install delete mode 100644 libre-testing/linux-libre-veyron/linux.install (limited to 'libre-testing') diff --git a/libre-testing/linux-libre-veyron/0001-ARM-atags-add-support-for-Marvell-s-u-boot.patch b/libre-testing/linux-libre-veyron/0001-ARM-atags-add-support-for-Marvell-s-u-boot.patch new file mode 100644 index 000000000..35b77d3ec --- /dev/null +++ b/libre-testing/linux-libre-veyron/0001-ARM-atags-add-support-for-Marvell-s-u-boot.patch @@ -0,0 +1,51 @@ +From 311f37a47e903b459dabc396494ac1621fb2d78b Mon Sep 17 00:00:00 2001 +From: Willy Tarreau +Date: Sun, 2 Dec 2012 19:59:28 +0100 +Subject: [PATCH 1/9] ARM: atags: add support for Marvell's u-boot + +Marvell uses a specific atag in its u-boot which includes among other +information the MAC addresses for up to 4 network interfaces. + +Signed-off-by: Willy Tarreau +--- + arch/arm/include/uapi/asm/setup.h | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/arch/arm/include/uapi/asm/setup.h b/arch/arm/include/uapi/asm/setup.h +index 6b335a9ff8c8..614150b53643 100644 +--- a/arch/arm/include/uapi/asm/setup.h ++++ b/arch/arm/include/uapi/asm/setup.h +@@ -144,6 +144,18 @@ struct tag_memclk { + __u32 fmemclk; + }; + ++/* Marvell uboot parameters */ ++#define ATAG_MV_UBOOT 0x41000403 ++struct tag_mv_uboot { ++ __u32 uboot_version; ++ __u32 tclk; ++ __u32 sysclk; ++ __u32 isUsbHost; ++ __u8 macAddr[4][6]; ++ __u16 mtu[4]; ++ __u32 nand_ecc; ++}; ++ + struct tag { + struct tag_header hdr; + union { +@@ -166,6 +178,11 @@ struct tag { + * DC21285 specific + */ + struct tag_memclk memclk; ++ ++ /* ++ * Marvell specific ++ */ ++ struct tag_mv_uboot mv_uboot; + } u; + }; + +-- +2.19.0 + diff --git a/libre-testing/linux-libre-veyron/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch b/libre-testing/linux-libre-veyron/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch new file mode 100644 index 000000000..f93022e50 --- /dev/null +++ b/libre-testing/linux-libre-veyron/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch @@ -0,0 +1,132 @@ +From 6136ffb3d88e9f044260f8288d2d0a1edd64379e Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" +Date: Mon, 16 Sep 2019 04:53:20 +0200 +Subject: [PATCH] ZEN: Add sysctl and CONFIG to disallow unprivileged + CLONE_NEWUSER + +Our default behavior continues to match the vanilla kernel. +--- + init/Kconfig | 16 ++++++++++++++++ + kernel/fork.c | 15 +++++++++++++++ + kernel/sysctl.c | 12 ++++++++++++ + kernel/user_namespace.c | 7 +++++++ + 4 files changed, 50 insertions(+) + +diff --git a/init/Kconfig b/init/Kconfig +index bd7d650d4a99..658f9c052151 100644 +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1091,6 +1091,22 @@ config USER_NS + + If unsure, say N. + ++config USER_NS_UNPRIVILEGED ++ bool "Allow unprivileged users to create namespaces" ++ default y ++ depends on USER_NS ++ help ++ When disabled, unprivileged users will not be able to create ++ new namespaces. Allowing users to create their own namespaces ++ has been part of several recent local privilege escalation ++ exploits, so if you need user namespaces but are ++ paranoid^Wsecurity-conscious you want to disable this. ++ ++ This setting can be overridden at runtime via the ++ kernel.unprivileged_userns_clone sysctl. ++ ++ If unsure, say Y. ++ + config PID_NS + bool "PID Namespaces" + default y +diff --git a/kernel/fork.c b/kernel/fork.c +index 541fd805fb88..ffd57c812153 100644 +--- a/kernel/fork.c ++++ b/kernel/fork.c +@@ -106,6 +106,11 @@ + + #define CREATE_TRACE_POINTS + #include ++#ifdef CONFIG_USER_NS ++extern int unprivileged_userns_clone; ++#else ++#define unprivileged_userns_clone 0 ++#endif + + /* + * Minimum number of threads to boot the kernel +@@ -1788,6 +1793,10 @@ static __latent_entropy struct task_struct *copy_process( + if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS)) + return ERR_PTR(-EINVAL); + ++ if ((clone_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) ++ if (!capable(CAP_SYS_ADMIN)) ++ return ERR_PTR(-EPERM); ++ + /* + * Thread groups must share signals as well, and detached threads + * can only be started up within the thread group. +@@ -2819,6 +2828,12 @@ int ksys_unshare(unsigned long unshare_flags) + if (unshare_flags & CLONE_NEWNS) + unshare_flags |= CLONE_FS; + ++ if ((unshare_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) { ++ err = -EPERM; ++ if (!capable(CAP_SYS_ADMIN)) ++ goto bad_unshare_out; ++ } ++ + err = check_unshare_flags(unshare_flags); + if (err) + goto bad_unshare_out; +diff --git a/kernel/sysctl.c b/kernel/sysctl.c +index 078950d9605b..baead3605bbe 100644 +--- a/kernel/sysctl.c ++++ b/kernel/sysctl.c +@@ -110,6 +110,9 @@ extern int core_uses_pid; + extern char core_pattern[]; + extern unsigned int core_pipe_limit; + #endif ++#ifdef CONFIG_USER_NS ++extern int unprivileged_userns_clone; ++#endif + extern int pid_max; + extern int pid_max_min, pid_max_max; + extern int percpu_pagelist_fraction; +@@ -545,6 +548,15 @@ static struct ctl_table kern_table[] = { + .proc_handler = proc_dointvec, + }, + #endif ++#ifdef CONFIG_USER_NS ++ { ++ .procname = "unprivileged_userns_clone", ++ .data = &unprivileged_userns_clone, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, ++#endif + #ifdef CONFIG_PROC_SYSCTL + { + .procname = "tainted", +diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c +index 8eadadc478f9..c36ecd19562c 100644 +--- a/kernel/user_namespace.c ++++ b/kernel/user_namespace.c +@@ -21,6 +21,13 @@ + #include + #include + ++/* sysctl */ ++#ifdef CONFIG_USER_NS_UNPRIVILEGED ++int unprivileged_userns_clone = 1; ++#else ++int unprivileged_userns_clone; ++#endif ++ + static struct kmem_cache *user_ns_cachep __read_mostly; + static DEFINE_MUTEX(userns_state_mutex); + +-- +2.23.0 + diff --git a/libre-testing/linux-libre-veyron/0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch b/libre-testing/linux-libre-veyron/0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch new file mode 100644 index 000000000..e9de435fd --- /dev/null +++ b/libre-testing/linux-libre-veyron/0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch @@ -0,0 +1,39 @@ +From 716120e8010a7f400c6bed7384000e95e1465c94 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= +Date: Mon, 26 Aug 2013 19:19:44 +0300 +Subject: [PATCH 1/2] usb serial gadget: no TTY hangup on USB disconnect [WIP] +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +We may want to maintain the TTY over USB disconnects. + +This is useful when we have a terminal console to a host which +power-cycles or for other reasons resets the USB host controller. + +Signed-off-by: Kyösti Mälkki +--- + drivers/usb/gadget/function/u_serial.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c +index b369292..d156a28 100644 +--- a/drivers/usb/gadget/function/u_serial.c ++++ b/drivers/usb/gadget/function/u_serial.c +@@ -1258,8 +1258,13 @@ void gserial_disconnect(struct gserial *gser) + gser->ioport = NULL; + if (port->port.count > 0 || port->openclose) { + wake_up_interruptible(&port->drain_wait); ++#if 0 + if (port->port.tty) + tty_hangup(port->port.tty); ++#else ++ if (port->port.tty) ++ stop_tty(port->port.tty); ++#endif + } + spin_unlock_irqrestore(&port->port_lock, flags); + +-- +1.8.1.1 + diff --git a/libre-testing/linux-libre-veyron/0002-ARM-atags-fdt-retrieve-MAC-addresses-from-Marvell-bo.patch b/libre-testing/linux-libre-veyron/0002-ARM-atags-fdt-retrieve-MAC-addresses-from-Marvell-bo.patch new file mode 100644 index 000000000..9ab38253d --- /dev/null +++ b/libre-testing/linux-libre-veyron/0002-ARM-atags-fdt-retrieve-MAC-addresses-from-Marvell-bo.patch @@ -0,0 +1,47 @@ +From 978d7f01eacdb7af7d87dc4c6811b9ff7f19f5cd Mon Sep 17 00:00:00 2001 +From: Willy Tarreau +Date: Sun, 2 Dec 2012 19:56:58 +0100 +Subject: [PATCH 2/9] ARM: atags/fdt: retrieve MAC addresses from Marvell boot + loader + +The atags are parsed and if a Marvell atag is found, up to 4 MAC +addresses are extracted there and assigned to node aliases eth0..3 +with the name "mac-address". + +This was tested on my Mirabox and the two NICs had their correct +address set. + +Signed-off-by: Willy Tarreau +--- + arch/arm/boot/compressed/atags_to_fdt.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/boot/compressed/atags_to_fdt.c b/arch/arm/boot/compressed/atags_to_fdt.c +index 41fa7316c52b..807ed160a4b9 100644 +--- a/arch/arm/boot/compressed/atags_to_fdt.c ++++ b/arch/arm/boot/compressed/atags_to_fdt.c +@@ -19,7 +19,7 @@ static int node_offset(void *fdt, const char *node_path) + } + + static int setprop(void *fdt, const char *node_path, const char *property, +- uint32_t *val_array, int size) ++ void *val_array, int size) + { + int offset = node_offset(fdt, node_path); + if (offset < 0) +@@ -180,6 +180,12 @@ int atags_to_fdt(void *atag_list, void *fdt, int total_space) + initrd_start); + setprop_cell(fdt, "/chosen", "linux,initrd-end", + initrd_start + initrd_size); ++ } else if (atag->hdr.tag == ATAG_MV_UBOOT) { ++ /* This ATAG provides up to 4 MAC addresses */ ++ setprop(fdt, "eth0", "mac-address", atag->u.mv_uboot.macAddr[0], 6); ++ setprop(fdt, "eth1", "mac-address", atag->u.mv_uboot.macAddr[1], 6); ++ setprop(fdt, "eth2", "mac-address", atag->u.mv_uboot.macAddr[2], 6); ++ setprop(fdt, "eth3", "mac-address", atag->u.mv_uboot.macAddr[3], 6); + } + } + +-- +2.19.0 + diff --git a/libre-testing/linux-libre-veyron/0003-SMILE-Plug-device-tree-file.patch b/libre-testing/linux-libre-veyron/0003-SMILE-Plug-device-tree-file.patch new file mode 100644 index 000000000..02eca7c31 --- /dev/null +++ b/libre-testing/linux-libre-veyron/0003-SMILE-Plug-device-tree-file.patch @@ -0,0 +1,209 @@ +From 96a2824045c5dff3c3ccb5e01813f5ec6372bde0 Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Fri, 5 Sep 2014 15:41:19 -0600 +Subject: [PATCH 3/9] SMILE Plug device tree file + +This adds a dts file for the SMILE Plug, which only differs from the Mirabox +dts with the LED definitions. + +Signed-off-by: Kevin Mihelich +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/armada-370-smileplug.dts | 173 +++++++++++++++++++++ + 2 files changed, 174 insertions(+) + create mode 100644 arch/arm/boot/dts/armada-370-smileplug.dts + +diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +index b5bd3de87c33..547603bafae1 100644 +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -1138,6 +1138,7 @@ dtb-$(CONFIG_MACH_ARMADA_370) += \ + armada-370-db.dtb \ + armada-370-dlink-dns327l.dtb \ + armada-370-mirabox.dtb \ ++ armada-370-smileplug.dtb \ + armada-370-netgear-rn102.dtb \ + armada-370-netgear-rn104.dtb \ + armada-370-rd.dtb \ +diff --git a/arch/arm/boot/dts/armada-370-smileplug.dts b/arch/arm/boot/dts/armada-370-smileplug.dts +new file mode 100644 +index 000000000000..d01308ab848b +--- /dev/null ++++ b/arch/arm/boot/dts/armada-370-smileplug.dts +@@ -0,0 +1,173 @@ ++/* ++ * Device Tree file for Marvell SMILE Plug ++ * ++ * Kevin Mihelich ++ * Gregory CLEMENT ++ * ++ * This file is licensed under the terms of the GNU General Public ++ * License version 2. This program is licensed "as is" without any ++ * warranty of any kind, whether express or implied. ++ */ ++ ++/dts-v1/; ++#include ++#include "armada-370.dtsi" ++ ++/ { ++ model = "Marvell SMILE Plug"; ++ compatible = "marvell,smileplug", "marvell,armada370", "marvell,armada-370-xp"; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200 earlyprintk"; ++ }; ++ ++ memory { ++ device_type = "memory"; ++ reg = <0x00000000 0x20000000>; /* 512 MB */ ++ }; ++ ++ soc { ++ ranges = ; ++ ++ pcie-controller { ++ status = "okay"; ++ ++ /* Internal mini-PCIe connector */ ++ pcie@1,0 { ++ /* Port 0, Lane 0 */ ++ status = "okay"; ++ }; ++ ++ /* Connected on the PCB to a USB 3.0 XHCI controller */ ++ pcie@2,0 { ++ /* Port 1, Lane 0 */ ++ status = "okay"; ++ }; ++ }; ++ ++ internal-regs { ++ serial@12000 { ++ status = "okay"; ++ }; ++ timer@20300 { ++ clock-frequency = <600000000>; ++ status = "okay"; ++ }; ++ ++ gpio_leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&smile_led_pins>; ++ ++ red_eyes_led { ++ label = "smileplug:red:eyes"; ++ gpios = <&gpio1 31 0>; ++ default-state = "off"; ++ }; ++ ++ green_eyes_led { ++ label = "smileplug:green:eyes"; ++ gpios = <&gpio2 0 0>; ++ linux,default-trigger = "default-on"; ++ }; ++ ++ red_smile_led { ++ label = "smileplug:red:smile"; ++ gpios = <&gpio1 15 0>; ++ default-state = "off"; ++ }; ++ ++ green_smile_led { ++ label = "smileplug:green:smile"; ++ gpios = <&gpio1 27 0>; ++ linux,default-trigger = "default-on"; ++ }; ++ }; ++ ++ mdio { ++ pinctrl-0 = <&mdio_pins>; ++ pinctrl-names = "default"; ++ phy0: ethernet-phy@0 { ++ reg = <0>; ++ }; ++ ++ phy1: ethernet-phy@1 { ++ reg = <1>; ++ }; ++ }; ++ ethernet@70000 { ++ pinctrl-0 = <&ge0_rgmii_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++ phy = <&phy0>; ++ phy-mode = "rgmii-id"; ++ }; ++ ethernet@74000 { ++ pinctrl-0 = <&ge1_rgmii_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++ phy = <&phy1>; ++ phy-mode = "rgmii-id"; ++ }; ++ ++ mvsdio@d4000 { ++ pinctrl-0 = <&sdio_pins3>; ++ pinctrl-names = "default"; ++ status = "okay"; ++ /* ++ * No CD or WP GPIOs: SDIO interface used for ++ * Wifi/Bluetooth chip ++ */ ++ broken-cd; ++ }; ++ ++ usb@50000 { ++ status = "okay"; ++ }; ++ ++ usb@51000 { ++ status = "okay"; ++ }; ++ ++ i2c@11000 { ++ status = "okay"; ++ clock-frequency = <100000>; ++ pca9505: pca9505@25 { ++ compatible = "nxp,pca9505"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ reg = <0x25>; ++ }; ++ }; ++ ++ nand@d0000 { ++ status = "okay"; ++ num-cs = <1>; ++ marvell,nand-keep-config; ++ marvell,nand-enable-arbiter; ++ nand-on-flash-bbt; ++ ++ partition@0 { ++ label = "U-Boot"; ++ reg = <0 0x400000>; ++ }; ++ partition@400000 { ++ label = "Linux"; ++ reg = <0x400000 0x400000>; ++ }; ++ partition@800000 { ++ label = "Filesystem"; ++ reg = <0x800000 0x3f800000>; ++ }; ++ }; ++ }; ++ }; ++}; ++ ++&pinctrl { ++ smile_led_pins: smile-led-pins { ++ marvell,pins = "mpp63", "mpp64", "mpp47", "mpp59"; ++ marvell,function = "gpio"; ++ }; ++}; +-- +2.19.0 + diff --git a/libre-testing/linux-libre-veyron/0004-fix-mvsdio-eMMC-timing.patch b/libre-testing/linux-libre-veyron/0004-fix-mvsdio-eMMC-timing.patch new file mode 100644 index 000000000..19ef6c0ac --- /dev/null +++ b/libre-testing/linux-libre-veyron/0004-fix-mvsdio-eMMC-timing.patch @@ -0,0 +1,38 @@ +From 43be8213a90dae909f838dedbc5e8a1e82b9572d Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Fri, 5 Sep 2014 15:43:56 -0600 +Subject: [PATCH 4/9] fix mvsdio eMMC timing + +These changes from Globalscale change the MMC timing to allow the eMMC versions +of the Mirabox and SMILE Plug to work. + +Signed-off-by: Kevin Mihelich +--- + drivers/mmc/host/mvsdio.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c +index e22bbff89c8d..6b30c850ce07 100644 +--- a/drivers/mmc/host/mvsdio.c ++++ b/drivers/mmc/host/mvsdio.c +@@ -93,7 +93,7 @@ static int mvsd_setup_data(struct mvsd_host *host, struct mmc_data *data) + tmout_index = fls(tmout - 1) - 12; + if (tmout_index < 0) + tmout_index = 0; +- if (tmout_index > MVSD_HOST_CTRL_TMOUT_MAX) ++// if (tmout_index > MVSD_HOST_CTRL_TMOUT_MAX) //by steven, try to setup the timeout to maximum value + tmout_index = MVSD_HOST_CTRL_TMOUT_MAX; + + dev_dbg(host->dev, "data %s at 0x%08x: blocks=%d blksz=%d tmout=%u (%d)\n", +@@ -616,6 +616,8 @@ static void mvsd_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) + u32 m = DIV_ROUND_UP(host->base_clock, ios->clock) - 1; + if (m > MVSD_BASE_DIV_MAX) + m = MVSD_BASE_DIV_MAX; ++ if(ios->clock==50000000 ) //by steven ++ m=1; + mvsd_write(MVSD_CLK_DIV, m); + host->clock = ios->clock; + host->ns_per_clk = 1000000000 / (host->base_clock / (m+1)); +-- +2.19.0 + diff --git a/libre-testing/linux-libre-veyron/0005-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch b/libre-testing/linux-libre-veyron/0005-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch new file mode 100644 index 000000000..18e2a7875 --- /dev/null +++ b/libre-testing/linux-libre-veyron/0005-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch @@ -0,0 +1,95 @@ +From 6e0372c8fec9db69e88a19c3a70a4c3a730fd743 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 18 Feb 2014 01:43:50 -0300 +Subject: [PATCH 5/9] net/smsc95xx: Allow mac address to be set as a parameter + +--- + drivers/net/usb/smsc95xx.c | 56 ++++++++++++++++++++++++++++++++++++++ + 1 file changed, 56 insertions(+) + +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index 262e7a3c23cb..c2b3c5b6e1f3 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -60,6 +60,7 @@ + #define SUSPEND_SUSPEND3 (0x08) + #define SUSPEND_ALLMODES (SUSPEND_SUSPEND0 | SUSPEND_SUSPEND1 | \ + SUSPEND_SUSPEND2 | SUSPEND_SUSPEND3) ++#define MAC_ADDR_LEN (6) + + #define CARRIER_CHECK_DELAY (2 * HZ) + +@@ -82,6 +83,10 @@ static bool turbo_mode = true; + module_param(turbo_mode, bool, 0644); + MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction"); + ++static char *macaddr = ":"; ++module_param(macaddr, charp, 0); ++MODULE_PARM_DESC(macaddr, "MAC address"); ++ + static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, + u32 *data, int in_pm) + { +@@ -913,8 +918,59 @@ static int smsc95xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd) + return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL); + } + ++/* Check the macaddr module parameter for a MAC address */ ++static int smsc95xx_is_macaddr_param(struct usbnet *dev, u8 *dev_mac) ++{ ++ int i, j, got_num, num; ++ u8 mtbl[MAC_ADDR_LEN]; ++ ++ if (macaddr[0] == ':') ++ return 0; ++ ++ i = 0; ++ j = 0; ++ num = 0; ++ got_num = 0; ++ while (j < MAC_ADDR_LEN) { ++ if (macaddr[i] && macaddr[i] != ':') { ++ got_num++; ++ if ('0' <= macaddr[i] && macaddr[i] <= '9') ++ num = num * 16 + macaddr[i] - '0'; ++ else if ('A' <= macaddr[i] && macaddr[i] <= 'F') ++ num = num * 16 + 10 + macaddr[i] - 'A'; ++ else if ('a' <= macaddr[i] && macaddr[i] <= 'f') ++ num = num * 16 + 10 + macaddr[i] - 'a'; ++ else ++ break; ++ i++; ++ } else if (got_num == 2) { ++ mtbl[j++] = (u8) num; ++ num = 0; ++ got_num = 0; ++ i++; ++ } else { ++ break; ++ } ++ } ++ ++ if (j == MAC_ADDR_LEN) { ++ netif_dbg(dev, ifup, dev->net, "Overriding MAC address with: " ++ "%02x:%02x:%02x:%02x:%02x:%02x\n", mtbl[0], mtbl[1], mtbl[2], ++ mtbl[3], mtbl[4], mtbl[5]); ++ for (i = 0; i < MAC_ADDR_LEN; i++) ++ dev_mac[i] = mtbl[i]; ++ return 1; ++ } else { ++ return 0; ++ } ++} ++ + static void smsc95xx_init_mac_address(struct usbnet *dev) + { ++ /* Check module parameters */ ++ if (smsc95xx_is_macaddr_param(dev, dev->net->dev_addr)) ++ return; ++ + const u8 *mac_addr; + + /* maybe the boot loader passed the MAC address in devicetree */ +-- +2.19.0 + diff --git a/libre-testing/linux-libre-veyron/0006-set-default-cubietruck-led-triggers.patch b/libre-testing/linux-libre-veyron/0006-set-default-cubietruck-led-triggers.patch new file mode 100644 index 000000000..4bed39a6b --- /dev/null +++ b/libre-testing/linux-libre-veyron/0006-set-default-cubietruck-led-triggers.patch @@ -0,0 +1,33 @@ +From b22d8cc1d2763b4abbc6587dff148be3be683ac0 Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Sat, 14 Feb 2015 12:32:27 +0100 +Subject: [PATCH 6/9] set default cubietruck led triggers + +Signed-off-by: Kevin Mihelich +--- + arch/arm/boot/dts/sun7i-a20-cubietruck.dts | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts +index 5649161de1d7..2be64a886555 100644 +--- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts ++++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts +@@ -80,6 +80,7 @@ + blue { + label = "cubietruck:blue:usr"; + gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "heartbeat"; + }; + + orange { +@@ -95,6 +96,7 @@ + green { + label = "cubietruck:green:usr"; + gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "mmc0"; + }; + }; + +-- +2.19.0 + diff --git a/libre-testing/linux-libre-veyron/0007-exynos4412-odroid-set-higher-minimum-buck2-regulator.patch b/libre-testing/linux-libre-veyron/0007-exynos4412-odroid-set-higher-minimum-buck2-regulator.patch new file mode 100644 index 000000000..5b5d345e7 --- /dev/null +++ b/libre-testing/linux-libre-veyron/0007-exynos4412-odroid-set-higher-minimum-buck2-regulator.patch @@ -0,0 +1,30 @@ +From eaea91920f1836c32a5cdb09eb7054af16b88a27 Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Thu, 11 Aug 2016 00:42:37 -0600 +Subject: [PATCH 7/9] exynos4412-odroid: set higher minimum buck2 regulator + voltage + +Set a higher minimum voltage to help reboot issue. +http://www.spinics.net/lists/linux-samsung-soc/msg54434.html + +Signed-off-by: Kevin Mihelich +--- + arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi +index a09e46c9dbc0..d8117a820812 100644 +--- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi ++++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi +@@ -423,7 +423,7 @@ + + buck2_reg: BUCK2 { + regulator-name = "vdd_arm"; +- regulator-min-microvolt = <900000>; ++ regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1350000>; + regulator-always-on; + regulator-boot-on; +-- +2.19.0 + diff --git a/libre-testing/linux-libre-veyron/0008-ARM-dove-enable-ethernet-on-D3Plug.patch b/libre-testing/linux-libre-veyron/0008-ARM-dove-enable-ethernet-on-D3Plug.patch new file mode 100644 index 000000000..6e2d97eab --- /dev/null +++ b/libre-testing/linux-libre-veyron/0008-ARM-dove-enable-ethernet-on-D3Plug.patch @@ -0,0 +1,31 @@ +From a3aab9208da801924ba6211998b31571ed564fcd Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Sun, 7 May 2017 13:32:25 -0600 +Subject: [PATCH 8/9] ARM: dove: enable ethernet on D3Plug + +Signed-off-by: Kevin Mihelich +--- + arch/arm/boot/dts/dove-d3plug.dts | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/arch/arm/boot/dts/dove-d3plug.dts b/arch/arm/boot/dts/dove-d3plug.dts +index 826026c28f90..a4c9963e1261 100644 +--- a/arch/arm/boot/dts/dove-d3plug.dts ++++ b/arch/arm/boot/dts/dove-d3plug.dts +@@ -61,6 +61,13 @@ + &uart0 { status = "okay"; }; + &sata0 { status = "okay"; }; + &i2c0 { status = "okay"; }; ++&mdio { status = "okay"; }; ++ð { status = "okay"; }; ++ ++ðphy { ++ compatible = "marvell,88e1310"; ++ reg = <1>; ++}; + + /* Samsung M8G2F eMMC */ + &sdio0 { +-- +2.19.0 + diff --git a/libre-testing/linux-libre-veyron/60-linux.hook b/libre-testing/linux-libre-veyron/60-linux.hook deleted file mode 100644 index b33873c85..000000000 --- a/libre-testing/linux-libre-veyron/60-linux.hook +++ /dev/null @@ -1,12 +0,0 @@ -[Trigger] -Type = File -Operation = Install -Operation = Upgrade -Operation = Remove -Target = usr/lib/modules/%KERNVER%/* -Target = usr/lib/modules/%EXTRAMODULES%/* - -[Action] -Description = Updating %PKGBASE% module dependencies... -When = PostTransaction -Exec = /usr/bin/depmod %KERNVER% diff --git a/libre-testing/linux-libre-veyron/90-linux.hook b/libre-testing/linux-libre-veyron/90-linux.hook deleted file mode 100644 index fca45abe1..000000000 --- a/libre-testing/linux-libre-veyron/90-linux.hook +++ /dev/null @@ -1,11 +0,0 @@ -[Trigger] -Type = File -Operation = Install -Operation = Upgrade -Target = usr/lib/modules/%KERNVER%/vmlinuz -Target = usr/lib/initcpio/* - -[Action] -Description = Updating %PKGBASE% initcpios... -When = PostTransaction -Exec = /usr/bin/mkinitcpio -p %PKGBASE% diff --git a/libre-testing/linux-libre-veyron/ChangeLog b/libre-testing/linux-libre-veyron/ChangeLog deleted file mode 100644 index efca69d26..000000000 --- a/libre-testing/linux-libre-veyron/ChangeLog +++ /dev/null @@ -1,115 +0,0 @@ -2016-12-23 André Silva - - * linux-libre-4.9_gnu-1 - * Disabled CONFIG_MTD_NAND_NANDSIM [12] - -2016-11-16 André Silva - - * linux-libre-4.8.8_gnu-1 - * Enabled CONFIG_MTD_NAND_NANDSIM [11] - -2016-08-01 André Silva - - * linux-libre-4.6.5_gnu-1 - * Disabled CONFIG_INTEL_MEI_TXE [10] - -2016-05-09 André Silva - - * linux-libre-4.5.3_gnu-1 - * Disabled CONFIG_IO_STRICT_DEVMEM [9] - -2015-12-13 André Silva - - * linux-libre-4.3.2_gnu-1 - * Enabled CONFIG_DISPLAY_PANEL_TPO_TD028TTEC1 and CONFIG_USB_G_DBGP modules [7][8] - -2015-09-23 André Silva - - * linux-libre-4.2.1_gnu-1 - * Removed am335x-pm-firmware.elf from CONFIG_EXTRA_FIRMWARE - -2015-08-20 André Silva - - * linux-libre-4.1.6_gnu-1 - * Added armv7h support - -2015-07-14 André Silva - - * linux-libre-4.1.2_gnu-1 - * Dropped mips64el support - -2015-07-04 André Silva - - * linux-libre-4.0.7_gnu-2 - * Removed linux from conflicts array for the AUR version to avoid making it hard for Arch users to try it out [6] - -2015-03-19 André Silva - - * linux-libre-3.19.2_gnu-1 - * Disabled CONFIG_LOGO, CONFIG_LOGO_LINUX_MONO, CONFIG_LOGO_LINUX_VGA16 and CONFIG_LOGO_LINUX_CLUT224 modules [5] - -2015-03-08 André Silva - - * linux-libre-3.19.1_gnu-1 - * Enabled CONFIG_LOGO, CONFIG_LOGO_LINUX_MONO, CONFIG_LOGO_LINUX_VGA16 and CONFIG_LOGO_LINUX_CLUT224 modules to enable Freedo bootup logos - * Replaced current Freedo to new one from GNU Art Gallery [4] - -2014-08-31 André Silva - - * linux-libre-3.16.1_gnu-1.3 - * Used '_gnu' in kernel pkgver instead of '.gnu' - -2014-08-24 André Silva - - * linux-libre-3.16.1.gnu-1.1 - * Changed upstream format based on the source code - * Disabled CONFIG_LOCALVERSION_AUTO - -2013-07-15 André Silva - - * linux-libre-3.10.1-1 - * Removed linux-libre-kmod-alx package from Parabola due which CONFIG_ALX module was implemented by default in the kernel - -2013-04-30 André Silva - - * linux-libre-3.9-2 - * Removed CONFIG_STUB_POULSBO module from the config files - -2012-12-19 André Silva - - * linux-libre-3.7.1-1 - * Replaced CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org" to CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="linux-libre.fsfla.org" - -2012-05-26 André Silva - - * linux-libre-3.4-1.2 - * Disabled CONFIG_MICROCODE_INTEL and CONFIG_MICROCODE_AMD modules [3] - -2012-04-24 André Silva - - * linux-libre-3.3.3-1 - * Disabled CONFIG_STUB_POULSBO module [2] - -2012-04-08 André Silva - - * linux-libre-3.3.1-1.1 - * Disabled CONFIG_IPW2100 and CONFIG_IPW2200 modules [1] - -2012-03-03 André Silva - - * linux-libre-3.2.9-2 - * Enabled CONFIG_FB_VT8623 module [0] - -[0] https://labs.parabola.nu/issues/14 -[1] https://labs.parabola.nu/issues/47 -[2] https://labs.parabola.nu/issues/90 -[3] https://labs.parabola.nu/issues/116 -[4] https://www.gnu.org/graphics/gnu-and-freedo/gnu-and-freedo.html -[5] https://labs.parabola.nu/issues/685 -[6] https://labs.parabola.nu/issues/750 -[7] https://labs.parabola.nu/issues/857 -[8] https://labs.parabola.nu/issues/858 -[9] https://labs.parabola.nu/issues/1000 -[10] https://labs.parabola.nu/issues/1062 -[11] https://labs.parabola.nu/issues/1143 -[12] https://labs.parabola.nu/issues/1143#note-7 diff --git a/libre-testing/linux-libre-veyron/PKGBUILD b/libre-testing/linux-libre-veyron/PKGBUILD index 69febbc21..4ee5e99f6 100644 --- a/libre-testing/linux-libre-veyron/PKGBUILD +++ b/libre-testing/linux-libre-veyron/PKGBUILD @@ -1,112 +1,97 @@ # Maintainer: David P. -# Contributor: André Silva -# Contributor: Márcio Silva -# Contributor: fauno -# Contributor: Sorin-Mihai Vârgolici -# Contributor: Michał Masłowski -# Contributor: Luke R. -# Contributor: Andreas Grapentin - -# Based on linux package - -#pkgbase=linux-libre # Build stock kernel -#pkgbase=linux-libre-custom # Build kernel with a different name + +_replacesarchkernel=('linux%') # '%' gets replaced with kernel suffix +_replacesoldkernels=() # '%' gets replaced with kernel suffix +_replacesoldmodules=() # '%' gets replaced with kernel suffix + pkgbase=linux-libre-veyron -_srcbasever=4.19-gnu -_srcver=4.19.67-gnu - -_replacesarchkernel=('linux-veyron%') # '%' gets replaced with _kernelname -_replacesoldkernels=() # '%' gets replaced with _kernelname -_replacesoldmodules=() # '%' gets replaced with _kernelname - -_srcname=linux-${_srcbasever%-*} -_archpkgver=${_srcver%-*} -pkgver=${_srcver//-/_} -pkgrel=2 -rcnver=4.19 -rcnrel=armv7-x8 +pkgver=4.19.94 +pkgrel=1 +pkgdesc='Veyron Chromebooks Linux-libre' +_srctag=v$pkgver-gnu +url="https://git.parabola.nu/~megver83/cros-kernel.git/log/?h=$_srctag" arch=(armv7h) -url='https://linux-libre.fsfla.org/' license=(GPL2) makedepends=( - xmlto kmod inetutils bc libelf python-sphinx python-sphinx_rtd_theme - graphviz imagemagick + bc kmod libelf + xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick + git + uboot-tools vboot-utils dtc ) -makedepends_armv7h=(uboot-tools vboot-utils dtc lzip) # for linux-libre-veyron options=('!strip') +_srcname=cros-kernel source=( - "https://linux-libre.fsfla.org/pub/linux-libre/releases/$_srcbasever/linux-libre-$_srcbasever.tar.xz"{,.sign} - "https://linux-libre.fsfla.org/pub/linux-libre/releases/$_srcver/patch-$_srcbasever-$_srcver.xz"{,.sign} + "git+https://git.parabola.nu/~megver83/cros-kernel.git?signed#tag=$_srctag" "https://repo.parabola.nu/other/linux-libre/logos/logo_linux_"{clut224.ppm,vga16.ppm,mono.pbm}{,.sig} config # the main kernel config file - 60-linux.hook # pacman hook for depmod - 90-linux.hook # pacman hook for initramfs regeneration - linux.preset # standard config files for mkinitcpio ramdisk - "kernel"{.its,.keyblock,_data_key.vbprivk} # files for signing Chromebooks kernels -) -source_armv7h=( - linux-4.19.8_lzip-0.patch + linux.preset # armv7h preset file for mkinitcpio ramdisk + "kernel"{.its,.keyblock,_data_key.vbprivk} # files for signing veyron Chromebooks kernels + + # maintain the TTY over USB disconnects + # http://www.coreboot.org/EHCI_Gadget_Debug + 0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch + # linux-lts patches + 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch + + # Arch Linux ARM patches + 0001-ARM-atags-add-support-for-Marvell-s-u-boot.patch + 0002-ARM-atags-fdt-retrieve-MAC-addresses-from-Marvell-bo.patch + 0003-SMILE-Plug-device-tree-file.patch + 0004-fix-mvsdio-eMMC-timing.patch + 0005-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch + 0006-set-default-cubietruck-led-triggers.patch + 0007-exynos4412-odroid-set-higher-minimum-buck2-regulator.patch + 0008-ARM-dove-enable-ethernet-on-D3Plug.patch + + # tmp + 'fix.patch::https://git.parabola.nu/~megver83/cros-kernel.git/patch/?id=133e2f5dac79e64119867e32af7db9997e112133' ) validpgpkeys=( - '474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva '6DB9C4B4F0D8C0DC432CF6E4227CA7C556B2BA78' # David P. ) -sha512sums=('5bc800b3beff43a8c15bd5515f4e0babe2beb5fa600491b7b37110e22d9b739d293f1e38753ed681be289c51390e0e64b3e60ce0db0a3bfe1f94ee5c014579a3' - 'SKIP' - 'c127ef588b646fd45cb219233be2464f00bc640a3fa9f7a84ca5a7c3e324ab4187bf094f4a521d8b3fa47c978e94e327dfdf7d5028a5792d54d38843a745d70e' - 'SKIP' +sha512sums=('SKIP' '13cb5bc42542e7b8bb104d5f68253f6609e463b6799800418af33eb0272cc269aaa36163c3e6f0aacbdaaa1d05e2827a4a7c4a08a029238439ed08b89c564bb3' 'SKIP' '7a3716bfe3b9f546da309c7492f3e08f8f506813afeb1c737a474c83313d5c313cf4582b65215c2cfce3b74d9d1021c96e8badafe8f6e5b01fe28d2b5c61ae78' 'SKIP' '267295aa0cea65684968420c68b32f1a66a22d018b9d2b2c1ef14267bcf4cb68aaf7099d073cbfefe6c25c8608bdcbbd45f7ac8893fdcecbf1e621abdfe9ecc1' 'SKIP' - 'c9ef6ca3f2c12dd19048e20f84f1676196a4a707c3e601349098134453ad6686b3ef43365f7ea2a63ca20077e6a7552e450121381b72791b6b5e55db7d3d450d' - '7ad5be75ee422dda3b80edd2eb614d8a9181e2c8228cd68b3881e2fb95953bf2dea6cbe7900ce1013c9de89b2802574b7b24869fc5d7a95d3cc3112c4d27063a' - '2718b58dbbb15063bacb2bde6489e5b3c59afac4c0e0435b97fe720d42c711b6bcba926f67a8687878bd51373c9cf3adb1915a11666d79ccb220bf36e0788ab7' - '2dc6b0ba8f7dbf19d2446c5c5f1823587de89f4e28e9595937dd51a87755099656f2acec50e3e2546ea633ad1bfd1c722e0c2b91eef1d609103d8abdc0a7cbaf' - '568c75a70206d74b2391c2c44122c08ffdf585b90763809ff983d53d8b20a0145acb4f838b1244fc29222ff859aee94aaf0c5e0d1cbc86ab9f6a4d0e58ee9d3a' + '472da4c5339824bdd7172e90b474e5092fd91f1b2c3a03b050832372ef496c849f1baa61ce06e7d79b4fec247acac4933086a25b9215b97488e180daf16c41ef' + 'f01e7925b262d2874a8a991b1f27d057356a2a384d2012b61be5a631d4e4d7cf87461c8fb9e7f183831f5a829ad204897f1f0545a52df6288a0e04a5c2e31b96' + '167bc73c6c1c63931806238905dc44c7d87c5a5c0f6293159f2133dfe717fb44081018d810675716d1605ec7dff5e8333b87b19e09e2de21d0448e447437873b' 'bb6718984a7357c9b00c37e4788480e5b8b75018c172ecc1441bc3fc5d2d42444eb5d8c7f9d2e3a7d6fed6d03acb565e3c0559486e494c40a7fe6bd0570c9ede' - '143dea30c6da00e504c99984a98a0eb2411f558fcdd9dfa7f607d6c14e9e7dffff9cb00121d9317044b07e3e210808286598c785ee854084b993ec9cb14d8232') -sha512sums_armv7h=('f43134aa9142324390ed40daf23b16713c630dc4c1463453ed624f3d8dccaa0875e3dd4c8bc2a0f57090bc12dd2a8f9b20cb78edbaeb60e95519722a08d4d6e8') - -_kernelname=${pkgbase#linux-libre} -_replacesarchkernel=("${_replacesarchkernel[@]/\%/${_kernelname}}") -_replacesoldkernels=("${_replacesoldkernels[@]/\%/${_kernelname}}") -_replacesoldmodules=("${_replacesoldmodules[@]/\%/${_kernelname}}") - -case "$CARCH" in - i686|x86_64) KARCH=x86;; - armv7h) KARCH=arm;; -esac + '143dea30c6da00e504c99984a98a0eb2411f558fcdd9dfa7f607d6c14e9e7dffff9cb00121d9317044b07e3e210808286598c785ee854084b993ec9cb14d8232' + '02af4dd2a007e41db0c63822c8ab3b80b5d25646af1906dc85d0ad9bb8bbf5236f8e381d7f91cf99ed4b0978c50aee37cb9567cdeef65b7ec3d91b882852b1af' + '5f196378d50dd737d727e424d8f31b7fa8a6b92ba88f0a1467ef79bc37a097160da1fc1fd5cfb4b8983f36f2afdf27eb229ec61b35a15ac2343d660eb416a230' + '60aa432465eb3ac10f565799d3dfecea21aaf08e83909c1161d9359e932626edbd1353e712d616c3d785c65a0f699e9c45df35bd9e86365c25399c6b2d45b9e4' + '86809feb5ae2759b449ec0cb7a6b3fb457874ed82a72dfda00607e8819c804a0714b5d6a17cbbba44996a36872224af42d1b85f1b3932f43bccb419041d25dc7' + '746acff348d62b3ed4e62cd9976ddf0af47f87bd3cffda90cbb00a6b57d589ccb681fcd9541ee5bdd179d95dad71d57c77cb1a60faee1c6cef518e4055c3456f' + 'c945e871fa456b521ced77cae9081bcdc47d836ecdabe6766e373681fe11fda3e5a7a3c16f70c586be64a1eb5c9136c43b0a44df897298940fd8703b50b0a543' + '054e98a2d1ea83cece1fe55ae087b282f25593022f252c74612d4aeb2a547f84ea626e3d982098ca798271af55f3b733ac2aea2fc0d9cad031802d2901dfe4ca' + '4433f9e780a72347313916c8a9cbcbce3a8c40e1b299e887dc748d257879fb5fab8f1683936339f73a4d4b4ef668b1ed6cc0d9a19ed4bd99039a1613ac08610e' + 'd1361d23ae79599e3fa94cba206bd40764f9eee0c584e639af13828dabb7f0dfa361792c098b5afae0bb350407b2dc47a1d67580daeade7a4f3e3e55e42c8470' + 'c1653f91067d31801a23450175e47968add147477caf20aec6092831739641312f4ad995af43c7e55545007279016b5f62a0720d31e4591b4421a65b8bd5b398' + '467af0fa091752473da7a531e2cd2410fec96c00829c1297eca5a37c1300cf068160066319ada182e40ac14d440973ee7e425c6efa476cd097218538c094409b') + +_replacesarchkernel=("${_replacesarchkernel[@]/\%/${pkgbase#linux-libre}}") +_replacesoldkernels=("${_replacesoldkernels[@]/\%/${pkgbase#linux-libre}}") +_replacesoldmodules=("${_replacesoldmodules[@]/\%/${pkgbase#linux-libre}}") + +export KBUILD_BUILD_HOST=parabola +export KBUILD_BUILD_USER=$pkgbase +export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" prepare() { cd $_srcname - # add upstream patch - if [ "$_srcbasever" != "$_srcver" ]; then - patch -p1 -i ../patch-$_srcbasever-$_srcver - fi - - # add freedo as boot logo + msg2 "Adding freedo as boot logo..." install -m644 -t drivers/video/logo \ ../logo_linux_{clut224.ppm,vga16.ppm,mono.pbm} msg2 "Setting version..." scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel - echo "$_kernelname" > localversion.20-pkgname - - if [ "$CARCH" = "armv7h" ]; then - local src_armv7h - for src_armv7h in "${source_armv7h[@]}"; do - src_armv7h="${src_armv7h%%::*}" - src_armv7h="${src_armv7h##*/}" - [[ $src_armv7h = *.patch ]] || continue - msg2 "Applying patch $src_armv7h..." - patch -Np1 < "../$src_armv7h" - done - fi + echo "${pkgbase#linux-libre}" > localversion.20-pkgname local src for src in "${source[@]}"; do @@ -121,92 +106,52 @@ prepare() { cp ../config .config make olddefconfig - make -s kernelrelease > ../version - msg2 "Prepared %s version %s" "$pkgbase" "$(<../version)" + make -s kernelrelease > version + msg2 "Prepared %s version %s" "$pkgbase" "$( "$startdir/$install.pkg" - true && install=$install.pkg - - # fill in mkinitcpio preset and pacman hooks - sed "$subst" ../linux.preset | install -Dm644 /dev/stdin \ - "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset" - sed "$subst" ../60-linux.hook | install -Dm644 /dev/stdin \ - "$pkgdir/usr/share/libalpm/hooks/60-$pkgbase.hook" - sed "$subst" ../90-linux.hook | install -Dm644 /dev/stdin \ - "$pkgdir/usr/share/libalpm/hooks/90-$pkgbase.hook" + # armv7h presets only work with ALL_kver=$kernver + msg2 "Installing mkinitcpio preset..." + sed "s|%PKGBASE%|$pkgbase|g;s|%KERNVER%|$kernver|g" ../linux-armv7h.preset \ + | install -Dm644 /dev/stdin "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset" - msg2 "Fixing permissions..." - chmod -Rc u=rwX,go=rX "$pkgdir" - - msg2 "Setting options for device tree compiler..." + # kernel signature cp ../kernel.its . - mkimage -D "-I dts -O dtb -p 2048" -f kernel.its kernel.itb + mkimage -D "-I dts -O dtb -p 2048" -f kernel.its kernel.signed dd if=/dev/zero of=bootloader.bin bs=512 count=1 echo 'console=tty0 init=/sbin/init root=PARTUUID=%U/PARTNROFF=1 rootwait rw noinitrd' > cmdline @@ -214,7 +159,7 @@ _package() { vbutil_kernel \ --pack vmlinux.kpart \ --version 1 \ - --vmlinuz kernel.itb \ + --vmlinuz kernel.signed \ --arch arm \ --keyblock ../kernel.keyblock \ --signprivate ../kernel_data_key.vbprivk \ @@ -222,44 +167,38 @@ _package() { --bootloader bootloader.bin msg2 "Installing kernel sign..." - mkdir -p "$pkgdir/boot" cp vmlinux.kpart "$pkgdir/boot" + + msg2 "Fixing permissions..." + chmod -Rc u=rwX,go=rX "$pkgdir" } _package-headers() { - pkgdesc="Header files and scripts for building modules for ${pkgbase^} kernel" - provides=("${_replacesarchkernel[@]/%/-headers=${_archpkgver}}") + pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel" + provides=("${_replacesarchkernel[@]/%/-headers=$pkgver}") conflicts=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}") replaces=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}") - local builddir="$pkgdir/usr/lib/modules/$(; images { - kernel@1{ + kernel@1 { description = "kernel"; data = /incbin/("arch/arm/boot/zImage"); type = "kernel_noload"; arch = "arm"; os = "linux"; compression = "none"; - load = <0>; - entry = <0>; + load = <0>; + entry = <0>; }; - fdt@1{ + fdt@1 { + description = "exynos5250-snow.dtb"; + data = /incbin/("arch/arm/boot/dts/exynos5250-snow.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@2 { + description = "exynos5250-snow-rev5.dtb"; + data = /incbin/("arch/arm/boot/dts/exynos5250-snow-rev5.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@3 { + description = "exynos5250-spring.dtb"; + data = /incbin/("arch/arm/boot/dts/exynos5250-spring.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@4 { + description = "exynos5800-peach-pi.dtb"; + data = /incbin/("arch/arm/boot/dts/exynos5800-peach-pi.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1{ + algo = "sha1"; + }; + }; + fdt@5 { + description = "exynos5420-peach-pit.dtb"; + data = /incbin/("arch/arm/boot/dts/exynos5420-peach-pit.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@6 { + description = "rk3288-veyron-brain.dtb"; + data = /incbin/("arch/arm/boot/dts/rk3288-veyron-brain.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@7 { + description = "rk3288-veyron-jaq.dtb"; + data = /incbin/("arch/arm/boot/dts/rk3288-veyron-jaq.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@8 { + description = "rk3288-veyron-jerry.dtb"; + data = /incbin/("arch/arm/boot/dts/rk3288-veyron-jerry.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@9 { + description = "rk3288-veyron-mickey.dtb"; + data = /incbin/("arch/arm/boot/dts/rk3288-veyron-mickey.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@10 { + description = "rk3288-veyron-minnie.dtb"; + data = /incbin/("arch/arm/boot/dts/rk3288-veyron-minnie.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@11 { + description = "rk3288-veyron-pinky.dtb"; + data = /incbin/("arch/arm/boot/dts/rk3288-veyron-pinky.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1{ + algo = "sha1"; + }; + }; + fdt@12 { description = "rk3288-veyron-speedy.dtb"; data = /incbin/("arch/arm/boot/dts/rk3288-veyron-speedy.dtb"); type = "flat_dt"; arch = "arm"; compression = "none"; - hash@1{ + hash@1 { + algo = "sha1"; + }; + }; + fdt@13 { + description = "tegra124-nyan-big.dtb"; + data = /incbin/("arch/arm/boot/dts/tegra124-nyan-big.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@14 { + description = "tegra124-nyan-blaze.dtb"; + data = /incbin/("arch/arm/boot/dts/tegra124-nyan-blaze.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { algo = "sha1"; }; }; }; configurations { default = "conf@1"; - conf@1{ + conf@1 { kernel = "kernel@1"; fdt = "fdt@1"; }; + conf@2 { + kernel = "kernel@1"; + fdt = "fdt@2"; + }; + conf@3 { + kernel = "kernel@1"; + fdt = "fdt@3"; + }; + conf@4 { + kernel = "kernel@1"; + fdt = "fdt@4"; + }; + conf@5 { + kernel = "kernel@1"; + fdt = "fdt@5"; + }; + conf@6 { + kernel = "kernel@1"; + fdt = "fdt@6"; + }; + conf@7 { + kernel = "kernel@1"; + fdt = "fdt@7"; + }; + conf@8 { + kernel = "kernel@1"; + fdt = "fdt@8"; + }; + conf@9 { + kernel = "kernel@1"; + fdt = "fdt@9"; + }; + conf@10 { + kernel = "kernel@1"; + fdt = "fdt@10"; + }; + conf@11 { + kernel = "kernel@1"; + fdt = "fdt@11"; + }; + conf@12 { + kernel = "kernel@1"; + fdt = "fdt@12"; + }; + conf@13 { + kernel = "kernel@1"; + fdt = "fdt@13"; + }; + conf@14 { + kernel = "kernel@1"; + fdt = "fdt@14"; + }; }; }; diff --git a/libre-testing/linux-libre-veyron/linux-4.19.8_lzip-0.patch b/libre-testing/linux-libre-veyron/linux-4.19.8_lzip-0.patch deleted file mode 100644 index 98edaff1c..000000000 --- a/libre-testing/linux-libre-veyron/linux-4.19.8_lzip-0.patch +++ /dev/null @@ -1,1974 +0,0 @@ -diff -urdN linux-4.19.8/Documentation/00-INDEX linux-4.19.8.new/Documentation/00-INDEX ---- linux-4.19.8/Documentation/00-INDEX 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/Documentation/00-INDEX 2018-12-09 18:01:59.000000000 +0100 -@@ -242,6 +242,8 @@ - - info on creator of above logo & site to get additional images from. - lsm.txt - - Linux Security Modules: General Security Hooks for Linux -+lzip.txt -+ - info on lzip compression for the linux kernel. - lzo.txt - - kernel LZO decompressor input formats - m68k/ -diff -urdN linux-4.19.8/Documentation/dontdiff linux-4.19.8.new/Documentation/dontdiff ---- linux-4.19.8/Documentation/dontdiff 2018-12-08 19:33:27.000000000 +0100 -+++ linux-4.19.8.new/Documentation/dontdiff 2018-12-09 18:01:59.000000000 +0100 -@@ -26,6 +26,7 @@ - *.ll - *.log - *.lst -+*.lz - *.lzma - *.lzo - *.mo -diff -urdN linux-4.19.8/Documentation/filesystems/squashfs.txt linux-4.19.8.new/Documentation/filesystems/squashfs.txt ---- linux-4.19.8/Documentation/filesystems/squashfs.txt 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/Documentation/filesystems/squashfs.txt 2018-12-09 18:01:59.000000000 +0100 -@@ -2,7 +2,7 @@ - ======================= - - Squashfs is a compressed read-only filesystem for Linux. --It uses zlib, lz4, lzo, or xz compression to compress files, inodes and -+It uses zlib, lz4, lzip, lzo, or xz compression to compress files, inodes and - directories. Inodes in the system are very small and all blocks are packed to - minimise data overhead. Block sizes greater than 4K are supported up to a - maximum of 1Mbytes (default block size 128K). -diff -urdN linux-4.19.8/Documentation/lzip.txt linux-4.19.8.new/Documentation/lzip.txt ---- linux-4.19.8/Documentation/lzip.txt 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.19.8.new/Documentation/lzip.txt 2018-12-09 19:07:33.000000000 +0100 -@@ -0,0 +1,59 @@ -+============================== -+Lzip data compression in Linux -+============================== -+ -+Introduction -+============ -+ -+Lzip is a lossless data compressor with a user interface similar to the -+one of gzip or bzip2. Lzip can compress about as fast as gzip (lzip -0) -+or compress most files more than bzip2 (lzip -9). Decompression speed is -+intermediate between gzip and bzip2. Lzip implements the LZMA algorithm. -+ -+Lzip has been designed, written and tested with great care to be the -+standard general-purpose compressor for unix-like systems. The lzip -+format is as simple as possible (but not simpler). It provides accurate -+and robust 3 factor integrity checking. -+ -+Learn more about lzip at http://www.nongnu.org/lzip/lzip.html -+ -+Lzip related components in the kernel -+===================================== -+ -+The lzip_decompress module in lib/lzip_decompress.c provides a versatile -+lzip decompression function able to do buffer to buffer decompression or -+stream decompression with fill and flush callback functions. The usage -+of the function is documented in include/linux/lzip.h. -+ -+For decompressing the kernel image, initramfs, and initrd, there is a -+wrapper function in lib/decompress_lunzip.c providing the same common -+interface as the other decompress_*.c files, which is defined in -+include/linux/decompress/generic.h. -+ -+For kernel makefiles, two commands are provided in scripts/Makefile.lib -+for use with $(call if_changed). The kernel image must be compressed -+with $(call if_changed,klzip) which will append a four-byte trailer -+containing the size of the uncompressed data, which is needed by the -+boot code. Other things should be compressed with $(call if_changed,lzip). -+ -+Testing -+======= -+ -+Lzip-compressed kernel images of multiple linux versions since 2.6.30.10 -+have been built and tested, even on machines as modest as an AMD 486-DX2 -+at 66 MHz with 64 MiB of RAM. In the worst case (on the slow machine -+above), lzip just increased the boot time a 15% compared with gzip. On -+more modern machines, lzip may boot slightly faster than gzip. It just -+takes 0.2 seconds for lzip to decompress vmlinuz-4.4.16 on my machine. -+ -+Decompression time is usually a small fraction of the total boot time. -+For example, using lz4 on a desktop machine in order to save 0.05 -+seconds of a total boot time of 20 seconds is probably not worth the -+increased image size. -+ -+Xlunzip is a test tool for the lzip_decompress module. It is similar to -+lunzip, but it uses the lzip_decompress module as a backend. The xlunzip -+home page is at http://www.nongnu.org/lzip/xlunzip.html -+ -+Author: Antonio Diaz Diaz -+Updated: 2018-12-09 -diff -urdN linux-4.19.8/Documentation/x86/boot.txt linux-4.19.8.new/Documentation/x86/boot.txt ---- linux-4.19.8/Documentation/x86/boot.txt 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/Documentation/x86/boot.txt 2018-12-09 18:01:59.000000000 +0100 -@@ -665,10 +665,10 @@ - The payload may be compressed. The format of both the compressed and - uncompressed data should be determined using the standard magic - numbers. The currently supported compression formats are gzip -- (magic numbers 1F 8B or 1F 9E), bzip2 (magic number 42 5A), LZMA -- (magic number 5D 00), XZ (magic number FD 37), and LZ4 (magic number -- 02 21). The uncompressed payload is currently always ELF (magic -- number 7F 45 4C 46). -+ (magic numbers 1F 8B or 1F 9E), bzip2 (magic number 42 5A), lzip -+ (magic number 4C 5A), LZMA (magic number 5D 00), XZ (magic number FD -+ 37), and LZ4 (magic number 02 21). The uncompressed payload is -+ currently always ELF (magic number 7F 45 4C 46). - - Field name: payload_length - Type: read -diff -urdN linux-4.19.8/Makefile linux-4.19.8.new/Makefile ---- linux-4.19.8/Makefile 2018-12-08 19:31:53.000000000 +0100 -+++ linux-4.19.8.new/Makefile 2018-12-09 18:01:59.000000000 +0100 -@@ -912,14 +912,17 @@ - export mod_strip_cmd - - # CONFIG_MODULE_COMPRESS, if defined, will cause module to be compressed --# after they are installed in agreement with CONFIG_MODULE_COMPRESS_GZIP --# or CONFIG_MODULE_COMPRESS_XZ. -+# after they are installed in agreement with CONFIG_MODULE_COMPRESS_GZIP, -+# CONFIG_MODULE_COMPRESS_LZIP or CONFIG_MODULE_COMPRESS_XZ. - - mod_compress_cmd = true - ifdef CONFIG_MODULE_COMPRESS - ifdef CONFIG_MODULE_COMPRESS_GZIP - mod_compress_cmd = gzip -n -f - endif # CONFIG_MODULE_COMPRESS_GZIP -+ ifdef CONFIG_MODULE_COMPRESS_LZIP -+ mod_compress_cmd = lzip -f -+ endif # CONFIG_MODULE_COMPRESS_LZIP - ifdef CONFIG_MODULE_COMPRESS_XZ - mod_compress_cmd = xz -f - endif # CONFIG_MODULE_COMPRESS_XZ -@@ -931,6 +934,7 @@ - # - INITRD_COMPRESS-y := gzip - INITRD_COMPRESS-$(CONFIG_RD_BZIP2) := bzip2 -+INITRD_COMPRESS-$(CONFIG_RD_LZIP) := lzip - INITRD_COMPRESS-$(CONFIG_RD_LZMA) := lzma - INITRD_COMPRESS-$(CONFIG_RD_XZ) := xz - INITRD_COMPRESS-$(CONFIG_RD_LZO) := lzo -diff -urdN linux-4.19.8/arch/arm/Kconfig linux-4.19.8.new/arch/arm/Kconfig ---- linux-4.19.8/arch/arm/Kconfig 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/arch/arm/Kconfig 2018-12-09 18:01:59.000000000 +0100 -@@ -77,6 +77,7 @@ - select HAVE_IRQ_TIME_ACCOUNTING - select HAVE_KERNEL_GZIP - select HAVE_KERNEL_LZ4 -+ select HAVE_KERNEL_LZIP - select HAVE_KERNEL_LZMA - select HAVE_KERNEL_LZO - select HAVE_KERNEL_XZ -diff -urdN linux-4.19.8/arch/arm/boot/compressed/Makefile linux-4.19.8.new/arch/arm/boot/compressed/Makefile ---- linux-4.19.8/arch/arm/boot/compressed/Makefile 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/arch/arm/boot/compressed/Makefile 2018-12-09 18:01:59.000000000 +0100 -@@ -71,6 +71,7 @@ - CPPFLAGS_vmlinux.lds := -DTEXT_START="$(ZTEXTADDR)" -DBSS_START="$(ZBSSADDR)" - - compress-$(CONFIG_KERNEL_GZIP) = gzip -+compress-$(CONFIG_KERNEL_LZIP) = klzip - compress-$(CONFIG_KERNEL_LZO) = lzo - compress-$(CONFIG_KERNEL_LZMA) = lzma - compress-$(CONFIG_KERNEL_XZ) = xzkern -diff -urdN linux-4.19.8/arch/arm/boot/compressed/decompress.c linux-4.19.8.new/arch/arm/boot/compressed/decompress.c ---- linux-4.19.8/arch/arm/boot/compressed/decompress.c 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/arch/arm/boot/compressed/decompress.c 2018-12-09 18:01:59.000000000 +0100 -@@ -37,6 +37,10 @@ - #include "../../../../lib/decompress_inflate.c" - #endif - -+#ifdef CONFIG_KERNEL_LZIP -+#include "../../../../lib/decompress_lunzip.c" -+#endif -+ - #ifdef CONFIG_KERNEL_LZO - #include "../../../../lib/decompress_unlzo.c" - #endif -diff -urdN linux-4.19.8/arch/sh/Kconfig linux-4.19.8.new/arch/sh/Kconfig ---- linux-4.19.8/arch/sh/Kconfig 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/arch/sh/Kconfig 2018-12-09 18:01:59.000000000 +0100 -@@ -25,6 +25,7 @@ - select HAVE_KERNEL_GZIP - select CPU_NO_EFFICIENT_FFS - select HAVE_KERNEL_BZIP2 -+ select HAVE_KERNEL_LZIP - select HAVE_KERNEL_LZMA - select HAVE_KERNEL_XZ - select HAVE_KERNEL_LZO -diff -urdN linux-4.19.8/arch/sh/Makefile linux-4.19.8.new/arch/sh/Makefile ---- linux-4.19.8/arch/sh/Makefile 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/arch/sh/Makefile 2018-12-09 18:01:59.000000000 +0100 -@@ -209,9 +209,9 @@ - libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) - libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) - --BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.xz uImage.lzo \ -- uImage.srec uImage.bin zImage vmlinux.bin vmlinux.srec \ -- romImage -+BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lz uImage.lzma uImage.xz \ -+ uImage.lzo uImage.srec uImage.bin zImage vmlinux.bin \ -+ vmlinux.srec romImage - PHONY += $(BOOT_TARGETS) - - all: $(notdir $(KBUILD_IMAGE)) -@@ -238,6 +238,7 @@ - @echo ' uImage.bin - Kernel-only image for U-Boot (bin)' - @echo '* uImage.gz - Kernel-only image for U-Boot (gzip)' - @echo ' uImage.bz2 - Kernel-only image for U-Boot (bzip2)' -+ @echo ' uImage.lz - Kernel-only image for U-Boot (lzip)' - @echo ' uImage.lzma - Kernel-only image for U-Boot (lzma)' - @echo ' uImage.xz - Kernel-only image for U-Boot (xz)' - @echo ' uImage.lzo - Kernel-only image for U-Boot (lzo)' -diff -urdN linux-4.19.8/arch/sh/boot/Makefile linux-4.19.8.new/arch/sh/boot/Makefile ---- linux-4.19.8/arch/sh/boot/Makefile 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/arch/sh/boot/Makefile 2018-12-09 18:01:59.000000000 +0100 -@@ -22,14 +22,15 @@ - suffix-y := bin - suffix-$(CONFIG_KERNEL_GZIP) := gz - suffix-$(CONFIG_KERNEL_BZIP2) := bz2 -+suffix-$(CONFIG_KERNEL_LZIP) := lz - suffix-$(CONFIG_KERNEL_LZMA) := lzma - suffix-$(CONFIG_KERNEL_XZ) := xz - suffix-$(CONFIG_KERNEL_LZO) := lzo - - targets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz \ -- uImage.bz2 uImage.lzma uImage.xz uImage.lzo uImage.bin --extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \ -- vmlinux.bin.xz vmlinux.bin.lzo -+ uImage.bz2 uImage.lz uImage.lzma uImage.xz uImage.lzo uImage.bin -+extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lz \ -+ vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo - subdir- := compressed romimage - - $(obj)/zImage: $(obj)/compressed/vmlinux FORCE -@@ -71,6 +72,9 @@ - $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE - $(call if_changed,bzip2) - -+$(obj)/vmlinux.bin.lz: $(obj)/vmlinux.bin FORCE -+ $(call if_changed,klzip) -+ - $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE - $(call if_changed,lzma) - -@@ -86,6 +90,9 @@ - $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz - $(call if_changed,uimage,gzip) - -+$(obj)/uImage.lz: $(obj)/vmlinux.bin.lz -+ $(call if_changed,uimage,lzip) -+ - $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma - $(call if_changed,uimage,lzma) - -diff -urdN linux-4.19.8/arch/sh/boot/compressed/Makefile linux-4.19.8.new/arch/sh/boot/compressed/Makefile ---- linux-4.19.8/arch/sh/boot/compressed/Makefile 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/arch/sh/boot/compressed/Makefile 2018-12-09 18:01:59.000000000 +0100 -@@ -5,10 +5,9 @@ - # create a compressed vmlinux image from the original vmlinux - # - --targets := vmlinux vmlinux.bin vmlinux.bin.gz \ -- vmlinux.bin.bz2 vmlinux.bin.lzma \ -- vmlinux.bin.xz vmlinux.bin.lzo \ -- head_$(BITS).o misc.o piggy.o -+targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \ -+ vmlinux.bin.lz vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo \ -+ head_$(BITS).o misc.o piggy.o - - OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/cache.o - -@@ -66,6 +65,8 @@ - $(call if_changed,gzip) - $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE - $(call if_changed,bzip2) -+$(obj)/vmlinux.bin.lz: $(vmlinux.bin.all-y) FORCE -+ $(call if_changed,klzip) - $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE - $(call if_changed,lzma) - $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE -diff -urdN linux-4.19.8/arch/sh/boot/compressed/misc.c linux-4.19.8.new/arch/sh/boot/compressed/misc.c ---- linux-4.19.8/arch/sh/boot/compressed/misc.c 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/arch/sh/boot/compressed/misc.c 2018-12-09 18:01:59.000000000 +0100 -@@ -58,6 +58,10 @@ - #include "../../../../lib/decompress_bunzip2.c" - #endif - -+#ifdef CONFIG_KERNEL_LZIP -+#include "../../../../lib/decompress_lunzip.c" -+#endif -+ - #ifdef CONFIG_KERNEL_LZMA - #include "../../../../lib/decompress_unlzma.c" - #endif -diff -urdN linux-4.19.8/arch/x86/Kconfig linux-4.19.8.new/arch/x86/Kconfig ---- linux-4.19.8/arch/x86/Kconfig 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/arch/x86/Kconfig 2018-12-09 18:01:59.000000000 +0100 -@@ -158,6 +158,7 @@ - select HAVE_KERNEL_BZIP2 - select HAVE_KERNEL_GZIP - select HAVE_KERNEL_LZ4 -+ select HAVE_KERNEL_LZIP - select HAVE_KERNEL_LZMA - select HAVE_KERNEL_LZO - select HAVE_KERNEL_XZ -diff -urdN linux-4.19.8/arch/x86/boot/compressed/Makefile linux-4.19.8.new/arch/x86/boot/compressed/Makefile ---- linux-4.19.8/arch/x86/boot/compressed/Makefile 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/arch/x86/boot/compressed/Makefile 2018-12-09 18:01:59.000000000 +0100 -@@ -23,8 +23,8 @@ - # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in. - KCOV_INSTRUMENT := n - --targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \ -- vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4 -+targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lz \ -+ vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4 - - KBUILD_CFLAGS := -m$(BITS) -O2 - KBUILD_CFLAGS += -fno-strict-aliasing $(call cc-option, -fPIE, -fPIC) -@@ -134,6 +134,8 @@ - $(call if_changed,gzip) - $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE - $(call if_changed,bzip2) -+$(obj)/vmlinux.bin.lz: $(vmlinux.bin.all-y) FORCE -+ $(call if_changed,klzip) - $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE - $(call if_changed,lzma) - $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE -@@ -145,6 +147,7 @@ - - suffix-$(CONFIG_KERNEL_GZIP) := gz - suffix-$(CONFIG_KERNEL_BZIP2) := bz2 -+suffix-$(CONFIG_KERNEL_LZIP) := lz - suffix-$(CONFIG_KERNEL_LZMA) := lzma - suffix-$(CONFIG_KERNEL_XZ) := xz - suffix-$(CONFIG_KERNEL_LZO) := lzo -diff -urdN linux-4.19.8/arch/x86/boot/compressed/misc.c linux-4.19.8.new/arch/x86/boot/compressed/misc.c ---- linux-4.19.8/arch/x86/boot/compressed/misc.c 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/arch/x86/boot/compressed/misc.c 2018-12-09 18:01:59.000000000 +0100 -@@ -61,6 +61,10 @@ - #include "../../../../lib/decompress_bunzip2.c" - #endif - -+#ifdef CONFIG_KERNEL_LZIP -+#include "../../../../lib/decompress_lunzip.c" -+#endif -+ - #ifdef CONFIG_KERNEL_LZMA - #include "../../../../lib/decompress_unlzma.c" - #endif -diff -urdN linux-4.19.8/fs/squashfs/Kconfig linux-4.19.8.new/fs/squashfs/Kconfig ---- linux-4.19.8/fs/squashfs/Kconfig 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/fs/squashfs/Kconfig 2018-12-09 18:01:59.000000000 +0100 -@@ -4,7 +4,7 @@ - help - Saying Y here includes support for SquashFS 4.0 (a Compressed - Read-Only File System). Squashfs is a highly compressed read-only -- filesystem for Linux. It uses zlib, lzo or xz compression to -+ filesystem for Linux. It uses zlib, lzip, lzo or xz compression to - compress both files, inodes and directories. Inodes in the system - are very small and all blocks are packed to minimise data overhead. - Block sizes greater than 4K are supported up to a maximum of 1 Mbytes -@@ -134,6 +134,21 @@ - file systems will be readable without selecting this option. - - If unsure, say N. -+ -+config SQUASHFS_LZIP -+ bool "Include support for LZIP compressed file systems" -+ depends on SQUASHFS -+ select LZIP_DECOMPRESS -+ help -+ Saying Y here includes support for reading Squashfs file systems -+ compressed with LZIP compression. LZIP gives better compression -+ than the default zlib compression, at the expense of greater CPU -+ and memory overhead. -+ -+ LZIP is not the standard compression used in Squashfs and so most -+ file systems will be readable without selecting this option. -+ -+ If unsure, say N. - - config SQUASHFS_LZO - bool "Include support for LZO compressed file systems" -diff -urdN linux-4.19.8/fs/squashfs/Makefile linux-4.19.8.new/fs/squashfs/Makefile ---- linux-4.19.8/fs/squashfs/Makefile 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/fs/squashfs/Makefile 2018-12-09 18:01:59.000000000 +0100 -@@ -13,6 +13,7 @@ - squashfs-$(CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU) += decompressor_multi_percpu.o - squashfs-$(CONFIG_SQUASHFS_XATTR) += xattr.o xattr_id.o - squashfs-$(CONFIG_SQUASHFS_LZ4) += lz4_wrapper.o -+squashfs-$(CONFIG_SQUASHFS_LZIP) += lzip_wrapper.o - squashfs-$(CONFIG_SQUASHFS_LZO) += lzo_wrapper.o - squashfs-$(CONFIG_SQUASHFS_XZ) += xz_wrapper.o - squashfs-$(CONFIG_SQUASHFS_ZLIB) += zlib_wrapper.o -diff -urdN linux-4.19.8/fs/squashfs/decompressor.c linux-4.19.8.new/fs/squashfs/decompressor.c ---- linux-4.19.8/fs/squashfs/decompressor.c 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/fs/squashfs/decompressor.c 2018-12-09 18:01:59.000000000 +0100 -@@ -47,6 +47,12 @@ - }; - #endif - -+#ifndef CONFIG_SQUASHFS_LZIP -+static const struct squashfs_decompressor squashfs_lzip_comp_ops = { -+ NULL, NULL, NULL, NULL, LZIP_COMPRESSION, "lzip", 0 -+}; -+#endif -+ - #ifndef CONFIG_SQUASHFS_LZO - static const struct squashfs_decompressor squashfs_lzo_comp_ops = { - NULL, NULL, NULL, NULL, LZO_COMPRESSION, "lzo", 0 -@@ -78,6 +84,7 @@ - static const struct squashfs_decompressor *decompressor[] = { - &squashfs_zlib_comp_ops, - &squashfs_lz4_comp_ops, -+ &squashfs_lzip_comp_ops, - &squashfs_lzo_comp_ops, - &squashfs_xz_comp_ops, - &squashfs_lzma_unsupported_comp_ops, -diff -urdN linux-4.19.8/fs/squashfs/decompressor.h linux-4.19.8.new/fs/squashfs/decompressor.h ---- linux-4.19.8/fs/squashfs/decompressor.h 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/fs/squashfs/decompressor.h 2018-12-09 18:01:59.000000000 +0100 -@@ -50,6 +50,10 @@ - extern const struct squashfs_decompressor squashfs_lz4_comp_ops; - #endif - -+#ifdef CONFIG_SQUASHFS_LZIP -+extern const struct squashfs_decompressor squashfs_lzip_comp_ops; -+#endif -+ - #ifdef CONFIG_SQUASHFS_LZO - extern const struct squashfs_decompressor squashfs_lzo_comp_ops; - #endif -diff -urdN linux-4.19.8/fs/squashfs/lzip_wrapper.c linux-4.19.8.new/fs/squashfs/lzip_wrapper.c ---- linux-4.19.8/fs/squashfs/lzip_wrapper.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.19.8.new/fs/squashfs/lzip_wrapper.c 2018-12-09 18:01:59.000000000 +0100 -@@ -0,0 +1,129 @@ -+/* -+ * Squashfs - a compressed read only filesystem for Linux -+ * -+ * Copyright (c) 2014 -+ * Phillip Lougher -+ * Copyright (C) 2018 Antonio Diaz Diaz -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version 2, -+ * or (at your option) any later version. -+ * -+ * 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. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program. If not, see . -+ * -+ * lzip_wrapper.c -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "squashfs_fs.h" -+#include "squashfs_fs_sb.h" -+#include "squashfs.h" -+#include "decompressor.h" -+#include "page_actor.h" -+ -+struct squashfs_lzip { -+ void *input; -+ void *output; -+}; -+ -+ -+static void *lzip_init(struct squashfs_sb_info *msblk, void *buff) -+{ -+ int block_size = max_t(int, msblk->block_size, SQUASHFS_METADATA_SIZE); -+ struct squashfs_lzip *stream = kzalloc(sizeof(*stream), GFP_KERNEL); -+ if (stream == NULL) -+ goto failed; -+ stream->input = vmalloc(block_size); -+ if (stream->input == NULL) -+ goto failed2; -+ stream->output = vmalloc(block_size); -+ if (stream->output == NULL) -+ goto failed3; -+ -+ return stream; -+ -+failed3: -+ vfree(stream->input); -+failed2: -+ kfree(stream); -+failed: -+ ERROR("Failed to initialise LZIP decompressor\n"); -+ return ERR_PTR(-ENOMEM); -+} -+ -+ -+static void lzip_free(void *strm) -+{ -+ struct squashfs_lzip *stream = strm; -+ -+ if (stream) { -+ vfree(stream->input); -+ vfree(stream->output); -+ } -+ kfree(stream); -+} -+ -+ -+static int lzip_uncompress(struct squashfs_sb_info *msblk, void *strm, -+ struct buffer_head **bh, int b, int offset, int length, -+ struct squashfs_page_actor *output) -+{ -+ struct squashfs_lzip *stream = strm; -+ void *buff = stream->input, *data; -+ long out_pos; -+ int avail, i, bytes = length, res; -+ -+ for (i = 0; i < b; i++) { -+ avail = min(bytes, msblk->devblksize - offset); -+ memcpy(buff, bh[i]->b_data + offset, avail); -+ buff += avail; -+ bytes -= avail; -+ offset = 0; -+ put_bh(bh[i]); -+ } -+ -+ res = lzip_decompress(stream->input, length, 0, 0, stream->output, -+ output->length, 0, &out_pos); -+ if (res < 0) { -+ ERROR("LZIP error code %d\n", res); -+ return -EIO; -+ } -+ bytes = out_pos; -+ data = squashfs_first_page(output); -+ buff = stream->output; -+ while (data) { -+ if (bytes <= PAGE_SIZE) { -+ memcpy(data, buff, bytes); -+ break; -+ } -+ memcpy(data, buff, PAGE_SIZE); -+ buff += PAGE_SIZE; -+ bytes -= PAGE_SIZE; -+ data = squashfs_next_page(output); -+ } -+ squashfs_finish_page(output); -+ -+ return out_pos; -+} -+ -+ -+const struct squashfs_decompressor squashfs_lzip_comp_ops = { -+ .init = lzip_init, -+ .free = lzip_free, -+ .decompress = lzip_uncompress, -+ .id = LZIP_COMPRESSION, -+ .name = "lzip", -+ .supported = 1 -+}; -diff -urdN linux-4.19.8/fs/squashfs/squashfs_fs.h linux-4.19.8.new/fs/squashfs/squashfs_fs.h ---- linux-4.19.8/fs/squashfs/squashfs_fs.h 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/fs/squashfs/squashfs_fs.h 2018-12-09 18:01:59.000000000 +0100 -@@ -248,6 +248,7 @@ - #define XZ_COMPRESSION 4 - #define LZ4_COMPRESSION 5 - #define ZSTD_COMPRESSION 6 -+#define LZIP_COMPRESSION 7 - - struct squashfs_super_block { - __le32 s_magic; -diff -urdN linux-4.19.8/include/linux/decompress/lunzip.h linux-4.19.8.new/include/linux/decompress/lunzip.h ---- linux-4.19.8/include/linux/decompress/lunzip.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.19.8.new/include/linux/decompress/lunzip.h 2018-12-09 18:01:59.000000000 +0100 -@@ -0,0 +1,11 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+#ifndef LINUX_DECOMPRESS_LUNZIP_H -+#define LINUX_DECOMPRESS_LUNZIP_H -+ -+int lunzip(unsigned char *inbuf, long in_len, -+ long (*fill)(void*, unsigned long), -+ long (*flush)(void*, unsigned long), -+ unsigned char *outbuf, -+ long *in_posp, -+ void (*error)(char *x)); -+#endif -diff -urdN linux-4.19.8/include/linux/lzip.h linux-4.19.8.new/include/linux/lzip.h ---- linux-4.19.8/include/linux/lzip.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.19.8.new/include/linux/lzip.h 2018-12-09 18:01:59.000000000 +0100 -@@ -0,0 +1,53 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+#ifndef __LZIP_H__ -+#define __LZIP_H__ -+/* -+ * LZIP decompressor -+ * -+ * Copyright (C) 2016-2018 Antonio Diaz Diaz. -+ */ -+ -+/* Return values (< 0 = Error) */ -+enum { -+ LZIP_OOM_INBUF = -1, -+ LZIP_HEADER1_EOF = -2, -+ LZIP_HEADER2_EOF = -3, -+ LZIP_BAD_MAGIC1 = -4, -+ LZIP_BAD_MAGIC2 = -5, -+ LZIP_BAD_VERSION = -6, -+ LZIP_BAD_DICT_SIZE = -7, -+ LZIP_OOM_OUTBUF = -8, -+ LZIP_WRITE_ERROR = -9, -+ LZIP_BAD_DATA = -10, -+ LZIP_DATA_EOF = -11, -+ LZIP_BAD_CRC = -12 -+}; -+ -+int lzip_decompress(unsigned char *inbuf, long in_len, -+ long (*fill)(void*, unsigned long), -+ long (*flush)(void*, unsigned long), -+ unsigned char *outbuf, long out_size, -+ long *in_posp, long *out_posp); -+ -+/* inbuf - input buffer. If null or in_len <= 0, fill must be non-null -+ * in_len - len of pre-read data in inbuf if inbuf is non-null -+ * fill - if non-null, function to fill inbuf when empty -+ * flush - if non-null, function to write out outbuf when full -+ * outbuf - output buffer. If null or out_size <= 0, flush must be non-null -+ * out_size - size of outbuf if outbuf is non-null -+ * in_posp - if non-null, the number of bytes consumed will be returned here -+ * out_posp - if non-null, the number of bytes produced will be returned here -+ * -+ * fill will be called (repeatedly) to read data. in_len bytes will be read -+ * per call (or 16384 bytes per call if inbuf is null or in_len <= 0). -+ * -+ * If flush is null, outbuf must be large enough to buffer all the expected -+ * output. Else the flush function will be called to flush the output buffer -+ * at the appropriate time (stream dependent). -+ * If out_size > 0 but is not large enough to buffer all the expected output, -+ * it must be at least as large as the dictionary size of the data. -+ * -+ * inbuf and outbuf may overlap (in-place decompression). -+ */ -+ -+#endif -diff -urdN linux-4.19.8/init/Kconfig linux-4.19.8.new/init/Kconfig ---- linux-4.19.8/init/Kconfig 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/init/Kconfig 2018-12-09 19:01:32.000000000 +0100 -@@ -122,6 +122,9 @@ - config HAVE_KERNEL_BZIP2 - bool - -+config HAVE_KERNEL_LZIP -+ bool -+ - config HAVE_KERNEL_LZMA - bool - -@@ -140,7 +143,7 @@ - choice - prompt "Kernel compression mode" - default KERNEL_GZIP -- depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_XZ || HAVE_KERNEL_LZO || HAVE_KERNEL_LZ4 || HAVE_KERNEL_UNCOMPRESSED -+ depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZIP || HAVE_KERNEL_LZMA || HAVE_KERNEL_XZ || HAVE_KERNEL_LZO || HAVE_KERNEL_LZ4 || HAVE_KERNEL_UNCOMPRESSED - help - The linux kernel is a kind of self-extracting executable. - Several compression algorithms are available, which differ -@@ -176,6 +179,15 @@ - Bzip2 uses a large amount of memory. For modern kernels you - will need at least 8MB RAM or more for booting. - -+config KERNEL_LZIP -+ bool "Lzip" -+ depends on HAVE_KERNEL_LZIP -+ help -+ Lzip's compression ratio is better than that of gzip and bzip2. -+ Decompression speed is between gzip and bzip2. Compression can -+ be as fast as gzip or slower than bzip2 depending on compression -+ level. Lzip can produce a kernel about a 16% smaller than gzip. -+ - config KERNEL_LZMA - bool "LZMA" - depends on HAVE_KERNEL_LZMA -@@ -1919,8 +1931,8 @@ - depends on MODULES - help - -- Compresses kernel modules when 'make modules_install' is run; gzip or -- xz depending on "Compression algorithm" below. -+ Compresses kernel modules when 'make modules_install' is run; gzip, -+ lzip or xz are used depending on "Compression algorithm" below. - - module-init-tools MAY support gzip, and kmod MAY support gzip and xz. - -@@ -1942,11 +1954,14 @@ - This determines which sort of compression will be used during - 'make modules_install'. - -- GZIP (default) and XZ are supported. -+ GZIP (default), LZIP and XZ are supported. - - config MODULE_COMPRESS_GZIP - bool "GZIP" - -+config MODULE_COMPRESS_LZIP -+ bool "LZIP" -+ - config MODULE_COMPRESS_XZ - bool "XZ" - -diff -urdN linux-4.19.8/init/do_mounts_rd.c linux-4.19.8.new/init/do_mounts_rd.c ---- linux-4.19.8/init/do_mounts_rd.c 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/init/do_mounts_rd.c 2018-12-09 18:01:59.000000000 +0100 -@@ -49,6 +49,7 @@ - * squashfs - * gzip - * bzip2 -+ * lzip - * lzma - * xz - * lzo -diff -urdN linux-4.19.8/lib/Kconfig linux-4.19.8.new/lib/Kconfig ---- linux-4.19.8/lib/Kconfig 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/lib/Kconfig 2018-12-09 18:01:59.000000000 +0100 -@@ -253,6 +253,12 @@ - tristate - select BITREVERSE - -+config LZIP_DECOMPRESS -+ tristate "LZIP decompression support" -+ help -+ LZMA compression algorithm is supported using the .lz file format. -+ See Documentation/lzip.txt for more information. -+ - config LZO_COMPRESS - tristate - -@@ -289,6 +295,10 @@ - config DECOMPRESS_BZIP2 - tristate - -+config DECOMPRESS_LZIP -+ select LZIP_DECOMPRESS -+ tristate -+ - config DECOMPRESS_LZMA - tristate - -diff -urdN linux-4.19.8/lib/Makefile linux-4.19.8.new/lib/Makefile ---- linux-4.19.8/lib/Makefile 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/lib/Makefile 2018-12-09 18:01:59.000000000 +0100 -@@ -119,6 +119,7 @@ - obj-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate/ - obj-$(CONFIG_REED_SOLOMON) += reed_solomon/ - obj-$(CONFIG_BCH) += bch.o -+obj-$(CONFIG_LZIP_DECOMPRESS) += lzip_decompress.o - obj-$(CONFIG_LZO_COMPRESS) += lzo/ - obj-$(CONFIG_LZO_DECOMPRESS) += lzo/ - obj-$(CONFIG_LZ4_COMPRESS) += lz4/ -@@ -131,6 +132,7 @@ - - lib-$(CONFIG_DECOMPRESS_GZIP) += decompress_inflate.o - lib-$(CONFIG_DECOMPRESS_BZIP2) += decompress_bunzip2.o -+lib-$(CONFIG_DECOMPRESS_LZIP) += decompress_lunzip.o - lib-$(CONFIG_DECOMPRESS_LZMA) += decompress_unlzma.o - lib-$(CONFIG_DECOMPRESS_XZ) += decompress_unxz.o - lib-$(CONFIG_DECOMPRESS_LZO) += decompress_unlzo.o -diff -urdN linux-4.19.8/lib/decompress.c linux-4.19.8.new/lib/decompress.c ---- linux-4.19.8/lib/decompress.c 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/lib/decompress.c 2018-12-09 18:01:59.000000000 +0100 -@@ -8,6 +8,7 @@ - #include - - #include -+#include - #include - #include - #include -@@ -25,6 +26,9 @@ - #ifndef CONFIG_DECOMPRESS_BZIP2 - # define bunzip2 NULL - #endif -+#ifndef CONFIG_DECOMPRESS_LZIP -+# define lunzip NULL -+#endif - #ifndef CONFIG_DECOMPRESS_LZMA - # define unlzma NULL - #endif -@@ -48,6 +52,7 @@ - { {0x1f, 0x8b}, "gzip", gunzip }, - { {0x1f, 0x9e}, "gzip", gunzip }, - { {0x42, 0x5a}, "bzip2", bunzip2 }, -+ { {0x4c, 0x5a}, "lzip", lunzip }, - { {0x5d, 0x00}, "lzma", unlzma }, - { {0xfd, 0x37}, "xz", unxz }, - { {0x89, 0x4c}, "lzo", unlzo }, -diff -urdN linux-4.19.8/lib/decompress_lunzip.c linux-4.19.8.new/lib/decompress_lunzip.c ---- linux-4.19.8/lib/decompress_lunzip.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.19.8.new/lib/decompress_lunzip.c 2018-12-09 18:01:59.000000000 +0100 -@@ -0,0 +1,100 @@ -+/* -+ * Wrapper for decompressing LZIP-compressed kernel, initramfs, and initrd -+ * -+ * Copyright (C) 2016-2018 Antonio Diaz Diaz. -+ * -+ * Licensed under GPLv2 or later, see file LICENSE in this source tree. -+ */ -+ -+#ifdef STATIC -+#define PREBOOT -+#include "lzip_decompress.c" -+#else -+#include -+#include -+#include -+#endif -+ -+STATIC int INIT __lunzip(unsigned char *inbuf, long in_len, -+ long (*fill)(void*, unsigned long), -+ long (*flush)(void*, unsigned long), -+ unsigned char *outbuf, long out_size, -+ long *in_posp, long *out_posp, -+ void (*error)(char *x)) -+{ -+ const int retval = lzip_decompress(inbuf, in_len, fill, flush, -+ outbuf, out_size, in_posp, out_posp); -+ switch (retval) { -+ case 0: break; -+ case LZIP_OOM_INBUF: -+ error("Out of memory while allocating input buffer."); -+ break; -+ case LZIP_HEADER1_EOF: -+ error("File ends unexpectedly at member header."); -+ break; -+ case LZIP_HEADER2_EOF: -+ error("Truncated header in multimember file."); -+ break; -+ case LZIP_BAD_MAGIC1: -+ error("Bad magic number (file not in lzip format)."); -+ break; -+ case LZIP_BAD_MAGIC2: -+ error("Corrupt header in multimember file."); -+ break; -+ case LZIP_BAD_VERSION: -+ error("Version of lzip member format not supported."); -+ break; -+ case LZIP_BAD_DICT_SIZE: -+ error("Invalid dictionary size in member header."); -+ break; -+ case LZIP_OOM_OUTBUF: -+ error("Out of memory while allocating output buffer."); -+ break; -+ case LZIP_WRITE_ERROR: -+ error("Write error."); -+ break; -+ case LZIP_BAD_DATA: -+ error("LZIP-compressed data is corrupt."); -+ break; -+ case LZIP_DATA_EOF: -+ error("LZIP-compressed data ends unexpectedly."); -+ break; -+ case LZIP_BAD_CRC: -+ error("CRC mismatch in LZIP-compressed data."); -+ break; -+ default: -+ error("Bug in the LZIP decompressor."); -+ } -+ return retval; -+} -+ -+#ifndef PREBOOT -+/* decompress_fn (see include/linux/decompress/generic.h) should have an -+ * out_size argument to prevent overflowing outbuf in case of corruption -+ * of the compressed data. -+ */ -+STATIC int INIT lunzip(unsigned char *inbuf, long in_len, -+ long (*fill)(void*, unsigned long), -+ long (*flush)(void*, unsigned long), -+ unsigned char *outbuf, -+ long *in_posp, -+ void (*error)(char *x)) -+{ -+ return __lunzip(inbuf, in_len, fill, flush, outbuf, LONG_MAX, -+ in_posp, 0, error); -+} -+#else -+STATIC int INIT __decompress(unsigned char *inbuf, long in_len, -+ long (*fill)(void*, unsigned long), -+ long (*flush)(void*, unsigned long), -+ unsigned char *outbuf, long out_size, -+ long *in_posp, -+ void (*error)(char *x)) -+{ -+/* Some archs pass out_size = 0 (to mean unlimited size), which is unsafe -+ * in case of corruption of the compressed data. -+ */ -+ return __lunzip(inbuf, in_len - 4, fill, flush, outbuf, -+ out_size ? out_size : LONG_MAX, in_posp, 0, error); -+} -+#endif -diff -urdN linux-4.19.8/lib/lzip_decompress.c linux-4.19.8.new/lib/lzip_decompress.c ---- linux-4.19.8/lib/lzip_decompress.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.19.8.new/lib/lzip_decompress.c 2018-12-09 18:01:59.000000000 +0100 -@@ -0,0 +1,882 @@ -+/* -+ * LZIP decompressor -+ * -+ * Copyright (C) 2016-2018 Antonio Diaz Diaz. -+ * -+ * Licensed under GPLv2 or later, see file LICENSE in this source tree. -+ */ -+ -+#include -+#include -+#include -+ -+/* -+ * STATIC_RW_DATA is used in the pre-boot environment on some architectures. -+ * See include/linux/decompress/mm.h for details. -+ */ -+#ifndef STATIC_RW_DATA -+#define STATIC_RW_DATA static -+#endif -+ -+typedef int State; -+ -+enum { states = 12 }; -+ -+static inline bool St_is_char(const State st) { return st < 7; } -+ -+static inline State St_set_char(const State st) -+{ -+ STATIC_RW_DATA const State next[states] = { 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5 }; -+ return next[st]; -+} -+ -+static inline State St_set_match(const State st) -+{ -+ return ((st < 7) ? 7 : 10); -+} -+ -+static inline State St_set_rep(const State st) -+{ -+ return ((st < 7) ? 8 : 11); -+} -+ -+static inline State St_set_short_rep(const State st) -+{ -+ return ((st < 7) ? 9 : 11); -+} -+ -+ -+enum { -+ min_dictionary_bits = 12, -+ min_dictionary_size = 1 << min_dictionary_bits, -+ max_dictionary_bits = 29, -+ max_dictionary_size = 1 << max_dictionary_bits, -+ literal_context_bits = 3, -+ pos_state_bits = 2, -+ pos_states = 1 << pos_state_bits, -+ pos_state_mask = pos_states - 1, -+ -+ len_states = 4, -+ dis_slot_bits = 6, -+ start_dis_model = 4, -+ end_dis_model = 14, -+ modeled_distances = 1 << (end_dis_model / 2), /* 128 */ -+ dis_align_bits = 4, -+ dis_align_size = 1 << dis_align_bits, -+ -+ len_low_bits = 3, -+ len_mid_bits = 3, -+ len_high_bits = 8, -+ len_low_symbols = 1 << len_low_bits, -+ len_mid_symbols = 1 << len_mid_bits, -+ len_high_symbols = 1 << len_high_bits, -+ max_len_symbols = len_low_symbols + len_mid_symbols + len_high_symbols, -+ -+ min_match_len = 2, /* must be 2 */ -+ max_match_len = min_match_len + max_len_symbols - 1, /* 273 */ -+ min_match_len_limit = 5 -+}; -+ -+static inline int get_len_state(const int len) -+{ -+ return min(len - min_match_len, len_states - 1); -+} -+ -+static inline int get_lit_state(const uint8_t prev_byte) -+{ -+ return (prev_byte >> (8 - literal_context_bits)); -+} -+ -+ -+enum { bit_model_move_bits = 5, -+ bit_model_total_bits = 11, -+ bit_model_total = 1 << bit_model_total_bits -+}; -+ -+typedef int Bit_model; -+ -+static inline void Bm_init(Bit_model * const probability) -+{ -+ *probability = bit_model_total / 2; -+} -+ -+static inline void Bm_array_init(Bit_model bm[], const int size) -+{ -+ int i; -+ -+ for (i = 0; i < size; ++i) -+ Bm_init(&bm[i]); -+} -+ -+struct Len_model { -+ Bit_model choice1; -+ Bit_model choice2; -+ Bit_model bm_low[pos_states][len_low_symbols]; -+ Bit_model bm_mid[pos_states][len_mid_symbols]; -+ Bit_model bm_high[len_high_symbols]; -+}; -+ -+static inline void Lm_init(struct Len_model * const lm) -+{ -+ Bm_init(&lm->choice1); -+ Bm_init(&lm->choice2); -+ Bm_array_init(lm->bm_low[0], pos_states * len_low_symbols); -+ Bm_array_init(lm->bm_mid[0], pos_states * len_mid_symbols); -+ Bm_array_init(lm->bm_high, len_high_symbols); -+} -+ -+ -+/* Table of CRCs of all 8-bit messages. */ -+STATIC_RW_DATA const uint32_t crc32[256] = -+ { -+ 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, -+ 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, -+ 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, -+ 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, -+ 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, -+ 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, -+ 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, -+ 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, -+ 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, -+ 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, -+ 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, -+ 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, -+ 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, -+ 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, -+ 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, -+ 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, -+ 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, -+ 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, -+ 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, -+ 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, -+ 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, -+ 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, -+ 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, -+ 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, -+ 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, -+ 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, -+ 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, -+ 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, -+ 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, -+ 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, -+ 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, -+ 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, -+ 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, -+ 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, -+ 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, -+ 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, -+ 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, -+ 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, -+ 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, -+ 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, -+ 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, -+ 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, -+ 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D }; -+ -+ -+static inline void CRC32_update_buf(uint32_t * const crc, -+ const uint8_t * const buffer, -+ const long size) -+{ -+ long i; -+ uint32_t c = *crc; -+ -+ for (i = 0; i < size; ++i) -+ c = crc32[(c^buffer[i])&0xFF] ^ (c >> 8); -+ *crc = c; -+} -+ -+ -+STATIC_RW_DATA const uint8_t lzip_magic[4] = { 0x4C, 0x5A, 0x49, 0x50 }; /* "LZIP" */ -+ -+typedef uint8_t Lzip_header[6]; /* 0-3 magic bytes */ -+ /* 4 version */ -+ /* 5 coded_dict_size */ -+enum { Lh_size = 6 }; -+ -+static inline bool Lh_verify_magic(const Lzip_header data) -+{ -+ int i; -+ -+ for (i = 0; i < 4; ++i) -+ if (data[i] != lzip_magic[i]) -+ return false; -+ return true; -+} -+ -+/* detect (truncated) header */ -+static inline bool Lh_verify_prefix(const Lzip_header data, const int sz) -+{ -+ int i; -+ for (i = 0; i < sz && i < 4; ++i) -+ if (data[i] != lzip_magic[i]) -+ return false; -+ return (sz > 0); -+} -+ -+/* detect corrupt header */ -+static inline bool Lh_verify_corrupt(const Lzip_header data) -+{ -+ int matches = 0; -+ int i; -+ for (i = 0; i < 4; ++i) -+ if (data[i] == lzip_magic[i]) -+ ++matches; -+ return (matches > 1 && matches < 4); -+} -+ -+static inline bool Lh_verify_version(const Lzip_header data) -+{ -+ return (data[4] == 1); -+} -+ -+static inline unsigned Lh_get_dictionary_size(const Lzip_header data) -+{ -+ unsigned sz = (1 << (data[5] & 0x1F)); -+ -+ if (sz > min_dictionary_size) -+ sz -= (sz / 16) * ((data[5] >> 5) & 7); -+ return sz; -+} -+ -+ -+typedef uint8_t Lzip_trailer[20]; -+ /* 0-3 CRC32 of the uncompressed data */ -+ /* 4-11 size of the uncompressed data */ -+ /* 12-19 member size including header and trailer */ -+enum { Lt_size = 20 }; -+ -+static inline unsigned Lt_get_data_crc(const Lzip_trailer data) -+{ -+ unsigned tmp = 0; -+ int i; -+ -+ for (i = 3; i >= 0; --i) { -+ tmp <<= 8; -+ tmp += data[i]; -+ } -+ return tmp; -+} -+ -+static inline unsigned long long Lt_get_data_size(const Lzip_trailer data) -+{ -+ unsigned long long tmp = 0; -+ int i; -+ -+ for (i = 11; i >= 4; --i) { -+ tmp <<= 8; -+ tmp += data[i]; -+ } -+ return tmp; -+} -+ -+static inline unsigned long long Lt_get_member_size(const Lzip_trailer data) -+{ -+ unsigned long long tmp = 0; -+ int i; -+ -+ for (i = 19; i >= 12; --i) { -+ tmp <<= 8; -+ tmp += data[i]; -+ } -+ return tmp; -+} -+ -+ -+struct Range_decoder { -+ unsigned long long partial_member_pos; -+ uint8_t *buffer; /* input buffer */ -+ long buffer_size; -+ long pos; /* current pos in buffer */ -+ long stream_pos; /* when reached, a new block must be read */ -+ uint32_t code; -+ uint32_t range; -+ long (*fill)(void*, unsigned long); -+ bool at_stream_end; -+ bool buffer_given; -+}; -+ -+ -+static bool Rd_read_block(struct Range_decoder * const rdec) -+{ -+ if (!rdec->at_stream_end) { -+ rdec->stream_pos = rdec->fill ? -+ rdec->fill(rdec->buffer, rdec->buffer_size) : 0; -+ rdec->at_stream_end = (rdec->stream_pos < rdec->buffer_size); -+ rdec->partial_member_pos += rdec->pos; -+ rdec->pos = 0; -+ } -+ return rdec->pos < rdec->stream_pos; -+} -+ -+ -+static inline bool Rd_init(struct Range_decoder * const rdec, -+ uint8_t * const inbuf, const long in_len, -+ long (*fill)(void*, unsigned long)) -+{ -+ rdec->partial_member_pos = 0; -+ rdec->buffer_given = (inbuf && in_len > 0); -+ rdec->buffer_size = rdec->buffer_given ? in_len : 16384; -+ rdec->buffer = rdec->buffer_given ? inbuf : malloc(rdec->buffer_size); -+ if (!rdec->buffer) -+ return false; -+ rdec->pos = 0; -+ rdec->stream_pos = rdec->buffer_given ? in_len : 0; -+ rdec->code = 0; -+ rdec->range = 0xFFFFFFFFU; -+ rdec->fill = fill; -+ rdec->at_stream_end = false; -+ return true; -+} -+ -+static inline void Rd_free(struct Range_decoder * const rdec) -+{ -+ if (!rdec->buffer_given) -+ free(rdec->buffer); -+} -+ -+static inline bool Rd_finished(struct Range_decoder * const rdec) -+{ -+ return rdec->pos >= rdec->stream_pos && !Rd_read_block(rdec); -+} -+ -+static inline unsigned long long -+Rd_member_position(const struct Range_decoder * const rdec) -+{ -+ return rdec->partial_member_pos + rdec->pos; -+} -+ -+static inline void Rd_reset_member_position(struct Range_decoder * const rdec) -+{ -+ rdec->partial_member_pos = 0; rdec->partial_member_pos -= rdec->pos; -+} -+ -+static inline uint8_t Rd_get_byte(struct Range_decoder * const rdec) -+{ -+ /* 0xFF avoids decoder error if member is truncated at EOS marker */ -+ if (Rd_finished(rdec)) -+ return 0xFF; -+ return rdec->buffer[rdec->pos++]; -+} -+ -+static inline void Rd_load(struct Range_decoder * const rdec) -+{ -+ int i; -+ -+ rdec->code = 0; -+ for (i = 0; i < 5; ++i) -+ rdec->code = (rdec->code << 8) | Rd_get_byte(rdec); -+ rdec->range = 0xFFFFFFFFU; -+} -+ -+static inline void Rd_normalize(struct Range_decoder * const rdec) -+{ -+ if (rdec->range <= 0x00FFFFFFU) { -+ rdec->range <<= 8; -+ rdec->code = (rdec->code << 8) | Rd_get_byte(rdec); -+ } -+} -+ -+static inline unsigned Rd_decode(struct Range_decoder * const rdec, -+ const int num_bits) -+{ -+ unsigned symbol = 0; -+ int i; -+ -+ for (i = num_bits; i > 0; --i) { -+ bool bit; -+ -+ Rd_normalize(rdec); -+ rdec->range >>= 1; -+ /* symbol <<= 1; */ -+ /* if(rdec->code >= rdec->range) { rdec->code -= rdec->range; symbol |= 1; } */ -+ bit = (rdec->code >= rdec->range); -+ symbol = (symbol << 1) + bit; -+ rdec->code -= rdec->range & (0U - bit); -+ } -+ return symbol; -+} -+ -+static inline unsigned Rd_decode_bit(struct Range_decoder * const rdec, -+ Bit_model * const probability) -+{ -+ uint32_t bound; -+ -+ Rd_normalize(rdec); -+ bound = (rdec->range >> bit_model_total_bits) * *probability; -+ if (rdec->code < bound) { -+ rdec->range = bound; -+ *probability += (bit_model_total - *probability) >> bit_model_move_bits; -+ return 0; -+ } else { -+ rdec->range -= bound; -+ rdec->code -= bound; -+ *probability -= *probability >> bit_model_move_bits; -+ return 1; -+ } -+} -+ -+static inline unsigned Rd_decode_tree3(struct Range_decoder * const rdec, -+ Bit_model bm[]) -+{ -+ unsigned symbol = 1; -+ -+ symbol = (symbol << 1) | Rd_decode_bit(rdec, &bm[symbol]); -+ symbol = (symbol << 1) | Rd_decode_bit(rdec, &bm[symbol]); -+ symbol = (symbol << 1) | Rd_decode_bit(rdec, &bm[symbol]); -+ return symbol & 7; -+} -+ -+static inline unsigned Rd_decode_tree6(struct Range_decoder * const rdec, -+ Bit_model bm[]) -+{ -+ unsigned symbol = 1; -+ -+ symbol = (symbol << 1) | Rd_decode_bit(rdec, &bm[symbol]); -+ symbol = (symbol << 1) | Rd_decode_bit(rdec, &bm[symbol]); -+ symbol = (symbol << 1) | Rd_decode_bit(rdec, &bm[symbol]); -+ symbol = (symbol << 1) | Rd_decode_bit(rdec, &bm[symbol]); -+ symbol = (symbol << 1) | Rd_decode_bit(rdec, &bm[symbol]); -+ symbol = (symbol << 1) | Rd_decode_bit(rdec, &bm[symbol]); -+ return symbol & 0x3F; -+} -+ -+static inline unsigned Rd_decode_tree8(struct Range_decoder * const rdec, -+ Bit_model bm[]) -+{ -+ unsigned symbol = 1; -+ int i; -+ -+ for (i = 0; i < 8; ++i) -+ symbol = (symbol << 1) | Rd_decode_bit(rdec, &bm[symbol]); -+ return symbol & 0xFF; -+} -+ -+static inline unsigned -+Rd_decode_tree_reversed(struct Range_decoder * const rdec, -+ Bit_model bm[], const int num_bits) -+{ -+ unsigned model = 1; -+ unsigned symbol = 0; -+ int i; -+ -+ for (i = 0; i < num_bits; ++i) { -+ const unsigned bit = Rd_decode_bit(rdec, &bm[model]); -+ -+ model = (model << 1) + bit; -+ symbol |= (bit << i); -+ } -+ return symbol; -+} -+ -+static inline unsigned -+Rd_decode_tree_reversed4(struct Range_decoder * const rdec, Bit_model bm[]) -+{ -+ unsigned symbol = Rd_decode_bit(rdec, &bm[1]); -+ unsigned model = 2 + symbol; -+ unsigned bit = Rd_decode_bit(rdec, &bm[model]); -+ -+ model = (model << 1) + bit; symbol |= (bit << 1); -+ bit = Rd_decode_bit(rdec, &bm[model]); -+ model = (model << 1) + bit; symbol |= (bit << 2); -+ symbol |= (Rd_decode_bit(rdec, &bm[model]) << 3); -+ return symbol; -+} -+ -+static inline unsigned Rd_decode_matched(struct Range_decoder * const rdec, -+ Bit_model bm[], unsigned match_byte) -+{ -+ unsigned symbol = 1; -+ unsigned mask = 0x100; -+ -+ while (true) { -+ const unsigned match_bit = (match_byte <<= 1) & mask; -+ const unsigned bit = Rd_decode_bit(rdec, &bm[symbol+match_bit+mask]); -+ -+ symbol = (symbol << 1) + bit; -+ if (symbol > 0xFF) -+ return symbol & 0xFF; -+ mask &= ~(match_bit ^ (bit << 8)); /* if( match_bit != bit ) mask = 0; */ -+ } -+} -+ -+static inline unsigned Rd_decode_len(struct Range_decoder * const rdec, -+ struct Len_model * const lm, -+ const int pos_state) -+{ -+ if (Rd_decode_bit(rdec, &lm->choice1) == 0) -+ return Rd_decode_tree3(rdec, lm->bm_low[pos_state]); -+ if (Rd_decode_bit(rdec, &lm->choice2) == 0) -+ return len_low_symbols + -+ Rd_decode_tree3(rdec, lm->bm_mid[pos_state]); -+ return len_low_symbols + len_mid_symbols + -+ Rd_decode_tree8(rdec, lm->bm_high); -+} -+ -+ -+struct LZ_decoder { -+ unsigned long long partial_data_pos; -+ struct Range_decoder *rdec; -+ /* Don't move bm_* to LZd_decode_member; makes frame too large. */ -+ Bit_model bm_literal[1 << literal_context_bits][0x300]; -+ Bit_model bm_match[states][pos_states]; -+ Bit_model bm_rep[states]; -+ Bit_model bm_rep0[states]; -+ Bit_model bm_rep1[states]; -+ Bit_model bm_rep2[states]; -+ Bit_model bm_len[states][pos_states]; -+ Bit_model bm_dis_slot[len_states][1 << dis_slot_bits]; -+ Bit_model bm_dis[modeled_distances-end_dis_model+1]; -+ Bit_model bm_align[dis_align_size]; -+ struct Len_model match_len_model; -+ struct Len_model rep_len_model; -+ -+ unsigned long buffer_size; -+ unsigned dictionary_size; -+ uint8_t *buffer; /* output buffer */ -+ unsigned long pos; /* current pos in buffer */ -+ unsigned long stream_pos; /* first byte not yet written to file */ -+ uint32_t crc; -+ long (*flush)(void*, unsigned long); -+ bool pos_wrapped; -+ bool buffer_given; -+ bool write_error; -+}; -+ -+static void LZd_flush_data(struct LZ_decoder * const d) -+{ -+ if (d->pos > d->stream_pos) { -+ const long size = d->pos - d->stream_pos; -+ -+ CRC32_update_buf(&d->crc, d->buffer + d->stream_pos, size); -+ if ((d->flush && -+ d->flush(d->buffer + d->stream_pos, size) != size) || -+ (!d->flush && d->pos_wrapped)) -+ d->write_error = true; -+ if (d->pos >= d->buffer_size) { -+ d->partial_data_pos += d->pos; -+ d->pos = 0; -+ d->pos_wrapped = true; -+ } -+ d->stream_pos = d->pos; -+ } -+} -+ -+static inline uint8_t LZd_peek_prev(const struct LZ_decoder * const d) -+{ -+ if (d->pos > 0) -+ return d->buffer[d->pos-1]; -+ if (d->pos_wrapped) -+ return d->buffer[d->buffer_size-1]; -+ return 0; /* prev_byte of first byte */ -+} -+ -+static inline uint8_t LZd_peek(const struct LZ_decoder * const d, -+ const unsigned distance) -+{ -+ const unsigned long i = ((d->pos > distance) ? 0 : d->buffer_size) + -+ d->pos - distance - 1; -+ return d->buffer[i]; -+} -+ -+static inline void LZd_put_byte(struct LZ_decoder * const d, const uint8_t b) -+{ -+ d->buffer[d->pos] = b; -+ if (++d->pos >= d->buffer_size) -+ LZd_flush_data(d); -+} -+ -+static inline void LZd_copy_block(struct LZ_decoder * const d, -+ const unsigned distance, unsigned len) -+{ -+ unsigned long lpos = d->pos, i = lpos - distance - 1; -+ bool fast, fast2; -+ -+ if (lpos > distance) { -+ fast = (len < d->buffer_size - lpos); -+ fast2 = (fast && len <= lpos - i); -+ } else { -+ i += d->buffer_size; -+ fast = (len < d->buffer_size - i); /* (i == pos) may happen */ -+ fast2 = (fast && len <= i - lpos); -+ } -+ if (fast) { /* no wrap */ -+ d->pos += len; -+ if (fast2) /* no wrap, no overlap */ -+ memcpy(d->buffer + lpos, d->buffer + i, len); -+ else -+ for (; len > 0; --len) -+ d->buffer[lpos++] = d->buffer[i++]; -+ } else -+ for (; len > 0; --len) { -+ d->buffer[d->pos] = d->buffer[i]; -+ if (++d->pos >= d->buffer_size) -+ LZd_flush_data(d); -+ if (++i >= d->buffer_size) -+ i = 0; -+ } -+} -+ -+static inline bool LZd_init(struct LZ_decoder * const d, -+ struct Range_decoder * const rde, -+ const unsigned dict_size, uint8_t * const outbuf, -+ long out_size, long (*flush)(void*, unsigned long)) -+{ -+ d->partial_data_pos = 0; -+ d->rdec = rde; -+ Bm_array_init(d->bm_literal[0], (1 << literal_context_bits) * 0x300); -+ Bm_array_init(d->bm_match[0], states * pos_states); -+ Bm_array_init(d->bm_rep, states); -+ Bm_array_init(d->bm_rep0, states); -+ Bm_array_init(d->bm_rep1, states); -+ Bm_array_init(d->bm_rep2, states); -+ Bm_array_init(d->bm_len[0], states * pos_states); -+ Bm_array_init(d->bm_dis_slot[0], len_states * (1 << dis_slot_bits)); -+ Bm_array_init(d->bm_dis, modeled_distances - end_dis_model + 1); -+ Bm_array_init(d->bm_align, dis_align_size); -+ Lm_init(&d->match_len_model); -+ Lm_init(&d->rep_len_model); -+ -+ d->buffer_given = (outbuf && out_size > 0); -+ d->buffer_size = d->buffer_given ? (unsigned long)out_size : dict_size; -+ d->dictionary_size = min_t(unsigned long, d->buffer_size, dict_size); -+ d->buffer = d->buffer_given ? outbuf : large_malloc(d->buffer_size); -+ if (!d->buffer) -+ return false; -+ d->pos = 0; -+ d->stream_pos = 0; -+ d->crc = 0xFFFFFFFFU; -+ d->flush = flush; -+ d->pos_wrapped = false; -+ d->write_error = false; -+ /* prev_byte of first byte; also for LZd_peek( 0 ) on corrupt file */ -+ if (!d->buffer_given) /* inbuf and outbuf may overlap */ -+ d->buffer[d->buffer_size-1] = 0; -+ return true; -+} -+ -+static inline void LZd_free(struct LZ_decoder * const d) -+{ -+ if (!d->buffer_given) -+ large_free(d->buffer); -+} -+ -+static inline unsigned LZd_crc(const struct LZ_decoder * const d) -+{ -+ return d->crc ^ 0xFFFFFFFFU; -+} -+ -+static inline unsigned long long -+LZd_data_position(const struct LZ_decoder * const d) -+{ -+ return d->partial_data_pos + d->pos; -+} -+ -+ -+static bool LZd_verify_trailer(struct LZ_decoder * const d) -+{ -+ Lzip_trailer trailer; -+ int i = 0; -+ -+ while (i < Lt_size) -+ trailer[i++] = Rd_get_byte(d->rdec); -+ -+ return (Lt_get_data_crc(trailer) == LZd_crc(d) && -+ Lt_get_data_size(trailer) == LZd_data_position(d) && -+ Lt_get_member_size(trailer) == Rd_member_position(d->rdec)); -+} -+ -+ -+/* Return value: 0 = OK, < 0 = error (see include/linux/lzip.h). */ -+static int LZd_decode_member(struct LZ_decoder * const d) -+{ -+ struct Range_decoder * const rdec = d->rdec; -+ unsigned rep0 = 0; /* rep[0-3] latest four distances */ -+ unsigned rep1 = 0; /* used for efficient coding of */ -+ unsigned rep2 = 0; /* repeated distances */ -+ unsigned rep3 = 0; -+ State state = 0; -+ -+ Rd_load(rdec); -+ while (!Rd_finished(rdec)) { -+ int len; -+ const int pos_state = LZd_data_position(d) & pos_state_mask; -+ -+ if (Rd_decode_bit(rdec, &d->bm_match[state][pos_state]) == 0) { -+ /* literal byte */ -+ Bit_model * const bm = d->bm_literal[get_lit_state(LZd_peek_prev(d))]; -+ -+ if (St_is_char(state)) { -+ state -= (state < 4) ? state : 3; -+ LZd_put_byte(d, Rd_decode_tree8(rdec, bm)); -+ } else { -+ state -= (state < 10) ? 3 : 6; -+ LZd_put_byte(d, Rd_decode_matched(rdec, bm, LZd_peek(d, rep0))); -+ } -+ continue; -+ } -+ /* match or repeated match */ -+ if (Rd_decode_bit(rdec, &d->bm_rep[state]) != 0) { -+ if (Rd_decode_bit(rdec, &d->bm_rep0[state]) == 0) { -+ if (Rd_decode_bit(rdec, &d->bm_len[state][pos_state]) == 0) { -+ state = St_set_short_rep(state); -+ LZd_put_byte(d, LZd_peek(d, rep0)); -+ continue; -+ } -+ } else { -+ unsigned distance; -+ -+ if (Rd_decode_bit(rdec, &d->bm_rep1[state]) == 0) -+ distance = rep1; -+ else { -+ if (Rd_decode_bit(rdec, &d->bm_rep2[state]) == 0) -+ distance = rep2; -+ else { -+ distance = rep3; -+ rep3 = rep2; -+ } -+ rep2 = rep1; -+ } -+ rep1 = rep0; -+ rep0 = distance; -+ } -+ state = St_set_rep(state); -+ len = min_match_len + Rd_decode_len(rdec, &d->rep_len_model, pos_state); -+ } else { /* match */ -+ unsigned distance; -+ -+ len = min_match_len + Rd_decode_len(rdec, &d->match_len_model, pos_state); -+ distance = Rd_decode_tree6(rdec, d->bm_dis_slot[get_len_state(len)]); -+ if (distance >= start_dis_model) { -+ const unsigned dis_slot = distance; -+ const int direct_bits = (dis_slot >> 1) - 1; -+ -+ distance = (2 | (dis_slot & 1)) << direct_bits; -+ if (dis_slot < end_dis_model) -+ distance += Rd_decode_tree_reversed(rdec, -+ d->bm_dis + (distance - dis_slot), direct_bits); -+ else { -+ distance += -+ Rd_decode(rdec, direct_bits - dis_align_bits) << dis_align_bits; -+ distance += Rd_decode_tree_reversed4(rdec, d->bm_align); -+ if (distance == 0xFFFFFFFFU) { /* marker found */ -+ Rd_normalize(rdec); -+ LZd_flush_data(d); -+ if (d->write_error) -+ return LZIP_WRITE_ERROR; -+ if (len == min_match_len) { /* End Of Stream marker */ -+ if (LZd_verify_trailer(d)) -+ return 0; -+ else -+ return LZIP_BAD_CRC; -+ } -+ if (len == min_match_len + 1) { /* Sync Flush marker */ -+ Rd_load(rdec); -+ continue; -+ } -+ return LZIP_BAD_DATA; /* unknown marker */ -+ } -+ } -+ } -+ rep3 = rep2; rep2 = rep1; rep1 = rep0; rep0 = distance; -+ state = St_set_match(state); -+ if (rep0 >= d->dictionary_size || -+ (rep0 >= d->pos && !d->pos_wrapped)) { -+ LZd_flush_data(d); -+ return LZIP_BAD_DATA; -+ } -+ } -+ LZd_copy_block(d, rep0, len); -+ } -+ LZd_flush_data(d); -+ return LZIP_DATA_EOF; -+} -+ -+ -+int lzip_decompress(unsigned char *inbuf, long in_len, -+ long (*fill)(void*, unsigned long), -+ long (*flush)(void*, unsigned long), -+ unsigned char *outbuf, long out_size, -+ long *in_posp, long *out_posp) -+{ -+ unsigned char *outptr = outbuf; -+ struct Range_decoder rdec; -+ struct LZ_decoder *decoder = 0; -+ int retval = 0; -+ bool first_member; -+ -+ if (in_posp) -+ *in_posp = 0; -+ if (out_posp) -+ *out_posp = 0; -+ -+ if (!Rd_init(&rdec, inbuf, in_len, fill)) -+ return LZIP_OOM_INBUF; -+ -+ for (first_member = true;; first_member = false) { -+ long data_pos; -+ int size; -+ unsigned dictionary_size; -+ Lzip_header header; -+ -+ Rd_reset_member_position(&rdec); -+ for (size = 0; size < Lh_size && !Rd_finished(&rdec); ++size) -+ header[size] = Rd_get_byte(&rdec); -+ if (Rd_finished(&rdec)) { /* End Of File */ -+ if (first_member) -+ retval = LZIP_HEADER1_EOF; -+ else if (Lh_verify_prefix(header, size)) -+ retval = LZIP_HEADER2_EOF; -+ break; -+ } -+ if (!Lh_verify_magic(header)) { -+ if (first_member) -+ retval = LZIP_BAD_MAGIC1; -+ else if (Lh_verify_corrupt(header)) -+ retval = LZIP_BAD_MAGIC2; -+ break; -+ } -+ if (!Lh_verify_version(header)) { -+ retval = LZIP_BAD_VERSION; -+ break; -+ } -+ dictionary_size = Lh_get_dictionary_size(header); -+ if (dictionary_size < min_dictionary_size || -+ dictionary_size > max_dictionary_size) { -+ retval = LZIP_BAD_DICT_SIZE; -+ break; -+ } -+ -+ if (!decoder) -+ decoder = malloc(sizeof *decoder); -+ if (!decoder || !LZd_init(decoder, &rdec, dictionary_size, -+ outptr, out_size, flush)) { -+ retval = LZIP_OOM_OUTBUF; -+ break; -+ } -+ retval = LZd_decode_member(decoder); -+ if (in_posp) -+ *in_posp += Rd_member_position(&rdec); -+ data_pos = LZd_data_position(decoder); -+ if (outptr) -+ outptr += data_pos; -+ if (out_posp) -+ *out_posp += data_pos; -+ if (out_size > 0) -+ out_size -= data_pos; -+ LZd_free(decoder); -+ if (retval != 0) -+ break; -+ } -+ if (decoder) -+ free(decoder); -+ Rd_free(&rdec); -+ return retval; -+} -+ -+#ifndef STATIC -+EXPORT_SYMBOL_GPL(lzip_decompress); -+#endif -+MODULE_DESCRIPTION("LZIP Decompressor"); -+MODULE_AUTHOR("Antonio Diaz Diaz "); -+MODULE_LICENSE("GPL"); -diff -urdN linux-4.19.8/scripts/Makefile.lib linux-4.19.8.new/scripts/Makefile.lib ---- linux-4.19.8/scripts/Makefile.lib 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/scripts/Makefile.lib 2018-12-09 18:01:59.000000000 +0100 -@@ -319,6 +319,21 @@ - bzip2 -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ - (rm -f $@ ; false) - -+# Lzip -+# --------------------------------------------------------------------------- -+# The .lz format has the uncompressed size available at the end of the -+# file, but at offset (member_size - 16). So we append a gzip-style size. -+# Use klzip to compress the kernel image and lzip to compress other things. -+ -+quiet_cmd_klzip = LZIP $@ -+cmd_klzip = (cat $(filter-out FORCE,$^) | \ -+ lzip -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ -+ (rm -f $@ ; false) -+ -+quiet_cmd_lzip = LZIP $@ -+cmd_lzip = (cat $(filter-out FORCE,$^) | lzip -9) > $@ || \ -+ (rm -f $@ ; false) -+ - # Lzma - # --------------------------------------------------------------------------- - -diff -urdN linux-4.19.8/scripts/extract-ikconfig linux-4.19.8.new/scripts/extract-ikconfig ---- linux-4.19.8/scripts/extract-ikconfig 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/scripts/extract-ikconfig 2018-12-09 18:01:59.000000000 +0100 -@@ -59,6 +59,7 @@ - try_decompress '\037\213\010' xy gunzip - try_decompress '\3757zXZ\000' abcde unxz - try_decompress 'BZh' xy bunzip2 -+try_decompress 'LZIP' xyz 'lzip -d' - try_decompress '\135\0\0\0' xxx unlzma - try_decompress '\211\114\132' xy 'lzop -d' - try_decompress '\002\041\114\030' xyy 'lz4 -d -l' -diff -urdN linux-4.19.8/scripts/extract-vmlinux linux-4.19.8.new/scripts/extract-vmlinux ---- linux-4.19.8/scripts/extract-vmlinux 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/scripts/extract-vmlinux 2018-12-09 18:01:59.000000000 +0100 -@@ -55,6 +55,7 @@ - try_decompress '\037\213\010' xy gunzip - try_decompress '\3757zXZ\000' abcde unxz - try_decompress 'BZh' xy bunzip2 -+try_decompress 'LZIP' xyz 'lzip -d' - try_decompress '\135\0\0\0' xxx unlzma - try_decompress '\211\114\132' xy 'lzop -d' - try_decompress '\002!L\030' xxx 'lz4 -d' -diff -urdN linux-4.19.8/scripts/package/Makefile linux-4.19.8.new/scripts/package/Makefile ---- linux-4.19.8/scripts/package/Makefile 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/scripts/package/Makefile 2018-12-09 18:01:59.000000000 +0100 -@@ -129,8 +129,9 @@ - $(if $(findstring tar-src,$@),, \ - $(if $(findstring bz2,$@),bzip2, \ - $(if $(findstring gz,$@),gzip, \ -+$(if $(findstring lz,$@),lzip, \ - $(if $(findstring xz,$@),xz, \ --$(error unknown target $@)))) \ -+$(error unknown target $@))))) \ - -f -9 $(perf-tar).tar) - - perf-%pkg: FORCE -@@ -147,8 +148,10 @@ - @echo ' tar-pkg - Build the kernel as an uncompressed tarball' - @echo ' targz-pkg - Build the kernel as a gzip compressed tarball' - @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball' -+ @echo ' tarlz-pkg - Build the kernel as a lzip compressed tarball' - @echo ' tarxz-pkg - Build the kernel as a xz compressed tarball' - @echo ' perf-tar-src-pkg - Build $(perf-tar).tar source tarball' - @echo ' perf-targz-src-pkg - Build $(perf-tar).tar.gz source tarball' - @echo ' perf-tarbz2-src-pkg - Build $(perf-tar).tar.bz2 source tarball' -+ @echo ' perf-tarlz-src-pkg - Build $(perf-tar).tar.lz source tarball' - @echo ' perf-tarxz-src-pkg - Build $(perf-tar).tar.xz source tarball' -diff -urdN linux-4.19.8/scripts/package/buildtar linux-4.19.8.new/scripts/package/buildtar ---- linux-4.19.8/scripts/package/buildtar 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/scripts/package/buildtar 2018-12-09 18:01:59.000000000 +0100 -@@ -35,6 +35,10 @@ - opts=--bzip2 - tarball=${tarball}.bz2 - ;; -+ tarlz-pkg) -+ opts=--lzip -+ tarball=${tarball}.lz -+ ;; - tarxz-pkg) - opts=--xz - tarball=${tarball}.xz -diff -urdN linux-4.19.8/scripts/patch-kernel linux-4.19.8.new/scripts/patch-kernel ---- linux-4.19.8/scripts/patch-kernel 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/scripts/patch-kernel 2018-12-09 18:01:59.000000000 +0100 -@@ -117,6 +117,10 @@ - ext=".bz2" - name="bzip2" - uncomp="bunzip2 -dc" -+ elif [ -r ${filebase}.lz ]; then -+ ext=".lz" -+ name="lzip" -+ uncomp="lzip -dc" - elif [ -r ${filebase}.xz ]; then - ext=".xz" - name="xz" -diff -urdN linux-4.19.8/tools/testing/selftests/gen_kselftest_tar.sh linux-4.19.8.new/tools/testing/selftests/gen_kselftest_tar.sh ---- linux-4.19.8/tools/testing/selftests/gen_kselftest_tar.sh 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/tools/testing/selftests/gen_kselftest_tar.sh 2018-12-09 18:01:59.000000000 +0100 -@@ -27,6 +27,10 @@ - copts="cvjf" - ext=".tar.bz2" - ;; -+ tarlz) -+ copts="cv --lzip -f" -+ ext=".tar.lz" -+ ;; - tarxz) - copts="cvJf" - ext=".tar.xz" -diff -urdN linux-4.19.8/usr/.gitignore linux-4.19.8.new/usr/.gitignore ---- linux-4.19.8/usr/.gitignore 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/usr/.gitignore 2018-12-09 18:01:59.000000000 +0100 -@@ -5,6 +5,7 @@ - initramfs_data.cpio - initramfs_data.cpio.gz - initramfs_data.cpio.bz2 -+initramfs_data.cpio.lz - initramfs_data.cpio.lzma - initramfs_list - include -diff -urdN linux-4.19.8/usr/Kconfig linux-4.19.8.new/usr/Kconfig ---- linux-4.19.8/usr/Kconfig 2018-12-08 12:59:10.000000000 +0100 -+++ linux-4.19.8.new/usr/Kconfig 2018-12-09 18:01:59.000000000 +0100 -@@ -70,6 +70,15 @@ - Support loading of a bzip2 encoded initial ramdisk or cpio buffer - If unsure, say N. - -+config RD_LZIP -+ bool "Support initial ramdisk/ramfs compressed using lzip" -+ default y -+ depends on BLK_DEV_INITRD -+ select DECOMPRESS_LZIP -+ help -+ Support loading of a lzip encoded initial ramdisk or cpio buffer. -+ If unsure, say N. -+ - config RD_LZMA - bool "Support initial ramdisk/ramfs compressed using LZMA" - default y -@@ -165,6 +174,18 @@ - If you choose this, keep in mind that you need to have the bzip2 tool - available to be able to compress the initram. - -+config INITRAMFS_COMPRESSION_LZIP -+ bool "Lzip" -+ depends on RD_LZIP -+ help -+ Lzip's compression ratio is better than that of gzip and bzip2. -+ Decompression speed is between gzip and bzip2. Compression can -+ be as fast as gzip or slower than bzip2 depending on compression -+ level. Lzip can produce a initramfs about a 16% smaller than gzip. -+ -+ If you choose this, keep in mind that you need to have the lzip tool -+ available to be able to compress the initram. -+ - config INITRAMFS_COMPRESSION_LZMA - bool "LZMA" - depends on RD_LZMA -@@ -222,12 +243,14 @@ - default "" if INITRAMFS_COMPRESSION_NONE - default ".gz" if INITRAMFS_COMPRESSION_GZIP - default ".bz2" if INITRAMFS_COMPRESSION_BZIP2 -+ default ".lz" if INITRAMFS_COMPRESSION_LZIP - default ".lzma" if INITRAMFS_COMPRESSION_LZMA - default ".xz" if INITRAMFS_COMPRESSION_XZ - default ".lzo" if INITRAMFS_COMPRESSION_LZO - default ".lz4" if INITRAMFS_COMPRESSION_LZ4 - default ".gz" if RD_GZIP - default ".lz4" if RD_LZ4 -+ default ".lz" if RD_LZIP - default ".lzo" if RD_LZO - default ".xz" if RD_XZ - default ".lzma" if RD_LZMA diff --git a/libre-testing/linux-libre-veyron/linux-libre-veyron.install b/libre-testing/linux-libre-veyron/linux-libre-veyron.install new file mode 100644 index 000000000..427db6f03 --- /dev/null +++ b/libre-testing/linux-libre-veyron/linux-libre-veyron.install @@ -0,0 +1,26 @@ +post_install() { + if mountpoint -q /boot; then + major=$(mountpoint -d /boot | cut -f 1 -d ':') + minor=$(mountpoint -d /boot | cut -f 2 -d ':') + else + major=$(mountpoint -d / | cut -f 1 -d ':') + minor=$(mountpoint -d / | cut -f 2 -d ':') + fi + device=$(awk {'if ($1 == "'$major'" && $2 == "'$minor'") print $4 '} /proc/partitions) + device="/dev/${device/%2/1}" + + echo "A new kernel version needs to be flashed onto $device." + echo "Do you want to do this now? [y|N]" + read -r shouldwe + if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then + dd if=/boot/vmlinux.kpart of=$device + sync + else + echo "You can do this later by running:" + echo "# dd if=/boot/vmlinux.kpart of=$device" + fi +} + +post_upgrade() { + post_install +} diff --git a/libre-testing/linux-libre-veyron/linux.install b/libre-testing/linux-libre-veyron/linux.install deleted file mode 100644 index a524c8c38..000000000 --- a/libre-testing/linux-libre-veyron/linux.install +++ /dev/null @@ -1,38 +0,0 @@ - -flash_kernel() { - major=$(mountpoint -d / | cut -f 1 -d ':') - minor=$(mountpoint -d / | cut -f 2 -d ':') - device=$(awk '{if ($1 == "'"${major}"'" && $2 == "'"${minor}"'") print $4}' < /proc/partitions) - device="/dev/${device/%2/1}" - - echo "A new kernel version needs to be flashed onto ${device}." - echo -n " do you want to do this now? [y/N] " - read -n 1 -r - (( ${#REPLY} == 1 )) && echo - - if [[ ! $REPLY =~ ^[Yy]$ ]]; then - echo "You can do this later by running:" - echo "# dd if=/boot/vmlinux.kpart of=${device}" - else - dd if=/boot/vmlinux.kpart of="${device}" - sync - fi -} - -post_install () { - flash_kernel -} - -post_upgrade() { - if [ "$(uname -m)" = "x86_64" ] || [ "$(uname -m)" = "i686" ]; then - if findmnt --fstab -uno SOURCE /boot &>/dev/null && ! mountpoint -q /boot; then - echo "WARNING: /boot appears to be a separate partition but is not mounted." - fi - fi - flash_kernel -} - -post_remove() { - rm -f boot/initramfs-%PKGBASE%.img - rm -f boot/initramfs-%PKGBASE%-fallback.img -} diff --git a/libre-testing/linux-libre-veyron/linux.preset b/libre-testing/linux-libre-veyron/linux.preset index 66709a8c1..ca3832faa 100644 --- a/libre-testing/linux-libre-veyron/linux.preset +++ b/libre-testing/linux-libre-veyron/linux.preset @@ -1,14 +1,10 @@ # mkinitcpio preset file for the '%PKGBASE%' package ALL_config="/etc/mkinitcpio.conf" -ALL_kver="/boot/vmlinuz-%PKGBASE%" +ALL_kver="%KERNVER%" -PRESETS=('default' 'fallback') +PRESETS=('default') #default_config="/etc/mkinitcpio.conf" default_image="/boot/initramfs-%PKGBASE%.img" #default_options="" - -#fallback_config="/etc/mkinitcpio.conf" -fallback_image="/boot/initramfs-%PKGBASE%-fallback.img" -fallback_options="-S autodetect" -- cgit v1.2.3