Gentoo Archives: gentoo-catalyst

From: Matt Turner <mattst88@g.o>
To: gentoo-catalyst@l.g.o
Cc: Matt Turner <mattst88@g.o>
Subject: [gentoo-catalyst] [PATCH 3/8] targets: Inline filesystem-functions.sh
Date: Sat, 02 May 2020 01:40:54
Message-Id: 20200502014036.1039317-3-mattst88@gentoo.org
In Reply to: [gentoo-catalyst] [PATCH 1/8] targets: Use gensquashfs instead of mksquashfs by Matt Turner
1 Signed-off-by: Matt Turner <mattst88@g.o>
2 ---
3 targets/support/filesystem-functions.sh | 19 -------------------
4 targets/support/target_image_setup.sh | 20 ++++++--------------
5 2 files changed, 6 insertions(+), 33 deletions(-)
6 delete mode 100755 targets/support/filesystem-functions.sh
7
8 diff --git a/targets/support/filesystem-functions.sh b/targets/support/filesystem-functions.sh
9 deleted file mode 100755
10 index a95ae0b9..00000000
11 --- a/targets/support/filesystem-functions.sh
12 +++ /dev/null
13 @@ -1,19 +0,0 @@
14 -#!/bin/bash
15 -
16 -# Dont forget to update functions.sh check_looptype
17 -# $1 is the target directory for the filesystem
18 -
19 -create_squashfs() {
20 - echo "Creating squashfs..."
21 - export loopname="image.squashfs"
22 - gensquashfs -D "${clst_destpath}" ${clst_fsops} "$1/${loopname}" \
23 - || die "gensquashfs failed, did you emerge squashfs-tools-ng?"
24 -}
25 -
26 -create_jffs2(){
27 - echo "Creating jffs2..."
28 - export loopname="image.jffs"
29 - # fs_check /usr/sbin/mkfs.jffs2 jffs2 sys-fs/mtd
30 - mkfs.jffs2 --root=${clst_destpath} --output=$1/${loopname} ${clst_fsops} \
31 - || die "Could not create a jffs2 filesystem"
32 -}
33 diff --git a/targets/support/target_image_setup.sh b/targets/support/target_image_setup.sh
34 index 423dc4c4..03cb4741 100755
35 --- a/targets/support/target_image_setup.sh
36 +++ b/targets/support/target_image_setup.sh
37 @@ -1,25 +1,17 @@
38 #!/bin/bash
39
40 source ${clst_shdir}/support/functions.sh
41 -source ${clst_shdir}/support/filesystem-functions.sh
42
43 -# Make the directory if it doesnt exist
44 -mkdir -p $1
45 +mkdir -p "${1}"
46
47 -loopret=1
48 +echo "Creating ${clst_fstype} filesystem"
49 case ${clst_fstype} in
50 squashfs)
51 - create_squashfs $1
52 - loopret=$?
53 + gensquashfs -D "${clst_destpath}" "${clst_fsops}" "${1}/image.squashfs" \
54 + || die "Failed to create squashfs filesystem"
55 ;;
56 jffs2)
57 - create_jffs2 $1
58 - loopret=$?
59 + mkfs.jffs2 --root="${clst_destpath}" --output="${1}/image.jffs" "${clst_fsops}" \
60 + || die "Failed to create jffs2 filesystem"
61 ;;
62 esac
63 -
64 -if [ ${loopret} = "1" ]
65 -then
66 - die "Filesystem not setup"
67 -fi
68 -exit $loopret
69 --
70 2.26.2

Replies