diff options
-rw-r--r-- | INSTALL.usb | 14 | ||||
-rw-r--r-- | README.md | 60 | ||||
-rw-r--r-- | TODO | 31 | ||||
-rw-r--r-- | data/issue | 19 | ||||
-rw-r--r-- | data/splash.png | bin | 100743 -> 401199 bytes | |||
-rw-r--r-- | dracut/adduser.sh | 4 | ||||
-rw-r--r-- | dracut/getty-autologin.sh | 11 | ||||
-rw-r--r-- | dracut/module-setup.sh | 1 | ||||
-rw-r--r-- | dracut/services.sh | 17 | ||||
-rw-r--r-- | extra/balder10.img | bin | 0 -> 1474560 bytes | |||
-rw-r--r-- | extra/ipxe.iso | bin | 0 -> 686080 bytes | |||
-rw-r--r-- | extra/memtest86+-5.01.iso | bin | 0 -> 1839104 bytes | |||
-rw-r--r-- | extra/mhdd32ver4.6.iso | bin | 0 -> 1533952 bytes | |||
-rw-r--r-- | hrmpf.packages | 358 | ||||
-rw-r--r-- | isolinux/isolinux.cfg.in | 28 | ||||
-rwxr-xr-x | mkhrmpf.sh | 13 | ||||
-rw-r--r-- | mklive.sh.in | 11 |
17 files changed, 509 insertions, 58 deletions
diff --git a/INSTALL.usb b/INSTALL.usb new file mode 100644 index 0000000..775bf46 --- /dev/null +++ b/INSTALL.usb @@ -0,0 +1,14 @@ +# Rough steps to install on USB with a FAT partition, from a booted ISO: + +We assume /dev/sda is the USB stick. + + fdisk /dev/sda + mkfs.vfat -n VOID_LIVE + mount /dev/sda1 /mnt + rsync -avP -x /run/initramfs/live/ /mnt/ + syslinux -d boot -i /dev/sda1 + mkdir /mnt/boot/syslinux + mv /mnt/boot/isolinux /mnt/boot/syslinux + mv /mnt/boot/syslinux/isolinux.cfg /mnt/boot/syslinux/syslinux.cfg + dd if=/usr/lib/syslinux/bios/mbr.bin of=/dev/sda conv=notrunc + diff --git a/README.md b/README.md index 7498034..1980a0e 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,49 @@ -## The Void Linux image/live/rootfs maker and installer + _ __ + | |_ _ _ _ __ _ __ / _| + | ' \| '_| ' \| '_ \ _| + |_||_|_| |_|_|_| .__/_| version 0.1.90 "Kiasoachbomba" + |_| -This repository contains utilities for Void Linux: - - * installer (The Void Linux el-cheapo installer for x86) - * mklive (The Void Linux live image maker for x86) - - * mkimage (The Void Linux image maker for ARM platforms) - * mkrootfs (The Void Linux rootfs maker for ARM platforms) +Welcome to the hrmpf rescue system, built on Void Linux. +This project is based on void-mklive. #### Dependencies - * xbps>=0.45 - * parted (for mkimage) - * qemu-user-static binaries (for mkrootfs) +* xbps>=0.45 +* GNU bash -#### Usage +#### Features -Type +* Loads of console standard tools, with a focus on: + * system rescue + * maintainance + * diagnosis + * networking + * security + * ad-hoc setups + * tiny bits of entertainment if you have to wait for something - $ make +* Missing software easily installable via XBPS. -and then see the usage output: +* Non-Linux extra images (only via ISOLINUX): + * memtest86+ + * iPXE + * FreeDOS + * MHDD32 hard disk analysis - $ ./mklive.sh -h - $ ./mkrootfs.sh -h - $ ./mkimage.sh -h +* ISO image can be burned on CD or written raw on USB stick. -#### Examples +* Load to RAM option, also bootable as MEMDISK. -Build a native live image with runit and keyboard set to 'fr': +* A plain Bash as default shell without annoying fancy configuration. - # ./mklive.sh -k fr - -Build an i686 (on x86\_64) live image with some additional packages: +#### Usage - # ./mklive.sh -a i686 -p 'vim rtorrent' +To build your own: -Build an x86\_64 musl live image with packages stored in a local repository: + % ./mkhrmpf.sh + % linux32 ./mkhrmpf.sh - # ./mklive.sh -a x86_64-musl -r /path/to/host/binpkgs +Download pre-built images at +<https://github.com/chneukirchen/hrmpf/releases>. -See the usage output for more information :-) diff --git a/TODO b/TODO new file mode 100644 index 0000000..78d7a48 --- /dev/null +++ b/TODO @@ -0,0 +1,31 @@ +- forensic mode (don't touch disks) +- hrmpf96 (64+32 image, best in the same squashfs and switch_root into + bindmount) +- artwork! +- install to usb + +fdisk +mkfs.vfat -n VOID_LIVE +mount /dev/sda1 /mnt +rsync -avP -x /run/initramfs/live/ /mnt/ +# or here: fatlabel /dev/sda1 VOID_LIVE +sed -i /SAMPLE/d /etc/mtools.conf +syslinux -d boot -i /dev/sda1 +mkdir /mnt/boot/syslinux +mv /mnt/boot/isolinux /mnt/boot/syslinux +mv /mnt/boot/syslinux/isolinux.cfg /mnt/boot/syslinux/syslinux.cfg +dd if=/usr/lib/syslinux/bios/mbr.bin of=hrmpf.img conv=notrunc + + +Possibly interesting packages found in grml not yet in void: + +bacula? +blktrace? no kernel support +buffer? +centerim? +chkrootkit? +clonezilla? +daemon? daemonize +hwinfo? +ipmitool? +ipsec-tools? diff --git a/data/issue b/data/issue index 9117c72..093632c 100644 --- a/data/issue +++ b/data/issue @@ -1,6 +1,11 @@ -############################################################################### + _ __ +| |_ _ _ _ __ _ __ / _| +| ' \\| '_| ' \\| '_ \\ _| +|_||_|_| |_|_|_| .__/_| version 0.1.90 "Kiasoachbomba" + |_| -Welcome to the Void Linux Live system. Two users are available to log in: +Welcome to the hrmpf rescue system, built on Void Linux. +There are two accounts: - root:voidlinux - anon:voidlinux @@ -8,18 +13,14 @@ Welcome to the Void Linux Live system. Two users are available to log in: The `anon` user additionally has `sudo(8)` permissions to run any command without a password. -To start the installation please type: +You can also use this disk to install Void: # void-installer -and follow the on-screen instructions. To install additional software make +and follow the on-screen instructions. To install additional software make sure to configure your network interface and then use: - xbps-install(8) to install/update packages - xbps-query(8) to query for package info -Thanks for using Void Linux. - - http://www.voidlinux.eu - -############################################################################### +Enjoy! diff --git a/data/splash.png b/data/splash.png index 639d2ef..bcc58b1 100644 --- a/data/splash.png +++ b/data/splash.png Binary files differdiff --git a/dracut/adduser.sh b/dracut/adduser.sh index f006424..f06a4ea 100644 --- a/dracut/adduser.sh +++ b/dracut/adduser.sh @@ -4,7 +4,7 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh -echo void-live > ${NEWROOT}/etc/hostname +echo hrmpf > ${NEWROOT}/etc/hostname AUTOLOGIN=$(getarg live.autologin) USERNAME=$(getarg live.user) @@ -54,3 +54,5 @@ fi if [ -n "$AUTOLOGIN" ]; then sed -i "s,GETTY_ARGS=\"--noclear\",GETTY_ARGS=\"--noclear -a $USERNAME\",g" ${NEWROOT}/etc/sv/agetty-tty1/run fi + +chroot ${NEWROOT} usermod -s /bin/bash root diff --git a/dracut/getty-autologin.sh b/dracut/getty-autologin.sh new file mode 100644 index 0000000..842c768 --- /dev/null +++ b/dracut/getty-autologin.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + +type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh + +USERNAME=$(getarg live.user) +[ -z "$USERNAME" ] && USERNAME=anon + +printf '%s\n' '#!/bin/sh' "exec setsid agetty --noclear --autologin root 38400 tty1 linux" >${NEWROOT}/etc/sv/agetty-tty1/run +printf '%s\n' '#!/bin/sh' "exec setsid agetty --autologin root --login-pause 38400 \${PWD##*-} linux" >${NEWROOT}/etc/sv/agetty-generic/run diff --git a/dracut/module-setup.sh b/dracut/module-setup.sh index df148f5..4170620 100644 --- a/dracut/module-setup.sh +++ b/dracut/module-setup.sh @@ -25,6 +25,7 @@ install() { inst_hook pre-pivot 01 "$moddir/adduser.sh" inst_hook pre-pivot 02 "$moddir/display-manager-autologin.sh" + inst_hook pre-pivot 02 "$moddir/getty-autologin.sh" inst_hook pre-pivot 03 "$moddir/copy-initramfs.sh" inst_hook pre-pivot 04 "$moddir/locale.sh" inst_hook pre-pivot 05 "$moddir/services.sh" diff --git a/dracut/services.sh b/dracut/services.sh index 50461ff..33dda75 100644 --- a/dracut/services.sh +++ b/dracut/services.sh @@ -11,19 +11,6 @@ for f in ${SERVICES}; do ln -sf /etc/sv/$f $NEWROOT/etc/runit/runsvdir/default/ done -dhcpcd=1 -for f in connmand NetworkManager wicd; do - if [ -e $SERVICEDIR/$f ]; then - unset dhcpcd - fi -done - -# Enable all services by default... with some exceptions. -for f in $SERVICEDIR/*; do - _service=${f##*/} - case "${_service}" in - agetty-console|agetty-generic|agetty-serial|agetty-tty[SAU]*|sulogin|dhcpcd-*|iptables|ip6tables|wpa_supplicant|pulseaudio|lvmetad|dmeventd|mdadm) ;; # ignored - dhcpcd) [ -n "$dhcpcd" ] && ln -sf ${f##$NEWROOT} $NEWROOT/etc/runit/runsvdir/default/;; - *) ln -sf ${f##$NEWROOT} $NEWROOT/etc/runit/runsvdir/default/;; - esac +for f in acpid dhcpcd gpm sshd udevd; do + ln -sf /etc/sv/$f $NEWROOT/etc/runit/runsvdir/default/ done diff --git a/extra/balder10.img b/extra/balder10.img new file mode 100644 index 0000000..7f5a5fd --- /dev/null +++ b/extra/balder10.img Binary files differdiff --git a/extra/ipxe.iso b/extra/ipxe.iso new file mode 100644 index 0000000..b7c9910 --- /dev/null +++ b/extra/ipxe.iso Binary files differdiff --git a/extra/memtest86+-5.01.iso b/extra/memtest86+-5.01.iso new file mode 100644 index 0000000..671bf06 --- /dev/null +++ b/extra/memtest86+-5.01.iso Binary files differdiff --git a/extra/mhdd32ver4.6.iso b/extra/mhdd32ver4.6.iso new file mode 100644 index 0000000..c00250e --- /dev/null +++ b/extra/mhdd32ver4.6.iso Binary files differdiff --git a/hrmpf.packages b/hrmpf.packages new file mode 100644 index 0000000..7f1fb6b --- /dev/null +++ b/hrmpf.packages @@ -0,0 +1,358 @@ +acpi +aiccu +alsa-lib +alsa-utils +apg +at +attr +autoconf +automake +autossh +bc +beep +biew +bind-utils +binutils +bison +bmon +bonnie++ +bridge-utils +bsdcpio +bsdtar +btrfs-progs +busybox +bwm-ng +byobu +bzip2 +cabextract +cdrtools +cksfv +cmus +cmus-flac +cmus-libao +cmus-mpc +colordiff +cpio +cpuburn +cpupower +cronie +cryptsetup +csync +csync2 +curl +cvs +daemonize +dar +dash +dateutils +db +ddate +ddclient +ddrescue +debootstrap +dhcpcd +dhex +di +dialog +diffutils +dmidecode +dmraid +dnsmap +dnsmasq +dos2unix +dosfstools +dpkg +dstat +dtach +duff +dumpet +duplicity +dvtm +e2fsprogs +ebtables +ed +edbrowse +efibootmgr +efivar +efmd +elinks +emacs +ent +entr +es +ethtool +exfat-utils +ext4magic +extrace +extundelete +fastd +fatrace +fbset +fdupes +file +findutils +firejail +flashrom +flex +foremost +fping +fuse +fuse-exfat +fuse-sshfs +gawk +gcc +gdb +gettext +git +git-perl +glibc-devel +gnupg +gnupg2 +gpm +gptfdisk +grep +grub +grub-i386-efi +grub-x86_64-efi +gummiboot +gzip +haveged +hdapsd +hddtemp +hdparm +hfsprogs +horst +hostapd +ht +htop +ifenslave +iftop +ii +inetutils-ftp +inetutils-inetd +inetutils-talk +inetutils-telnet +inotify-tools +iodine +ioping +iotop +ipcalc +iperf +iproute2 +ipset +iptables +iptraf-ng +iputils +ired +irqbalance +irssi +iw +jfsutils +jhead +john +jupp +kbd +kbd-data +kexec-tools +kpartx +ksh +ldns +less +lftp +libao-sndio +liboping +libressl-openssl +libtool +lilo +linux-firmware +lm_sensors +logrotate +lrzip +lshw +lsof +ltrace +lvm2 +lxc +lynx +lzop +m4 +make +mbuffer +mc +mcabber +mcelog +mdadm +mercurial +mg +miller +mksh +mmv +mosh +mpg123 +ms-sys +msmtp +msrc_base +mt-st +mtools +mtr +mtree +multitail +mutt +nano +nbd +ncdu +ndisc6 +net-snmp +net-tools +nethack +nethogs +nfs-utils +nftables +nginx +ngrep +nmap +nmon +nq +nsd +ntfs-3g +ntp +numactl +nvi +nwipe +open-iscsi +openbsd-netcat +opensmtpd +openssh +openvpn +oue +outils +p7zip +par +par2cmdline +parallel +partclone +parted +passwdqc +patch +pax +pax-utils +pbzip2 +pciutils +perl +pev +pflask-git +picocom +pigz +pixz +pkg-config +pm-utils +pmr +posh +powertop +ppp +pptpclient +privoxy +procmail +progress +pv +pwgen +python +radvd +ranger +rc +rcs +rdfind +rdumpfs +redo +reptyr +rfkill +rkhunter +rlwrap +rng-tools +rpcbind +rpmextract +rsnapshot +rsync +rsyslog +rtorrent +s-nail +s3cmd +s3fs-fuse +samba +sample +schedtool +screen +sdparm +sg3_utils +sharutils +shorewall +shorewall6 +sic +simple-mtpfs +sleuthkit +slurm +smartmontools +sndio +socat +socklog-void +squashfs-tools +ssdeep +sslscan +strace +stunnel +sudo +swaks +sysfsutils +syslinux +sysstat +tar +tc-play +tcpdump +tcsh +testdisk +texinfo +tftp-hpa +tgt +tin +tlsdate +tmux +tor +traceroute +tree +trn +tweak +unbound +unison +unrar +unzip +usbutils +util-linux +vbindiff +vboot-utils +vde2 +vim +vorbis-tools +vpnc +w3m +wavemon +wgetpaste +which +whois +wireless_tools +wireshark +wol +wpa_supplicant +wvdial +xfsdump +xfsprogs +xinetd +xjobs +xmlstarlet +xtools +xz +zbackup +zerofree +zip +zmap +zpaq +zsh diff --git a/isolinux/isolinux.cfg.in b/isolinux/isolinux.cfg.in index 69de967..06196bb 100644 --- a/isolinux/isolinux.cfg.in +++ b/isolinux/isolinux.cfg.in @@ -8,12 +8,12 @@ MENU AUTOBOOT BIOS default device boot in # second{,s}... MENU BACKGROUND @@SPLASHIMAGE@@ MENU WIDTH 78 MENU MARGIN 1 -MENU ROWS 4 +MENU ROWS 8 MENU VSHIFT 2 -MENU TIMEOUTROW 8 +MENU TIMEOUTROW 12 MENU TABMSGROW 2 -MENU CMDLINEROW 11 -MENU HELPMSGROW 16 +MENU CMDLINEROW 15 +MENU HELPMSGROW 21 MENU HELPMSGENDROW 29 MENU COLOR title * #FF5255FF * @@ -28,6 +28,26 @@ LABEL linuxram MENU LABEL @@BOOT_TITLE@@ @@KERNVER@@ @@ARCH@@ (RAM) KERNEL /boot/vmlinuz APPEND initrd=/boot/initrd root=live:CDLABEL=VOID_LIVE init=/sbin/init ro rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=@@KEYMAP@@ locale.LANG=@@LOCALE@@ @@BOOT_CMDLINE@@ rd.live.ram +LABEL memtest86+ +MENU LABEL memtest86+ 5.01 +KERNEL memdisk +INITRD /boot/memtest86+-5.01.iso +APPEND iso +LABEL mhdd32 +MENU LABEL MHDD32 v4.6 Hard Drive Analysis Tool +KERNEL memdisk +INITRD /boot/mhdd32ver4.6.iso +APPEND iso +LABEL ipxe +MENU LABEL iPXE 1.0.0+ +KERNEL memdisk +INITRD /boot/ipxe.iso +APPEND iso +LABEL balder +MENU LABEL Balder10 FreeDOS +KERNEL memdisk +INITRD /boot/balder10.img +APPEND raw LABEL c MENU LABEL Boot first HD found by BIOS COM32 chain.c32 diff --git a/mkhrmpf.sh b/mkhrmpf.sh new file mode 100755 index 0000000..f1a3cd4 --- /dev/null +++ b/mkhrmpf.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +./mklive.sh \ + -T "hrmpf live/rescue system" \ + -C "loglevel=6 printk.time=1 net.ifnames=0" \ + -r http://repo.voidlinux.eu/current \ + -r http://repo.voidlinux.eu/current/nonfree \ + -S 1024 \ + -B extra/balder10.img \ + -B extra/mhdd32ver4.6.iso \ + -B extra/ipxe.iso \ + -B extra/memtest86+-5.01.iso \ + -p "$(cat hrmpf.packages)" diff --git a/mklive.sh.in b/mklive.sh.in index 913a0c3..63cd510 100644 --- a/mklive.sh.in +++ b/mklive.sh.in @@ -76,6 +76,7 @@ Options: -C "cmdline args" Add additional kernel command line arguments. -T "title" Modify the bootloader title. -K Do not remove builddir. + -B <file> Add file to /boot The $PROGNAME script generates a live image of the Void Linux distribution. This ISO image can be written to a CD/DVD-ROM or any USB stick. @@ -150,6 +151,9 @@ generate_initramfs() { mv $ROOTFS/boot/initrd $BOOT_DIR cp $ROOTFS/boot/vmlinuz-$KERNELVERSION $BOOT_DIR/vmlinuz + if [ "$BOOT_FILES" ]; then + cp $BOOT_FILES $BOOT_DIR + fi } cleanup_rootfs() { @@ -171,6 +175,7 @@ generate_isolinux_boot() { cp -f $SYSLINUX_DATADIR/vesamenu.c32 "$ISOLINUX_DIR" cp -f $SYSLINUX_DATADIR/libutil.c32 "$ISOLINUX_DIR" cp -f $SYSLINUX_DATADIR/chain.c32 "$ISOLINUX_DIR" + cp -f $SYSLINUX_DATADIR/memdisk "$ISOLINUX_DIR" cp -f isolinux/isolinux.cfg.in "$ISOLINUX_DIR"/isolinux.cfg cp -f ${SPLASH_IMAGE} "$ISOLINUX_DIR" @@ -265,14 +270,16 @@ generate_iso_image() { -output "$CURDIR/$OUTPUT_FILE" "$IMAGEDIR" || die "Failed to generate ISO image" } +BOOT_FILES= XBPS_REPOSITORY="--repository=http://repo.voidlinux.eu/current --repository=http://muslrepo.voidlinux.eu/current" # # main() # -while getopts "a:b:r:c:C:T:Kk:l:i:s:S:o:p:h" opt; do +while getopts "a:b:B:r:c:C:T:Kk:l:i:s:S:o:p:h" opt; do case $opt in a) BASE_ARCH="$OPTARG";; b) BASE_SYSTEM_PKG="$OPTARG";; + B) BOOT_FILES="$BOOT_FILES $OPTARG";; r) XBPS_REPOSITORY="--repository=$OPTARG $XBPS_REPOSITORY";; c) XBPS_CACHEDIR="--cachedir=$OPTARG";; K) readonly KEEP_BUILDDIR=1;; @@ -350,7 +357,7 @@ _linux_series=$(XBPS_ARCH=$BASE_ARCH $XBPS_QUERY_CMD -r $ROOTFS ${XBPS_REPOSITOR _kver=$(XBPS_ARCH=$BASE_ARCH $XBPS_QUERY_CMD -r $ROOTFS ${XBPS_REPOSITORY:=-R} -p pkgver ${_linux_series}) KERNELVERSION=$($XBPS_UHELPER_CMD getpkgversion ${_kver}) -: ${OUTPUT_FILE="void-live-${BASE_ARCH}-${KERNELVERSION}-$(date +%Y%m%d).iso"} +: ${OUTPUT_FILE="hrmpf-${BASE_ARCH}-${KERNELVERSION}-$(date +%Y%m%d).iso"} info_msg "[2/9] Installing software to generate the image: ${REQUIRED_PKGS} ..." install_prereqs |