linuxrc: just added a comment regarding booting via pcmcia (which is not available...
[grml-live.git] / docs / building-process
1 ################################################################################
2 Get an initial chroot
3 ---------------------
4
5 Used initial version of ~/grml-live/scripts/grml-live for this.
6
7 Install essential software
8 --------------------------
9
10 # cat > /etc/apt/sources.list << EOF
11
12   deb     http://deb.grml.org/                    grml-stable   main
13   deb     http://deb.grml.org/                    grml-testing  main
14   deb     http://ftp.tu-graz.ac.at/mirror/debian  etch     main contrib non-free
15
16 EOF
17
18 # cat > /etc/apt/preferences << EOF
19 // main grml-repository:
20 Package: *
21 Pin: origin deb.grml.org
22 Pin-Priority: 996
23
24 // fallback grml-repository:
25 Package: *
26 Pin: origin grml.org
27 Pin-Priority: 995
28
29 // debian unstable pool (default):
30 Package: *
31 Pin: release a=unstable,o=Debian
32 Pin-Priority: 991
33
34 EOF
35
36 # mount /proc
37 # apt-get update
38 # apt-get install grml-etc grml-etc-core grml-scripts
39 # rm /var/run/dbus/pid
40 # umount /proc
41
42 # cd /etc
43 # mv inittab inittab.orig
44 # cp inittab.grml inittab
45
46 # touch /etc/ld.so.nohwcap
47 # touch /etc/grml_cd
48 # echo "0.00a Release Codename grml-etch [$(date +%Y-%m-%d)]" > /etc/grml_version
49 # echo 'grml-etch' > /etc/hostname
50
51 # cat > /etc/hosts << EOF
52 127.0.0.1       grml-etch    localhost
53
54 # The following lines are desirable for IPv6 capable hosts
55 # (added automatically by netbase upgrade)
56
57 ::1     ip6-localhost ip6-loopback grml-etch
58 fe00::0 ip6-localnet
59 ff00::0 ip6-mcastprefix
60 ff02::1 ip6-allnodes
61 ff02::2 ip6-allrouters
62 ff02::3 ip6-allhosts
63 EOF
64
65 # echo 'Yes, do as I say!' | apt-get --force-yes -y install file-rc
66 # cp /etc/runlevel.conf /etc/runlevel.conf.orig
67 # cp /etc/runlevel.conf.livecd /etc/runlevel.conf
68
69 # cat >> /etc/network/interfaces << EOF
70 # The loopback interface
71 # automatically added when upgrading
72 auto lo
73 iface lo inet loopback
74 EOF
75
76 # addgroup --gid 1000 grml
77 # adduser --uid 1000 --gid 1000 --disabled-password grml
78 # sed -i 's/^root::/root:*:/' /etc/shadow
79
80 # cat > /etc/sudoers << EOF
81 # sudoers file.
82 # This file MUST be edited with the "visudo" command as root.
83 # See the man page for details on how to write a sudoers file.
84
85 # Host alias specification
86
87 # User alias specification
88
89 # Cmnd alias specification
90
91 # User privilege specification
92 root    ALL=(ALL) ALL
93
94 # WARNING: This allows the unprivileged grml user to start commands as root
95 # WARNING: This is totally insecure and (almost) makes grml a second root account.
96 # WARNING: Never allow external access to the grml user!!!
97 grml    ALL=NOPASSWD: ALL
98
99 # allow editing of files with editor:
100 # grml ALL=NOPASSWD: sudoedit
101
102 # usage examples:
103 # grml ALL=NOPASSWD: /sbin/hdparm
104 # grml ALL=NOPASSWD: /usr/sbin/hwinfo
105 # Cmnd_Alias DEBIAN = /usr/bin/apt-get, /usr/bin/dpkg, /usr/bin/auto-apt, /usr/bin/apt-file
106 # grml ALL=NOPASSWD: DEBIAN
107 # chroot       ALL=NOPASSWD: /usr/sbin/chroot, /bin/su - chroot
108 # chroot       ALL=NOPASSWD: /usr/sbin/chroot, /bin/su - chroot
109
110 secvpn  ALL=NOPASSWD: /usr/sbin/secvpn, /usr/sbin/pppd
111 EOF
112
113
114 # apt-get install linux-image-2.6.20-grml
115 # aptitude install powernowd aumix alsa-utils hwinfo mdadm locales
116 # cp /etc/locale.gen.minimal /etc/locale.gen && locale-gen
117 # mv /etc/motd.dpkg-new /var/run/motd
118
119 # aptitude install dctrl-tools usbutils bzip2 pdmenu
120 # apt-get clean
121 # aptitude forget-new
122 # umount /proc /sys 2>/dev/null
123 # exit # finally leave chroot...
124
125 Build ISO
126 ---------
127
128 # mkdir /home/mika/grml/chroot/grml_cd.etch/
129 # cd /home/mika/grml/chroot/grml_cd.etch/
130 # cp -a /home/mika/grml/chroot/grml_cd.large/* .
131 # mksquashfs /home/mika/grml/chroot/grml_uncompressed.etch/* /home/mika/grml/chroot/grml_cd.etch/GRML/GRML -noappend
132
133 # cd /home/mika/grml/chroot/grml_cd.etch
134 # mkisofs -V "grml-etch 0.00a" -publisher 'Michael Prokop <mika@grml.org>' -l \
135   -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -c boot/isolinux/boot.cat -b \
136   boot/isolinux/isolinux.bin -o /home/mika/grml/chroot/grml-etch_0.00a.iso . 
137
138
139 Extend the software list
140 ------------------------
141
142 # aptitude install grml-x xserver-xorg-input-vmmouse xterm xcursor-themes idesk
143 # mv /etc/X11/xorg.conf /etc/X11/xorg.conf.debian
144
145 # update-alternatives --set x-terminal-emulator /usr/bin/xterm
146 # update-alternatives --set x-cursor-theme /etc/X11/cursors/whiteglass.theme
147 # update-alternatives --set editor /usr/bin/vim.basic
148 # chsh -s /bin/zsh root
149 # chsh -s /bin/zsh grml
150
151 # aptitude install deborphan
152 # aptitude --purge remove $(deborphan)
153
154 # aptitude install grml grml2usb grml2hd
155 # aptitude install openssh-server
156
157 # aptitude install iceweasel sane sane-utils  xsane cups
158 # aptitude install wireless-tools wpasupplicant
159 ################################################################################
160
161 ################################################################################
162 grml-ppc
163 ========
164
165 "Old" system (WD-harddisk):
166 ---------------------------
167
168 # debootstrap etch /data/chroot http://ftp.tu-graz.ac.at/mirror/debian
169 # chroot /data/chroot
170
171 # cat > /etc/apt/sources.list << EOF
172
173   deb     http://deb.grml.org/                    grml-stable   main
174   deb     http://deb.grml.org/                    grml-testing  main
175   deb     http://ftp.tu-graz.ac.at/mirror/debian  etch     main contrib non-free
176
177 EOF
178
179 # gpg --keyserver subkeys.pgp.net --recv-keys F61E2E7CECDEA787
180 # gpg --export F61E2E7CECDEA787 > /etc/apt/grml.key
181 # apt-key add /etc/apt/grml.key
182
183 # apt-get update
184 # apt-get install vim zsh
185 # apt-get install grml-etc grml-etc-core grml-scripts
186
187 System died :-/
188 http://michael-prokop.at/blog/2007/03/22/sterbende-festplatte/
189
190 Reinstalled it:
191 http://michael-prokop.at/blog/2007/03/23/murphy-2/
192
193 "New" system (Samsung-harddisk):
194 --------------------------------
195
196 Installed new system via USB-stick, d-i from efika.de. Now booting the system via USBĀ­stick:
197
198   boot hd0:0 kernel_efika console=ttyPSC0 root=/dev/sda1
199
200 Setup on main system:
201
202 # apt-get update ; apt-get install zsh mercurial debootstrap screen devscripts fakeroot gcc debhelper bzip2 libc6-dev ntpdate
203
204 % cat >> /etc/apt/sources.list << EOF
205 deb http://deb.grml.org/ grml-stable  main
206 deb http://deb.grml.org/ grml-testing main
207 EOF
208
209 # apt-get install grml-etc grml-etc-core grml-scripts
210 # apt-get install vim zsh
211
212 Install chroot:
213
214 # mkdir /data
215 # mount /dev/sda4 /data
216 # mkdir /data/chroot
217
218 # debootstrap etch /data/chroot http://ftp.tu-graz.ac.at/mirror/debian
219 # chroot /data/chroot /bin/sh
220
221 # cat > /etc/apt/sources.list << EOF
222
223   deb     http://deb.grml.org/                    grml-stable   main
224   deb     http://deb.grml.org/                    grml-testing  main
225   deb     http://ftp.tu-graz.ac.at/mirror/debian  etch     main contrib non-free
226
227 EOF
228
229 # gpg --keyserver subkeys.pgp.net --recv-keys F61E2E7CECDEA787
230 # gpg --export F61E2E7CECDEA787 > /etc/apt/grml.key
231 # apt-key add /etc/apt/grml.key
232
233 # cat > /usr/bin/policy-rc.d << EOF
234 > #!/bin/sh
235 > exit 101
236 > EOF
237 # chmod 755 /usr/bin/policy-rc.d
238 # mount -t proc none /proc
239 # apt-get update
240 # aptitude install vim zsh grml-etc grml-etc-core grml-scripts
241
242 # cat > /etc/apt/preferences << EOF
243 // main grml-repository:
244 Package: *
245 Pin: origin deb.grml.org
246 Pin-Priority: 996
247
248 // fallback grml-repository:
249 Package: *
250 Pin: origin grml.org
251 Pin-Priority: 995
252
253 // debian unstable pool (default):
254 Package: *
255 Pin: release a=unstable,o=Debian
256 Pin-Priority: 991
257
258 EOF
259
260 # cd /etc
261 # mv inittab inittab.orig
262 # cp inittab.grml inittab
263 # touch /etc/ld.so.nohwcap
264 # touch /etc/grml_cd
265 # echo "0.00a Release Codename grml-ppc [$(date +%Y-%m-%d)]" > /etc/grml_version
266 # echo "0.00a Release Codename grml-etch [$(date +%Y-%m-%d)]" > /etc/grml_version
267 # echo 'grml-ppc' > /etc/hostname
268
269 # cat > /etc/hosts << EOF
270 127.0.0.1       grml-ppch    localhost
271
272 # The following lines are desirable for IPv6 capable hosts
273 # (added automatically by netbase upgrade)
274
275 ::1     ip6-localhost ip6-loopback grml-ppch
276 fe00::0 ip6-localnet
277 ff00::0 ip6-mcastprefix
278 ff02::1 ip6-allnodes
279 ff02::2 ip6-allrouters
280 ff02::3 ip6-allhosts
281 EOF
282
283 # echo 'Yes, do as I say!' | apt-get --force-yes -y install file-rc
284 # cp /etc/runlevel.conf /etc/runlevel.conf.orig
285 # cp /etc/runlevel.conf.livecd /etc/runlevel.conf
286
287 # cat >> /etc/network/interfaces << EOF
288 # The loopback interface
289 # automatically added when upgrading
290 auto lo
291 iface lo inet loopback
292 EOF
293
294 # addgroup --gid 1000 grml
295 # adduser --uid 1000 --gid 1000 --disabled-password grml
296 # sed -i 's/^root::/root:*:/' /etc/shadow
297
298 # cat > /etc/sudoers << EOF
299 # sudoers file.
300 # This file MUST be edited with the "visudo" command as root.
301 # See the man page for details on how to write a sudoers file.
302
303 # Host alias specification
304
305 # User alias specification
306
307 # Cmnd alias specification
308
309 # User privilege specification
310 root    ALL=(ALL) ALL
311
312 # WARNING: This allows the unprivileged grml user to start commands as root
313 # WARNING: This is totally insecure and (almost) makes grml a second root account.
314 # WARNING: Never allow external access to the grml user!!!
315 grml    ALL=NOPASSWD: ALL
316
317 # allow editing of files with editor:
318 # grml ALL=NOPASSWD: sudoedit
319
320 # usage examples:
321 # grml ALL=NOPASSWD: /sbin/hdparm
322 # grml ALL=NOPASSWD: /usr/sbin/hwinfo
323 # Cmnd_Alias DEBIAN = /usr/bin/apt-get, /usr/bin/dpkg, /usr/bin/auto-apt, /usr/bin/apt-file
324 # grml ALL=NOPASSWD: DEBIAN
325 # chroot       ALL=NOPASSWD: /usr/sbin/chroot, /bin/su - chroot
326 # chroot       ALL=NOPASSWD: /usr/sbin/chroot, /bin/su - chroot
327
328 secvpn  ALL=NOPASSWD: /usr/sbin/secvpn, /usr/sbin/pppd
329 EOF
330
331 # aptitude install powernowd aumix alsa-utils hwinfo mdadm locales dctrl-tools usbutils sudo bzip2 pdmenu
332 # cp /etc/locale.gen.minimal /etc/locale.gen && locale-gen
333 # mv /etc/motd.dpkg-new /var/run/motd
334
335 mika@funkenzutzler ~/kernel % scp linux-image-2.6.19-grml_grml.02_powerpc.deb efika:/data/chroot/root/
336
337 % cd ~/kernel
338 % cvs -d:pserver:anonymous@aufs.cvs.sourceforge.net:/cvsroot/aufs login
339 % cvs -z3 -d:pserver:anonymous@aufs.cvs.sourceforge.net:/cvsroot/aufs co aufs
340 % cd aufs
341 % export ARCH=powerpc
342 % make GCC=powerpc-linux-gnu-gcc-4.1 KDIR=~/kernel/linux-2.6.19 -f local.mk
343
344 # dpkg -i /root/linux-image-2.6.19-grml_grml.02_powerpc.deb
345
346 # umount /proc
347 # apt-get clean
348 # aptitude forget-new
349 # umount /proc /sys 2>/dev/null
350 # exit # finally leave chroot...
351
352 Build ISO
353 ---------
354
355 # aptitude install squashfs-tools mkisofs
356 # cd /data && mkdir grml_cd.ppc && mkdir grml_cd.ppc/GRML
357 # mksquashfs /data/chroot/* /data/grml_cd.ppc/GRML/GRML -noappend
358
359 # cd /data/grml_cd.ppc && mkdir -p boot/yaboot && cd boot/yaboot
360 # cp /data/chroot/boot/vmlinux-2.6.19-grml linux
361 # cat > yaboot.conf << EOF
362 device=cd:
363 default=grml
364
365 message=/boot/yaboot/boot.msg
366
367 image=/boot/yaboot/linux
368   label=grml
369   initrd=/boot/yaboot/minirt
370   append="quiet"
371   read-only
372
373 image=/boot/yaboot/linux
374   label=debug
375   initrd=/boot/yaboot/minirt
376   append="debug"
377   read-only
378 EOF
379
380 # cat > boot.msg << EOF
381
382 Welcome to grml-ppc.
383
384 EOF
385
386 # cd /tmp
387 # dd if=/dev/zero of=minirt26 bs=6000k count=1
388 # mke2fs -b 1024 -N 8192 -F -q -m 0 minirt26
389 # mount -o loop /tmp/minirt26 /mnt/initrd
390 # cd /mnt/initrd && rm -rf lost+found
391
392
393 % mkdir busybox && cd busybox
394 % wget http://www.busybox.net/downloads/busybox-1.5.0.tar.gz
395 % tar zxf busybox-1.5.0.tar.gz
396 % cd busybox-1.5.0
397 % wget grml.org/tmp/busybox
398 % cp busybox .config
399 % make
400
401 # cd /mnt/minirtd/
402 # mkdir afs cdrom dev etc GRML media mnt modules proc selinux static swap sys
403 # ln -s /GRML/bin bin
404 # ln -s /GRML/boot boot
405 # ln -s /GRML/lib lib
406 # ln -s /GRML/opt opt
407 # ln -s static sbin
408 # ln -s /var/tmp tmp
409 # ln -s /GRML/user usr
410
411 # cd /mnt/initrd/dev && MAKEDEV generic
412
413 # cd /mnt/initrd/GRML
414 # ln -s /cdrom/GRML/bin  bin
415 # ln -s /cdrom/GRML/boot boot
416 # ln -s /cdrom/GRML/etc  etc
417 # ln -s /cdrom/GRML/lib  lib
418 # ln -s /cdrom/GRML/opt  opt
419 # ln -s /cdrom/GRML/sbin sbin
420 # ln -s /cdrom/GRML/usr  usr
421 # ln -s /cdrom/GRML/var  var
422
423 # cp /home/mika/busybox/busybox-1.5.0/busybox /mnt/initrd/static/
424
425 # cd /mnt/initrd/static/
426 # for i in \
427   \[ \[\[ addgroup adduser adjtimex ar arping ash awk basename bunzip2 bzcat cal cat chgrp chmod chown chroot chvt clear cmp \
428   cp cpio crond crontab cut date dc dd deallocvt delgroup deluser df dirname dmesg dos2unix dpkg dpkg-deb du dumpkmap echo \
429   egrep env expr false fbset fdflush fdisk fgrep find fold free freeramdisk fsck.minix ftpget ftpput getopt getty grep gunzip \
430   gzip halt head hexdump hostid hostname httpd hwclock id ifconfig ifdown ifup init insmod ip ipcalc kill killall klogd \
431   last length linuxrc ln loadfont loadkmap logger login logname logread losetup ls lsmod makedevs md5sum mesg mkdir mkfifo  \
432   mkfs.minix mknod mkswap mktemp modprobe more mount mt mv nameif nc netstat nslookup od openvt passwd patch pidof ping, \
433   ping6 pivot_root poweroff printf ps pwd rdate readlink realpath reboot renice reset rm rmdir rmmod route rpm rpm2cpio run-parts \
434   sed setkeycodes sh sha1sum sleep sort start-stop-daemon strings stty su sulogin swapoff swapon sync syslogd tail tar tee \
435   telnet telnetd test tftp time top touch tr traceroute true tty udhcpc udhcpd umount uname uncompress uniq unix2dos unzip \
436   uptime usleep uudecode uuencode vi vlock watch watchdog wc wget which who whoami xargs yes zcat ; \
437   do ln -s ./busybox $i ; done
438
439 # cd /mnt/initrd/
440 # cat > etc/fstab << EOF
441 # /etc/fstab - static file system information
442 # <filesystem> <mountpoint>   <type> <options>                             <dump> <pass>
443 proc           /proc          proc   rw,nosuid,nodev,noexec                 0      0
444 none           /proc/bus/usb  usbfs  defaults,noauto                        0      0
445 sysfs          /sys           sysfs  rw,nosuid,nodev,noexec                 0      0
446 devpts         /dev/pts       devpts mode=0622                              0      0
447 /dev/fd0       /mnt/floppy    auto   users,noauto,exec                      0      0
448 /dev/external  /mnt/external  auto   users,noauto,exec,rw,uid=grml,gid=grml 0      0
449 /dev/external1 /mnt/external1 auto   users,noauto,exec,rw,uid=grml,gid=grml 0      0
450 /dev/cdrom     /mnt/cdrom     auto   users,noauto,exec,ro                   0      0
451 /dev/dvd       /mnt/dvd       auto   users,noauto,exec,ro                   0      0
452 # some other examples:
453 # /dev/hda1       /Grml        ext3    dev,suid,user,noauto 0  2
454 # //1.2.3.4/pub   /smb/pub     smbfs   defaults,user,noauto,uid=grml,gid=grml 0 0
455 # linux:/pub      /beer        nfs     defaults             0  0
456 # tmpfs           /tmp         tmpfs   size=300M            0  0
457 #
458 # Warning! Please do *not* change any lines below because they are auto-generated by rebuildfstab!
459 # If you want to disable rebuildfstab set CONFIG_FSTAB='no' in /etc/grml/autoconfig!
460 # See 'man grml-rebuildfstab' for more details about the following entries.
461 EOF
462
463 # cat > etc/group << EOF
464 root::0:root
465 grml::1000:grml
466 slocate::21:root
467 nobody::-1:nobody
468 EOF
469
470 # cat > etc/mtab << EOF
471 /dev/root / ext2 rw 0 0
472 EOF
473
474 # cat > etc/passwd << EOF
475 root:*:0:0:grml Administrator:/root:/bin/zsh
476 grml:*:1000:1000:grml User:/home/grml:/bin/zsh
477 nobody:*:-1:-1:Nobody:/:/bin/true
478 EOF
479
480 # cat > etc/resolv.conf << EOF
481 # Insert nameservers here
482 # nameserver 127.0.0.1
483 EOF
484
485 # cat > etc/shadow << EOF
486 root:*:11312:0:99999:7:::
487 grml:*:11312:0:99999:7:::
488 nobody:*:11312:0:99999:7:::
489 EOF
490
491 # cat > etc/init << EOF
492 #!/static/ash
493 # This script is called in case of loading this initrd image as
494 # root-partition, so execute linuxrc first, then replace process
495 # with the real init.
496 # (C) Klaus Knopper May 2004, License: GPL
497
498 # linuxrc will configure the ramdisk system, anc then copy a static
499 # init from CD to ramdisk, after finishing the autoconfiguration.
500 /linuxrc
501
502 # Call the real init now
503 exec /etc/init "$@" </dev/console >/dev/console 2>&1
504 EOF
505
506 # cd /mnt/initrd/etc && ln -s /GRML/etc/ld.so.conf ld.so.conf
507
508 # cd /mnt/initrd
509 # wget grml.org/files/devel/linuxrc
510 # chmod 755 linuxrc
511
512 mika@funkenzutzler ~ % scp kernel/aufs/fs/aufs/aufs.ko root@efika:/mnt/initrd/modules/
513
514 # cd /mnt/initrd/modules
515 # mkdir div && cd div
516 # for mod in ehci-hcd.ko firmware_class.ko ieee1394.ko ntfs.ko ohci1394.ko ohci-hcd.ko \
517 pcmcia_core.ko pcmcia.ko rsrc_nonstatic.ko sbp2.ko uhci-hcd.ko usbcore.ko usbhid.ko  \
518 usb-storage.ko yenta_socket.ko ; do find /data/chroot/lib/modules -name "$mod" -exec cp {} . \; ; done
519
520 # cd /tmp
521 # umount /mnt/initrd
522 # gzip -9 minirt26
523 # mv minirt26.gz /data/grml_cd.ppc/boot/yaboot/
524
525 # cp /usr/lib/yaboot/yaboot /data/grml_cd.ppc/boot/yaboot/
526
527 # cd /data/grml_cd.ppc
528 # mkisofs -V "grml-etch 0.00a" -publisher 'Michael Prokop <mika@grml.org>' -l \
529   -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -c boot/yaboot/boot.cat \
530   -b boot/yaboot/yaboot -o /data/grml-ppc_0.00a.iso .
531
532 => PROBLEMS :-/
533
534
535 mkisofs -o /data/grml-ppc_0.00a.iso -part -hfs -r -l -J \
536 -A "grml-ppc" \
537 -P "Michael Prokop" \
538 -p "Michael Prokop" \
539 -abstract "grml-ppc" \
540 -sysid "grml-ppc" \
541 -V "grml-ppc 0.0" \
542 -volset "grml-ppc" \
543 -volset-size 2 \
544 -volset-seqno 1 \
545 -hfs-volid "grml-ppc" \
546 -map `pwd`/mapping \
547 -magic `pwd`/magic \
548 -m "*.orig" \
549 -hide '*.MacOS' -hide '*.DOS' \
550 -hide-joliet '*.Unix' -hide-joliet '*.MacOS' \
551 -hide-hfs '*.Unix' -hide-hfs '*.DOS' \
552 -graft-points \
553 install/yaboot.conf=boot/yaboot/yaboot.conf ./
554
555 #Bless install folder so yaboot can boot
556 hmount $2
557 hattrib -b install
558 #hattrib -t tbxi -c chrp :install:yaboot
559 humount
560
561 ################################################################################
562
563 grml64
564 ======
565
566 debootstrap sid /grml/grml_uncompressed.grml64 http://ftp.tu-graz.ac.at/mirror/debian
567 chroot /grml/grml_uncompressed.grml64 /bin/sh
568
569 cat > /etc/apt/sources.list << EOF
570
571   deb     http://deb.grml.org/                    grml-stable   main
572   deb     http://deb.grml.org/                    grml-testing  main
573   deb     http://ftp.tu-graz.ac.at/mirror/debian  unstable      main contrib non-free
574
575 EOF
576
577 cat > /etc/apt/preferences << EOF
578 // main grml-repository:
579 Package: *
580 Pin: origin deb.grml.org
581 Pin-Priority: 996
582
583 // fallback grml-repository:
584 Package: *
585 Pin: origin grml.org
586 Pin-Priority: 995
587
588 // debian unstable pool (default):
589 Package: *
590 Pin: release a=unstable,o=Debian
591 Pin-Priority: 991
592
593 EOF
594
595 gpg --keyserver subkeys.pgp.net --recv-keys F61E2E7CECDEA787
596 gpg --export F61E2E7CECDEA787 > /etc/apt/grml.key
597 apt-key add /etc/apt/grml.key
598
599 mount /proc
600 apt-get update
601 apt-get install grml-etc grml-etc-core grml-scripts
602 umount /proc
603
604 cd /etc
605 mv inittab inittab.orig
606 cp inittab.grml inittab
607
608 touch /etc/ld.so.nohwcap
609 touch /etc/grml_cd
610 echo "0.01 Release Codename grml64 [$(date +%Y-%m-%d)]" > /etc/grml_version
611 echo 'grml64' > /etc/hostname
612
613 cat > /etc/hosts << EOF
614 127.0.0.1       grml64    localhost
615
616 # The following lines are desirable for IPv6 capable hosts
617 # (added automatically by netbase upgrade)
618
619 ::1     ip6-localhost ip6-loopback grml64
620 fe00::0 ip6-localnet
621 ff00::0 ip6-mcastprefix
622 ff02::1 ip6-allnodes
623 ff02::2 ip6-allrouters
624 ff02::3 ip6-allhosts
625 EOF
626
627 echo 'Yes, do as I say!' | apt-get --force-yes -y install file-rc
628 cp /etc/runlevel.conf /etc/runlevel.conf.orig
629 cp /etc/runlevel.conf.livecd /etc/runlevel.conf
630
631 cat >> /etc/network/interfaces << EOF
632 # The loopback interface
633 # automatically added when upgrading
634 auto lo
635 iface lo inet loopback
636 EOF
637
638 addgroup --gid 1000 grml
639 adduser --uid 1000 --gid 1000 --disabled-password --shell /bin/zsh grml
640 sed -i 's/^root::/root:*:/' /etc/shadow
641 sed -i 's#SHELL=.*#SHELL=/bin/zsh#' /etc/default/useradd
642 sed -i 's#/bin/bash#/bin/zsh#' /etc/passwd
643
644 cat > /etc/sudoers << EOF
645 # sudoers file.
646 # This file MUST be edited with the "visudo" command as root.
647 # See the man page for details on how to write a sudoers file.
648
649 # Host alias specification
650
651 # User alias specification
652
653 # Cmnd alias specification
654
655 # User privilege specification
656 root    ALL=(ALL) ALL
657
658 # WARNING: This allows the unprivileged grml user to start commands as root
659 # WARNING: This is totally insecure and (almost) makes grml a second root account.
660 # WARNING: Never allow external access to the grml user!!!
661 grml    ALL=NOPASSWD: ALL
662
663 # allow editing of files with editor:
664 # grml ALL=NOPASSWD: sudoedit
665
666 # usage examples:
667 # grml ALL=NOPASSWD: /sbin/hdparm
668 # grml ALL=NOPASSWD: /usr/sbin/hwinfo
669 # Cmnd_Alias DEBIAN = /usr/bin/apt-get, /usr/bin/dpkg, /usr/bin/auto-apt, /usr/bin/apt-file
670 # grml ALL=NOPASSWD: DEBIAN
671 # chroot       ALL=NOPASSWD: /usr/sbin/chroot, /bin/su - chroot
672 # chroot       ALL=NOPASSWD: /usr/sbin/chroot, /bin/su - chroot
673
674 secvpn  ALL=NOPASSWD: /usr/sbin/secvpn, /usr/sbin/pppd
675 EOF
676
677 aptitude install powernowd aumix alsa-utils hwinfo mdadm locales
678 cp /etc/locale.gen.grml /etc/locale.gen && locale-gen
679 mv /etc/motd.dpkg-new /var/run/motd
680 aptitude install grml grml-x
681
682 wget http://dufo.tugraz.at/~prokop/grml-kernel/2.6.20-grml/linux-image-2.6.20-grml64_grml.01_amd64.deb
683 wget http://dufo.tugraz.at/~prokop/grml-kernel/2.6.20-grml/linux-headers-2.6.20-grml64_grml.01_amd64.deb
684
685 aptitude install dctrl-tools usbutils bzip2 pdmenu
686
687 aptitude install multitail htop iptstate idesk xserver-xorg-video-vmware
688
689 wget http://grml.org/files/devel/create-scsi-mod-file.sh 
690 chmod 755 ./create-scsi-mod-file.sh
691 ./create-scsi-mod-file.sh > scsi-modules.txt
692
693 apt-get clean
694 aptitude forget-new
695 umount /proc /sys 2>/dev/null
696 exit # finally leave chroot...
697
698 Build ISO
699 ---------
700
701 # cd /grml && mkdir grml_cd.grml64
702 # scp -r mika@192.168.1.104:~/grml/chroot/grml_cd.large/boot grml_cd.grml64/
703 # cd /grml/grml_cd.grml64/boot/isolinux
704 # cp /grml/grml_uncompressed.grml64/boot/vmlinuz-2.6.20-grml64 linux26
705 # mkdir /grml/grml_cd.grml64/GRML/
706 # mksquashfs /grml/grml_uncompressed.grml64/* /grml/grml_cd.grml64/GRML/GRML -noappend
707
708 $UPDATE-INITRD...
709 for mod in *.ko ; do find /grml/grml_uncompressed.grml64/lib/modules/2.6.20-grml64 -name "$mod" -exec cp {} . \; ; done
710
711 Important:
712   ln -s /GRML/emul/ia32-linux/lib emul
713   ln -s /GRML/lib64 lib64
714
715
716 $BUILD_BUSYBOX
717
718 scsi-modules not present in grml64:
719
720   53c700.ko advansys.ko aha152x_cs.ko aha152x.ko aha1542.ko aha1740.ko dpt_i2o.ko 
721   dtc.ko fd_mcs.ko g_NCR5380.ko g_NCR5380_mmio.ko ibmmca.ko in2000.ko NCR53c406a.ko
722   NCR_D700.ko NCR_Q720_mod.ko nsp32.ko nsp_cs.ko pas16.ko psi240i.ko qlogicfas.ko
723   sim710.ko sym53c416.ko t128.ko u14-34f.ko ultrastor.ko wd7000.ko
724
725 % cd ~/kernel
726 % cvs -d:pserver:anonymous@aufs.cvs.sourceforge.net:/cvsroot/aufs login
727 % rehash
728 % cvs -z3 -d:pserver:anonymous@aufs.cvs.sourceforge.net:/cvsroot/aufs co aufs
729 % cd aufs
730 % make KDIR=~/kernel/linux-2.6.20 -f local.mk
731
732 # cp ~mika/kernel/aufs/fs/aufs/aufs.ko /mnt/initrd/modules/
733
734 # cd /home/mika/grml/chroot/grml_cd.grml64
735 # mkisofs -V "grml64 0.01" -publisher 'Michael Prokop <mika@grml.org>' -l \
736   -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -c boot/isolinux/boot.cat -b \
737   boot/isolinux/isolinux.bin -o /grml/grml64_0.01.iso .
738 ################################################################################