Skip to content

Commit

Permalink
Update InstallNET.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
veip007 authored Oct 10, 2023
1 parent c54ccc9 commit 3ea4bdc
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions InstallNET.sh
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ if [[ -n "$tmpDIST" ]]; then
[[ "$isDigital" == '9' ]] && DIST='stretch';
[[ "$isDigital" == '10' ]] && DIST='buster';
[[ "$isDigital" == '11' ]] && DIST='bullseye';
# [[ "$isDigital" == '12' ]] && DIST='bookworm';
[[ "$isDigital" == '12' ]] && DIST='bookworm';
}
}
LinuxMirror=$(selectMirror "$Relese" "$DIST" "$VER" "$tmpMirror")
Expand Down Expand Up @@ -611,15 +611,18 @@ for COMP in `echo -en 'gzip\nlzma\nxz'`
$UNCOMP < /tmp/$NewIMG | cpio --extract --verbose --make-directories --no-absolute-filenames >>/dev/null 2>&1

if [[ "$linux_relese" == 'debian' ]] || [[ "$linux_relese" == 'ubuntu' ]]; then
CurrentKernelVersion=`ls -1 ./lib/modules 2>/dev/null |head -n1`
[ -n "$CurrentKernelVersion" ] && SelectLowmem="di-utils-exit-installer,driver-injection-disk-detect,fdisk-udeb,netcfg-static,parted-udeb,partman-auto,partman-ext3,ata-modules-${CurrentKernelVersion}-di,efi-modules-${CurrentKernelVersion}-di,sata-modules-${CurrentKernelVersion}-di,scsi-modules-${CurrentKernelVersion}-di,scsi-nic-modules-${CurrentKernelVersion}-di" || SelectLowmem=""
cat >/tmp/boot/preseed.cfg<<EOF
d-i debian-installer/locale string en_US
d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/country string US
d-i debian-installer/language string en
d-i console-setup/layoutcode string us
d-i keyboard-configuration/xkb-keymap string us
d-i lowmem/low note
d-i anna/choose_modules_lowmem multiselect $SelectLowmem
d-i netcfg/choose_interface select $interfaceSelect
Expand Down Expand Up @@ -680,6 +683,7 @@ tasksel tasksel/first multiselect minimal
d-i pkgsel/update-policy select none
d-i pkgsel/include string openssh-server
d-i pkgsel/upgrade select none
d-i apt-setup/services-select multiselect
popularity-contest popularity-contest/participate boolean false
Expand Down Expand Up @@ -779,21 +783,22 @@ EOF
fi

find . | cpio -H newc --create --verbose | gzip -9 > /tmp/initrd.img;
cp -f /tmp/initrd.img /boot/initrd.img || sudo cp -f /tmp/initrd.img /boot/initrd.img
cp -f /tmp/vmlinuz /boot/vmlinuz || sudo cp -f /tmp/vmlinuz /boot/vmlinuz

chown root:root $GRUBDIR/$GRUBFILE
chmod 444 $GRUBDIR/$GRUBFILE

if [[ "$loaderMode" == "0" ]]; then
cp -f /tmp/initrd.img /boot/initrd.img || sudo cp -f /tmp/initrd.img /boot/initrd.img
cp -f /tmp/vmlinuz /boot/vmlinuz || sudo cp -f /tmp/vmlinuz /boot/vmlinuz

chown root:root $GRUBDIR/$GRUBFILE
chmod 444 $GRUBDIR/$GRUBFILE

sleep 3 && reboot || sudo reboot >/dev/null 2>&1
else
rm -rf "$HOME/loader"
mkdir -p "$HOME/loader"
cp -rf "/boot/initrd.img" "$HOME/loader/initrd.img"
cp -rf "/boot/vmlinuz" "$HOME/loader/vmlinuz"
[[ -f "/boot/initrd.img" ]] && rm -rf "/boot/initrd.img"
[[ -f "/boot/vmlinuz" ]] && rm -rf "/boot/vmlinuz"
cp -rf "/tmp/initrd.img" "$HOME/loader/initrd.img"
cp -rf "/tmp/vmlinuz" "$HOME/loader/vmlinuz"
rm -rf "/tmp/initrd.img"
rm -rf "/tmp/vmlinuz"
echo && ls -AR1 "$HOME/loader"
fi

0 comments on commit 3ea4bdc

Please sign in to comment.