-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakecdrm.sav3
executable file
·101 lines (88 loc) · 2.44 KB
/
makecdrm.sav3
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/sh
#
#
# USAGE: ./makecd DEVICE [blank]
# example: ./makecd ATAPI:1,0,0 blank
# first BLANKS a CD-RW and burns to ATAPI Writer on
# Secondary master.
#
#
#
#
#
echo "g4l, Frank Stephen 2004"
echo "g4l comes with ABSOLUTELY NO WARRANTY."
echo "This is free software, and you are welcome"
echo "to redistribute it freely."
echo
echo
sleep 3
#16384
#ramdisk_size=32768
ramdisk_size=65536
#ramdisk_size=131072
device=$1
option=$2
ver=$3
if [ "$ver" = "" ]; then
alphaver=""
else
alphaver=alpha$ver
fi
if [ "$device" = "" ]; then
echo "USAGE: $0 DEVICE OPTION"
echo "example: $0 ATAPI:1,0,0 blank"
echo "first BLANKS a CD-RW and burns to ATAPI Writer on"
echo "Secondary master."
echo
echo "example: $0 create"
echo "create ISO image only"
exit 1
fi
echo "Creating ramdisk"
dd if=/dev/zero of=bootcd/isolinux/ramdisk bs=1k count=$ramdisk_size
echo "Creating loop device"
losetup /dev/loop0 bootcd/isolinux/ramdisk
echo "Creating ext2 filesystem"
mke2fs -m 0 -b 1024 -N 4000 /dev/loop0
#mke2fs -m 0 -b 4096 -N 4000 /dev/loop0
echo "Mounting loop device in /mnt"
mount /dev/loop0 /mnt
echo "Deleting lost+found"
rm -R /mnt/lost+found
echo "Copy rootfs files to ramdisk in /mnt"
# Added -p to keep the file dates
cp -R --preserve=all bootcd/rootfs/* /mnt
# Added .bash_profile to run g4lmenu at start
cp -p bootcd/rootfs/.bash_profile /mnt
echo "Umounting /mnt"
umount /mnt
echo "Delete loop device"
losetup -d /dev/loop0
echo "Compressing ramdisk"
#gzip bootcd/isolinux/ramdisk
LZMA=`which lzma 2>/dev/null `
if [ $? = "0" ] ; then echo $LZMA
else
echo "makecd create script requires lzma package "
exit 1
fi
lzma -v bootcd/isolinux/ramdisk
echo "Creating ISO9660/Joliet/RockRidge filesystem"
#mkisofs -l -L -J -R -o boot.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table bootcd/isolinux/.
mkisofs -l -allow-leading-dots -V "G4L 0.45$alphaver" -J -R -o boot.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table bootcd/isolinux/.
if [ "$device" != "create" ]; then
echo "Burning to device $device"
if [ "$option" = "" ]; then
cdrecord -v dev=$device boot.iso
fi
if [ "$option" = "blank" ]; then
cdrecord -v blank=fast dev=$device boot.iso
fi
echo "Deleting ISO image"
rm boot.iso
fi
echo "Deleting ramdisk"
#mv bootcd/isolinux/ramdisk.gz /home/msetzerii
mv bootcd/isolinux/ramdisk.lzma /home/msetzerii
echo "DONE..."