updated early stage3 packages + fixed creation of binaries
[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 2.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 init.d HOSTNAME passwd group fstab conf; do
49                 cp -r $hdw_home_dir/misc/sysfiles/etc/$i mnt/etc/
50         done
51         cp $root/etc/inittab mnt/etc/
52         cp $confdir/issue mnt/etc/
53         # kernel
54         cp $root/boot/vmlinuz_hdw mnt/boot
55         # lilo
56         offset="`ls -s $root/boot/vmlinuz_hdw | awk '{ print $1 }'`"
57         ((offset += 50))
58         cat > mnt/etc/lilo.conf <<-EOF
59 boot=/dev/floppy/0
60 read-write
61 compact
62 image=/boot/vmlinuz_hdw
63 label=hdw-install
64 append="root=/dev/floppy/0"
65 EOF
66         # /dev -- use obsolete devfs!!
67         mount -tdevfs devfs mnt/dev
68         mount -tproc proc mnt/proc
69         lilo -r mnt
70         umount mnt/dev
71         umount mnt/proc
72         # prepare image
73         umount mnt
74         mkdir -p $prefix/share/bootdisk
75         cp bootdisk.img $prefix/share/bootdisk
76                 }