Skip to content

Commit

Permalink
add support for 20.04 and large iso
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoqiang committed Jun 8, 2020
1 parent 01e15df commit e8458a4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
4 changes: 2 additions & 2 deletions systemback/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 9),
libblkid-dev,
libmount-dev,
libncursesw5-dev,
libparted0-dev,
libparted-dev,
qtbase5-dev,
qttools5-dev-tools
Standards-Version: 3.9.7
Expand All @@ -18,7 +18,7 @@ Depends: ${misc:Depends},
casper | live-boot,
dosfstools,
fonts-freefont-ttf | ttf-freefont,
genisoimage,
xorriso,
squashfs-tools,
syslinux,
syslinux (<< 3:5) | isolinux (>> 3:6),
Expand Down
2 changes: 1 addition & 1 deletion systemback/libsystemback/sblib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ uchar sb::exec(cQStr &cmd, uchar flag, cQStr &envv)
else
{
silent = flag != (flag & ~Silent), wait = flag != (flag & ~Wait);
if((rprcnt = (bckgrnd = flag != (flag & ~Bckgrnd)) || wait || flag == (flag & ~Prgrss) ? 0 : cmd.startsWith("mksquashfs") ? 1 : cmd.startsWith("genisoimage") ? 2 : cmd.startsWith("tar -cf") ? 3 : cmd.startsWith("tar -xf") ? 4 : 0)) Progress = 0;
if((rprcnt = (bckgrnd = flag != (flag & ~Bckgrnd)) || wait || flag == (flag & ~Prgrss) ? 0 : cmd.startsWith("mksquashfs") ? 1 : cmd.startsWith("xorriso") ? 2 : cmd.startsWith("tar -cf") ? 3 : cmd.startsWith("tar -xf") ? 4 : 0)) Progress = 0;
}

QProcess proc;
Expand Down
11 changes: 7 additions & 4 deletions systemback/systemback/systemback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,8 @@ void systemback::unitimer()

if(ui->installpanel->isVisible())
{
ui->usernamepipe->show();
ui->fullnamepipe->show();
if(ui->installmenu->isEnabled() && ui->fullnamepipe->isVisible() && ui->usernamepipe->isVisible() && ui->hostnamepipe->isVisible() && ui->passwordpipe->isVisible() && (ui->rootpassword1->text().isEmpty() || ui->rootpasswordpipe->isVisible()) && ! ui->installnext->isEnabled()) ui->installnext->setEnabled(true);
}
else if(ui->livepanel->isVisible())
Expand Down Expand Up @@ -5446,7 +5448,7 @@ void systemback::on_livelist_currentItemChanged(QLWI *crrnt)
if(! ui->livedelete->isEnabled()) ui->livedelete->setEnabled(true);
ullong isize(sb::fsize(sb::sdir[2] % '/' % sb::left(crrnt->text(), sb::instr(crrnt->text(), " ") - 1) % ".sblive"));

if(isize && isize < 4294967295 && isize * 2 + 104857600 < sb::dfree(sb::sdir[2]) && ! sb::exist(sb::sdir[2] % '/' % sb::left(crrnt->text(), sb::instr(crrnt->text(), " ") - 1) % ".iso"))
if(isize && isize * 2 + 104857600 < sb::dfree(sb::sdir[2]) && ! sb::exist(sb::sdir[2] % '/' % sb::left(crrnt->text(), sb::instr(crrnt->text(), " ") - 1) % ".iso"))
{
if(! ui->liveconvert->isEnabled()) ui->liveconvert->setEnabled(true);
}
Expand Down Expand Up @@ -7445,9 +7447,10 @@ void systemback::on_livenew_clicked()
pset(20, " 4/3+1"),
sb::Progress = -1;
if(! (sb::rename(sb::sdir[2] % "/.sblivesystemcreate/syslinux/syslinux.cfg", sb::sdir[2] % "/.sblivesystemcreate/syslinux/isolinux.cfg") && sb::rename(sb::sdir[2] % "/.sblivesystemcreate/syslinux", sb::sdir[2] % "/.sblivesystemcreate/isolinux")) || intrrpt) return err();
if(! sb::copy("/usr/lib/ISOLINUX/isohdpfx.bin", sb::sdir[2] % "/.sblivesystemcreate/isolinux/isohdpfx.bin")) return err();
ui->progressbar->setValue(0);

if(sb::exec("genisoimage -r -V sblive -cache-inodes -J -l -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -c isolinux/boot.cat -o \"" % sb::sdir[2] % "\"/" % ifname % ".iso \"" % sb::sdir[2] % "\"/.sblivesystemcreate", sb::Prgrss))
if(sb::exec("xorriso -as mkisofs -V sblive -cache-inodes -J -R -isohybrid-mbr \"" % sb::sdir[2] % "/.sblivesystemcreate/isolinux/isohdpfx.bin\" -c isolinux/boot.cat -b isolinux/isolinux.bin -iso-level 3 -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -o \"" % sb::sdir[2] % "\"/" % ifname % ".iso \"" % sb::sdir[2] % "\"/.sblivesystemcreate", sb::Prgrss))
{
if(sb::isfile(sb::sdir[2] % '/' % ifname % ".iso")) sb::remove(sb::sdir[2] % '/' % ifname % ".iso");
return err(312);
Expand Down Expand Up @@ -7482,11 +7485,11 @@ void systemback::on_liveconvert_clicked()
sb::ThrdLng[0] = sb::fsize(path % ".sblive"), sb::ThrdStr[0] = sb::sdir[2] % "/.sblivesystemconvert";
if(sb::exec("tar -xf \"" % path % "\".sblive -C \"" % sb::sdir[2] % "\"/.sblivesystemconvert --no-same-owner --no-same-permissions", sb::Prgrss)) return err(326);
if(! (sb::rename(sb::sdir[2] % "/.sblivesystemconvert/syslinux/syslinux.cfg", sb::sdir[2] % "/.sblivesystemconvert/syslinux/isolinux.cfg") && sb::rename(sb::sdir[2] % "/.sblivesystemconvert/syslinux", sb::sdir[2] % "/.sblivesystemconvert/isolinux")) || intrrpt) return err(324);
if(! sb::copy("/usr/lib/ISOLINUX/isohdpfx.bin", sb::sdir[2] % "/.sblivesystemconvert/isolinux/isohdpfx.bin")) return err(324);
pset(21, " 2/2"),
sb::Progress = -1,
ui->progressbar->setValue(0);
if(sb::exec("genisoimage -r -V sblive -cache-inodes -J -l -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -c isolinux/boot.cat -o \"" % path % "\".iso \"" % sb::sdir[2] % "\"/.sblivesystemconvert", sb::Prgrss)) return err(325);
if(sb::exec("isohybrid \"" % path % "\".iso") || ! cfmod(path % ".iso", 0666)) return err();
if(sb::exec("xorriso -as mkisofs -V sblive -cache-inodes -J -R -isohybrid-mbr \"" % sb::sdir[2] % "/.sblivesystemconvert/isolinux/isohdpfx.bin\" -c isolinux/boot.cat -b isolinux/isolinux.bin -iso-level 3 -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -o \"" % path % "\".iso \"" % sb::sdir[2] % "\"/.sblivesystemconvert", sb::Prgrss)) return err(325);
sb::remove(sb::sdir[2] % "/.sblivesystemconvert");
if(intrrpt) return err();
emptycache(),
Expand Down
9 changes: 9 additions & 0 deletions systemback/systemback/systemback.ui
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="text">
<string>xiaoqiang</string>
</property>
<property name="maxLength">
<number>80</number>
</property>
Expand Down Expand Up @@ -449,6 +452,9 @@
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="text">
<string>xiaoqiang</string>
</property>
<property name="maxLength">
<number>32</number>
</property>
Expand Down Expand Up @@ -5330,6 +5336,9 @@
<property name="text">
<string>Copy user data files</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
<widget class="QComboBox" name="grubinstallcopy">
<property name="geometry">
Expand Down

0 comments on commit e8458a4

Please sign in to comment.