e75e51c23939f5711d8d23788387b003b92ec1ca
[hdw-linux/hdw-linux.git] / packages / ia32 / bootdisk / bootdisk
1 # hdw-linux bootdisk package
2
3 # author: hackbard@hackdaworld.dyndns.org
4
5 # [V] 1.00-pre10
6 # [D] busybox-1.00-pre10.tar.bz2 http://www.busybox.net/downloads/
7 # [S] 2-19
8
9 skip=1
10 s_reason="bootdisks are deluxe ... (scheduled for 1.0 release ;)"
11
12 srcdir="busybox-$ver"
13
14 pre_install()   {
15         mkdir -p ../bootdisk && cd ../bootdisk
16         dd if=/dev/zero of=./bootdisk.img bs=1k count=4096
17         yes "y" | mke2fs -m 0 ./bootdisk.img
18         mkdir mnt && mount -t ext2 -o loop ./bootdisk.img mnt
19         # directories
20         mkdir -p mnt/{boot,dev,proc,etc/init.d}
21         mkdir -p mnt/{sbin,bin,lib,mnt,usr,var/log,pkgs}
22         cd -
23                 }
24
25 build_main()    {
26         # busybox part
27         cp $hdw_home_dir/misc/arch/${hdw_arch}/busybox.config .config
28         make
29         make PREFIX=$root/src.bootdisk/bootdisk/mnt install
30                 }
31
32 post_install()  {
33         cd ../bootdisk
34         # libc
35         cp $root/lib/{ld-*.so,libc-*.so} mnt/lib/
36         cd mnt/lib
37         i=ld-*.so ; ln -sf $i ld-linux.so.2
38         i=libc-*.so ; ln -sf $i libc.so.6
39         cd ../..
40         # some more binaries / configs
41         cp $root/sbin/btee mnt/sbin/
42         ln -sf getty mnt/sbin/agetty
43         ln -sf ash mnt/bin/bash
44         # hdw-get
45         cp $root/usr/bin/hdw-get mnt/bin/
46         cp $root/etc/hdw-get.conf mnt/etc/
47         # init stuff
48         for i in inittab init.d HOSTNAME passwd group fstab conf; do
49                 cp -r $hdw_home_dir/misc/sysfiles/etc/$i mnt/etc/
50         done
51         cp $confdir/issue mnt/etc/
52         # kernel
53         cp $root/boot/vmlinuz_hdw mnt/boot
54         # lilo
55         offset="`ls -s $root/boot/vmlinuz_hdw | awk '{ print $1 }'`"
56         ((offset += 50))
57         cat > mnt/etc/lilo.conf <<-EOF
58 boot=/dev/floppy/0
59 read-write
60 compact
61 image=/boot/vmlinuz_hdw
62 label=hdw-install
63 append="root=/dev/floppy/0"
64 EOF
65         # /dev -- use obsolete devfs!!
66         mount -tdevfs devfs mnt/dev
67         mount -tproc proc mnt/proc
68         lilo -r mnt
69         umount mnt/dev
70         umount mnt/proc
71         # prepare image
72         umount mnt
73         mkdir -p $prefix/share/bootdisk
74         cp bootdisk.img $prefix/share/bootdisk
75                 }