Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fe35df9

Browse files
Giuseppe NatalespeachySolomon Peachypcotret
authoredSep 30, 2020
Bring master changes on image_v2.6.0 (#1140)
* PYNQ: Allow fetching BSP from a URL instead of only local files. (v2) (#1022) This means one can keep the (usually pretty large) BSP separate from the repository, and has the added benefit of making some CI flows a lot simpler. Co-authored-by: Solomon Peachy <solomon.peachy@philips.com> * Fix for LateX generation (#1042) The HTML generation already works fine. However, `make latexpdf`generates an error in the glossary section. * Replace kpartx with losetup for loop detection and detach (#1065) Co-authored-by: Solomon Peachy <pizza@shaftnet.org> Co-authored-by: Solomon Peachy <solomon.peachy@philips.com> Co-authored-by: Pascal Cotret <pascal.cotret@gmail.com>
1 parent 8ec2a6a commit fe35df9

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed
 

‎docs/source/glossary.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
Glossary
33
********
44

5-
.. glossary::
6-
7-
85
A-G
96
===
107

‎sdbuild/scripts/create_bsp.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ set -e
66
board=$1
77
template=$2
88

9-
if [ ! -z "$BSP" ]; then
9+
if [ -n "$BSP" ]; then
10+
# If $BSP is a URL, fetch it!
11+
if [[ "$BSP" == *"://"* ]] ; then
12+
BSP_ABS="${BSP_BUILD}/../downloaded-${BSP_PROJECT}.bsp"
13+
curl -o "${BSP_ABS}" "${BSP}"
14+
BSP=$(basename "${BSP_ABS}")
15+
fi
1016
cp -f $BSP_ABS $BSP_BUILD
1117
cd $BSP_BUILD
1218
old_project=$(echo $(tar -xvf $BSP) | cut -f1 -d" ")
@@ -36,4 +42,3 @@ else
3642
petalinux-package --force --bsp -p $BSP_PROJECT \
3743
--output $BSP_PROJECT.bsp
3844
fi
39-

‎sdbuild/scripts/resize_umount.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ export PATH=/sbin:$PATH
88

99
image_dir=$2
1010
image_file=$1
11+
used_loop=$(sudo losetup -j $image_file | grep -o 'loop[0-9]*')
1112

12-
boot_dev=/dev/mapper/$(sudo kpartx -v $image_file | grep -o 'loop[0-9]*p1')
13-
root_dev=/dev/mapper/$(sudo kpartx -v $image_file | grep -o 'loop[0-9]*p2')
14-
root_offset=$(sudo kpartx -v $image_file | grep 'loop[0-9]*p2' | cut -d ' ' -f 6)
13+
boot_dev=/dev/mapper/${used_loop}p1
14+
root_dev=/dev/mapper/${used_loop}p2
15+
root_offset=$(sudo kpartx -v /dev/${used_loop} | grep 'loop[0-9]*p2' | cut -d ' ' -f 6)
1516
sleep 5
1617

1718
sudo umount $image_dir/boot
@@ -31,7 +32,9 @@ sudo chroot / zerofree $root_dev
3132

3233
sleep 5
3334

34-
sudo kpartx -d $image_file
35+
sudo dmsetup remove /dev/mapper/${used_loop}p1
36+
sudo dmsetup remove /dev/mapper/${used_loop}p2
37+
sudo losetup -d /dev/${used_loop}
3538

3639
sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk $1
3740
d # delete partition

‎sdbuild/scripts/setup_host.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ nfs-common
3939
zerofree
4040
u-boot-tools
4141
rpm2cpio
42+
curl
4243
docker-ce
4344
docker-ce-cli
4445
containerd.io

‎sdbuild/scripts/unmount_image.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ set -e
44

55
target=$1
66
image_file=$2
7+
used_loop=$(sudo losetup -j $image_file | grep -o 'loop[0-9]*')
78

89
sudo umount $target/boot
910
sudo umount $target
1011
sleep 5
11-
sudo kpartx -d $image_file
12+
sudo dmsetup remove /dev/mapper/${used_loop}p1
13+
sudo dmsetup remove /dev/mapper/${used_loop}p2
14+
sudo losetup -d /dev/${used_loop}

0 commit comments

Comments
 (0)
Failed to load comments.