wok-current view busybox-boot/receipt @ rev 14674

edje-dev: Up to 1.7.7
author Dominique Corbex <domcox@slitaz.org>
date Thu Jun 06 22:08:32 2013 +0200 (2013-06-06)
parents 579492e43b93
children f98e99c7c5d8
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox-boot"
4 VERSION="1.21.0"
5 CATEGORY="base-system"
6 SHORT_DESC="Many common UNIX utilities for core-5in1/boot flavor."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 DEPENDS="linux syslinux"
10 WANTED="busybox"
11 WEB_SITE="http://www.busybox.net/"
12 CONFIG_FILES=""
14 # Rules to gen a SliTaz package suitable for Tazpkg.
15 genpkg_rules()
16 {
17 jslinux=false
18 mkdir $fs/bin $fs/dev
19 cp -a $src/busybox-static $fs/bin/busybox
20 mknod -m 660 $fs/dev/console c 5 1
21 mknod -m 771 $fs/dev/null c 1 3
22 mknod -m 660 $fs/dev/tty c 5 0
23 mknod -m 660 $fs/dev/tty1 c 4 1
24 if $jslinux; then
25 mknod -m 644 $fs/dev/clipboard c 10 231
26 mknod -m 660 $fs/dev/ttyS0 c 4 64
27 fi
28 cat > $fs/init <<EOT
29 #!/bin/busybox sh
31 for i in \$(busybox --list) ; do busybox ln /bin/busybox /bin/\$i; done
33 export PATH=/bin
34 export HOME=/
35 export TERM=vt100
37 mkdir /tmp /mnt /proc
38 mount -t proc none /proc
39 while read name major minor ; do
40 for i in '' 1 2 3 4 5 6 7 8 9 ; do
41 mknod -m 644 /dev/\$name\$i b \$major \$((\$i + \$minor))
42 done
43 done <<EOM
44 loop 7 0
45 hda 3 0
46 hdb 3 64
47 sda 8 0
48 sdb 8 16
49 EOM
51 arg()
52 {
53 grep -q \$1= /proc/cmdline && root="\$(sed "s/.*\$1=\\([^ ]*\\).*/\\1/" </proc/cmdline)"
54 }
56 arg mount && mount \$root /mnt
57 arg loopfs && losetup /dev/loop /mnt/\$root && mount /dev/loop /mnt
58 arg subroot && cp /bin/busybox /mnt/\$root/dev/shm &&
59 exec switch_root mnt \$root/dev/shm/busybox chroot \$root /sbin/init
60 arg loopfs && exec switch_root mnt /sbin/init
62 [ -d /proc/bus/usb ] && mount -t usbfs usbfs /proc/bus/usb
63 while read type dir ; do
64 grep -qs \$type /proc/filesystems &&
65 mkdir \$dir && mount -t \$type none \$dir
66 done <<EOM
67 sysfs /sys
68 devpts /dev/pts
69 EOM
71 TTY=\$(tty 2>/dev/null)
72 TTY=\${TTY:-/dev/tty1}
73 EOT
74 $jslinux && echo 'stty -F $TTY rows 30 2>/dev/null' >> $fs/init
75 cat >> $fs/init <<EOT
77 busybox | sed '/Current/,\$!d'
78 while true; do
79 if [ -x /bin/setsid ]; then
80 setsid sh -c "exec sh <\$TTY >\$TTY 2>&1"
81 else
82 sh <\$TTY >\$TTY 2>&1
83 fi
84 done
85 EOT
86 chmod +x $fs/init
87 }
89 pre_install()
90 {
91 rm -rf $1/bin $1/dev
92 }
94 post_install()
95 {
96 rm -rf $1/lib $1/var $1/sbin $1/home $1/root $1/media
97 }