-
Notifications
You must be signed in to change notification settings - Fork 2
/
makeimage.sh
66 lines (46 loc) · 1.97 KB
/
makeimage.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
60
61
62
63
64
65
66
echo Fetching base Initial-Ramdisk:
wget -O initrd.gz http://linux.citylink.co.nz/debian/dists/stable/main/installer-armhf/current/images/netboot/initrd.gz
echo Fetching Novena Update Hooks:
wget -O hooks.tgz http://www2.futureware.at/novena/hooks.tgz
echo Fetching Kosagi Key:
echo 4C0E70D9 is the new key
wget -O kosagi.gpg https://github.com/xobs/kosagi-repo/raw/master/etc/apt/trusted.gpg.d/kosagi.gpg
echo Installing necessary tools:
sudo apt-get install u-boot-tools lvm2 cryptsetup kosagi-repo initramfs-tools build-essential u-boot-novena exfat-utils linux-image-novena linux-firmware-image-novena linux-headers-novena
sudo apt-get --reinstall install linux-image-novena
echo Unpacking Ramdisk
gunzip <initrd.gz >initrd-unpacked
echo Creating workspace
rm -rf ./cpio/
mkdir cpio
cd cpio
echo Unpacking Ramdisk
cpio -i <../initrd-unpacked
echo Copying missing modules into new ramdisk
cp -r /lib/modules/* lib/modules/
echo Copying Bluetooth firmware
mkdir lib/firmware
mkdir lib/firmware/ar3k
cp /lib/firmware/ar3k/AthrBT_0x11020000.dfu lib/firmware/ar3k/
cp /lib/firmware/ar3k/ramps_0x11020000_40.dfu lib/firmware/ar3k/
echo Copying preseed
cp ../preseed.cfg preseed.cfg
echo Copying Kosagi repo key
cp ../kosagi.gpg kosagi.gpg
echo Copying fdisk for partitioning
cp /sbin/fdisk sbin/fdisk
echo Copying mkimage
cp /usr/bin/mkimage bin/mkimage
cp /lib/arm-linux-gnueabihf/libblkid.so.1 /lib/arm-linux-gnueabihf/libuuid.so.1 /lib/arm-linux-gnueabihf/libsmartcols.so.1 /lib/arm-linux-gnueabihf/libc.so.6 lib/arm-linux-gnueabihf/
cp ../hooks.tgz hooks.tgz
echo Creating new ramdisk image
find . | cpio -H newc -o >../newinitrd
cd ..
echo Packing ramdisk image
gzip <newinitrd >newinitrd.gz
rm -- ./boot/*
mkdir boot
mkimage -A arm -T ramdisk -C none -n uInitrd -d ./newinitrd.gz ./boot/uInitrd
cp uEnv.txt boot/uEnv.txt
echo "Now copy boot/uInitrd and boot/uEnv.txt into the /boot partition"
echo "If you want to rerun the installer later on, just rename uInitrd-install to uInitrd again"