Mario Gzuk wrote:
> Am Dienstag, den 27.03.2007, 13:45 +0200 schrieb Nils Olav Fossum:
>   
>> Tirsdag 27 mars 2007 13:07, skrev Mario Gzuk:
>>     
>>> Am Dienstag, den 27.03.2007, 11:10 +0200 schrieb Steffen Kaiser:
>>>       
>>>> http://unattended-gui.svn.sourceforge.net/viewvc/unattended-gui/z/etc/ini
>>>> t/profiles/unattended-nodosemu/01install?revision=87&view=markup I mean,
>>>> the DOSemu part is wicked.
>>>>         
>>     
>> Im reading into it now.
>> I really like the minimalism of the current linuxboot,
>> so if I can help integrate this into linuxboot ill put some work into it.
>>
>> Mario; Prepare for some stupid questions ;)
>>     
>
> There are no stupid questions, there are only stupid answers. I have
> integrate it into my own boot cd. You can chooce via kernel command line
> or configuration file which profile is used. So you can chooce between:
> http://unattended.technikz.de/index.php/Unattended-gui:Profiles
>
> So the boot cd has much more flexibility.
>
> greetings
>   

Ok.. I'm work'n on integrating this "NO-Dosemu" stuff into my unattended 
package..  I've got it all working with one HUGE exception.  After all 
the files are copied, and the box reboots, I get a message in German 
that says
"Disk error
Press any key to restart"

(Yea, I know.. that's the english version.. )

I've also tried recreating the ntldr files that are in the binary folder 
by reversing the dd command and using skip vs seek to extract the 
contents off of a functioning drive on first reboot from a windows install.

I'll paste the contents of my script below.. basically, I call it 
directly after the install.pl finishes running in place of the dosemu 
stuff..

Some explanation: For some reason, the parted that I've compiled doesn't 
format the partition, so I've added dosfstools to my build so I can use 
the mkdosfs command to format the partition.  I've also taken out the 
parts that write to the unattended file since I'm not using the GUI 
unattended, and don't need those entries.

I've modified the init.functions to work properly without the commands 
that aren't included by default in the unattended.cvs build of 
linuxboot.  As far as I can tell, the dd commands are not writing the 
ntloader mbr and/or bootsect.bat properly.

Any help is greatly appreciated.

Thanks
Michael J. Kidd

------------ Script follows --------------
#!/bin/bash

LOGTTY=/dev/tty4
BASEDIR=/z/linuxaux/etc

source $BASEDIR/init.functions


function mbr_disk () {
  REPLACEMBR=`parse_ini_file /tmp/unattend.txt _meta replace_mbr`
  if [ "$REPLACEMBR" == "1" ]; then
    BOOTNUMBER=`parted /dev/dsk print | grep "boot" | awk '{print $1}'`
    dd if=$BASEDIR/binary/freedos-mbr.bin of=/dev/dsk bs=1 count=446 > 
$LOGTTY 2>&1
    dd if=$BASEDIR/binary/ntldr_boot_code_sector0 of=/dev/dsk$BOOTNUMBER 
bs=1 count=420 seek=90 > $LOGTTY 2>&1
    dd if=$BASEDIR/binary/ntldr_boot_code_sector12 
of=/dev/dsk$BOOTNUMBER bs=512 count=1 seek=12 > $LOGTTY 2>&1
  fi
}

#disable kernel messages
echo "0" > /proc/sys/kernel/printk



active_part_line=`parted -s /dev/dsk print | grep 'boot'`
active_part=`echo $active_part_line | awk '{print $1}'`
if [ -z "$active_part" ]
then
        echo "Partition table:" >&2
        parted /dev/dsk print >&2
        die "No active partition found!"
fi
#replace of the dosemu part....
#write bootcode into mbr and the bootable fat32 partition
BOOTNUMBER=`parted /dev/dsk print | grep "boot" | awk '{print $1}'`
# parted -s /dev/dsk -- mkfs $BOOTNUMBER fat32 > $LOGTTY 2>&1
message_start "Formatting C: FAT32"
mkdosfs -F 32 /dev/dsk${BOOTNUMBER} > $LOGTTY 2>&1
message_end

message_start "Replace mbr"
mbr_disk
message_end

#mount /c
mv /c /OLDc
mkdir /c
message_start "Mount /c"
mount -t vfat /dev/dsk$BOOTNUMBER /c > $LOGTTY 2>&1
message_end
mv /OLDc/* /c/

#boot ini
message_start "Creating boot.ini"
echo "[Boot Loader]" >/c/boot.ini
echo "Timeout=2" >>/c/boot.ini
echo "Default=C:\\\$WIN_NT$.~BT\BOOTSECT.DAT" >>/c/boot.ini
echo "[Operating Systems]" >>/c/boot.ini
echo "C:\\\$WIN_NT$.~BT\BOOTSECT.DAT = \"Installation/Update 
Windows\"">>/c/boot.ini
message_end

#creating directorys
message_start "Creating /c/\$"
mkdir /c/\$ > $LOGTTY 2>&1
message_end
message_start "Creating /c/\$win_nt\$.~bt"
mkdir /c/\$win_nt\$.~bt > $LOGTTY 2>&1
message_end
message_start "Creating /c/\$win_nt\$.~bt/system32"
mkdir /c/\$win_nt\$.~bt/system32 > $LOGTTY 2>&1
message_end
message_start "Creating /c/\$win_nt\$.~ls"
mkdir /c/\$win_nt\$.~ls > $LOGTTY 2>&1
message_end

#bootsect.dat
message_start "Creating bootsect.dat"
dd if=/dev/dsk$BOOTNUMBER of=/c/\$win_nt\$.~bt/bootsect.dat bs=512 
count=1 > $LOGTTY 2>&1
dd if=$BASEDIR/binary/ntldr_boot_code_install 
of=/c/\$win_nt\$.~bt/bootsect.dat bs=1 count=420 seek=90 conv=notrunc > 
$LOGTTY 2>&1
message_end

# exit 1;

#copy files
OS_media=`parse_ini_file /c/netinst/unattend.txt _meta OS_media`
OS_DIR=`echo $OS_media | awk -F: '{print $2}' | sed 's/\\\/\\//g'`
OS_DIR="/z$OS_DIR"

if [ -d "$OS_DIR/amd64" ]
then
        ARCH=amd64
        OS_INSTALL_DIR="$OS_DIR/amd64"
else
        ARCH=i386
        OS_INSTALL_DIR="$OS_DIR/i386"
fi
copy_files "$OS_INSTALL_DIR/" "/c/\$win_nt\$.~bt/" 2 "Copy installation 
files."
copy_files "$OS_INSTALL_DIR/system32/" "/c/\$win_nt\$.~bt/system32/" 2 
"Copy system32."
copy_files "$OS_INSTALL_DIR/" "/c/\$win_nt\$.~ls/" 1 "Copy system"
if [ "$ARCH" == "amd64" ]

then
        copy_files "$OS_DIR/i386/" "/c/\$win_nt\$.~ls/" 1 "Copy i386 system"
fi

copy_files "$OS_DIR/i386/ntldr" "/c/" 3 "Copy ntldr."
copy_files "$OS_DIR/i386/ntdetect.com" "/c/" 3 "Copy ntdetect.com."
copy_files "$OS_DIR/i386/setupldr.bin" "/c/\$ldr\$" 3 "Copy setupldr.bin."
copy_files "$OS_INSTALL_DIR/txtsetup.sif" "/c/" 3 "Copy txtsetup.sif."
copy_files "/c/netinst/unattend.txt" "/c/\$win_nt\$.~bt/winnt.sif" 3 
"Copy winnt.sif."
#move files/drivers to the right pace.....
message_start "Move driver direcory"
mv /c/\$win_nt\$.~ls/$ARCH/\$[Oo][eE][mM]\$/* /c/\$/ > $LOGTTY 2>&1
message_end

#end umount /c
message_start "Umount /c"
umount /c
message_end

exit 0


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
unattended-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unattended-devel

Reply via email to