Nwipe can now be configured from the kernel command line in grub.cfg using nwipe_options...., likewise the keyboard layout can be set from the kernel command line in grub.cfg using loadkeys=uk etc. A pause was added on nwipe exit so the summary table could be read. Pressing a key then starts a 5 second countdown to launch nwipe. Added the following additional software packages, memtest86, usbutils for usb-devices command etc, hwdata usb and pci, hidapi, libgudev, dosfstools, includes fatlabel, fsck.fat, mkfs.fat, e2fsprogs, includes fsck.

This commit is contained in:
Nick Law
2021-01-14 14:20:39 +00:00
parent 17454c8c7a
commit b5e6e4018e
6 changed files with 75 additions and 0 deletions

View File

@@ -3,9 +3,49 @@
# trap the ctrl+c signal
trap "echo" INT
# initialise
country_code=""
nwipe_options_string=""
# read the kernel command line for the loadkeys label for setting the correct keyboard layout
country_code=$(kernel_cmdline_extractor loadkeys)
if [ $? == 0 ]
then
if [ "$country_code" != "" ]
then
loadkeys $country_code
fi
fi
# read the kernel command line for nwipe options
nwipe_options_string=$(kernel_cmdline_extractor nwipe_options)
if [ $? == 0 ]
then
nwipe_options_flag=1
else
nwipe_options_flag=0
fi
# run nwipe with a time stamped log file
while true
do
if [ $nwipe_options_flag == 0 ]
then
/usr/bin/nwipe --logfile=nwipe_log_$(date +%Y%m%d-%H%M%S).txt
else
/usr/bin/nwipe --logfile=nwipe_log_$(date +%Y%m%d-%H%M%S).txt $nwipe_options_string
fi
printf "Paused, press a key to restart nwipe."
read -rsn1 input
sleep 1;
printf " 4"
sleep 1
printf " 3"
sleep 1;
printf " 2"
sleep 1
printf " 1"
sleep 1;
printf " 0"
done

View File

@@ -14,13 +14,23 @@ BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/shredos/kernel-5.6-defconfig.config"
BR2_PACKAGE_BINUTILS=y
BR2_PACKAGE_DOSFSTOOLS=y
BR2_PACKAGE_DOSFSTOOLS_FATLABEL=y
BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y
BR2_PACKAGE_DOSFSTOOLS_MKFS_FAT=y
BR2_PACKAGE_E2FSPROGS=y
BR2_PACKAGE_HDPARM=y
BR2_PACKAGE_HWDATA=y
BR2_PACKAGE_KBD=y
BR2_PACKAGE_MEMTEST86=y
BR2_PACKAGE_SMARTMONTOOLS=y
BR2_PACKAGE_TRIGGERHAPPY=y
BR2_PACKAGE_USBUTILS=y
BR2_PACKAGE_HIDAPI=y
BR2_PACKAGE_LIBATASMART=y
BR2_PACKAGE_LIBHID=y
BR2_PACKAGE_ELFUTILS=y
BR2_PACKAGE_KERNEL_CMDLINE_EXTRACTOR=y
BR2_PACKAGE_NWIPE=y
BR2_PACKAGE_UTIL_LINUX_BINARIES=y
BR2_PACKAGE_UTIL_LINUX_MOUNT=y

View File

@@ -1799,6 +1799,7 @@ menu "Other"
source "package/gsl/Config.in"
source "package/gtest/Config.in"
source "package/jemalloc/Config.in"
source "package/kernel_cmdline_extractor/Config.in"
source "package/lapack/Config.in"
source "package/libargtable2/Config.in"
source "package/libatomic_ops/Config.in"

View File

@@ -0,0 +1,6 @@
config BR2_PACKAGE_KERNEL_CMDLINE_EXTRACTOR
bool "kernel_cmdline_extractor"
help
Kernel_cmdline_extractor
comment "kernel_cmdline_extractor"

View File

@@ -0,0 +1 @@
sha1 c81a245e89ceb09b28634c6040eef65276e0f51d kernel_cmdline_extractor-v1.04.tar.gz

View File

@@ -0,0 +1,17 @@
################################################################################
#
# kernel_cmdline_extractor
#
################################################################################
KERNEL_CMDLINE_EXTRACTOR_VERSION = v1.04
KERNEL_CMDLINE_EXTRACTOR_SITE = $(call github,PartialVolume,kernel_cmdline_extractor,$(KERNEL_CMDLINE_EXTRACTOR_VERSION))
define KERNEL_CMDLINE_EXTRACTOR_INITSH
(cd $(@D) && ./autogen.sh);
endef
KERNEL_CMDLINE_EXTRACTOR_POST_PATCH_HOOKS += KERNEL_CMDLINE_EXTRACTOR_INITSH
$(eval $(autotools-package))