WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Install dCore-buster64 on hdd in Hyper-V  (Read 2277 times)

Offline GregS

  • Newbie
  • *
  • Posts: 1
Install dCore-buster64 on hdd in Hyper-V
« on: June 06, 2020, 08:09:58 PM »
Hi all, the task I'm trying to get done is as simple as to rollout a tiny proxy service over about 100 VMs which run under Hyper-V. I have not dealt with TCL before so it is something new to me but as far as it does really small footprint it would be much easier to deploy. I noticed that there is a dCore version which supports deb packages and I loved it because then it seems quite easy to complete with my task once I would have got dCore installed onto VM.

I wondering if dCore supports booting from HV hdd?  I ask because if  I boot from ISO I can't see HDD until running sce-import scsi and sce-load scsi. So I guess it will not boot as HDD is required to be seen during boot time. Does it means something need to be done with vmlinuz or/and initramfs? I'm pretty confused here and lack of skills.
Please guide me a bit guys I would really appreciate any help.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: Install dCore-buster64 on hdd in Hyper-V
« Reply #1 on: June 10, 2020, 01:42:50 PM »
Hi Greg.  The following should work if you need scsi drivers in the base dCore*.gz.  The scsi-$kernelversion package has no dependencies, but this method can be used of a package has no dependencies or 100 of them.  Use a running instance of dCore-buster64 to import your package. 

Code: [Select]
sce-import scsi-4.19.10-tinycore64

Now you have an SCE scsi-4.19.10-tinycore64.sce of the package and any of it's dependencies in your SCE directory.

Then,download or place the dCore-buster64.gz in your current directory.  Use the below script to unpack the dCore-buster64.gz, name it perhaps dCore-unpack.sh:

Code: [Select]
#!/bin/sh

CORE="$1"

if [ ! -d rootfs ]; then
mkdir rootfs
else
rm -r rootfs/*
fi

cd rootfs

zcat ../"$CORE" | cpio -i -H newc -d
 
cd -

The use of the script is:

Code: [Select]
dCore-unpack.sh dCore-buster64.gz

That will unpack dCore-buster64.gz into a directory rootfs.

Now you want to copy the desired SCE(s) to the /tmp/builtin directory in the rootfs of what will be your new dCore-buster64.gz.

At the command line:

Code: [Select]
cp /etc/sysconfig/tcedir/sce/scsi-4.19.10-tinycore64.sce* rootfs/tmp/builtin/

Then, use the repack script below, named dCorepack.sh to create the final dCore-buster64.gz:

Code: [Select]
#!/bin/sh

CORE="$1"
REPO=`cat rootfs/usr/share/doc/tc/repo.txt`
RELEASE=`echo dCore-"$REPO":$(date "+%Y.%m.%d.%H.%M")`
echo "$RELEASE" > rootfs/usr/share/doc/tc/release.txt
echo "$RELEASE" > dCore-"$REPO".latest
cd rootfs

find | cpio -o -H newc | gzip -2 > ../"$CORE"
cd ..
md5sum "$CORE" > "$CORE".md5.txt

cd -

Usage is:

Code: [Select]
dCorepack.sh dCore-buster64.gz

Your new dCore-buster.gz now contains the scsi drivers.  This can be used with any needed extra SCEs in base, this is how dCorePlus is made. 





Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: Install dCore-buster64 on hdd in Hyper-V
« Reply #2 on: June 10, 2020, 02:08:54 PM »
Actually, the above works with any needed packages to be available after boot, what you need is for the scsi drivers available in base at boot.  So below is a little different but should suffice. 

With the dCore-buster64.gz in the current directory, do the unpack with the below script, name it dCore-unpack.sh:

Code: [Select]
#!/bin/sh

CORE="$1"

if [ ! -d rootfs ]; then
mkdir rootfs
else
rm -r rootfs/*
fi

cd rootfs

zcat ../"$CORE" | cpio -i -H newc -d
 
cd -

Use the script to unpack the base:

Code: [Select]
dCore-unpack.sh dCore-buster64.gz

Then get the scsi drivers:

Code: [Select]
wget http://tinycorelinux.net/dCore/x86_64/import/scsi-4.19.10-tinycore64.tar.gz

Then untar the drivers into the base in rootfs:

Code: [Select]
tar xvf scsi-4.19.10-tinycore64.tar.gz -C rootfs

Then repack the base with the below script name it dCorepack.sh:

Code: [Select]
#!/bin/sh

CORE="$1"
REPO=`cat rootfs/usr/share/doc/tc/repo.txt`
RELEASE=`echo dCore-"$REPO":$(date "+%Y.%m.%d.%H.%M")`
echo "$RELEASE" > rootfs/usr/share/doc/tc/release.txt
echo "$RELEASE" > dCore-"$REPO".latest
cd rootfs

find | cpio -o -H newc | gzip -2 > ../"$CORE"
cd ..
md5sum "$CORE" > "$CORE".md5.txt

cd -


Usage is:

Code: [Select]
dCorepack.sh dCore-buster64.gz

Now all should be good.  My oversight on the kernel modules needed vs the packages needed on boot. 
« Last Edit: June 10, 2020, 02:12:21 PM by Jason W »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10700
Re: Install dCore-buster64 on hdd in Hyper-V
« Reply #3 on: June 11, 2020, 12:09:08 AM »
Perms note: unpacking and packing operations need to be done as root, otherwise you will get wrong perms/ownership and get issues.
The only barriers that can stop you are the ones you create yourself.