Flashing to Byzantium

In order to build the uuu tool I need to install these packages.

sudo apt install git
sudo apt install cmake
sudo apt install libusb-1.0-0-dev
sudo apt install libzip-dev
sudo apt install libbz2-dev

But the last two are not available for me.

Loading repository data...
Reading installed packages...
'libzip-dev' not found in package names. Trying capabilities.
No provider of 'libzip-dev' found.
Resolving package dependencies...
Nothing to do.
gantz@localhost:~> sudo zypper install libbz2-dev
Loading repository data...
Reading installed packages...
'libbz2-dev' not found in package names. Trying capabilities.
No provider of 'libbz2-dev' found.
Resolving package dependencies...
Nothing to do.

You could try the package name “libzip-devel”

Which GNU/Linux distribution (or other OS) are you using?

I dual boot Windows 8.1 with OpenSuse Leap 15.3

EDIT: Ok now it was able to find them. Thank you I have to say these names are terrible though. Hard to spell and remember.

I did that last step in order to build the UUU tool and this is what I got. Don’t understand what any of this means.

Cloning into 'mfgtools'...
warning: redirecting to https://source.puri.sm/Librem5/mfgtools.git/
remote: Enumerating objects: 2991, done.
remote: Total 2991 (delta 0), reused 0 (delta 0), pack-reused 2991
Receiving objects: 100% (2991/2991), 3.31 MiB | 67.00 KiB/s, done.
Resolving deltas: 100% (2084/2084), done.
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
  No CMAKE_C_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error in CMakeLists.txt:
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/home/gantz/git/librem5-devkit-tools/build/mfgtools/CMakeFiles/CMakeOutput.log".
See also "/home/gantz/git/librem5-devkit-tools/build/mfgtools/CMakeFiles/CMakeError.log".
make: *** No targets specified and no makefile found.  Stop.
[sudo] password for root:

Just flashed my Amber Librem 5 to Byzantium with LUKS encryption.

Here is a summary of some points that it took me some time to gather together. None of this is really new information. I just thought it would be good to put it all in one post. Most of this has been covered in this thread or elsewhere on this forum already.

General points

Flashing with LUKS encryption

  • When flashing using the librem5-flash-image script, remember to specify --variant luks if you want LUKS encryption.
  • It’s known that flashing the LUKS image results in an insecure cloned master key for the encryption. This is not the encryption passphrase. The passphrase can be easily changed (and indeed you can have more than one passphrase at a time), but the master key can’t be changed without re-writing all the encrypted data on disk, and you can’t do that while the encrypted filesystem is mounted, so it’s best done before flashing the image.
  • I first ran the librem5-flash-image script with --skip-cleanup to obtain the image and a uuu script (.lst file).
  • To re-encrypt with a new master key, I mapped the image as a loop device and ran cryptsetup-reencrypt on it. (References: 1, 2)
  • The re-encrypted image can then be flashed by running uuu directly, giving uuu the path to the uuu script as its only argument.
  • The encrypted image does not expand to fill the available space by default. I used cfdisk on the phone to delete /dev/mmcblk0p2 and to make a new partition filling the space. Then I deleted /etc/resize_rootfs-resized and rebooted the phone. This caused the partition to be resized to fill the available space. (References: 1, 2)

My first impression is that Byzantium seems more polished and complete than Amber. I now need to restore my data and selected configurations before trying it out properly.

9 Likes

This looks overly complicated. Could you help me to flash mine to Byzantium? I’m basically stuck on the first bullet point. The post above yours is what I got and I dunno if that worked properly or not.

It looks as though you are probably missing a compiler and need to install one. Either that or cmake can’t find the compiler you already have.

On PureOS, or another Debian- or Ubuntu-based distro, I would try sudo apt install build-essential to fix that.

It looks like you are running openSUSE, though. I found a forum thread asking what’s the equivalent to build-essential in openSUSE. Apparently the equivalent is sudo zypper install --type pattern devel_basis, but I have no idea how accurate that information is, because I haven’t used openSUSE in more than a decade. But hopefully it’s at least a starting point to figuring out what to do.

The output you’ve posted looks like it came from both git and cmake. If installing a compiler doesn’t solve the problem, it might help if you could clarify what commands you have run, and precisely how you went about running them, and which output came after which command.

Note that I am likely to be unable to come to this forum again until next Friday.

2 Likes

I installed the devel_basis pattern and this is what I got now. It’s still not happy.

gantz@localhost:~/git/librem5-devkit-tools> ./scripts/build_uuu.sh -i
fatal: destination path 'mfgtools' already exists and is not an empty directory.
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'libusb-1.0>=1.0.16'
--   No package 'libusb-1.0' found
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:467 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPkgConfig.cmake:647 (_pkg_check_modules_internal)
  libuuu/CMakeLists.txt:7 (pkg_check_modules)


-- Configuring incomplete, errors occurred!
See also "/home/gantz/git/librem5-devkit-tools/build/mfgtools/CMakeFiles/CMakeOutput.log".
See also "/home/gantz/git/librem5-devkit-tools/build/mfgtools/CMakeFiles/CMakeError.log".
make: *** No targets specified and no makefile found.  Stop.

Looks like you are trying to build uuu from source. I don’t use openSUSE but it looks like a package is availabe: https://software.opensuse.org/package/mfgtools so I assume rather then build it from source you can just install mfgtools. You can also keep trying to build from source. That error message is saying that you need to install libusb-1.0.
edit - I actually think it would be great idea to mention in the docs that uuu in other distros is commonly mfgtools

You will also struggle when you attempt to run the actual flashing script since you cannot run sudo apt build-dep . before hand. You’ll want to install these packages before you run the script. https://source.puri.sm/Librem5/librem5-flash-image/-/blob/main/requirements.txt

That mfgtools package is only for Tumbleweed. I use Leap 15.3 So I tried to install the community version for Leap but there is problem with the repository.

An error occurred while initialising the software repository.

Details:

https-download.opensuse.org-8c7c0683: [https-download.opensuse.org-8c7c0683|https://download.opensuse.org/repositories/SUSE:/SLE-15-SP1:/Update/pool-leap-15.3/] Valid metadata not found at specified URL

History:

- [https-download.opensuse.org-8c7c0683|https://download.opensuse.org/repositories/SUSE:/SLE-15-SP1:/Update/pool-leap-15.3/] Repository type can't be determined.

Try again?

EDIT: Installation was only partially successful. So it did install in the end but did not add all the repositories which should be fine.

Ah I see. My other thread comment is likey no good to you aswell. The mfgtools project is here: https://github.com/NXPmicro/mfgtools

You could download one of the assets there - https://github.com/NXPmicro/mfgtools/releases/download/uuu_1.4.165/uuu

  • make it executable chmod +x uuu
  • move it somewhere the path will pick it up like mv uuu ~/.local/bin
  • Restart whatever terminal application you are using.
  • Try uuu

Do I download that text file from this link or do I need to install them individually from my repository?

The packages you need to run that script are all listed there. So you have to find the package that in each of those line items and install them individually.
coloredlogs for example would be this package: https://software.opensuse.org/package/python3-coloredlogs
Which apparently has no offical package for you either… :frowning:

For packages that are available for a newer version of my OS I just try to build tha package source. I’m not sure how it works on SUSE, but on Fedora you need to find the .src.rpm and then use rpmbuild. Usually works.

I did all of that. And when I type uuu into the terminal I get this.

gantz@localhost:~> uuu
If 'uuu' is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf uuu

Can you give me the output of: echo $PATH

gantz@localhost:~> echo $PATH
/home/gantz/bin:/usr/local/bin:/usr/bin:/bin

I did find those packages in Yast. They all just have prefix called phyton2 or phyton3. That website is probably not updated very well. The question now is which version do I install? Python2 or 3.

Okay sorry. I guess that’s not in your path. ‘mv ~/.local/bin/uuu ~/bin’

You’d need the python3 versions