summaryrefslogtreecommitdiffstats
path: root/install.sh
blob: b80acbc71146dfae476786beac29f91a4f178715 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

[ $# -ne 1 ] && echo "install.sh <root install path>" && exit 1
mkdir -p ${1}/sbin
mkdir -p ${1}/lib/initcpio
mkdir -p ${1}/etc

sed -e 's|CONFIG="mkinitcpio.conf"|CONFIG="/etc/mkinitcpio.conf"|g' \
    -e 's|FUNCTIONS="functions"|FUNCTIONS="/lib/initcpio/functions"|g' \
    -e 's|HOOKDIR="hooks"|HOOKDIR="/lib/initcpio/hooks"|g' \
    -e 's|INSTDIR="install"|INSTDIR="/lib/initcpio/install"|g' \
    -e 's|PRESETDIR="mkinitcpio.d"|PRESETDIR="/etc/mkinitcpio.d"|g' \
    < mkinitcpio > ${1}/sbin/mkinitcpio
chmod 755 ${1}/sbin/mkinitcpio

install -D -m644 mkinitcpio.conf ${1}/etc/mkinitcpio.conf
install -D -m755 init ${1}/lib/initcpio/init
install -D -m644 functions ${1}/lib/initcpio/functions
cp -r hooks/ ${1}/lib/initcpio/
cp -r install/ ${1}/lib/initcpio/
cp -r mkinitcpio.d/ ${1}/etc/mkinitcpio.d

install -D -m644 mkinitcpio.5.gz /usr/man/man5/mkinitcpio.5.gz