make grub udisk manually

Below is the steps how to make grub udisk manually

my udisk is /dev/sdc

  1. clean udisk information(mbr and partition information)

sudo dd if=/dev/zero of=/dev/sdc bs=1M count=1024 oflag=direct

  1. create dos partition table

sudo fdisk /dev/sdc

o create a new empty DOS partition table
n -> p -> default->default->204800
a toggle a bootable flag
w write table to disk and exit

  1. sudo mkfs.ext4 /dev/sdc1
    sudo mount /dev/sdc1 /media/wrsadmin/boot/
    sudo grub-install --root-directory=/media/wrsadmin/boot/ /dev/sdc

Installing for i386-pc platform.
Installation finished. No error reported.

  1. vi grub.cfg, add your menuentry
    menuentry ‘wrlinux-nfs-dhcp-rootfs3’ {
    recordfail
    load_video
    gfxmode l i n u x g f x m o d e i n s m o d g z i o i f [ x linux_gfx_mode insmod gzio if [ x linuxgfxmodeinsmodgzioif[xgrub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_msdos
    insmod ext2
    set root=‘hd0,msdos1’
    linux /boot/bzImage rootfstype=nfs root=/dev/nfs rw nfsroot=128.224.162.154:/nfsroot/rootfs3,vers=3 ip=dhcp console=ttyUSB0,115200n8
    }
    5.copy bzImage to /boot/bzImage
    6.set pc bios boot from udisk
  2. about the rootfs
    for arm, you can build one with busybox by yourself;
    for x86, you can use yocto to build one.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值