Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 68 lines (54 sloc) 1.921 kb
f54fc6c @Tomas-M initial files
authored
1 #!/bin/bash
2 # Linux Live Kit version 7
3
4 export PATH=.:./tools:../tools:/usr/sbin:/usr/bin:/sbin:/bin:/
5
6 CHANGEDIR=$(dirname $(readlink -f $0))
7 echo "Changing current directory to $CHANGEDIR"
8 cd $CHANGEDIR
9
10 . ./.config || exit 1
ffbcc57 @Tomas-M move livekitlib to root
authored
11 . ./livekitlib || exit 1
f54fc6c @Tomas-M initial files
authored
12
13 # only root can continue, because only root can read all files from your system
14 allow_only_root
15
0ad779c @Tomas-M initramfs initial empty script
authored
16 # check for mksquashfs with xz compression
17 if [ "$(mksquashfs 2>&1 | grep "Xdict-size")" = "" ]; then
18 echo "mksquashfs not found or doesn't support -comp xz, aborting, no changes made"
19 exit 1
20 fi
666742f @Tomas-M initial functions
authored
21
22 # build initramfs image
d5102a9 @Tomas-M build message
authored
23 echo "Building intramfs image..."
bfcf2bd @Tomas-M boot to bash
authored
24 cd initramfs
25 INITRAMFS=$(./initramfs_create "$LIVEKITNAME")
26 cd ..
27
ec4660f @Tomas-M compress current filesystem
authored
28 # create live kit filesystem (cpio archive)
bfcf2bd @Tomas-M boot to bash
authored
29 rm -Rf "$LIVEKITDATA"
30 BOOT="$LIVEKITDATA"/"$LIVEKITNAME"/boot
31 mkdir -p "$BOOT"
1633d33 @Tomas-M persistent changes
authored
32 mkdir -p "$BOOT"/../changes
c5ab1f9 @Tomas-M syslinux working binaries
authored
33 mv "$INITRAMFS" $BOOT/initrfs.img
a52b924 @Tomas-M copy all files from bootfiles, not just the named ones
authored
34 cp bootfiles/* $BOOT
18a45dd @Tomas-M fix syslinux.cfg copying
authored
35 cat bootfiles/syslinux.cfg | sed -r "s:/boot/:/$LIVEKITNAME/boot/:" > $BOOT/syslinux.cfg
c5ab1f9 @Tomas-M syslinux working binaries
authored
36 cat bootfiles/bootinst.bat | sed -r "s:/boot/:/$LIVEKITNAME/boot/:" | sed -r "s:\\\\boot\\\\:\\\\$LIVEKITNAME\\\\boot\\\\:" > $BOOT/bootinst.bat
bfcf2bd @Tomas-M boot to bash
authored
37 cp /boot/vmlinuz $BOOT/
0ad779c @Tomas-M initramfs initial empty script
authored
38
528d3ea @Tomas-M device hotplug
authored
39 if [ -d sb ]; then
40 cp sb/* $LIVEKITDATA/$LIVEKITNAME/
6b807b3 @Tomas-M find data retrying
authored
41 else
42 # create compressed bundles
43 for i in $MKMOD; do
83a9885 @Tomas-M keep as directory fix
authored
44 mksquashfs /$i $LIVEKITDATA/$LIVEKITNAME/$i.$BEXT -comp xz -b 512k -keep-as-directory
6b807b3 @Tomas-M find data retrying
authored
45 done
528d3ea @Tomas-M device hotplug
authored
46 fi
bfcf2bd @Tomas-M boot to bash
authored
47
6b807b3 @Tomas-M find data retrying
authored
48
0e22bdf @Tomas-M surround by infomessages
authored
49 # create ISO for CD image
50 echo "Creating ISO file for CD boot..."
bfcf2bd @Tomas-M boot to bash
authored
51 cd "$LIVEKITDATA"
4fc76b6 @Tomas-M make it more universal yet still preserve my target directory
authored
52 TARGET=/mnt/z
53 if [ ! -d $TARGET ]; then
54 TARGET=/tmp
55 fi
56
57 mkisofs -o "$TARGET/$LIVEKITNAME-$(uname -m).iso" -v -J -R -D -A "$LIVEKITNAME" -V "$LIVEKITNAME" \
bfcf2bd @Tomas-M boot to bash
authored
58 -no-emul-boot -boot-info-table -boot-load-size 4 \
59 -b "$LIVEKITNAME"/boot/isolinux.bin -c "$LIVEKITNAME"/boot/isolinux.boot . \
60 >/dev/null 2>/dev/null
1bf8290 @Tomas-M added tar target and cleanup
authored
61
0e22bdf @Tomas-M surround by infomessages
authored
62 echo "Creating TAR for USB boot..."
1bf8290 @Tomas-M added tar target and cleanup
authored
63 tar -c ./* > "$TARGET/$LIVEKITNAME-$(uname -m).tar"
64
65 cd ..
66 rm -Rf "$LIVEKITDATA"
0e22bdf @Tomas-M surround by infomessages
authored
67 echo "finished. Find your result in $TARGET"
Something went wrong with that request. Please try again.