Cryptsetup Unsupported LUKS version 2

Hi,

Happy and healthy New Year.

How can I install version 2. (cryptsetup) in the Ipfire.

kind regards

If you want to build it as an addon you will need to follow the wki instructions on building an addon
https://wiki.ipfire.org/devel/ipfire-2-x/addon-howto

and you will need to have a build system to do it with.
https://wiki.ipfire.org/devel/ipfire-2-x/build-howto

2 Likes

Can I also do it in “/opt/pakfire/tmp/”
install?
It’s been a little longer.

/opt/pakfire/tmp is where you do the extraction and install of your built addon (addon-name.ipfire file).

If your question is if you can do the build of the addon on IPFire then you can’t do that on the standard IPFire as there are no compilers available on it as they are not wise to have on a production firewall.

However, as per the build system link you can do the addon build on a system with IPFire installed with the addition of installing git and make. Then need to do the git checkout, download the sources and the toolchain. Then you will have a system ready to do your addon build on.

1 Like

Thank you for your help!

Is there already a ready-made package “cryptsetup-2. *. *. Ipfire” that I can use?

No. cryptsetup-2 is not a standard addon for IPFire. That is why you would need to build it yourself if you have a special requirement.

1 Like

I have Ubuntu 20.04.3 because this link doesn’t exist ("/ bin / dash")
Can you briefly describe how I have to proceed?
Preferably on the IPFIRE system right away.
Are the instructions up to date?

thank you

If /bin/dash does not exist then presumably on your system /bin/sh points to /bin/bash in which case everything is okay with that.

Check if in your ubuntu you have
/usr/include/asm-generic and
/usr/lib/i386-linux-gnu/libc.so

If yes then you will need to make the symbolic links mentioned for Ubuntu 11.04
If you have
/usr/include/asm and
/usr/lib/libc.so
then no symbolic links are needed.

You will need to install the additional packages mentioned in the wiki.

Then you will need to create a git clone of the IPFire2.x repository on your system somewhere.
I have placed it in my home directory under a directory called sandbox but you can decide where you want to keep it.
This tells you how to get the git clone
https://wiki.ipfire.org/devel/sources

You will also need to set up your git environment
https://wiki.ipfire.org/devel/git/setup
As you won’t be doing patches you don’t need to set up the email section, just the first part about introducing yourself.

Then you will need to do a first full build of IPFire before starting with your addon.

sudo ./make.sh downloadsrc
sudo ./make.sh gettoolchain
sudo ./make.sh build

The first time will be longer as there will be no cache stored.

After this first build is completed then you can follow the addon section.

Generally the instructions are up to date. I have used it for addons myself and others in the forum also.
You need to have some familiarity with building from source to be able to fault find if something goes wrong but you can also come back to this forum for help.

You should be familiar with building the cryptsetup-2 package from source before trying it out in an IPFire build to ensure that you have correct commands entered into the LFS file that you will need to create and maximise the chances of the addon build running without hiccups.

Good luck.

PS: I run with an i5 system and the first build for me was around 6 hours but subsequent builds with modifications to some packages typically takes 2.25 to 2.75 hours.

1 Like

Thank you for your help!

build is now running, let me know if it worked. ((=

1 Like

What did I forget?


cryptsetup (2.4.2)                                                                                                                                
    Jan  5 09:59:27: Building libloc libloc-0.9.8.tar.gz checksum OK
    location-2021-09-25.db.xz checksum OK
    + cd /usr/src/lfs
    + make -f libloc LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 09:59:27: Building ncdu ncdu-1.16.tar.gz checksum OK
    + cd /usr/src/lfs
    + make -f ncdu LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 09:59:28: Building lshw lshw-B.02.19.2.tar.gz checksum OK
    + cd /usr/src/lfs
    + make -f lshw LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 09:59:28: Building socat socat-1.7.3.4.tar.gz checksum OK
    + cd /usr/src/lfs
    + make -f socat LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 09:59:28: Building libcdada libcdada-0.3.5.tar.gz checksum OK
    + cd /usr/src/lfs
    + make -f libcdada LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 09:59:28: Building pmacct pmacct-1.7.6.tar.gz checksum OK
    + cd /usr/src/lfs
    + make -f pmacct LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 09:59:28: Building squid-asnbl squid-asnbl-0.2.3.tar.gz checksum OK
    + cd /usr/src/lfs
    + make -f squid-asnbl LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 09:59:28: Building cryptsetup cryptsetup:58: *** missing separator.  Stop.

ERROR: Download error in cryptsetup                                                                                                                          [ FAIL ]
    Check /var/sandbox/ipfire-2.x/log/_build.ipfire.log for errors if applicable                                                                             [ FAIL ]

What does DNS proxy mean in my compilation machine?

check the lfs file line 58
Missing separator is reported usually if you have used spaces instead of a tab or garbage at the end of a file.

2 Likes

Now comes this error.

cryptsetup (2.4.2)                                                                                                                               [        0 ][ FAIL ]

    Jan  5 10:52:52: Building lshw lshw-B.02.19.2.tar.gz checksum OK
    + cd /usr/src/lfs
    + make -f lshw LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 10:52:52: Building socat socat-1.7.3.4.tar.gz checksum OK
    + cd /usr/src/lfs
    + make -f socat LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 10:52:53: Building libcdada libcdada-0.3.5.tar.gz checksum OK
    + cd /usr/src/lfs
    + make -f libcdada LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 10:52:53: Building pmacct pmacct-1.7.6.tar.gz checksum OK
    + cd /usr/src/lfs
    + make -f pmacct LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 10:52:53: Building squid-asnbl squid-asnbl-0.2.3.tar.gz checksum OK
    + cd /usr/src/lfs
    + make -f squid-asnbl LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 10:52:53: Building cryptsetup cryptsetup-2.4.2.tar.xz checksum OK
    + cd /usr/src/lfs
    + make -f cryptsetup LFS_BASEDIR=/usr/src install
    ====================================== Installing cryptsetup-2.4.2 ...
    Install started; saving file list to /usr/src/lsalr ...
    
    gzip: stdin: not in gzip format
    tar: Child returned status 1
    tar: Error is not recoverable: exiting now
    make: *** [cryptsetup:79: /usr/src/log/cryptsetup-2.4.2] Error 2

ERROR: Building cryptsetup                                                                                                                                   [ FAIL ]
    Check /var/sandbox/ipfire-2.x/log/_build.ipfire.log for errors if applicable                                                                             [ FAIL ]

The parameters for tar are incorrect you try to unpack an xz file as gz.
use xaf instead. (a stands for autodetect.)

2 Likes

Thank you for your help!
Unfortunately I have to ask again.

cryptsetup (2.4.2)                                                                                                                               [        1 ][ FAIL ]

    Jan  5 11:30:23: Building lshw lshw-B.02.19.2.tar.gz checksum OK
    + cd /usr/src/lfs
    + make -f lshw LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 11:30:23: Building socat socat-1.7.3.4.tar.gz checksum OK
    + cd /usr/src/lfs
    + make -f socat LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 11:30:23: Building libcdada libcdada-0.3.5.tar.gz checksum OK
    + cd /usr/src/lfs
    + make -f libcdada LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 11:30:23: Building pmacct pmacct-1.7.6.tar.gz checksum OK
    + cd /usr/src/lfs
    + make -f pmacct LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 11:30:23: Building squid-asnbl squid-asnbl-0.2.3.tar.gz checksum OK
    + cd /usr/src/lfs
    + make -f squid-asnbl LFS_BASEDIR=/usr/src install
    make: Nothing to be done for 'install'.
    Jan  5 11:30:23: Building cryptsetup cryptsetup-2.4.2.tar.xz checksum OK
    + cd /usr/src/lfs
    + make -f cryptsetup LFS_BASEDIR=/usr/src install
    ====================================== Installing cryptsetup-2.4.2 ...
    Install started; saving file list to /usr/src/lsalr ...
    cd /usr/src/cryptsetup-2.4.2 && make -j4
    make[1]: Entering directory '/usr/src/cryptsetup-2.4.2'
    make[1]: *** No targets specified and no makefile found.  Stop.
    make[1]: Leaving directory '/usr/src/cryptsetup-2.4.2'
    make: *** [cryptsetup:80: /usr/src/log/cryptsetup-2.4.2] Error 2

ERROR: Building cryptsetup                                                                                                                                   [ FAIL ]
    Check /var/sandbox/ipfire-2.x/log/_build.ipfire.log for errors if applicable                                                                             [ FAIL ]
##############################################################################
#                                                                             #
# IPFire.org - A linux based firewall                                         #
# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
#                                                                             #
# 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 3 of the License, 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 <http://www.gnu.org/licenses/>.       #
#                                                                             #
###############################################################################

###############################################################################
# Definitions
###############################################################################

include Config

VER        = 2.4.2

THISAPP    = cryptsetup-$(VER)
DL_FILE    = $(THISAPP).tar.xz
#DL_FROM    = $(URL_IPFIRE)
DL_FROM    = https://www.kernel.org
DIR_APP    = $(DIR_SRC)/$(THISAPP)
TARGET     = $(DIR_INFO)/$(THISAPP)
PROG       = cryptsetup
PAK_VER    = 2

DEPS       = ""

###############################################################################
# Top-level Rules
###############################################################################

objects = $(DL_FILE)

$(DL_FILE) = $(DL_FROM)/$(DL_FILE)

$(DL_FILE)_MD5 = 151f8b52de89968cdee4ff0f832bcf38

install : $(TARGET)
check : $(patsubst %,$(DIR_CHK)/%,$(objects))

download :$(patsubst %,$(DIR_DL)/%,$(objects))

md5 : $(subst %,%_MD5,$(objects))

dist:.
	 $(PAK)

###############################################################################
# Downloading, checking, md5sum
###############################################################################

$(patsubst %,$(DIR_CHK)/%,$(objects)) :
    @$(CHECK)

$(patsubst %,$(DIR_DL)/%,$(objects)) :
    @$(LOAD)

$(subst %,%_MD5,$(objects)) :
		 @$(MD5)

###############################################################################
# Installation Details
###############################################################################

$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
	@$(PREBUILD)
	@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar xaf $(DIR_DL)/$(DL_FILE)
	cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE)
	cd $(DIR_APP) && ./getweb all
	cd $(DIR_APP) && make install
	@rm -rf $(DIR_APP)
	@$(POSTBUILD)

Looks like cryptsetup need more than a simple make to build.
check cryptsetups build documentation. Maybee you have to configure the source first or an other
buildsystem like cmake.

I have searched in the git and cryptsetup-1.0.6 which we have removed long time ago need ./configure before make.
https://git.ipfire.org/?p=ipfire-2.x.git;a=blob;f=lfs/cryptsetup;h=a70c021304524ba8f53a2757e3d1543207d46937;hb=a70c021304524ba8f53a2757e3d1543207d46937

./configure was missing. Thank you!
The build has now gone through, but I can’t
Find “cryptsetup-2.4.2.ipfire”.?

The build was not the last step. From the logs now you have to create a rootfile…

Check the “Package definition” here:

without rootfile it cannot create a package. Also the name should be
cryptodev-2.4.2-2.ipfire
because you have set PAK_VER to 2

2 Likes

cryptsetup is now under “ipfire-2.x / config / rootfiles / packages / cryptsetup”

How do I have to proceed now?
It is unclear what I mean with "copy src / paks / default to src / paks / "
should do.?

You need to copy src/paks/default directory to src/paks/cryptsetup directory as cryptsetup is the name of your addon and the lfs, rootfile and paks directories need to be consistent with the naming.

Then you need to decide if the default entries for install.sh and uninstall.sh your addon are sufficient or if you need additional commands. The update.sh script can be left as it is as it just runs the uninstall.sh script followed by the install.sh script. You can look at the other entries in the paks directory to see what has been done for different addons. The freeradius entry has some additional commands added over the default entry, as an example such as adding the links for auto startup at boot etc.

If you don’t put an entry into src/paks/ then IPFire will just use the default set anyway.
Looking in the git repository to 2009 when crypsetup was last in IPFire then there were no specific install.sh, uninstall.sh etc files in a cryptsetup directory so the default set would have been used. Probably makes sense to just not add any cryptsetup directory and the .ipfire file will have the default set.

1 Like
tar xvf /tmp/cryptsetup-2.4.2-2.ipfire 
ROOTFILES
files.tar.xz
install.sh
uninstall.sh
update.sh
cryptsetup luksOpen /dev/sdx1 Test
cryptsetup: error while loading shared libraries: libcryptsetup.so.12: cannot open shared object file: No such file or directory

This error occurs with the new version.?