From: Michael Tremer Date: Tue, 5 Jan 2021 16:53:36 +0000 (+0000) Subject: Package extended attributes in distro.img and Core Updates X-Git-Tag: v2.25-core155~296 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=b37678e92231a7497820b2f39f040cccacfd808e Package extended attributes in distro.img and Core Updates System capabilities are stored in extended file system attributes which are by default not stored in tar balls. This patch ensures that they are packaged and extracted. Signed-off-by: Michael Tremer --- diff --git a/config/rootfiles/core/154/filelists/files b/config/rootfiles/core/154/filelists/files index 1861bb9255..dff15547b8 100644 --- a/config/rootfiles/core/154/filelists/files +++ b/config/rootfiles/core/154/filelists/files @@ -1,6 +1,7 @@ etc/system-release etc/issue etc/os-release +opt/pakfire/lib/functions.sh srv/web/ipfire/cgi-bin/country.cgi srv/web/ipfire/cgi-bin/credits.cgi srv/web/ipfire/cgi-bin/dhcp.cgi diff --git a/lfs/Config b/lfs/Config index b16da91bdb..524ba35c0d 100644 --- a/lfs/Config +++ b/lfs/Config @@ -70,7 +70,10 @@ else PREFIX = /usr endif -TAR_OPTIONS = --xz +TAR_OPTIONS = \ + --format=pax \ + --acls \ + --xattrs --xattrs-include='*' # URLs that are common sources of downloads. If you're having trouble with # a site you should change its URL to that of a suitable mirror site. diff --git a/lfs/cdrom b/lfs/cdrom index f18b80a033..a764416d03 100644 --- a/lfs/cdrom +++ b/lfs/cdrom @@ -32,12 +32,6 @@ TARGET = $(DIR_INFO)/$(THISAPP) # Fail when there is an error in the tar pipe SHELL=/bin/bash -o pipefail -ifeq "$(BUILD_PLATFORM)" "arm" - TAR_OPTIONS = -else - TAR_OPTIONS = --lzma -endif - HAS_MEMTEST = 0 HAS_IPXE = 0 HAS_ISOLINUX = 0 @@ -166,12 +160,12 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) # Compress root filesystem # Reason for this tar+untar+tar is removing of entries listed two or more in src/ROOTFILES rm -rf $(DIR_TMP)/root && mkdir -p $(DIR_TMP)/root - tar -c --exclude='#*' --exclude='proc/*' --exclude='dev/pts/*' --exclude='tmp/*' \ + tar $(TAR_OPTIONS) -c --exclude='#*' --exclude='proc/*' --exclude='dev/pts/*' --exclude='tmp/*' \ --exclude='__pycache__' \ - -C / --files-from=$(DIR_TMP)/ROOTFILES | tar -x -C $(DIR_TMP)/root + -C / --files-from=$(DIR_TMP)/ROOTFILES | tar $(TAR_OPTIONS) -x -C $(DIR_TMP)/root rm -f $(DIR_TMP)/ROOTFILES mkdir $(DIR_TMP)/root/sys - cd $(DIR_TMP)/root && tar cf - * | xz $(XZ_OPT) > $(DIR_TMP)/cdrom/distro.img + cd $(DIR_TMP)/root && tar $(TAR_OPTIONS) -cf - * | xz $(XZ_OPT) > $(DIR_TMP)/cdrom/distro.img rm -rf $(DIR_TMP)/root # Other files diff --git a/lfs/core-updates b/lfs/core-updates index e0dfa69f4a..fa8b36d501 100644 --- a/lfs/core-updates +++ b/lfs/core-updates @@ -28,7 +28,6 @@ VER = ipfire THISAPP = core-updates TARGET = $(DIR_INFO)/$(THISAPP) -TAR_OPTIONS = --xz ############################################################################### # Top-level Rules @@ -72,13 +71,13 @@ core/%: sed -e "s/KVER/$(KVER)/g" -i /tmp/ROOTFILES #Remove doubled files with tar/untar/tar to save space - tar -c --exclude='proc/*' --exclude='tmp/ROOTFILES' --exclude='__pycache__' --exclude='#*' --exclude='dev/pts/*' \ + tar $(TAR_OPTIONS) -c --exclude='proc/*' --exclude='tmp/ROOTFILES' --exclude='__pycache__' --exclude='#*' --exclude='dev/pts/*' \ --exclude-from=$(DIR_SRC)/config/rootfiles/$@/exclude \ -C / --files-from=/tmp/ROOTFILES -f /$(SNAME).tar mv -f /tmp/ROOTFILES /install/packages/package/ROOTFILES - tar -p --numeric-owner -x -C /tmp -f /$(SNAME).tar + tar $(TAR_OPTIONS) -p --numeric-owner -x -C /tmp -f /$(SNAME).tar rm -f /$(SNAME).tar - cd /tmp && XZ_OPT="$(XZ_OPT)" tar cJf /install/packages/package/files.tar.xz $(TAR_OPTIONS) * && rm -rf * + cd /tmp && XZ_OPT="$(XZ_OPT)" tar $(TAR_OPTIONS) -cJf /install/packages/package/files.tar.xz $(TAR_OPTIONS) * && rm -rf * cat /install/packages/package/ROOTFILES | grep -v "#" > /install/packages/package/ROOTFILES.tmp rm /install/packages/package/ROOTFILES mv /install/packages/package/ROOTFILES.tmp /install/packages/package/ROOTFILES diff --git a/lfs/flash-images b/lfs/flash-images index 5f39c488f6..9fd9250553 100644 --- a/lfs/flash-images +++ b/lfs/flash-images @@ -152,9 +152,9 @@ endif # Install IPFire ifneq "$(BUILD_PLATFORM)" "arm" - tar -x --xz -C $(MNThdd)/ -f $(DIR_TMP)/cdrom/distro.img + tar $(TAR_OPTIONS) -x --xz -C $(MNThdd)/ -f $(DIR_TMP)/cdrom/distro.img else - tar -x -C $(MNThdd)/ -f $(DIR_TMP)/cdrom/distro.img + tar $(TAR_OPTIONS) -x -C $(MNThdd)/ -f $(DIR_TMP)/cdrom/distro.img endif -touch $(MNThdd)/lib/modules/$(KVER)-ipfire/modules.dep mkdir $(MNThdd)/proc diff --git a/src/installer/main.c b/src/installer/main.c index 3eff481b05..00d1728882 100644 --- a/src/installer/main.c +++ b/src/installer/main.c @@ -781,7 +781,7 @@ int main(int argc, char *argv[]) { // Extract files... snprintf(commandstring, STRING_SIZE, - "/bin/tar -C /harddisk -xvf /cdrom/distro.img --xz 2>/dev/null"); + "/bin/tar --acls --xattrs --xattrs-include='*' -C /harddisk -xvf /cdrom/distro.img --xz 2>/dev/null"); if (runcommandwithprogress(60, 4, title, commandstring, INST_FILECOUNT, _("Installing the system..."), logfile)) { diff --git a/src/pakfire/lib/functions.sh b/src/pakfire/lib/functions.sh index 375169760e..5918649db0 100644 --- a/src/pakfire/lib/functions.sh +++ b/src/pakfire/lib/functions.sh @@ -24,7 +24,8 @@ extract_files() { echo "Extracting files..." - tar xavf /opt/pakfire/tmp/files* --no-overwrite-dir -p --numeric-owner -C / + tar --acls --xattrs --xattrs-include='*' \ + -xavf /opt/pakfire/tmp/files* --no-overwrite-dir -p --numeric-owner -C / echo "...Finished." }