> On Jan 11, 2015, at 9:05 PM, ChenQi <qi.c...@windriver.com> wrote: > > On 01/09/2015 11:52 PM, Drew Moseley wrote: >> Use static device paths for mounting from /dev/disk/<blah> in >> case the device ordering changes. >> >> Signed-off-by: Drew Moseley <drew_mose...@mentor.com> >> --- >> meta/recipes-core/initrdscripts/files/init-install.sh | 14 ++++++++++---- >> 1 file changed, 10 insertions(+), 4 deletions(-) >> >> diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh >> b/meta/recipes-core/initrdscripts/files/init-install.sh >> index fb537ee..f924418 100644 >> --- a/meta/recipes-core/initrdscripts/files/init-install.sh >> +++ b/meta/recipes-core/initrdscripts/files/init-install.sh >> @@ -156,6 +156,12 @@ mkfs.ext3 $rootfs >> echo "Formatting swap partition...($swap)" >> mkswap $swap >> +# Determine the static device paths >> +sync; udevadm settle >> +bootfs_static="$(udevadm info --query=property --name=$bootfs | grep >> DEVLINKS= | cut -d= -f2 | cut -d\ -f1)" >> +swap_static="$(udevadm info --query=property --name=$swap | grep DEVLINKS= >> | cut -d= -f2 | cut -d\ -f1)" >> +rootfs_uuid="$(udevadm info --query=property --name=$rootfs | grep >> ID_PART_ENTRY_UUID | cut -d= -f2)" >> + > > Would ID_PART_ENTRY_UUID be always there?
That's a good question. In my test systems (two VirtualBox configs and two AMD based PCs) it is always there. Taking a second look at my developer Ubuntu system it does not seem to have that field so maybe I'm just getting lucky on my test systems. Anybody have a suggestion for a replacement? >> mkdir /tgt_root >> mkdir /src_root >> mkdir -p /boot >> @@ -166,8 +172,8 @@ mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 >> /src_root >> echo "Copying rootfs files..." >> cp -a /src_root/* /tgt_root >> if [ -d /tgt_root/etc/ ] ; then >> - echo "$swap swap swap defaults >> 0 0" >> /tgt_root/etc/fstab >> - echo "$bootfs /boot ext3 defaults >> 1 2" >> /tgt_root/etc/fstab >> + echo "$swap_static swap swap defaults >> 0 0" >> /tgt_root/etc/fstab >> + echo "$bootfs_static /boot ext3 defaults >> 1 2" >> /tgt_root/etc/fstab >> # We dont want udev to mount our root device while we're booting... >> if [ -d /tgt_root/etc/udev/ ] ; then >> echo "/dev/${device}" >> /tgt_root/etc/udev/mount.blacklist >> @@ -186,7 +192,7 @@ if [ -f /etc/grub.d/00_header ] ; then >> cat >$GRUBCFG <<_EOF >> menuentry "Linux" { >> set root=(hd0,1) >> - linux /vmlinuz root=$rootfs $rootwait rw $5 $3 $4 quiet >> + linux /vmlinuz root=PARTUUID=$rootfs_uuid $rootwait rw $5 $3 $4 quiet > > I thought PARTUUID is for GPT only. > Perhaps so but it does seem to be there on my VirtualBox systems. My Ubuntu host uses "root=UUID=blah" but that was't working for me at some point. I'll dig back into it and see what I can find. Drew -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core