pyavitz / debian-image-builder

Debian image builder for single board computers
Other
141 stars 33 forks source link

Normal user and higher loop number fixes #19

Closed 0n3man closed 2 years ago

0n3man commented 2 years ago

Makefile updated to allow running as normal user after having run as root shrink updated to allow for loop back devices with numbers greater than loop9p1

pyavitz commented 2 years ago

Made it Ubuntu specific as Debian Bullseye doesn't have this issue. Ideally people shouldn't have snapd installed whilst using the builder.

if [[ `grep -w "VERSION_CODENAME=jammy" "/etc/os-release"` ]]; then
    # snapd woes; grep for higher loop numbers
    grep -o 'loop[0-9]\+p.' <<<"$kpartx" > kpart2;
else
    grep -o 'loop.p.' <<<"$kpartx" > kpart2;
fi

Built, flashed and booted.

sun8i-h3-orangepi-one-devuan-chimaera-5.15.32-2022-04-08.img.xz
dmesg | grep "model"; dmesg | grep "Linux version"; grep -w "PRETTY_NAME" "/etc/os-release"
[    0.000000] OF: fdt: Machine model: Xunlong Orange Pi One
[    0.000000] Linux version 5.15.32 (marvin@martian) (arm-linux-gnueabihf-gcc-10 (Ubuntu 10.3.0-8ubuntu1) 10.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #3 SMP Fri Apr 1 01:44:52 UTC 2022
PRETTY_NAME="Devuan GNU/Linux 4 (chimaera)"