diff options
author | Tobias Powalowski <tpowa@archlinux.org> | 2006-06-14 13:26:36 +0200 |
---|---|---|
committer | Tobias Powalowski <tpowa@archlinux.org> | 2006-06-14 13:26:36 +0200 |
commit | 9290f4f3f9adcdd0dde38957ffe1eada0564db09 (patch) | |
tree | 323ac6fd1277542242f48bd17d49cf2c5dad905a | |
parent | 851b4e2c2b119692c30f185b1c0d10b07cacc322 (diff) | |
download | mkinitcpio-9290f4f3f9adcdd0dde38957ffe1eada0564db09.tar.gz mkinitcpio-9290f4f3f9adcdd0dde38957ffe1eada0564db09.tar.xz |
'added hooks to the packages itself'
git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@127 880c04e9-e011-0410-abf7-b926e227c9cd
-rw-r--r-- | hooks/encrypt | 67 | ||||
-rw-r--r-- | hooks/keymap | 21 | ||||
-rw-r--r-- | hooks/lvm2 | 18 | ||||
-rw-r--r-- | install/encrypt | 18 | ||||
-rw-r--r-- | install/keymap | 44 | ||||
-rw-r--r-- | install/lvm2 | 19 |
6 files changed, 0 insertions, 187 deletions
diff --git a/hooks/encrypt b/hooks/encrypt deleted file mode 100644 index 30dfc12..0000000 --- a/hooks/encrypt +++ /dev/null @@ -1,67 +0,0 @@ -# vim: set ft=sh: -# TODO this one needs some work to work with lots of different -# encryption schemes -run_hook () -{ - mkdevice () { /bin/mknod "/dev/mapper/control" c ${1} ${2}; } - - /bin/modprobe -a -q dm-crypt >/dev/null 2>&1 - if [ -e "/sys/class/misc/device-mapper" ]; then - read dev_t < /sys/class/misc/device-mapper/dev - OLDIFS=$IFS; IFS=: - mkdevice $dev_t - IFS=$OLDIFS - - if /bin/cryptsetup isLuks ${root} >/dev/null 2>&1; then - echo "" - echo "A password is required to access the root filesystem:" - - #loop until we get a real password - while ! /bin/cryptsetup luksOpen ${root} root; do - sleep 2; - done - if [ -e "/dev/mapper/root" ]; then - export root="/dev/mapper/root" - else - err "Password succeeded, but root creation failed, aborting..." - exit 1 - fi - elif [ "x${crypto}" != "x" ]; then - do_oldcrypto () - { - if [ $# -ne 5 ]; then - err "Verify parameter format: crypto=hash:cipher:keysize:offset:skip" - err "Non-LUKS decryption not attempted..." - else - exe="/bin/cryptsetup create root ${root}" - [ "x${1}" != "x" ] && exe="$exe --hash \"${1}\"" - [ "x${2}" != "x" ] && exe="$exe --cipher \"${2}\"" - [ "x${3}" != "x" ] && exe="$exe --key-size \"${3}\"" - [ "x${4}" != "x" ] && exe="$exe --offset \"${4}\"" - [ "x${5}" != "x" ] && exe="$exe --skip \"${5}\"" - echo "" - echo "A password is required to access the root filesystem:" - eval "${exe}" - fi - } - - msg "Non-LUKS encrypted device found..." - OLDIFS=$IFS; IFS=: - do_oldcrypt ${crypto} - IFS=$OLDIFS - - if [ $? -ne 0 ]; then - err "Non-LUKS device decryption failed. verify format: " - err " crypto=hash:cipher:keysize:offset:skip" - exit 1 - else - if [ -e "/dev/mapper/root" ]; then - export root="/dev/mapper/root" - else - err "Password succeeded, but root creation failed, aborting..." - exit 1 - fi - fi - fi - fi -} diff --git a/hooks/keymap b/hooks/keymap deleted file mode 100644 index 414338b..0000000 --- a/hooks/keymap +++ /dev/null @@ -1,21 +0,0 @@ -# vim: set ft=sh: -run_hook () -{ - msg -n ":: Loading keymap..." - . /keymap - if [ "$KEYMAP" != "" ]; then - /bin/loadkeys -q $KEYMAP - fi - # If locale is *.utf set console to Unicode mode - if [ "$UTF8" = "yes" ]; then - /bin/kbd_mode -u - /bin/dumpkeys | /bin/loadkeys --unicode - echo -ne "\e%G" >> /dev/console - fi - if [ "$CONSOLEMAP" != "" ]; then - /bin/setfont -m $CONSOLEMAP $CONSOLEFONT -C /dev/console - else - /bin/setfont $CONSOLEFONT -C /dev/console - fi - msg "done." -} diff --git a/hooks/lvm2 b/hooks/lvm2 deleted file mode 100644 index 1eaae9a..0000000 --- a/hooks/lvm2 +++ /dev/null @@ -1,18 +0,0 @@ -# vim:set ft=sh: -run_hook () -{ - mkdevice () { /bin/mknod "/dev/mapper/control" c ${1} ${2}; } - - /bin/modprobe -q dm-mod >/dev/null 2>&1 - if [ -e "/sys/class/misc/device-mapper" ]; then - read dev_t < /sys/class/misc/device-mapper/dev - OLDIFS=$IFS; IFS=: - mkdevice $dev_t - IFS=$OLDIFS - - msg "Scanning logical volumes..." - /bin/lvm vgscan --ignorelockingfailure - msg "Activating logical volumes..." - /bin/lvm vgchange --ignorelockingfailure -ay - fi -} diff --git a/install/encrypt b/install/encrypt deleted file mode 100644 index e97734e..0000000 --- a/install/encrypt +++ /dev/null @@ -1,18 +0,0 @@ -# vim: set ft=sh: - -install () -{ - MODULES=" dm-crypt $(all_modules "/crypto/" | grep -v "aes.ko" ) " - BINARIES="" - add_dir "/dev/mapper" - add_file "/sbin/cryptsetup.static" "/bin/cryptsetup" - FILES="" - SCRIPT="encrypt" -} - -help () -{ -cat<<HELPEOF - This hook allows for an encrypted root device. -HELPEOF -} diff --git a/install/keymap b/install/keymap deleted file mode 100644 index 0518802..0000000 --- a/install/keymap +++ /dev/null @@ -1,44 +0,0 @@ -# vim: set ft=sh: - -install () -{ - MODULES="" - BINARIES="" - FILES="" - SCRIPT="keymap" - KEYMAP_FILE="$(mktemp /tmp/keymap.XXXXXX)" - add_file /bin/loadkeys.static /bin/loadkeys - add_file /usr/bin/dumpkeys.static /bin/dumpkeys - add_file /usr/bin/kbd_mode.static /bin/kdb_mode - add_file /usr/bin/setfont.static /bin/setfont - grep "KEYMAP=" /etc/rc.conf >> ${KEYMAP_FILE} - grep "CONSOLEFONT=" /etc/rc.conf >> ${KEYMAP_FILE} - grep "CONSOLEMAP=" /etc/rc.conf >> ${KEYMAP_FILE} - if [ "$(echo $LOCALE | /bin/grep -i utf)" != "" ]; then - echo UTF8="yes" >> ${KEYMAP_FILE} - fi - . ${KEYMAP_FILE} - add_file ${KEYMAP_FILE} /keymap - [ "$CONSOLEFONT" != "" ] && add_file /usr/share/kbd/consolefonts/$(grep "CONSOLEFONT=" /etc/rc.conf | awk -FCONSOLEFONT= '{print $2}' | sed -e "s@[\"']*@@g")* - [ "$CONSOLEMAP" != "" ] && add_file /usr/share/kbd/unimaps/$(grep "CONSOLEMAP=" /etc/rc.conf | awk -FCONSOLEMAP= '{print $2}' | sed -e "s@[\"']*@@g")* - if [ "$KEYMAP" != "" ]; then - for i in $(find /usr/share/kbd/ -name "$(grep "KEYMAP=" /etc/rc.conf |\ - awk -FKEYMAP= '{print $2}' | awk -F- '{print $1}' | sed -e "s@[\"']*@@g")*.map.gz"); do - add_file $i - done - for i in $(echo /usr/share/kbd/keymaps/include/*); do - add_file $i - done - for i in $(echo /usr/share/kbd/keymaps/*/include/*); do - add_file $i - done - fi -} - -help () -{ -cat<<HELPEOF - This hook loads the specified keymap and consolefont from rc.conf, - during early userspace. -HELPEOF -} diff --git a/install/lvm2 b/install/lvm2 deleted file mode 100644 index c6cacc3..0000000 --- a/install/lvm2 +++ /dev/null @@ -1,19 +0,0 @@ -# vim: set ft=sh: - -install () -{ - MODULES=" dm-mod " - BINARIES="" - FILES="" - SCRIPT="lvm2" - - add_dir "/dev/mapper" - add_file "/sbin/lvm.static" "/bin/lvm" -} - -help () -{ -cat<<HELPEOF - This hook loads the necessary modules for an LVM2 root device. -HELPEOF -} |