mirror of
				https://github.com/pbatard/rufus.git
				synced 2024-08-14 23:57:05 +00:00 
			
		
		
		
	[syslinux] update Syslinux to v6.03
* Also add experimental support for Syslinux/NTFS * Closes #391
This commit is contained in:
		
							parent
							
								
									37ffbabaaf
								
							
						
					
					
						commit
						6ca024ae3b
					
				
					 23 changed files with 747 additions and 140 deletions
				
			
		|  | @ -294,7 +294,7 @@ t MSG_112 "Formatting a large UDF volumes can take a lot of time. At USB 2.0 spe | |||
| 	"duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!" | ||||
| t MSG_113 "Large UDF volume" | ||||
| t MSG_114 "This image uses Syslinux %s%s but this application only includes the installation files for " | ||||
| 	"Syslinux %s.\n\nAs new versions of Syslinux are not compatible with one another, and it wouldn't " | ||||
| 	"Syslinux %s%s.\n\nAs new versions of Syslinux are not compatible with one another, and it wouldn't " | ||||
| 	"be possible for Rufus to include them all, two additional files must be downloaded from the " | ||||
| 	"Internet ('ldlinux.sys' and 'ldlinux.bss'):\n" | ||||
| 	"- Select 'Yes' to connect to the Internet and download these files\n" | ||||
|  | @ -686,7 +686,7 @@ t MSG_112 "فرمتة وحدات تخزين UDF كبيرة تستغرق وقتا | |||
| 	"للفرمتة هي: %d:%02d, خلالها شريط التقدّم سيظهر مجمّد. يرجى التحلّي بالصبر!" | ||||
| t MSG_113 "وحدة تخزين UDF كبيرة" | ||||
| t MSG_114 "هذه الصورة (الإيميج) تستخدم Syslinux %s%s ولكن هذا التطبيق يشمل فقط ملفات التثبيت لـ " | ||||
| 	"Syslinux %s. \n\nفالإصدارات الجديدة من Syslinux لا تتلاءم مع بعضها البعض, وأنه " | ||||
| 	"Syslinux %s%s. \n\nفالإصدارات الجديدة من Syslinux لا تتلاءم مع بعضها البعض, وأنه " | ||||
| 	"من غير الممكن لروفوس إحتواء الكل, يجب تحميل ملفين إضافيين من " | ||||
| 	"الإنترنت('ldlinux.sys' و 'ldlinux.bss'):\n" | ||||
| 	"- إختر ‘نعم’ للإتصال بالإنترنت وتحميل الملفات\n" | ||||
|  | @ -1118,7 +1118,7 @@ t MSG_112 "Форматирането на голям UDF дял може да  | |||
| 	"време е  %d:%02d, при което процесната лента че изглежда не активна. Моля бъдете търпеливи!" | ||||
| t MSG_113 "Голям UDF дял" | ||||
| t MSG_114 "Този образ използва Syslinux %s%s но тази програма включва само инсталационни файлове за" | ||||
| 	"Syslinux %s.\n\nТъй като новите версии на Syslinux не са съвместими една с друга, и няма да е  " | ||||
| 	"Syslinux %s%s.\n\nТъй като новите версии на Syslinux не са съвместими една с друга, и няма да е  " | ||||
| 	"възможно за Rufus да ги включи всичките, два допълнителни файлове трябва да бъдат изтеглени от " | ||||
| 	"Интернет ('ldlinux.sys' и 'ldlinux.bss'):\n" | ||||
| 	"- Изберете 'Yes' за да се свържете с интернет и да изтеглите тези файлове\n" | ||||
|  | @ -1489,7 +1489,7 @@ t MSG_111 "不支持的簇大小" | |||
| t MSG_112 "格式化较大的 UDF 卷可能需要很长时间。过程中进度条可能会呈禁止状态,属于正常现象。" | ||||
| 	"请耐心等待!\nUSB 2.0 设备预计剩余时间:%d:%02d" | ||||
| t MSG_113 "大容量 UDF 卷" | ||||
| t MSG_114 "此镜像使用的更新版本的 Syslinux %s%s,此程序内置的 Syslinux %s 不支持更新版本。\n\n" | ||||
| t MSG_114 "此镜像使用的更新版本的 Syslinux %s%s,此程序内置的 Syslinux %s%s 不支持更新版本。\n\n" | ||||
| 	"Rufus 需要下载两个文件:'ldlinux.sys' 和 'ldlinux.bss'\n" | ||||
| 	"- 选择 '是' 连接网络下载文件\n" | ||||
| 	"- 选择 '否' 取消此项操作\n\n" | ||||
|  | @ -1859,7 +1859,7 @@ t MSG_111 "不相容的配置單元大小" | |||
| t MSG_112 "磁碟區較大的 UDF 格式化作業時間較久,過程中進度列表可能會呈現靜止狀態、乃屬正常現象,請耐心等候。" | ||||
| 	"估計剩餘時間: %d:%02d" | ||||
| t MSG_113 "大 UDF 磁碟區" | ||||
| t MSG_114 "此映像檔使用到 Syslinux %s%s,但本軟體僅支援 Syslinux %s 安裝檔案。\n\n" | ||||
| t MSG_114 "此映像檔使用到 Syslinux %s%s,但本軟體僅支援 Syslinux %s%s 安裝檔案。\n\n" | ||||
| 	"由於不同版本的 Syslinux 互不相容,因此需額外下載以下擴充檔案: \n" | ||||
| 	"'ldlinux.sys' 和 'ldlinux.bss'\n" | ||||
| 	"如欲下載這份檔案,請選擇「是」,Rufus 將會自動上網下載。若要終止作業,請選擇「否」\n\n" | ||||
|  | @ -2245,7 +2245,7 @@ t MSG_112 "Formatiranje velike UDF jedinice može potrajati. Pri USB 2.0 brzini, | |||
| 	" %d:%02d " | ||||
| t MSG_113 "Velika UDF jedinica" | ||||
| t MSG_114 "Ova slika koristi Syslinux %s%s ali ova aplikacija samo uključuje datoteke za " | ||||
| 	"Syslinux %s.\n\nPošto nove ver. Syslinux nisu kompatibilne jedna s drugom, " | ||||
| 	"Syslinux %s%s.\n\nPošto nove ver. Syslinux nisu kompatibilne jedna s drugom, " | ||||
| 	"dvije dodatne datoteke se trebaju preuzeti sa" | ||||
| 	"interneta: ('ldlinux.sys' i 'ldlinux.bss')\n" | ||||
| 	"- Odaberite 'Da' kako bi se datoteke preuzele\n" | ||||
|  | @ -2646,7 +2646,7 @@ t MSG_112 "Formátování velkých UDF svazků může trvat delší čas. Při r | |||
| 	"formátování trvat přibližně %d:%02d, ukazatel průběhu operace je během formátování zdánlivě nefunkční. Buďte trpělivý! " | ||||
| t MSG_113 "Velký UDF svazku" | ||||
| t MSG_114 "Tento obraz používá Syslinux %s%s, tato aplikace však obsahuje pouze instalační soubory pro " | ||||
| 	"Syslinux %s.\n\nJelikož nové verze Syslinux nejsou vzájemně kompatibilní a není možné v programu Rufus " | ||||
| 	"Syslinux %s%s.\n\nJelikož nové verze Syslinux nejsou vzájemně kompatibilní a není možné v programu Rufus " | ||||
| 	"zahrnout všechny verze, je nutné z Internetu stáhnout dodatečné dva soubory  " | ||||
| 	"(ldlinux.sys a ldlinux.bss):\n" | ||||
| 	"- Zvolte 'Ano' pro stažení souborů z Internetu\n" | ||||
|  | @ -3042,7 +3042,7 @@ t MSG_112 "Formatering af en stor UDF volume kan tage lang tid. Ved USB 2.0 hast | |||
| 	"formatering %d:%02d, hvorunder statuslinjen forekommer frosset. Vær tålmodig!" | ||||
| t MSG_113 "Stor UDF volume" | ||||
| t MSG_114 "Dette image benytter Syslinux %s%s men denne applikation indeholder kun installationsfilerne til " | ||||
| 	"Syslinux %s.\n\nDa nye versioner af Syslinux ikke er kompatible med hinanden, og det desuden ikke " | ||||
| 	"Syslinux %s%s.\n\nDa nye versioner af Syslinux ikke er kompatible med hinanden, og det desuden ikke " | ||||
| 	"ville være muligt for Rufus at inkludere dem alle, er det nødvendigt at hente to yderligere filer fra " | ||||
| 	"nettet ('ldlinux.sys' and 'ldlinux.bss'):\n" | ||||
| 	"- Vælg 'Ja' for at tilslutte internet og hente disse filer\n" | ||||
|  | @ -3429,7 +3429,7 @@ t MSG_111 "Incompatibel Clustergrootte" | |||
| t MSG_112 "Het formatteren van grote UDF volumes kan een lange tijd duren..." | ||||
| t MSG_113 "Grote UDF volume" | ||||
| t MSG_114 "Deze image maakt gebruik van Syslinux %s%s maar de applicatie bevat alleen de installatiebestanden voor"  | ||||
| 	"Syslinux %s.\n\nOmdat oude en nieuwe versies van Syslinux niet compatibel zijn met elkaar, en het niet mogelijk is voor Rufus om alle versies te beheren," | ||||
| 	"Syslinux %s%s.\n\nOmdat oude en nieuwe versies van Syslinux niet compatibel zijn met elkaar, en het niet mogelijk is voor Rufus om alle versies te beheren," | ||||
| 	"moeten twee extra bestanden gedownload worden van het internet ('ldlinux.sys' en 'ldlinux.bss'):\n" | ||||
| 	"- Klik op 'Ja' om via internet deze bestanden te downloaden\n"      | ||||
| 	"- Klik op 'Nee' om de opdracht te annuleren\n\n" | ||||
|  | @ -3824,7 +3824,7 @@ t MSG_112 "Suurten UDF-asemien alustus voi kestää kauan. USB 2.0-nopeuksilla a | |||
| 	"kesto on %d:%02d, minkä aikana etenemispalkki vaikuttaa pysähtyneeltä. Ole kärsivällinen!" | ||||
| t MSG_113 "Suuri UDF-asema" | ||||
| t MSG_114 "Tämä kuva käyttää Syslinuxia %s%s, mutta tämä sovellus sisältää asennustiedostot vain " | ||||
| 	"Syslinuxille %s.\n\nKoska Syslinuxin uudet versiot eivät ole keskenään yhteensopivia, eikä Rufus  " | ||||
| 	"Syslinuxille %s%s.\n\nKoska Syslinuxin uudet versiot eivät ole keskenään yhteensopivia, eikä Rufus  " | ||||
| 	"voisi sisältää niitä kaikkia, on kaksi lisätiedostoa ladattava internetistä " | ||||
| 	"('ldlinux.sys' ja 'ldlinux.bss'):\n" | ||||
| 	"- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi nämä tiedostot\n" | ||||
|  | @ -4202,7 +4202,7 @@ t MSG_111 "Taille de clusters incompatible" | |||
| t MSG_112 "Le formatage d'un volume UDF de grande taille peut prendre beaucoup de temps. Aux vitesses USB 2.0, " | ||||
| 	"la durée de formatage estimée est %d :%02d, pendant laquelle la barre de progrès semblera gelée. Veuillez être patient !" | ||||
| t MSG_113 "Volume UDF de grand taille" | ||||
| t MSG_114 "Cette image utilise Syslinux %s%s mais l'application inclus seulement les fichiers d'installation pour Syslinux %s.\n\n" | ||||
| t MSG_114 "Cette image utilise Syslinux %s%s mais l'application inclus seulement les fichiers d'installation pour Syslinux %s%s.\n\n" | ||||
| 	"Comme les nouvelles versions de Syslinux sont incompatibles entre elles, et il n'est pas possible à Rufus de toutes " | ||||
| 	"les inclure, deux fichiers supplémentaires ('ldlinux.sys' et 'ldlinux.bss') doivent être téléchargés :\n" | ||||
| 	"- Choisissez 'Oui' pour télécharger ces fichier depuis Internet\n" | ||||
|  | @ -4582,7 +4582,7 @@ t MSG_110 "MS-DOS kann nicht von einem Laufwerk starten, das 64 Kilobyte große | |||
| t MSG_111 "Inkompatible Zuordnungseinheitengröße" | ||||
| t MSG_112 "Großes UDF-Laufwerke zu formatieren, kann viel Zeit benötigen..." | ||||
| t MSG_113 "Großes UDF-Laufwerk" | ||||
| t MSG_114 "Dieses Abbild benutzt Syslinux %s%s, aber diese Anwendung verfügt nur über Installationsdateien für Syslinux %s.\n\n" | ||||
| t MSG_114 "Dieses Abbild benutzt Syslinux %s%s, aber diese Anwendung verfügt nur über Installationsdateien für Syslinux %s%s.\n\n" | ||||
| 	"Neuere Syslinux-Versionen sind untereinander nicht kompatibel. Rufus kann nicht alle Versionen unterstützen. " | ||||
| 	"Zwei zusätzliche Dateien müssen vom Internet heruntergeladen werden ('ldlinux.sys' and 'ldlinux.bss'):\n" | ||||
| 	"- Wählen Sie 'Ja', um dem Download zuzustimmen oder\n" | ||||
|  | @ -5011,7 +5011,7 @@ t MSG_112 "Η διαμόρφωση μεγάλων τόμων UDF ίσως δια | |||
| 	"είναι %d:%02d. Κατά την διάρκεια της διαμόρφωσης η μπάρα προόδου θα είναι στατική. Παρακαλώ περιμένετε!" | ||||
| t MSG_113 "Mεγάλος τόμος UDF" | ||||
| t MSG_114 "Αυτό το είδωλο χρησιμοποιεί το Syslinux %s%s παρόλα αυτά η εφαρμογή(Rufus) εμπεριέχει μόνο τα αρχεία εγκατάστασης του " | ||||
| 	"Syslinux %s.\n\n Εφόσον οι νέες εκδόσεις του Syslinux δεν είναι συμβατές μεταξύ τους, δεν είναι δυνατό για το Rufus" | ||||
| 	"Syslinux %s%s.\n\n Εφόσον οι νέες εκδόσεις του Syslinux δεν είναι συμβατές μεταξύ τους, δεν είναι δυνατό για το Rufus" | ||||
| 	"να τις εμπεριέχει όλες. Επομένως, απαιτείται η λήψη δύο νέων αρχείων απο το διαδίκτυο ('ldlinux.sys' και 'ldlinux.bss'): \n" | ||||
| 	"- Επιλέξτε το 'Ναι' για να συνδεθείτε στο διαδίκτυο και να κάνετε λήψη των αρχείων\n" | ||||
| 	"- Επιλέξτε το 'Όχι' για να ακυρώσετε τη λειτουργία.\n" | ||||
|  | @ -6155,7 +6155,7 @@ t MSG_112 "La formattazione di un volume UDF di grandi dimensioni può richieder | |||
| 	"per la formattazione sarà di %d:%02d, durante il quale la barra di progresso non verrà aggiornata. Attendi il completamento dell'operazione!" | ||||
| t MSG_113 "Voume UDF di grandi dimensioni" | ||||
| t MSG_114 "Questa immagine usa Syslinux %s%s ma questa applicazione include solo i file di installazione per " | ||||
| 	"Syslinux %s.\n\nPoiché le nuove versioni di Syslinux non sono compatibili con le precedenti e " | ||||
| 	"Syslinux %s%s.\n\nPoiché le nuove versioni di Syslinux non sono compatibili con le precedenti e " | ||||
| 	"non sarebbe possibile per Rufus includerle tutte, devono essere scaricati da Internet due file aggiuntivi " | ||||
| 	"('ldlinux.sys' e 'ldlinux.bss'):\n" | ||||
| 	"- Seleziona 'Sì' per collegarti a internet e scaricare questi due file\n" | ||||
|  | @ -6559,7 +6559,7 @@ t MSG_111 "互換性がないクラスタサイズです。" | |||
| t MSG_112 "大きいUDFボリュームがフォーマットするは時間がかかれます。USB2.0スピードで、 " | ||||
| 	"フォーマットの推定持続は%d:%02d。この時間の間にプログレスバーは凍結用に見えます。こんな時間にちょっと待って下さい。" | ||||
| t MSG_113 "大きいUDFボリューム" | ||||
| t MSG_114 "このイメージは Syslinux %s%s を使うが、このアプリケーションは Syslinux %s のインストール " | ||||
| t MSG_114 "このイメージは Syslinux %s%s を使うが、このアプリケーションは Syslinux %s%s のインストール " | ||||
| 	"ファイルだけあります。\n\nSyslinuxの新バージョンは互いに互換性のないから、RufusはSyslinkのすべて " | ||||
| 	"を含めれません。インタネットから二つのファイルはダウンロードしなければならない。 " | ||||
| 	"('ldlinux.sys' and 'ldlinux.bss'):\n" | ||||
|  | @ -6956,7 +6956,7 @@ t MSG_112 "큰 UDF 볼륨을 포맷하려면 시간이 많이 걸릴 수 있습 | |||
| 	"%d:%02d 입니다. 포맷 중 진행바가 멈춤상태로 있을 수도 있습니다. 기다려주십시오!" | ||||
| t MSG_113 "큰 UDF 볼륨" | ||||
| t MSG_114 "이 이미지는 Syslinux를 하지만 %s%s 이 프로그램에는 Syslinux의 설치 파일만 포함되어 있습니다. " | ||||
| 	"Syslinux %s.\n\nSyslinux의 새 버전은 서로 호환되지 않으며, Rufus가 새 버전 모두를 포함하는 것은 불가능합니다." | ||||
| 	"Syslinux %s%s.\n\nSyslinux의 새 버전은 서로 호환되지 않으며, Rufus가 새 버전 모두를 포함하는 것은 불가능합니다." | ||||
| 	"다음 두 개의 추가 파일을 인터넷에서 다운로드 하십시오." | ||||
| 	"('ldlinux.sys' and 'ldlinux.bss'):\n" | ||||
| 	"- '예'를 선택하면 인터넷에 연결하여 두 개의 파일을 다운로드합니다.\n" | ||||
|  | @ -7376,7 +7376,7 @@ t MSG_112 "Large UDF disku formatēšana var aizņemt daudz laika. Izmantojot US | |||
| 	"ilgums ir %d:%02d, kura laikā izpildes līnija var apstāties. Esiet pacietīgi!" | ||||
| t MSG_113 "Large UDF disks" | ||||
| t MSG_114 "Šis imidžs izmanto Syslinux %s%s, bet aplikācija satur instalācijas failus " | ||||
| 	"Syslinux %s.\n\nTā kā jaunās Syslinux versijas nav savstarpēji atbalstāmas, nepieciešams " | ||||
| 	"Syslinux %s%s.\n\nTā kā jaunās Syslinux versijas nav savstarpēji atbalstāmas, nepieciešams " | ||||
| 	"no interneta ielādēt nepieciešamos failus ('ldlinux.sys' un 'ldlinux.bss'):\n" | ||||
| 	"- Izvēlieties 'Jā' lai pieslēgtos pie interneta un ielādētu šos failus\n" | ||||
| 	"- Izvēlieties 'Nē' lai atceltu šo operāciju\n\n" | ||||
|  | @ -7793,7 +7793,7 @@ t MSG_112 "Didelių UDF tomų formatavimas gali užimti daug laiko. USB 2.0 grei | |||
| 	"trukmė yra %d:%02d, tuo metu eigos juosta gali atrodyti sustingusi. Prašau kantrybės!" | ||||
| t MSG_113 "Didelis UDF tomas" | ||||
| t MSG_114 "Šis atvaizdas naudoja Syslinux %s%s, bet ši programa turi tik diegimo failus, skirtus " | ||||
| 	"Syslinux %s.\n\nKadangi naujos Syslinux versijos tarpusavyje nesuderinamos, ir nėra galimybės " | ||||
| 	"Syslinux %s%s.\n\nKadangi naujos Syslinux versijos tarpusavyje nesuderinamos, ir nėra galimybės " | ||||
| 	"į Rufus įtraukti jas visas, du papildomi failai turi būti atsisiųsti iš " | ||||
| 	"interneto ('ldlinux.sys' ir 'ldlinux.bss'):\n" | ||||
| 	"- Pasirinkite 'Taip' norėdami prisijungti prie interneto ir atsisiųsti šiuos failus\n" | ||||
|  | @ -8217,7 +8217,7 @@ t MSG_112 "Pemformattan jilid UDF yang besar mengambil masa yang amat lama. Pada | |||
| 	"adalah %d:%02d, di mana bar kemajuan akan lihat seperti ia tidak bergerak. Tolong bersabar" | ||||
| t MSG_113 "Jilid UDF besar" | ||||
| t MSG_114 "Imej ini menggunakan Syslinux %s%s tetapi aplikasi ini hanya mempunyai fail pemasangan untuk" | ||||
| 	"Syslinux %s.\n\nOleh kerana versi-versi baharu Syslinux tidak serasi dengan satu sama lain, maka tidak" | ||||
| 	"Syslinux %s%s.\n\nOleh kerana versi-versi baharu Syslinux tidak serasi dengan satu sama lain, maka tidak" | ||||
| 	"wajarlah Rufus menyediakan semuanya, dua fail tambahan perlu dimuat turun dari" | ||||
| 	"Internet ('ldlinux.sys' dan 'ldlinux.bss'):\n" | ||||
| 	"- Pilih 'Ya' untuk menyambung ke Internet dan memuat turun fail tersebut\n" | ||||
|  | @ -8638,7 +8638,7 @@ t MSG_112 "Formatowanie dużych woluminów UDF może zająć dużo czasu. Przy p | |||
| 	"formatowania wynosi %d:%02d, podczas którego pasek postępu będzie wysawał się być zamrożony. Proszę być cierpliwym!" | ||||
| t MSG_113 "Duży wolumin UDF" | ||||
| t MSG_114 "Ten obraz używa Syslinux %s%s lecz ta aplikacja dołącza pliki instalacyjne tylko dla " | ||||
| 	"Syslinux %s.\n\nPonieważ nowa wersja Syslinux nie jest kompatybilna z inną i nie jest " | ||||
| 	"Syslinux %s%s.\n\nPonieważ nowa wersja Syslinux nie jest kompatybilna z inną i nie jest " | ||||
| 	"możliwe dla Rufusa aby załączyć je wszystkie, dwa dodatkowe pliki muszą być pobrane " | ||||
| 	"z Internetu ('ldlinux.sys' oraz 'ldlinux.bss'):\n" | ||||
| 	"- Wybierz 'Tak' aby połączyć z Internetem i pobrać te pliki\n" | ||||
|  | @ -8873,7 +8873,7 @@ t MSG_104 "Syslinux v5.0 ou posterior requer que esteja instalado um arquivo '%s | |||
| t MSG_110 "MS-DOS não inicia um disco com um tamanho de cluster de 64 kilobytes.\n" | ||||
| 	"Por favor altere o tamanho de cluster ou use FreeDOS." | ||||
| t MSG_114 "Esta imagem usa Syslinux %s%s, mas este aplicativo inclui somente os arquivos de instalação para " | ||||
| 	"Syslinux %s.\n\nComo novas versões de Syslinux não são compatíveis entre si, e que não " | ||||
| 	"Syslinux %s%s.\n\nComo novas versões de Syslinux não são compatíveis entre si, e que não " | ||||
| 	"seja possível para Rufus incluí-los todos, dois arquivos adicionais devem ser baixados a partir da " | ||||
| 	"Internet ('ldlinux.sys' and 'ldlinux.bss'):\n" | ||||
| 	"- Selecione 'Sim' para se conectar à Internet e baixar esses arquivos\n" | ||||
|  | @ -9608,8 +9608,8 @@ t MSG_111 "Dimensiune Cluster incompatibilă" | |||
| t MSG_112 "Formatarea volumului mare UDF, poate dura ceva timp. Viteza formatării USB 2.0, estimează " | ||||
| 	"durata este %d:%02d, în care va apărea pe bara de progres. Vă rugăm să aveţi răbdare!" | ||||
| t MSG_113 "Volumul UDF mare" | ||||
| t MSG_114 "Această imagine foloseste Syslinux %s%s, dar această aplicație include doar fișierele de instalare pentru Syslinux %s. " | ||||
| 	"Syslinux %s.\n\nNoile versiuni ale syslinux, nu sunt compatibile cu altele, și nu ar fi " | ||||
| t MSG_114 "Această imagine foloseste Syslinux %s%s, dar această aplicație include doar fișierele de instalare pentru " | ||||
| 	"Syslinux %s%s.\n\nNoile versiuni ale syslinux, nu sunt compatibile cu altele, și nu ar fi " | ||||
| 	"este posibil ca Rufus să le includă, două fișiere suplimentare, ele trebuie să fi descărcate de pe " | ||||
| 	"Internet ('ldlinux.sys' şi 'ldlinux.bss'):\n" | ||||
| 	"- Selectați 'Da' pentru a vă conecta la Internet și de a descărca aceste fișiere\n" | ||||
|  | @ -10007,7 +10007,7 @@ t MSG_111 "Несовместимый размер кластера" | |||
| t MSG_112 "Форматирование в Large UDF-тома занимает много времени..." | ||||
| t MSG_113 "Large UDF-том" | ||||
| t MSG_114 "Данный образ использует Syslinux %s%s, но данное приложение включает в себя только установочные файлы для " | ||||
| 	"Syslinux %s.\n\nТак как новые версии Syslinux не совместимы друг с другом, необходимо, чтобы дополнительные" | ||||
| 	"Syslinux %s%s.\n\nТак как новые версии Syslinux не совместимы друг с другом, необходимо, чтобы дополнительные" | ||||
| 	"файлы ('ldlinux.sys' and 'ldlinux.bss') были загружены из интернета:\n" | ||||
| 	"- Выберите 'Да', чтобы скачать файлы из интернета\n" | ||||
| 	"- Выберите 'Нет', чтобы отменить операцию\n\n" | ||||
|  | @ -10398,7 +10398,7 @@ t MSG_112 "Formátovanie veľkých UDF zväzkov môže trvať dlhý čas. Rýchl | |||
| 	"trvanie formátovania (približne %d:%02d), počas procesu sa vám môže zdať, že aplikácia zamrzla. Budte trpezlivý! " | ||||
| t MSG_113 "Veľkosť UDF zväzku" | ||||
| t MSG_114 "Tento obraz používa Syslinux %s%s ale tento program obsahuje inštaláciu pre " | ||||
| 	"Syslinux %s.\n\nAk nová verzia Syslinuxu nie je kompaktibilná s ďalším obrazom,  " | ||||
| 	"Syslinux %s%s.\n\nAk nová verzia Syslinuxu nie je kompaktibilná s ďalším obrazom,  " | ||||
| 	"je možné, že program Rufus neobsahuje dva doplnkové súbory, ktoré budú musieť byť stiahnuté " | ||||
| 	"z internetu (ldlinux.sys a ldlinux.bss):\n" | ||||
| 	"- Stlačte 'Áno' pre stiahnutie týchto súborov z internetu\n" | ||||
|  | @ -10805,7 +10805,7 @@ t MSG_112 "Formatiranje velikih nosilcev UDF lahko traja veliko časa. Pri hitro | |||
| 	"trajanje formatiranja %d:%02d, med čimer se kazalnik poteka ne bo premaknil. Prosim, bodite potrpežljivi!" | ||||
| t MSG_113 "Velik nosilec UDF" | ||||
| t MSG_114 "Ta slika uporablja Syslinux %s%s, toda ta aplikacija vsebuje le namestitvene datoteke za " | ||||
| 	"Syslinux %s.\n\nKer novejše verzije Syslinuxa niso združljive in Rufus ne more vsebovati vseh, " | ||||
| 	"Syslinux %s%s.\n\nKer novejše verzije Syslinuxa niso združljive in Rufus ne more vsebovati vseh, " | ||||
| 	"morata biti prenešeni še dve dodatni datoteki (ldlinux.sys in ldlinux.bss):\n" | ||||
| 	"- Izberite \"Da\", da se povežete na internet in prenesete ti dve datoteki.\n" | ||||
| 	"- Izberite \"Ne\", da prekinete dejanje.\n\n" | ||||
|  | @ -11604,7 +11604,7 @@ t MSG_112 "Att formatera en stor UDF-volum kan ta lång tid. Vid USB 2.0-hastigh | |||
| 	"tiden runt %d:%02d, och under tiden kan förloppsindikatorn se ut att stå stilla." | ||||
| t MSG_113 "Stor UDF-volum" | ||||
| t MSG_114 "Denna avbild använder Syslinux %s%s men detta programmet innehåller endast installationsfiler för " | ||||
| 	"Syslinux %s.\n\nEftersom nya versioner av Syslinux inte är kompatibla med varandra, skulle det vara " | ||||
| 	"Syslinux %s%s.\n\nEftersom nya versioner av Syslinux inte är kompatibla med varandra, skulle det vara " | ||||
| 	"omöjligt att alla fanns med i Rufus, så därför måste två filer laddas ned från " | ||||
| 	"internet ('ldlinux.sys' och 'ldlinux.bss'):\n" | ||||
| 	"- Välj 'Ja' för att ansluta till internet och ladda ned filerna\n" | ||||
|  | @ -12019,7 +12019,7 @@ t MSG_111 "Uyumsuz Ayırma Boyutu" | |||
| t MSG_112 "Geniş bir UDF Biriminin biçimlendirilmesi çok uzun bir süre alabilir. USB 2.0 hızında, Tahmini biçimlendirme " | ||||
| 	"süresi %d:%02d, İlerleme çubuğu donmuş görünüyorken. Lütfen sabırlı olun!" | ||||
| t MSG_113 "Geniş UDF Birimi" | ||||
| t MSG_114 "Bu yansıma Syslinux %s%s kullanıyor fakat bu uygulama yalnız Syslinux %s için yükleme dosyalarını " | ||||
| t MSG_114 "Bu yansıma Syslinux %s%s kullanıyor fakat bu uygulama yalnız Syslinux %s%s için yükleme dosyalarını " | ||||
| 	"içeriyor.\n\nSyslinux'un yeni sürümleri bir başkasıyla uyumlu olmadığından ve Rufus'un bunların" | ||||
| 	"tamamını içermesi mümkün olmadığından, iki ek dosyanın('ldlinux.sys' ve 'ldlinux.bss') internet üzerinden " | ||||
| 	"indirilmesi gerekli:\n" | ||||
|  | @ -12441,7 +12441,7 @@ t MSG_111 "Несумісний розмір кластера" | |||
| t MSG_112 "Форматування в Large UDF-тома займає багато часу..." | ||||
| t MSG_113 "Large UDF-том" | ||||
| t MSG_114 "Даний образ використовує Syslinux %s%s, проте даний додаток включає в себе тільки установочні файли для " | ||||
| 	"Syslinux %s.\n\nТак як нові версії Syslinux несумісні одна з одною, необхідно, щоб додаткові" | ||||
| 	"Syslinux %s%s.\n\nТак як нові версії Syslinux несумісні одна з одною, необхідно, щоб додаткові" | ||||
| 	"файли ('ldlinux.sys' та 'ldlinux.bss') були завантажені з інтернету:\n" | ||||
| 	"- Оберіть 'Так', щоб завантажити файли з інтернету\n" | ||||
| 	"- Оберіть 'Ні', щоб відмінити операцію\n\n" | ||||
|  |  | |||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								res/syslinux/ldlinux_v6.sys
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								res/syslinux/ldlinux_v6.sys
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							|  | @ -1,4 +1,4 @@ | |||
| o ldlinux_v4.[bss|sys] have been renamed from ldlinux.[bss|sys] found in syslinux-4.07/core/ | ||||
| o ldlinux_v5.[bss|sys] have been renamed from ldlinux.[bss|sys] found in syslinux-5.10/core/ | ||||
| o ldlinux_v6.[bss|sys] have been renamed from ldlinux.[bss|sys] found in syslinux-6.03/bios/core/ | ||||
| o mboot.c32 comes from syslinux-4.07/com32/mboot | ||||
|   http://www.kernel.org/pub/linux/utils/boot/syslinux/ | ||||
|  | @ -1554,7 +1554,7 @@ DWORD WINAPI FormatThread(void* param) | |||
| 			// We must close and unlock the volume to write files to it
 | ||||
| 			safe_unlockclose(hLogicalVolume); | ||||
| 		} else if ( (dt == DT_SYSLINUX_V4) || (dt == DT_SYSLINUX_V5) || ((dt == DT_ISO) && ((fs == FS_FAT16) || (fs == FS_FAT32))) ) { | ||||
| 			if (!InstallSyslinux(DriveIndex, drive_name[0])) { | ||||
| 			if (!InstallSyslinux(DriveIndex, drive_name[0], fs)) { | ||||
| 				FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_INSTALL_FAILURE; | ||||
| 			} | ||||
| 		} | ||||
|  |  | |||
|  | @ -50,8 +50,8 @@ | |||
| #define IDR_FD_EGA18_CPX                326 | ||||
| #define IDR_SL_LDLINUX_V4_BSS           400 | ||||
| #define IDR_SL_LDLINUX_V4_SYS           401 | ||||
| #define IDR_SL_LDLINUX_V5_BSS           402 | ||||
| #define IDR_SL_LDLINUX_V5_SYS           403 | ||||
| #define IDR_SL_LDLINUX_V6_BSS           402 | ||||
| #define IDR_SL_LDLINUX_V6_SYS           403 | ||||
| #define IDR_SL_MBOOT_C32                404 | ||||
| #define IDR_LC_RUFUS_LOC                500 | ||||
| #define IDR_XT_HOGGER                   501 | ||||
|  |  | |||
							
								
								
									
										11
									
								
								src/rufus.c
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								src/rufus.c
									
										
									
									
									
								
							|  | @ -1178,7 +1178,8 @@ static BOOL BootCheck(void) | |||
| 						} | ||||
| 					} | ||||
| 				} | ||||
| 			} else if (iso_report.sl_version != embedded_sl_version[1]) { | ||||
| 			} else if ((iso_report.sl_version != embedded_sl_version[1]) || | ||||
| 				(safe_strcmp(iso_report.sl_version_ext, embedded_sl_version_ext[1]) != 0)) { | ||||
| 				// Unlike what was the case for v4 and earlier, Syslinux v5+ versions are INCOMPATIBLE with one another!
 | ||||
| 				IGNORE_RETVAL(_chdirU(app_dir)); | ||||
| 				IGNORE_RETVAL(_mkdir(FILES_DIR)); | ||||
|  | @ -1200,7 +1201,7 @@ static BOOL BootCheck(void) | |||
| 						iso_report.sl_version_str, iso_report.sl_version_ext); | ||||
| 				} else { | ||||
| 					r = MessageBoxU(hMainDialog, lmprintf(MSG_114, iso_report.sl_version_str, iso_report.sl_version_ext, | ||||
| 						embedded_sl_version_str[1]), | ||||
| 						embedded_sl_version_str[1], embedded_sl_version_ext[1]), | ||||
| 						lmprintf(MSG_115), MB_YESNO|MB_ICONWARNING|MB_IS_RTL); | ||||
| 					if (r != IDYES) | ||||
| 						return FALSE; | ||||
|  | @ -1287,7 +1288,7 @@ void InitDialog(HWND hDlg) | |||
| 	HDC hDC; | ||||
| 	int i, i16, s16; | ||||
| 	char tmp[128], *token, *buf, *ext; | ||||
| 	static char* resource[2] = { MAKEINTRESOURCEA(IDR_SL_LDLINUX_V4_SYS), MAKEINTRESOURCEA(IDR_SL_LDLINUX_V5_SYS) }; | ||||
| 	static char* resource[2] = { MAKEINTRESOURCEA(IDR_SL_LDLINUX_V4_SYS), MAKEINTRESOURCEA(IDR_SL_LDLINUX_V6_SYS) }; | ||||
| 
 | ||||
| #ifdef RUFUS_TEST | ||||
| 	ShowWindow(GetDlgItem(hDlg, IDC_TEST), SW_SHOW); | ||||
|  | @ -1505,9 +1506,9 @@ void SetBoot(int fs, int bt) | |||
| 	IGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType, lmprintf(MSG_036)), DT_ISO)); | ||||
| 	IGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType, lmprintf(MSG_095)), DT_IMG)); | ||||
| 	// If needed (advanced mode) also append a Syslinux option
 | ||||
| 	if ( (bt == BT_BIOS) && (((fs == FS_FAT16) || (fs == FS_FAT32)) && (advanced_mode)) ) { | ||||
| 	if ( (bt == BT_BIOS) && (((fs == FS_FAT16) || (fs == FS_FAT32) || (fs == FS_NTFS)) && (advanced_mode)) ) { | ||||
| 		IGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType, "Syslinux 4"), DT_SYSLINUX_V4)); | ||||
| 		IGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType, "Syslinux 5"), DT_SYSLINUX_V5)); | ||||
| 		IGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType, "Syslinux 6"), DT_SYSLINUX_V5)); | ||||
| 		IGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType, "ReactOS"), DT_REACTOS)); | ||||
| 	} | ||||
| 	if ((!advanced_mode) && (selection_default >= DT_SYSLINUX_V4)) { | ||||
|  |  | |||
|  | @ -369,7 +369,7 @@ extern BOOL Question(char* title, char* format, ...); | |||
| extern BOOL ExtractDOS(const char* path); | ||||
| extern BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan); | ||||
| extern int64_t ExtractISOFile(const char* iso, const char* iso_file, const char* dest_file, DWORD attributes); | ||||
| extern BOOL InstallSyslinux(DWORD drive_index, char drive_letter); | ||||
| extern BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int fs); | ||||
| extern uint16_t GetSyslinuxVersion(char* buf, size_t buf_size, char** ext); | ||||
| extern BOOL CreateProgress(void); | ||||
| extern BOOL SetAutorun(const char* path); | ||||
|  |  | |||
							
								
								
									
										20
									
								
								src/rufus.rc
									
										
									
									
									
								
							
							
						
						
									
										20
									
								
								src/rufus.rc
									
										
									
									
									
								
							|  | @ -32,7 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL | |||
| 
 | ||||
| IDD_DIALOG DIALOGEX 12, 12, 206, 329 | ||||
| STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | ||||
| CAPTION "Rufus 1.5.0.537" | ||||
| CAPTION "Rufus 1.5.0.538" | ||||
| FONT 8, "MS Shell Dlg", 400, 0, 0x1 | ||||
| BEGIN | ||||
|     DEFPUSHBUTTON   "Start",IDC_START,94,291,50,14 | ||||
|  | @ -165,7 +165,7 @@ END | |||
| RTL_IDD_DIALOG DIALOGEX 12, 12, 206, 329 | ||||
| STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | ||||
| EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL | ||||
| CAPTION "Rufus 1.5.0.537" | ||||
| CAPTION "Rufus 1.5.0.538" | ||||
| FONT 8, "MS Shell Dlg", 400, 0, 0x1 | ||||
| BEGIN | ||||
|     DEFPUSHBUTTON   "Start",IDC_START,94,291,50,14 | ||||
|  | @ -336,8 +336,8 @@ BEGIN | |||
|     "#endif\r\n" | ||||
|     "IDR_SL_LDLINUX_V4_BSS   RCDATA                  ""../res/syslinux/ldlinux_v4.bss""\r\n" | ||||
|     "IDR_SL_LDLINUX_V4_SYS   RCDATA                  ""../res/syslinux/ldlinux_v4.sys""\r\n" | ||||
|     "IDR_SL_LDLINUX_V5_BSS   RCDATA                  ""../res/syslinux/ldlinux_v5.bss""\r\n" | ||||
|     "IDR_SL_LDLINUX_V5_SYS   RCDATA                  ""../res/syslinux/ldlinux_v5.sys""\r\n" | ||||
|     "IDR_SL_LDLINUX_V6_BSS   RCDATA                  ""../res/syslinux/ldlinux_v6.bss""\r\n" | ||||
|     "IDR_SL_LDLINUX_V6_SYS   RCDATA                  ""../res/syslinux/ldlinux_v6.sys""\r\n" | ||||
|     "IDR_SL_MBOOT_C32        RCDATA                  ""../res/syslinux/mboot.c32""\r\n" | ||||
|     "IDR_FD_COMMAND_COM      RCDATA                  ""../res/freedos/COMMAND.COM""\r\n" | ||||
|     "IDR_FD_KERNEL_SYS       RCDATA                  ""../res/freedos/KERNEL.SYS""\r\n" | ||||
|  | @ -428,8 +428,8 @@ END | |||
| // | ||||
| 
 | ||||
| VS_VERSION_INFO VERSIONINFO | ||||
|  FILEVERSION 1,5,0,537 | ||||
|  PRODUCTVERSION 1,5,0,537 | ||||
|  FILEVERSION 1,5,0,538 | ||||
|  PRODUCTVERSION 1,5,0,538 | ||||
|  FILEFLAGSMASK 0x3fL | ||||
| #ifdef _DEBUG | ||||
|  FILEFLAGS 0x1L | ||||
|  | @ -446,13 +446,13 @@ BEGIN | |||
|         BEGIN | ||||
|             VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" | ||||
|             VALUE "FileDescription", "Rufus" | ||||
|             VALUE "FileVersion", "1.5.0.537" | ||||
|             VALUE "FileVersion", "1.5.0.538" | ||||
|             VALUE "InternalName", "Rufus" | ||||
|             VALUE "LegalCopyright", "© 2011-2014 Pete Batard (GPL v3)" | ||||
|             VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" | ||||
|             VALUE "OriginalFilename", "rufus.exe" | ||||
|             VALUE "ProductName", "Rufus" | ||||
|             VALUE "ProductVersion", "1.5.0.537" | ||||
|             VALUE "ProductVersion", "1.5.0.538" | ||||
|         END | ||||
|     END | ||||
|     BLOCK "VarFileInfo" | ||||
|  | @ -490,8 +490,8 @@ IDR_LC_RUFUS_LOC        RCDATA                  "../res/localization/embedded.lo | |||
| #endif | ||||
| IDR_SL_LDLINUX_V4_BSS   RCDATA                  "../res/syslinux/ldlinux_v4.bss" | ||||
| IDR_SL_LDLINUX_V4_SYS   RCDATA                  "../res/syslinux/ldlinux_v4.sys" | ||||
| IDR_SL_LDLINUX_V5_BSS   RCDATA                  "../res/syslinux/ldlinux_v5.bss" | ||||
| IDR_SL_LDLINUX_V5_SYS   RCDATA                  "../res/syslinux/ldlinux_v5.sys" | ||||
| IDR_SL_LDLINUX_V6_BSS   RCDATA                  "../res/syslinux/ldlinux_v6.bss" | ||||
| IDR_SL_LDLINUX_V6_SYS   RCDATA                  "../res/syslinux/ldlinux_v6.sys" | ||||
| IDR_SL_MBOOT_C32        RCDATA                  "../res/syslinux/mboot.c32" | ||||
| IDR_FD_COMMAND_COM      RCDATA                  "../res/freedos/COMMAND.COM" | ||||
| IDR_FD_KERNEL_SYS       RCDATA                  "../res/freedos/KERNEL.SYS" | ||||
|  |  | |||
|  | @ -36,6 +36,7 @@ | |||
| #include "syslxfs.h" | ||||
| #include "libfat.h" | ||||
| #include "setadv.h" | ||||
| #include "ntfssect.h" | ||||
| 
 | ||||
| unsigned char* syslinux_ldlinux[2] = { NULL, NULL }; | ||||
| DWORD syslinux_ldlinux_len[2]; | ||||
|  | @ -69,7 +70,7 @@ int libfat_readfile(intptr_t pp, void *buf, size_t secsize, | |||
|  * Extract the ldlinux.sys and ldlinux.bss from resources, | ||||
|  * then patch and install them | ||||
|  */ | ||||
| BOOL InstallSyslinux(DWORD drive_index, char drive_letter) | ||||
| BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int fs_type) | ||||
| { | ||||
| 	HANDLE f_handle = INVALID_HANDLE_VALUE; | ||||
| 	HANDLE d_handle = INVALID_HANDLE_VALUE; | ||||
|  | @ -77,12 +78,12 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter) | |||
| 	DWORD bytes_written; | ||||
| 	BOOL r = FALSE; | ||||
| 	FILE* fd; | ||||
| 	size_t len; | ||||
| 	size_t length; | ||||
| 
 | ||||
| 	static unsigned char sectbuf[SECTOR_SIZE]; | ||||
| 	static char* resource[2][2] = { | ||||
| 		{ MAKEINTRESOURCEA(IDR_SL_LDLINUX_V4_SYS), MAKEINTRESOURCEA(IDR_SL_LDLINUX_V4_BSS) }, | ||||
| 		{ MAKEINTRESOURCEA(IDR_SL_LDLINUX_V5_SYS), MAKEINTRESOURCEA(IDR_SL_LDLINUX_V5_BSS) } }; | ||||
| 		{ MAKEINTRESOURCEA(IDR_SL_LDLINUX_V6_SYS), MAKEINTRESOURCEA(IDR_SL_LDLINUX_V6_BSS) } }; | ||||
| 	const char* ldlinux = "ldlinux"; | ||||
| 	const char* syslinux = "syslinux"; | ||||
| 	const char* ldlinux_ext[3] = { "sys", "bss", "c32" }; | ||||
|  | @ -116,9 +117,9 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter) | |||
| 				uprintf("Could not open %s\n", path); | ||||
| 				goto out; | ||||
| 			} | ||||
| 			len = fread(syslinux_ldlinux[i], 1, (size_t)syslinux_ldlinux_len[i], fd); | ||||
| 			length = fread(syslinux_ldlinux[i], 1, (size_t)syslinux_ldlinux_len[i], fd); | ||||
| 			fclose(fd); | ||||
| 			if (len != (size_t)syslinux_ldlinux_len[i]) { | ||||
| 			if (length != (size_t)syslinux_ldlinux_len[i]) { | ||||
| 				uprintf("Could not read %s\n", path); | ||||
| 				goto out; | ||||
| 			} | ||||
|  | @ -148,8 +149,8 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter) | |||
| 	} | ||||
| 
 | ||||
| 	/* Write ldlinux.sys file */ | ||||
| 	if (!WriteFile(f_handle, syslinux_ldlinux[0], syslinux_ldlinux_len[0], | ||||
| 		   &bytes_written, NULL) || | ||||
| 	if (!WriteFile(f_handle, (const char _force *)syslinux_ldlinux[0], | ||||
| 		   syslinux_ldlinux_len[0], &bytes_written, NULL) || | ||||
| 		bytes_written != syslinux_ldlinux_len[0]) { | ||||
| 		uprintf("Could not write '%s'\n", &path[3]); | ||||
| 		goto out; | ||||
|  | @ -183,6 +184,39 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter) | |||
| 	sectors = (libfat_sector_t*) calloc(ldlinux_sectors, sizeof *sectors); | ||||
| 	if (sectors == NULL) | ||||
| 		goto out; | ||||
| 	if (fs_type == FS_NTFS) { | ||||
| 		DWORD err; | ||||
| 		S_NTFSSECT_VOLINFO vol_info; | ||||
| 		LARGE_INTEGER vcn, lba, len; | ||||
| 		S_NTFSSECT_EXTENT extent; | ||||
| 
 | ||||
| 		static_sprintf(tmp, "%C:\\", drive_letter); | ||||
| 		err = NtfsSectGetVolumeInfo(tmp, &vol_info); | ||||
| 		if (err != ERROR_SUCCESS) { | ||||
| 			uprintf("Could not fetch NTFS volume info"); | ||||
| 			goto out; | ||||
| 		} | ||||
| 		secp = sectors; | ||||
| 		nsectors = 0; | ||||
| 		for (vcn.QuadPart = 0; | ||||
| 			NtfsSectGetFileVcnExtent(f_handle, &vcn, &extent) == ERROR_SUCCESS; | ||||
| 			vcn = extent.NextVcn) { | ||||
| 				err = NtfsSectLcnToLba(&vol_info, &extent.FirstLcn, &lba); | ||||
| 				if (err != ERROR_SUCCESS) { | ||||
| 					uprintf("Could not translate LDLINUX.SYS LCN to disk LBA"); | ||||
| 					goto out; | ||||
| 				} | ||||
| 				lba.QuadPart -= vol_info.PartitionLba.QuadPart; | ||||
| 				len.QuadPart = ((extent.NextVcn.QuadPart - | ||||
| 					extent.FirstVcn.QuadPart) * | ||||
| 					vol_info.SectorsPerCluster); | ||||
| 				while (len.QuadPart-- && nsectors < ldlinux_sectors) { | ||||
| 					*secp++ = lba.QuadPart++; | ||||
| 					nsectors++; | ||||
| 				} | ||||
| 		} | ||||
| 		goto map_done; | ||||
| 	} | ||||
| 	fs = libfat_open(libfat_readfile, (intptr_t) d_handle); | ||||
| 	if (fs == NULL) { | ||||
| 		uprintf("Syslinux FAT access error\n"); | ||||
|  | @ -198,6 +232,7 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter) | |||
| 		s = libfat_nextsector(fs, s); | ||||
| 	} | ||||
| 	libfat_close(fs); | ||||
| map_done: | ||||
| 
 | ||||
| 	/* Patch ldlinux.sys and the boot sector */ | ||||
| 	syslinux_patch(sectors, nsectors, 0, 0, NULL, NULL); | ||||
|  | @ -224,7 +259,7 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter) | |||
| 	} | ||||
| 
 | ||||
| 	/* Make the syslinux boot sector */ | ||||
| 	syslinux_make_bootsect(sectbuf, VFAT); | ||||
| 	syslinux_make_bootsect(sectbuf, (fs_type == FS_NTFS)?NTFS:VFAT); | ||||
| 
 | ||||
| 	/* Write boot sector back */ | ||||
| 	if (SetFilePointer(d_handle, 0, NULL, FILE_BEGIN) != 0 || | ||||
|  |  | |||
|  | @ -20,6 +20,7 @@ | |||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <ClInclude Include="..\advconst.h" /> | ||||
|     <ClInclude Include="..\ntfssect.h" /> | ||||
|     <ClInclude Include="..\syslinux.h" /> | ||||
|     <ClInclude Include="..\syslxcom.h" /> | ||||
|     <ClInclude Include="..\syslxfs.h" /> | ||||
|  | @ -27,6 +28,7 @@ | |||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <ClCompile Include="..\fs.c" /> | ||||
|     <ClCompile Include="..\ntfssect.c" /> | ||||
|     <ClCompile Include="..\setadv.c" /> | ||||
|     <ClCompile Include="..\syslxmod.c" /> | ||||
|   </ItemGroup> | ||||
|  |  | |||
|  | @ -26,6 +26,9 @@ | |||
|     <ClInclude Include="..\syslxcom.h"> | ||||
|       <Filter>Header Files</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="..\ntfssect.h"> | ||||
|       <Filter>Header Files</Filter> | ||||
|     </ClInclude> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <ClCompile Include="..\fs.c"> | ||||
|  | @ -37,5 +40,8 @@ | |||
|     <ClCompile Include="..\syslxmod.c"> | ||||
|       <Filter>Source Files</Filter> | ||||
|     </ClCompile> | ||||
|     <ClCompile Include="..\ntfssect.c"> | ||||
|       <Filter>Source Files</Filter> | ||||
|     </ClCompile> | ||||
|   </ItemGroup> | ||||
| </Project> | ||||
|  | @ -13,5 +13,6 @@ TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \ | |||
|            $(SDK_LIB_PATH)\user32.lib | ||||
| 
 | ||||
| SOURCES=fs.c          \ | ||||
|         ntfssect.c    \ | ||||
|         setadv.c      \ | ||||
|         syslxmod.c | ||||
|  | @ -1,4 +1,4 @@ | |||
| noinst_LIBRARIES = libinstaller.a | ||||
| 
 | ||||
| libinstaller_a_SOURCES = fs.c setadv.c syslxmod.c | ||||
| libinstaller_a_SOURCES = fs.c ntfssect.c setadv.c syslxmod.c | ||||
| libinstaller_a_CFLAGS = $(AM_CFLAGS) | ||||
|  | @ -53,6 +53,7 @@ am__v_at_0 = @ | |||
| libinstaller_a_AR = $(AR) $(ARFLAGS) | ||||
| libinstaller_a_LIBADD = | ||||
| am_libinstaller_a_OBJECTS = libinstaller_a-fs.$(OBJEXT) \
 | ||||
| 	libinstaller_a-ntfssect.$(OBJEXT) \
 | ||||
| 	libinstaller_a-setadv.$(OBJEXT) \
 | ||||
| 	libinstaller_a-syslxmod.$(OBJEXT) | ||||
| libinstaller_a_OBJECTS = $(am_libinstaller_a_OBJECTS) | ||||
|  | @ -166,7 +167,7 @@ top_build_prefix = @top_build_prefix@ | |||
| top_builddir = @top_builddir@ | ||||
| top_srcdir = @top_srcdir@ | ||||
| noinst_LIBRARIES = libinstaller.a | ||||
| libinstaller_a_SOURCES = fs.c setadv.c syslxmod.c | ||||
| libinstaller_a_SOURCES = fs.c ntfssect.c setadv.c syslxmod.c | ||||
| libinstaller_a_CFLAGS = $(AM_CFLAGS) | ||||
| all: all-am | ||||
| 
 | ||||
|  | @ -232,6 +233,14 @@ libinstaller_a-fs.obj: fs.c | |||
| 	$(AM_V_CC) @AM_BACKSLASH@ | ||||
| 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinstaller_a_CFLAGS) $(CFLAGS) -c -o libinstaller_a-fs.obj `if test -f 'fs.c'; then $(CYGPATH_W) 'fs.c'; else $(CYGPATH_W) '$(srcdir)/fs.c'; fi` | ||||
| 
 | ||||
| libinstaller_a-ntfssect.o: ntfssect.c | ||||
| 	$(AM_V_CC) @AM_BACKSLASH@ | ||||
| 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinstaller_a_CFLAGS) $(CFLAGS) -c -o libinstaller_a-ntfssect.o `test -f 'ntfssect.c' || echo '$(srcdir)/'`ntfssect.c | ||||
| 
 | ||||
| libinstaller_a-ntfssect.obj: ntfssect.c | ||||
| 	$(AM_V_CC) @AM_BACKSLASH@ | ||||
| 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinstaller_a_CFLAGS) $(CFLAGS) -c -o libinstaller_a-ntfssect.obj `if test -f 'ntfssect.c'; then $(CYGPATH_W) 'ntfssect.c'; else $(CYGPATH_W) '$(srcdir)/ntfssect.c'; fi` | ||||
| 
 | ||||
| libinstaller_a-setadv.o: setadv.c | ||||
| 	$(AM_V_CC) @AM_BACKSLASH@ | ||||
| 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinstaller_a_CFLAGS) $(CFLAGS) -c -o libinstaller_a-setadv.o `test -f 'setadv.c' || echo '$(srcdir)/'`setadv.c | ||||
|  |  | |||
|  | @ -18,6 +18,8 @@ | |||
| 
 | ||||
| #define _XOPEN_SOURCE 500	/* Required on glibc 2.x */ | ||||
| #define _BSD_SOURCE | ||||
| /* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */ | ||||
| #define _DEFAULT_SOURCE 1 | ||||
| #include <stdio.h> | ||||
| #include <inttypes.h> | ||||
| #include <string.h> | ||||
|  |  | |||
							
								
								
									
										359
									
								
								src/syslinux/libinstaller/ntfssect.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										359
									
								
								src/syslinux/libinstaller/ntfssect.c
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,359 @@ | |||
| /* -------------------------------------------------------------------------- *
 | ||||
|  * | ||||
|  *   Copyright 2011 Shao Miller - All Rights Reserved | ||||
|  * | ||||
|  *   This program is free software; you can redistribute it and/or modify | ||||
|  *   it under the terms of the GNU General Public License as published by | ||||
|  *   the Free Software Foundation, Inc., 53 Temple Place Ste 330, | ||||
|  *   Boston MA 02111-1307, USA; either version 2 of the License, or | ||||
|  *   (at your option) any later version; incorporated herein by reference. | ||||
|  * | ||||
|  * ------------------------------------------------------------------------- */ | ||||
| 
 | ||||
| /****
 | ||||
|  * ntfssect.c | ||||
|  * | ||||
|  * Fetch NTFS file cluster & sector information via Windows | ||||
|  * | ||||
|  * With special thanks to Mark Roddy for his article: | ||||
|  *   http://www.wd-3.com/archive/luserland.htm
 | ||||
|  */ | ||||
| #if defined(_MSC_VER) | ||||
| #pragma warning(disable:4996) | ||||
| #endif | ||||
| 
 | ||||
| #include <windows.h> | ||||
| #include <winioctl.h> | ||||
| #include <stddef.h> | ||||
| #include <string.h> | ||||
| 
 | ||||
| #include "ntfssect.h" | ||||
| 
 | ||||
| /*** Macros */ | ||||
| #define M_ERR(msg) (NtfsSectLastErrorMessage = (msg)) | ||||
| 
 | ||||
| /*** Function declarations */ | ||||
| static DWORD NtfsSectGetVolumeHandle( | ||||
|     CHAR * VolumeName, | ||||
|     S_NTFSSECT_VOLINFO * VolumeInfo | ||||
|   ); | ||||
| static DWORD NtfsSectGetVolumePartitionLba(S_NTFSSECT_VOLINFO * VolumeInfo); | ||||
| 
 | ||||
| /*** Objects */ | ||||
| CHAR * NtfsSectLastErrorMessage; | ||||
| 
 | ||||
| /*** Function definitions */ | ||||
| DWORD M_NTFSSECT_API NtfsSectGetFileVcnExtent( | ||||
|     HANDLE File, | ||||
|     LARGE_INTEGER * Vcn, | ||||
|     S_NTFSSECT_EXTENT * Extent | ||||
|   ) { | ||||
|     BOOL bad, ok; | ||||
|     DWORD output_size, rc; | ||||
|     STARTING_VCN_INPUT_BUFFER input; | ||||
|     RETRIEVAL_POINTERS_BUFFER output; | ||||
| 
 | ||||
|     bad = ( | ||||
|         File == INVALID_HANDLE_VALUE || | ||||
|         !Vcn || | ||||
|         Vcn->QuadPart < 0 || | ||||
|         !Extent | ||||
|       ); | ||||
|     if (bad) | ||||
|       return ERROR_INVALID_PARAMETER; | ||||
| 
 | ||||
|     input.StartingVcn = *Vcn; | ||||
|     ok = DeviceIoControl( | ||||
|         File, | ||||
|         FSCTL_GET_RETRIEVAL_POINTERS, | ||||
|         &input, | ||||
|         sizeof input, | ||||
|         &output, | ||||
|         sizeof output, | ||||
|         &output_size, | ||||
|         NULL | ||||
|       ); | ||||
|     ok = ok; | ||||
|     rc = GetLastError(); | ||||
|     switch (rc) { | ||||
|         case NO_ERROR: | ||||
|         case ERROR_MORE_DATA: | ||||
|           Extent->FirstVcn = output.StartingVcn; | ||||
|           Extent->NextVcn = output.Extents[0].NextVcn; | ||||
|           Extent->FirstLcn = output.Extents[0].Lcn; | ||||
|           return ERROR_SUCCESS; | ||||
| 
 | ||||
|         case ERROR_HANDLE_EOF: | ||||
|           break; | ||||
| 
 | ||||
|         default: | ||||
|           M_ERR("NtfsSectGetFileVcnExtent(): Unknown status!"); | ||||
|       } | ||||
| 
 | ||||
|     return rc; | ||||
|   } | ||||
| 
 | ||||
| /* Internal use only */ | ||||
| static DWORD NtfsSectGetVolumeHandle( | ||||
|     CHAR * VolumeName, | ||||
|     S_NTFSSECT_VOLINFO * VolumeInfo | ||||
|   ) { | ||||
|     #define M_VOL_PREFIX "\\\\.\\" | ||||
|     CHAR volname[sizeof M_VOL_PREFIX - 1 + MAX_PATH + 1] = M_VOL_PREFIX; | ||||
|     CHAR * const volname_short = volname + sizeof M_VOL_PREFIX - 1; | ||||
|     CHAR * c; | ||||
|     DWORD rc; | ||||
| 
 | ||||
|     /* Prefix "\\.\" onto the passed volume name */ | ||||
|     strcpy(volname + sizeof M_VOL_PREFIX - 1, VolumeName); | ||||
| 
 | ||||
|     /* Find the last non-null character */ | ||||
|     for (c = volname_short; *c; ++c) | ||||
|       ; | ||||
| 
 | ||||
|     /* Remove trailing back-slash */ | ||||
|     if (c[-1] == '\\') | ||||
|       c[-1] = 0; | ||||
| 
 | ||||
|     /* Open the volume */ | ||||
|     VolumeInfo->Handle = CreateFileA( | ||||
|         volname, | ||||
|         GENERIC_READ, | ||||
|         FILE_SHARE_READ | FILE_SHARE_WRITE, | ||||
|         NULL, | ||||
|         OPEN_EXISTING, | ||||
|         0, | ||||
|         NULL | ||||
|       ); | ||||
|     rc = GetLastError(); | ||||
|     if (VolumeInfo->Handle == INVALID_HANDLE_VALUE) { | ||||
|         M_ERR("Unable to open volume handle!"); | ||||
|         goto err_handle; | ||||
|       } | ||||
| 
 | ||||
|     return ERROR_SUCCESS; | ||||
| 
 | ||||
|     CloseHandle(VolumeInfo->Handle); | ||||
|     err_handle: | ||||
| 
 | ||||
|     return rc; | ||||
|   } | ||||
| 
 | ||||
| DWORD M_NTFSSECT_API NtfsSectGetVolumeInfo( | ||||
|     CHAR * VolumeName, | ||||
|     S_NTFSSECT_VOLINFO * VolumeInfo | ||||
|   ) { | ||||
|     S_NTFSSECT_XPFUNCS xp_funcs; | ||||
|     DWORD rc, free_clusts, total_clusts; | ||||
|     BOOL ok; | ||||
| 
 | ||||
|     if (!VolumeName || !VolumeInfo) | ||||
|       return ERROR_INVALID_PARAMETER; | ||||
| 
 | ||||
|     rc = NtfsSectGetVolumeHandle(VolumeName, VolumeInfo); | ||||
|     if (rc != ERROR_SUCCESS) | ||||
|       goto err_handle; | ||||
| 
 | ||||
|     rc = NtfsSectLoadXpFuncs(&xp_funcs); | ||||
|     if (rc != ERROR_SUCCESS) | ||||
|       goto err_xp_funcs; | ||||
| 
 | ||||
|     ok = xp_funcs.GetDiskFreeSpace( | ||||
|         VolumeName, | ||||
|         &VolumeInfo->SectorsPerCluster, | ||||
|         &VolumeInfo->BytesPerSector, | ||||
|         &free_clusts, | ||||
|         &total_clusts | ||||
|       ); | ||||
|     rc = GetLastError(); | ||||
|     if (!ok) { | ||||
|         M_ERR("GetDiskFreeSpace() failed!"); | ||||
|         goto err_freespace; | ||||
|       } | ||||
| 
 | ||||
|     rc = NtfsSectGetVolumePartitionLba(VolumeInfo); | ||||
|     if (rc != ERROR_SUCCESS) | ||||
|       goto err_lba; | ||||
| 
 | ||||
|     VolumeInfo->Size = sizeof *VolumeInfo; | ||||
|     rc = ERROR_SUCCESS; | ||||
| 
 | ||||
|     err_lba: | ||||
| 
 | ||||
|     err_freespace: | ||||
| 
 | ||||
|     NtfsSectUnloadXpFuncs(&xp_funcs); | ||||
|     err_xp_funcs: | ||||
| 
 | ||||
|     if (rc != ERROR_SUCCESS) { | ||||
|         CloseHandle(VolumeInfo->Handle); | ||||
|         VolumeInfo->Handle = INVALID_HANDLE_VALUE; | ||||
|       } | ||||
|     err_handle: | ||||
| 
 | ||||
|     return rc; | ||||
|   } | ||||
| 
 | ||||
| DWORD M_NTFSSECT_API NtfsSectGetVolumeInfoFromFileName( | ||||
|     CHAR * FileName, | ||||
|     S_NTFSSECT_VOLINFO * VolumeInfo | ||||
|   ) { | ||||
|     S_NTFSSECT_XPFUNCS xp_funcs; | ||||
|     DWORD rc; | ||||
|     CHAR volname[MAX_PATH + 1]; | ||||
|     BOOL ok; | ||||
| 
 | ||||
|     if (!FileName || !VolumeInfo) | ||||
|       return ERROR_INVALID_PARAMETER; | ||||
| 
 | ||||
|     rc = NtfsSectLoadXpFuncs(&xp_funcs); | ||||
|     if (rc != ERROR_SUCCESS) { | ||||
|         goto err_xp_funcs; | ||||
|       } | ||||
| 
 | ||||
|     ok = xp_funcs.GetVolumePathName( | ||||
|         FileName, | ||||
|         volname, | ||||
|         sizeof volname | ||||
|       ); | ||||
|     rc = GetLastError(); | ||||
|     if (!ok) { | ||||
|         M_ERR("GetVolumePathName() failed!"); | ||||
|         goto err_volname; | ||||
|       } | ||||
| 
 | ||||
|     rc = NtfsSectGetVolumeInfo(volname, VolumeInfo); | ||||
| 
 | ||||
|     err_volname: | ||||
| 
 | ||||
|     NtfsSectUnloadXpFuncs(&xp_funcs); | ||||
|     err_xp_funcs: | ||||
| 
 | ||||
|     return rc; | ||||
|   } | ||||
| 
 | ||||
| /* Internal use only */ | ||||
| static DWORD NtfsSectGetVolumePartitionLba(S_NTFSSECT_VOLINFO * VolumeInfo) { | ||||
|     BOOL ok; | ||||
|     VOLUME_DISK_EXTENTS vol_disk_extents; | ||||
|     DWORD output_size, rc; | ||||
| 
 | ||||
|     ok = DeviceIoControl( | ||||
|         VolumeInfo->Handle, | ||||
|         IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, | ||||
|         NULL, | ||||
|         0, | ||||
|         &vol_disk_extents, | ||||
|         sizeof vol_disk_extents, | ||||
|         &output_size, | ||||
|         NULL | ||||
|       ); | ||||
|     rc = GetLastError(); | ||||
|     if (!ok) { | ||||
|         M_ERR("Couldn't fetch volume disk extent(s)!"); | ||||
|         goto err_vol_disk_extents; | ||||
|       } | ||||
| 
 | ||||
|     if (vol_disk_extents.NumberOfDiskExtents != 1) { | ||||
|         M_ERR("Unsupported number of volume disk extents!"); | ||||
|         goto err_num_of_extents; | ||||
|       } | ||||
| 
 | ||||
|     VolumeInfo->PartitionLba.QuadPart = ( | ||||
|         vol_disk_extents.Extents[0].StartingOffset.QuadPart / | ||||
|         VolumeInfo->BytesPerSector | ||||
|       ); | ||||
| 
 | ||||
|     return ERROR_SUCCESS; | ||||
| 
 | ||||
|     err_num_of_extents: | ||||
| 
 | ||||
|     err_vol_disk_extents: | ||||
| 
 | ||||
|     return rc; | ||||
|   } | ||||
| 
 | ||||
| DWORD M_NTFSSECT_API NtfsSectLcnToLba( | ||||
|     const S_NTFSSECT_VOLINFO * VolumeInfo, | ||||
|     const LARGE_INTEGER * Lcn, | ||||
|     LARGE_INTEGER * Lba | ||||
|   ) { | ||||
|     BOOL bad; | ||||
|     bad = ( | ||||
|         !VolumeInfo || | ||||
|         !VolumeInfo->BytesPerSector || | ||||
|         !VolumeInfo->SectorsPerCluster || | ||||
|         !Lcn || | ||||
|         Lcn->QuadPart < 0 || | ||||
|         !Lba | ||||
|       ); | ||||
|     if (bad) | ||||
|       return ERROR_INVALID_PARAMETER; | ||||
| 
 | ||||
|     Lba->QuadPart = ( | ||||
|         VolumeInfo->PartitionLba.QuadPart + | ||||
|         Lcn->QuadPart * | ||||
|         VolumeInfo->SectorsPerCluster | ||||
|       ); | ||||
|     return ERROR_SUCCESS; | ||||
|   } | ||||
| 
 | ||||
| DWORD M_NTFSSECT_API NtfsSectLoadXpFuncs(S_NTFSSECT_XPFUNCS * XpFuncs) { | ||||
|     DWORD rc; | ||||
| 
 | ||||
|     if (!XpFuncs) | ||||
|       return ERROR_INVALID_PARAMETER; | ||||
| 
 | ||||
|     XpFuncs->Size = sizeof *XpFuncs; | ||||
| 
 | ||||
|     XpFuncs->Kernel32 = LoadLibraryA("kernel32.dll"); | ||||
|     rc = GetLastError(); | ||||
|     if (!XpFuncs->Kernel32) { | ||||
|         M_ERR("KERNEL32.DLL not found!"); | ||||
|         goto err; | ||||
|       } | ||||
| 
 | ||||
|     XpFuncs->GetVolumePathName = (F_KERNEL32_GETVOLUMEPATHNAME *) ( | ||||
|         GetProcAddress( | ||||
|             XpFuncs->Kernel32, | ||||
|             "GetVolumePathNameA" | ||||
|           ) | ||||
|       ); | ||||
|     rc = GetLastError(); | ||||
|     if (!XpFuncs->GetVolumePathName) { | ||||
|         M_ERR("GetVolumePathName() not found in KERNEL32.DLL!"); | ||||
|         goto err; | ||||
|       } | ||||
| 
 | ||||
|     XpFuncs->GetDiskFreeSpace = (F_KERNEL32_GETDISKFREESPACE *) ( | ||||
|         GetProcAddress( | ||||
|             XpFuncs->Kernel32, | ||||
|             "GetDiskFreeSpaceA" | ||||
|           ) | ||||
|       ); | ||||
|     rc = GetLastError(); | ||||
|     if (!XpFuncs->GetDiskFreeSpace) { | ||||
|         M_ERR("GetDiskFreeSpace() not found in KERNEL32.DLL!"); | ||||
|         goto err; | ||||
|       } | ||||
| 
 | ||||
|     return ERROR_SUCCESS; | ||||
| 
 | ||||
|     err: | ||||
|     NtfsSectUnloadXpFuncs(XpFuncs); | ||||
|     return rc; | ||||
|   } | ||||
| 
 | ||||
| VOID M_NTFSSECT_API NtfsSectUnloadXpFuncs(S_NTFSSECT_XPFUNCS * XpFuncs) { | ||||
|     if (!XpFuncs) | ||||
|       return; | ||||
| 
 | ||||
|     XpFuncs->GetDiskFreeSpace = NULL; | ||||
|     XpFuncs->GetVolumePathName = NULL; | ||||
|     if (XpFuncs->Kernel32) | ||||
|       FreeLibrary(XpFuncs->Kernel32); | ||||
|     XpFuncs->Kernel32 = NULL; | ||||
|     XpFuncs->Size = 0; | ||||
|     return; | ||||
|   } | ||||
| 
 | ||||
							
								
								
									
										152
									
								
								src/syslinux/libinstaller/ntfssect.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										152
									
								
								src/syslinux/libinstaller/ntfssect.h
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,152 @@ | |||
| /* -------------------------------------------------------------------------- *
 | ||||
|  * | ||||
|  *   Copyright 2011 Shao Miller - All Rights Reserved | ||||
|  * | ||||
|  *   This program is free software; you can redistribute it and/or modify | ||||
|  *   it under the terms of the GNU General Public License as published by | ||||
|  *   the Free Software Foundation, Inc., 53 Temple Place Ste 330, | ||||
|  *   Boston MA 02111-1307, USA; either version 2 of the License, or | ||||
|  *   (at your option) any later version; incorporated herein by reference. | ||||
|  * | ||||
|  * ------------------------------------------------------------------------- */ | ||||
| #ifndef M_NTFSSECT_H_ | ||||
| 
 | ||||
| /****
 | ||||
|  * ntfssect.h | ||||
|  * | ||||
|  * Fetch NTFS file cluster & sector information via Windows | ||||
|  * | ||||
|  * With special thanks to Mark Roddy for his article: | ||||
|  *   http://www.wd-3.com/archive/luserland.htm
 | ||||
|  */ | ||||
| 
 | ||||
| /*** Macros */ | ||||
| #define M_NTFSSECT_H_ | ||||
| #define M_NTFSSECT_API | ||||
| 
 | ||||
| /*** Object types */ | ||||
| 
 | ||||
| /* An "extent;" a contiguous range of file data */ | ||||
| typedef struct S_NTFSSECT_EXTENT_ S_NTFSSECT_EXTENT; | ||||
| 
 | ||||
| /* Volume info relevant to file cluster & sector info */ | ||||
| typedef struct S_NTFSSECT_VOLINFO_ S_NTFSSECT_VOLINFO; | ||||
| 
 | ||||
| /* Stores function pointers to some Windows functions */ | ||||
| typedef struct S_NTFSSECT_XPFUNCS_ S_NTFSSECT_XPFUNCS; | ||||
| 
 | ||||
| /*** Function types */ | ||||
| 
 | ||||
| /* The function type for Kernel32.dll's GetDiskFreeSpace() */ | ||||
| typedef BOOL WINAPI F_KERNEL32_GETDISKFREESPACE( | ||||
|     LPCSTR, | ||||
|     LPDWORD, | ||||
|     LPDWORD, | ||||
|     LPDWORD, | ||||
|     LPDWORD | ||||
|   ); | ||||
| 
 | ||||
| /* The function type for Kernel32.dll's GetVolumePathName() */ | ||||
| typedef BOOL WINAPI F_KERNEL32_GETVOLUMEPATHNAME(LPCSTR, LPCSTR, DWORD); | ||||
| 
 | ||||
| /*** Function declarations */ | ||||
| 
 | ||||
| /**
 | ||||
|  * Fetch the extent containing a particular VCN | ||||
|  * | ||||
|  * @v File | ||||
|  * @v Vcn | ||||
|  * @v Extent | ||||
|  * @ret DWORD | ||||
|  */ | ||||
| DWORD M_NTFSSECT_API NtfsSectGetFileVcnExtent( | ||||
|     HANDLE File, | ||||
|     LARGE_INTEGER * Vcn, | ||||
|     S_NTFSSECT_EXTENT * Extent | ||||
|   ); | ||||
| 
 | ||||
| /**
 | ||||
|  * Populate a volume info object | ||||
|  * | ||||
|  * @v VolumeName | ||||
|  * @v VolumeInfo | ||||
|  * @ret DWORD | ||||
|  */ | ||||
| DWORD M_NTFSSECT_API NtfsSectGetVolumeInfo( | ||||
|     CHAR * VolumeName, | ||||
|     S_NTFSSECT_VOLINFO * VolumeInfo | ||||
|   ); | ||||
| 
 | ||||
| /**
 | ||||
|  * Populate a volume info object | ||||
|  * | ||||
|  * @v FileName | ||||
|  * @v VolumeInfo | ||||
|  * @ret DWORD | ||||
|  */ | ||||
| DWORD M_NTFSSECT_API NtfsSectGetVolumeInfoFromFileName( | ||||
|     CHAR * FileName, | ||||
|     S_NTFSSECT_VOLINFO * VolumeInfo | ||||
|   ); | ||||
| 
 | ||||
| /**
 | ||||
|  * Convert a volume LCN to an absolute disk LBA | ||||
|  * | ||||
|  * @v VolumeInfo | ||||
|  * @v Lcn | ||||
|  * @v Lba | ||||
|  * @ret DWORD | ||||
|  */ | ||||
| DWORD M_NTFSSECT_API NtfsSectLcnToLba( | ||||
|     const S_NTFSSECT_VOLINFO * VolumeInfo, | ||||
|     const LARGE_INTEGER * Lcn, | ||||
|     LARGE_INTEGER * Lba | ||||
|   ); | ||||
| 
 | ||||
| /**
 | ||||
|  * Load some helper XP functions | ||||
|  * | ||||
|  * @v XpFuncs | ||||
|  * @ret DWORD | ||||
|  */ | ||||
| DWORD M_NTFSSECT_API NtfsSectLoadXpFuncs(S_NTFSSECT_XPFUNCS * XpFuncs); | ||||
| 
 | ||||
| /**
 | ||||
|  * Unload some helper XP functions | ||||
|  * | ||||
|  * @v XpFuncs | ||||
|  * @ret DWORD | ||||
|  */ | ||||
| VOID M_NTFSSECT_API NtfsSectUnloadXpFuncs(S_NTFSSECT_XPFUNCS * XpFuncs); | ||||
| 
 | ||||
| /*** Object declarations */ | ||||
| 
 | ||||
| /**
 | ||||
|  * The last error message set by one of our functions. | ||||
|  * Obviously not per-thread | ||||
|  */ | ||||
| extern CHAR * NtfsSectLastErrorMessage; | ||||
| 
 | ||||
| /*** Struct/union definitions */ | ||||
| struct S_NTFSSECT_EXTENT_ { | ||||
|     LARGE_INTEGER FirstVcn; | ||||
|     LARGE_INTEGER NextVcn; | ||||
|     LARGE_INTEGER FirstLcn; | ||||
|   }; | ||||
| 
 | ||||
| struct S_NTFSSECT_VOLINFO_ { | ||||
|     DWORD Size; | ||||
|     HANDLE Handle; | ||||
|     DWORD BytesPerSector; | ||||
|     DWORD SectorsPerCluster; | ||||
|     LARGE_INTEGER PartitionLba; | ||||
|   }; | ||||
| 
 | ||||
| struct S_NTFSSECT_XPFUNCS_ { | ||||
|     DWORD Size; | ||||
|     HMODULE Kernel32; | ||||
|     F_KERNEL32_GETVOLUMEPATHNAME * GetVolumePathName; | ||||
|     F_KERNEL32_GETDISKFREESPACE * GetDiskFreeSpace; | ||||
|   }; | ||||
| 
 | ||||
| #endif /* M_NTFSSECT_H_ */ | ||||
|  | @ -18,6 +18,14 @@ | |||
| #include "advconst.h" | ||||
| #include "setadv.h" | ||||
| 
 | ||||
| #ifdef __CHECKER__ | ||||
| # define _slimg __attribute__((noderef,address_space(1))) | ||||
| # define _force __attribute__((force)) | ||||
| #else | ||||
| # define _slimg | ||||
| # define _force | ||||
| #endif | ||||
| 
 | ||||
| /* The standard boot sector and ldlinux image */ | ||||
| extern unsigned char* syslinux_ldlinux[2]; | ||||
| extern DWORD syslinux_ldlinux_len[2]; | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| /*
 | ||||
|  *   Copyright 2011 Paulo Alcantara <pcacjr@gmail.com> | ||||
|  *   Copyright 2011-2012 Paulo Alcantara <pcacjr@zytor.com> | ||||
|  * | ||||
|  *   This program is free software; you can redistribute it and/or modify | ||||
|  *   it under the terms of the GNU General Public License as published by | ||||
|  | @ -12,13 +12,16 @@ | |||
| #ifndef _SYSLXFS_H_ | ||||
| #define _SYSLXFS_H_ | ||||
| 
 | ||||
| /* Global fs_type for handling fat, ntfs, ext2/3/4 and btrfs */ | ||||
| /* Global fs_type for handling fat, ntfs, ext2/3/4, btrfs, xfs and ufs1/2 */ | ||||
| enum filesystem { | ||||
|     NONE, | ||||
|     EXT2, | ||||
|     BTRFS, | ||||
|     VFAT, | ||||
|     NTFS, | ||||
|     XFS, | ||||
|     UFS1, | ||||
|     UFS2, | ||||
| }; | ||||
| 
 | ||||
| //extern int fs_type;
 | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| /* ----------------------------------------------------------------------- *
 | ||||
|  * | ||||
|  *   Copyright 2007-2008 H. Peter Anvin - All Rights Reserved | ||||
|  *   Copyright 2009-2011 Intel Corporation; author: H. Peter Anvin | ||||
|  *   Copyright 2009-2014 Intel Corporation; author: H. Peter Anvin | ||||
|  *   Copyright 2011 Paulo Alcantara <pcacjr@gmail.com> | ||||
|  * | ||||
|  *   This program is free software; you can redistribute it and/or modify | ||||
|  | @ -26,16 +26,15 @@ | |||
| #ifdef __GNUC__ | ||||
| # ifdef __MINGW32__ | ||||
|    /* gcc 4.7 miscompiles packed structures in MS-bitfield mode */ | ||||
| #  define GNUC_PACKED __attribute__((packed,gcc_struct)) | ||||
| #  define PACKME | ||||
| #  define PACKED __attribute__((packed,gcc_struct)) | ||||
| # else | ||||
| #  define GNUC_PACKED __attribute__((packed)) | ||||
| #  define PACKME | ||||
| #  define PACKED __attribute__((packed)) | ||||
| # endif | ||||
| # define PRAGMA_BEGIN_PACKED | ||||
| # define PRAGMA_END_PACKED | ||||
| #elif defined(_MSC_VER) | ||||
| # define GNUC_PACKED | ||||
| # define PRAGMA_BEGIN_PACKED __pragma(pack(push, 1)) | ||||
| # define PRAGMA_END_PACKED   __pragma(pack(pop)) | ||||
| # define PACKME __pragma(pack(push, 1)) | ||||
| # define PACKED __pragma(pack(pop)) | ||||
| #else | ||||
| # error "Need to define PACKED for this compiler" | ||||
| #endif | ||||
|  | @ -66,7 +65,7 @@ static inline uint32_t get_32(const uint32_t * p) | |||
|     return *p; | ||||
| #else | ||||
|     const uint16_t *pp = (const uint16_t *)p; | ||||
|     return get_16(pp[0]) + (uint32_t)get_16(pp[1]); | ||||
|     return get_16(&pp[0]) + ((uint32_t)get_16(&pp[1]) << 16); | ||||
| #endif | ||||
| } | ||||
| 
 | ||||
|  | @ -77,7 +76,7 @@ static inline uint64_t get_64(const uint64_t * p) | |||
|     return *p; | ||||
| #else | ||||
|     const uint32_t *pp = (const uint32_t *)p; | ||||
|     return get_32(pp[0]) + (uint64_t)get_32(pp[1]); | ||||
|     return get_32(&pp[0]) + ((uint64_t)get_32(&pp[1]) << 32); | ||||
| #endif | ||||
| } | ||||
| 
 | ||||
|  | @ -104,11 +103,9 @@ static inline void set_32(uint32_t *p, uint32_t v) | |||
|     /* Littleendian and unaligned-capable */ | ||||
|     *p = v; | ||||
| #else | ||||
|     uint8_t *pp = (uint8_t *) p; | ||||
|     pp[0] = (v & 0xff); | ||||
|     pp[1] = ((v >> 8) & 0xff); | ||||
|     pp[2] = ((v >> 16) & 0xff); | ||||
|     pp[3] = ((v >> 24) & 0xff); | ||||
|     uint16_t *pp = (uint16_t *) p; | ||||
|     set_16(&pp[0], v); | ||||
|     set_16(&pp[1], v >> 16); | ||||
| #endif | ||||
| } | ||||
| 
 | ||||
|  | @ -119,8 +116,8 @@ static inline void set_64(uint64_t *p, uint64_t v) | |||
|     *p = v; | ||||
| #else | ||||
|     uint32_t *pp = (uint32_t *) p; | ||||
|     set_32(pp[0], v); | ||||
|     set_32(pp[1], v >> 32); | ||||
|     set_32(&pp[0], v); | ||||
|     set_32(&pp[1], v >> 32); | ||||
| #endif | ||||
| } | ||||
| 
 | ||||
|  | @ -130,47 +127,65 @@ static inline void set_64(uint64_t *p, uint64_t v) | |||
|  */ | ||||
| #ifdef __MSDOS__ | ||||
| 
 | ||||
| static inline __attribute__ ((const)) | ||||
| uint16_t ds(void) | ||||
| { | ||||
|     uint16_t v; | ||||
|     asm("movw %%ds,%0":"=rm"(v)); | ||||
|     return v; | ||||
| } | ||||
| 
 | ||||
| static inline void *set_fs(const void *p) | ||||
| { | ||||
|     uint16_t seg; | ||||
| 
 | ||||
|     seg = ds() + ((size_t) p >> 4); | ||||
|     asm volatile ("movw %0,%%fs"::"rm" (seg)); | ||||
|     return (void *)((size_t) p & 0xf); | ||||
| } | ||||
| 
 | ||||
| uint8_t get_8_sl(const uint8_t * p); | ||||
| uint16_t get_16_sl(const uint16_t * p); | ||||
| uint32_t get_32_sl(const uint32_t * p); | ||||
| uint64_t get_64_sl(const uint64_t * p); | ||||
| void set_8_sl(uint8_t * p, uint8_t v); | ||||
| void set_16_sl(uint16_t * p, uint16_t v); | ||||
| void set_32_sl(uint32_t * p, uint32_t v); | ||||
| void set_64_sl(uint64_t * p, uint64_t v); | ||||
| void memcpy_to_sl(void *dst, const void *src, size_t len); | ||||
| void memcpy_from_sl(void *dst, const void *src, size_t len); | ||||
| uint8_t get_8_sl(const uint8_t _slimg * p); | ||||
| uint16_t get_16_sl(const uint16_t _slimg * p); | ||||
| uint32_t get_32_sl(const uint32_t _slimg * p); | ||||
| uint64_t get_64_sl(const uint64_t _slimg * p); | ||||
| void set_8_sl(uint8_t _slimg * p, uint8_t v); | ||||
| void set_16_sl(uint16_t _slimg * p, uint16_t v); | ||||
| void set_32_sl(uint32_t _slimg * p, uint32_t v); | ||||
| void set_64_sl(uint64_t _slimg * p, uint64_t v); | ||||
| void memcpy_to_sl(void _slimg *dst, const void *src, size_t len); | ||||
| void memcpy_from_sl(void *dst, const void _slimg *src, size_t len); | ||||
| void memset_sl(void _slimg *dst, int c, size_t len); | ||||
| 
 | ||||
| #else | ||||
| 
 | ||||
| /* Sane system ... */ | ||||
| #define get_8_sl(x)    		get_8(x) | ||||
| #define get_16_sl(x)   		get_16(x) | ||||
| #define get_32_sl(x)   		get_32(x) | ||||
| #define get_64_sl(x)   		get_64(x) | ||||
| #define set_8_sl(x,y)  		set_8(x,y) | ||||
| #define set_16_sl(x,y) 		set_16(x,y) | ||||
| #define set_32_sl(x,y) 		set_32(x,y) | ||||
| #define set_64_sl(x,y) 		set_64(x,y) | ||||
| #define memcpy_to_sl(d,s,l)	memcpy(d,s,l) | ||||
| #define memcpy_from_sl(d,s,l)	memcpy(d,s,l) | ||||
| static inline uint8_t get_8_sl(const uint8_t _slimg * p) | ||||
| { | ||||
|     return get_8((const uint8_t _force *)p); | ||||
| } | ||||
| static inline uint16_t get_16_sl(const uint16_t _slimg * p) | ||||
| { | ||||
|     return get_16((const uint16_t _force *)p); | ||||
| } | ||||
| static inline uint32_t get_32_sl(const uint32_t _slimg * p) | ||||
| { | ||||
|     return get_32((const uint32_t _force *)p); | ||||
| } | ||||
| static inline uint64_t get_64_sl(const uint64_t _slimg * p) | ||||
| { | ||||
|     return get_64((const uint64_t _force *)p); | ||||
| } | ||||
| static inline void set_8_sl(uint8_t _slimg * p, uint8_t v) | ||||
| { | ||||
|     set_8((uint8_t _force *)p, v); | ||||
| } | ||||
| static inline void set_16_sl(uint16_t _slimg * p, uint16_t v) | ||||
| { | ||||
|     set_16((uint16_t _force *)p, v); | ||||
| } | ||||
| static inline void set_32_sl(uint32_t _slimg * p, uint32_t v) | ||||
| { | ||||
|     set_32((uint32_t _force *)p, v); | ||||
| } | ||||
| static inline void set_64_sl(uint64_t _slimg * p, uint64_t v) | ||||
| { | ||||
|     set_64((uint64_t _force *)p, v); | ||||
| } | ||||
| static inline void memcpy_to_sl(void _slimg *dst, const void *src, size_t len) | ||||
| { | ||||
|     memcpy((void _force *)dst, src, len); | ||||
| } | ||||
| static inline void memcpy_from_sl(void *dst, const void _slimg *src, size_t len) | ||||
| { | ||||
|     memcpy(dst, (const void _force *)src, len); | ||||
| } | ||||
| static inline void memset_sl(void _slimg *dst, int c, size_t len) | ||||
| { | ||||
|     memset((void _force *)dst, c, len); | ||||
| } | ||||
| 
 | ||||
| #endif | ||||
| 
 | ||||
|  | @ -204,13 +219,14 @@ struct ext_patch_area { | |||
| }; | ||||
| 
 | ||||
| /* Sector extent */ | ||||
| PRAGMA_BEGIN_PACKED | ||||
| PACKME | ||||
| struct syslinux_extent { | ||||
|     uint64_t lba; | ||||
|     uint16_t len; | ||||
| } GNUC_PACKED; | ||||
| } PACKED; | ||||
| 
 | ||||
| /* FAT bootsector format, also used by other disk-based derivatives */ | ||||
| PACKME | ||||
| struct fat_boot_sector { | ||||
|     uint8_t bsJump[3]; | ||||
|     char bsOemName[8]; | ||||
|  | @ -227,7 +243,9 @@ struct fat_boot_sector { | |||
|     uint32_t bsHiddenSecs; | ||||
|     uint32_t bsHugeSectors; | ||||
| 
 | ||||
|     PACKME | ||||
|     union { | ||||
| 	PACKME | ||||
| 	struct { | ||||
| 	    uint8_t DriveNumber; | ||||
| 	    uint8_t Reserved1; | ||||
|  | @ -236,7 +254,8 @@ struct fat_boot_sector { | |||
| 	    char VolumeLabel[11]; | ||||
| 	    char FileSysType[8]; | ||||
| 	    uint8_t Code[442]; | ||||
| 	} GNUC_PACKED bs16; | ||||
| 	} PACKED bs16; | ||||
| 	PACKME | ||||
| 	struct { | ||||
| 	    uint32_t FATSz32; | ||||
| 	    uint16_t ExtFlags; | ||||
|  | @ -252,15 +271,16 @@ struct fat_boot_sector { | |||
| 	    char VolumeLabel[11]; | ||||
| 	    char FileSysType[8]; | ||||
| 	    uint8_t Code[414]; | ||||
| 	} GNUC_PACKED bs32; | ||||
|     } GNUC_PACKED; | ||||
| 	} PACKED bs32; | ||||
|     } PACKED; | ||||
| 
 | ||||
|     uint32_t bsMagic; | ||||
|     uint16_t bsForwardPtr; | ||||
|     uint16_t bsSignature; | ||||
| } GNUC_PACKED; | ||||
| } PACKED; | ||||
| 
 | ||||
| /* NTFS bootsector format */ | ||||
| PACKME | ||||
| struct ntfs_boot_sector { | ||||
|     uint8_t bsJump[3]; | ||||
|     char bsOemName[8]; | ||||
|  | @ -291,8 +311,7 @@ struct ntfs_boot_sector { | |||
|     uint32_t bsMagic; | ||||
|     uint16_t bsForwardPtr; | ||||
|     uint16_t bsSignature; | ||||
| } GNUC_PACKED; | ||||
| PRAGMA_END_PACKED | ||||
| } PACKED; | ||||
| 
 | ||||
| #define FAT_bsHead      bsJump | ||||
| #define FAT_bsHeadLen   offsetof(struct fat_boot_sector, bsBytesPerSec) | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| /* ----------------------------------------------------------------------- *
 | ||||
|  * | ||||
|  *   Copyright 1998-2008 H. Peter Anvin - All Rights Reserved | ||||
|  *   Copyright 2009-2010 Intel Corporation; author H. Peter Anvin | ||||
|  *   Copyright 2009-2014 Intel Corporation; author H. Peter Anvin | ||||
|  * | ||||
|  *   This program is free software; you can redistribute it and/or modify | ||||
|  *   it under the terms of the GNU General Public License as published by | ||||
|  | @ -17,6 +17,8 @@ | |||
| 
 | ||||
| #define _XOPEN_SOURCE 500	/* Required on glibc 2.x */ | ||||
| #define _BSD_SOURCE | ||||
| /* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */ | ||||
| #define _DEFAULT_SOURCE 1 | ||||
| #include <stdio.h> | ||||
| #include <inttypes.h> | ||||
| #include <string.h> | ||||
|  | @ -30,7 +32,7 @@ | |||
| /*
 | ||||
|  * Generate sector extents | ||||
|  */ | ||||
| static void generate_extents(struct syslinux_extent *ex, int nptrs, | ||||
| static void generate_extents(struct syslinux_extent _slimg *ex, int nptrs, | ||||
| 			     const sector_t *sectp, int nsect) | ||||
| { | ||||
|     uint32_t addr = 0x8000;	/* ldlinux.sys starts loading here */ | ||||
|  | @ -42,7 +44,7 @@ static void generate_extents(struct syslinux_extent *ex, int nptrs, | |||
|     len = 0; | ||||
|     lba = 0; | ||||
| 
 | ||||
|     memset(ex, 0, nptrs * sizeof *ex); | ||||
|     memset_sl(ex, 0, nptrs * sizeof *ex); | ||||
| 
 | ||||
|     while (nsect) { | ||||
| 	sect = *sectp++; | ||||
|  | @ -81,10 +83,15 @@ static void generate_extents(struct syslinux_extent *ex, int nptrs, | |||
| /*
 | ||||
|  * Form a pointer based on a 16-bit patcharea/epa field | ||||
|  */ | ||||
| static inline void *ptr(void *img, uint16_t *offset_p) | ||||
| static inline void *ptr(void *img, const uint16_t _slimg *offset_p) | ||||
| { | ||||
|     return (char *)img + get_16_sl(offset_p); | ||||
| } | ||||
| static inline void _slimg *slptr(void _slimg *img, | ||||
| 				 const uint16_t _slimg *offset_p) | ||||
| { | ||||
|     return (char _slimg *)img + get_16_sl(offset_p); | ||||
| } | ||||
| 
 | ||||
| /*
 | ||||
|  * This patches the boot sector and the beginning of ldlinux.sys | ||||
|  | @ -101,25 +108,26 @@ int syslinux_patch(const sector_t *sectp, int nsectors, | |||
| 		   int stupid, int raid_mode, | ||||
| 		   const char *subdir, const char *subvol) | ||||
| { | ||||
|     struct patch_area *patcharea; | ||||
|     struct ext_patch_area *epa; | ||||
|     struct syslinux_extent *ex; | ||||
|     uint32_t *wp; | ||||
|     struct patch_area _slimg *patcharea; | ||||
|     struct ext_patch_area _slimg *epa; | ||||
|     struct syslinux_extent _slimg *ex; | ||||
|     const uint32_t _slimg *wp; | ||||
|     int nsect = ((boot_image_len + SECTOR_SIZE - 1) >> SECTOR_SHIFT) + 2; | ||||
|     uint32_t csum; | ||||
|     int i, dw, nptrs; | ||||
|     struct fat_boot_sector *sbs = (struct fat_boot_sector *)boot_sector; | ||||
|     uint64_t *advptrs; | ||||
|     uint64_t _slimg *advptrs; | ||||
| 
 | ||||
|     if (nsectors < nsect) | ||||
| 	return -1;		/* The actual file is too small for content */ | ||||
| 
 | ||||
|     /* Search for LDLINUX_MAGIC to find the patch area */ | ||||
|     for (wp = (uint32_t *)boot_image; get_32_sl(wp) != LDLINUX_MAGIC; | ||||
|     for (wp = (const uint32_t _slimg *)boot_image; | ||||
| 	 get_32_sl(wp) != LDLINUX_MAGIC; | ||||
| 	 wp++) | ||||
| 	; | ||||
|     patcharea = (struct patch_area *)wp; | ||||
|     epa = ptr(boot_image, &patcharea->epaoffset); | ||||
|     patcharea = (struct patch_area _slimg *)wp; | ||||
|     epa = slptr(boot_image, &patcharea->epaoffset); | ||||
| 
 | ||||
|     /* First sector need pointer in boot sector */ | ||||
|     set_32(ptr(sbs, &epa->sect1ptr0), (uint32_t) sectp[0]); | ||||
|  | @ -145,20 +153,22 @@ int syslinux_patch(const sector_t *sectp, int nsectors, | |||
|     } | ||||
| 
 | ||||
|     /* Set the sector extents */ | ||||
|     ex = ptr(boot_image, &epa->secptroffset); | ||||
|     ex = slptr(boot_image, &epa->secptroffset); | ||||
|     nptrs = get_16_sl(&epa->secptrcnt); | ||||
| 
 | ||||
| #if 0 | ||||
|     if (nsect > nptrs) { | ||||
| 	/* Not necessarily an error in this case, but a general problem */ | ||||
| 	fprintf(stderr, "Insufficient extent space, build error!\n"); | ||||
| 	exit(1); | ||||
|     } | ||||
| #endif | ||||
| 
 | ||||
|     /* -1 for the pointer in the boot sector, -2 for the two ADVs */ | ||||
|     generate_extents(ex, nptrs, sectp, nsect-1-2); | ||||
| 
 | ||||
|     /* ADV pointers */ | ||||
|     advptrs = ptr(boot_image, &epa->advptroffset); | ||||
|     advptrs = slptr(boot_image, &epa->advptroffset); | ||||
|     set_64_sl(&advptrs[0], sectp[nsect-1-2]); | ||||
|     set_64_sl(&advptrs[1], sectp[nsect-1-1]); | ||||
| 
 | ||||
|  | @ -169,7 +179,7 @@ int syslinux_patch(const sector_t *sectp, int nsectors, | |||
| 	    fprintf(stderr, "Subdirectory path too long... aborting install!\n"); | ||||
| 	    exit(1); | ||||
| 	} | ||||
| 	memcpy_to_sl(ptr(boot_image, &epa->diroffset), subdir, sublen); | ||||
| 	memcpy_to_sl(slptr(boot_image, &epa->diroffset), subdir, sublen); | ||||
|     } | ||||
| 
 | ||||
|     /* Poke in the subvolume information */ | ||||
|  | @ -179,14 +189,14 @@ int syslinux_patch(const sector_t *sectp, int nsectors, | |||
| 	    fprintf(stderr, "Subvol name too long... aborting install!\n"); | ||||
| 	    exit(1); | ||||
| 	} | ||||
| 	memcpy_to_sl(ptr(boot_image, &epa->subvoloffset), subvol, sublen); | ||||
| 	memcpy_to_sl(slptr(boot_image, &epa->subvoloffset), subvol, sublen); | ||||
|     } | ||||
| 
 | ||||
|     /* Now produce a checksum */ | ||||
|     set_32_sl(&patcharea->checksum, 0); | ||||
| 
 | ||||
|     csum = LDLINUX_MAGIC; | ||||
|     for (i = 0, wp = (uint32_t *)boot_image; i < dw; i++, wp++) | ||||
|     for (i = 0, wp = (const uint32_t _slimg *)boot_image; i < dw; i++, wp++) | ||||
| 	csum -= get_32_sl(wp);	/* Negative checksum */ | ||||
| 
 | ||||
|     set_32_sl(&patcharea->checksum, csum); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue