source: netinstall-debian-installer/trunk/lliurex-customizer.sh @ 1552

Last change on this file since 1552 was 1552, checked in by mabarracus, 5 years ago

Add script to customize initrds

File size: 1.1 KB
Line 
1#!/bin/bash -x
2
3ME=$(whoami)
4if [ "x$ME" != "xroot" ]; then
5    echo "I need run as root"
6    exit
7fi
8
9INIT_DIR=$(pwd)
10a=$(arch)
11
12case "$a" in
13    *86)
14        SRC="fuentes_x86"
15        ;;
16
17    *_64)
18        SRC="fuentes_amd64"
19        ;;
20
21    x*)
22        echo "Not implemented"
23        ;;
24esac 
25
26D=$(ls ./$SRC|grep debian-installer)
27if [ ! -d ./$SRC/build-area ]; then
28    pushd ./$SRC/$D
29    svn-buildpackage -us -uc
30    if [ $? -ne 0 ]; then
31        echo "Error"
32        exit
33    fi
34    popd
35fi
36
37PKG=""
38PKG=$(ls ./$SRC/build-area/|egrep 'debian-installer-images.*\.tar\.gz')
39if [ -z "$PKG" ]; then
40    echo ERROR
41    exit 1
42fi
43mkdir -p tmp
44cp ./$SRC/build-area/$PKG tmp/
45
46rm -rf ./$SRC/tarballs ./$SRC/build-area
47
48pushd tmp
49tar xvfz $PKG
50RD=$(find ./ -name initrd.gz)
51RD_DIR=$(dirname $RD)
52pushd $RD_DIR
53
54mkdir -p tmp
55pushd tmp
56gunzip -c ../initrd.gz |cpio -id
57rm -f ../initrd.gz
58for x in $INIT_DIR/resources/*.png ; do
59    N=$(basename $x)
60    cp $INIT_DIR/resources/$N usr/share/graphics/$N
61done
62find ./ | cpio -H newc -o > ../initrd
63popd
64rm -rf tmp
65gzip -9 initrd
66mv initrd.gz initrd.lz
67popd
68cp $RD_DIR/linux ..
69cp $RD_DIR/initrd.lz ..
70popd 
71rm -rf tmp
72echo "Done !"
73
Note: See TracBrowser for help on using the repository browser.