]> git.sur5r.net Git - bacula/rescue/blob - rescue/linux/usb/how_to_create_a_new_usb_key.txt
Add new usb rescue key code
[bacula/rescue] / rescue / linux / usb / how_to_create_a_new_usb_key.txt
1
2
3 --------------HOW TO CREATE A NEW USB KEY (CHANGE DISTRIB)----------------
4
5 mkdir /tmp/distrib
6 mount -o loop distrib.iso /tmp/distrib
7 umount /tmp/distrib
8
9 mkdir /tmp/squash
10 mount -o loop -t squashfs /tmp/distrib/casper/filesystem.squashfs /tmp/squash
11
12 mkdir sqfs
13 rsync -avx -P /tmp/squash/. sqfs/.
14
15 chroot sqfs
16 ####################################carefull execute this in the chroot
17
18
19 mount -t sysfs none /sys/
20 mount -t proc none /proc/
21 export HOME=/root
22
23 nano /etc/apt/sources.list ###include universe multiverse
24
25 cat >/etc/resolv.conf <<EOF
26 search sibbald.com
27 nameserver 192.168.68.254
28 nameserver 208.67.222.222
29 nameserver 208.67.220.220
30 EOF
31
32 apt-get update
33
34 apt-get remove --purge `dpkg-query -W --showformat '${Package}\n' | grep language-pack | egrep -v '\-en'`
35
36 apt-get remove --purge `dpkg-query -W --showformat '${Package}\n' | grep openoffice\.org-`
37
38 apt-get remove --purge amarok dictionaries-common
39
40 apt-get upgrade
41
42 apt-get install lvm2 qemu mdadm mbr xfsprogs jfsutils hfsplus hfsutils\
43  gparted xdialog dialog reiserfsprogs reiser4progs ntfsprogs ntfs-3g e2fsprogs dosfstools
44
45 apt-get install bind9-host dnsutils  linux-generic linux-headers-generic linux-image-generic   ssl-cert
46
47
48 apt-get install sshfs gedit lsscsi m4 mtx nfs-common   nfs-kernel-server patch \
49   squashfs-tools strace sg3-utils screen scsiadd system-tools-backends   telnet dpkg \
50 traceroute usbutils whois autofs busybox   chkrootkit clamav dmidecode unrar
51
52 apt-get install flashplugin-nonfree aircrack-ng g++ nvidia-glx-180   gfxboot syslinux mtools
53
54 apt-get install openssh-server subversion  gftp firefox sg3-utils
55
56 apt-get remove linux-headers-2.6.28-11 linux-headers-2.6.28-11-generic \
57   linux-image-2.6.28-11-generic linux-restricted-modules-2.6.28-11-generic \
58   linux-restricted-modules-2.6.28-11-generic ###change kernel version 
59
60 apt-get clean
61
62 dpkg-query -W --showformat='${Package} ${Version}\n' >filesystem.manifest
63
64 rm -rf /tmp/*
65 rm -f /etc/hosts /etc/resolv.conf
66 umount /proc/
67 umount /sys/
68 history -c
69 exit
70
71
72 ###reboot if proc didn't unmount
73 cp sqfs/boot/vmlinuz-blabla vmlinuz
74 cp sqfs/boot/initrd-img-blabla  initrd-img (or gz)
75 cp sqfs/filesystem.manifest .
76 rm sqfs/filesystem.manifest 
77 mksquashfs sqfs filesystem.squashfs
78   
79 apt-get install isomaster ## if you don't have it
80
81 --point it to your distrib.iso
82
83 --extract /isolinux
84
85 mv isolinux syslinux
86 mv syslinux/isolinux.cfg syslinux/syslinux.cfg ## you can edit it to set a lower timeout (30)
87
88 --edit syslinux/text.cfg so it looks like
89
90 default live
91 label live
92   menu label ^Bacula-rescue
93   kernel /casper/vmlinuz
94   append  noprompt cdrom-detect/try-usb=true persistent file=/cdrom/preseed/xubuntu.seed boot=casper initrd=/casper/initrd.img  quiet nosplash --
95
96
97 --note that the important bit is
98
99  cdrom-detect/try-usb=true persistent
100
101  --and that the initrd have the good extension
102
103 --and if your cd doesnt have casper but live change accordingly
104
105 ###
106
107 --in isomaster delete the isolinux dir
108 --put in your new syslinux dir
109
110 --in isomaster delete everything in casper and replace with your own vmlinuz initrd filesystem.squashfs
111                and filesystem.manifest
112
113 --save your work as bs-rescue-bla-bla.iso
114
115 --change the copy_bacula_to usb_stick script so it points to your iso
116
117
118 et voilĂ 
119
120
121
122
123