File: unpack-initrd

package info (click to toggle)
abootimg 0.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 156 kB
  • sloc: ansic: 775; sh: 39; makefile: 29
file content (20 lines) | stat: -rwxr-xr-x 295 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
#

initrd=${1:-initrd.img}
ramdisk=${2:-ramdisk}

if [ ! -f $initrd ]; then
    echo "$initrd does not exist."
    exit 1
fi

if [ -d $ramdisk ]; then
    echo "$ramdisk already exists."
    exit 1
fi

mkdir -p $ramdisk

zcat $initrd | ( cd $ramdisk; cpio -i --no-absolute-filenames)