-
Notifications
You must be signed in to change notification settings - Fork 0
/
extract_non_kernal_files_fm_sfs.sh
59 lines (40 loc) · 1.33 KB
/
extract_non_kernal_files_fm_sfs.sh
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
54
55
56
57
58
59
#!/bin/sh
extract_non_kernal_files_fm_sfs(){
select_pup_img() ISO_IMG
ISO_IMG=$1
echo "Mounting $(basename $ISO_IMG)..."
mount -o ro $IMGPUP /mnt/wktaz
#mount $IMGPUP /mnt/wktaz -o loop
if [ $? -ne 0 ]; then
echo "Mounting puppy image failed"
exit
fi
rootfslist="$(find /mnt/wktaz -type f -name "*.sfs")"
if [ "$rootfslist" == "" ]; then
echo "Not a puppy disc image"
umount /mnt/wktaz
#exit
return 1 #In bash non zero return values are failures.
fi
echo "Copying puppy non-kernel files...."
echo "Searching for non-kernel modules..."
mkdir -p $curdir/kernel-modules/lib
for file1 in $(find /mnt/wktaz -type f -name "*.sfs")
do
mount -t squashfs $file1 /mnt/wksfs
if [ $? -eq 0 ]; then
if [ -d /mnt/wksfs/lib/modules ]; then
echo "Copying kernel modules from $(basename $file1) to rootfs..."
sdfgfsdgf pepp
xcurdir="$(echo "$curdir" | sed "s#\/#\\\/#g")"
find $curdir/kernel-modules/lib/ -type f -name "*" | sed -e "s#$xcurdir\/kernel-modules\/lib\/#\/lib\/#g" > $curdir/kernel-modules/var/lib/tazpkg/installed/linux-modules/files.list
fi
if [ -d /mnt/wksfs/etc/modules ]; then
cp -rf /mnt/wksfs/etc/modules $curdir/kernel-modules/etc/
fi
umount /mnt/wksfs
fi
done
re_extract_kernal=0 #Added by s243a
umount /mnt/wktaz
}