blob: 9c4684e5943a7ab0a0bb2eac5c8eafc3ada6110f (
plain) (
blame)
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
|
#!/bin/sh
tmp=$PWD/tmp
aports=$PWD/../aports
target=alpine-test.iso
initramfs=test.gz
modloop=modloop.cmg
unapk() {
local dest="$1"
shift
while [ $# -gt 0 ]; do
tar -C "$dest" -zxf "$1"
shift
done
rm -f "$dest/.PKGINFO"
}
link_or_copy() {
ln -f "$1" "$2" 2>/dev/null || cp "$1" "$2"
}
rm -r $tmp
mkdir -p $tmp/apks $tmp/isolinux
cp /usr/share/syslinux/isolinux.* $tmp/isolinux
cat >$tmp/isolinux/isolinux.cfg <<EOF
timeout 20
prompt 1
default test
label test
kernel /boot/vmlinuz
append initrd=/boot/test.gz alpine_dev=cdrom quiet
EOF
#cp $aports/core/*/*.apk $tmp/apks
unapk $tmp $aports/core/linux-grsec/linux-grsec-[0-9]*.apk
# only build initram if its missing or script is newer than target
if [ ! -f "$initramfs" ] || [ mkinitram -nt "$initramfs" ]; then
sh mkinitram
fi
if [ ! -f "$modloop" ] || [ mkmodloop -nt "$modloop" ]; then
sh mkmodloop
fi
mkdir -p $tmp/boot/
link_or_copy test.gz $tmp/boot/
link_or_copy modloop.cmg $tmp/boot/
echo "==> Creating ISO image"
genisoimage -o $target -l -J -R \
-b isolinux/isolinux.bin \
-c isolinux/boot.cat \
-no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
-quiet \
$tmp
|