forked from Drewsif/PiShrink
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathmake_e2fstools
executable file
·53 lines (45 loc) · 1.08 KB
/
make_e2fstools
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# make_e2fstools
# PiShrink-macOS
#
# Created by Simone Karin Lehmann on 13.03.18.
# Copyright © 2018 LisaNet, BSD 2 clause license
#
### functions
download ()
{
cd "$PACKAGES"
down_FILE=$(basename "$1")
test -e "$down_FILE" || curl -LO "$1"
cd "$CMPL"
tar -xzf "$PACKAGES/$down_FILE"
}
BASE=$(pwd)
PACKAGES="/Volumes/Ramdisk/packages"
TARGET="/Volumes/Ramdisk/sw"
CMPL="/Volumes/Ramdisk/compile"
export CC=clang
### create RAM disk
if [ ! -e "/Volumes/Ramdisk" ]; then
DEVICE=$(hdiutil attach -nomount ram://2048000)
newfs_hfs -v Ramdisk $DEVICE
diskutil mount $DEVICE
fi
### set up dirs
mkdir "$PACKAGES"
mkdir "$TARGET"
mkdir "$CMPL"
download https://netix.dl.sourceforge.net/project/e2fsprogs/e2fsprogs/v1.46.5/e2fsprogs-1.46.5.tar.gz
cd e2fs*
./configure --prefix "$TARGET" --disable-nls
make
cp -a e2fsck/e2fsck "$BASE"
cp -a resize/resize2fs "$BASE"
cp -a misc/tune2fs "$BASE"
download https://ftp.gnu.org/gnu/coreutils/coreutils-9.1.tar.xz
cd core*
./configure --prefix "$TARGET" --disable-nls
make
cp -a src/truncate "$BASE"
cd "$BASE"
diskutil eject "/Volumes/Ramdisk"