blocks icon indicating copy to clipboard operation
blocks copied to clipboard

Updated fork out there anywhere?

Open thenebular opened this issue 1 year ago • 5 comments

In issue #41 on Aug 17th 2021 @MurzNN commented that @viccie30 had forked the project with preparations to package it for Debian. I looked at @viccie30's profile and I didn't find anything relating to blocks.

Does anyone know if there's a fork out there that will allow installation on a current distro?

thenebular avatar Jan 06 '23 21:01 thenebular

I think I did fork it around that time, but I haven't used this software in quite some time, so I probably deleted my fork sometime between then and now.

viccie30 avatar Jan 06 '23 22:01 viccie30

In case it helps, I followed the instructions in that thread and converting a partition seems to mostly work, after installing a few packages (libparted-dev, libaugeas0, libpython3-dev, supermin). I had to use a CFLAGS override to install requirements: CFLAGS=-fcommon pip3 install -r requirements.txt This appears to be due to the issue mentioned at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=957720 and the workaround comes from https://bugs.gentoo.org/706904

I also had to add BLK_DEV_LOOP to my kernel compile, because I didn't have it, but you probably won't need to do that.

Unfortunately it won't let me make the change to a running system (understandable) and getting supermin working seems infeasible unless the dependency can be updated to v5 (per #39), so I'll have to see about getting it to work on a live microSD/USB install, or get my x32 install working again - at least it shares the same 64-bit kernel.

GreenReaper avatar Jan 12 '23 00:01 GreenReaper

In case it helps, I followed the instructions in that thread and converting a partition seems to mostly work, after installing a few packages (libparted-dev, libaugeas0, libpython3-dev, supermin). I had to use a CFLAGS override to install requirements: CFLAGS=-fcommon pip3 install -r requirements.txt This appears to be due to the issue mentioned at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=957720 and the workaround comes from https://bugs.gentoo.org/706904

I also had to add BLK_DEV_LOOP to my kernel compile, because I didn't have it, but you probably won't need to do that.

Unfortunately it won't let me make the change to a running system (understandable) and getting supermin working seems infeasible unless the dependency can be updated to v5 (per #39), so I'll have to see about getting it to work on a live microSD/USB install, or get my x32 install working again - at least it shares the same 64-bit kernel.

If I were to run this on a USB, what would be the entire process? I am trying to set one of my SSDs as bcache but has data in it as well as all my HDDs

ramzh avatar Jan 16 '23 19:01 ramzh

I'm also struggling to use this under Amazon Linux 2, any tips are more than welcome.

cristim avatar Apr 30 '23 21:04 cristim

I did a little progress:

Seems like supermin5 no longer supports --names and needs to be called with package names coming from a file like this:

      [sm_cmd] + '--use-installed --prepare --include-packagelist package_names.txt  -o'.split() + [smd])

Therefore I created a function that creates the file:

def write_list_to_file(file_name, pkg_list):
        with open(file_name, 'w') as file:
            for pkg in pkg_list:
                file.write(f'{pkg}\n')

The problem is then blocks call it with a bunch of packages, many of which are not available on my Amazon Linux2 system:

python3-blocks
util-linux
dash
mount
base-files
libc-bin
nilfs-tools
reiserfsprogs
xfsprogs
e2fsprogs
btrfs-tools
lvm2
cryptsetup-bin
bcache-tools
yum install `cat package_names.txt`    
No package python3-blocks available.
Package util-linux-2.30.2-2.amzn2.0.11.x86_64 already installed and latest version
No package base-files available.
No package libc-bin available.
No package nilfs-tools available.
No package reiserfsprogs available.
Package xfsprogs-5.0.0-10.amzn2.0.1.x86_64 already installed and latest version
Package e2fsprogs-1.42.9-19.amzn2.0.1.x86_64 already installed and latest version
No package btrfs-tools available.
Package 7:lvm2-2.02.187-6.amzn2.5.x86_64 already installed and latest version
No package cryptsetup-bin available.
Nothing to do

I wonder which of those packages we really need and which are optional.

cristim avatar Apr 30 '23 22:04 cristim

Working on Proxmox 8 (debian 12):

sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev -y
wget https://www.python.org/ftp/python/3.8.17/Python-3.8.17.tar.xz
tar xvf Python-3.8.17.tar.xz
mv Python-3.8.17 /usr/local/share/python3.8
cd /usr/local/share/python3.8
./configure --enable-optimizations --enable-shared
make -j5
sudo make altinstall
ldconfig /usr/local/share/python3.8
wget https://bootstrap.pypa.io/get-pip.py
python3.8 get-pip.py
python3.8 -m pip install --upgrade pip

apt install lvm2 python3-pip git libparted-dev libaugeas0 pkg-config gcc cryptsetup lvm2 liblzo2-dev nilfs-tools reiserfsprogs xfsprogs e2fsprogs vim

cd /root
git clone https://github.com/g2p/blocks
cd blocks
CFLAGS=-fcommon python3.8 -m pip install -r requirements.txt --break-system-packages

vim /root/blocks/src/blocks/blocks/__main__.py
search for:
exit_stack.callback(lambda: quiet_call(cmd))
add this line BEFORE IT:
time.sleep(5)

blocks to-lvm  /dev/sdxx

hcharbonnier avatar Feb 22 '24 19:02 hcharbonnier