Add debian package for parted
- Copied 1 patch from CentOS. Another patch is already applied in 3.4. - Copied the resizepart.sh file from CentOS. - Suppress to apply debian/patches in debian source package because they are already applied. Test: - Create debian package for parted - Create ISO with parted package included Story: 2009101 Task: 43526 Signed-off-by: Takamasa Takenaka <takamasa.takenaka@windriver.com> Change-Id: I9a2c0781c07a7e53e7a61800813dc634ed9d5beb
This commit is contained in:
parent
99e0438c90
commit
0e7fef247a
@ -5,3 +5,4 @@ config/puppet-modules/puppet-rabbitmq-8.5.0
|
|||||||
config/puppet-modules/puppet-staging
|
config/puppet-modules/puppet-staging
|
||||||
storage-drivers/trident-installer
|
storage-drivers/trident-installer
|
||||||
config/puppet-5.5.22
|
config/puppet-5.5.22
|
||||||
|
filesystem/parted
|
||||||
|
@ -0,0 +1,35 @@
|
|||||||
|
From ec1370a0a0e16b02f75d0d6c99fd2af258098b00 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Takamasa Takenaka <takamasa.takenaka@windriver.com>
|
||||||
|
Date: Tue, 5 Oct 2021 11:47:19 -0300
|
||||||
|
Subject: [PATCH 1/2] suppress debian patch in tar
|
||||||
|
|
||||||
|
Remove patch entries in series because parted 3.4 debian
|
||||||
|
source tar includes code with these patches applied.
|
||||||
|
|
||||||
|
Signed-off-by: Takamasa Takenaka <takamasa.takenaka@windriver.com>
|
||||||
|
---
|
||||||
|
debian/patches/series | 14 --------------
|
||||||
|
1 file changed, 14 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/debian/patches/series b/debian/patches/series
|
||||||
|
index da8a1ac..e69de29 100644
|
||||||
|
--- a/debian/patches/series
|
||||||
|
+++ b/debian/patches/series
|
||||||
|
@@ -1,14 +0,0 @@
|
||||||
|
-doc-package.patch
|
||||||
|
-preserve-hidden-parts.patch
|
||||||
|
-kfreebsd-gnu.patch
|
||||||
|
-freebsd-ufs.patch
|
||||||
|
-zfs.patch
|
||||||
|
-freebsd-zvol.patch
|
||||||
|
-freebsd-geli.patch
|
||||||
|
-kfreebsd_lvm.patch
|
||||||
|
-hurd-partition-path.patch
|
||||||
|
-hurd-reread.patch
|
||||||
|
-gptsync.patch
|
||||||
|
-udevadm-settle.patch
|
||||||
|
-align-new-partitions-on-fresh-disks.patch
|
||||||
|
-probe-lvs-again.patch
|
||||||
|
--
|
||||||
|
2.25.1
|
||||||
|
|
@ -0,0 +1,46 @@
|
|||||||
|
From 6077588e8e9a9d59ca4e9d133605b778760fca71 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Takamasa Takenaka <takamasa.takenaka@windriver.com>
|
||||||
|
Date: Tue, 5 Oct 2021 11:52:18 -0300
|
||||||
|
Subject: [PATCH 2/2] install resizepart.sh script
|
||||||
|
|
||||||
|
- resizepart.sh is a script without needing to handle command
|
||||||
|
prompts interactively (clean copied from CentOS)
|
||||||
|
- Disable device-mapper for configure
|
||||||
|
|
||||||
|
Signed-off-by: Takamasa Takenaka <takamasa.takenaka@windriver.com>
|
||||||
|
---
|
||||||
|
debian/parted.install | 1 +
|
||||||
|
debian/rules | 8 ++------
|
||||||
|
2 files changed, 3 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/debian/parted.install b/debian/parted.install
|
||||||
|
index 88efc46..4c4dccb 100644
|
||||||
|
--- a/debian/parted.install
|
||||||
|
+++ b/debian/parted.install
|
||||||
|
@@ -1,3 +1,4 @@
|
||||||
|
sbin
|
||||||
|
usr/share/man/man8/parted.8
|
||||||
|
usr/share/man/man8/partprobe.8
|
||||||
|
+resizepart.sh usr/sbin
|
||||||
|
diff --git a/debian/rules b/debian/rules
|
||||||
|
index 590d032..f6ca9a0 100755
|
||||||
|
--- a/debian/rules
|
||||||
|
+++ b/debian/rules
|
||||||
|
@@ -15,12 +15,8 @@ export DEB_BUILD_MAINT_OPTIONS := hardening=+all
|
||||||
|
CONFFLAGS := --sbindir=/sbin --enable-mtrace --enable-shared
|
||||||
|
CONFFLAGS += --disable-gcc-warnings
|
||||||
|
|
||||||
|
-# Enable device-mapper only on Linux
|
||||||
|
-ifeq (linux, $(DEB_HOST_ARCH_OS))
|
||||||
|
- CONFFLAGS += --enable-device-mapper
|
||||||
|
-else
|
||||||
|
- CONFFLAGS += --disable-device-mapper
|
||||||
|
-endif
|
||||||
|
+# Disable device-mappaer
|
||||||
|
+CONFFLAGS += --disable-device-mapper
|
||||||
|
|
||||||
|
# Everything above here is common to the deb and udeb builds.
|
||||||
|
CONFFLAGS_UDEB := $(CONFFLAGS)
|
||||||
|
--
|
||||||
|
2.25.1
|
||||||
|
|
2
filesystem/parted/debian/deb_patches/series
Normal file
2
filesystem/parted/debian/deb_patches/series
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
0001-suppress-debian-patch-in-tar.patch
|
||||||
|
0002-install-resizepart.sh-script.patch
|
9
filesystem/parted/debian/meta_data.yaml
Normal file
9
filesystem/parted/debian/meta_data.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
debname: parted
|
||||||
|
debver: 3.4-1
|
||||||
|
dl_path:
|
||||||
|
name: parted-3.4-1.tar.gz
|
||||||
|
url: https://salsa.debian.org/parted-team/parted/-/archive/debian/3.4-1/parted-debian-3.4-1.tar.gz
|
||||||
|
md5sum: c2666a4dd24907de44c56cc54b35c569
|
||||||
|
revision:
|
||||||
|
dist: $STX_DIST
|
||||||
|
PKG_GITREVCOUNT: true
|
55
filesystem/parted/debian/patches/0001-syscalls.patch
Normal file
55
filesystem/parted/debian/patches/0001-syscalls.patch
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
From 0d22ac37ddcdacfd97e95563c7f6a51a1f50f5da Mon Sep 17 00:00:00 2001
|
||||||
|
From: Takamasa Takenaka <takamasa.takenaka@windriver.com>
|
||||||
|
Date: Tue, 5 Oct 2021 11:57:57 -0300
|
||||||
|
Subject: [PATCH 1/2] syscalls
|
||||||
|
|
||||||
|
Copy of syscalls.patch from CentOS.
|
||||||
|
|
||||||
|
Signed-off-by: Takamasa Takenaka <takamasa.takenaka@windriver.com>
|
||||||
|
---
|
||||||
|
libparted/arch/linux.c | 11 +++++++++++
|
||||||
|
1 file changed, 11 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
|
||||||
|
index 9bae57f..7b8b670 100644
|
||||||
|
--- a/libparted/arch/linux.c
|
||||||
|
+++ b/libparted/arch/linux.c
|
||||||
|
@@ -1798,12 +1798,14 @@ _device_close (PedDevice* dev)
|
||||||
|
|
||||||
|
#if SIZEOF_OFF_T < 8
|
||||||
|
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
|
||||||
|
static _syscall5(int,_llseek,
|
||||||
|
unsigned int, fd,
|
||||||
|
unsigned long, offset_high,
|
||||||
|
unsigned long, offset_low,
|
||||||
|
loff_t*, result,
|
||||||
|
unsigned int, origin)
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
loff_t
|
||||||
|
llseek (unsigned int fd, loff_t offset, unsigned int whence)
|
||||||
|
@@ -1811,11 +1813,20 @@ llseek (unsigned int fd, loff_t offset, unsigned int whence)
|
||||||
|
loff_t result;
|
||||||
|
int retval;
|
||||||
|
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
|
||||||
|
retval = _llseek(fd,
|
||||||
|
((unsigned long long)offset) >> 32,
|
||||||
|
((unsigned long long)offset) & 0xffffffff,
|
||||||
|
&result,
|
||||||
|
whence);
|
||||||
|
+#else
|
||||||
|
+ retval = syscall(__NR__llseek, fd,
|
||||||
|
+ ((unsigned long long)offset) >> 32,
|
||||||
|
+ ((unsigned long long)offset) & 0xffffffff,
|
||||||
|
+ &result,
|
||||||
|
+ whence);
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
return (retval==-1 ? (loff_t) retval : result);
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.25.1
|
||||||
|
|
@ -0,0 +1,47 @@
|
|||||||
|
From 1af84a759edaf5029fd8531363538e7dee970d34 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Takamasa Takenaka <takamasa.takenaka@windriver.com>
|
||||||
|
Date: Tue, 5 Oct 2021 12:00:52 -0300
|
||||||
|
Subject: [PATCH 2/2] add resizepart.sh
|
||||||
|
|
||||||
|
resizepart.sh is a script without needing to handle command
|
||||||
|
prompts interactively (clean copied from CentOS)
|
||||||
|
|
||||||
|
Signed-off-by: Takamasa Takenaka <takamasa.takenaka@windriver.com>
|
||||||
|
---
|
||||||
|
resizepart.sh | 24 ++++++++++++++++++++++++
|
||||||
|
1 file changed, 24 insertions(+)
|
||||||
|
create mode 100644 resizepart.sh
|
||||||
|
|
||||||
|
diff --git a/resizepart.sh b/resizepart.sh
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..29be2a0
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/resizepart.sh
|
||||||
|
@@ -0,0 +1,24 @@
|
||||||
|
+#!/bin/bash
|
||||||
|
+
|
||||||
|
+################################################################################
|
||||||
|
+# Copyright (c) 2015 Wind River Systems, Inc.
|
||||||
|
+#
|
||||||
|
+# SPDX-License-Identifier: Apache-2.0
|
||||||
|
+#
|
||||||
|
+################################################################################
|
||||||
|
+
|
||||||
|
+DEVICE=$1
|
||||||
|
+PARTITION=$2
|
||||||
|
+SIZE=$(blockdev --getsize64 ${DEVICE})
|
||||||
|
+SIZE_MB=$((SIZE / (1024*1024)))
|
||||||
|
+
|
||||||
|
+## This is a workaround to allow cloud-init to invoke parted without needing to
|
||||||
|
+## handle command prompts interactively. Support for non-interactive parted
|
||||||
|
+## commands are not supported on mounted partitions.
|
||||||
|
+##
|
||||||
|
+/usr/sbin/parted ---pretend-input-tty ${DEVICE} resizepart ${PARTITION} << EOF
|
||||||
|
+yes
|
||||||
|
+${SIZE_MB}
|
||||||
|
+EOF
|
||||||
|
+
|
||||||
|
+exit $?
|
||||||
|
--
|
||||||
|
2.25.1
|
||||||
|
|
2
filesystem/parted/debian/patches/series
Normal file
2
filesystem/parted/debian/patches/series
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
0001-syscalls.patch
|
||||||
|
0002-add-resizepart.sh.patch
|
Loading…
Reference in New Issue
Block a user