Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/catalyst:pending/mattst88 commit in: targets/support/
Date: Sun, 03 May 2020 22:04:39
Message-Id: 1588543458.415e88f301517f3efc4289912889509a67fe5115.mattst88@gentoo
1 commit: 415e88f301517f3efc4289912889509a67fe5115
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 1 06:40:26 2020 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Sun May 3 22:04:18 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=415e88f3
7
8 targets: Inline filesystem-functions.sh
9
10 Inline create_squashfs and create_jffs2 since they're called only from
11 one place (in a different file).
12
13 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
14
15 targets/support/filesystem-functions.sh | 19 -------------------
16 targets/support/target_image_setup.sh | 20 ++++++--------------
17 2 files changed, 6 insertions(+), 33 deletions(-)
18
19 diff --git a/targets/support/filesystem-functions.sh b/targets/support/filesystem-functions.sh
20 deleted file mode 100755
21 index a95ae0b9..00000000
22 --- a/targets/support/filesystem-functions.sh
23 +++ /dev/null
24 @@ -1,19 +0,0 @@
25 -#!/bin/bash
26 -
27 -# Dont forget to update functions.sh check_looptype
28 -# $1 is the target directory for the filesystem
29 -
30 -create_squashfs() {
31 - echo "Creating squashfs..."
32 - export loopname="image.squashfs"
33 - gensquashfs -D "${clst_destpath}" ${clst_fsops} "$1/${loopname}" \
34 - || die "gensquashfs failed, did you emerge squashfs-tools-ng?"
35 -}
36 -
37 -create_jffs2(){
38 - echo "Creating jffs2..."
39 - export loopname="image.jffs"
40 - # fs_check /usr/sbin/mkfs.jffs2 jffs2 sys-fs/mtd
41 - mkfs.jffs2 --root=${clst_destpath} --output=$1/${loopname} ${clst_fsops} \
42 - || die "Could not create a jffs2 filesystem"
43 -}
44
45 diff --git a/targets/support/target_image_setup.sh b/targets/support/target_image_setup.sh
46 index 423dc4c4..03cb4741 100755
47 --- a/targets/support/target_image_setup.sh
48 +++ b/targets/support/target_image_setup.sh
49 @@ -1,25 +1,17 @@
50 #!/bin/bash
51
52 source ${clst_shdir}/support/functions.sh
53 -source ${clst_shdir}/support/filesystem-functions.sh
54
55 -# Make the directory if it doesnt exist
56 -mkdir -p $1
57 +mkdir -p "${1}"
58
59 -loopret=1
60 +echo "Creating ${clst_fstype} filesystem"
61 case ${clst_fstype} in
62 squashfs)
63 - create_squashfs $1
64 - loopret=$?
65 + gensquashfs -D "${clst_destpath}" "${clst_fsops}" "${1}/image.squashfs" \
66 + || die "Failed to create squashfs filesystem"
67 ;;
68 jffs2)
69 - create_jffs2 $1
70 - loopret=$?
71 + mkfs.jffs2 --root="${clst_destpath}" --output="${1}/image.jffs" "${clst_fsops}" \
72 + || die "Failed to create jffs2 filesystem"
73 ;;
74 esac
75 -
76 -if [ ${loopret} = "1" ]
77 -then
78 - die "Filesystem not setup"
79 -fi
80 -exit $loopret