-
Notifications
You must be signed in to change notification settings - Fork 3
/
1-create-development-chroot.sh
executable file
·51 lines (40 loc) · 1.64 KB
/
1-create-development-chroot.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
#!/bin/bash
# Linuxium's scripts to create a custom Ubuntu ISO
source chroot-variables.txt
# mount Ubuntu ISO
[ -f mnt ] && rm -f mnt
[ -d mnt ] || mkdir mnt
sudo mount -o loop ${PATH_TO}/${CANONICAL_ISO} mnt 2> /dev/null
# extract development chroot file system from ISO
sudo rm -rf squashfs-root development-chroot
sudo unsquashfs mnt/casper/filesystem.squashfs
mv squashfs-root development-chroot
# unmount Ubuntu ISO
sudo umount mnt
rmdir mnt
# copy kernel.org banner to development chroot
sudo cp ${PATH_TO}/finger_banner development-chroot/${PATH_TO}/finger_banner
# configure networking inside development chroot
sudo cp /etc/resolv.conf development-chroot/etc/
# copy required files to development chroot
sudo cp chroot-variables.txt development-chroot/usr/src
sudo cp 2a-start-compile-linux.source development-chroot/usr/src
sudo cp 2b-finish-compile-linux.source development-chroot/usr/src
sudo cp include/aufs4-v4.10-fix1.patch development-chroot/usr/src
sudo cp include/aufs4-v4.10-fix2.patch development-chroot/usr/src
sudo cp ${PATH_TO}/sources.list development-chroot/etc/apt/
sudo cp ${PATH_TO}/defconfig development-chroot/usr/src
sudo cp include/REPORTING-BUGS development-chroot/usr/src
# add support for aufs
rm -rf kernel_sources/aufs4-standalone.git
cd kernel_sources
git clone git://github.com/sfjro/aufs4-standalone.git aufs4-standalone.git
cd aufs4-standalone.git
git checkout origin/aufs4.9
cd ../..
sudo cp -a kernel_sources/aufs4-standalone.git development-chroot/usr/src
# copy kernel definitions to development chroot
for KERNEL in ${LINUXIUM_KERNELS}
do
sudo cp kernel_sources/${KERNEL}_kernel.source development-chroot/usr/src
done