Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/meta/classes/boot-directdisk.bbclass b/meta/classes/boot-directdisk.bbclass
- index 3169043..df57de4 100644
- --- a/meta/classes/boot-directdisk.bbclass
- +++ b/meta/classes/boot-directdisk.bbclass
- @@ -58,6 +58,21 @@ build_boot_dd() {
- # done in blocks, thus the mod by 16 instead of 32.
- BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
- + KERNEL_VERSION=$(grep '^VERSION\s*=' ${STAGING_KERNEL_DIR}/Makefile | grep -o '[0-9]*$')
- + KERNEL_PATCHLEVEL=$(grep '^PATCHLEVEL\s*=' ${STAGING_KERNEL_DIR}/Makefile | grep -o '[0-9]*$')
- +
- + rm -rf $IMAGE
- + dd if=/dev/zero of=$IMAGE bs=512 seek=1 count=0
- + parted $IMAGE mklabel msdos
- +
- + if [[ $KERNEL_VERSION -eq 3 && $KERNEL_PATCHLEVEL -ge 8 ]] || [ $KERNEL_VERSION -gt 3 ]; then
- + # the disk signature generated by parted isn't really random, so regenerate it
- + dd if=/dev/urandom of=$IMAGE bs=1 seek=440 count=4 conv=notrunc
- +
- + DISK_SIGNATURE=$(hexdump -s 440 -n 4 -e '4 1 "%02x\n" "\n"' $IMAGE | tac | paste -sd '')
- + sed -i "s|\broot=[^ ]*|root=PARTUUID=$DISK_SIGNATURE-02|" $HDDDIR/syslinux.cfg
- + fi
- +
- mkdosfs -n ${BOOTDD_VOLUME_ID} -S 512 -C $HDDIMG $BLOCKS
- mcopy -i $HDDIMG -s $HDDDIR/* ::/
- @@ -71,10 +86,8 @@ build_boot_dd() {
- END3=`expr \( $ROOTFSBLOCKS \* 1024 \) + $END1`
- echo $ROOTFSBLOCKS $TOTALSIZE $END1 $END2 $END3
- - rm -rf $IMAGE
- dd if=/dev/zero of=$IMAGE bs=1024 seek=$TOTALSIZE count=1
- - parted $IMAGE mklabel msdos
- parted $IMAGE mkpart primary fat16 0 ${END1}B
- parted $IMAGE unit B mkpart primary ext2 ${END2}B ${END3}B
- parted $IMAGE set 1 boot on
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement