Results 1 to 1 of 1
Hello!
First post for me here
My system:
Ubuntu 6.1
Created system:
Debian sarge debootstrap
Wanted bootable media:
Flashdisc
Ok, i will now post all the commands to building my ...
- 03-21-2007 #1Just Joined!
- Join Date
- Mar 2007
- Posts
- 2
Building an embedded debian system, help!
Hello!
First post for me here
My system:
Ubuntu 6.1
Created system:
Debian sarge debootstrap
Wanted bootable media:
Flashdisc
Ok, i will now post all the commands to building my new system.
Feels like iam doing things in the wrong order =(
You guys might come with som suggestions!?
Iam not sure if the the grub command is right because when i boot to the usb-flash-hd the grub menu from my ubuntu menu.lst is showing up. I want it to use the one on my flashdisk. And the kernel is killed after a while. Something like -> Kernel alert = killing init is prompted and the system locks up.
Added this to my ubuntu mnu.lst for testing:
title Other operating systems:
title ------------------------
root
title Robot OS
root (hd0,0)
kernel /boot/vmlinuz-2.6.8-3-386 root=/dev/hda1 ro single
initrd /boot/initrd.img-2.6.8-3-386
boot
This is what i get when i execute the last command in my guide.
root@mattias-laptop:/# grub-install --root-directory=/stripped_OS/ --no-floppy /dev/sda
Installation finished. No error reported.
This is the contents of the device map /stripped_OS//boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
(fd0) /dev/fd0
(hd0) /dev/hda
(hd1) /dev/sda
This might be an error that is from when i install the kernel .. I get prompted to fix the bootloader when i install the kernel.
This is the exact command i use:
-------------------------------------------------------------------------------------------------
root@mattias-laptop:/# sudo -s
root@mattias-laptop:/# umount /dev/sda1
root@mattias-laptop:/# fdisk /dev/sda
Fresh partition:
Delete all partion on the flashdisk using d command in fdisk
Create one partion on the flashdisk using n,p,1,[enter],[enter] command in fdisk
Set bootable flag on flash partion using a,1 command in fdisk
Write the partion to the flash with w
root@mattias-laptop:/# umount /dev/sda1
root@mattias-laptop:/# mke2fs -j /dev/sda1
root@mattias-laptop:/# mkdir /full_OS
root@mattias-laptop:/# apt-get install debootstrap
root@mattias-laptop:/# debootstrap --arch i386 sarge /full_OS/ http://ftp.se.debian.org/debian/
root@mattias-laptop:/# cd /full_OS/etc/
root@mattias-laptop:/full_OS/etc/# gedit fstab
// ---------------------------------------
/dev/hda1 / ext3 auto 0 0
proc /proc proc auto 0 0
// Save and close
root@mattias-laptop:/full_OS/etc/# cd /etc
root@mattias-laptop:/etc/# gedit fstab
// ---------------------------------------
... add these below:
/dev /full_OS/dev none bind 0 0
/proc /full_OS/proc none bind 0 0
// Save and close
root@mattias-laptop:/etc/# mkdir /full_OS/boot/grub
root@mattias-laptop:/etc/# cp /boot/grub/* /full_OS/boot/grub/
root@mattias-laptop:/etc/# cd /full_OS/boot/grub/
root@mattias-laptop:/full_OS/boot/grub/# gedit menu.lst
// ---------------------------------------
default 0
title Robot OS
root (hd0,0)
kernel /boot/vmlinuz-2.6.8-3-386 root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.8-386
quiet
savedefault
boot
// Save and close
root@mattias-laptop:/full_OS/boot/grub/# mount -a
root@mattias-laptop:/full_OS/boot/grub/# chroot /full_OS
root@mattias-laptop:/# apt-get install kernel-image-2.6.8-3-386 // Here i get a question about lilo.conf
root@mattias-laptop:/# exit
root@mattias-laptop:/full_OS/boot/grub/# cd /full_OS/etc/mkinitrd/
root@mattias-laptop:/full_OS/etc/mkinitrd/# gedit mkinitrd.conf
// ---------------------------------------
ROOT=/dev/sda1
// Save and close
root@mattias-laptop:/full_OS/etc/mkinitrd/# umount /full_OS/proc
root@mattias-laptop:/full_OS/etc/mkinitrd/# umount /full_OS/dev
root@mattias-laptop:/full_OS/etc/mkinitrd/# mkdir /stripped_OS
root@mattias-laptop:/full_OS/etc/mkinitrd/# mount /dev/sda1 /stripped_OS/
root@mattias-laptop:/full_OS/etc/mkinitrd/# cp -r /full_OS/* /stripped_OS/
root@mattias-laptop:/full_OS/etc/mkinitrd/# grub-install --root-directory=/stripped_OS/ --no-floppy /dev/sda
-------------------------------------------------------------------------------------------------


Reply With Quote
