Commit 4c1bddaf authored by Francesco Bonanno's avatar Francesco Bonanno

Reverting to docker, tried in a container a fix for loop devices that is...

Reverting to docker, tried in a container a fix for loop devices that is working! Image is on its way... Can be seen as failed bacause the artifact is too big to be fetched from gitlab server
parent 2084c1d4
Pipeline #62 canceled with stage
in 55 minutes and 7 seconds
image: amd64/debian
before_script:
- echo 'Acquire::http { Proxy "http://172.17.0.1:3142"; }' >> /etc/apt/apt.conf.d/proxy
- apt-get update
- apt-get -y install sudo make build-essential autoconf automake autogen live-build tar gzip xz-utils gdisk unzip wget kpartx lvm2 dosfstools coreutils parted xfsprogs wget binutils tar git parted bc multiarch-support qemu-user qemu-user-static binfmt-support gcc-arm-linux-gnueabihf kmod bison flex libssl-dev
- apt update
- apt install -y sudo make build-essential autoconf automake autogen live-build tar gzip xz-utils gdisk unzip wget kpartx lvm2 dosfstools coreutils parted xfsprogs wget binutils tar git parted bc multiarch-support qemu-user qemu-user-static binfmt-support gcc-arm-linux-gnueabihf kmod bison flex libssl-dev util-linux
- mkdir keyring && cd keyring && wget -r -np --tries=10 -A .deb "http://archive.parrotsec.org/parrot/pool/main/p/parrot-archive-keyring/" && dpkg --force-all -i archive.parrotsec.org/parrot/pool/main/p/parrot-archive-keyring/parrot-archive-keyring*.deb && cd .. && rm -rf keyring
- echo "deb http://deb.parrotsec.org/parrot/ parrot main" > /etc/apt/sources.list.d/parrot.list && apt update
- apt download live-build debootstrap && dpkg --force-all -i live-build*.deb debootstrap*.deb
......
......@@ -2,8 +2,8 @@ image: arm32v7/debian
before_script:
- echo 'Acquire::http { Proxy "http://172.17.0.1:3142"; }' >> /etc/apt/apt.conf.d/proxy
- apt-get update
- apt-get -y install sudo make build-essential autoconf automake autogen live-build tar gzip xz-utils gdisk unzip wget kpartx lvm2 dosfstools coreutils parted xfsprogs wget binutils tar git parted bc
- apt update
- apt install -y sudo make build-essential autoconf automake autogen live-build tar gzip xz-utils gdisk unzip wget kpartx lvm2 dosfstools coreutils parted xfsprogs wget binutils tar git parted bc
- mkdir keyring && cd keyring && wget -r -np --tries=10 -A .deb "http://archive.parrotsec.org/parrot/pool/main/p/parrot-archive-keyring/" && dpkg --force-all -i archive.parrotsec.org/parrot/pool/main/p/parrot-archive-keyring/parrot-archive-keyring*.deb && cd .. && rm -rf keyring
- echo "deb http://deb.parrotsec.org/parrot/ parrot main" > /etc/apt/sources.list.d/parrot.list && apt update
- apt download live-build debootstrap && dpkg --force-all -i live-build*.deb debootstrap*.deb
......
......@@ -86,9 +86,19 @@ echo "Creating an image"
mkdir -p ${buildenv}
image="${buildenv}/parrot-armhf-image.img"
dd if=/dev/zero of=${image} bs=1MB count=4096
device=`losetup -f --show ${image}` #Use '--device-cgroup-rule="b 7:* rmw" ' to create the docker container, solve the issues
device=`losetup -f --show --partscan ${image}` #Use '--device-cgroup-rule="b 7:* rmw" ' to create the docker container, solve the issues
echo "image ${image} created and mounted as ${device}"
# Trying this solution instead for loopdevices in docker
partitions=$(lsblk --raw --output "MAJ:MIN" --noheadings ${device} | tail -n +2)
counter=1
for i in $partitions; do
MAJ=$(echo $i | cut -d: -f1)
MIN=$(echo $i | cut -d: -f2)
if [ ! -e "${device}p${counter}" ]; then mknod ${device}p${counter} b $MAJ $MIN; fi
counter=$((counter + 1))
done
fdisk ${device} << EOF
n
p
......@@ -107,6 +117,16 @@ EOF
partprobe ${device}
# Trying this solution instead for loopdevices in docker
partitions=$(lsblk --raw --output "MAJ:MIN" --noheadings ${device} | tail -n +2)
counter=1
for i in $partitions; do
MAJ=$(echo $i | cut -d: -f1)
MIN=$(echo $i | cut -d: -f2)
if [ ! -e "${device}p${counter}" ]; then mknod ${device}p${counter} b $MAJ $MIN; fi
counter=$((counter + 1))
done
bootp=${device}p1
rootp=${device}p2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment