-
Notifications
You must be signed in to change notification settings - Fork 307
buildcustomversion
This process may be somewhat difficult for some; for an easier approach, see Command-line Options (for building scripts), Bundling together a script, a disk image, and UNetbootin into a single executable, and Building a UNetbootin Plugin.
First, you will need to get the latest source release, by installing bzr and running:
bzr branch lp:unetbootin
From unetbootin.h:
This is for Elive:
#ifdef ELIVE
#define UNETBOOTINB "Elive USB Installer"
#define NOMANUAL
#define NOFLOPPY
//#define USBINSTALL
#endif
This is for Auto Super Grub Disk:
#ifdef AUTOSUPERGRUBDISK
#define UNETBOOTINB "Auto Super Grub Disk"
#define NOEXTERN
//#define NOISO
#define HDDINSTALL
#endif
From unetbootin.cpp:
This is for EeePCLinuxOS:
#ifdef EEEPCLOS
distroselect->addItem("EeePCLinuxOS", (QStringList() << "pre2008_Live" <<
tr("<img src=\":/eeepclos.png\" /><br/>"
"<b>Homepage:</b> <a href=\"http://www.eeepclinuxos.com/\">http://www.eeepclinuxos.com</a><br/>"
"<b>Description:</b> EeePCLinuxOS is a user-friendly PCLinuxOS based distribution for the EeePC.<br/>"
"<b>Install Notes:</b> Make sure install media is empty and formatted before proceeding with install.") <<
"pre2008_Live"));
#endif
This is for Ubuntu:
distroselect->addItem("Ubuntu", (QStringList() << "8.04_Live" <<
tr("<b>Homepage:</b> <a href=\"http://www.ubuntu.com/\">http://www.ubuntu.com</a><br/>"
"<b>Description:</b> Ubuntu is a user-friendly Debian-based distribution. It is currently the most popular Linux desktop distribution.<br/>"
"<b>Install Notes:</b> The Live version allows for booting in Live mode, from which the installer can optionally be launched. The NetInstall version allows for installation over FTP, and can install Kubuntu and other official Ubuntu derivatives.") <<
"6.06_NetInstall" << "6.06_NetInstall_x64" << "6.06_Live" << "6.06_Live_x64" << "6.10_NetInstall" << "6.10_NetInstall_x64" << "6.10_Live" << "6.10_Live_x64" << "7.04_NetInstall" << "7.04_NetInstall_x64" << "7.04_Live" << "7.04_Live_x64" << "7.10_NetInstall" << "7.10_NetInstall_x64" << "7.10_Live" << "7.10_Live_x64" << "8.04_NetInstall" << "8.04_NetInstall_x64" << "8.04_Live" << "8.04_Live_x64"));
From distrolst.cpp:
This is for Ubuntu Eee:
#ifdef EEEUBUNTU
if (nameDistro == "Ubuntu Eee")
{
downloadfile(QString("http://lubi.sourceforge.net/ubuntu-eee-%1.iso").arg(relname), isotmpf);
extractiso(isotmpf, targetPath);
}
#endif
This is for Auto Super Grub Disk:
#ifdef AUTOSUPERGRUBDISK
if (nameDistro == "Auto Super Grub Disk")
{
instIndvfl("memdisk", QString("%1ubnkern").arg(targetPath));
instIndvfl("asgd.img", QString("%1ubninit").arg(targetPath));
}
#endif
This is for Elive:
#ifdef ELIVE
if (nameDistro == "Elive")
{
downloadfile(fileFilterNetDir(QStringList() <<
"http://elive.leviathan-avc.com/development/" <<
"http://elive.cmhacks.com/development/" <<
"http://elive.icedslash.com/isos/development/"
, 524288000, 1048576000, QList<QRegExp>() <<
QRegExp(".iso$", Qt::CaseInsensitive) <<
QRegExp("elive\\S{0,}.iso$", Qt::CaseInsensitive)
), isotmpf);
extractiso(isotmpf, targetPath);
}
#endif
This is for NetBSD:
if (nameDistro == "NetBSD")
{
if (isarch64)
{
cpuarch = "amd64";
}
else
{
cpuarch = "i386";
}
downloadfile(QString("http://ftp.netbsd.org/pub/NetBSD/NetBSD-%1/%2/binary/kernel/netbsd-INSTALL.gz").arg(relname, cpuarch), QString("%1ubnkern").arg(targetPath));
kernelParam = "--type=netbsd";
initrdLine = "";
initrdOpts = "";
initrdLoc = "";
}
This is for FreeBSD:
if (nameDistro == "FreeBSD")
{
if (isarch64)
{
cpuarch = "-x64";
}
else
{
cpuarch = "";
}
instIndvfl("memdisk", QString("%1ubnkern").arg(targetPath));
downloadfile(QString("http://downloads.sourceforge.net/sourceforge/lubi/freebsd-%1%2.img.gz").arg(relname, cpuarch), QString("%1ubninit").arg(targetPath));
}
This is for NTPasswd:
if (nameDistro == "NTPasswd")
{
downloadfile(QString("http://downloads.sourceforge.net/sourceforge/lubi/ntpasswd-%1-kernel").arg(relname), QString("%1ubnkern").arg(targetPath));
downloadfile(QString("http://downloads.sourceforge.net/sourceforge/lubi/ntpasswd-%1-initrd.gz").arg(relname), QString("%1ubninit").arg(targetPath));
kernelOpts = "rw vga=1 init=/linuxrc";
}
This is for Ubuntu:
if (nameDistro == "Ubuntu")
{
if (isarch64)
{
cpuarch = "amd64";
}
else
{
cpuarch = "i386";
}
if (islivecd)
{
downloadfile(fileFilterNetDir(QStringList() <<
"http://releases.ubuntu.com/"+relname <<
"http://releases.ubuntu.com/releases/"+relname <<
"ftp://releases.ubuntu.com/releases/.pool/" <<
"http://mirrors.gigenet.com/ubuntu/"+relname <<
"http://mirrors.easynews.com/linux/ubuntu-releases/"+relname <<
"http://www.gtlib.gatech.edu/pub/ubuntu-releases/"+relname <<
"http://ftp.wayne.edu/linux_distributions/ubuntu/"+relname <<
"http://ubuntu.mirrors.proxad.net/"+relname
, 524288000, 1048576000, QList<QRegExp>() <<
QRegExp(".iso$", Qt::CaseInsensitive) <<
QRegExp(cpuarch+".iso$", Qt::CaseInsensitive) <<
QRegExp("desktop-"+cpuarch+".iso$", Qt::CaseInsensitive) <<
QRegExp("desktop-"+cpuarch+".iso$", Qt::CaseInsensitive) <<
QRegExp("ubuntu\\S{0,}"+relname+"\\S{0,}desktop\\S{0,}"+cpuarch+"\\S{0,}.iso$", Qt::CaseInsensitive) <<
QRegExp("ubuntu-"+relname+"\\S{0,}-desktop-"+cpuarch+".iso$", Qt::CaseInsensitive)
), isotmpf);
extractiso(isotmpf, targetPath);
}
else
{
relname.replace("8.04", "hardy").replace("7.10", "gutsy").replace("7.04", "feisty").replace("6.10", "edgy").replace("6.06", "dapper");
downloadfile(QString("http://archive.ubuntu.com/ubuntu/dists/%1/main/installer-%2/current/images/netboot/ubuntu-installer/%2/linux").arg(relname, cpuarch), QString("%1ubnkern").arg(targetPath));
downloadfile(QString("http://archive.ubuntu.com/ubuntu/dists/%1/main/installer-%2/current/images/netboot/ubuntu-installer/%2/initrd.gz").arg(relname, cpuarch), QString("%1ubninit").arg(targetPath));
kernelOpts = "vga=normal";
}
}
This is for Frugalware:
if (nameDistro == "Frugalware")
{
if (isarch64)
{
cpuarch = "x86_64";
}
else
{
cpuarch = "i686";
}
QStringList frugalwaremirrorsL = QStringList() <<
// "ftp://ftp5.frugalware.org/packages/frugalware/pub/frugalware-"+relname+"/boot/" <<
// "http://www5.frugalware.org/packages/frugalware/pub/frugalware-"+relname+"/boot/" <<
"ftp://ftp8.frugalware.org/distro/frugalware/frugalware-"+relname+"/boot/" <<
"http://www8.frugalware.org/distro/frugalware/frugalware-"+relname+"/boot/" <<
"ftp://ftp10.frugalware.org/pub/linux/frugalware/frugalware-"+relname+"/boot/" <<
"http://www10.frugalware.org/pub/linux/frugalware/frugalware-"+relname+"/boot/" <<
"ftp://ftp12.frugalware.org/mirrors/ftp.frugalware.org/pub/frugalware/frugalware-"+relname+"/boot/" <<
"http://www12.frugalware.org/mirrors/ftp.frugalware.org/pub/frugalware/frugalware-"+relname+"/boot/" <<
"ftp://ftp4.frugalware.org/pub/linux/distributions/frugalware/frugalware-"+relname+"/boot/" <<
"http://www4.frugalware.org/pub/linux/distributions/frugalware/frugalware-"+relname+"/boot/" <<
"ftp://ftp2.frugalware.org/frugalware/pub/frugalware/frugalware-"+relname+"/boot/" <<
"ftp://ftp3.frugalware.org/mirrors/frugalware/pub/frugalware/frugalware-"+relname+"/boot/";
downloadfile(fileFilterNetDir(frugalwaremirrorsL
, 307200, 104857600, QList<QRegExp>() <<
QRegExp("vmlinuz", Qt::CaseInsensitive) <<
QRegExp("^vmlinuz-", Qt::CaseInsensitive) <<
QRegExp(cpuarch, Qt::CaseInsensitive) <<
QRegExp("-"+cpuarch+"$", Qt::CaseInsensitive) <<
QRegExp("^vmlinuz-\\S{1,}-"+cpuarch+"$", Qt::CaseInsensitive)
), QString("%1ubnkern").arg(targetPath));
downloadfile(fileFilterNetDir(frugalwaremirrorsL
, 3145728, 1048576000, QList<QRegExp>() <<
QRegExp("initrd", Qt::CaseInsensitive) <<
QRegExp("^initrd-", Qt::CaseInsensitive) <<
QRegExp(cpuarch, Qt::CaseInsensitive) <<
QRegExp("-"+cpuarch+".img", Qt::CaseInsensitive) <<
QRegExp("-"+cpuarch+".img.gz$", Qt::CaseInsensitive) <<
QRegExp("^initrd-\\S{0,}"+cpuarch+".img.gz$", Qt::CaseInsensitive)
), QString("%1ubninit").arg(targetPath));
kernelOpts = "load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=100000 rw root=/dev/ram quiet vga=791";
}
From build-eeeubuntu:
#!/bin/sh
mingwb="$(ls /usr/ | grep mingw32 | head --lines 1)"
rvern="$(./vcs-revno)"
make clean
rm Makefile*
rm release/*
lupdate-qt4 unetbootin.pro
lrelease-qt4 unetbootin.pro
./qmake-windows "DEFINES += EEEUBUNTU" "RESOURCES += unetbootin-eeeubuntu.qrc"
make
$mingwb-strip --strip-all release/unetbootin.exe
mv release/unetbootin.exe release/unetbootin-eeeubuntu-windows-$rvern.exe
./upx --lzma release/unetbootin-eeeubuntu-windows-$rvern.exe
./qmake-linux "DEFINES += EEEUBUNTU" "RESOURCES += unetbootin-eeeubuntu.qrc"
make
$mingwb-strip --strip-all unetbootin
mv unetbootin release/unetbootin-eeeubuntu-linux-$rvern
./upx --lzma release/unetbootin-eeeubuntu-linux-$rvern
qmake-qt4 -spec linux-g++-32 "RESOURCES += unetbootin-linux.qrc"
From unetbootin-autosupergrubdisk.qrc:
<RCC>
<qresource prefix="/" >
<file>asgd_en.htm</file>
<file>asgd_es.htm</file>
<file>asgd.img</file>
<file>asgd1.png</file>
<file>asgd2.png</file>
<file>asgd3.png</file>
<file>asgd4.png</file>
<file>asgd5.png</file>
<file>asgd6.png</file>
<file>asgd7.png</file>
<file>asgd8.png</file>
<file>asgd9.png</file>
<file>asgd10.png</file>
<file>asgd11.png</file>
<file>asgd12.png</file>
</qresource>
</RCC>
From unetbootin-eeeubuntu.qrc:
<RCC>
<qresource prefix="/" >
<file>eeeubuntu.png</file>
</qresource>
</RCC>
Embedding a disk image will significantly increase the size of your generated unetbootin executable, but will save the user the need to download anything.
You will first want to add the disk image filename (*.iso or *.img) to the .qrc file and place the actual file in the same directory; for example:
From unetbootin-autosupergrubdisk.qrc:
<RCC>
<qresource prefix="/" >
<file>asgd.img</file>
</qresource>
</RCC>
Now you will want to edit distrolist.cpp to have it use the embedded disk image; the file (in this example "mydistro.iso") is accessible via ":/mydistro.iso" when using QFile, or can be coped to another path via instIndvfl("mydistro.iso", targetpath).
If you embedded a floppy disk image, just have it copy it and memdisk to the target drive:
This is for Auto Super Grub Disk:
#ifdef AUTOSUPERGRUBDISK
if (nameDistro == "Auto Super Grub Disk")
{
instIndvfl("memdisk", QString("%1ubnkern").arg(targetPath));
instIndvfl("asgd.img", QString("%1ubninit").arg(targetPath));
}
#endif
If you embedded an iso file as mydistro.iso, use the following code:
#ifdef MYDISTRO
if (nameDistro == "MyDistro")
{
instIndvfl("mydistro.iso", isotmpf);
extractiso(isotmpf, targetPath);
QFile::remove(isotmpf);
}
#endif
From ubnembed.rc:
#define RT_MANIFEST 24
#define APP_MANIFEST 1
APP_MANIFEST RT_MANIFEST unetbootin.exe.manifest
1 VERSIONINFO
FILEVERSION 1,1,1,1
PRODUCTVERSION 1,1,1,1
{
BLOCK "StringFileInfo"
{
BLOCK "040904E4"
{
VALUE "CompanyName", "Geza Kovacs"
VALUE "FileVersion", " "
VALUE "FileDescription", "UNetbootin - Universal Netboot Installer - http://unetbootin.sourceforge.net"
VALUE "InternalName", "UNetbootin - Universal Netboot Installer"
VALUE "LegalCopyright", "Copyright - Geza Kovacs - License - GNU GPL v2+"
VALUE "LegalTrademarks", " "
VALUE "OriginalFilename", "unetbootin.exe"
VALUE "ProductName", "UNetbootin - Universal Netboot Installer"
VALUE "ProductVersion", " "
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 1033, 1252
}
}
Now, you're ready to compile and distribute your custom version of UNetbootin. See the compiling page for instructions. Once you're done, make sure to add your customized version to the list of custom UNetbootin versions and derivatives.
Building a UNetbootin Plugin
List of Custom UNetbootin Versions and Plugins