#! /bin/sh # ------------------------------------------------------------------------- # creates a script to do a direct-hd-install 3.6.2 # # Creation: 2008-02-24 jb / LanSpezi # Last Update: $Id: mkhdinstall.sh 20065 2011-09-06 20:16:23Z sklein $ # ------------------------------------------------------------------------- scr_mounted= example() { cat < vfat rw,user,noauto,umask=000 0 0 to /etc/fstab or mount the device before invoking mkfli4l.sh, for instance like follows [sudo] mount -t vfat -o umask=000 or as complete sequence: sudo mount -t vfat -o umask=000 && \ sh mkfli4l.sh --hdinstallpath ; \ sudo umount EOF } check_mount() { device= line=`mount | grep "on $1"` if [ "$line" ]; then set $line real_device=$1 device=`echo $1 | sed -e 's#.*/##;s#[0-9]*$##'` fs=$5 return 0 fi return 1 } mkhdinstall () { if ! check_mount $hdinstall_path; then # try to mount it as normal user scr_mounted=yes echo "-> mounting $hdinstall_path ..." if ! mount $hdinstall_path 2> /dev/null || ! check_mount $hdinstall_path; then # still not mounted, so no user entry in /etc/fstab { cat < $hdinstall_path/hd.cfg; then cf_errors=1 else if [ -f "$dir_build"/BOOT.MSG ]; then echo " boot.msg" if ! cp "$dir_build"/BOOT.MSG $hdinstall_path/boot.msg; then cf_errors=1 fi fi if [ -f "$dir_build"/BOOT_S.MSG ]; then echo " boot_s.msg" if ! cp "$dir_build"/BOOT_S.MSG $hdinstall_path/boot_s.msg; then cf_errors=1 fi fi if [ -f "$dir_build"/BOOT_Z.MSG ]; then echo " boot_z.msg" if ! cp "$dir_build"/BOOT_Z.MSG $hdinstall_path/boot_z.msg; then cf_errors=1 fi fi for file in rc.cfg opt.img kernel rootfs.img syslinux.cfg; do if [ -f "$dir_build"/$file ]; then echo " $file" if ! cp "$dir_build"/$file $hdinstall_path; then cf_errors=1 fi fi done fi if [ "$scr_mounted" = yes ]; then echo "-> unmounting $hdinstall_path" umount $hdinstall_path || abort "failed to unmount $hdinstall_path" fi [ $cf_errors -eq 0 ] || abort "Something went wrong. Get help." } show_header "--- trying to copy files to install medium" mkhdinstall show_end show_header "--- Additional actions for first installations" cat <