Skip to content

DietPi-Prep | Fix installation for XU3/4/HC1 + some adjustments - #1362

Merged
Fourdee merged 10 commits into
testingfrom
dietpi-prep-kernel-fix
Jan 2, 2018
Merged

Fourdee merged 10 commits into
testingfrom
dietpi-prep-kernel-fix

Conversation

@MichaIng

Copy link
Copy Markdown
Owner

DietPi-Prep

DietPi-Prep
+ Adjust conf.d file naming to 99-dietpi-*, so we can easily find/reset/remove those in the future.
+ Make wget prefer IPv4 failure prove. Maybe we can build a script like this to savely adjust values inside config files, including to option to preserve or overwrite existing values, something like: G_EDIT_CONF -o "prefer-family =" "prefer-family = IPv4" "/etc/wgetrc"
+ Fix https://github.com/Fourdee/DietPi/issues/1285#issuecomment-354602594 by installing kernel/firmware/bootloader packages directly. This allows autoremove of older/different packages.
+ Some typos...
+ Switch to "echo" in forgotten case, before dietpi-globals were loaded.
@k-plan

k-plan commented Jan 1, 2018

Copy link
Copy Markdown
Contributor

@MichaIng

Fix is there #1362

hmm... don't know, if I have do it correct: GIT_BRANCH='ca4a2266ebef775769b4836eab2fbb1b6280e976'

root@DietPi:~# sudo GIT_BRANCH=$GIT_BRANCH ./PREP_SYSTEM_FOR_DIETPI.sh
./PREP_SYSTEM_FOR_DIETPI.sh: line 350: syntax error near unexpected token `done'
./PREP_SYSTEM_FOR_DIETPI.sh: line 350: `        done'

+ Fix missing "fi"
@MichaIng

MichaIng commented Jan 1, 2018 •

Copy link
Copy Markdown
Owner Author

@k-plan
Sorry, commented out an "fi" too much, fixed.

As just the preparation script is modified by this PR, you don't need to adjust the GIT_BRANCH.

Comment thread PREP_SYSTEM_FOR_DIETPI.sh Outdated

#aPACKAGES_REQUIRED_INSTALL+=('linux-image-4.9-armhf-odroid-xu3')
aPACKAGES_REQUIRED_INSTALL+=('linux-image-armhf-odroid-xu3')
G_AGI linux-image-4.9-armhf-odroid-xu3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4.9 testing kernel, is no longer supported via HK or developed, they have switched to 4.14: http://com.odroid.com/sigong/blog/blog_list.php?bid=192

Meveric will provide packages of 4.14 when stable enough for end users. We can then change as needed in future.

Please revert kernel to 3.x (stable, official) linux-image-armhf-odroid-xu3. Users can install 4.9 testing kernel, if needed manually afterwards.

@k-plan k-plan Jan 1, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fourdee

Please revert kernel to 3.x (stable, official)

I think, this was my fault. Sorry.
Yes I have read the HK kernel story. https://github.com/Fourdee/DietPi/issues/1285#issuecomment-354602923

Hmmm ... but Debian Stretch with Kernel 3.x ?

https://wiki.debian.org/DebianStretch#Packages_.26_versions

kernel : Linux 4.9

Have I totally missed something?

If I remember correct, HK kernel 4.9 was their previous testing/stable?

http://com.odroid.com/sigong/blog/blog_list.php?bid=183

This LTS(Long Term Support) kernel 4.9 will be actively updated until early 2019.

What a bullsh....

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@k-plan @Fourdee
Yes, still using 3.x also sounds unreasonable to me. If 4.9 is not supported any more, than 3.x won't be either (for Stretch+), even that Meveric still use this as from naming kinda default.

Meveric does already have 4.14 in it's repo, constantly updating (at least there are already several minor versions), so then I would directly go to 4.14 instead of shipping 3.X and overwriting users/base images newer kernel with this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh ... as I said before Linux Kernel 4.14 Debugging Party

I really don't know ... but it will be your arbitration.

@k-plan k-plan Jan 1, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing to do with HW_MODEL == 11

but on the other hand I can't see any support from HK for newer kernels then 3.x for

Odroid C1/C1+/C0 or C2

can be a argument to stay on 3.x for Odroid XU4/XU3/HC1/MC1 as well.

(and for sure the better mali hardware ffmpeg/kodi/xbmc support as well)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm as for Odroid, the debugging party is over since October, but some people seem to face issues with USB hard drives and UAS enabled. I am not really sure, that UAS is, seems to be a new (faster) USB transfer method or something...

@k-plan k-plan Jan 1, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UAS => come into focus with Odroid HC1 on board SATA Bridge:

JMicron JMS578 USB 3.0 to SATA Bridge with UAS capability to archive near ~300MB/sec transter speed

The reason, why I started to play around with this: https://github.com/Fourdee/DietPi/issues/1268#issuecomment-354499449

What does it profit, if we can't get the speed over the network? For me personally - nothing.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also make a separation between the devices, but as at least Odroid claims all to be compatible vice versa...
For now I will revert to 3.x but include a check to keep newer kernel, if installed, as kernel downgrade is also risky/unsupported and this enables us to also test newer kernels by choosing the related base image.

@k-plan k-plan Jan 1, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on hardware Odroid HC1 (XU4) with based on (NR_4.x)_DietPi_v158_OdroidXU4-armv7-(Jessie).img and it works! 😃

For now I will revert to 3.x but ...

Good idea for now, because the device will not start up after PREP.

  • easy to fix, because boot_xu4.ini from DietPi repro has wrong
    fatload mmc 0:1 0x44000000 exynos5422-odroidxu3.dtb
    Must have fatload mmc 0:1 0x44000000 exynos5422-odroidxu4.dtb for kernel 4.x
    But messing around with such a lot of installation, I know this immediately.

Really nice work 👍
Will test it later with Meveric Jessie (default Kernel 3.x) image

PS: - what not looking "so nice" is autogenerted fstabat the moment.

root@DietPi:~# cat /etc/fstab
#Samba Client------------------------------------------------------
#/mnt/samba . Please use dietpi-config and the Networking Options: NAS menu to setup this mount

#FTP Client Mount--------------------------------------------------
#/mnt/ftp_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount

#NFS Client Mount--------------------------------------------------
#/mnt/nfs_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount

#TMPFS / MISC ------------------------------------------------------
proc            /proc           proc    defaults                                                                                        0 0
tmpfs                   /tmp                    tmpfs   defaults,noatime,nodev,nosuid,mode=1777                         0 0
tmpfs                   /var/log                tmpfs   defaults,size=20m,noatime,nodev,nosuid,mode=1777        0 0
tmpfs                   /DietPi                 tmpfs   defaults,size=10m,noatime,nodev,nosuid,mode=1777        0 0

#Internal Drives---------------------------------------------------
UUID=5886-8548    /boot    auto    defaults,noatime,nofail,discard,x-systemd.automount    0 0
UUID=a4f12232-1670-43f4-8eca-49bfbe4d01ee    /    auto    defaults,noatime,nofail,discard    0 0

But it's only cosmetic. Before boot device mmc/eMMC was in first line. But anyway, yes their are #Internal Drives

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. This will basically keep the currently installed kernel, as on working devices there should always be one installed.
So if we have a C1/C2 etc. image with preinstalled 3.X kernel, it will stay. If they run a current XUX/HC1 image with 4.14, it will stay as well.

This is maybe not the best solution, as we loose control about which kernel people use, thus which kernel related errors they might face, but it prevents downgrade at least, which might be an error source as well.

+ Fixed typo, leading to not removed APT norecommends config.
@MichaIng

MichaIng commented Jan 1, 2018

Copy link
Copy Markdown
Owner Author

Works now, tested with Jessie and Stretch on VirtualBox via mini.iso images. Buster is not possible at the moment. Kernel on repo was updated to 4.14 but the installer wants to see 4.12. Need to wait for new buster mini.iso.

+ Keeping currently installed kernel on Odroid devices, install linux-image-armhf-odroid-xu3 otherwise.
@k-plan

k-plan commented Jan 1, 2018 •

Copy link
Copy Markdown
Contributor
GIT_BRANCH='b02674eca84ff097b36bbf334db828bc3ddc3a95'

root@odroid-jessie:~# GIT_BRANCH=$GIT_BRANCH ./PREP_SYSTEM_FOR_DIETPI.sh
./PREP_SYSTEM_FOR_DIETPI.sh: line 561: unexpected EOF while looking for matching `)'
./PREP_SYSTEM_FOR_DIETPI.sh: line 1324: syntax error: unexpected end of file

Sorry. In 1324 lines of bash code I never ever will find the fault. 😢

+ Add missing ")"
@MichaIng

MichaIng commented Jan 2, 2018

Copy link
Copy Markdown
Owner Author

@k-plan
Thx, fixed, I should really avoid last minute late night fixes 😅.

@Fourdee

Fourdee commented Jan 2, 2018

Copy link
Copy Markdown
Collaborator

@MichaIng
@k-plan

Online bash error checker:
https://www.shellcheck.net/

image

Just dont run dietpi-software through it 🤣 ⏳

Comment thread PREP_SYSTEM_FOR_DIETPI.sh Outdated
aPACKAGES_REQUIRED_INSTALL+=('linux-image-armhf-odroid-xu3')
#G_AGI linux-image-4.9-armhf-odroid-xu3
G_AGI $(dpkg --get-selections | grep "linux-image*" | awk '{print $1}')
[ ! -n "$(dpkg --get-selections | grep "linux-image*") ] && G_AGI linux-image-armhf-odroid-xu3

@Fourdee Fourdee Jan 2, 2018 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing ":
Try string quote the whole command

"$(dpkg --get-selections | grep linux-image*)"

+ Real fix Odroid kernel handling
@MichaIng

MichaIng commented Jan 2, 2018 •

Copy link
Copy Markdown
Owner Author

@Fourdee
Fixed, back home again and checked on machine. Thanks for spellchecker link, will use it from now on.

Nice checker actually, gives also interesting hints within the whole script. Could be worth to check and optimize all scripts with it, especially dietpi-software 😆.

@MichaIng

MichaIng commented Jan 2, 2018

Copy link
Copy Markdown
Owner Author

Retested, from step seven on some errors appear that we should mute:

 [   Info   ] Configuring regional settings (Locale):
*** update-locale: Error: invalid locale settings:  LANG=0.UTF-8
 [    Ok    ] dpkg-reconfigure -f noninteractive locales

...

 DietPi
─────────────────────────────────────────────────────
 Mode: Disable swapfile

/sbin/dphys-swapfile: 1: /etc/dphys-swapfile: : not found
 [   Info   ] Deleting existing swapfile ()

dphys-swapfile.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable dphys-swapfile
 [   Info   ] Completed

 [   Info   ] Resetting boot.ini, config.txt, cmdline.txt etc
 [   Info   ] Generating default wpa_supplicant.conf
 [   Info   ] DietPi-Globals loaded

 [    Ok    ] Root access verified.
 [   Info   ] DietPi-Globals loaded

 [   Info   ] Checking RootFS R/W access. Please wait...
 [    Ok    ] RootFS R/W access.


 DietPi-Set_Hardware
─────────────────────────────────────────────────────
 Mode: wificreds (set)

/DietPi/dietpi/func/dietpi-set_hardware: line 1446: /etc/wpa_supplicant/wpa_supplicant.conf: No such file or directory
/DietPi/dietpi/func/dietpi-set_hardware: line 1464: /etc/wpa_supplicant/wpa_supplicant.conf: No such file or directory

...

 [   Info   ] Resetting DietPi generated globals/files
rm: cannot remove '/DietPi/dietpi/.': Is a directory
rm: cannot remove '/DietPi/dietpi/..': Is a directory

@Fourdee

Fourdee commented Jan 2, 2018 •

Copy link
Copy Markdown
Collaborator

@MichaIng

[ Info ] Configuring regional settings (Locale):
*** update-locale: Error: invalid locale settings: LANG=0.UTF-8
[ Ok ] dpkg-reconfigure -f noninteractive locales

Is en_GB.UTF-8 set after this? If so we probably dont need the command update-locale at all, or maybe after dpkg reconfigure?
Wasnt sure ^^

/sbin/dphys-swapfile: 1: /etc/dphys-swapfile: : not found

🈯️ fixed in: Fourdee@db7d0cf
I've also removed the unneeded lines in this PR

[ Info ] Resetting DietPi generated globals/files
rm: cannot remove '/DietPi/dietpi/.': Is a directory
rm: cannot remove '/DietPi/dietpi/..': Is a directory

Due to rm /DietPi/dietpi/.* on hidden files

  • can we exclude . .. in checks?
  • /dev/null redirect?

@MichaIng

MichaIng commented Jan 2, 2018

Copy link
Copy Markdown
Owner Author

@Fourdee
Afterwards en_GB.UTF-8 UTF-8 seems to be set, or at least it appears in the list, actually two times for me (again at the bottom).
Also the commands do not produce an error any more. Not sure, if it is a problem, but we should try to hide the error(s) anyway.

Could switch to bulletproof sed:
grep -q '^[[:blank:]]*en_GB.UTF-8 UTF-8' /etc/locale.gen ||
grep -q '^[[:blank:]#;]*en_GB.UTF-8 UTF-8' /etc/locale.gen &&
sed -i '/^[[:blank:]#;]*en_GB.UTF-8 UTF-8/c\en_GB.UTF-8 UTF-8' /etc/locale.gen ||
echo 'en_GB.UTF-8 UTF-8' >> /etc/locale.gen

Default conf now generated inside script: Fourdee@db7d0cf
@MichaIng

MichaIng commented Jan 2, 2018 •

Copy link
Copy Markdown
Owner Author

@another issue, I already recognized on earlier tries and forgot to mention: Somehow the G_HW_ARCH recognition doesn't work sometimes:

 [   Info   ] -----------------------------------------------------------------------------------
 [    Ok    ] Step 2: Hardware selection:
 [   Info   ] -----------------------------------------------------------------------------------
 [   Info   ] Setting G_HW_MODEL index of: 20
 [   Info   ] CPU ARCH = 0 : x86_64

At the beginning it is clearly selected. I just checked: The sourcing dietpi-globals at the beginning of script leads to a value of "0" again. After the whole script, value is correctly set.

€: About locales:
locale-gen (generating locales based on /etc/locale.gen) and update-locale (adding locale setting to /etc/default/locale) is both included in dpkg-reconfigure locales

To make it easy I changed it now to:

echo 'en_GB.UTF-8 UTF-8' > /etc/locale.gen
G_RUN_CMD dpkg-reconfigure -f noninteractive locales

This will also add the commented list to /etc/locale.gen again, so no need so sed here.

€€: And finally fixed the rm -R ./.. error:
https://unix.stackexchange.com/a/310763
&> /dev/null would have also worked, but as the other solution is simple as well...

MichaIng added 2 commits January 2, 2018 15:11
+ Fix locales setting
+ Fix rm -R ./.. error.
@MichaIng

MichaIng commented Jan 2, 2018

Copy link
Copy Markdown
Owner Author

@Fourdee
You wan't to review the latest commits? Want to merge, to make testing live easier for @k-plan 😄.

@Fourdee

Fourdee commented Jan 2, 2018 •

Copy link
Copy Markdown
Collaborator

@MichaIng

issue, I already recognized on earlier tries and forgot to mention: Somehow the G_HW_ARCH recognition doesn't work sometimes:

👍
Fixed with : Fourdee@5d5a3dc

You wan't to review the latest commits? Want to merge, to make testing live easier for @k-plan

Lol, @k-plan had bad experience lately ❤️ 😄. Yep, lets fix it 😃

@Fourdee
Fourdee merged commit 9fbcd17 into testing Jan 2, 2018
@Fourdee

Fourdee commented Jan 2, 2018

Copy link
Copy Markdown
Collaborator

@MichaIng

Legend, great work 👍

@MichaIng
MichaIng deleted the dietpi-prep-kernel-fix branch January 2, 2018 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants