Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 36463 Details for
Bug 43146
Support for dm-crypt in baselayout
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Rolled init script + config file into baselayout
baselayout.patch (text/plain), 5.58 KB, created by
rob holland (RETIRED)
on 2004-07-30 04:42:45 UTC
(
hide
)
Description:
Rolled init script + config file into baselayout
Filename:
MIME Type:
Creator:
rob holland (RETIRED)
Created:
2004-07-30 04:42:45 UTC
Size:
5.58 KB
patch
obsolete
>diff -ru rc-scripts-1.5.1.orig/etc/conf.d/cryptfs rc-scripts-1.5.1/etc/conf.d/cryptfs >--- rc-scripts-1.5.1.orig/etc/conf.d/cryptfs 2004-07-30 12:40:03.314561848 +0000 >+++ rc-scripts-1.5.1/etc/conf.d/cryptfs 2004-07-30 12:42:27.163693456 +0000 >@@ -1,19 +1,9 @@ >-# Encryped file systems are configured here >-# Syntax: >-# Each line must be either: >-# swap=<map-name> source=<device-name> [options=<cryptsetup-option-string>] [pre_mount=<cmd>] >-# or: >-# mount=<map-name> source=<device-name> [options=<cryptsetup-option-string>] [pre_mount=<cmd>] [post_mount=<cmd>] >- >-# Swap partitions. These should come first in this file so that no keys make their way into unencrypted swap >+# Swap partitions. These should come first so that no keys make their way into unencrypted swap > # If no options are given, they will default to: -c aes -h sha1 -d /dev/urandom > # If no makefs is given then mkswap will be assumed >-# The post_mount command is ignored for swap >- >-# swap=crypt-swap source='/dev/main/swap' >+swap=crypt-swap source='/dev/main/swap' > > # Mounts > # If no options are given, they will default to: -c aes -h sha1 > # No mkfs is run unless you specify a makefs option >- >-# mount=crypt-tmp options='-d /dev/urandom' source='/dev/main/tmp' pre_mount='/sbin/mkreiserfs -f -f ${dev}' post_mount='chown root:root ${mount_point}; chmod 1777 ${mount_point}' >+mount=crypt-tmp options='-d /dev/urandom' source='/dev/main/tmp' pre_mount='/sbin/mkreiserfs -f -f ${dev}' post_mount='chown root:root ${mount_point}; chmod 1777 ${mount_point}' >diff -ru rc-scripts-1.5.1.orig/init.d/checkfs rc-scripts-1.5.1/init.d/checkfs >--- rc-scripts-1.5.1.orig/init.d/checkfs 2004-06-15 21:03:10.000000000 +0000 >+++ rc-scripts-1.5.1/init.d/checkfs 2004-07-30 12:42:08.700500288 +0000 >@@ -179,6 +179,70 @@ > eend $? "Failed to setup the LVM" > fi > >+ >+ ebegin 'Setting up dm-crypt mappings' >+ >+ if [ -f /etc/conf.d/cryptfs ] >+ then >+ cryptfs_status=0 >+ >+ /bin/egrep '^(mount|swap)' /etc/conf.d/cryptfs | \ >+ while read mountline >+ do >+ mount= >+ swap= >+ options= >+ pre_mount= >+ >+ eval ${mountline} >+ >+ if [ -n "${mount}" ] >+ then >+ target=${mount} >+ [ -z "${options}" ] && options='-c aes -h sha1' >+ elif [ -n "${swap}" ] >+ then >+ target=${swap} >+ [ -z "${options}" ] && options='-c aes -h sha1 -d /dev/urandom' >+ else >+ ewarn "Invalid line in /etc/conf.d/cryptomount: ${mountline}" >+ fi >+ >+ ! /bin/cryptsetup status ${target}|egrep '\<active:' > /dev/null >+ configured=$? >+ >+ if [ ${configured} -eq 0 ] >+ then >+ einfo "dm-crypt map ${target}" >+ if ! /bin/cryptsetup ${options} create ${target} ${source} >/dev/console </dev/console >+ then >+ ewarn "Failure configuring ${target}" >+ cryptfs_status=1 >+ else >+ if [ -n "${swap}" ] >+ then >+ [ -z "${pre_mount}" ] && pre_mount='mkswap ${dev}' >+ fi >+ >+ if [ -n "${pre_mount}" ] >+ then >+ dev="/dev/mapper/${target}" >+ einfo " Running pre_mount commands on: ${target}" >+ if ! eval "${pre_mount}" > /dev/null >+ then >+ ewarn "Failed to run pre_mount commands on: ${target}" >+ cryptfs_status=1 >+ fi >+ fi >+ fi >+ else >+ ewarn "dm-crypt mapping ${target} is already configured" >+ cryptfs_status=1 >+ fi >+ done >+ fi >+ ewend ${cryptfs_status} 'Failed to setup a mapping or swap device.' >+ > if [ -f /fastboot -o -n "${CDBOOT}" ] > then > rm -f /fastboot >diff -ru rc-scripts-1.5.1.orig/init.d/halt.sh rc-scripts-1.5.1/init.d/halt.sh >--- rc-scripts-1.5.1.orig/init.d/halt.sh 2004-06-15 16:32:24.000000000 +0000 >+++ rc-scripts-1.5.1/init.d/halt.sh 2004-07-30 12:42:14.635598016 +0000 >@@ -123,6 +123,39 @@ > done > eend 0 > >+# Try to remove any dm-crypt mappings >+ >+if [ -f /etc/conf.d/cryptfs ] >+then >+ ebegin "Removing dm-crypt mappings" >+ >+ /bin/egrep "^(mount|swap)" /etc/conf.d/cryptfs | \ >+ while read mountline >+ do >+ mount= >+ swap= >+ target= >+ >+ eval ${mountline} >+ >+ if [ -n "${mount}" ] >+ then >+ target=${mount} >+ elif [ -n "${swap}" ] >+ then >+ target=${swap} >+ else >+ ewarn "Invalid line in /etc/conf.d/cryptfs: ${mountline}" >+ fi >+ >+ einfo "Removing dm-crypt mapping for: ${target}" >+ if ! /bin/cryptsetup remove ${target} >+ then >+ ewarn "Failed to remove dm-crypt mapping for: ${target}" >+ fi >+ done >+fi >+ > # Stop LVM > if [ -x /sbin/vgchange ] && [ -f /etc/lvmtab -o -d /etc/lvm ] && \ > [ -d /proc/lvm -o "`grep device-mapper /proc/misc 2>/dev/null`" ] >diff -ru rc-scripts-1.5.1.orig/init.d/localmount rc-scripts-1.5.1/init.d/localmount >--- rc-scripts-1.5.1.orig/init.d/localmount 2004-06-15 16:32:24.000000000 +0000 >+++ rc-scripts-1.5.1/init.d/localmount 2004-07-30 12:42:02.832392376 +0000 >@@ -41,6 +41,48 @@ > ebegin "Activating (possibly) more swap" > /sbin/swapon -a &>/dev/null > eend 0 >+ >+ # Run any post_mount commands for cryptfs >+ >+ if [ -f /etc/conf.d/cryptfs ] >+ then >+ ebegin "Running post_mount commands for cryptfs" >+ >+ /bin/egrep "^mount" /etc/conf.d/cryptfs | \ >+ while read mountline >+ do >+ mount= >+ mount_point= >+ post_mount= >+ >+ eval ${mountline} >+ >+ target=${mount} >+ >+ ! /bin/cryptsetup status ${target}|egrep '\<active:' > /dev/null >+ configured=$? >+ >+ if [ ${configured} -eq 1 ] >+ then >+ mount_point=`/bin/awk "/\/dev\/mapper\/${target}/ { print \\$2 }" /proc/mounts` >+ if [ -n "${mount_point}" ] >+ then >+ if [ -n "${post_mount}" ] >+ then >+ if ! eval "${post_mount}" > /dev/null >+ then >+ ewarn "Failed to run post_mount commands on: ${target}" >+ fi >+ fi >+ else >+ ewarn "Failed to find mount point to ${target}. Skipping" >+ fi >+ else >+ ewarn "Target ${target} wasn't mapped, skipping" >+ fi >+ >+ done >+ fi > } > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 43146
:
26492
|
26567
|
26568
|
26578
|
26953
|
27067
|
27268
|
36320
|
36321
|
36322
|
36323
|
36463
|
36464
|
37800
|
40036
|
40037
|
40114