Cryptsetup Unsupported LUKS version 2

So in the rootfile what directory does it have for that shared library?

In your ./configure line did you set --prefix=/usr , most packages require the prefix to be set to that otherwise the install ends up in the wrong place.

Maybe you could show the rootfile that you ended up with.

1 Like

rootfile- “cryptsetup-2.4.2”

#usr/include/libcryptsetup.h
usr/lib/cryptsetup
#usr/lib/cryptsetup/libcryptsetup-token-ssh.la
#usr/lib/cryptsetup/libcryptsetup-token-ssh.so
#usr/lib/libcryptsetup.la
#usr/lib/libcryptsetup.so
#usr/lib/libcryptsetup.so.12
#usr/lib/libcryptsetup.so.12.7.0
#usr/lib/pkgconfig/libcryptsetup.pc
usr/sbin/cryptsetup
usr/sbin/cryptsetup-reencrypt
usr/sbin/cryptsetup-ssh
usr/sbin/integritysetup
usr/sbin/veritysetup
usr/share/locale/cs/LC_MESSAGES/cryptsetup.mo
usr/share/locale/da/LC_MESSAGES/cryptsetup.mo
usr/share/locale/de/LC_MESSAGES/cryptsetup.mo
usr/share/locale/es/LC_MESSAGES/cryptsetup.mo
usr/share/locale/fi/LC_MESSAGES/cryptsetup.mo
usr/share/locale/fr/LC_MESSAGES/cryptsetup.mo
usr/share/locale/id/LC_MESSAGES/cryptsetup.mo
usr/share/locale/it/LC_MESSAGES/cryptsetup.mo
usr/share/locale/ja/LC_MESSAGES/cryptsetup.mo
usr/share/locale/nl/LC_MESSAGES/cryptsetup.mo
usr/share/locale/pl/LC_MESSAGES/cryptsetup.mo
usr/share/locale/pt_BR/LC_MESSAGES/cryptsetup.mo
usr/share/locale/ru/LC_MESSAGES/cryptsetup.mo
usr/share/locale/sr/LC_MESSAGES/cryptsetup.mo
usr/share/locale/sv/LC_MESSAGES/cryptsetup.mo
usr/share/locale/uk/LC_MESSAGES/cryptsetup.mo
usr/share/locale/vi/LC_MESSAGES/cryptsetup.mo
usr/share/locale/zh_CN/LC_MESSAGES/cryptsetup.mo
#usr/share/man/man8/cryptsetup-reencrypt.8
#usr/share/man/man8/cryptsetup-ssh.8
#usr/share/man/man8/cryptsetup.8
#usr/share/man/man8/integritysetup.8
#usr/share/man/man8/veritysetup.8

lfs- “cryptsetup”

# 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) && ./configure
	cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE)
	cd $(DIR_APP) && make install
	@rm -rf $(DIR_APP)
	@$(POSTBUILD)

does the line have to be adjusted like this? "./configure --prefix=/usr "

I want to try Ubuntu again

In my Ubuntu-20.04.3 there is no “python-urlgrabber”, “git-core”.
Do I need these packages to build the build environment?
Where can I get these packages from?

No. They are for older versions.

This files should not excluded. remove the “#”
and add one to all the cryptsetup.mo files that are not really needed.

2 Likes

I have apparently misunderstood…

You will need to remove the prepended plus (+) or minus (-) sign and, possibly, to comment out some files.

Rule-of-thumb is as follows:

    remove all lines with a minus (-) sign.
    remove all plus (+) signs.
    comment out (prepending a hash (#) sign) all lines pointing to directories.
    comment out (prepending a hash (#) sign) all lines pointing to "useless" files.

Useless files are:

    manpages (are usually located in /usr/share/man)
    pkg-config files ( are usually located in /usr/lib/pkgconfig)
    *.so files (are usually located in /usr/lib)
    *.a files (are usually located in /usr/lib)
    *.la files (are usually located in /usr/lib)
    *.h files or header files (are usually located in /usr/include)
    *.m4 files (are usually located in /usr/share/aclocal)

1 Like

It is just the *.so files that are “useless”
.so.12 and .so.12.7.0 need to be left uncommented.

It is also just a guideline. Some packages follow non standard naming and could have name.12.7.0.so as the library file that is required and name.so as the one that should be commented out.

1 Like

Now it’s working! ((=

Thanks again for the quick help!

In Ubuntu I get this error:

Packaged toolchain compilation                                                                                                                                
./make.sh: Zeile 1740: zstd: Befehl nicht gefunden
tar: Das sieht nicht wie ein „tar“-Archiv aus.
tar: Beende mit Fehlerstatus aufgrund vorheriger Fehler
Checking for necessary space on disk                                                                                                                         [ DONE ]
chroot: failed to run command 'env': No such file or directory
Building LFS                                                                                                                                                  
stage2                                                                                                                                                       [ FAIL ]

    Jan  6 20:42:21: Building stage2 chroot: failed to run command 'env': No such file or directory

ERROR: Building stage2                                                                                                                                       [ FAIL ]
    Check /home/pavi/sandbox/ipfire-2.x/log/_build.base.log for errors if applicable                                                                         [ FAIL ]

Where exactly do I have to change that?

There is a Symlink "/bin/sh" that points to "/bin/dash". This will cause an error if you compile glibc. Please change "/bin/sh" to "/bin/bash".

Ubuntu 11.04 needs some additional symlinks to asm header and glibc:

This looks to me like you did not run ./make.sh gettoolchain before running ./make.sh build
and so it has tried to build the toolchain. This requires additional packages to be installed on your computer. The message suggests that at least zstd is required.

I would suggest downloading the toolchain rather than trying to build it.

if you run ls -hal /bin/sh you will get a message similar to this
lrwxrwxrwx 1 root root 4 Nov 21 20:31 /bin/sh -> bash
For me this is showing that there is a symlink from sh to bash.
If yours shows a symlink from sh to dash then you need to change the symlink from dash to bash

ln -sf /bin/bash /bin/sh
ln is the command for creating a link
-sf ---- s is to create a softlink and f is to force a change to the link. If the link already exists it will not be changed without using the f
the first command is the source file that you want to make a link to
the second command is the symbolic link name that you want to use

You need zstd compression on the host. Install with

sudo apt install zstd

This was only a problem if you want compile the toolchain from source. And it is also obsolete with newer ubuntu versions i think.

that was exactly what was missing.

Thank you!

Thank you!

I don’t get a * -ipfire package built under Ubuntu.

taglib (1.12)                                                                                                                                    [        0 ][ DONE ]
transmission (3.00)                                                                                                                              [        1 ][ DONE ]
stress (1.0.4)                                                                                                                                   [        0 ][ DONE ]
Checking Logfiles for new Files                                                                                                                               
Changes in cryptsetup-2.4.2 check rootfile!
Rootfile for cryptsetup-2.4.2_missing_rootfile missing!
*** Build finished in 4:12:00                                  

Why is no “cryptsetup-2.4.2-2.ipfire” created under Ubuntu?

This indicates that in this build something changed in your rootfile compared to what is in the file in config/rootfiles/packages
Look in the cryptseup-2.4.2 file in log/ for any lines starting with +
These have changed compared to the cryptsetup file in config/rootfiles/packages/
I believe that a package would not be built if there were changes in the rootfile because then it would not be clear which files should be included in the .ipfire file to be installed.

This suggests that the file in /log with _missing_rootfile at the end of it was still there when you carried out a new build.
Did you run a ./make.sh clean before running another ./make.sh build ? That would have cleared out the log directory removing the _rootfile_missing files which then should not be recreated if you have a rootfile in the correct directory.

Unfortunately no success. After 3 attempts, I always get the same message:

taglib (1.12)                                                                                                                                    [        0 ][ DONE ]
transmission (3.00)                                                                                                                              [        1 ][ DONE ]
stress (1.0.4)                                                                                                                                   [        0 ][ DONE ]
Checking Logfiles for new Files                                                                                                                               
Changes in cryptsetup-2.4.2 check rootfile!
Rootfile for cryptsetup-2.4.2_missing_rootfile missing!
*** Build finished in 4:08:13                           

All other packages * ipfire are in packages / only no “cryptsetup”
Why is it that the building does not work under Ubuntu?

Just to confirm, the filenames for your rootfile and lfs file are just “cryptsetup”.
Just checking if there might have been a typo along the way and so cryptsetup rootfile is not found by make.sh build

If the answer is yes then you will need to look through the _build.packages.log in the log directory to see what the problem is.

Edit:
Looking in the _build.packages.log file won’t help because if there is a _missing_rootfile entry in the log directory it will not create the package file.

There has to be an error with the naming of the rootfile. That is the only reason for getting a _missing_rootfile message, that the make.sh script cannot find a rootfile called exactly cryptsetup.

Maybe do do a ls -hal config/rootfiles/packages/crypt* . There are no other rootfiles in the packages directory starting with crypt.

I just did a listing in /packages/ and in /common/ looking for any filename with crypt in it, irrespective of case or other characters in between the letters and in my standard system there was nothing in /packages/ and only the following in /common/

Crypt-PasswdMD5
libgcrypt
libxcrypt

Try the following command to check for anything with the letters crypt in either lower or upper case in your packages directory.
ls -hal config/rootfiles/packages/*[cC]*[rR]*[yY]*[pP]*[tT]*

:~/sandbox/ipfire-2.x$ ls -hal config/rootfiles/packages/*[cC]*[rR]*[yY]*[pP]*[tT]*
-rw-r--r-- 1 root root 1,4K Jan  9 07:54 config/rootfiles/packages/cryptsetup-2.4.2
ls -la lfs/cryptsetup 
-rw-r--r-- 1 root root 3246 Jan  7 20:53 lfs/cryptsetup
 ls -la config/rootfiles/packages/crypt*
-rw-r--r-- 1 root root 1421 Jan  9 07:54 config/rootfiles/packages/cryptsetup-2.4.2

That is the reason you have a problem. The rootfile is called cryptsetup-2.4.2 and the lfs is called cryptsetup
These two names must be the same and the same as the name used in make.sh in the lfs2make line.

I suspect you edited the rootfile from the log directory and then svaed it in the config/rootfiles/packages directory but with the same name as in the log directory. This has to be “saved as” with any version numbers removed.

Change the filename from cryptsetup-2.4.2 to cryptsetup and your build should work fine.