|
|
|
@ -107,7 +107,7 @@ if(defined $data{arg}{'vars'}){
|
|
|
|
|
if(!packsystem()){
|
|
|
|
|
beep();
|
|
|
|
|
}
|
|
|
|
|
}elsif(defined $data{arg}{iso} || defined $data{arg}{rescratch}){
|
|
|
|
|
}elsif(defined $data{arg}{iso} || defined $data{arg}{rebuild}){
|
|
|
|
|
if(!createiso()){
|
|
|
|
|
beep();
|
|
|
|
|
}
|
|
|
|
@ -263,7 +263,7 @@ sub getarg{
|
|
|
|
|
"m" => '', "make" => '',
|
|
|
|
|
"p" => '', "pack" => '',
|
|
|
|
|
"iso" => '',
|
|
|
|
|
"rescratch" => '',
|
|
|
|
|
"rebuild" => '',
|
|
|
|
|
"break" => '',
|
|
|
|
|
"L" => '',
|
|
|
|
|
"M" => '',
|
|
|
|
@ -429,7 +429,7 @@ sub getarg{
|
|
|
|
|
$data{CHECKSYSTEM_NOMES}++; $data{builder}++;
|
|
|
|
|
$data{createiso}++;
|
|
|
|
|
}
|
|
|
|
|
if(defined $data{arg}{'rescratch'}){
|
|
|
|
|
if(defined $data{arg}{'rebuild'}){
|
|
|
|
|
$data{CHECKSYSTEM_NOMES}++; $data{builder}++;
|
|
|
|
|
$data{createiso}++;
|
|
|
|
|
}
|
|
|
|
@ -523,7 +523,7 @@ sub getarg{
|
|
|
|
|
printmes(" -m, --make\t\t"); printmes(gettext('make system')."\n");
|
|
|
|
|
printmes(" -p, --pack\t\t"); printmes(gettext('pack the distribution package into the archive file')."\n");
|
|
|
|
|
printmes(" --iso\t\t\t"); printmes(gettext('create a loaded iso-image of system')."\n");
|
|
|
|
|
printmes(" --rescratch\t\t"); printmes(gettext('regenerate squashfs image on flash')."\n");
|
|
|
|
|
printmes(" --rebuild\t\t"); printmes(gettext('regenerate squashfs image on flash')."\n");
|
|
|
|
|
printmes(" --break\t\t"); printmes(gettext('break the system building')."\n");
|
|
|
|
|
|
|
|
|
|
printmes("\n".gettext('Additions assemble').":\n");
|
|
|
|
@ -1557,7 +1557,7 @@ sub checksystem{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
$data{squash_del} = "";
|
|
|
|
|
if(-e "/mnt/flash/" && defined $data{arg}{rescratch}){
|
|
|
|
|
if(-e "/mnt/flash/" && defined $data{arg}{rebuild}){
|
|
|
|
|
opendir(F, "/mnt/flash/");
|
|
|
|
|
foreach(readdir F){
|
|
|
|
|
if($_ eq "." || $_ eq ".."){next;}
|
|
|
|
@ -3231,11 +3231,11 @@ sub profiles{
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
sub isotosys{
|
|
|
|
|
#подготовим флешку к загрузке
|
|
|
|
|
if(($data{type} eq "flash" || defined $data{arg}{rescratch}) &&
|
|
|
|
|
if(($data{type} eq "flash" || defined $data{arg}{rebuild}) &&
|
|
|
|
|
!-e "$data{'chroot'}$target/syslinux" #проверим установку с флешки на флешку
|
|
|
|
|
){
|
|
|
|
|
my $target;
|
|
|
|
|
if(defined $data{arg}{rescratch}){
|
|
|
|
|
if(defined $data{arg}{rebuild}){
|
|
|
|
|
$target = "/target";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -5142,7 +5142,7 @@ sub umount_build_dirs{
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
sub createiso{
|
|
|
|
|
#проверим что система загружена в Scratch режиме и на флешке
|
|
|
|
|
if(defined $data{arg}{rescratch} &&
|
|
|
|
|
if(defined $data{arg}{rebuild} &&
|
|
|
|
|
($data{scratch} ne "on" || $data{load} ne "ram" || !-e "/mnt/flash")){
|
|
|
|
|
printmes(gettext('Error')."! ");
|
|
|
|
|
printmes(gettext('The computer must be load in to the flash from Scratch mode')); printmes(".\n");
|
|
|
|
@ -5210,7 +5210,7 @@ sub createiso{
|
|
|
|
|
my $target = "$data{tmpdir}/livecd/target";
|
|
|
|
|
my $copyflash;
|
|
|
|
|
my $isolinux = "isolinux";
|
|
|
|
|
if(defined $data{arg}{rescratch}){
|
|
|
|
|
if(defined $data{arg}{rebuild}){
|
|
|
|
|
$copyflash = "&& cp -r $target/* /mnt/flash/";
|
|
|
|
|
$isolinux = "syslinux";
|
|
|
|
|
}
|
|
|
|
@ -5233,7 +5233,7 @@ sub createiso{
|
|
|
|
|
|
|
|
|
|
#создадим livecd.squashfs
|
|
|
|
|
my $squashfile;
|
|
|
|
|
if(!defined $data{arg}{rescratch}){
|
|
|
|
|
if(!defined $data{arg}{rebuild}){
|
|
|
|
|
$squashfile = "$data{tmpdir}/livecd/target/$data{squash_cur}";
|
|
|
|
|
}else{
|
|
|
|
|
$squashfile = "/mnt/flash/$data{squash_cur}"
|
|
|
|
@ -5267,7 +5267,7 @@ sub createiso{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#создадим iso-образ
|
|
|
|
|
if(!defined $data{arg}{rescratch}){
|
|
|
|
|
if(!defined $data{arg}{rebuild}){
|
|
|
|
|
printmes(" ".gettext('Create iso-image')); printmes("...");
|
|
|
|
|
chdir("$data{tmpdir}/livecd");
|
|
|
|
|
if(system("mkisofs -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -iso-level 4 -hide boot.catalog -o $data{linuxdir}/$data{iso} target/ &>/dev/null")){
|
|
|
|
@ -5288,14 +5288,14 @@ sub createiso{
|
|
|
|
|
return "";
|
|
|
|
|
}else{
|
|
|
|
|
#delete old squashfs
|
|
|
|
|
if(defined $data{arg}{rescratch} && $data{squash_del}){
|
|
|
|
|
if(defined $data{arg}{rebuild} && $data{squash_del}){
|
|
|
|
|
`rm /mnt/flash/$data{squash_del}`;
|
|
|
|
|
}
|
|
|
|
|
printmes(" ".gettext('done')); printmes(".\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#Создадим DIGESTS-файл
|
|
|
|
|
if(!defined $data{arg}{rescratch}){
|
|
|
|
|
if(!defined $data{arg}{rebuild}){
|
|
|
|
|
printmes(" ".gettext('Create')); printmes(" DIGESTS "); printmes(gettext('file')); printmes("...");
|
|
|
|
|
if(create_digests("$data{linuxdir}/$data{iso}")){
|
|
|
|
|
printmes(" ".gettext('done')); printmes(".\n");
|
|
|
|
@ -5305,7 +5305,7 @@ sub createiso{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#синхронизируем флешку, т.к. отмонтировать диск при перезагрузке не получится
|
|
|
|
|
if(defined $data{arg}{rescratch}){
|
|
|
|
|
if(defined $data{arg}{rebuild}){
|
|
|
|
|
printmes(" ".gettext('Sync file systems')); printmes("...");
|
|
|
|
|
`sync`;
|
|
|
|
|
printmes(" ".gettext('done')); printmes(".\n");
|
|
|
|
|