-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathchroot_fetch
executable file
·72 lines (53 loc) · 1.6 KB
/
chroot_fetch
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
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
#-----
# Packages
#-----
echo "------------------"
echo "Primary packages"
echo "------------------"
packages=(mksh bmake gmake busybox toybox libressl cmake curl rsync linux flex byacc om4 zlib expat samurai libffi python ca-certificates)
root=$(pwd)/root/
for pkg in ${packages[@]};do
echo "$pkg"
source ${root}/iglunix/pkgs/${pkg}/build.sh
cd ${root}/iglunix/pkgs/${pkg}/
#Only needed if you want to clean
#sudo rm -rf src
if test -d "src"; then
echo "Already got the source for ${pkg}?! No need to download.."
else
rm src 2> /dev/null
#src could be a file (file != dir)
mkdir src
cd src
fetch
fi
done
#-----
# tmp Packages
#-----
echo "------------------"
echo "Temporary packages"
echo "------------------"
mkdir ${root}/iglunix/tmp_pkgs/
#echo "ibara baseutils"
#cd ${root}/iglunix/tmp_pkgs/
#git clone https://github.com/ibara/baseutils.git
echo "------------------------------------"
echo " shell scripts/single files"
echo "------------------------------------"
cp ${root}/../dont_use_here/inside_chroot ${root}
cp ${root}/../dont_use_here/linux_header_only_patch ${root}
cp ${root}/../dont_use_here/inittab ${root}/etc/inittab
mkdir ${root}/etc
mkdir ${root}/etc/profile.d
cp ${root}/../dont_use_here/profile ${root}/etc/profile
cat << EOF > ${root}/login_shell
exec -a "-sh" /bin/sh
EOF
sudo cp /etc/resolv.conf ${ROOT}/etc/resolv.conf
echo "Copied the host resolv.conf into the target"
echo "Feel free to override the generated network settings prior to chrooting into the system"
echo "---------------------"
echo "finished chroot_fetch"
echo "---------------------"