diff --git a/cbox-tree.d/etc/rc3.d/S99cb-finish-boot b/cbox-tree.d/etc/rc3.d/S99cb-finish-boot index 1c5173d..b99b58a 120000 --- a/cbox-tree.d/etc/rc3.d/S99cb-finish-boot +++ b/cbox-tree.d/etc/rc3.d/S99cb-finish-boot @@ -1 +1 @@ -../init.d/cb-hints.sh \ No newline at end of file +../init.d/cb-finish-boot \ No newline at end of file diff --git a/cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh b/cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh index cf1d866..f53f88e 100755 --- a/cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh +++ b/cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh @@ -120,7 +120,7 @@ function create_config() log_msg "Copying configuration defaults ..." cp -a "$CONFIG_DEFAULTS_DIR/." "$CONFIG_DIR" - log_msg "Copying temporary cerificate file to config filesystem ..." + log_msg "Copying temporary certificate file to config filesystem ..." # beware: the temp file should always be there - even after reboot - see "mount_config" cp -p "$CERT_TEMP" "$CERT_FILE" @@ -233,6 +233,16 @@ function find_harddisk() echo -n "$dev" } +function get_available_disks() +# looks which allowed disks are at the moment connected with the cbox +{ + local dev=$( + for a in $SCAN_DEVICES + do grep -q " `basename $a`$" /proc/partitions && echo "$a" + done ) + echo -n "$dev" +} + function mount_config() { @@ -257,9 +267,9 @@ function mount_config() function mount_crypto() { - is_crypto_mounted && echo "Das Crypto-Dateisystem ist bereits aktiv!" && return + is_crypto_mounted && echo "The cryptofilesystem is already active!" && return local device=`find_harddisk` - [ -z "$device" ] && error_msg 4 'no valid harddisk found!' && return 1 + [ -z "$device" ] && error_msg 4 'No valid harddisk found!' && return 1 # passphrase is read from stdin log_msg "Mounting crypto partition ..." $CRYPTSETUP -h "$(config_get_value hash)" -c "$(config_get_value cipher)" create "`basename $CRYPTMAPPER_DEV`" "${device}2" @@ -301,12 +311,12 @@ function init_cryptobox_part1() # this is only the first part of initialisation that takes no time - good for a smooth web interface { local device=$(find_harddisk) - [ -z "$device" ] && log_msg 'no valid harddisk found!' && return 1 + [ -z "$device" ] && log_msg 'No valid harddisk found!' && return 1 ( log_msg "Initializing crypto partition on $device ..." umount_crypto || true mount | grep -q " $CONFIG_DIR " && umount "$CONFIG_DIR" || true - initial_checks "$device" || return 1 + initial_checks "$device" || { log_msg "initial checks failed" && return 1} create_partitions "$device" create_config "$device" ) >>"$LOG_FILE" 2>&1 @@ -437,6 +447,9 @@ case "$ACTION" in # wait for 5 seconds to finish present http requests echo -n "sleep 5; ifconfig $NET_IFACE `config_get_value ip`" | at now ;; + get_available_disks ) + get_available_disks + ;; get_current_ip ) get_current_ip ;; @@ -487,6 +500,7 @@ case "$ACTION" in echo " is_config_mounted - check, if configuration partition is mounted" echo " is_init_running - check, if initialization is ongoing" echo " is_harddisk_available - check, if there is a usable harddisk" + echo " get_available_disks - shows all connected and allowed disks" echo " get_current_ip - get the current IP of the network interface" echo " update_ip_address - update the network interface after reconfiguration" echo " set_config NAME VALUE - change a configuration setting" diff --git a/cbox-tree.d/var/www/cgi-bin/cryptobox.pl b/cbox-tree.d/var/www/cgi-bin/cryptobox.pl index 272b6a7..cafdcb1 100755 --- a/cbox-tree.d/var/www/cgi-bin/cryptobox.pl +++ b/cbox-tree.d/var/www/cgi-bin/cryptobox.pl @@ -161,6 +161,11 @@ sub is_harddisk_available return (system("$CB_SCRIPT","is_harddisk_available") == 0); } +sub get_available_disks +# TODO: this is useful for diskselection buttons +{ + return `$CB_SCRIPT get_available_disks`; +} sub get_current_ip # the IP of eth0 - not the configured value of the box (only for validation) diff --git a/kernel/config-2.6.12.6_cryptobox0.3 b/kernel/config-2.6.12.6_cryptobox0.3 index 4a2b198..eeae54c 100644 --- a/kernel/config-2.6.12.6_cryptobox0.3 +++ b/kernel/config-2.6.12.6_cryptobox0.3 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.12.6 -# Mon Oct 17 13:43:42 2005 +# Fri Oct 21 00:03:17 2005 # CONFIG_X86=y CONFIG_MMU=y @@ -357,117 +357,86 @@ CONFIG_IDEDMA_AUTO=y # # SCSI device support # -CONFIG_SCSI=m -# CONFIG_SCSI_PROC_FS is not set +CONFIG_SCSI=y +CONFIG_SCSI_PROC_FS=y # # SCSI support type (disk, tape, CD-ROM) # -CONFIG_BLK_DEV_SD=m +CONFIG_BLK_DEV_SD=y # CONFIG_CHR_DEV_ST is not set # CONFIG_CHR_DEV_OSST is not set -CONFIG_BLK_DEV_SR=m +CONFIG_BLK_DEV_SR=y # CONFIG_BLK_DEV_SR_VENDOR is not set -CONFIG_CHR_DEV_SG=m +CONFIG_CHR_DEV_SG=y # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # -CONFIG_SCSI_MULTI_LUN=y +# CONFIG_SCSI_MULTI_LUN is not set # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set # # SCSI Transport Attributes # -CONFIG_SCSI_SPI_ATTRS=m -CONFIG_SCSI_FC_ATTRS=m +# CONFIG_SCSI_SPI_ATTRS is not set +# CONFIG_SCSI_FC_ATTRS is not set # CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers # -CONFIG_BLK_DEV_3W_XXXX_RAID=m -CONFIG_SCSI_3W_9XXX=m -CONFIG_SCSI_7000FASST=m -CONFIG_SCSI_ACARD=m -CONFIG_SCSI_AHA152X=m -CONFIG_SCSI_AHA1542=m -CONFIG_SCSI_AACRAID=m -CONFIG_SCSI_AIC7XXX=m -CONFIG_AIC7XXX_CMDS_PER_DEVICE=32 -CONFIG_AIC7XXX_RESET_DELAY_MS=15000 -# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set -CONFIG_AIC7XXX_DEBUG_ENABLE=y -CONFIG_AIC7XXX_DEBUG_MASK=0 -CONFIG_AIC7XXX_REG_PRETTY_PRINT=y -CONFIG_SCSI_AIC7XXX_OLD=m -CONFIG_SCSI_AIC79XX=m -CONFIG_AIC79XX_CMDS_PER_DEVICE=32 -CONFIG_AIC79XX_RESET_DELAY_MS=15000 -# CONFIG_AIC79XX_BUILD_FIRMWARE is not set -# CONFIG_AIC79XX_ENABLE_RD_STRM is not set -CONFIG_AIC79XX_DEBUG_ENABLE=y -CONFIG_AIC79XX_DEBUG_MASK=0 -CONFIG_AIC79XX_REG_PRETTY_PRINT=y -CONFIG_SCSI_DPT_I2O=m -CONFIG_SCSI_IN2000=m +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_3W_9XXX is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_IN2000 is not set # CONFIG_MEGARAID_NEWGEN is not set -CONFIG_MEGARAID_LEGACY=m +# CONFIG_MEGARAID_LEGACY is not set # CONFIG_SCSI_SATA is not set -CONFIG_SCSI_BUSLOGIC=m -# CONFIG_SCSI_OMIT_FLASHPOINT is not set -CONFIG_SCSI_DMX3191D=m -CONFIG_SCSI_DTC3280=m -CONFIG_SCSI_EATA=m -# CONFIG_SCSI_EATA_TAGGED_QUEUE is not set -# CONFIG_SCSI_EATA_LINKED_COMMANDS is not set -CONFIG_SCSI_EATA_MAX_TAGS=16 -CONFIG_SCSI_FUTURE_DOMAIN=m -CONFIG_SCSI_GDTH=m -CONFIG_SCSI_GENERIC_NCR5380=m -CONFIG_SCSI_GENERIC_NCR5380_MMIO=m -# CONFIG_SCSI_GENERIC_NCR53C400 is not set -CONFIG_SCSI_IPS=m -CONFIG_SCSI_INITIO=m -CONFIG_SCSI_INIA100=m -CONFIG_SCSI_PPA=m -CONFIG_SCSI_IMM=m -# CONFIG_SCSI_IZIP_EPP16 is not set -# CONFIG_SCSI_IZIP_SLOW_CTR is not set -CONFIG_SCSI_NCR53C406A=m -CONFIG_SCSI_SYM53C8XX_2=m -CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 -CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 -CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 -# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set -CONFIG_SCSI_IPR=m -# CONFIG_SCSI_IPR_TRACE is not set -# CONFIG_SCSI_IPR_DUMP is not set -CONFIG_SCSI_PAS16=m -CONFIG_SCSI_PSI240I=m -CONFIG_SCSI_QLOGIC_FAS=m -CONFIG_SCSI_QLOGIC_FC=m -# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set -CONFIG_SCSI_QLOGIC_1280=m -# CONFIG_SCSI_QLOGIC_1280_1040 is not set -CONFIG_SCSI_QLA2XXX=m -CONFIG_SCSI_QLA21XX=m -CONFIG_SCSI_QLA22XX=m -CONFIG_SCSI_QLA2300=m -CONFIG_SCSI_QLA2322=m -CONFIG_SCSI_QLA6312=m -CONFIG_SCSI_LPFC=m -CONFIG_SCSI_SYM53C416=m -CONFIG_SCSI_DC395x=m -CONFIG_SCSI_DC390T=m -CONFIG_SCSI_T128=m -CONFIG_SCSI_U14_34F=m -# CONFIG_SCSI_U14_34F_TAGGED_QUEUE is not set -# CONFIG_SCSI_U14_34F_LINKED_COMMANDS is not set -CONFIG_SCSI_U14_34F_MAX_TAGS=8 -CONFIG_SCSI_ULTRASTOR=m -CONFIG_SCSI_NSP32=m +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set +# CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_PPA is not set +# CONFIG_SCSI_IMM is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_IPR is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_FC is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +CONFIG_SCSI_QLA2XXX=y +# CONFIG_SCSI_QLA21XX is not set +# CONFIG_SCSI_QLA22XX is not set +# CONFIG_SCSI_QLA2300 is not set +# CONFIG_SCSI_QLA2322 is not set +# CONFIG_SCSI_QLA6312 is not set +# CONFIG_SCSI_LPFC is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC395x is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_ULTRASTOR is not set +# CONFIG_SCSI_NSP32 is not set # CONFIG_SCSI_DEBUG is not set # @@ -501,7 +470,7 @@ CONFIG_IEEE1394=y # Subsystem Options # # CONFIG_IEEE1394_VERBOSEDEBUG is not set -# CONFIG_IEEE1394_OUI_DB is not set +CONFIG_IEEE1394_OUI_DB=y # CONFIG_IEEE1394_EXTRA_CONFIG_ROMS is not set # @@ -511,17 +480,17 @@ CONFIG_IEEE1394=y # # Texas Instruments PCILynx requires I2C # -CONFIG_IEEE1394_OHCI1394=m +CONFIG_IEEE1394_OHCI1394=y # # Protocol Drivers # # CONFIG_IEEE1394_VIDEO1394 is not set -CONFIG_IEEE1394_SBP2=m +CONFIG_IEEE1394_SBP2=y # CONFIG_IEEE1394_SBP2_PHYS_DMA is not set # CONFIG_IEEE1394_ETH1394 is not set # CONFIG_IEEE1394_DV1394 is not set -# CONFIG_IEEE1394_RAWIO is not set +CONFIG_IEEE1394_RAWIO=y # CONFIG_IEEE1394_CMP is not set # @@ -953,7 +922,7 @@ CONFIG_DUMMY_CONSOLE=y # CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y -CONFIG_USB=m +CONFIG_USB=y # CONFIG_USB_DEBUG is not set # @@ -968,13 +937,13 @@ CONFIG_USB_DEVICEFS=y # # USB Host Controller Drivers # -CONFIG_USB_EHCI_HCD=m +CONFIG_USB_EHCI_HCD=y # CONFIG_USB_EHCI_SPLIT_ISO is not set # CONFIG_USB_EHCI_ROOT_HUB_TT is not set -CONFIG_USB_OHCI_HCD=m +CONFIG_USB_OHCI_HCD=y # CONFIG_USB_OHCI_BIG_ENDIAN is not set CONFIG_USB_OHCI_LITTLE_ENDIAN=y -CONFIG_USB_UHCI_HCD=m +CONFIG_USB_UHCI_HCD=y # CONFIG_USB_SL811_HCD is not set # @@ -987,7 +956,7 @@ CONFIG_USB_UHCI_HCD=m # # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # -CONFIG_USB_STORAGE=m +CONFIG_USB_STORAGE=y # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_DATAFAB is not set CONFIG_USB_STORAGE_FREECOM=y @@ -1182,18 +1151,32 @@ CONFIG_CRAMFS=y # # Partition Types # -# CONFIG_PARTITION_ADVANCED is not set +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_EFI_PARTITION is not set # # Native Language Support # CONFIG_NLS=y CONFIG_NLS_DEFAULT="iso8859-15" -CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_437=y # CONFIG_NLS_CODEPAGE_737 is not set # CONFIG_NLS_CODEPAGE_775 is not set -CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_850=y # CONFIG_NLS_CODEPAGE_852 is not set # CONFIG_NLS_CODEPAGE_855 is not set # CONFIG_NLS_CODEPAGE_857 is not set @@ -1213,21 +1196,21 @@ CONFIG_NLS_CODEPAGE_850=m # CONFIG_NLS_ISO8859_8 is not set # CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set -CONFIG_NLS_ASCII=m -CONFIG_NLS_ISO8859_1=m -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_ISO8859_13 is not set -# CONFIG_NLS_ISO8859_14 is not set +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_2=y +CONFIG_NLS_ISO8859_3=y +CONFIG_NLS_ISO8859_4=y +CONFIG_NLS_ISO8859_5=y +CONFIG_NLS_ISO8859_6=y +CONFIG_NLS_ISO8859_7=y +CONFIG_NLS_ISO8859_9=y +CONFIG_NLS_ISO8859_13=y +CONFIG_NLS_ISO8859_14=y CONFIG_NLS_ISO8859_15=y -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -CONFIG_NLS_UTF8=m +CONFIG_NLS_KOI8_R=y +CONFIG_NLS_KOI8_U=y +# CONFIG_NLS_UTF8 is not set # # Profiling support diff --git a/kernel/kernel-image-2.6.12.6_cryptobox0.3_i386.deb b/kernel/kernel-image-2.6.12.6_cryptobox0.3_i386.deb index 29c5b84..df98480 100644 Binary files a/kernel/kernel-image-2.6.12.6_cryptobox0.3_i386.deb and b/kernel/kernel-image-2.6.12.6_cryptobox0.3_i386.deb differ diff --git a/scripts/cbox-build.sh b/scripts/cbox-build.sh index 6baa770..8c8db5e 100755 --- a/scripts/cbox-build.sh +++ b/scripts/cbox-build.sh @@ -84,7 +84,7 @@ function configure_cb() if [ ! -e "$IMAGE_DIR" ]; then echo -e "Directory \"$IMAGE_DIR\" not found!" echo -e "Did you run \"$0 dfsbuild\"?" - exit + exit 1 fi echo "Copying files to the box ..." @@ -102,7 +102,7 @@ function configure_cb() # 'source' implicitly imports all current settings # indent these lines to improve the output ( source "$file" ) 2>&1 | sed 's/^/\t/' - done + done } @@ -110,9 +110,12 @@ function blanknburn_cdrw() { cdrecord -v dev=$CDWRITER blank=fast if [ -e "$IMAGEZ_FILE" ]; then - $IMAGE_FILE=$IMAGEZ_FILE + cdrecord -v dev=$CDWRITER $IMAGEZ_FILE + elif [ -e "IMAGE_FILE" ]; then + cdrecord -v dev=$CDWRITER $IMAGE_FILE + else + echo "can't find CryptoBox image to burn" && exit 1 fi - cdrecord -v dev=$CDWRITER $IMAGE_FILE } ################ do it! ###################### @@ -121,7 +124,7 @@ function blanknburn_cdrw() # initialize local directories (easier for users) for a in $LOCALCONF_DIR $CUSTOM_CONFIGURE_DIR do [ ! -e "$a" ] && mkdir "$a" && chown --reference=. "$a" - done +done # check for uid=0 (necessary for all operations) [ "$(id -u)" -ne 0 ] && echo "this script ($0) has to be called as root" >&2 && exit 1