summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmake-boot-image.sh24
1 files changed, 14 insertions, 10 deletions
diff --git a/make-boot-image.sh b/make-boot-image.sh
index 4813f99..6d94b95 100755
--- a/make-boot-image.sh
+++ b/make-boot-image.sh
@@ -8,7 +8,7 @@ WORKDIR=./work # Must not be with "nodev" mount option
DLDIR=./downloads
OUTDIR=./out
OUTUSB=/dev/sdb # Will wreck everything here !
-LEGACY=y # make USB bootable key compatible with non UEFI-BIOS
+LEGACY=n # make USB bootable key compatible with non UEFI-BIOS
DEVEL_MODE=n # Adds debugging tools in the generated image
ROOTCMD=sudo
WGET="wget" # "wget --no-check-certificate" could help but is a security concern
@@ -85,14 +85,15 @@ then $ROOTCMD apt-get update
$ROOTCMD apt-get build-dep linux-source
# Dependencies for kernel tools
[ "x$DEVEL_MODE" == "xy" ] && $ROOTCMD apt-get install libelf-dev libunwind-dev \
- libdw-dev libaudit-dev libssl-dev libslang2-dev libiberty-dev flex bison
+ libdw-dev libaudit-dev libssl-dev libslang2-dev libiberty-dev flex bison tcpdump
# Optionnally qemu to run the result for santity checking
[ "x$DEVEL_MODE" = "xy" ] && $ROOTCMD apt-get install qemu-system-x86
# Dependencies to put into the initrd
$ROOTCMD apt-get install dmidecode pciutils usbutils lshw sysstat iftop strace tmux \
- ntfs-3g e2fsprogs partclone util-linux udpcast gdisk efibootmgr tcpdump pigz \
- pv figlet toilet-fonts
+ ntfs-3g e2fsprogs partclone util-linux udpcast gdisk efibootmgr pigz \
+ pv bc figlet toilet-fonts ncurses-bin
# util-linux : fdisk, sfdisk, lsblk, setterm
+ # ncurses-bin : tput
> "$WORKDIR/apt-done"
fi
@@ -261,9 +262,9 @@ then (
set +x
PATH="$WORKDIR/kernel/tools/perf:/usr/sbin:/usr/bin:/sbin:/bin"
# Diagnostic tools
- mkchroot "$WORKDIR/initrd" dmidecode iftop iostat lshw lspci lsblk lsusb mpstat tcpdump
+ mkchroot "$WORKDIR/initrd" dmidecode iftop iostat lshw lspci lsblk lsusb mpstat
# Console tools and manpages display
- mkchroot "$WORKDIR/initrd" setterm strace groff nroff troff grotty gtbl tmux pv figlet
+ mkchroot "$WORKDIR/initrd" tput setterm strace groff nroff troff grotty gtbl tmux bc pv figlet
# Filesystem tools
mkchroot "$WORKDIR/initrd" mkfs mke2fs /sbin/mkfs.ext* mkntfs mkfs.ntfs mkfs.fat mkexfatfs mkfs.exfat mkfs
mkchroot "$WORKDIR/initrd" ntfs-3g mount.ntfs mount.fuse mount.exfat-fuse mount.exfat
@@ -281,6 +282,9 @@ fi
if [ "x$DEVEL_MODE" == "xy" ]
then (
+ # tcpdump costs few Mb with libcrypto
+ mkchroot "$WORKDIR/initrd" tcpdump
+ # Perf tool
p="$WORKDIR/kernel/tools/perf/perf"
cp -a "$p" "$WORKDIR/initrd/sbin/"
set +x
@@ -292,7 +296,7 @@ if [ ! -d "$WORKDIR/initrd/usr/man" ]
then mkdir -p "$WORKDIR"/initrd/usr/man/man{1,6,8} "$WORKDIR"/initrd/usr/share/groff/current/font
mkdir -p "$WORKDIR"/initrd/etc/groff/ "$WORKDIR"/initrd/usr/share/figlet/
- cp -a /usr/share/man/man1/{iostat,lshw,mpstat,setterm,pv,strace,tmux,pigz,udp-receiver}* "$WORKDIR"/initrd/usr/man/man1/
+ cp -a /usr/share/man/man1/{iostat,lshw,mpstat,setterm,bc,pv,strace,tmux,pigz,udp-receiver}* "$WORKDIR"/initrd/usr/man/man1/
cp -a /usr/share/man/man6/figlet* "$WORKDIR"/initrd/usr/man/man6/
cp -a /usr/share/man/man8/{dmidecode,iftop,lspci,lsblk,lsusb,partclone,efibootmgr,mkfs}* "$WORKDIR"/initrd/usr/man/man8/
cp -a /usr/share/man/man8/{ntfs,mkntfs,mkexfatfs,mount.ntfs,mount.fuse,mount.exfat-fuse}* "$WORKDIR"/initrd/usr/man/man8/
@@ -446,9 +450,7 @@ set -v
/bin/busybox --install -s||rescue_shell # Setup busybox symlinks for all applets
mount_pseudofilesystems || rescue_shell # Setup /dev, /proc, /sys and so
-export TERM=linux # FIXME: wrong default TERM=vt102, why?
loadkmap < /etc/keys.bmap # Load keyboard layout
-setterm -blank 60 # screen sleep mode after 60 minutes
mount -o remount -o size=80% / # Allow using most of RAM for rootfs
@@ -463,6 +465,8 @@ EOF
add_initrd_script "/etc/init.d/rc2" <<"EOF"
echo -e '\033[37;43m'----- rc2 script started -----'\033[0m' # Hint for user about boot steps if its hangs
. /etc/init.d/funcs # Load helper functions
+export TERM=linux # FIXME: wrong default TERM=vt102, why?
+setterm -blank 60 # screen sleep mode after 60 minutes
set -v # Trace execution
network_conf
@@ -552,7 +556,7 @@ EOF
add_initrd_script "/bin/sfx-load" <<"EOF"
notes() {
echo 'print "n=CCDEEFFGAABB\na=nsnbnnsnbnbn\n(\n"; for (d=21;d<109;d++) {
- scale=20; f=440*e((d-69)/12*l(2)); fr=f+0.0005; scale=3; fr=fr/1; scale=0; o=d/12-1; t=d%12;
+ scale=20; f=440*e((d-69)/12*l(2)); fr=f+0.5; scale=0; fr=fr/1; o=d/12-1; t=d%12;
print "echo ${n:",t,":1}${a:",t,":1}",o,"=",fr,"\n"
}; print ") | tr -d n"' | bc -l | busybox sh
}