File: mkdisk

package info (click to toggle)
loadlin 1.6f-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 800 kB
  • sloc: asm: 3,823; ansic: 402; makefile: 80; sh: 16
file content (19 lines) | stat: -rwxr-xr-x 366 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
if [ -z $1 ]; then
  exit 1
fi

PROGRAM=$1
SIZE=`/bin/ls -l $PROGRAM |awk '{print $5}'`
SIZE=`expr $SIZE / 1024 + 50`

mke2fs /dev/ram $SIZE
mount -t ext2 /dev/ram /mnt
mkdir /mnt/dev
mknod /mnt/dev/tty1 c 4 1
mkdir /mnt/proc
chmod 555 /mnt/proc
cp -p $PROGRAM /mnt/linuxrc
umount /dev/ram
dd if=/dev/ram bs=1k count=$SIZE of=initdisk
freeramdisk /dev/ram