From 3e729651a15029b902d07efbdbd3ad9087f022ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C3=ADas=20Fonzo?= Date: Mon, 20 May 2019 09:10:40 -0300 Subject: [PATCH] stages: 2/02-squashfs: apply a patch to fix FTBFS against glibc 2.28 or major --- .../0010-fix_FTBFS_with_glibc_2.28.patch | 103 +++++++++++++++++++++ .../squashfs-tools-20180628_lzip-0.diff | 0 stages/2/02-squashfs | 11 ++- 3 files changed, 110 insertions(+), 4 deletions(-) create mode 100644 patches/squashfs-tools/0010-fix_FTBFS_with_glibc_2.28.patch rename patches/{squashfs => squashfs-tools}/squashfs-tools-20180628_lzip-0.diff (100%) diff --git a/patches/squashfs-tools/0010-fix_FTBFS_with_glibc_2.28.patch b/patches/squashfs-tools/0010-fix_FTBFS_with_glibc_2.28.patch new file mode 100644 index 00000000..166d0705 --- /dev/null +++ b/patches/squashfs-tools/0010-fix_FTBFS_with_glibc_2.28.patch @@ -0,0 +1,103 @@ +Description: fix FTBFS with glibc 2.28 + . +Author: Laszlo Boszormenyi (GCS) +Bug-Debian: https://bugs.debian.org/916014 +Forwarded: no +Last-Update: 2018-12-09 + +--- + +--- squashfs-tools-4.3.orig/squashfs-tools/mksquashfs.c ++++ squashfs-tools-4.3/squashfs-tools/mksquashfs.c +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -986,49 +987,49 @@ int create_inode(squashfs_inode *i_no, s + } + else if(type == SQUASHFS_CHRDEV_TYPE || type == SQUASHFS_BLKDEV_TYPE) { + struct squashfs_dev_inode_header *dev = &inode_header.dev; +- unsigned int major = major(buf->st_rdev); +- unsigned int minor = minor(buf->st_rdev); ++ unsigned int i_major = major(buf->st_rdev); ++ unsigned int i_minor = minor(buf->st_rdev); + +- if(major > 0xfff) { ++ if(i_major > 0xfff) { + ERROR("Major %d out of range in device node %s, " +- "truncating to %d\n", major, filename, +- major & 0xfff); +- major &= 0xfff; ++ "truncating to %d\n", i_major, filename, ++ i_major & 0xfff); ++ i_major &= 0xfff; + } +- if(minor > 0xfffff) { ++ if(i_minor > 0xfffff) { + ERROR("Minor %d out of range in device node %s, " +- "truncating to %d\n", minor, filename, +- minor & 0xfffff); +- minor &= 0xfffff; ++ "truncating to %d\n", i_minor, filename, ++ i_minor & 0xfffff); ++ i_minor &= 0xfffff; + } + inode = get_inode(sizeof(*dev)); + dev->nlink = nlink; +- dev->rdev = (major << 8) | (minor & 0xff) | +- ((minor & ~0xff) << 12); ++ dev->rdev = (i_major << 8) | (i_minor & 0xff) | ++ ((i_minor & ~0xff) << 12); + SQUASHFS_SWAP_DEV_INODE_HEADER(dev, inode); + TRACE("Device inode, rdev 0x%x, nlink %d\n", dev->rdev, nlink); + } + else if(type == SQUASHFS_LCHRDEV_TYPE || type == SQUASHFS_LBLKDEV_TYPE) { + struct squashfs_ldev_inode_header *dev = &inode_header.ldev; +- unsigned int major = major(buf->st_rdev); +- unsigned int minor = minor(buf->st_rdev); ++ unsigned int i_major = major(buf->st_rdev); ++ unsigned int i_minor = minor(buf->st_rdev); + +- if(major > 0xfff) { ++ if(i_major > 0xfff) { + ERROR("Major %d out of range in device node %s, " +- "truncating to %d\n", major, filename, +- major & 0xfff); +- major &= 0xfff; ++ "truncating to %d\n", i_major, filename, ++ i_major & 0xfff); ++ i_major &= 0xfff; + } +- if(minor > 0xfffff) { ++ if(i_minor > 0xfffff) { + ERROR("Minor %d out of range in device node %s, " +- "truncating to %d\n", minor, filename, +- minor & 0xfffff); +- minor &= 0xfffff; ++ "truncating to %d\n", i_minor, filename, ++ i_minor & 0xfffff); ++ i_minor &= 0xfffff; + } + inode = get_inode(sizeof(*dev)); + dev->nlink = nlink; +- dev->rdev = (major << 8) | (minor & 0xff) | +- ((minor & ~0xff) << 12); ++ dev->rdev = (i_major << 8) | (i_minor & 0xff) | ++ ((i_minor & ~0xff) << 12); + dev->xattr = xattr; + SQUASHFS_SWAP_LDEV_INODE_HEADER(dev, inode); + TRACE("Device inode, rdev 0x%x, nlink %d\n", dev->rdev, nlink); +--- squashfs-tools-4.3.orig/squashfs-tools/unsquashfs.c ++++ squashfs-tools-4.3/squashfs-tools/unsquashfs.c +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + #include + #include + diff --git a/patches/squashfs/squashfs-tools-20180628_lzip-0.diff b/patches/squashfs-tools/squashfs-tools-20180628_lzip-0.diff similarity index 100% rename from patches/squashfs/squashfs-tools-20180628_lzip-0.diff rename to patches/squashfs-tools/squashfs-tools-20180628_lzip-0.diff diff --git a/stages/2/02-squashfs b/stages/2/02-squashfs index 0f20f8f0..83d6a3df 100755 --- a/stages/2/02-squashfs +++ b/stages/2/02-squashfs @@ -1,6 +1,6 @@ # Build script for squashfs4.3+. # -# Copyright (c) 2018 Matias Fonzo, . +# Copyright (c) 2018-2019 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,11 +28,14 @@ cd squashfs-tools-${version} # Note: # The build environment for cross-compilation is not imported, -# the squashfs installation must work from the host system, +# the squashfs-tools installation must work from the host system, # this will produce the compressed squash-image -# Patch to include LZIP support -patch -p1 < "${worktree}/patches/squashfs/squashfs-tools-20180628_lzip-0.diff" +# Apply a patch to include LZIP support +patch -p1 < "${worktree}/patches/squashfs-tools/squashfs-tools-20180628_lzip-0.diff" + +# Fix compilation against glibc 2.28+ (patch coming from Debian) +patch -p1 < "${worktree}/patches/squashfs-tools/0010-fix_FTBFS_with_glibc_2.28.patch" cd squashfs-tools -- 2.11.4.GIT