Coder Social home page Coder Social logo

dd support for /dev/zero about grub HOT 10 CLOSED

a1ive avatar a1ive commented on August 22, 2024
dd support for /dev/zero

from grub.

Comments (10)

a1ive avatar a1ive commented on August 22, 2024

I want to write a string (the value of a variable) into an existing file (NTFS or FAT).

dd --str=STRING --of=...
深度截图_选择区域_20200223081540

from grub.

a1ive avatar a1ive commented on August 22, 2024

now you can use (proc) as /dev/zero.
disk size is 2TB (UINT32_MAX).
深度截图_选择区域_20200223095359

from grub.

steve6375 avatar steve6375 commented on August 22, 2024

Thanks!
When booting WinPE ISOs that have been made using WinBuilder, they look for an INI file in the root of all drives.

I have added some code to my map.sh and now Gandalf WinPE boots correctly using map (no yellow triangle on Desktop and apps work).

My first partition has all three .ini files
WinBuilder INI files.zip

	loopback -d loop;
	loopback loop "${grubfm_file}";
	set installiso="${grubfm_path}";
	tr --set=installiso "/" "\\";
	set "iso1=[IsoInfo]\x0d\x0aIsoName=${installiso}\x0d\x0a"
	if [ -f (loop)/CdUsb.Y -o -f (loop)/Win10PE.cd -o -f (loop)/Win8PE.cd ] ; then 
		echo Info: WinBuilder ISO detected!
		if [ -f (hd0,msdos1)/Win10PESE.ini ] ; then dd --if (proc) --of=(hd0,msdos1)/Win10PESE.ini ; dd -s "$iso1" --of=(hd0,msdos1)/Win10PESE.ini ; fi
		if [ -f (hd0,msdos1)/Win8PESE.ini ]  ; then dd --if (proc) --of=(hd0,msdos1)/Win8PESE.ini  ; dd -s "$iso1" --of=(hd0,msdos1)/Win8PESE.ini  ; fi
		if [ -f (hd0,msdos1)/Win7PESE.ini ]  ; then dd --if (proc) --of=(hd0,msdos1)/Win7PESE.ini  ; dd -s "$iso1" --of=(hd0,msdos1)/Win7PESE.ini  ; fi
		#grubfm_hex (hd0,msdos1)/Win7PESE.ini
	unset iso1
	fi

from grub.

steve6375 avatar steve6375 commented on August 22, 2024

P.S. dd seems very slow when using (proc) ???

from grub.

a1ive avatar a1ive commented on August 22, 2024

P.S. dd seems very slow when using (proc) ???

If you are trying to dd a file, grub2 will convert file to blocklists.

from grub.

steve6375 avatar steve6375 commented on August 22, 2024

yes, as in example code above.

from grub.

a1ive avatar a1ive commented on August 22, 2024

If (hd0,1) is fat, why not use fatfs create file and write?

set installiso="${grubfm_path}";
tr --set=installiso "/" "\\";
set "iso1=[IsoInfo]\x0d\x0aIsoName=${installiso}\x0d\x0a";
mount (hd0,1) 1;
touch 1:/Win10PESE.ini;
write_file 1:/Win10PESE.ini "${iso1}";

深度截图_选择区域_20200223193626

from grub.

steve6375 avatar steve6375 commented on August 22, 2024

Because the files are already in partition 1 as part of easy2boot. agFM is an optional extra.

from grub.

a1ive avatar a1ive commented on August 22, 2024

As long as (hd0,1) is FAT, you could use write_file rather than dd.

from grub.

steve6375 avatar steve6375 commented on August 22, 2024

It is usually NTFS

from grub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.